diff options
author | Cohen, Eugene <eugene@hp.com> | 2017-04-04 11:27:43 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-04-21 03:31:20 -0400 |
commit | 60174fb3eaa6c84273f282125c4cccdc701549a8 (patch) | |
tree | 9f651e143f103fc8294be5fb4935351edc9c57da | |
parent | 1681bab7c450508b26f33368a8d1ec57d3fabfcc (diff) |
efi/libstub: Skip GOP with PIXEL_BLT_ONLY format
commit 540f4c0e894f7e46a66dfa424b16424cbdc12c38 upstream.
The UEFI Specification permits Graphics Output Protocol (GOP) instances
without direct framebuffer access. This is indicated in the Mode structure
with a PixelFormat enumeration value of PIXEL_BLT_ONLY. Given that the
kernel does not know how to drive a Blt() only framebuffer (which is only
permitted before ExitBootServices() anyway), we should disregard such
framebuffers when looking for a GOP instance that is suitable for use as
the boot console.
So modify the EFI GOP initialization to not use a PIXEL_BLT_ONLY instance,
preventing attempts later in boot to use an invalid screen_info.lfb_base
address.
Signed-off-by: Eugene Cohen <eugene@hp.com>
[ Moved the Blt() only check into the loop and clarified that Blt() only GOPs are unusable by the kernel. ]
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: leif.lindholm@linaro.org
Cc: linux-efi@vger.kernel.org
Cc: lorenzo.pieralisi@arm.com
Fixes: 9822504c1fa5 ("efifb: Enable the efi-framebuffer platform driver ...")
Link: http://lkml.kernel.org/r/20170404152744.26687-2-ard.biesheuvel@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/firmware/efi/libstub/gop.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/firmware/efi/libstub/gop.c b/drivers/firmware/efi/libstub/gop.c index 932742e4cf23..24c461dea7af 100644 --- a/drivers/firmware/efi/libstub/gop.c +++ b/drivers/firmware/efi/libstub/gop.c | |||
@@ -149,7 +149,8 @@ setup_gop32(efi_system_table_t *sys_table_arg, struct screen_info *si, | |||
149 | 149 | ||
150 | status = __gop_query32(sys_table_arg, gop32, &info, &size, | 150 | status = __gop_query32(sys_table_arg, gop32, &info, &size, |
151 | ¤t_fb_base); | 151 | ¤t_fb_base); |
152 | if (status == EFI_SUCCESS && (!first_gop || conout_found)) { | 152 | if (status == EFI_SUCCESS && (!first_gop || conout_found) && |
153 | info->pixel_format != PIXEL_BLT_ONLY) { | ||
153 | /* | 154 | /* |
154 | * Systems that use the UEFI Console Splitter may | 155 | * Systems that use the UEFI Console Splitter may |
155 | * provide multiple GOP devices, not all of which are | 156 | * provide multiple GOP devices, not all of which are |
@@ -266,7 +267,8 @@ setup_gop64(efi_system_table_t *sys_table_arg, struct screen_info *si, | |||
266 | 267 | ||
267 | status = __gop_query64(sys_table_arg, gop64, &info, &size, | 268 | status = __gop_query64(sys_table_arg, gop64, &info, &size, |
268 | ¤t_fb_base); | 269 | ¤t_fb_base); |
269 | if (status == EFI_SUCCESS && (!first_gop || conout_found)) { | 270 | if (status == EFI_SUCCESS && (!first_gop || conout_found) && |
271 | info->pixel_format != PIXEL_BLT_ONLY) { | ||
270 | /* | 272 | /* |
271 | * Systems that use the UEFI Console Splitter may | 273 | * Systems that use the UEFI Console Splitter may |
272 | * provide multiple GOP devices, not all of which are | 274 | * provide multiple GOP devices, not all of which are |