[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250816153430.51235-2-ziyao@disroot.org>
Date: Sat, 16 Aug 2025 15:34:30 +0000
From: Yao Zi <ziyao@...root.org>
To: Thomas Zimmermann <tzimmermann@...e.de>,
Javier Martinez Canillas <javierm@...hat.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>
Cc: dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org,
Yao Zi <ziyao@...root.org>
Subject: [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.
Signed-off-by: Yao Zi <ziyao@...root.org>
---
drivers/gpu/drm/sysfb/efidrm.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/sysfb/efidrm.c b/drivers/gpu/drm/sysfb/efidrm.c
index 1883c4a8604c..7f76e8961788 100644
--- a/drivers/gpu/drm/sysfb/efidrm.c
+++ b/drivers/gpu/drm/sysfb/efidrm.c
@@ -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,
};
--
2.50.1
Powered by blists - more mailing lists