kboot: Save notch height in dcp node

DCP will use this information to provide "notch-less" display modes.

Signed-off-by: Janne Grunau <j@jannau.net>
This commit is contained in:
Janne Grunau 2022-10-25 08:04:22 +02:00 committed by Hector Martin
parent 53e6254497
commit 0bb521c2c3

View file

@ -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 // We do not need to reserve the framebuffer, as it will be excluded from the usable RAM
// range already. // 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"); int ipd = adt_path_offset(adt, "/arm-io/spi3/ipd");
if (ipd < 0) if (ipd < 0)