Skip to contentSkip to conversation

drm/i915: quirk away broken OpRegion VBT

PATCH In review Daniel Vetter 4 participants 4 messages Mar 24, 2012 – Mar 28, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: quirk away broken OpRegion VBT

Somehow the BIOS manages to screw things up when copying the VBT around, because the one we scrap from the VBIOS rom actually works.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=28812

---
 drivers/gpu/drm/i915/intel_bios.c |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/intel_bios.c +22 -1
index e4317da..d6ffdbd 100644
@@ -24,6 +24,7 @@
  *    Eric Anholt <[email protected]>
  *
  */
+#include <linux/dmi.h>
 #include <drm/drm_dp_helper.h>
 #include "drmP.h"
 #include "drm.h"
@@ -662,6 +663,26 @@ init_vbt_defaults(struct drm_i915_private *dev_priv)
 	dev_priv->edp.bpp = 18;
 }
 
+static int __init intel_no_opregion_vbt_callback(const struct dmi_system_id *id)
+{
+	DRM_DEBUG_KMS("Falling back to manually reading VBT from "
+		      "VBIOS ROM for %s\n",
+		      id->ident);
+	return 1;
+}
+
+static const struct dmi_system_id intel_no_opregion_vbt[] = {
+	{
+		.callback = intel_no_opregion_vbt_callback,
+		.ident = "ThinkCentre A57",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "97027RG"),
+		},
+	},
+	{ }
+};
+
 /**
  * intel_parse_bios - find VBT and initialize settings from the BIOS
  * @dev: DRM device
@@ -682,7 +703,7 @@ intel_parse_bios(struct drm_device *dev)
 	init_vbt_defaults(dev_priv);
 
 	/* XXX Should this validation be moved to intel_opregion.c? */
-	if (dev_priv->opregion.vbt) {
+	if (!dmi_check_system(intel_no_opregion_vbt) && dev_priv->opregion.vbt) {
 		struct vbt_header *vbt = dev_priv->opregion.vbt;
 		if (memcmp(vbt->signature, "$VBT", 4) == 0) {
 			DRM_DEBUG_KMS("Using VBT from OpRegion: %20s\n",
Signature · 1 line
1.7.9.1
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Daniel Vetter

Somehow the BIOS manages to screw things up when copying the VBT around, because the one we scrap from the VBIOS rom actually works.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=28812

That completely disproves my theory that the BIOS writers that went to the extra trouble to implement the OpRegion specification would be more likely to get it right and to make the information stored there accurate.

-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Reviewed-by
#2 lore raw
Quoted 22 lines · Chris Wilson
Quoted 7 lines · Daniel Vetter

Somehow the BIOS manages to screw things up when copying the VBT around, because the one we scrap from the VBIOS rom actually works.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=28812

That completely disproves my theory that the BIOS writers that went to the extra trouble to implement the OpRegion specification would be more likely to get it right and to make the information stored there accurate.

-Chris

--
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 3 lines
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
GPG: 0x905BE242 @ wwwkeys.pgp.net
#3 lore raw
In reply to Chris Wilson
Quoted 9 lines · On Sat, 24 Mar 2012 23:03:08 +0000 Chris Wilson <[email protected]>…
Quoted 7 lines · Daniel Vetter

Somehow the BIOS manages to screw things up when copying the VBT around, because the one we scrap from the VBIOS rom actually works.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=28812

Quoted 5 lines

That completely disproves my theory that the BIOS writers that went to the extra trouble to implement the OpRegion specification would be more likely to get it right and to make the information stored there accurate.

On some platforms OpRegion is the *only* way to get the VBT reasonably... but quirking around broken ones is fine (though I suspect we're not doing something right; the OpRegion VBT ought to be fine).

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx