Commit b30581a4 authored by Jani Nikula's avatar Jani Nikula

drm/i915: move "no VBT in opregion" quirk to intel_opregion_setup()

Check the quirk in intel_opregion_setup(), and don't initialize
opregion->vbt at all if the quirk says it's not present, hiding the
quirk from the rest of the driver.
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/7cdc86eb441f8b7075142445a800b07ecf8c76cb.1450089383.git.jani.nikula@intel.com
parent b3cbd98b
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
* Eric Anholt <eric@anholt.net> * Eric Anholt <eric@anholt.net>
* *
*/ */
#include <linux/dmi.h>
#include <drm/drm_dp_helper.h> #include <drm/drm_dp_helper.h>
#include <drm/drmP.h> #include <drm/drmP.h>
#include <drm/i915_drm.h> #include <drm/i915_drm.h>
...@@ -1214,26 +1214,6 @@ init_vbt_defaults(struct drm_i915_private *dev_priv) ...@@ -1214,26 +1214,6 @@ init_vbt_defaults(struct drm_i915_private *dev_priv)
} }
} }
static int 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"),
},
},
{ }
};
static const struct bdb_header *validate_vbt(const void *base, static const struct bdb_header *validate_vbt(const void *base,
size_t size, size_t size,
const void *_vbt, const void *_vbt,
...@@ -1317,7 +1297,7 @@ intel_parse_bios(struct drm_device *dev) ...@@ -1317,7 +1297,7 @@ intel_parse_bios(struct drm_device *dev)
init_vbt_defaults(dev_priv); init_vbt_defaults(dev_priv);
/* XXX Should this validation be moved to intel_opregion.c? */ /* XXX Should this validation be moved to intel_opregion.c? */
if (!dmi_check_system(intel_no_opregion_vbt) && dev_priv->opregion.vbt) if (dev_priv->opregion.vbt)
bdb = validate_vbt(dev_priv->opregion.header, OPREGION_SIZE, bdb = validate_vbt(dev_priv->opregion.header, OPREGION_SIZE,
dev_priv->opregion.vbt, "OpRegion"); dev_priv->opregion.vbt, "OpRegion");
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
*/ */
#include <linux/acpi.h> #include <linux/acpi.h>
#include <linux/dmi.h>
#include <acpi/video.h> #include <acpi/video.h>
#include <drm/drmP.h> #include <drm/drmP.h>
...@@ -904,6 +905,25 @@ static void swsci_setup(struct drm_device *dev) ...@@ -904,6 +905,25 @@ static void swsci_setup(struct drm_device *dev)
static inline void swsci_setup(struct drm_device *dev) {} static inline void swsci_setup(struct drm_device *dev) {}
#endif /* CONFIG_ACPI */ #endif /* CONFIG_ACPI */
static int 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"),
},
},
{ }
};
int intel_opregion_setup(struct drm_device *dev) int intel_opregion_setup(struct drm_device *dev)
{ {
struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_private *dev_priv = dev->dev_private;
...@@ -942,8 +962,6 @@ int intel_opregion_setup(struct drm_device *dev) ...@@ -942,8 +962,6 @@ int intel_opregion_setup(struct drm_device *dev)
goto err_out; goto err_out;
} }
opregion->header = base; opregion->header = base;
opregion->vbt = base + OPREGION_VBT_OFFSET;
opregion->lid_state = base + ACPI_CLID; opregion->lid_state = base + ACPI_CLID;
mboxes = opregion->header->mboxes; mboxes = opregion->header->mboxes;
...@@ -968,6 +986,9 @@ int intel_opregion_setup(struct drm_device *dev) ...@@ -968,6 +986,9 @@ int intel_opregion_setup(struct drm_device *dev)
if (mboxes & MBOX_ASLE_EXT) if (mboxes & MBOX_ASLE_EXT)
DRM_DEBUG_DRIVER("ASLE extension supported\n"); DRM_DEBUG_DRIVER("ASLE extension supported\n");
if (!dmi_check_system(intel_no_opregion_vbt))
opregion->vbt = base + OPREGION_VBT_OFFSET;
return 0; return 0;
err_out: err_out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment