[Intel-gfx] intel_opregion_get_panel_type potential bug fix

Sean Greenslade sean at seangreenslade.com
Mon Aug 29 17:35:16 UTC 2016


Hello, all. I've been attempting to track down a bug with my Panasonic
CF-30 laptop. I have a bug report[0] submitted.

In investigating the issue myself, I discovered that the root of the
problem seemed to be that the new code for getting the panel type from
the opregion seems to believe it is getting good data, but it is not.
The function intel_opregion_get_panel_type (introduced in commit
a05628195a0d, the one my bisect says caused this issue) seems to do some
checks for validity, but apparently not enough.

I see there has already been a fix for one particular laptop[1], however
my machine is not a Skylake so this fix does not apply to me. After
reading over what Ville Syrjälä wrote in the patch notes for the
get_panel_type function, I went and read part of the intel spec[2] that
describes this data, and found a discrepancy that I don't fully
understand. On page 106 of [2], there is a table that describes the
layout of the response that intel_opregion_get_panel_type parses for the
panel type. Bit 17 is listed as reserved, must be zero. On my machine,
that bit is set to one. Additionally, on my two other Intel graphics
laptops that aren't exhibiting this issue, it is also set to one,
however they both fail the existing sanity checks in the function and
revert to the VBT entry.

But now I'm in a bit over my head. I've attached the patch (applies to
drm-intel-nightly) that I used to get the full u32 response of the swsci
lookup, as well as a tentative fix. My fix checks for the reserved bit
being set incorrectly and reverts to using the VBT entry. This fixes the
regression on my CF-30, and doesn't hurt anything on my other two
machines, but I have no newer machines to test it on. Can someone look
this over and see if I'm taking the correct approach? Additionally, I
would love to know if anyone has any more information on why the
reserved bit is set (it was set on all three of my machines).

Thanks for your attention,

--Sean


[0]: https://bugs.freedesktop.org/show_bug.cgi?id=97443
[1]: https://lists.freedesktop.org/archives/intel-gfx/2016-July/100573.html
[2]: https://01.org/sites/default/files/documentation/acpi_igd_opregion_spec_0.pdf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: get_panel_type.patch
Type: text/x-diff
Size: 1008 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gfx/attachments/20160829/22d0a3cd/attachment.patch>


More information about the Intel-gfx mailing list