OSDN Git Service

drm/edid: Fix cea mode aspect ratio handling
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 8 May 2018 11:09:38 +0000 (16:39 +0530)
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Fri, 11 May 2018 07:00:18 +0000 (09:00 +0200)
commit357768cc9e3fdacf6551da0ae1483bc87dbcb4e8
treec4ddf282d263b48bda77f5cf4e2c15f6c11d97ee
parenta2328fd657017557606264c61074e609adfbb3ce
drm/edid: Fix cea mode aspect ratio handling

commit 6dffd431e229 ("drm: Add aspect ratio parsing in DRM layer")
cause us to not send out any VICs in the AVI infoframes. That commit
was since reverted, but if and when we add aspect ratio handing back
we need to be more careful.

Let's handle this by considering the aspect ratio as a requirement
for cea mode matching only if the passed in mode actually has a
non-zero aspect ratio field. This will keep userspace that doesn't
provide an aspect ratio working as before by matching it to the
first otherwise equal cea mode. And once userspace starts to
provide the aspect ratio it will be considerd a hard requirement
for the match.

Also change the hdmi mode matching to use drm_mode_match() for
consistency, but we don't match on aspect ratio there since the
spec doesn't list a specific aspect ratio for those modes.

Cc: Shashank Sharma <shashank.sharma@intel.com>
Cc: "Lin, Jia" <lin.a.jia@intel.com>
Cc: Akashdeep Sharma <akashdeep.sharma@intel.com>
Cc: Jim Bride <jim.bride@linux.intel.com>
Cc: Jose Abreu <Jose.Abreu@synopsys.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Shashank Sharma <shashank.sharma@intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1525777785-9740-4-git-send-email-ankit.k.nautiyal@intel.com
drivers/gpu/drm/drm_edid.c