From: pjones@redhat.com (Peter Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/8] efi/x86: efifb: move DMI based quirks handling out of generic code
Date: Mon, 21 Mar 2016 09:42:23 -0400 [thread overview]
Message-ID: <20160321134222.GA21791@redhat.com> (raw)
In-Reply-To: <20160318105007.GM2619@codeblueprint.co.uk>
On Fri, Mar 18, 2016 at 10:50:07AM +0000, Matt Fleming wrote:
> (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 <ard.biesheuvel@linaro.org>
> > ---
> > 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?
It looks right to me as well:
Acked-By: Peter Jones <pjones@redhat.com>
>
> > 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 <linux/module.h>
> > #include <linux/kernel.h>
> > +#include <linux/efi.h>
> > #include <linux/errno.h>
> > #include <linux/fb.h>
> > #include <linux/platform_device.h>
> > @@ -15,7 +16,7 @@
> > #include <linux/dmi.h>
> > #include <linux/pci.h>
> > #include <video/vga.h>
> > -#include <asm/sysfb.h>
> > +#include <asm/efi.h>
> >
> > static bool request_mem_succeeded = false;
> >
> > @@ -85,21 +86,13 @@ static struct fb_ops efifb_ops = {
> > static int efifb_setup(char *options)
> > {
> > char *this_opt;
> > - int i;
> >
> > if (options && *options) {
> > while ((this_opt = strsep(&options, ",")) != NULL) {
> > if (!*this_opt) continue;
> >
> > - for (i = 0; i < M_UNKNOWN; i++) {
> > - if (efifb_dmi_list[i].base != 0 &&
> > - !strcmp(this_opt, efifb_dmi_list[i].optname)) {
> > - screen_info.lfb_base = efifb_dmi_list[i].base;
> > - screen_info.lfb_linelength = efifb_dmi_list[i].stride;
> > - screen_info.lfb_width = efifb_dmi_list[i].width;
> > - screen_info.lfb_height = efifb_dmi_list[i].height;
> > - }
> > - }
> > + efifb_setup_from_dmi(&screen_info, this_opt);
> > +
> > if (!strncmp(this_opt, "base:", 5))
> > screen_info.lfb_base = simple_strtoul(this_opt+5, NULL, 0);
> > else if (!strncmp(this_opt, "stride:", 7))
> > --
> > 1.9.1
> >
--
Peter
next prev parent reply other threads:[~2016-03-21 13:42 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-10 5:40 [PATCH 0/8] EFI framebuffer support for ARM and arm64 Ard Biesheuvel
2016-03-10 5:40 ` [PATCH 1/8] efi: make install_configuration_table() boot service usable Ard Biesheuvel
2016-03-18 10:59 ` Matt Fleming
2016-03-18 11:02 ` Ard Biesheuvel
2016-03-10 5:40 ` [PATCH 2/8] efi: libstub: move Graphics Output Protocol handling to generic code Ard Biesheuvel
2016-03-18 11:25 ` Matt Fleming
2016-03-10 5:40 ` [PATCH 3/8] efi/x86: libstub: move to generic GOP code Ard Biesheuvel
2016-03-10 5:40 ` [PATCH 4/8] efi/x86: efifb: move DMI based quirks handling out of generic code Ard Biesheuvel
2016-03-18 10:50 ` Matt Fleming
2016-03-21 13:42 ` Peter Jones [this message]
2016-03-10 5:40 ` [PATCH 5/8] efi: efifb: use builtin_platform_driver and drop unused includes Ard Biesheuvel
2016-03-18 10:52 ` Matt Fleming
2016-03-21 13:43 ` Peter Jones
2016-03-10 5:40 ` [PATCH 6/8] efi/arm*: libstub: wire up GOP handling into the ARM UEFI stub Ard Biesheuvel
2016-03-10 8:25 ` Ingo Molnar
2016-03-10 8:36 ` Ard Biesheuvel
2016-03-10 9:03 ` Ingo Molnar
2016-03-10 9:14 ` Ard Biesheuvel
2016-03-10 9:25 ` Ingo Molnar
2016-03-10 10:25 ` Ard Biesheuvel
2016-03-10 14:49 ` Matt Fleming
2016-03-10 14:30 ` Matt Fleming
2016-03-18 11:37 ` Matt Fleming
2016-03-10 5:40 ` [PATCH 7/8] efi/arm*: efifb: expose efifb platform device if GOP is available Ard Biesheuvel
2016-03-10 5:40 ` [PATCH 8/8] efi/arm: populate screen_info based on data provided by the UEFI stub Ard Biesheuvel
2016-03-18 11:53 ` Matt Fleming
2016-03-18 11:57 ` Ard Biesheuvel
2016-03-10 16:12 ` [PATCH 0/8] EFI framebuffer support for ARM and arm64 Mark Langsdorf
2016-03-10 16:23 ` Ard Biesheuvel
2016-03-11 17:52 ` Alexander Graf
2016-03-11 18:24 ` 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=20160321134222.GA21791@redhat.com \
--to=pjones@redhat.com \
--cc=linux-arm-kernel@lists.infradead.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).