From 0bb521c2c3d7927af04bb1ba5a6cc3595c17c802 Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Tue, 25 Oct 2022 08:04:22 +0200 Subject: [PATCH] kboot: Save notch height in dcp node DCP will use this information to provide "notch-less" display modes. Signed-off-by: Janne Grunau --- src/kboot.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/kboot.c b/src/kboot.c index 77e1148d..347ae47d 100644 --- a/src/kboot.c +++ b/src/kboot.c @@ -240,7 +240,19 @@ static int dt_set_chosen(void) // We do not need to reserve the framebuffer, as it will be excluded from the usable RAM // range already. + + // save notch height in the dcp node if present + if (cur_boot_args.video.height - fb_height) { + int dcp = fdt_path_offset(dt, "dcp"); + if (dcp >= 0) + if (fdt_appendprop_u32(dt, dcp, "apple,notch-height", + cur_boot_args.video.height - fb_height)) + printf("FDT: couldn't set apple,notch-height\n"); + } } + node = fdt_path_offset(dt, "/chosen"); + if (node < 0) + bail("FDT: /chosen node not found in devtree\n"); int ipd = adt_path_offset(adt, "/arm-io/spi3/ipd"); if (ipd < 0)