Skip to content

Commit

Permalink
drm/i915: Fix not finding the VBT when it overlaps with OPREGION_ASLE…
Browse files Browse the repository at this point in the history
…_EXT

commit 998d757 upstream.

If there is no OPREGION_ASLE_EXT then a VBT stored in mailbox open-power-host-os#4 may
use the ASLE_EXT parts of the opregion. Adjust the vbt_size calculation
for a vbt in mailbox open-power-host-os#4 for this.

This fixes the driver not finding the VBT on a jumper ezpad mini3
cherrytrail tablet and on a ACER SW5_017 machine.

Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
(cherry picked from commit dfb65e7)
Signed-off-by: Jani Nikula <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
jwrdegoede authored and gregkh committed Mar 15, 2017
1 parent 5eeb3c0 commit cde8051
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion drivers/gpu/drm/i915/intel_opregion.c
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,18 @@ int intel_opregion_setup(struct drm_i915_private *dev_priv)
opregion->vbt_size = vbt_size;
} else {
vbt = base + OPREGION_VBT_OFFSET;
vbt_size = OPREGION_ASLE_EXT_OFFSET - OPREGION_VBT_OFFSET;
/*
* The VBT specification says that if the ASLE ext
* mailbox is not used its area is reserved, but
* on some CHT boards the VBT extends into the
* ASLE ext area. Allow this even though it is
* against the spec, so we do not end up rejecting
* the VBT on those boards (and end up not finding the
* LCD panel because of this).
*/
vbt_size = (mboxes & MBOX_ASLE_EXT) ?
OPREGION_ASLE_EXT_OFFSET : OPREGION_SIZE;
vbt_size -= OPREGION_VBT_OFFSET;
if (intel_bios_is_valid_vbt(vbt, vbt_size)) {
DRM_DEBUG_KMS("Found valid VBT in ACPI OpRegion (Mailbox #4)\n");
opregion->vbt = vbt;
Expand Down

0 comments on commit cde8051

Please sign in to comment.