Skip to contentSkip to conversation

efifb: Skip DMI checks if the bootloader knows what it's doing

PATCH In review Matthew Garrett 2 participants 2 messages Apr 27, 2012 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efifb: Skip DMI checks if the bootloader knows what it's doing

The majority of the DMI checks in efifb are for cases where the bootloader has provided invalid information. However, on some machines the overrides may do more harm than good due to configuration differences between machines with the same machine identifier. It turns out that it's possible for the bootloader to get the correct information on GOP-based systems, but we can't guarantee that the kernel's being booted with one that's been updated to do so. Add support for a capabilities flag that can be set by the bootloader, and skip the DMI checks in that case.

---
 drivers/video/efifb.c       |    4 +++-
 include/linux/screen_info.h |    2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/video/efifb.c +3 -1
index b4a632a..932abaa 100644
@@ -553,7 +553,9 @@ static int __init efifb_init(void)
 	int ret;
 	char *option = NULL;
 
-	dmi_check_system(dmi_system_table);
+	if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI ||
+	    !(screen_info.capabilities & VIDEO_CAPABILITY_SKIP_QUIRKS))
+		dmi_check_system(dmi_system_table);
 
 	if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI)
 		return -ENODEV;
include/linux/screen_info.h +2 -0
index 899fbb4..fb3c5a8 100644
@@ -68,6 +68,8 @@ struct screen_info {
 
 #define VIDEO_FLAGS_NOCURSOR	(1 << 0) /* The video mode has no cursor set */
 
+#define VIDEO_CAPABILITY_SKIP_QUIRKS	(1 << 0)
+
 #ifdef __KERNEL__
 extern struct screen_info screen_info;
 
Signature · 1 line
1.7.10
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Matthew Garrett

The majority of the DMI checks in efifb are for cases where the bootloader has provided invalid information. However, on some machines the overrides may do more harm than good due to configuration differences between machines with the same machine identifier. It turns out that it's possible for the bootloader to get the correct information on GOP-based systems, but we can't guarantee that the kernel's being booted with one that's been updated to do so. Add support for a capabilities flag that can be set by the bootloader, and skip the DMI checks in that case.

Looks right to me.

Quoted 33 lines
---
  drivers/video/efifb.c       |    4 +++-
  include/linux/screen_info.h |    2 ++
  2 files changed, 5 insertions(+), 1 deletion(-)
drivers/video/efifb.c +3 -1
index b4a632a..932abaa 100644
@@ -553,7 +553,9 @@ static int __init efifb_init(void)
  	int ret;
  	char *option = NULL;
 
-	dmi_check_system(dmi_system_table);
+	if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI ||
+	    !(screen_info.capabilities&  VIDEO_CAPABILITY_SKIP_QUIRKS))
+		dmi_check_system(dmi_system_table);
 
  	if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI)
  		return -ENODEV;
include/linux/screen_info.h +2 -0
index 899fbb4..fb3c5a8 100644
@@ -68,6 +68,8 @@ struct screen_info {
 
  #define VIDEO_FLAGS_NOCURSOR	(1<<  0) /* The video mode has no cursor set */
 
+#define VIDEO_CAPABILITY_SKIP_QUIRKS	(1<<  0)
+
  #ifdef __KERNEL__
  extern struct screen_info screen_info;
 
Signature · 5 lines
         Peter

Any connection between your reality and mine is purely coincidental.

01234567890123456789012345678901234567890123456789012345678901234567890123456789