Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33413 )
Change subject: mb/google/kukui: Add panels for Krane ......................................................................
Patch Set 25: Code-Review+1
(1 comment)
https://review.coreboot.org/c/coreboot/+/33413/15/src/mainboard/google/kukui... File src/mainboard/google/kukui/panel_krane.c:
https://review.coreboot.org/c/coreboot/+/33413/15/src/mainboard/google/kukui... PS15, Line 357: static struct panel_description *krane_panels[] = {
I did some experiment and found it not being very easy/clean at the moment. […]
Well... even with 8 byte per command some of your panels take up multiple KB right now. I think it would quickly become worth it. But I think it's okay to check these in like this and then do that later (if you hopefully still have time).
For loading, just allocate a big buffer that can easily hold your biggest panel. BSS is (relatively) cheap. It should just need something like
struct panel_description *get_panel_description(int panel_id) { char filename[64]; static u8 buffer[4*KiB]; /* ...maybe cache result if you want to call this more than once... */ if (!snprintf(filename, sizeof(filename), "panel-description-%d", panel_id) || !cbfs_boot_load_file(filename, buffer, sizeof(buffer), CBFS_TYPE_STRUCT)) return NULL; return (struct panel_description *)buffer; }