summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2025-04-01 11:37:18 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2025-04-07 11:02:07 +0200
commit305396ac7782c2f1aba407bab06e9da68588ffef (patch)
tree6ec72123a9692c305bf08e4b96793ea369c7b24c
parent32ae90c66fb62e4f6ae859422f733dfb249f10cf (diff)
drm/sysfb: efidrm: Add EDID support
Enable the connector's EDID property if edid_info contains valid data. Exports the EDID via sysfs for user-space compositors. EDID information is not always available. Depending on the system and kernel configuration, it is either provided by the boot loader or read by the kernel during early boot stages. As of now, there's only one EFI display, so that EDID data always belongs to this output. This might change if there's ever more than one EFI display in the system. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20250401094056.32904-16-tzimmermann@suse.de
-rw-r--r--drivers/gpu/drm/sysfb/efidrm.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/drm/sysfb/efidrm.c b/drivers/gpu/drm/sysfb/efidrm.c
index 5c1876e34a04..af90064a4c04 100644
--- a/drivers/gpu/drm/sysfb/efidrm.c
+++ b/drivers/gpu/drm/sysfb/efidrm.c
@@ -13,6 +13,7 @@
#include <drm/drm_damage_helper.h>
#include <drm/drm_device.h>
#include <drm/drm_drv.h>
+#include <drm/drm_edid.h>
#include <drm/drm_fbdev_shmem.h>
#include <drm/drm_framebuffer.h>
#include <drm/drm_gem_atomic_helper.h>
@@ -22,6 +23,7 @@
#include <drm/drm_modeset_helper_vtables.h>
#include <drm/drm_probe_helper.h>
+#include <video/edid.h>
#include <video/pixel_format.h>
#include "drm_sysfb_helper.h"
@@ -308,6 +310,10 @@ static struct efidrm_device *efidrm_device_create(struct drm_driver *drv,
drm_dbg(dev, "framebuffer format=%p4cc, size=%dx%d, stride=%d bytes\n",
&format->format, width, height, stride);
+#ifdef CONFIG_X86
+ if (drm_edid_header_is_valid(edid_info.dummy) == 8)
+ sysfb->edid = edid_info.dummy;
+#endif
sysfb->fb_mode = drm_sysfb_mode(width, height, 0, 0);
sysfb->fb_format = format;
sysfb->fb_pitch = stride;
@@ -413,6 +419,8 @@ static struct efidrm_device *efidrm_device_create(struct drm_driver *drv,
drm_connector_set_panel_orientation_with_quirk(connector,
DRM_MODE_PANEL_ORIENTATION_UNKNOWN,
width, height);
+ if (sysfb->edid)
+ drm_connector_attach_edid_property(connector);
ret = drm_connector_attach_encoder(connector, encoder);
if (ret)