David Woodhouse 4f94f04
From f462ed939de67c20528bc08f11d2fc4f2d59c0d5 Mon Sep 17 00:00:00 2001
David Woodhouse 4f94f04
From: Matthew Garrett <mjg@redhat.com>
David Woodhouse 4f94f04
Date: Fri, 27 Jul 2012 12:58:53 -0400
David Woodhouse 4f94f04
Subject: [PATCH 1/2] efifb: Skip DMI checks if the bootloader knows what it's
David Woodhouse 4f94f04
 doing
David Woodhouse 4f94f04
David Woodhouse 4f94f04
The majority of the DMI checks in efifb are for cases where the bootloader
David Woodhouse 4f94f04
has provided invalid information. However, on some machines the overrides
David Woodhouse 4f94f04
may do more harm than good due to configuration differences between machines
David Woodhouse 4f94f04
with the same machine identifier. It turns out that it's possible for the
David Woodhouse 4f94f04
bootloader to get the correct information on GOP-based systems, but we
David Woodhouse 4f94f04
can't guarantee that the kernel's being booted with one that's been updated
David Woodhouse 4f94f04
to do so. Add support for a capabilities flag that can be set by the
David Woodhouse 4f94f04
bootloader, and skip the DMI checks in that case. Additionally, set this
David Woodhouse 4f94f04
flag in the UEFI stub code.
David Woodhouse 4f94f04
David Woodhouse 4f94f04
Signed-off-by: Matthew Garrett <mjg@redhat.com>
David Woodhouse 4f94f04
Acked-by: Peter Jones <pjones@redhat.com>
David Woodhouse 4f94f04
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
David Woodhouse 4f94f04
---
David Woodhouse 4f94f04
 arch/x86/boot/compressed/eboot.c | 2 ++
David Woodhouse 4f94f04
 drivers/video/efifb.c            | 4 +++-
David Woodhouse 4f94f04
 include/linux/screen_info.h      | 2 ++
David Woodhouse 4f94f04
 3 files changed, 7 insertions(+), 1 deletion(-)
David Woodhouse 4f94f04
David Woodhouse 4f94f04
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
David Woodhouse 4f94f04
index d5e4044..bbd83b9 100644
David Woodhouse 4f94f04
--- a/arch/x86/boot/compressed/eboot.c
David Woodhouse 4f94f04
+++ b/arch/x86/boot/compressed/eboot.c
David Woodhouse 4f94f04
@@ -379,6 +379,8 @@ static efi_status_t setup_gop(struct screen_info *si, efi_guid_t *proto,
David Woodhouse 4f94f04
 		si->rsvd_pos = 0;
David Woodhouse 4f94f04
 	}
David Woodhouse 4f94f04
 
David Woodhouse 4f94f04
+	si->capabilities |= VIDEO_CAPABILITY_SKIP_QUIRKS;
David Woodhouse 4f94f04
+
David Woodhouse 4f94f04
 free_handle:
David Woodhouse 4f94f04
 	efi_call_phys1(sys_table->boottime->free_pool, gop_handle);
David Woodhouse 4f94f04
 	return status;
David Woodhouse 4f94f04
diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c
David Woodhouse 4f94f04
index b4a632a..932abaa 100644
David Woodhouse 4f94f04
--- a/drivers/video/efifb.c
David Woodhouse 4f94f04
+++ b/drivers/video/efifb.c
David Woodhouse 4f94f04
@@ -553,7 +553,9 @@ static int __init efifb_init(void)
David Woodhouse 4f94f04
 	int ret;
David Woodhouse 4f94f04
 	char *option = NULL;
David Woodhouse 4f94f04
 
David Woodhouse 4f94f04
-	dmi_check_system(dmi_system_table);
David Woodhouse 4f94f04
+	if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI ||
David Woodhouse 4f94f04
+	    !(screen_info.capabilities & VIDEO_CAPABILITY_SKIP_QUIRKS))
David Woodhouse 4f94f04
+		dmi_check_system(dmi_system_table);
David Woodhouse 4f94f04
 
David Woodhouse 4f94f04
 	if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI)
David Woodhouse 4f94f04
 		return -ENODEV;
David Woodhouse 4f94f04
diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h
David Woodhouse 4f94f04
index 899fbb4..fb3c5a8 100644
David Woodhouse 4f94f04
--- a/include/linux/screen_info.h
David Woodhouse 4f94f04
+++ b/include/linux/screen_info.h
David Woodhouse 4f94f04
@@ -68,6 +68,8 @@ struct screen_info {
David Woodhouse 4f94f04
 
David Woodhouse 4f94f04
 #define VIDEO_FLAGS_NOCURSOR	(1 << 0) /* The video mode has no cursor set */
David Woodhouse 4f94f04
 
David Woodhouse 4f94f04
+#define VIDEO_CAPABILITY_SKIP_QUIRKS	(1 << 0)
David Woodhouse 4f94f04
+
David Woodhouse 4f94f04
 #ifdef __KERNEL__
David Woodhouse 4f94f04
 extern struct screen_info screen_info;
David Woodhouse 4f94f04
 
David Woodhouse 4f94f04
-- 
David Woodhouse 4f94f04
1.7.12.1
David Woodhouse 4f94f04