From 1f84b2c02597ef7a373478cc97caf07c69f1ae3a Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Wed, 1 Sep 2021 16:27:58 -0700 Subject: drivers/mipi: Make orientation a property of the mainboard, not 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 Change-Id: If2b716aa4dae036515730c12961fdd8a9ac34753 Reviewed-on: https://review.coreboot.org/c/coreboot/+/57324 Reviewed-by: Yu-Ping Wu Tested-by: build bot (Jenkins) --- src/mainboard/google/trogdor/mainboard.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/mainboard/google/trogdor') diff --git a/src/mainboard/google/trogdor/mainboard.c b/src/mainboard/google/trogdor/mainboard.c index 4b395ba07c..066705eb6b 100644 --- a/src/mainboard/google/trogdor/mainboard.c +++ b/src/mainboard/google/trogdor/mainboard.c @@ -117,7 +117,8 @@ static enum cb_err display_init(struct panel_serializable_data *panel) 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 @@ static void display_startup(void) 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) -- cgit v1.2.3