linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Herrmann <dh.herrmann@gmail.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	linux-efi@vger.kernel.org,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	Matt Fleming <matt@codeblueprint.co.uk>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Peter Jones <pjones@redhat.com>,
	leif.lindholm@linaro.org, Mark Rutland <mark.rutland@arm.com>,
	"the arch/x86 maintainers" <x86@kernel.org>
Subject: Re: [PATCH v2 8/9] efi/arm*: wire up struct screen_info to efi-framebuffer platform device
Date: Mon, 21 Mar 2016 14:53:11 +0100	[thread overview]
Message-ID: <CANq1E4RUWKe=fF=9+9qq46ZeU1cgfXU+WmraXKnGLM5zyTVCoQ@mail.gmail.com> (raw)
In-Reply-To: <1458319661-19762-9-git-send-email-ard.biesheuvel@linaro.org>

Hi

On Fri, Mar 18, 2016 at 5:47 PM, Ard Biesheuvel
<ard.biesheuvel@linaro.org> wrote:
> This adds code to the ARM and arm64 EFI init routines to expose a platform
> device of type 'efi-framebuffer' if struct screen_info has been populated
> appropriately from the GOP protocol by the stub. Since the framebuffer may
> potentially be located in system RAM, make sure that the region is reserved
> and marked MEMBLOCK_NOMAP.
>
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  drivers/firmware/efi/arm-init.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
>
> diff --git a/drivers/firmware/efi/arm-init.c b/drivers/firmware/efi/arm-init.c
> index acd44de30504..f5f13b871d42 100644
> --- a/drivers/firmware/efi/arm-init.c
> +++ b/drivers/firmware/efi/arm-init.c
> @@ -19,6 +19,7 @@
>  #include <linux/mm_types.h>
>  #include <linux/of.h>
>  #include <linux/of_fdt.h>
> +#include <linux/platform_device.h>
>  #include <linux/screen_info.h>
>
>  #include <asm/efi.h>
> @@ -76,6 +77,10 @@ static void __init init_screen_info(void)
>                 screen_info = *si;
>                 early_memunmap(si, sizeof(*si));
>         }
> +
> +       if (screen_info.orig_video_isVGA == VIDEO_TYPE_EFI &&
> +           memblock_is_map_memory(screen_info.lfb_base))
> +               memblock_mark_nomap(screen_info.lfb_base, screen_info.lfb_size);
>  }
>
>  static int __init uefi_init(void)
> @@ -235,3 +240,16 @@ void __init efi_init(void)
>
>         init_screen_info();
>  }
> +
> +static int __init register_gop_device(void)
> +{
> +       void *pd;
> +
> +       if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI)
> +               return 0;
> +
> +       /* the efifb driver accesses screen_info directly, no need to pass it */
> +       pd = platform_device_register_simple("efi-framebuffer", 0, NULL, 0);

I'd really appreciate if you pass "screen_info" as data, just like x86
does. Sure, we still use the global screen_info variable from efifb,
but we should try to reduce the number of global variables and rather
make drivers use the platform-data of the platform device.

Thanks
David

  reply	other threads:[~2016-03-21 13:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-18 16:47 [PATCH v2 0/9] EFI framebuffer support for ARM and arm64 Ard Biesheuvel
2016-03-18 16:47 ` [PATCH v2 1/9] efi/x86: prepare GOP handling code for reuse as generic code Ard Biesheuvel
2016-03-19  5:58   ` kbuild test robot
2016-03-18 16:47 ` [PATCH v2 2/9] efi: libstub: move Graphics Output Protocol handling to " Ard Biesheuvel
2016-03-18 16:47 ` [PATCH v2 3/9] efi/x86: efifb: move DMI based quirks handling out of " Ard Biesheuvel
2016-03-21 13:54   ` David Herrmann
2016-03-18 16:47 ` [PATCH v2 4/9] efi: efifb: use builtin_platform_driver and drop unused includes Ard Biesheuvel
2016-03-18 16:47 ` [PATCH v2 5/9] efi/arm64: libstub: make screen_info accessible to the UEFI stub Ard Biesheuvel
2016-03-18 16:47 ` [PATCH v2 6/9] efi/arm: " Ard Biesheuvel
2016-03-18 16:47 ` [PATCH v2 7/9] efi/arm*: libstub: wire up GOP protocol to struct screen_info Ard Biesheuvel
2016-03-18 16:47 ` [PATCH v2 8/9] efi/arm*: wire up struct screen_info to efi-framebuffer platform device Ard Biesheuvel
2016-03-21 13:53   ` David Herrmann [this message]
2016-03-18 16:47 ` [PATCH v2 9/9] efifb: enable the efi-framebuffer platform driver for ARM and arm64 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='CANq1E4RUWKe=fF=9+9qq46ZeU1cgfXU+WmraXKnGLM5zyTVCoQ@mail.gmail.com' \
    --to=dh.herrmann@gmail.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=catalin.marinas@arm.com \
    --cc=leif.lindholm@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=matt@codeblueprint.co.uk \
    --cc=pjones@redhat.com \
    --cc=will.deacon@arm.com \
    --cc=x86@kernel.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).