Skip to contentSkip to conversation

video: Make edid_info generally available in x86

PATCH In review Thomas Zimmermann 2 participants 7 messages Jun 2, 2025 – Jun 3, 2025

Subsystems (6)
lore
Share & tools
lore

Thomas Zimmermann

author maintainer
#0 lore raw

cover video: Make edid_info generally available in x86

The global variable edid_info provides the system framebuffer's EDID information, if any. Make it available on x86 without dependencies on fbdev. DRM drivers for system framebuffers export the information to userspace.

Besides cleaning up, this series prepares support for firmware EDID on EFI-based systems.

Thomas Zimmermann (2):
video: Make CONFIG_FIRMWARE_EDID generally available
video: Make global edid_info depend on CONFIG_FIRMWARE_EDID

 arch/x86/kernel/setup.c          |  4 ++++
 drivers/gpu/drm/sysfb/efidrm.c   |  2 +-
 drivers/gpu/drm/sysfb/vesadrm.c  |  2 +-
 drivers/video/Kconfig            | 18 +++++++++++++++++-
 drivers/video/fbdev/core/Kconfig | 15 ---------------
 drivers/video/fbdev/core/fbmon.c |  3 +--
 include/video/edid.h             |  3 ++-
 7 files changed, 26 insertions(+), 21 deletions(-)
Signature · 1 line
2.49.0
author maintainer
#1 lore raw

PATCH 1/2 video: Make CONFIG_FIRMWARE_EDID generally available

DRM drivers such as efidrm and vesadrm can export firmware EDID data to userspace. Make the related option CONFIG_FIRMWARE_EDID available without CONFIG_FB. Make it depend on X86, which is currently the only architecture providing EDID information.

---
 drivers/video/Kconfig            | 18 +++++++++++++++++-
 drivers/video/fbdev/core/Kconfig | 15 ---------------
 drivers/video/fbdev/core/fbmon.c |  3 +--
 3 files changed, 18 insertions(+), 18 deletions(-)
drivers/video/Kconfig +17 -1
index 5df981920a94..c3da6c0bfca6 100644
@@ -61,6 +61,23 @@ config HDMI
 
 endif # HAS_IOMEM
 
+config FIRMWARE_EDID
+	bool "Enable firmware EDID"
+	depends on X86
+	help
+	  This enables access to the EDID transferred from the firmware.
+	  On x86, this is from the VESA BIOS. DRM display drivers will
+	  be able to export the information to userspace.
+
+	  Also enable this if DDC/I2C transfers do not work for your driver
+	  and if you are using nvidiafb, i810fb or savagefb.
+
+	  In general, choosing Y for this option is safe.  If you
+	  experience extremely long delays while booting before you get
+	  something on your display, try setting this to N.  Matrox cards in
+	  combination with certain motherboards and monitors are known to
+	  suffer from this problem.
+
 if VT
 	source "drivers/video/console/Kconfig"
 endif
@@ -70,5 +87,4 @@ if FB_CORE || SGI_NEWPORT_CONSOLE
 
 endif
 
-
 endmenu
drivers/video/fbdev/core/Kconfig +0 -15
index 4abe12db7594..b38c3b776bce 100644
@@ -10,21 +10,6 @@ config FB_CORE
 config FB_NOTIFY
 	bool
 
-config FIRMWARE_EDID
-	bool "Enable firmware EDID"
-	depends on FB
-	help
-	  This enables access to the EDID transferred from the firmware.
-	  On the i386, this is from the Video BIOS. Enable this if DDC/I2C
-	  transfers do not work for your driver and if you are using
-	  nvidiafb, i810fb or savagefb.
-
-	  In general, choosing Y for this option is safe.  If you
-	  experience extremely long delays while booting before you get
-	  something on your display, try setting this to N.  Matrox cards in
-	  combination with certain motherboards and monitors are known to
-	  suffer from this problem.
-
 config FB_DEVICE
 	bool "Provide legacy /dev/fb* device"
 	depends on FB_CORE
drivers/video/fbdev/core/fbmon.c +1 -2
index 0a26399dbc89..7762ad0284fa 100644
@@ -1482,13 +1482,12 @@ int fb_validate_mode(const struct fb_var_screeninfo *var, struct fb_info *info)
 		-EINVAL : 0;
 }
 
-#if defined(CONFIG_FIRMWARE_EDID) && defined(CONFIG_X86)
-
 /*
  * We need to ensure that the EDID block is only returned for
  * the primary graphics adapter.
  */
 
+#if defined(CONFIG_FIRMWARE_EDID)
 const unsigned char *fb_firmware_edid(struct device *device)
 {
 	struct pci_dev *dev = NULL;
Signature · 1 line
2.49.0
maintainer Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] video: Make CONFIG_FIRMWARE_EDID generally available

Quoted 11 lines · Thomas Zimmermann

DRM drivers such as efidrm and vesadrm can export firmware EDID data to userspace. Make the related option CONFIG_FIRMWARE_EDID available without CONFIG_FB. Make it depend on X86, which is currently the only architecture providing EDID information.

---
  drivers/video/Kconfig            | 18 +++++++++++++++++-
  drivers/video/fbdev/core/Kconfig | 15 ---------------
  drivers/video/fbdev/core/fbmon.c |  3 +--
  3 files changed, 18 insertions(+), 18 deletions(-)
author maintainer
#3 lore raw

PATCH 2/2 video: Make global edid_info depend on CONFIG_FIRMWARE_EDID

In reply to Thomas Zimmermann

Protect global edid_info behind CONFIG_FIRMWARE_EDID and remove the config tests for CONFIG_X86. Makes edid_info available iff its option has been enabled.

---
 arch/x86/kernel/setup.c         | 4 ++++
 drivers/gpu/drm/sysfb/efidrm.c  | 2 +-
 drivers/gpu/drm/sysfb/vesadrm.c | 2 +-
 include/video/edid.h            | 3 ++-
 4 files changed, 8 insertions(+), 3 deletions(-)
arch/x86/kernel/setup.c +4 -0
index 9d2a13b37833..cfe501d323d5 100644
@@ -217,8 +217,10 @@ arch_initcall(init_x86_sysctl);
  */
 struct screen_info screen_info;
 EXPORT_SYMBOL(screen_info);
+#if defined(CONFIG_FIRMWARE_EDID)
 struct edid_info edid_info;
 EXPORT_SYMBOL_GPL(edid_info);
+#endif
 
 extern int root_mountflags;
 
@@ -503,7 +505,9 @@ static void __init parse_boot_params(void)
 {
 	ROOT_DEV = old_decode_dev(boot_params.hdr.root_dev);
 	screen_info = boot_params.screen_info;
+#if defined(CONFIG_FIRMWARE_EDID)
 	edid_info = boot_params.edid_info;
+#endif
 #ifdef CONFIG_X86_32
 	apm_info.bios = boot_params.apm_bios_info;
 	ist_info = boot_params.ist_info;
drivers/gpu/drm/sysfb/efidrm.c +1 -1
index 46912924636a..a8b1305b6e13 100644
@@ -202,7 +202,7 @@ 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 defined(CONFIG_FIRMWARE_EDID)
 	if (drm_edid_header_is_valid(edid_info.dummy) == 8)
 		sysfb->edid = edid_info.dummy;
 #endif
drivers/gpu/drm/sysfb/vesadrm.c +1 -1
index 7945544ba73e..c5216dbe21ec 100644
@@ -344,7 +344,7 @@ static struct vesadrm_device *vesadrm_device_create(struct drm_driver *drv,
 #endif
 	}
 
-#ifdef CONFIG_X86
+#if defined(CONFIG_FIRMWARE_EDID)
 	if (drm_edid_header_is_valid(edid_info.dummy) == 8)
 		sysfb->edid = edid_info.dummy;
 #endif
include/video/edid.h +2 -1
index f614371e9116..c2b186b1933a 100644
@@ -4,7 +4,8 @@
 
 #include <uapi/video/edid.h>
 
-#ifdef CONFIG_X86
+#if defined(CONFIG_FIRMWARE_EDID)
 extern struct edid_info edid_info;
 #endif
+
 #endif /* __linux_video_edid_h__ */
Signature · 1 line
2.49.0
maintainer Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] video: Make global edid_info depend on CONFIG_FIRMWARE_EDID

Quoted 11 lines · Thomas Zimmermann

Protect global edid_info behind CONFIG_FIRMWARE_EDID and remove the config tests for CONFIG_X86. Makes edid_info available iff its option has been enabled.

---
  arch/x86/kernel/setup.c         | 4 ++++
  drivers/gpu/drm/sysfb/efidrm.c  | 2 +-
  drivers/gpu/drm/sysfb/vesadrm.c | 2 +-
  include/video/edid.h            | 3 ++-
  4 files changed, 8 insertions(+), 3 deletions(-)
author maintainer
#5 lore raw

Re: [PATCH 2/2] video: Make global edid_info depend on CONFIG_FIRMWARE_EDID

Hi

Am 03.06.25 um 18:08 schrieb Helge Deller:

Quoted 13 lines · Thomas Zimmermann
Quoted 11 lines

Protect global edid_info behind CONFIG_FIRMWARE_EDID and remove the config tests for CONFIG_X86. Makes edid_info available iff its option has been enabled.

---
  arch/x86/kernel/setup.c         | 4 ++++
  drivers/gpu/drm/sysfb/efidrm.c  | 2 +-
  drivers/gpu/drm/sysfb/vesadrm.c | 2 +-
  include/video/edid.h            | 3 ++-

  4 files changed, 8 insertions(+), 3 deletions(-)
Quoted 1 line

Thanks for reviewing. I'd like to merge the series via drm-misc for some other patches I have for DRM. Ok?

Best regards
Thomas

Signature · 7 lines
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
maintainer
#6 lore raw

Re: [PATCH 2/2] video: Make global edid_info depend on CONFIG_FIRMWARE_EDID

Quoted 16 lines · Thomas Zimmermann

Hi

Am 03.06.25 um 18:08 schrieb Helge Deller:

Quoted 13 lines · Thomas Zimmermann
Quoted 11 lines

Protect global edid_info behind CONFIG_FIRMWARE_EDID and remove the config tests for CONFIG_X86. Makes edid_info available iff its option has been enabled.

---
  arch/x86/kernel/setup.c         | 4 ++++
  drivers/gpu/drm/sysfb/efidrm.c  | 2 +-
  drivers/gpu/drm/sysfb/vesadrm.c | 2 +-
  include/video/edid.h            | 3 ++-

  4 files changed, 8 insertions(+), 3 deletions(-)
Quoted 3 lines
Quoted 1 line

Thanks for reviewing. I'd like to merge the series via drm-misc for some other patches I have for DRM. Ok?

Sure.

Helge