From 564720f2c8b6c37aeceb10bd1a4064165ebdafb0 Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Tue, 6 Aug 2019 08:23:54 +0800 Subject: libpayload: cbgfx: Allow rotation of the display Sometimes the display native orientation does not match the device default orientation, so allow rotation of the framebuffer before it is displayed on screen. set_pixel now take coordinates in the rotated coordinate system, and converts the coordinates before writing to the framebuffer. Also, screen.size now matches the rotated system (_not_ the framebuffer size). BUG=b:132049716 TEST=Boot krane, see that FW screen is orientation properly. Change-Id: If9316c0ce33c17057372ef5995a2c68de4f11f02 Signed-off-by: Nicolas Boichat Reviewed-on: https://review.coreboot.org/c/coreboot/+/34732 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner Reviewed-by: Christian Walter --- payloads/libpayload/include/coreboot_tables.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'payloads/libpayload/include') diff --git a/payloads/libpayload/include/coreboot_tables.h b/payloads/libpayload/include/coreboot_tables.h index 9b69a6d3d3..bf2cf022d1 100644 --- a/payloads/libpayload/include/coreboot_tables.h +++ b/payloads/libpayload/include/coreboot_tables.h @@ -189,6 +189,14 @@ struct cb_forward { u64 forward; }; +/* Panel orientation, matches drm_connector.h in the Linux kernel. */ +enum cb_fb_orientation { + CB_FB_ORIENTATION_NORMAL = 0, + CB_FB_ORIENTATION_BOTTOM_UP = 1, + CB_FB_ORIENTATION_LEFT_UP = 2, + CB_FB_ORIENTATION_RIGHT_UP = 3, +}; + struct cb_framebuffer { u32 tag; u32 size; @@ -206,6 +214,7 @@ struct cb_framebuffer { u8 blue_mask_size; u8 reserved_mask_pos; u8 reserved_mask_size; + u8 orientation; }; #define CB_GPIO_ACTIVE_LOW 0 -- cgit v1.2.3