Skip to contentSkip to conversation

drm/vesadrm: Match framebuffer device by id instead of driver name

PATCH NAK Yao Zi 2 participants 4 messages Aug 16, 2025 – Aug 18, 2025

Subsystems (3)
lore
Share & tools
lore

Yao Zi

author
#0 lore raw

PATCH 1/2 drm/vesadrm: Match framebuffer device by id instead of driver name

Currently the driver matches the platform framebuffer device registered by sysfb through driver name, "vesa-framebuffer", this is a little confusing since this driver registers a DRM device, instead of a framebuffer.

Moreover, we have a driver with the same name, enabled by CONFIG_FB_VESA, that acts as a consumer of vesa-framebuffer as well. They cannot be both loaded into the kernel.

Making these two drivers coexist is sometimes useful, e.g., a distribution may want to build fbcon into the kernel image for debugging purpose, but keep the whole DRM subsystem enabled as module. In such case vesadrm could serve as a solution for running DRM-specific userspace programs on platforms with only VESA VBIOS available.

Let's rename the driver as "vesa-display" to avoid possible confusion. A platform_device_id table is introduced to match "vesa-framebuffer" devices.

---
 drivers/gpu/drm/sysfb/vesadrm.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/sysfb/vesadrm.c +9 -1
index 90615e9ac86b..16635dc3d5cc 100644
@@ -3,6 +3,7 @@
 #include <linux/aperture.h>
 #include <linux/ioport.h>
 #include <linux/limits.h>
+#include <linux/mod_devicetable.h>
 #include <linux/platform_device.h>
 #include <linux/screen_info.h>
 
@@ -517,10 +518,17 @@ static void vesadrm_remove(struct platform_device *pdev)
 	drm_dev_unplug(dev);
 }
 
+static const struct platform_device_id vesadrm_platform_id[] = {
+	{ "vesa-framebuffer" },
+	{ },
+};
+MODULE_DEVICE_TABLE(platform, vesadrm_platform_id);
+
 static struct platform_driver vesadrm_platform_driver = {
 	.driver = {
-		.name = "vesa-framebuffer",
+		.name = "vesa-display",
 	},
+	.id_table = vesadrm_platform_id,
 	.probe = vesadrm_probe,
 	.remove = vesadrm_remove,
 };
Signature · 1 line
2.50.1
author
#1 lore raw

PATCH 2/2 drm/efidrm: Match framebuffer device by id instead of driver name

Currently the driver matches the platform framebuffer device registered by sysfb through driver name, "efi-framebuffer", this is a little confusing since this driver registers a DRM device, instead of a framebuffer.

Moreover, we have a driver with the same name, enabled by CONFIG_FB_EFI, that acts as a consumer of efi-framebuffer as well. They cannot be both loaded into the kernel.

Making these two drivers coexist is sometimes useful, e.g., a distribution may want to build fbcon into the kernel image for debugging purpose, but keep the whole DRM subsystem enabled as module. In such case efidrm could serve as a solution for running DRM-specific userspace programs on platforms with only UEFI framebuffer supplied.

Let's rename the driver as "efi-display" to avoid possible confusion. A platform_device_id table is introduced to match "efi-framebuffer" devices.

---
 drivers/gpu/drm/sysfb/efidrm.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/sysfb/efidrm.c +9 -1
index 1883c4a8604c..7f76e8961788 100644
@@ -3,6 +3,7 @@
 #include <linux/aperture.h>
 #include <linux/efi.h>
 #include <linux/limits.h>
+#include <linux/mod_devicetable.h>
 #include <linux/platform_device.h>
 #include <linux/screen_info.h>
 
@@ -375,10 +376,17 @@ static void efidrm_remove(struct platform_device *pdev)
 	drm_dev_unplug(dev);
 }
 
+static const struct platform_device_id efidrm_platform_id[] = {
+	{ "efi-framebuffer" },
+	{ },
+};
+MODULE_DEVICE_TABLE(platform, efidrm_platform_id);
+
 static struct platform_driver efidrm_platform_driver = {
 	.driver = {
-		.name = "efi-framebuffer",
+		.name = "efi-display",
 	},
+	.id_table = efidrm_platform_id,
 	.probe = efidrm_probe,
 	.remove = efidrm_remove,
 };
Signature · 1 line
2.50.1
maintainer NAK
#2 lore raw

Re: [PATCH 2/2] drm/efidrm: Match framebuffer device by id instead of driver name

Hi

Am 16.08.25 um 17:34 schrieb Yao Zi:

Quoted 15 lines

Currently the driver matches the platform framebuffer device registered by sysfb through driver name, "efi-framebuffer", this is a little confusing since this driver registers a DRM device, instead of a framebuffer.

Moreover, we have a driver with the same name, enabled by CONFIG_FB_EFI, that acts as a consumer of efi-framebuffer as well. They cannot be both loaded into the kernel.

Making these two drivers coexist is sometimes useful, e.g., a distribution may want to build fbcon into the kernel image for debugging purpose, but keep the whole DRM subsystem enabled as module. In such case efidrm could serve as a solution for running DRM-specific userspace programs on platforms with only UEFI framebuffer supplied.

Quoted 3 lines

Let's rename the driver as "efi-display" to avoid possible confusion. A platform_device_id table is introduced to match "efi-framebuffer" devices.

NAK, please see the rsp vesa-framebuffer patch for the rational

https://lore.kernel.org/dri-devel/[email protected]/

Best regards
Thomas

Quoted 37 lines
---
  drivers/gpu/drm/sysfb/efidrm.c | 10 +++++++++-
  1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/sysfb/efidrm.c +9 -1
index 1883c4a8604c..7f76e8961788 100644
@@ -3,6 +3,7 @@
  #include <linux/aperture.h>
  #include <linux/efi.h>
  #include <linux/limits.h>
+#include <linux/mod_devicetable.h>
  #include <linux/platform_device.h>
  #include <linux/screen_info.h>
 
@@ -375,10 +376,17 @@ static void efidrm_remove(struct platform_device *pdev)
  	drm_dev_unplug(dev);
  }
 
+static const struct platform_device_id efidrm_platform_id[] = {
+	{ "efi-framebuffer" },
+	{ },
+};
+MODULE_DEVICE_TABLE(platform, efidrm_platform_id);
+
  static struct platform_driver efidrm_platform_driver = {
  	.driver = {
-		.name = "efi-framebuffer",
+		.name = "efi-display",
  	},
+	.id_table = efidrm_platform_id,
  	.probe = efidrm_probe,
  	.remove = efidrm_remove,
  };
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 NAK
#3 lore raw
In reply to Yao Zi

Hi

Am 16.08.25 um 17:34 schrieb Yao Zi:

Quoted 8 lines

Currently the driver matches the platform framebuffer device registered by sysfb through driver name, "vesa-framebuffer", this is a little confusing since this driver registers a DRM device, instead of a framebuffer.

Moreover, we have a driver with the same name, enabled by CONFIG_FB_VESA, that acts as a consumer of vesa-framebuffer as well. They cannot be both loaded into the kernel.

That is intentional and desired. Please pick one of the drivers and use that. Vesafb is obsolete, but it's slightly smaller footprint might make s difference on ancient systems. For anything new, vesadrm is a better choice.

Quoted 6 lines

Making these two drivers coexist is sometimes useful, e.g., a distribution may want to build fbcon into the kernel image for debugging purpose, but keep the whole DRM subsystem enabled as module. In such case vesadrm could serve as a solution for running DRM-specific userspace programs on platforms with only VESA VBIOS available.

You can do debugging with vesadrm as well. We also have DRM-based panic output if you just want the stack trace. If that's not enough, please build better debugging infrastructure for DRM.

Quoted 4 lines

Let's rename the driver as "vesa-display" to avoid possible confusion. A platform_device_id table is introduced to match "vesa-framebuffer" devices.

NAK.

Best regards
Thomas

Quoted 37 lines
---
  drivers/gpu/drm/sysfb/vesadrm.c | 10 +++++++++-
  1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/sysfb/vesadrm.c +9 -1
index 90615e9ac86b..16635dc3d5cc 100644
@@ -3,6 +3,7 @@
  #include <linux/aperture.h>
  #include <linux/ioport.h>
  #include <linux/limits.h>
+#include <linux/mod_devicetable.h>
  #include <linux/platform_device.h>
  #include <linux/screen_info.h>
 
@@ -517,10 +518,17 @@ static void vesadrm_remove(struct platform_device *pdev)
  	drm_dev_unplug(dev);
  }
 
+static const struct platform_device_id vesadrm_platform_id[] = {
+	{ "vesa-framebuffer" },
+	{ },
+};
+MODULE_DEVICE_TABLE(platform, vesadrm_platform_id);
+
  static struct platform_driver vesadrm_platform_driver = {
  	.driver = {
-		.name = "vesa-framebuffer",
+		.name = "vesa-display",
  	},
+	.id_table = vesadrm_platform_id,
  	.probe = vesadrm_probe,
  	.remove = vesadrm_remove,
  };
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)