Skip to content

Commit 21289ec

Browse files
Ard BiesheuvelIngo Molnar
authored andcommitted
x86/efi/efifb: Move DMI based quirks handling out of generic code
The efifb quirks handling based on DMI identification of the platform is specific to x86, so move it to x86 arch code. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk> Acked-by: David Herrmann <dh.herrmann@gmail.com> Acked-by: Peter Jones <pjones@redhat.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Will Deacon <will.deacon@arm.com> Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/1461614832-17633-19-git-send-email-matt@codeblueprint.co.uk Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent fc37206 commit 21289ec

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed

arch/x86/include/asm/efi.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ static inline bool efi_runtime_supported(void)
180180
extern struct console early_efi_console;
181181
extern void parse_efi_setup(u64 phys_addr, u32 data_len);
182182

183+
extern void efifb_setup_from_dmi(struct screen_info *si, const char *opt);
184+
183185
#ifdef CONFIG_EFI_MIXED
184186
extern void efi_thunk_runtime_setup(void);
185187
extern efi_status_t efi_thunk_set_virtual_address_map(

arch/x86/kernel/sysfb_efi.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,21 @@ struct efifb_dmi_info efifb_dmi_list[] = {
6868
[M_UNKNOWN] = { NULL, 0, 0, 0, 0, OVERRIDE_NONE }
6969
};
7070

71+
void efifb_setup_from_dmi(struct screen_info *si, const char *opt)
72+
{
73+
int i;
74+
75+
for (i = 0; i < M_UNKNOWN; i++) {
76+
if (efifb_dmi_list[i].base != 0 &&
77+
!strcmp(opt, efifb_dmi_list[i].optname)) {
78+
si->lfb_base = efifb_dmi_list[i].base;
79+
si->lfb_linelength = efifb_dmi_list[i].stride;
80+
si->lfb_width = efifb_dmi_list[i].width;
81+
si->lfb_height = efifb_dmi_list[i].height;
82+
}
83+
}
84+
}
85+
7186
#define choose_value(dmivalue, fwvalue, field, flags) ({ \
7287
typeof(fwvalue) _ret_ = fwvalue; \
7388
if ((flags) & (field)) \

drivers/video/fbdev/efifb.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88

99
#include <linux/module.h>
1010
#include <linux/kernel.h>
11+
#include <linux/efi.h>
1112
#include <linux/errno.h>
1213
#include <linux/fb.h>
1314
#include <linux/platform_device.h>
1415
#include <linux/screen_info.h>
1516
#include <linux/dmi.h>
1617
#include <linux/pci.h>
1718
#include <video/vga.h>
18-
#include <asm/sysfb.h>
19+
#include <asm/efi.h>
1920

2021
static bool request_mem_succeeded = false;
2122

@@ -85,21 +86,13 @@ static struct fb_ops efifb_ops = {
8586
static int efifb_setup(char *options)
8687
{
8788
char *this_opt;
88-
int i;
8989

9090
if (options && *options) {
9191
while ((this_opt = strsep(&options, ",")) != NULL) {
9292
if (!*this_opt) continue;
9393

94-
for (i = 0; i < M_UNKNOWN; i++) {
95-
if (efifb_dmi_list[i].base != 0 &&
96-
!strcmp(this_opt, efifb_dmi_list[i].optname)) {
97-
screen_info.lfb_base = efifb_dmi_list[i].base;
98-
screen_info.lfb_linelength = efifb_dmi_list[i].stride;
99-
screen_info.lfb_width = efifb_dmi_list[i].width;
100-
screen_info.lfb_height = efifb_dmi_list[i].height;
101-
}
102-
}
94+
efifb_setup_from_dmi(&screen_info, this_opt);
95+
10396
if (!strncmp(this_opt, "base:", 5))
10497
screen_info.lfb_base = simple_strtoul(this_opt+5, NULL, 0);
10598
else if (!strncmp(this_opt, "stride:", 7))

0 commit comments

Comments
 (0)