public inbox for linux-efi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] video/efi: Support FIRMWARE_EDID on non-x86
@ 2025-11-19 12:30 Ard Biesheuvel
  2025-11-19 12:30 ` [PATCH 1/3] efi: Wrap screen_info in efi_screen_info so edid_info can be added later Ard Biesheuvel
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Ard Biesheuvel @ 2025-11-19 12:30 UTC (permalink / raw)
  To: linux-efi
  Cc: linux-kernel, Ard Biesheuvel, Thomas Zimmermann,
	Javier Martinez Canillas

From: Ard Biesheuvel <ardb@kernel.org>

Refactor the screen_info handling so non-x86 platforms booting via the
EFI stub also have access to the EDID data exposed by the EFI boot
services.

Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Javier Martinez Canillas <javierm@redhat.com>

Ard Biesheuvel (3):
  efi: Wrap screen_info in efi_screen_info so edid_info can be added
    later
  video/edid: Use getter function for edid_info
  efi: Add FIRMWARE_EDID support

 arch/x86/kernel/setup.c                       |  8 ++++++--
 drivers/firmware/efi/earlycon.c               |  1 -
 drivers/firmware/efi/efi-init.c               | 19 ++++++++++++++-----
 drivers/firmware/efi/libstub/efi-stub-entry.c |  3 +--
 drivers/firmware/efi/libstub/efi-stub.c       | 16 ++++++++++------
 drivers/firmware/efi/libstub/efistub.h        |  9 +++------
 drivers/firmware/efi/libstub/gop.c            |  1 -
 drivers/firmware/efi/libstub/screen_info.c    |  7 +++----
 drivers/firmware/efi/libstub/zboot.c          |  2 +-
 drivers/firmware/efi/sysfb_efi.c              |  1 -
 drivers/gpu/drm/sysfb/efidrm.c                |  4 ++--
 drivers/gpu/drm/sysfb/vesadrm.c               |  4 ++--
 drivers/video/Kconfig                         |  2 +-
 drivers/video/fbdev/core/fbmon.c              |  4 ++--
 include/linux/efi.h                           | 10 +++++++++-
 include/video/edid.h                          |  2 +-
 16 files changed, 55 insertions(+), 38 deletions(-)

-- 
2.52.0.rc1.455.g30608eb744-goog


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/3] efi: Wrap screen_info in efi_screen_info so edid_info can be added later
  2025-11-19 12:30 [PATCH 0/3] video/efi: Support FIRMWARE_EDID on non-x86 Ard Biesheuvel
@ 2025-11-19 12:30 ` Ard Biesheuvel
  2025-11-19 12:30 ` [PATCH 2/3] video/edid: Use getter function for edid_info Ard Biesheuvel
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Ard Biesheuvel @ 2025-11-19 12:30 UTC (permalink / raw)
  To: linux-efi
  Cc: linux-kernel, Ard Biesheuvel, Thomas Zimmermann,
	Javier Martinez Canillas

From: Ard Biesheuvel <ardb@kernel.org>

Prepare for adding support to the EFI stub to pass edid_info discovered
using EFI boot services to the kernel proper via a EFI configuration
table. Instead of passing struct screen_info directly, define a new
struct efi_screen_info that encapsulates it. struct edid_info will be
added there later.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 drivers/firmware/efi/earlycon.c               |  1 -
 drivers/firmware/efi/efi-init.c               | 11 ++++++-----
 drivers/firmware/efi/libstub/efi-stub-entry.c |  3 +--
 drivers/firmware/efi/libstub/efi-stub.c       |  9 ++++-----
 drivers/firmware/efi/libstub/efistub.h        |  6 +++---
 drivers/firmware/efi/libstub/gop.c            |  1 -
 drivers/firmware/efi/libstub/screen_info.c    |  7 +++----
 drivers/firmware/efi/libstub/zboot.c          |  2 +-
 drivers/firmware/efi/sysfb_efi.c              |  1 -
 include/linux/efi.h                           |  6 +++++-
 10 files changed, 23 insertions(+), 24 deletions(-)

diff --git a/drivers/firmware/efi/earlycon.c b/drivers/firmware/efi/earlycon.c
index d18a1a5de144..23fb23867b56 100644
--- a/drivers/firmware/efi/earlycon.c
+++ b/drivers/firmware/efi/earlycon.c
@@ -9,7 +9,6 @@
 #include <linux/io.h>
 #include <linux/kernel.h>
 #include <linux/serial_core.h>
-#include <linux/screen_info.h>
 #include <linux/string.h>
 
 #include <asm/early_ioremap.h>
diff --git a/drivers/firmware/efi/efi-init.c b/drivers/firmware/efi/efi-init.c
index a65c2d5b9e7b..5896f4e699a1 100644
--- a/drivers/firmware/efi/efi-init.c
+++ b/drivers/firmware/efi/efi-init.c
@@ -19,7 +19,6 @@
 #include <linux/of_address.h>
 #include <linux/of_fdt.h>
 #include <linux/platform_device.h>
-#include <linux/screen_info.h>
 
 #include <asm/efi.h>
 
@@ -61,13 +60,15 @@ extern __weak const efi_config_table_type_t efi_arch_tables[];
  * everything else can get it from here.
  */
 #if !defined(CONFIG_X86) && (defined(CONFIG_SYSFB) || defined(CONFIG_EFI_EARLYCON))
-struct screen_info screen_info __section(".data");
+struct efi_screen_info efi_screen_info __section(".data");
+
+extern struct screen_info screen_info __alias(efi_screen_info);
 EXPORT_SYMBOL_GPL(screen_info);
 #endif
 
 static void __init init_screen_info(void)
 {
-	struct screen_info *si;
+	struct efi_screen_info *si;
 
 	if (screen_info_table != EFI_INVALID_TABLE_ADDR) {
 		si = early_memremap(screen_info_table, sizeof(*si));
@@ -75,8 +76,8 @@ static void __init init_screen_info(void)
 			pr_err("Could not map screen_info config table\n");
 			return;
 		}
-		screen_info = *si;
-		memset(si, 0, sizeof(*si));
+		efi_screen_info = *si;
+		si->screen_info = (struct screen_info){};
 		early_memunmap(si, sizeof(*si));
 
 		if (memblock_is_map_memory(screen_info.lfb_base))
diff --git a/drivers/firmware/efi/libstub/efi-stub-entry.c b/drivers/firmware/efi/libstub/efi-stub-entry.c
index a6c049835190..520f5ea31cfd 100644
--- a/drivers/firmware/efi/libstub/efi-stub-entry.c
+++ b/drivers/firmware/efi/libstub/efi-stub-entry.c
@@ -1,7 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 
 #include <linux/efi.h>
-#include <linux/screen_info.h>
 
 #include <asm/efi.h>
 
@@ -9,7 +8,7 @@
 
 static unsigned long screen_info_offset;
 
-struct screen_info *alloc_screen_info(void)
+struct efi_screen_info *alloc_screen_info(void)
 {
 	if (IS_ENABLED(CONFIG_ARM))
 		return __alloc_screen_info();
diff --git a/drivers/firmware/efi/libstub/efi-stub.c b/drivers/firmware/efi/libstub/efi-stub.c
index 9cb814c5ba1b..fe77c285a547 100644
--- a/drivers/firmware/efi/libstub/efi-stub.c
+++ b/drivers/firmware/efi/libstub/efi-stub.c
@@ -10,7 +10,6 @@
  */
 
 #include <linux/efi.h>
-#include <linux/screen_info.h>
 #include <asm/efi.h>
 
 #include "efistub.h"
@@ -48,13 +47,13 @@
 static u64 virtmap_base = EFI_RT_VIRTUAL_BASE;
 static bool flat_va_mapping = (EFI_RT_VIRTUAL_OFFSET != 0);
 
-void __weak free_screen_info(struct screen_info *si)
+void __weak free_screen_info(struct efi_screen_info *si)
 {
 }
 
-static struct screen_info *setup_graphics(void)
+static struct efi_screen_info *setup_graphics(void)
 {
-	struct screen_info *si, tmp = {};
+	struct efi_screen_info *si, tmp = {};
 
 	if (efi_setup_graphics(&tmp, NULL) != EFI_SUCCESS)
 		return NULL;
@@ -145,7 +144,7 @@ efi_status_t efi_stub_common(efi_handle_t handle,
 			     unsigned long image_addr,
 			     char *cmdline_ptr)
 {
-	struct screen_info *si;
+	struct efi_screen_info *si;
 	efi_status_t status;
 
 	status = check_platform_features();
diff --git a/drivers/firmware/efi/libstub/efistub.h b/drivers/firmware/efi/libstub/efistub.h
index b2fb0c3fa721..bdeb28d42a1a 100644
--- a/drivers/firmware/efi/libstub/efistub.h
+++ b/drivers/firmware/efi/libstub/efistub.h
@@ -1175,9 +1175,9 @@ efi_enable_reset_attack_mitigation(void) { }
 
 void efi_retrieve_eventlog(void);
 
-struct screen_info *alloc_screen_info(void);
-struct screen_info *__alloc_screen_info(void);
-void free_screen_info(struct screen_info *si);
+struct efi_screen_info *alloc_screen_info(void);
+struct efi_screen_info *__alloc_screen_info(void);
+void free_screen_info(struct efi_screen_info *si);
 
 void efi_cache_sync_image(unsigned long image_base,
 			  unsigned long alloc_size);
diff --git a/drivers/firmware/efi/libstub/gop.c b/drivers/firmware/efi/libstub/gop.c
index 72d74436a7a4..db80f2ad2871 100644
--- a/drivers/firmware/efi/libstub/gop.c
+++ b/drivers/firmware/efi/libstub/gop.c
@@ -8,7 +8,6 @@
 #include <linux/bitops.h>
 #include <linux/ctype.h>
 #include <linux/efi.h>
-#include <linux/screen_info.h>
 #include <linux/string.h>
 #include <asm/efi.h>
 #include <asm/setup.h>
diff --git a/drivers/firmware/efi/libstub/screen_info.c b/drivers/firmware/efi/libstub/screen_info.c
index 5d3a1e32d177..189da1efb7b2 100644
--- a/drivers/firmware/efi/libstub/screen_info.c
+++ b/drivers/firmware/efi/libstub/screen_info.c
@@ -1,7 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 
 #include <linux/efi.h>
-#include <linux/screen_info.h>
 
 #include <asm/efi.h>
 
@@ -21,9 +20,9 @@
 
 static efi_guid_t screen_info_guid = LINUX_EFI_SCREEN_INFO_TABLE_GUID;
 
-struct screen_info *__alloc_screen_info(void)
+struct efi_screen_info *__alloc_screen_info(void)
 {
-	struct screen_info *si;
+	struct efi_screen_info *si;
 	efi_status_t status;
 
 	status = efi_bs_call(allocate_pool, EFI_ACPI_RECLAIM_MEMORY,
@@ -43,7 +42,7 @@ struct screen_info *__alloc_screen_info(void)
 	return NULL;
 }
 
-void free_screen_info(struct screen_info *si)
+void free_screen_info(struct efi_screen_info *si)
 {
 	if (!si)
 		return;
diff --git a/drivers/firmware/efi/libstub/zboot.c b/drivers/firmware/efi/libstub/zboot.c
index c47ace06f010..86f4814cfd47 100644
--- a/drivers/firmware/efi/libstub/zboot.c
+++ b/drivers/firmware/efi/libstub/zboot.c
@@ -26,7 +26,7 @@ void __weak efi_cache_sync_image(unsigned long image_base,
 	// executable code loaded into memory to be safe for execution.
 }
 
-struct screen_info *alloc_screen_info(void)
+struct efi_screen_info *alloc_screen_info(void)
 {
 	return __alloc_screen_info();
 }
diff --git a/drivers/firmware/efi/sysfb_efi.c b/drivers/firmware/efi/sysfb_efi.c
index 1e509595ac03..092c19771e17 100644
--- a/drivers/firmware/efi/sysfb_efi.c
+++ b/drivers/firmware/efi/sysfb_efi.c
@@ -22,7 +22,6 @@
 #include <linux/of_address.h>
 #include <linux/pci.h>
 #include <linux/platform_device.h>
-#include <linux/screen_info.h>
 #include <linux/sysfb.h>
 #include <video/vga.h>
 
diff --git a/include/linux/efi.h b/include/linux/efi.h
index a01f3fe20dab..75d05dc1b4ee 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -27,7 +27,7 @@
 
 #include <asm/page.h>
 
-struct screen_info;
+#include <linux/screen_info.h>
 
 #define EFI_SUCCESS		0
 #define EFI_LOAD_ERROR		( 1 | (1UL << (BITS_PER_LONG-1)))
@@ -1361,4 +1361,8 @@ extern struct blocking_notifier_head efivar_ops_nh;
 void efivars_generic_ops_register(void);
 void efivars_generic_ops_unregister(void);
 
+struct efi_screen_info {
+	struct screen_info	screen_info;
+};
+
 #endif /* _LINUX_EFI_H */
-- 
2.52.0.rc1.455.g30608eb744-goog


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/3] video/edid: Use getter function for edid_info
  2025-11-19 12:30 [PATCH 0/3] video/efi: Support FIRMWARE_EDID on non-x86 Ard Biesheuvel
  2025-11-19 12:30 ` [PATCH 1/3] efi: Wrap screen_info in efi_screen_info so edid_info can be added later Ard Biesheuvel
@ 2025-11-19 12:30 ` Ard Biesheuvel
  2025-11-19 12:30 ` [PATCH 3/3] efi: Add FIRMWARE_EDID support Ard Biesheuvel
  2025-11-20  7:56 ` [PATCH 0/3] video/efi: Support FIRMWARE_EDID on non-x86 Thomas Zimmermann
  3 siblings, 0 replies; 8+ messages in thread
From: Ard Biesheuvel @ 2025-11-19 12:30 UTC (permalink / raw)
  To: linux-efi
  Cc: linux-kernel, Ard Biesheuvel, Thomas Zimmermann,
	Javier Martinez Canillas

From: Ard Biesheuvel <ardb@kernel.org>

Avoid accessing a global writable buffer directly for edid_info, and
instead, define a getter function returning a pointer to it. And
considering that all callers access only the 'dummy' field, just
return a const u8* directly.

This will be used by non-x86 EFI systems that pass edid_info via a EFI
configuration table.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 arch/x86/kernel/setup.c          | 8 ++++++--
 drivers/gpu/drm/sysfb/efidrm.c   | 4 ++--
 drivers/gpu/drm/sysfb/vesadrm.c  | 4 ++--
 drivers/video/fbdev/core/fbmon.c | 4 ++--
 include/video/edid.h             | 2 +-
 5 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 1b2edd07a3e1..526c9c4553c1 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -214,8 +214,12 @@ 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);
+static struct edid_info edid_info __ro_after_init;
+const u8 *get_edid_info(void)
+{
+	return edid_info.dummy;
+}
+EXPORT_SYMBOL_GPL(get_edid_info);
 #endif
 
 extern int root_mountflags;
diff --git a/drivers/gpu/drm/sysfb/efidrm.c b/drivers/gpu/drm/sysfb/efidrm.c
index 1883c4a8604c..e30b93ed4264 100644
--- a/drivers/gpu/drm/sysfb/efidrm.c
+++ b/drivers/gpu/drm/sysfb/efidrm.c
@@ -203,8 +203,8 @@ static struct efidrm_device *efidrm_device_create(struct drm_driver *drv,
 		&format->format, width, height, stride);
 
 #if defined(CONFIG_FIRMWARE_EDID)
-	if (drm_edid_header_is_valid(edid_info.dummy) == 8)
-		sysfb->edid = edid_info.dummy;
+	if (drm_edid_header_is_valid(get_edid_info()) == 8)
+		sysfb->edid = get_edid_info();
 #endif
 	sysfb->fb_mode = drm_sysfb_mode(width, height, 0, 0);
 	sysfb->fb_format = format;
diff --git a/drivers/gpu/drm/sysfb/vesadrm.c b/drivers/gpu/drm/sysfb/vesadrm.c
index 16a4b52d45c6..a4ff78fddc0c 100644
--- a/drivers/gpu/drm/sysfb/vesadrm.c
+++ b/drivers/gpu/drm/sysfb/vesadrm.c
@@ -469,8 +469,8 @@ static struct vesadrm_device *vesadrm_device_create(struct drm_driver *drv,
 	}
 
 #if defined(CONFIG_FIRMWARE_EDID)
-	if (drm_edid_header_is_valid(edid_info.dummy) == 8)
-		sysfb->edid = edid_info.dummy;
+	if (drm_edid_header_is_valid(get_edid_info()) == 8)
+		sysfb->edid = get_edid_info();
 #endif
 	sysfb->fb_mode = drm_sysfb_mode(width, height, 0, 0);
 	sysfb->fb_format = format;
diff --git a/drivers/video/fbdev/core/fbmon.c b/drivers/video/fbdev/core/fbmon.c
index 0a65bef01e3c..caa057c76a88 100644
--- a/drivers/video/fbdev/core/fbmon.c
+++ b/drivers/video/fbdev/core/fbmon.c
@@ -1495,7 +1495,7 @@ const unsigned char *fb_firmware_edid(struct device *device)
 {
 	struct pci_dev *dev = NULL;
 	struct resource *res = NULL;
-	unsigned char *edid = NULL;
+	const unsigned char *edid = NULL;
 
 	if (device)
 		dev = to_pci_dev(device);
@@ -1504,7 +1504,7 @@ const unsigned char *fb_firmware_edid(struct device *device)
 		res = &dev->resource[PCI_ROM_RESOURCE];
 
 	if (res && res->flags & IORESOURCE_ROM_SHADOW)
-		edid = edid_info.dummy;
+		edid = get_edid_info();
 
 	return edid;
 }
diff --git a/include/video/edid.h b/include/video/edid.h
index c2b186b1933a..b8f24c4b2829 100644
--- a/include/video/edid.h
+++ b/include/video/edid.h
@@ -5,7 +5,7 @@
 #include <uapi/video/edid.h>
 
 #if defined(CONFIG_FIRMWARE_EDID)
-extern struct edid_info edid_info;
+const u8 *get_edid_info(void) __attribute_const__;
 #endif
 
 #endif /* __linux_video_edid_h__ */
-- 
2.52.0.rc1.455.g30608eb744-goog


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/3] efi: Add FIRMWARE_EDID support
  2025-11-19 12:30 [PATCH 0/3] video/efi: Support FIRMWARE_EDID on non-x86 Ard Biesheuvel
  2025-11-19 12:30 ` [PATCH 1/3] efi: Wrap screen_info in efi_screen_info so edid_info can be added later Ard Biesheuvel
  2025-11-19 12:30 ` [PATCH 2/3] video/edid: Use getter function for edid_info Ard Biesheuvel
@ 2025-11-19 12:30 ` Ard Biesheuvel
  2025-11-20  7:56 ` [PATCH 0/3] video/efi: Support FIRMWARE_EDID on non-x86 Thomas Zimmermann
  3 siblings, 0 replies; 8+ messages in thread
From: Ard Biesheuvel @ 2025-11-19 12:30 UTC (permalink / raw)
  To: linux-efi
  Cc: linux-kernel, Ard Biesheuvel, Thomas Zimmermann,
	Javier Martinez Canillas

From: Ard Biesheuvel <ardb@kernel.org>

Add support to non-x86 EFI systems for passing the EDID information
discovered by the EFI stub to the kernel proper.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 drivers/firmware/efi/efi-init.c         | 8 ++++++++
 drivers/firmware/efi/libstub/efi-stub.c | 7 ++++++-
 drivers/firmware/efi/libstub/efistub.h  | 3 ---
 drivers/video/Kconfig                   | 2 +-
 include/linux/efi.h                     | 4 ++++
 5 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/drivers/firmware/efi/efi-init.c b/drivers/firmware/efi/efi-init.c
index 5896f4e699a1..d70bd0ec154f 100644
--- a/drivers/firmware/efi/efi-init.c
+++ b/drivers/firmware/efi/efi-init.c
@@ -64,6 +64,14 @@ struct efi_screen_info efi_screen_info __section(".data");
 
 extern struct screen_info screen_info __alias(efi_screen_info);
 EXPORT_SYMBOL_GPL(screen_info);
+
+#ifdef CONFIG_FIRMWARE_EDID
+const u8 *get_edid_info(void)
+{
+       return efi_screen_info.edid_info.dummy;
+}
+EXPORT_SYMBOL_GPL(get_edid_info);
+#endif
 #endif
 
 static void __init init_screen_info(void)
diff --git a/drivers/firmware/efi/libstub/efi-stub.c b/drivers/firmware/efi/libstub/efi-stub.c
index fe77c285a547..20b606d1cbf0 100644
--- a/drivers/firmware/efi/libstub/efi-stub.c
+++ b/drivers/firmware/efi/libstub/efi-stub.c
@@ -54,8 +54,13 @@ void __weak free_screen_info(struct efi_screen_info *si)
 static struct efi_screen_info *setup_graphics(void)
 {
 	struct efi_screen_info *si, tmp = {};
+	struct edid_info *edid_info = NULL;
 
-	if (efi_setup_graphics(&tmp, NULL) != EFI_SUCCESS)
+#ifdef CONFIG_FIRMWARE_EDID
+	edid_info = &tmp.edid_info;
+#endif
+
+	if (efi_setup_graphics(&tmp.screen_info, edid_info) != EFI_SUCCESS)
 		return NULL;
 
 	si = alloc_screen_info();
diff --git a/drivers/firmware/efi/libstub/efistub.h b/drivers/firmware/efi/libstub/efistub.h
index bdeb28d42a1a..93940592e88e 100644
--- a/drivers/firmware/efi/libstub/efistub.h
+++ b/drivers/firmware/efi/libstub/efistub.h
@@ -34,9 +34,6 @@
 #define EFI_ALLOC_LIMIT		ULONG_MAX
 #endif
 
-struct edid_info;
-struct screen_info;
-
 extern bool efi_no5lvl;
 extern bool efi_nochunk;
 extern bool efi_nokaslr;
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index d51777df12d1..6526827fbc55 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -63,7 +63,7 @@ endif # HAS_IOMEM
 
 config FIRMWARE_EDID
 	bool "Enable firmware EDID"
-	depends on X86
+	depends on X86 || EFI_GENERIC_STUB
 	help
 	  This enables access to the EDID transferred from the firmware.
 	  On x86, this is from the VESA BIOS. DRM display drivers will
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 75d05dc1b4ee..8d8228d73585 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -28,6 +28,7 @@
 #include <asm/page.h>
 
 #include <linux/screen_info.h>
+#include <video/edid.h>
 
 #define EFI_SUCCESS		0
 #define EFI_LOAD_ERROR		( 1 | (1UL << (BITS_PER_LONG-1)))
@@ -1363,6 +1364,9 @@ void efivars_generic_ops_unregister(void);
 
 struct efi_screen_info {
 	struct screen_info	screen_info;
+#ifdef CONFIG_FIRMWARE_EDID
+	struct edid_info	edid_info;
+#endif
 };
 
 #endif /* _LINUX_EFI_H */
-- 
2.52.0.rc1.455.g30608eb744-goog


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/3] video/efi: Support FIRMWARE_EDID on non-x86
  2025-11-19 12:30 [PATCH 0/3] video/efi: Support FIRMWARE_EDID on non-x86 Ard Biesheuvel
                   ` (2 preceding siblings ...)
  2025-11-19 12:30 ` [PATCH 3/3] efi: Add FIRMWARE_EDID support Ard Biesheuvel
@ 2025-11-20  7:56 ` Thomas Zimmermann
  2025-11-20  8:19   ` Thomas Zimmermann
  3 siblings, 1 reply; 8+ messages in thread
From: Thomas Zimmermann @ 2025-11-20  7:56 UTC (permalink / raw)
  To: Ard Biesheuvel, linux-efi
  Cc: linux-kernel, Ard Biesheuvel, Javier Martinez Canillas

Hi,

thanks for addressing the remaining EDID support.

First of all, you need to cc dri-devel@lists.freedesktop.org  on any 
further revisions.

Am 19.11.25 um 13:30 schrieb Ard Biesheuvel:
> From: Ard Biesheuvel <ardb@kernel.org>
>
> Refactor the screen_info handling so non-x86 platforms booting via the
> EFI stub also have access to the EDID data exposed by the EFI boot
> services.

I don't like how this series complicates everything to make non-x86 
easier. But the general idea of using efi_screen_info goes into the 
right direction. It's just not generic enough.

The sysfb code transfers struct screen_info as device parameter [1]. 
Drivers later fetch it on probe [2].  The direct ref to the global 
edid_info [3] only exists because we have no means of transferring it as 
device data.

So instead of using efi_screen_info, let's declare struct sysfb_display 
with screen_info and edid_info.  The header would be linux/sysfb.h.  We 
transfer this to all related drivers.  The generic EFI code would set it 
up like efi_screen_info and the x86 code would decalre it at [4]; 
replacing the existing state.

Best regards
Thomas

[1] 
https://elixir.bootlin.com/linux/v6.17.8/source/drivers/firmware/sysfb.c#L205
[2] 
https://elixir.bootlin.com/linux/v6.17.8/source/drivers/gpu/drm/sysfb/efidrm.c#L162
[3] 
https://elixir.bootlin.com/linux/v6.17.8/source/drivers/gpu/drm/sysfb/efidrm.c#L206
[4] 
https://elixir.bootlin.com/linux/v6.17.8/source/arch/x86/kernel/setup.c#L214


>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Javier Martinez Canillas <javierm@redhat.com>
>
> Ard Biesheuvel (3):
>    efi: Wrap screen_info in efi_screen_info so edid_info can be added
>      later
>    video/edid: Use getter function for edid_info
>    efi: Add FIRMWARE_EDID support
>
>   arch/x86/kernel/setup.c                       |  8 ++++++--
>   drivers/firmware/efi/earlycon.c               |  1 -
>   drivers/firmware/efi/efi-init.c               | 19 ++++++++++++++-----
>   drivers/firmware/efi/libstub/efi-stub-entry.c |  3 +--
>   drivers/firmware/efi/libstub/efi-stub.c       | 16 ++++++++++------
>   drivers/firmware/efi/libstub/efistub.h        |  9 +++------
>   drivers/firmware/efi/libstub/gop.c            |  1 -
>   drivers/firmware/efi/libstub/screen_info.c    |  7 +++----
>   drivers/firmware/efi/libstub/zboot.c          |  2 +-
>   drivers/firmware/efi/sysfb_efi.c              |  1 -
>   drivers/gpu/drm/sysfb/efidrm.c                |  4 ++--
>   drivers/gpu/drm/sysfb/vesadrm.c               |  4 ++--
>   drivers/video/Kconfig                         |  2 +-
>   drivers/video/fbdev/core/fbmon.c              |  4 ++--
>   include/linux/efi.h                           | 10 +++++++++-
>   include/video/edid.h                          |  2 +-
>   16 files changed, 55 insertions(+), 38 deletions(-)
>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/3] video/efi: Support FIRMWARE_EDID on non-x86
  2025-11-20  7:56 ` [PATCH 0/3] video/efi: Support FIRMWARE_EDID on non-x86 Thomas Zimmermann
@ 2025-11-20  8:19   ` Thomas Zimmermann
  2025-11-20  8:25     ` Ard Biesheuvel
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Zimmermann @ 2025-11-20  8:19 UTC (permalink / raw)
  To: Ard Biesheuvel, linux-efi
  Cc: linux-kernel, Ard Biesheuvel, Javier Martinez Canillas



Am 20.11.25 um 08:56 schrieb Thomas Zimmermann:
> Hi,
>
> thanks for addressing the remaining EDID support.
>
> First of all, you need to cc dri-devel@lists.freedesktop.org  on any 
> further revisions.
>
> Am 19.11.25 um 13:30 schrieb Ard Biesheuvel:
>> From: Ard Biesheuvel <ardb@kernel.org>
>>
>> Refactor the screen_info handling so non-x86 platforms booting via the
>> EFI stub also have access to the EDID data exposed by the EFI boot
>> services.
>
> I don't like how this series complicates everything to make non-x86 
> easier. But the general idea of using efi_screen_info goes into the 
> right direction. It's just not generic enough.
>
> The sysfb code transfers struct screen_info as device parameter [1]. 
> Drivers later fetch it on probe [2].  The direct ref to the global 
> edid_info [3] only exists because we have no means of transferring it 
> as device data.
>
> So instead of using efi_screen_info, let's declare struct 
> sysfb_display with screen_info and edid_info.  The header would be 
> linux/sysfb.h.  We transfer this to all related drivers.  The generic 
> EFI code would set it up like efi_screen_info and the x86 code would 
> decalre it at [4]; replacing the existing state.

If this proposal works for EFI, I could do the changes in graphics 
drivers and then resubmit the EDID series with an additional patch for 
generic EFI.

>
> Best regards
> Thomas
>
> [1] 
> https://elixir.bootlin.com/linux/v6.17.8/source/drivers/firmware/sysfb.c#L205
> [2] 
> https://elixir.bootlin.com/linux/v6.17.8/source/drivers/gpu/drm/sysfb/efidrm.c#L162
> [3] 
> https://elixir.bootlin.com/linux/v6.17.8/source/drivers/gpu/drm/sysfb/efidrm.c#L206
> [4] 
> https://elixir.bootlin.com/linux/v6.17.8/source/arch/x86/kernel/setup.c#L214
>
>
>>
>> Cc: Thomas Zimmermann <tzimmermann@suse.de>
>> Cc: Javier Martinez Canillas <javierm@redhat.com>
>>
>> Ard Biesheuvel (3):
>>    efi: Wrap screen_info in efi_screen_info so edid_info can be added
>>      later
>>    video/edid: Use getter function for edid_info
>>    efi: Add FIRMWARE_EDID support
>>
>>   arch/x86/kernel/setup.c                       |  8 ++++++--
>>   drivers/firmware/efi/earlycon.c               |  1 -
>>   drivers/firmware/efi/efi-init.c               | 19 ++++++++++++++-----
>>   drivers/firmware/efi/libstub/efi-stub-entry.c |  3 +--
>>   drivers/firmware/efi/libstub/efi-stub.c       | 16 ++++++++++------
>>   drivers/firmware/efi/libstub/efistub.h        |  9 +++------
>>   drivers/firmware/efi/libstub/gop.c            |  1 -
>>   drivers/firmware/efi/libstub/screen_info.c    |  7 +++----
>>   drivers/firmware/efi/libstub/zboot.c          |  2 +-
>>   drivers/firmware/efi/sysfb_efi.c              |  1 -
>>   drivers/gpu/drm/sysfb/efidrm.c                |  4 ++--
>>   drivers/gpu/drm/sysfb/vesadrm.c               |  4 ++--
>>   drivers/video/Kconfig                         |  2 +-
>>   drivers/video/fbdev/core/fbmon.c              |  4 ++--
>>   include/linux/efi.h                           | 10 +++++++++-
>>   include/video/edid.h                          |  2 +-
>>   16 files changed, 55 insertions(+), 38 deletions(-)
>>
>

-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/3] video/efi: Support FIRMWARE_EDID on non-x86
  2025-11-20  8:19   ` Thomas Zimmermann
@ 2025-11-20  8:25     ` Ard Biesheuvel
  2025-11-21 14:03       ` Thomas Zimmermann
  0 siblings, 1 reply; 8+ messages in thread
From: Ard Biesheuvel @ 2025-11-20  8:25 UTC (permalink / raw)
  To: Thomas Zimmermann
  Cc: Ard Biesheuvel, linux-efi, linux-kernel, Javier Martinez Canillas

On Thu, 20 Nov 2025 at 09:19, Thomas Zimmermann <tzimmermann@suse.de> wrote:
>
>
>
> Am 20.11.25 um 08:56 schrieb Thomas Zimmermann:
> > Hi,
> >
> > thanks for addressing the remaining EDID support.
> >
> > First of all, you need to cc dri-devel@lists.freedesktop.org  on any
> > further revisions.
> >
> > Am 19.11.25 um 13:30 schrieb Ard Biesheuvel:
> >> From: Ard Biesheuvel <ardb@kernel.org>
> >>
> >> Refactor the screen_info handling so non-x86 platforms booting via the
> >> EFI stub also have access to the EDID data exposed by the EFI boot
> >> services.
> >
> > I don't like how this series complicates everything to make non-x86
> > easier. But the general idea of using efi_screen_info goes into the
> > right direction. It's just not generic enough.
> >
> > The sysfb code transfers struct screen_info as device parameter [1].
> > Drivers later fetch it on probe [2].  The direct ref to the global
> > edid_info [3] only exists because we have no means of transferring it
> > as device data.
> >
> > So instead of using efi_screen_info, let's declare struct
> > sysfb_display with screen_info and edid_info.  The header would be
> > linux/sysfb.h.  We transfer this to all related drivers.  The generic
> > EFI code would set it up like efi_screen_info and the x86 code would
> > decalre it at [4]; replacing the existing state.
>
> If this proposal works for EFI, I could do the changes in graphics
> drivers and then resubmit the EDID series with an additional patch for
> generic EFI.
>

That sounds great, thanks.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/3] video/efi: Support FIRMWARE_EDID on non-x86
  2025-11-20  8:25     ` Ard Biesheuvel
@ 2025-11-21 14:03       ` Thomas Zimmermann
  0 siblings, 0 replies; 8+ messages in thread
From: Thomas Zimmermann @ 2025-11-21 14:03 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: Ard Biesheuvel, linux-efi, linux-kernel, Javier Martinez Canillas

Hi

Am 20.11.25 um 09:25 schrieb Ard Biesheuvel:
> On Thu, 20 Nov 2025 at 09:19, Thomas Zimmermann <tzimmermann@suse.de> wrote:
>>
>>
>> Am 20.11.25 um 08:56 schrieb Thomas Zimmermann:
>>> Hi,
>>>
>>> thanks for addressing the remaining EDID support.
>>>
>>> First of all, you need to cc dri-devel@lists.freedesktop.org  on any
>>> further revisions.
>>>
>>> Am 19.11.25 um 13:30 schrieb Ard Biesheuvel:
>>>> From: Ard Biesheuvel <ardb@kernel.org>
>>>>
>>>> Refactor the screen_info handling so non-x86 platforms booting via the
>>>> EFI stub also have access to the EDID data exposed by the EFI boot
>>>> services.
>>> I don't like how this series complicates everything to make non-x86
>>> easier. But the general idea of using efi_screen_info goes into the
>>> right direction. It's just not generic enough.
>>>
>>> The sysfb code transfers struct screen_info as device parameter [1].
>>> Drivers later fetch it on probe [2].  The direct ref to the global
>>> edid_info [3] only exists because we have no means of transferring it
>>> as device data.
>>>
>>> So instead of using efi_screen_info, let's declare struct
>>> sysfb_display with screen_info and edid_info.  The header would be
>>> linux/sysfb.h.  We transfer this to all related drivers.  The generic
>>> EFI code would set it up like efi_screen_info and the x86 code would
>>> decalre it at [4]; replacing the existing state.
>> If this proposal works for EFI, I could do the changes in graphics
>> drivers and then resubmit the EDID series with an additional patch for
>> generic EFI.
>>
> That sounds great, thanks.

Series is out at 
https://lore.kernel.org/dri-devel/20251121135624.494768-1-tzimmermann@suse.de/ 
Once/if merged, we can implement EDID support on top of it for all of EFI.

Best regards
Thomas


-- 
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-11-21 14:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-19 12:30 [PATCH 0/3] video/efi: Support FIRMWARE_EDID on non-x86 Ard Biesheuvel
2025-11-19 12:30 ` [PATCH 1/3] efi: Wrap screen_info in efi_screen_info so edid_info can be added later Ard Biesheuvel
2025-11-19 12:30 ` [PATCH 2/3] video/edid: Use getter function for edid_info Ard Biesheuvel
2025-11-19 12:30 ` [PATCH 3/3] efi: Add FIRMWARE_EDID support Ard Biesheuvel
2025-11-20  7:56 ` [PATCH 0/3] video/efi: Support FIRMWARE_EDID on non-x86 Thomas Zimmermann
2025-11-20  8:19   ` Thomas Zimmermann
2025-11-20  8:25     ` Ard Biesheuvel
2025-11-21 14:03       ` Thomas Zimmermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox