[PATCH] drm/i915: Fix not finding the VBT when it overlaps with OPREGION_ASLE_EXT

Hans de Goede hdegoede at redhat.com
Fri Feb 10 10:52:51 UTC 2017


Hi,

On 06-02-17 08:04, Jani Nikula wrote:
> On Sun, 25 Dec 2016, Hans de Goede <hdegoede at redhat.com> wrote:
>> If there is no OPREGION_ASLE_EXT then a VBT stored in mailbox #4 may
>> use the ASLE_EXT parts of the opregion. Adjust the vbt_size calculation
>> for a vbt in mailbox #4 for this.
>>
>> This fixes the driver not finding the VBT on a jumper ezpad mini3
>> cherrytrail tablet.
>>
>> Cc: stable at vger.kernel.org
>> Signed-off-by: Hans de Goede <hdegoede at redhat.com>
>> ---
>> Note even with this fixed the panel still does not work with 4.9,
>> but it does with drm-intel-next-queued :) I believe the missing bit in
>> 4.9 is the "drm/915: Parsing the missed out DTD fields from the VBT"
>> commit, but I've not verified this.
>> ---
>>  drivers/gpu/drm/i915/intel_opregion.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c
>> index f4429f6..eff35ae 100644
>> --- a/drivers/gpu/drm/i915/intel_opregion.c
>> +++ b/drivers/gpu/drm/i915/intel_opregion.c
>> @@ -982,7 +982,9 @@ 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;
>> +			vbt_size = (mboxes & MBOX_ASLE_EXT) ?
>> +				OPREGION_ASLE_EXT_OFFSET : OPREGION_SIZE;
>> +			vbt_size -= OPREGION_VBT_OFFSET;
>
> First, I want a big fat warning comment about what's going on
> here. Otherwise someone's bound to "fix" this later on.

Done for v2, which I will send shortly.

> Second, per the spec, the ASLE ext mailbox is 1k in size, and there's a
> 1k reserved region at the end. We probably shouldn't allow VBT to extend
> over there. But hey, per the spec we also shouldn't allow VBT to extend
> over mailbox #5 either. So if you can't be bothered with that, neither
> will I.

Hmm, that makes no sense, OPREGION_SIZE is 8192 bytes or 0x2000,
OPREGION_ASLE_EXT_OFFSET is 0x1C00 or 7168 bytes, if there is 1k
reserved after the ASLE ext mailbox then there is exactly 0 bytes
available for the ASLE ext mailbox or OPREGION_SIZE should be 9216
not 8192 (which I don't think so). Maybe the last 1k is either
the ASLE ext mailbox OR reserved ?

Anyways leaving this bit as is for now.

Regards,

Hans


More information about the dri-devel mailing list