From: Thomas Zimmermann <tzimmermann@suse.de>
To: ardb@kernel.org, javierm@redhat.com, arnd@arndb.de,
richard.lyu@suse.com, helgaas@kernel.org
Cc: x86@kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org,
loongarch@lists.linux.dev, linux-riscv@lists.infradead.org,
dri-devel@lists.freedesktop.org, linux-hyperv@vger.kernel.org,
linux-pci@vger.kernel.org, linux-fbdev@vger.kernel.org,
Thomas Zimmermann <tzimmermann@suse.de>
Subject: [PATCH v3 5/9] sysfb: Pass sysfb_primary_display to devices
Date: Wed, 26 Nov 2025 17:03:22 +0100 [thread overview]
Message-ID: <20251126160854.553077-6-tzimmermann@suse.de> (raw)
In-Reply-To: <20251126160854.553077-1-tzimmermann@suse.de>
Instead of screen_info, store a copy of sysfb_primary_display as
device data. Pick it up in drivers. Later changes will add additional
data to the display info, such as EDID information.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
---
drivers/firmware/sysfb.c | 5 +++--
drivers/gpu/drm/sysfb/efidrm.c | 9 ++++++---
drivers/gpu/drm/sysfb/vesadrm.c | 9 ++++++---
drivers/video/fbdev/efifb.c | 10 ++++++----
drivers/video/fbdev/vesafb.c | 10 ++++++----
drivers/video/fbdev/vga16fb.c | 8 +++++---
6 files changed, 32 insertions(+), 19 deletions(-)
diff --git a/drivers/firmware/sysfb.c b/drivers/firmware/sysfb.c
index 1f671f9219b0..8833582c1883 100644
--- a/drivers/firmware/sysfb.c
+++ b/drivers/firmware/sysfb.c
@@ -141,7 +141,8 @@ static struct device *sysfb_parent_dev(const struct screen_info *si)
static __init int sysfb_init(void)
{
- struct screen_info *si = &sysfb_primary_display.screen;
+ struct sysfb_display_info *dpy = &sysfb_primary_display;
+ struct screen_info *si = &dpy->screen;
struct device *parent;
unsigned int type;
struct simplefb_platform_data mode;
@@ -202,7 +203,7 @@ static __init int sysfb_init(void)
sysfb_set_efifb_fwnode(si, pd);
- ret = platform_device_add_data(pd, si, sizeof(*si));
+ ret = platform_device_add_data(pd, dpy, sizeof(*dpy));
if (ret)
goto err;
diff --git a/drivers/gpu/drm/sysfb/efidrm.c b/drivers/gpu/drm/sysfb/efidrm.c
index 1b683d55d6ea..29533ae8fbbf 100644
--- a/drivers/gpu/drm/sysfb/efidrm.c
+++ b/drivers/gpu/drm/sysfb/efidrm.c
@@ -4,7 +4,7 @@
#include <linux/efi.h>
#include <linux/limits.h>
#include <linux/platform_device.h>
-#include <linux/screen_info.h>
+#include <linux/sysfb.h>
#include <drm/clients/drm_client_setup.h>
#include <drm/drm_atomic.h>
@@ -141,6 +141,7 @@ static const struct drm_mode_config_funcs efidrm_mode_config_funcs = {
static struct efidrm_device *efidrm_device_create(struct drm_driver *drv,
struct platform_device *pdev)
{
+ const struct sysfb_display_info *dpy;
const struct screen_info *si;
const struct drm_format_info *format;
int width, height, stride;
@@ -160,9 +161,11 @@ static struct efidrm_device *efidrm_device_create(struct drm_driver *drv,
size_t nformats;
int ret;
- si = dev_get_platdata(&pdev->dev);
- if (!si)
+ dpy = dev_get_platdata(&pdev->dev);
+ if (!dpy)
return ERR_PTR(-ENODEV);
+ si = &dpy->screen;
+
if (screen_info_video_type(si) != VIDEO_TYPE_EFI)
return ERR_PTR(-ENODEV);
diff --git a/drivers/gpu/drm/sysfb/vesadrm.c b/drivers/gpu/drm/sysfb/vesadrm.c
index 7b7b5ba26317..16fc223f8c5b 100644
--- a/drivers/gpu/drm/sysfb/vesadrm.c
+++ b/drivers/gpu/drm/sysfb/vesadrm.c
@@ -4,7 +4,7 @@
#include <linux/ioport.h>
#include <linux/limits.h>
#include <linux/platform_device.h>
-#include <linux/screen_info.h>
+#include <linux/sysfb.h>
#include <drm/clients/drm_client_setup.h>
#include <drm/drm_atomic.h>
@@ -391,6 +391,7 @@ static const struct drm_mode_config_funcs vesadrm_mode_config_funcs = {
static struct vesadrm_device *vesadrm_device_create(struct drm_driver *drv,
struct platform_device *pdev)
{
+ const struct sysfb_display_info *dpy;
const struct screen_info *si;
const struct drm_format_info *format;
int width, height, stride;
@@ -410,9 +411,11 @@ static struct vesadrm_device *vesadrm_device_create(struct drm_driver *drv,
size_t nformats;
int ret;
- si = dev_get_platdata(&pdev->dev);
- if (!si)
+ dpy = dev_get_platdata(&pdev->dev);
+ if (!dpy)
return ERR_PTR(-ENODEV);
+ si = &dpy->screen;
+
if (screen_info_video_type(si) != VIDEO_TYPE_VLFB)
return ERR_PTR(-ENODEV);
diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c
index 0e1bd3dba255..47ebc0107209 100644
--- a/drivers/video/fbdev/efifb.c
+++ b/drivers/video/fbdev/efifb.c
@@ -15,7 +15,7 @@
#include <linux/fb.h>
#include <linux/platform_device.h>
#include <linux/printk.h>
-#include <linux/screen_info.h>
+#include <linux/sysfb.h>
#include <video/vga.h>
#include <asm/efi.h>
#include <drm/drm_utils.h> /* For drm_get_panel_orientation_quirk */
@@ -345,6 +345,7 @@ ATTRIBUTE_GROUPS(efifb);
static int efifb_probe(struct platform_device *dev)
{
+ struct sysfb_display_info *dpy;
struct screen_info *si;
struct fb_info *info;
struct efifb_par *par;
@@ -360,10 +361,11 @@ static int efifb_probe(struct platform_device *dev)
* driver. We get a copy of the attached screen_info, so that we can
* modify its values without affecting later drivers.
*/
- si = dev_get_platdata(&dev->dev);
- if (!si)
+ dpy = dev_get_platdata(&dev->dev);
+ if (!dpy)
return -ENODEV;
- si = devm_kmemdup(&dev->dev, si, sizeof(*si), GFP_KERNEL);
+
+ si = devm_kmemdup(&dev->dev, &dpy->screen, sizeof(*si), GFP_KERNEL);
if (!si)
return -ENOMEM;
diff --git a/drivers/video/fbdev/vesafb.c b/drivers/video/fbdev/vesafb.c
index f135033c22fb..f84f4db244bf 100644
--- a/drivers/video/fbdev/vesafb.c
+++ b/drivers/video/fbdev/vesafb.c
@@ -20,7 +20,7 @@
#include <linux/ioport.h>
#include <linux/init.h>
#include <linux/platform_device.h>
-#include <linux/screen_info.h>
+#include <linux/sysfb.h>
#include <linux/io.h>
#include <video/vga.h>
@@ -243,6 +243,7 @@ static int vesafb_setup(char *options)
static int vesafb_probe(struct platform_device *dev)
{
+ struct sysfb_display_info *dpy;
struct screen_info *si;
struct fb_info *info;
struct vesafb_par *par;
@@ -257,10 +258,11 @@ static int vesafb_probe(struct platform_device *dev)
* driver. We get a copy of the attached screen_info, so that we can
* modify its values without affecting later drivers.
*/
- si = dev_get_platdata(&dev->dev);
- if (!si)
+ dpy = dev_get_platdata(&dev->dev);
+ if (!dpy)
return -ENODEV;
- si = devm_kmemdup(&dev->dev, si, sizeof(*si), GFP_KERNEL);
+
+ si = devm_kmemdup(&dev->dev, &dpy->screen, sizeof(*si), GFP_KERNEL);
if (!si)
return -ENOMEM;
diff --git a/drivers/video/fbdev/vga16fb.c b/drivers/video/fbdev/vga16fb.c
index 6b81337a4909..22085d3668e8 100644
--- a/drivers/video/fbdev/vga16fb.c
+++ b/drivers/video/fbdev/vga16fb.c
@@ -21,7 +21,7 @@
#include <linux/ioport.h>
#include <linux/init.h>
#include <linux/platform_device.h>
-#include <linux/screen_info.h>
+#include <linux/sysfb.h>
#include <asm/io.h>
#include <video/vga.h>
@@ -1305,15 +1305,17 @@ static const struct fb_ops vga16fb_ops = {
static int vga16fb_probe(struct platform_device *dev)
{
+ struct sysfb_display_info *dpy;
struct screen_info *si;
struct fb_info *info;
struct vga16fb_par *par;
int i;
int ret = 0;
- si = dev_get_platdata(&dev->dev);
- if (!si)
+ dpy = dev_get_platdata(&dev->dev);
+ if (!dpy)
return -ENODEV;
+ si = &dpy->screen;
ret = check_mode_supported(si);
if (ret)
--
2.51.1
next prev parent reply other threads:[~2025-11-26 16:09 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-26 16:03 [PATCH v3 0/9] arch,sysfb,efi: Support EDID on non-x86 EFI systems Thomas Zimmermann
2025-11-26 16:03 ` [PATCH v3 1/9] efi: earlycon: Reduce number of references to global screen_info Thomas Zimmermann
2025-11-26 16:03 ` [PATCH v3 2/9] efi: sysfb_efi: " Thomas Zimmermann
2025-11-26 16:03 ` [PATCH v3 3/9] sysfb: Add struct sysfb_display_info Thomas Zimmermann
2025-11-27 1:18 ` Richard Lyu
2025-11-26 16:03 ` [PATCH v3 4/9] sysfb: Replace screen_info with sysfb_primary_display Thomas Zimmermann
2025-11-27 1:21 ` Richard Lyu
2025-11-26 16:03 ` Thomas Zimmermann [this message]
2025-11-27 1:23 ` [PATCH v3 5/9] sysfb: Pass sysfb_primary_display to devices Richard Lyu
2025-11-26 16:03 ` [PATCH v3 6/9] sysfb: Move edid_info into sysfb_primary_display Thomas Zimmermann
2025-11-26 16:03 ` [PATCH v3 7/9] efi: Refactor init_primary_display() helpers Thomas Zimmermann
2025-12-16 13:40 ` Ard Biesheuvel
2025-11-26 16:03 ` [PATCH v3 8/9] efi: Support EDID information Thomas Zimmermann
2025-11-26 16:03 ` [PATCH v3 9/9] efi: libstub: Simplify interfaces for primary_display Thomas Zimmermann
2025-12-16 13:23 ` Ard Biesheuvel
2025-12-21 16:18 ` Thomas Zimmermann
2025-11-27 2:20 ` [PATCH v3 0/9] arch,sysfb,efi: Support EDID on non-x86 EFI systems Richard Lyu
2025-11-27 7:43 ` Thomas Zimmermann
2025-12-04 9:17 ` Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251126160854.553077-6-tzimmermann@suse.de \
--to=tzimmermann@suse.de \
--cc=ardb@kernel.org \
--cc=arnd@arndb.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=helgaas@kernel.org \
--cc=javierm@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=loongarch@lists.linux.dev \
--cc=richard.lyu@suse.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).