OSDN Git Service

drm/i915: Pick the first mode from EDID as the fixed mode when there is no preferred...
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 21 Mar 2019 13:24:42 +0000 (15:24 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 22 Mar 2019 16:41:39 +0000 (18:41 +0200)
commit8f49673ef919e828cf66c23d9c73c1d50e56610a
tree7db8ba437652f479f158819e5c2884bc5007e0d4
parent0dc927eb9496ca5dfcde476f00c23b2283f8a5e2
drm/i915: Pick the first mode from EDID as the fixed mode when there is no preferred mode

Some monitors apparently forget to mark any mode as preferred in the
EDID. In this particular case we have a very generic looking ID
"PNP Model 0 Serial Number 4" / "LVDS 800x600" so a specific quirk
doesn't seem particularly wise. Also the quirk we have
(EDID_QUIRK_FIRST_DETAILED_PREFERRED) is actually defunct so we'd
have to fix it first.

When there is no preferred mode we currently fall back to the VBT.
That approach fails us here as the VBT mode is 1024x768 whereas
the panel resolution is 800x600. So instead of falling back to the
VBT when there is no preferred mode let's just pick the first
probed mode. Only if the EDID provided no modes we fall back to
the VBT.

For this machine the VBIOS would appear to select the 800x600
60Hz EST mode rather than the first detailed mode (which is
the new fallback will pick). The two modes differ only by
having opposite sync polarities, which does not seem to matter
to the panel in question.

v2: Make sure the probed_modes list is not empty

Cc: Adam Jackson <ajax@redhat.com>
Cc: Roberto Viola <cagnulein@gmail.com>
Tested-by: Roberto Viola <cagnulein@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109780
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190321132446.22394-2-ville.syrjala@linux.intel.com
Reviewed-by: Adam Jackson <ajax@redhat.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/intel_panel.c