From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Fleming Subject: Re: [PATCH 4/8] efi/x86: efifb: move DMI based quirks handling out of generic code Date: Fri, 18 Mar 2016 10:50:07 +0000 Message-ID: <20160318105007.GM2619@codeblueprint.co.uk> References: <1457588408-19309-1-git-send-email-ard.biesheuvel@linaro.org> <1457588408-19309-5-git-send-email-ard.biesheuvel@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1457588408-19309-5-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Sender: linux-efi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Ard Biesheuvel Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org, catalin.marinas-5wv7dgnIgG8@public.gmane.org, will.deacon-5wv7dgnIgG8@public.gmane.org, x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, mark.rutland-5wv7dgnIgG8@public.gmane.org, leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, Peter Jones , David Herrmann List-Id: linux-efi@vger.kernel.org (Cc'ing efifb maintainer and sysfb_efi.c author) On Thu, 10 Mar, at 12:40:04PM, Ard Biesheuvel wrote: > 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 > --- > arch/x86/include/asm/efi.h | 2 ++ > arch/x86/kernel/sysfb_efi.c | 15 +++++++++++++++ > drivers/video/fbdev/efifb.c | 15 ++++----------- > 3 files changed, 21 insertions(+), 11 deletions(-) I've left the patch content intact below. This looks like a worthwhile change to me. David, Peter, any comments? > diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h > index 7d5187b66108..790adbc3a64a 100644 > --- a/arch/x86/include/asm/efi.h > +++ b/arch/x86/include/asm/efi.h > @@ -154,6 +154,8 @@ static inline bool efi_runtime_supported(void) > extern struct console early_efi_console; > extern void parse_efi_setup(u64 phys_addr, u32 data_len); > > +extern void efifb_setup_from_dmi(struct screen_info *si, const char *opt); > + > #ifdef CONFIG_EFI_MIXED > extern void efi_thunk_runtime_setup(void); > extern efi_status_t efi_thunk_set_virtual_address_map( > diff --git a/arch/x86/kernel/sysfb_efi.c b/arch/x86/kernel/sysfb_efi.c > index b285d4e8c68e..e21a8a7ddcff 100644 > --- a/arch/x86/kernel/sysfb_efi.c > +++ b/arch/x86/kernel/sysfb_efi.c > @@ -68,6 +68,21 @@ struct efifb_dmi_info efifb_dmi_list[] = { > [M_UNKNOWN] = { NULL, 0, 0, 0, 0, OVERRIDE_NONE } > }; > > +void efifb_setup_from_dmi(struct screen_info *si, const char *opt) > +{ > + int i; > + > + for (i = 0; i < M_UNKNOWN; i++) { > + if (efifb_dmi_list[i].base != 0 && > + !strcmp(opt, efifb_dmi_list[i].optname)) { > + si->lfb_base = efifb_dmi_list[i].base; > + si->lfb_linelength = efifb_dmi_list[i].stride; > + si->lfb_width = efifb_dmi_list[i].width; > + si->lfb_height = efifb_dmi_list[i].height; > + } > + } > +} > + > #define choose_value(dmivalue, fwvalue, field, flags) ({ \ > typeof(fwvalue) _ret_ = fwvalue; \ > if ((flags) & (field)) \ > diff --git a/drivers/video/fbdev/efifb.c b/drivers/video/fbdev/efifb.c > index 95d293b7445a..dd594369b8a6 100644 > --- a/drivers/video/fbdev/efifb.c > +++ b/drivers/video/fbdev/efifb.c > @@ -8,6 +8,7 @@ > > #include > #include > +#include > #include > #include > #include > @@ -15,7 +16,7 @@ > #include > #include > #include