mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/vesadrm: Match framebuffer device by id instead of driver name
@ 2025-08-16 15:34 Yao Zi
  2025-08-16 15:34 ` [PATCH 2/2] drm/efidrm: " Yao Zi
  2025-08-18  7:17 ` [PATCH 1/2] drm/vesadrm: " Thomas Zimmermann
  0 siblings, 2 replies; 4+ messages in thread
From: Yao Zi @ 2025-08-16 15:34 UTC (permalink / raw)
  To: Thomas Zimmermann, Javier Martinez Canillas, Maarten Lankhorst,
	Maxime Ripard, David Airlie, Simona Vetter
  Cc: dri-devel, linux-kernel, Yao Zi

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.

Signed-off-by: Yao Zi <ziyao@disroot.org>
---
 drivers/gpu/drm/sysfb/vesadrm.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/sysfb/vesadrm.c b/drivers/gpu/drm/sysfb/vesadrm.c
index 90615e9ac86b..16635dc3d5cc 100644
--- a/drivers/gpu/drm/sysfb/vesadrm.c
+++ b/drivers/gpu/drm/sysfb/vesadrm.c
@@ -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,
 };
-- 
2.50.1


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

end of thread, other threads:[~2025-08-18  7:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-16 15:34 [PATCH 1/2] drm/vesadrm: Match framebuffer device by id instead of driver name Yao Zi
2025-08-16 15:34 ` [PATCH 2/2] drm/efidrm: " Yao Zi
2025-08-18  7:19   ` Thomas Zimmermann
2025-08-18  7:17 ` [PATCH 1/2] drm/vesadrm: " Thomas Zimmermann

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

all inboxes | Powered by JetHome®