Commit 98fdaaca authored by Jani Nikula's avatar Jani Nikula

drm/i915/opregion: fix version check

The u32 version field encodes major, minor, revision and reserved. We've
basically been checking for any non-zero version.

Add opregion version logging while at it.

v2: Fix the fix of the version check

Fixes: 04ebaadb ("drm/i915/opregion: handle VBT sizes bigger than 6 KB")
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Imre Deak <imre.deak@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190208184254.24123-1-jani.nikula@intel.com
parent 312c4ba1
...@@ -54,7 +54,12 @@ ...@@ -54,7 +54,12 @@
struct opregion_header { struct opregion_header {
u8 signature[16]; u8 signature[16];
u32 size; u32 size;
u32 opregion_ver; struct {
u8 rsvd;
u8 revision;
u8 minor;
u8 major;
} __packed over;
u8 bios_ver[32]; u8 bios_ver[32];
u8 vbios_ver[16]; u8 vbios_ver[16];
u8 driver_ver[16]; u8 driver_ver[16];
...@@ -924,6 +929,11 @@ int intel_opregion_setup(struct drm_i915_private *dev_priv) ...@@ -924,6 +929,11 @@ int intel_opregion_setup(struct drm_i915_private *dev_priv)
opregion->header = base; opregion->header = base;
opregion->lid_state = base + ACPI_CLID; opregion->lid_state = base + ACPI_CLID;
DRM_DEBUG_DRIVER("ACPI OpRegion version %u.%u.%u\n",
opregion->header->over.major,
opregion->header->over.minor,
opregion->header->over.revision);
mboxes = opregion->header->mboxes; mboxes = opregion->header->mboxes;
if (mboxes & MBOX_ACPI) { if (mboxes & MBOX_ACPI) {
DRM_DEBUG_DRIVER("Public ACPI methods supported\n"); DRM_DEBUG_DRIVER("Public ACPI methods supported\n");
...@@ -952,7 +962,7 @@ int intel_opregion_setup(struct drm_i915_private *dev_priv) ...@@ -952,7 +962,7 @@ int intel_opregion_setup(struct drm_i915_private *dev_priv)
if (dmi_check_system(intel_no_opregion_vbt)) if (dmi_check_system(intel_no_opregion_vbt))
goto out; goto out;
if (opregion->header->opregion_ver >= 2 && opregion->asle && if (opregion->header->over.major >= 2 && opregion->asle &&
opregion->asle->rvda && opregion->asle->rvds) { opregion->asle->rvda && opregion->asle->rvds) {
opregion->rvda = memremap(opregion->asle->rvda, opregion->rvda = memremap(opregion->asle->rvda,
opregion->asle->rvds, opregion->asle->rvds,
......
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