kraxel / rpms / kernel

Forked from rpms/kernel 2 years ago
Clone
918c474
commit 9b989ae8a30f5a430fabbf911e0643bca96c3fd1
918c474
Author: Matthew Garrett <mjg@redhat.com>
918c474
Date:   Thu Apr 26 17:35:58 2012 -0400
918c474
918c474
    efifb: Skip DMI checks if the bootloader knows what it's doing
918c474
    
918c474
    The majority of the DMI checks in efifb are for cases where the bootloader
918c474
    has provided invalid information. However, on some machines the overrides
918c474
    may do more harm than good due to configuration differences between machines
918c474
    with the same machine identifier. It turns out that it's possible for the
918c474
    bootloader to get the correct information on GOP-based systems, but we
918c474
    can't guarantee that the kernel's being booted with one that's been updated
918c474
    to do so. Add support for a capabilities flag that can be set by the
918c474
    bootloader, and skip the DMI checks in that case.
918c474
    
918c474
    Signed-off-by: Matthew Garrett <mjg@redhat.com>
918c474
918c474
diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c
918c474
index b4a632a..932abaa 100644
918c474
--- a/drivers/video/efifb.c
918c474
+++ b/drivers/video/efifb.c
918c474
@@ -553,7 +553,9 @@ static int __init efifb_init(void)
918c474
 	int ret;
918c474
 	char *option = NULL;
918c474
 
918c474
-	dmi_check_system(dmi_system_table);
918c474
+	if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI ||
918c474
+	    !(screen_info.capabilities & VIDEO_CAPABILITY_SKIP_QUIRKS))
918c474
+		dmi_check_system(dmi_system_table);
918c474
 
918c474
 	if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI)
918c474
 		return -ENODEV;
918c474
diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h
918c474
index 899fbb4..fb3c5a8 100644
918c474
--- a/include/linux/screen_info.h
918c474
+++ b/include/linux/screen_info.h
918c474
@@ -68,6 +68,8 @@ struct screen_info {
918c474
 
918c474
 #define VIDEO_FLAGS_NOCURSOR	(1 << 0) /* The video mode has no cursor set */
918c474
 
918c474
+#define VIDEO_CAPABILITY_SKIP_QUIRKS	(1 << 0)
918c474
+
918c474
 #ifdef __KERNEL__
918c474
 extern struct screen_info screen_info;
918c474