Skip to content

Commit 4fcae63

Browse files
tdzardbiesheuvel
authored andcommitted
sysfb: Move edid_info into sysfb_primary_display
Move x86's edid_info into sysfb_primary_display as a new field named edid. Adapt all users. An instance of edid_info has only been defined on x86. With the move into sysfb_primary_display, it becomes available on all architectures. Therefore remove this contraint from CONFIG_FIRMWARE_EDID. x86 fills the EDID data from boot_params.edid_info. DRM drivers pick up the raw data and make it available to DRM clients. Replace the drivers' references to edid_info and instead use the sysfb_display_info as passed from sysfb. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
1 parent 08e583a commit 4fcae63

6 files changed

Lines changed: 16 additions & 18 deletions

File tree

arch/x86/kernel/setup.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,6 @@ arch_initcall(init_x86_sysctl);
215215

216216
struct sysfb_display_info sysfb_primary_display;
217217
EXPORT_SYMBOL(sysfb_primary_display);
218-
#if defined(CONFIG_FIRMWARE_EDID)
219-
struct edid_info edid_info;
220-
EXPORT_SYMBOL_GPL(edid_info);
221-
#endif
222218

223219
extern int root_mountflags;
224220

@@ -530,7 +526,7 @@ static void __init parse_boot_params(void)
530526
ROOT_DEV = old_decode_dev(boot_params.hdr.root_dev);
531527
sysfb_primary_display.screen = boot_params.screen_info;
532528
#if defined(CONFIG_FIRMWARE_EDID)
533-
edid_info = boot_params.edid_info;
529+
sysfb_primary_display.edid = boot_params.edid_info;
534530
#endif
535531
#ifdef CONFIG_X86_32
536532
apm_info.bios = boot_params.apm_bios_info;

drivers/gpu/drm/sysfb/efidrm.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include <drm/drm_print.h>
2525
#include <drm/drm_probe_helper.h>
2626

27-
#include <video/edid.h>
2827
#include <video/pixel_format.h>
2928

3029
#include "drm_sysfb_helper.h"
@@ -207,8 +206,8 @@ static struct efidrm_device *efidrm_device_create(struct drm_driver *drv,
207206
&format->format, width, height, stride);
208207

209208
#if defined(CONFIG_FIRMWARE_EDID)
210-
if (drm_edid_header_is_valid(edid_info.dummy) == 8)
211-
sysfb->edid = edid_info.dummy;
209+
if (drm_edid_header_is_valid(dpy->edid.dummy) == 8)
210+
sysfb->edid = dpy->edid.dummy;
212211
#endif
213212
sysfb->fb_mode = drm_sysfb_mode(width, height, 0, 0);
214213
sysfb->fb_format = format;

drivers/gpu/drm/sysfb/vesadrm.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include <drm/drm_print.h>
2626
#include <drm/drm_probe_helper.h>
2727

28-
#include <video/edid.h>
2928
#include <video/pixel_format.h>
3029
#include <video/vga.h>
3130

@@ -474,8 +473,8 @@ static struct vesadrm_device *vesadrm_device_create(struct drm_driver *drv,
474473
}
475474

476475
#if defined(CONFIG_FIRMWARE_EDID)
477-
if (drm_edid_header_is_valid(edid_info.dummy) == 8)
478-
sysfb->edid = edid_info.dummy;
476+
if (drm_edid_header_is_valid(dpy->edid.dummy) == 8)
477+
sysfb->edid = dpy->edid.dummy;
479478
#endif
480479
sysfb->fb_mode = drm_sysfb_mode(width, height, 0, 0);
481480
sysfb->fb_format = format;

drivers/video/fbdev/core/fbmon.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@
3232
#include <linux/module.h>
3333
#include <linux/pci.h>
3434
#include <linux/slab.h>
35-
#include <video/edid.h>
35+
#include <linux/string_choices.h>
36+
#include <linux/sysfb.h>
37+
3638
#include <video/of_videomode.h>
3739
#include <video/videomode.h>
40+
3841
#include "../edid.h"
39-
#include <linux/string_choices.h>
4042

4143
/*
4244
* EDID parser
@@ -1504,7 +1506,7 @@ const unsigned char *fb_firmware_edid(struct device *device)
15041506
res = &dev->resource[PCI_ROM_RESOURCE];
15051507

15061508
if (res && res->flags & IORESOURCE_ROM_SHADOW)
1507-
edid = edid_info.dummy;
1509+
edid = sysfb_primary_display.edid.dummy;
15081510

15091511
return edid;
15101512
}

include/linux/sysfb.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#include <linux/screen_info.h>
1313
#include <linux/types.h>
1414

15+
#include <video/edid.h>
16+
1517
struct device;
1618
struct platform_device;
1719
struct screen_info;
@@ -62,6 +64,10 @@ struct efifb_dmi_info {
6264

6365
struct sysfb_display_info {
6466
struct screen_info screen;
67+
68+
#if defined(CONFIG_FIRMWARE_EDID)
69+
struct edid_info edid;
70+
#endif
6571
};
6672

6773
extern struct sysfb_display_info sysfb_primary_display;

include/video/edid.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,4 @@
44

55
#include <uapi/video/edid.h>
66

7-
#if defined(CONFIG_FIRMWARE_EDID)
8-
extern struct edid_info edid_info;
9-
#endif
10-
117
#endif /* __linux_video_edid_h__ */

0 commit comments

Comments
 (0)