From e366ba14eb99c58b074dd9c31460e8165f0ecc0d Mon Sep 17 00:00:00 2001 From: Hung-Te Lin Date: Wed, 7 Aug 2019 16:28:08 +0800 Subject: soc/mediatek: Change DSI init commands to take flexible length array The fixed size of init command in lcm_init_table is wasting lots of space and we should change to packed array since the command buffer already provides length information. With this change, BOE panel init commands have been reduced from 4848 bytes to 1309 bytes. BUG=b:80501386,b:117254947 TEST=emerge-kukui coreboot chromeos-bootimage; Boots properly Change-Id: I359dde8e6f2e1c0983f4677193bb47a7ae497ca6 Signed-off-by: Hung-Te Lin Reviewed-on: https://review.coreboot.org/c/coreboot/+/34778 Reviewed-by: Julius Werner Tested-by: build bot (Jenkins) --- src/mainboard/google/kukui/panel.h | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'src/mainboard/google') diff --git a/src/mainboard/google/kukui/panel.h b/src/mainboard/google/kukui/panel.h index e68567ddd4..321e3662a3 100644 --- a/src/mainboard/google/kukui/panel.h +++ b/src/mainboard/google/kukui/panel.h @@ -23,27 +23,28 @@ struct panel_description { struct edid edid; /* edid info of this panel */ enum lb_fb_orientation orientation; /* panel orientation */ void (*power_on)(void); /* Callback to turn on panel */ - struct lcm_init_command init[]; /* table of init commands */ + u8 init[]; /* a packed array of lcm_init_command */ }; /* Returns the panel description from given ID. */ extern struct panel_description *get_panel_description(int panel_id); -#define INIT_DCS_CMD(...) { \ - .cmd = LCM_DCS_CMD, \ - .len = sizeof((u8[]){__VA_ARGS__}), \ - .data = {__VA_ARGS__} } +#define INIT_DCS_CMD(...) \ + LCM_DCS_CMD, \ + sizeof((u8[]){__VA_ARGS__}), \ + __VA_ARGS__ -#define INIT_GENERIC_CMD(...) { \ - .cmd = LCM_GENERIC_CMD, \ - .len = sizeof((u8[]){__VA_ARGS__}), \ - .data = {__VA_ARGS__} } +#define INIT_GENERIC_CMD(...) \ + LCM_GENERIC_CMD, \ + sizeof((u8[]){__VA_ARGS__}), \ + __VA_ARGS__ -#define INIT_DELAY_CMD(delay) { \ - .cmd = LCM_DELAY_CMD,\ - .len = delay, } +#define INIT_DELAY_CMD(delay) \ + LCM_DELAY_CMD, \ + delay -#define INIT_END_CMD { .cmd = LCM_END_CMD, } +#define INIT_END_CMD \ + LCM_END_CMD /* GPIO names */ #define GPIO_LCM_RST_1V8 GPIO(LCM_RST) /* 45 */ -- cgit v1.2.3