aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Garrett <mjg@redhat.com>2012-07-27 17:20:49 -0400
committerMatt Fleming <matt.fleming@intel.com>2012-09-17 08:29:24 -0400
commite9b10953edbccd3744e039ffc060ab2692f17856 (patch)
tree624e3106d263cef39059348d7f90edf75f83feef
parentf462ed939de67c20528bc08f11d2fc4f2d59c0d5 (diff)
x86, EFI: Calculate the EFI framebuffer size instead of trusting the firmware
Seth Forshee reported that his system was reporting that the EFI framebuffer stretched from 0x90010000-0xb0010000 despite the GPU's BAR only covering 0x90000000-0x9ffffff. It's safer to calculate this value from the pixel stride and screen height (values we already depend on) rather than face potential problems with resource allocation later on. Signed-off-by: Matthew Garrett <mjg@redhat.com> Tested-by: Seth Forshee <seth.forshee@canonical.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
-rw-r--r--arch/x86/boot/compressed/eboot.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
index bbd83b9cb4da..c760e073963e 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
@@ -331,7 +331,6 @@ static efi_status_t setup_gop(struct screen_info *si, efi_guid_t *proto,
331 si->lfb_width = width; 331 si->lfb_width = width;
332 si->lfb_height = height; 332 si->lfb_height = height;
333 si->lfb_base = fb_base; 333 si->lfb_base = fb_base;
334 si->lfb_size = fb_size;
335 si->pages = 1; 334 si->pages = 1;
336 335
337 if (pixel_format == PIXEL_RGB_RESERVED_8BIT_PER_COLOR) { 336 if (pixel_format == PIXEL_RGB_RESERVED_8BIT_PER_COLOR) {
@@ -379,6 +378,8 @@ static efi_status_t setup_gop(struct screen_info *si, efi_guid_t *proto,
379 si->rsvd_pos = 0; 378 si->rsvd_pos = 0;
380 } 379 }
381 380
381 si->lfb_size = si->lfb_linelength * si->lfb_height;
382
382 si->capabilities |= VIDEO_CAPABILITY_SKIP_QUIRKS; 383 si->capabilities |= VIDEO_CAPABILITY_SKIP_QUIRKS;
383 384
384free_handle: 385free_handle: