Nicolas Boichat has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34731 )
Change subject: lib/edid: Add suport for display rotation ......................................................................
lib/edid: Add suport for display rotation
Sometimes the display native orientation does not match the device default orientation. We add a parameter to be passed to libpayload, which can then do the rotation.
BUG=b:132049716 TEST=Boot krane, see that FW screen is orientation properly.
Change-Id: I5e1d94b973a3f615b73eebe0ca1202ba03731844 --- M src/commonlib/include/commonlib/coreboot_tables.h M src/include/edid.h M src/lib/edid_fill_fb.c 3 files changed, 30 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/31/34731/1
diff --git a/src/commonlib/include/commonlib/coreboot_tables.h b/src/commonlib/include/commonlib/coreboot_tables.h index 0fe9703..84c75bf 100644 --- a/src/commonlib/include/commonlib/coreboot_tables.h +++ b/src/commonlib/include/commonlib/coreboot_tables.h @@ -283,6 +283,13 @@ * fields described above. It may, however, only implement a subset * of the possible color formats. */ + +/* Panel orientation, matches drm_connector.h in the Linux kernel. */ +#define LB_PANEL_ORIENTATION_NORMAL 0 +#define LB_PANEL_ORIENTATION_BOTTOM_UP 1 +#define LB_PANEL_ORIENTATION_LEFT_UP 2 +#define LB_PANEL_ORIENTATION_RIGHT_UP 3 + struct lb_framebuffer { uint32_t tag; uint32_t size; @@ -300,6 +307,8 @@ uint8_t blue_mask_size; uint8_t reserved_mask_pos; uint8_t reserved_mask_size; + + uint8_t orientation; };
diff --git a/src/include/edid.h b/src/include/edid.h index d567115..7292737 100644 --- a/src/include/edid.h +++ b/src/include/edid.h @@ -102,11 +102,28 @@ EDID_ABSENT, };
+/* Panel orientation, matches drm_connector.h in the Linux kernel. */ +enum edid_panel_orientation { + EDID_PANEL_ORIENTATION_NORMAL = 0, + EDID_PANEL_ORIENTATION_BOTTOM_UP = 1, + EDID_PANEL_ORIENTATION_LEFT_UP = 2, + EDID_PANEL_ORIENTATION_RIGHT_UP = 3 +}; + /* Defined in src/lib/edid.c */ int decode_edid(unsigned char *edid, int size, struct edid *out); void edid_set_framebuffer_bits_per_pixel(struct edid *edid, int fb_bpp, int row_byte_alignment); -void set_vbe_mode_info_valid(const struct edid *edid, uintptr_t fb_addr); +void set_vbe_mode_info_valid_orientation(const struct edid *edid, + uintptr_t fb_addr, enum edid_panel_orientation orientation); int set_display_mode(struct edid *edid, enum edid_modes mode);
+/* Wrapper for default orientation. */ +static inline void set_vbe_mode_info_valid(const struct edid *edid, + uintptr_t fb_addr) +{ + set_vbe_mode_info_valid_orientation(edid, fb_addr, + EDID_PANEL_ORIENTATION_NORMAL); +} + #endif /* EDID_H */ diff --git a/src/lib/edid_fill_fb.c b/src/lib/edid_fill_fb.c index 210c727..4e001d4 100644 --- a/src/lib/edid_fill_fb.c +++ b/src/lib/edid_fill_fb.c @@ -30,7 +30,8 @@ /* * Take an edid, and create a framebuffer. Set fb_valid to 1. */ -void set_vbe_mode_info_valid(const struct edid *edid, uintptr_t fb_addr) +void set_vbe_mode_info_valid_orientation(const struct edid *edid, + uintptr_t fb_addr, enum edid_panel_orientation orientation) { edid_fb.physical_address = fb_addr; edid_fb.x_resolution = edid->x_resolution; @@ -77,6 +78,7 @@ edid->framebuffer_bits_per_pixel); return; } + edid_fb.orientation = orientation;
fb_valid = 1; }
Nicolas Boichat has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34731 )
Change subject: lib/edid: Add suport for display rotation ......................................................................
Patch Set 1:
Moving from https://chromium-review.googlesource.com/c/chromiumos/third_party/coreboot/+...
Hello Julius Werner, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34731
to look at the new patch set (#2).
Change subject: lib/edid: Add suport for display rotation ......................................................................
lib/edid: Add suport for display rotation
Sometimes the display native orientation does not match the device default orientation. We add a parameter to be passed to libpayload, which can then do the rotation.
BUG=b:132049716 TEST=Boot krane, see that FW screen is orientation properly.
Change-Id: I5e1d94b973a3f615b73eebe0ca1202ba03731844 --- M src/commonlib/include/commonlib/coreboot_tables.h M src/include/edid.h M src/lib/edid_fill_fb.c 3 files changed, 17 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/31/34731/2
Hello Julius Werner, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34731
to look at the new patch set (#3).
Change subject: lib/edid: Add suport for display rotation ......................................................................
lib/edid: Add suport for display rotation
Sometimes the display native orientation does not match the device default orientation. We add a parameter to be passed to libpayload, which can then do the rotation.
BUG=b:132049716 TEST=Boot krane, see that FW screen is orientation properly.
Change-Id: I5e1d94b973a3f615b73eebe0ca1202ba03731844 Signed-off-by: Nicolas Boichat drinkcat@chromium.org --- M 3rdparty/blobs M src/commonlib/include/commonlib/coreboot_tables.h M src/include/edid.h M src/lib/edid_fill_fb.c 4 files changed, 18 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/31/34731/3
Hello Julius Werner, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34731
to look at the new patch set (#4).
Change subject: lib/edid: Add suport for display rotation ......................................................................
lib/edid: Add suport for display rotation
Sometimes the display native orientation does not match the device default orientation. We add a parameter to be passed to libpayload, which can then do the rotation.
BUG=b:132049716 TEST=Boot krane, see that FW screen is orientation properly.
Change-Id: I5e1d94b973a3f615b73eebe0ca1202ba03731844 Signed-off-by: Nicolas Boichat drinkcat@chromium.org --- M src/commonlib/include/commonlib/coreboot_tables.h M src/include/edid.h M src/lib/edid_fill_fb.c 3 files changed, 17 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/31/34731/4
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34731 )
Change subject: lib/edid: Add suport for display rotation ......................................................................
Patch Set 4: Code-Review+2
(1 comment)
https://review.coreboot.org/c/coreboot/+/34731/4/src/commonlib/include/commo... File src/commonlib/include/commonlib/coreboot_tables.h:
https://review.coreboot.org/c/coreboot/+/34731/4/src/commonlib/include/commo... PS4, Line 289: PANEL nit: maybe call it FB instead of PANEL because it is associated with lb_framebuffer
Hello Julius Werner, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34731
to look at the new patch set (#5).
Change subject: lib/edid: Add suport for display rotation ......................................................................
lib/edid: Add suport for display rotation
Sometimes the display native orientation does not match the device default orientation. We add a parameter to be passed to libpayload, which can then do the rotation.
BUG=b:132049716 TEST=Boot krane, see that FW screen is orientation properly.
Change-Id: I5e1d94b973a3f615b73eebe0ca1202ba03731844 Signed-off-by: Nicolas Boichat drinkcat@chromium.org --- M src/commonlib/include/commonlib/coreboot_tables.h M src/include/edid.h M src/lib/edid_fill_fb.c 3 files changed, 17 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/31/34731/5
Nicolas Boichat has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34731 )
Change subject: lib/edid: Add suport for display rotation ......................................................................
Patch Set 5:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34731/4/src/commonlib/include/commo... File src/commonlib/include/commonlib/coreboot_tables.h:
https://review.coreboot.org/c/coreboot/+/34731/4/src/commonlib/include/commo... PS4, Line 289: PANEL
nit: maybe call it FB instead of PANEL because it is associated with lb_framebuffer
Done
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34731 )
Change subject: lib/edid: Add suport for display rotation ......................................................................
Patch Set 5:
Who calls `set_vbe_panel_orientation()`?
Nicolas Boichat has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34731 )
Change subject: lib/edid: Add suport for display rotation ......................................................................
Patch Set 5:
Patch Set 5:
Who calls `set_vbe_panel_orientation()`?
The board's mainboard.c. For example: https://review.coreboot.org/c/coreboot/+/34733
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34731 )
Change subject: lib/edid: Add suport for display rotation ......................................................................
Patch Set 5:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34731/5/src/commonlib/include/commo... File src/commonlib/include/commonlib/coreboot_tables.h:
https://review.coreboot.org/c/coreboot/+/34731/5/src/commonlib/include/commo... PS5, Line 288: panel Should be lb_fb_orientation to match, then (and set_vbe_framebuffer_orientation()).
Hello Julius Werner, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34731
to look at the new patch set (#6).
Change subject: lib/edid: Add suport for display rotation ......................................................................
lib/edid: Add suport for display rotation
Sometimes the display native orientation does not match the device default orientation. We add a parameter to be passed to libpayload, which can then do the rotation.
BUG=b:132049716 TEST=Boot krane, see that FW screen is orientation properly.
Change-Id: I5e1d94b973a3f615b73eebe0ca1202ba03731844 Signed-off-by: Nicolas Boichat drinkcat@chromium.org --- M src/commonlib/include/commonlib/coreboot_tables.h M src/include/edid.h M src/lib/edid_fill_fb.c 3 files changed, 20 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/31/34731/6
Nicolas Boichat has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34731 )
Change subject: lib/edid: Add suport for display rotation ......................................................................
Patch Set 6:
(1 comment)
https://review.coreboot.org/c/coreboot/+/34731/5/src/commonlib/include/commo... File src/commonlib/include/commonlib/coreboot_tables.h:
https://review.coreboot.org/c/coreboot/+/34731/5/src/commonlib/include/commo... PS5, Line 288: panel
Should be lb_fb_orientation to match, then (and set_vbe_framebuffer_orientation()).
Done
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34731 )
Change subject: lib/edid: Add suport for display rotation ......................................................................
Patch Set 6: Code-Review+2
Martin Roth has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/34731 )
Change subject: lib/edid: Add suport for display rotation ......................................................................
lib/edid: Add suport for display rotation
Sometimes the display native orientation does not match the device default orientation. We add a parameter to be passed to libpayload, which can then do the rotation.
BUG=b:132049716 TEST=Boot krane, see that FW screen is orientation properly.
Change-Id: I5e1d94b973a3f615b73eebe0ca1202ba03731844 Signed-off-by: Nicolas Boichat drinkcat@chromium.org Reviewed-on: https://review.coreboot.org/c/coreboot/+/34731 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Julius Werner jwerner@chromium.org --- M src/commonlib/include/commonlib/coreboot_tables.h M src/include/edid.h M src/lib/edid_fill_fb.c 3 files changed, 20 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Julius Werner: Looks good to me, approved
diff --git a/src/commonlib/include/commonlib/coreboot_tables.h b/src/commonlib/include/commonlib/coreboot_tables.h index 0fe9703..7bded2a 100644 --- a/src/commonlib/include/commonlib/coreboot_tables.h +++ b/src/commonlib/include/commonlib/coreboot_tables.h @@ -283,6 +283,18 @@ * fields described above. It may, however, only implement a subset * of the possible color formats. */ + +/* + * Framebuffer orientation, matches drm_connector.h drm_panel_orientation in the + * Linux kernel. + */ +enum lb_fb_orientation { + LB_FB_ORIENTATION_NORMAL = 0, + LB_FB_ORIENTATION_BOTTOM_UP = 1, + LB_FB_ORIENTATION_LEFT_UP = 2, + LB_FB_ORIENTATION_RIGHT_UP = 3, +}; + struct lb_framebuffer { uint32_t tag; uint32_t size; @@ -300,6 +312,7 @@ uint8_t blue_mask_size; uint8_t reserved_mask_pos; uint8_t reserved_mask_size; + uint8_t orientation; };
diff --git a/src/include/edid.h b/src/include/edid.h index d567115..e5f7d98 100644 --- a/src/include/edid.h +++ b/src/include/edid.h @@ -17,6 +17,7 @@ #define EDID_H
#include <stdint.h> +#include "commonlib/coreboot_tables.h"
enum edid_modes { EDID_MODE_640x480_60Hz, @@ -107,6 +108,7 @@ void edid_set_framebuffer_bits_per_pixel(struct edid *edid, int fb_bpp, int row_byte_alignment); void set_vbe_mode_info_valid(const struct edid *edid, uintptr_t fb_addr); +void set_vbe_framebuffer_orientation(enum lb_fb_orientation orientation); int set_display_mode(struct edid *edid, enum edid_modes mode);
#endif /* EDID_H */ diff --git a/src/lib/edid_fill_fb.c b/src/lib/edid_fill_fb.c index 210c727..1b38ead 100644 --- a/src/lib/edid_fill_fb.c +++ b/src/lib/edid_fill_fb.c @@ -81,6 +81,11 @@ fb_valid = 1; }
+void set_vbe_framebuffer_orientation(enum lb_fb_orientation orientation) +{ + edid_fb.orientation = orientation; +} + int fill_lb_framebuffer(struct lb_framebuffer *framebuffer) { if (!fb_valid)