Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

sysfb: Pass sysfb_primary_display to devices

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>
Reviewed-by: Richard Lyu <richard.lyu@suse.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

authored by

Thomas Zimmermann and committed by
Ard Biesheuvel
08e583ad a41e0ab3

+32 -19
+3 -2
drivers/firmware/sysfb.c
··· 141 141 142 142 static __init int sysfb_init(void) 143 143 { 144 - struct screen_info *si = &sysfb_primary_display.screen; 144 + struct sysfb_display_info *dpy = &sysfb_primary_display; 145 + struct screen_info *si = &dpy->screen; 145 146 struct device *parent; 146 147 unsigned int type; 147 148 struct simplefb_platform_data mode; ··· 203 202 204 203 sysfb_set_efifb_fwnode(si, pd); 205 204 206 - ret = platform_device_add_data(pd, si, sizeof(*si)); 205 + ret = platform_device_add_data(pd, dpy, sizeof(*dpy)); 207 206 if (ret) 208 207 goto err; 209 208
+6 -3
drivers/gpu/drm/sysfb/efidrm.c
··· 4 4 #include <linux/efi.h> 5 5 #include <linux/limits.h> 6 6 #include <linux/platform_device.h> 7 - #include <linux/screen_info.h> 7 + #include <linux/sysfb.h> 8 8 9 9 #include <drm/clients/drm_client_setup.h> 10 10 #include <drm/drm_atomic.h> ··· 141 141 static struct efidrm_device *efidrm_device_create(struct drm_driver *drv, 142 142 struct platform_device *pdev) 143 143 { 144 + const struct sysfb_display_info *dpy; 144 145 const struct screen_info *si; 145 146 const struct drm_format_info *format; 146 147 int width, height, stride; ··· 161 160 size_t nformats; 162 161 int ret; 163 162 164 - si = dev_get_platdata(&pdev->dev); 165 - if (!si) 163 + dpy = dev_get_platdata(&pdev->dev); 164 + if (!dpy) 166 165 return ERR_PTR(-ENODEV); 166 + si = &dpy->screen; 167 + 167 168 if (screen_info_video_type(si) != VIDEO_TYPE_EFI) 168 169 return ERR_PTR(-ENODEV); 169 170
+6 -3
drivers/gpu/drm/sysfb/vesadrm.c
··· 4 4 #include <linux/ioport.h> 5 5 #include <linux/limits.h> 6 6 #include <linux/platform_device.h> 7 - #include <linux/screen_info.h> 7 + #include <linux/sysfb.h> 8 8 9 9 #include <drm/clients/drm_client_setup.h> 10 10 #include <drm/drm_atomic.h> ··· 391 391 static struct vesadrm_device *vesadrm_device_create(struct drm_driver *drv, 392 392 struct platform_device *pdev) 393 393 { 394 + const struct sysfb_display_info *dpy; 394 395 const struct screen_info *si; 395 396 const struct drm_format_info *format; 396 397 int width, height, stride; ··· 411 410 size_t nformats; 412 411 int ret; 413 412 414 - si = dev_get_platdata(&pdev->dev); 415 - if (!si) 413 + dpy = dev_get_platdata(&pdev->dev); 414 + if (!dpy) 416 415 return ERR_PTR(-ENODEV); 416 + si = &dpy->screen; 417 + 417 418 if (screen_info_video_type(si) != VIDEO_TYPE_VLFB) 418 419 return ERR_PTR(-ENODEV); 419 420
+6 -4
drivers/video/fbdev/efifb.c
··· 15 15 #include <linux/fb.h> 16 16 #include <linux/platform_device.h> 17 17 #include <linux/printk.h> 18 - #include <linux/screen_info.h> 18 + #include <linux/sysfb.h> 19 19 #include <video/vga.h> 20 20 #include <asm/efi.h> 21 21 #include <drm/drm_utils.h> /* For drm_get_panel_orientation_quirk */ ··· 345 345 346 346 static int efifb_probe(struct platform_device *dev) 347 347 { 348 + struct sysfb_display_info *dpy; 348 349 struct screen_info *si; 349 350 struct fb_info *info; 350 351 struct efifb_par *par; ··· 361 360 * driver. We get a copy of the attached screen_info, so that we can 362 361 * modify its values without affecting later drivers. 363 362 */ 364 - si = dev_get_platdata(&dev->dev); 365 - if (!si) 363 + dpy = dev_get_platdata(&dev->dev); 364 + if (!dpy) 366 365 return -ENODEV; 367 - si = devm_kmemdup(&dev->dev, si, sizeof(*si), GFP_KERNEL); 366 + 367 + si = devm_kmemdup(&dev->dev, &dpy->screen, sizeof(*si), GFP_KERNEL); 368 368 if (!si) 369 369 return -ENOMEM; 370 370
+6 -4
drivers/video/fbdev/vesafb.c
··· 20 20 #include <linux/ioport.h> 21 21 #include <linux/init.h> 22 22 #include <linux/platform_device.h> 23 - #include <linux/screen_info.h> 23 + #include <linux/sysfb.h> 24 24 #include <linux/io.h> 25 25 26 26 #include <video/vga.h> ··· 243 243 244 244 static int vesafb_probe(struct platform_device *dev) 245 245 { 246 + struct sysfb_display_info *dpy; 246 247 struct screen_info *si; 247 248 struct fb_info *info; 248 249 struct vesafb_par *par; ··· 258 257 * driver. We get a copy of the attached screen_info, so that we can 259 258 * modify its values without affecting later drivers. 260 259 */ 261 - si = dev_get_platdata(&dev->dev); 262 - if (!si) 260 + dpy = dev_get_platdata(&dev->dev); 261 + if (!dpy) 263 262 return -ENODEV; 264 - si = devm_kmemdup(&dev->dev, si, sizeof(*si), GFP_KERNEL); 263 + 264 + si = devm_kmemdup(&dev->dev, &dpy->screen, sizeof(*si), GFP_KERNEL); 265 265 if (!si) 266 266 return -ENOMEM; 267 267
+5 -3
drivers/video/fbdev/vga16fb.c
··· 21 21 #include <linux/ioport.h> 22 22 #include <linux/init.h> 23 23 #include <linux/platform_device.h> 24 - #include <linux/screen_info.h> 24 + #include <linux/sysfb.h> 25 25 26 26 #include <asm/io.h> 27 27 #include <video/vga.h> ··· 1305 1305 1306 1306 static int vga16fb_probe(struct platform_device *dev) 1307 1307 { 1308 + struct sysfb_display_info *dpy; 1308 1309 struct screen_info *si; 1309 1310 struct fb_info *info; 1310 1311 struct vga16fb_par *par; 1311 1312 int i; 1312 1313 int ret = 0; 1313 1314 1314 - si = dev_get_platdata(&dev->dev); 1315 - if (!si) 1315 + dpy = dev_get_platdata(&dev->dev); 1316 + if (!dpy) 1316 1317 return -ENODEV; 1318 + si = &dpy->screen; 1317 1319 1318 1320 ret = check_mode_supported(si); 1319 1321 if (ret)