summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/commonlib/include/commonlib/coreboot_tables.h13
-rw-r--r--src/include/edid.h2
-rw-r--r--src/lib/edid_fill_fb.c5
3 files changed, 20 insertions, 0 deletions
diff --git a/src/commonlib/include/commonlib/coreboot_tables.h b/src/commonlib/include/commonlib/coreboot_tables.h
index 0fe9703d34..7bded2a3a3 100644
--- a/src/commonlib/include/commonlib/coreboot_tables.h
+++ b/src/commonlib/include/commonlib/coreboot_tables.h
@@ -283,6 +283,18 @@ struct lb_forward {
* 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 @@ struct lb_framebuffer {
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 d567115744..e5f7d98926 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 @@ 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_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 210c727224..1b38ead596 100644
--- a/src/lib/edid_fill_fb.c
+++ b/src/lib/edid_fill_fb.c
@@ -81,6 +81,11 @@ void set_vbe_mode_info_valid(const struct edid *edid, uintptr_t fb_addr)
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)