summaryrefslogtreecommitdiff
path: root/include/linux/coreboot.h
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2026-02-17 16:56:22 +0100
committerThomas Zimmermann <tzimmermann@suse.de>2026-02-20 14:38:25 +0100
commit058fc04b8587ad07a86dfa8f99d8d99db0a55443 (patch)
tree2fcba781e97a124a321aca1b57b5951c62811038 /include/linux/coreboot.h
parenta29a1f0ec8d69ee917a9d4c84b844df0decff0ef (diff)
drm/sysfb: corebootdrm: Support panel orientation
Add fields and constants for coreboot framebuffer orientation. Set corebootdrm's DRM connector state from the values. Not all firmware provides orientation, so make it optional. Systems without, continue to use unknown orientation. v3: - comment on _HAS_ORIENTATION semantics (Tzung-Bi) Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Acked-by: Julius Werner <jwerner@chromium.org> Acked-by: Tzung-Bi Shih <tzungbi@kernel.org> # coreboot Link: https://patch.msgid.link/20260217155836.96267-13-tzimmermann@suse.de
Diffstat (limited to 'include/linux/coreboot.h')
-rw-r--r--include/linux/coreboot.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/coreboot.h b/include/linux/coreboot.h
index 885da106fee3..5d40ca7a1d89 100644
--- a/include/linux/coreboot.h
+++ b/include/linux/coreboot.h
@@ -47,6 +47,11 @@ struct lb_cbmem_entry {
u32 id;
};
+#define LB_FRAMEBUFFER_ORIENTATION_NORMAL 0
+#define LB_FRAMEBUFFER_ORIENTATION_BOTTOM_UP 1
+#define LB_FRAMEBUFFER_ORIENTATION_LEFT_UP 2
+#define LB_FRAMEBUFFER_ORIENTATION_RIGHT_UP 3
+
/* Describes framebuffer setup by coreboot */
struct lb_framebuffer {
u32 tag;
@@ -65,6 +70,7 @@ struct lb_framebuffer {
u8 blue_mask_size;
u8 reserved_mask_pos;
u8 reserved_mask_size;
+ u8 orientation;
};
/*
@@ -74,4 +80,11 @@ struct lb_framebuffer {
#define LB_FRAMEBUFFER_HAS_LFB(__fb) \
((__fb)->size >= offsetofend(struct lb_framebuffer, reserved_mask_size))
+/*
+ * True if the coreboot-provided data is large enough to hold information
+ * on the display orientation. False otherwise.
+ */
+#define LB_FRAMEBUFFER_HAS_ORIENTATION(__fb) \
+ ((__fb)->size >= offsetofend(struct lb_framebuffer, orientation))
+
#endif /* _LINUX_COREBOOT_H */