Attention is currently required from: Hung-Te Lin, Yu-Ping Wu. Hello Hung-Te Lin, Yu-Ping Wu,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/57324
to review the following change.
Change subject: drivers/mipi: Orientation is a property of the mainboard, not the panel ......................................................................
drivers/mipi: Orientation is a property of the mainboard, not the panel
It doesn't make sense to store the orientation field directly in the panel information structure, which is supposed to be reuseable between different boards. The thing that determines orientation is how that panel is built into the board in question, which only the board itself can know. The same portrait panel could be rotated left to be used as landscape in one board and rotated right to be used as landscape in another. This patch moves the orientation field out of the panel structure back into the mainboards to reflect this.
Signed-off-by: Julius Werner jwerner@chromium.org Change-Id: If2b716aa4dae036515730c12961fdd8a9ac34753 --- M src/drivers/mipi/panel-AUO_B101UAN08_3.c M src/drivers/mipi/panel-AUO_KD101N80_45NA.c M src/drivers/mipi/panel-BOE_TV101WUM_N53.c M src/drivers/mipi/panel-BOE_TV101WUM_NL6.c M src/drivers/mipi/panel-BOE_TV105WUM_NW0.c M src/drivers/mipi/panel-CMN_P097PFG_SSD2858.c M src/drivers/mipi/panel-STA_2081101QFH032011_53G.c M src/drivers/mipi/panel-VIS_RM69299.c M src/include/mipi/panel.h M src/mainboard/google/kukui/panel.h M src/mainboard/google/kukui/panel_anx7625.c M src/mainboard/google/kukui/panel_flapjack.c M src/mainboard/google/kukui/panel_kakadu.c M src/mainboard/google/kukui/panel_katsu.c M src/mainboard/google/kukui/panel_kodama.c M src/mainboard/google/kukui/panel_krane.c M src/mainboard/google/kukui/panel_kukui.c M src/mainboard/google/kukui/panel_ps8640.c M src/mainboard/google/trogdor/mainboard.c 19 files changed, 22 insertions(+), 33 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/57324/1
diff --git a/src/drivers/mipi/panel-AUO_B101UAN08_3.c b/src/drivers/mipi/panel-AUO_B101UAN08_3.c index 8eeac85..5144ce5 100644 --- a/src/drivers/mipi/panel-AUO_B101UAN08_3.c +++ b/src/drivers/mipi/panel-AUO_B101UAN08_3.c @@ -18,7 +18,6 @@ .x_mm = 135, .y_mm = 216, }, }, - .orientation = LB_FB_ORIENTATION_LEFT_UP, .init = { PANEL_DELAY(24), PANEL_DCS(0xB0, 0x01), diff --git a/src/drivers/mipi/panel-AUO_KD101N80_45NA.c b/src/drivers/mipi/panel-AUO_KD101N80_45NA.c index 436940c..6055097 100644 --- a/src/drivers/mipi/panel-AUO_KD101N80_45NA.c +++ b/src/drivers/mipi/panel-AUO_KD101N80_45NA.c @@ -18,7 +18,6 @@ .x_mm = 135, .y_mm = 216, }, }, - .orientation = LB_FB_ORIENTATION_LEFT_UP, .init = { PANEL_DELAY(10), PANEL_DCS(0x11), diff --git a/src/drivers/mipi/panel-BOE_TV101WUM_N53.c b/src/drivers/mipi/panel-BOE_TV101WUM_N53.c index bc45474..d5df681 100644 --- a/src/drivers/mipi/panel-BOE_TV101WUM_N53.c +++ b/src/drivers/mipi/panel-BOE_TV101WUM_N53.c @@ -18,7 +18,6 @@ .x_mm = 135, .y_mm = 216, }, }, - .orientation = LB_FB_ORIENTATION_LEFT_UP, .init = { PANEL_DELAY(24), PANEL_DCS(0xB0, 0x05), diff --git a/src/drivers/mipi/panel-BOE_TV101WUM_NL6.c b/src/drivers/mipi/panel-BOE_TV101WUM_NL6.c index 2c990f8..d7678d8 100644 --- a/src/drivers/mipi/panel-BOE_TV101WUM_NL6.c +++ b/src/drivers/mipi/panel-BOE_TV101WUM_NL6.c @@ -18,7 +18,6 @@ .x_mm = 135, .y_mm = 216, }, }, - .orientation = LB_FB_ORIENTATION_LEFT_UP, .init = { PANEL_DELAY(24), PANEL_DCS(0xB0, 0x05), diff --git a/src/drivers/mipi/panel-BOE_TV105WUM_NW0.c b/src/drivers/mipi/panel-BOE_TV105WUM_NW0.c index 6931193..97b8483 100644 --- a/src/drivers/mipi/panel-BOE_TV105WUM_NW0.c +++ b/src/drivers/mipi/panel-BOE_TV105WUM_NW0.c @@ -18,7 +18,6 @@ .x_mm = 147, .y_mm = 236, }, }, - .orientation = LB_FB_ORIENTATION_LEFT_UP, .init = { PANEL_DCS(0x10), PANEL_DELAY(34), diff --git a/src/drivers/mipi/panel-CMN_P097PFG_SSD2858.c b/src/drivers/mipi/panel-CMN_P097PFG_SSD2858.c index 73e8596..637533e 100644 --- a/src/drivers/mipi/panel-CMN_P097PFG_SSD2858.c +++ b/src/drivers/mipi/panel-CMN_P097PFG_SSD2858.c @@ -18,7 +18,6 @@ .x_mm = 147, .y_mm = 196, }, }, - .orientation = LB_FB_ORIENTATION_NORMAL, .init = { PANEL_GENERIC(0xff, 0x00), /* LOCKCNT=0x1f4, MRX=0, POSTDIV=1 (/2} }, MULT=0x49 diff --git a/src/drivers/mipi/panel-STA_2081101QFH032011_53G.c b/src/drivers/mipi/panel-STA_2081101QFH032011_53G.c index be8ba73..9c4dbe3 100644 --- a/src/drivers/mipi/panel-STA_2081101QFH032011_53G.c +++ b/src/drivers/mipi/panel-STA_2081101QFH032011_53G.c @@ -18,7 +18,6 @@ .x_mm = 135, .y_mm = 217, }, }, - .orientation = LB_FB_ORIENTATION_LEFT_UP, .init = { PANEL_DCS(0xB0, 0x01), PANEL_DCS(0xC3, 0x4F), diff --git a/src/drivers/mipi/panel-VIS_RM69299.c b/src/drivers/mipi/panel-VIS_RM69299.c index aff2a99..697b0e7 100644 --- a/src/drivers/mipi/panel-VIS_RM69299.c +++ b/src/drivers/mipi/panel-VIS_RM69299.c @@ -18,7 +18,6 @@ .x_mm = 74, .y_mm = 131, }, }, - .orientation = LB_FB_ORIENTATION_NORMAL, .init = { PANEL_DCS(0xFE, 0x00, 0x15, 0x80), PANEL_DCS(0xc2, 0x08, 0x15, 0x80), diff --git a/src/include/mipi/panel.h b/src/include/mipi/panel.h index e0a1463..edb6df5 100644 --- a/src/include/mipi/panel.h +++ b/src/include/mipi/panel.h @@ -27,7 +27,6 @@ */ struct panel_serializable_data { struct edid edid; /* edid info of this panel */ - enum lb_fb_orientation orientation; /* Panel orientation */ u8 init[]; /* A packed array of panel_init_command */ };
diff --git a/src/mainboard/google/kukui/panel.h b/src/mainboard/google/kukui/panel.h index 17c1983..c5bc43e 100644 --- a/src/mainboard/google/kukui/panel.h +++ b/src/mainboard/google/kukui/panel.h @@ -11,6 +11,7 @@ struct panel_serializable_data *s; void (*power_on)(void); /* Callback to turn on panel */ void (*post_power_on)(void); /* Callback to run after panel is turned on */ + enum lb_fb_orientation orientation; };
/* Returns the panel description from given ID. */ diff --git a/src/mainboard/google/kukui/panel_anx7625.c b/src/mainboard/google/kukui/panel_anx7625.c index fb3c9b7..90a041b 100644 --- a/src/mainboard/google/kukui/panel_anx7625.c +++ b/src/mainboard/google/kukui/panel_anx7625.c @@ -13,7 +13,6 @@ #define ANX7625_I2C_BUS 4
static struct panel_serializable_data anx7625_data = { - .orientation = LB_FB_ORIENTATION_NORMAL, .init = { PANEL_END }, };
@@ -33,6 +32,7 @@
static struct panel_description anx7625_panel = { .s = &anx7625_data, + .orientation = LB_FB_ORIENTATION_NORMAL, .power_on = dummy_power_on, .post_power_on = start_anx7625, }; diff --git a/src/mainboard/google/kukui/panel_flapjack.c b/src/mainboard/google/kukui/panel_flapjack.c index 16a949d..3ad9d6a 100644 --- a/src/mainboard/google/kukui/panel_flapjack.c +++ b/src/mainboard/google/kukui/panel_flapjack.c @@ -3,10 +3,10 @@ #include "panel.h"
static struct panel_description flapjack_panels[] = { - [0] = { .name = "BOE_TV101WUM_NG0", }, - [1] = { .name = "BOE_TV080WUM_NG0", }, - [2] = { .name = "INX_OTA7290D10P", }, - [3] = { .name = "AUO_NT51021D8P", }, + [0] = { .name = "BOE_TV101WUM_NG0", .orientation = LB_FB_ORIENTATION_NORMAL}, + [1] = { .name = "BOE_TV080WUM_NG0", .orientation = LB_FB_ORIENTATION_NORMAL}, + [2] = { .name = "INX_OTA7290D10P", .orientation = LB_FB_ORIENTATION_NORMAL}, + [3] = { .name = "AUO_NT51021D8P", .orientation = LB_FB_ORIENTATION_NORMAL}, };
struct panel_description *get_panel_description(int panel_id) diff --git a/src/mainboard/google/kukui/panel_kakadu.c b/src/mainboard/google/kukui/panel_kakadu.c index f01c28b..df9a92e 100644 --- a/src/mainboard/google/kukui/panel_kakadu.c +++ b/src/mainboard/google/kukui/panel_kakadu.c @@ -3,7 +3,7 @@ #include "panel.h"
static struct panel_description kakadu_panels[] = { - [1] = { .name = "BOE_TV105WUM_NW0", }, + [1] = { .name = "BOE_TV105WUM_NW0", .orientation = LB_FB_ORIENTATION_LEFT_UP}, };
struct panel_description *get_panel_description(int panel_id) diff --git a/src/mainboard/google/kukui/panel_katsu.c b/src/mainboard/google/kukui/panel_katsu.c index f2a2070..eeb9573 100644 --- a/src/mainboard/google/kukui/panel_katsu.c +++ b/src/mainboard/google/kukui/panel_katsu.c @@ -3,8 +3,8 @@ #include "panel.h"
static struct panel_description katsu_panels[] = { - [1] = { .name = "BOE_TV105WUM_NW0", }, - [2] = { .name = "STA_2081101QFH032011_53G", }, + [1] = { .name = "BOE_TV105WUM_NW0", .orientation = LB_FB_ORIENTATION_LEFT_UP}, + [2] = { .name = "STA_2081101QFH032011_53G", .orientation = LB_FB_ORIENTATION_LEFT_UP}, };
struct panel_description *get_panel_description(int panel_id) diff --git a/src/mainboard/google/kukui/panel_kodama.c b/src/mainboard/google/kukui/panel_kodama.c index efabfa2..35d3d91 100644 --- a/src/mainboard/google/kukui/panel_kodama.c +++ b/src/mainboard/google/kukui/panel_kodama.c @@ -3,8 +3,8 @@ #include "panel.h"
static struct panel_description kodama_panels[] = { - [1] = { .name = "AUO_B101UAN08_3", }, - [2] = { .name = "BOE_TV101WUM_N53", }, + [1] = { .name = "AUO_B101UAN08_3", .orientation = LB_FB_ORIENTATION_LEFT_UP}, + [2] = { .name = "BOE_TV101WUM_N53", .orientation = LB_FB_ORIENTATION_LEFT_UP}, };
struct panel_description *get_panel_description(int panel_id) diff --git a/src/mainboard/google/kukui/panel_krane.c b/src/mainboard/google/kukui/panel_krane.c index 6228bcb..3088718 100644 --- a/src/mainboard/google/kukui/panel_krane.c +++ b/src/mainboard/google/kukui/panel_krane.c @@ -3,9 +3,10 @@ #include "panel.h"
static struct panel_description krane_panels[] = { - [0] = { .name = "AUO_KD101N80_45NA", }, - [1] = { .name = "BOE_TV101WUM_NL6", }, /* Only Rev3, can be reused. */ - [11] = { .name = "BOE_TV101WUM_NL6", }, + [0] = { .name = "AUO_KD101N80_45NA", .orientation = LB_FB_ORIENTATION_LEFT_UP}, + /* [1] is only Rev3, can be reused. */ + [1] = { .name = "BOE_TV101WUM_NL6", .orientation = LB_FB_ORIENTATION_LEFT_UP}, + [11] = { .name = "BOE_TV101WUM_NL6", .orientation = LB_FB_ORIENTATION_LEFT_UP}, };
struct panel_description *get_panel_description(int panel_id) diff --git a/src/mainboard/google/kukui/panel_kukui.c b/src/mainboard/google/kukui/panel_kukui.c index ae002e6..283b641 100644 --- a/src/mainboard/google/kukui/panel_kukui.c +++ b/src/mainboard/google/kukui/panel_kukui.c @@ -25,6 +25,7 @@
static struct panel_description kukui_panel = { .name = "CMN_P097PFG_SSD2858", + .orientation = LB_FB_ORIENTATION_NORMAL, .power_on = power_on_ssd2858, };
diff --git a/src/mainboard/google/kukui/panel_ps8640.c b/src/mainboard/google/kukui/panel_ps8640.c index f169254..c4e90ea 100644 --- a/src/mainboard/google/kukui/panel_ps8640.c +++ b/src/mainboard/google/kukui/panel_ps8640.c @@ -34,12 +34,12 @@ }
static struct panel_serializable_data ps8640_data = { - .orientation = LB_FB_ORIENTATION_NORMAL, .init = { PANEL_END }, };
static struct panel_description ps8640_panel = { .s = &ps8640_data, + .orientation = LB_FB_ORIENTATION_NORMAL, .power_on = dummy_power_on, };
diff --git a/src/mainboard/google/trogdor/mainboard.c b/src/mainboard/google/trogdor/mainboard.c index 4b395ba..066705e 100644 --- a/src/mainboard/google/trogdor/mainboard.c +++ b/src/mainboard/google/trogdor/mainboard.c @@ -117,7 +117,8 @@
static void display_startup(void) { - struct panel_serializable_data *panel = NULL; + struct panel_serializable_data edp_panel = {0}; + struct panel_serializable_data *panel = &edp_panel;
if (!display_init_required()) { printk(BIOS_INFO, "Skipping display init.\n"); @@ -130,24 +131,18 @@ return; } else { enum dp_pll_clk_src ref_clk = SN65_SEL_19MHZ; - static struct panel_serializable_data edp_panel = { - .orientation = LB_FB_ORIENTATION_NORMAL, - }; i2c_init(QUPV3_0_SE2, I2C_SPEED_FAST); /* EDP Bridge I2C */ power_on_bridge(); mdelay(250); /* Delay for the panel to be up */ sn65dsi86_bridge_init(BRIDGE_BUS, BRIDGE_CHIP, ref_clk); - if (sn65dsi86_bridge_read_edid(BRIDGE_BUS, BRIDGE_CHIP, &edp_panel.edid) < 0) + if (sn65dsi86_bridge_read_edid(BRIDGE_BUS, BRIDGE_CHIP, &panel->edid) < 0) return; - panel = &edp_panel; }
printk(BIOS_INFO, "display init!\n"); edid_set_framebuffer_bits_per_pixel(&panel->edid, 32, 0); - if (display_init(panel) == CB_SUCCESS) { - struct fb_info *info = fb_new_framebuffer_info_from_edid(&panel->edid, 0); - fb_set_orientation(info, panel->orientation); - } + if (display_init(panel) == CB_SUCCESS) + fb_new_framebuffer_info_from_edid(&panel->edid, 0); }
static void mainboard_init(struct device *dev)