aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_modes.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2015-11-16 14:05:12 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-12-01 01:57:14 -0500
commit4c6bcf44549907cb50b67f98eb13717a4adc6b33 (patch)
tree1b2d0b895c0c6a2891359526455637eba1a5649f /drivers/gpu/drm/drm_modes.c
parent6753ba97e78bb0ed5c0ed35c21c1e2a31f7299a0 (diff)
drm/edid: Make the detailed timing CEA/HDMI mode fixup accept up to 5kHz clock difference
Rather than using drm_match_cea_mode() to see if the EDID detailed timings are supposed to represent one of the CEA/HDMI modes, add a special version of that function that takes in an explicit clock tolerance value (in kHz). When looking at the detailed timings specify the tolerance as 5kHz due to the 10kHz clock resolution limit inherent in detailed timings. drm_match_cea_mode() uses the normal KHZ2PICOS() matching of clocks, which only allows smaller errors for lower clocks (eg. for 25200 it won't allow any error) and a bigger error for higher clocks (eg. for 297000 it actually matches 296913-297000). So it doesn't really match what we want for the fixup. Using the explicit +-5kHz is much better for this use case. Not sure if we should change the normal mode matching to also use something else besides KHZ2PICOS() since it allows a different proportion of error depending on the clock. I believe VESA CVT allows a maximum deviation of .5%, so using that for normal mode matching might be a good idea? Cc: Adam Jackson <ajax@redhat.com> Tested-by: nathan.d.ciobanu@linux.intel.com Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92217 Fixes: fa3a7340eaa1 ("drm/edid: Fix up clock for CEA/HDMI modes specified via detailed timings") Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/drm_modes.c')
-rw-r--r--drivers/gpu/drm/drm_modes.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index bde9b2911dc2..ef6bd3656548 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -917,13 +917,30 @@ bool drm_mode_equal(const struct drm_display_mode *mode1, const struct drm_displ
917 } else if (mode1->clock != mode2->clock) 917 } else if (mode1->clock != mode2->clock)
918 return false; 918 return false;
919 919
920 return drm_mode_equal_no_clocks(mode1, mode2);
921}
922EXPORT_SYMBOL(drm_mode_equal);
923
924/**
925 * drm_mode_equal_no_clocks - test modes for equality
926 * @mode1: first mode
927 * @mode2: second mode
928 *
929 * Check to see if @mode1 and @mode2 are equivalent, but
930 * don't check the pixel clocks.
931 *
932 * Returns:
933 * True if the modes are equal, false otherwise.
934 */
935bool drm_mode_equal_no_clocks(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2)
936{
920 if ((mode1->flags & DRM_MODE_FLAG_3D_MASK) != 937 if ((mode1->flags & DRM_MODE_FLAG_3D_MASK) !=
921 (mode2->flags & DRM_MODE_FLAG_3D_MASK)) 938 (mode2->flags & DRM_MODE_FLAG_3D_MASK))
922 return false; 939 return false;
923 940
924 return drm_mode_equal_no_clocks_no_stereo(mode1, mode2); 941 return drm_mode_equal_no_clocks_no_stereo(mode1, mode2);
925} 942}
926EXPORT_SYMBOL(drm_mode_equal); 943EXPORT_SYMBOL(drm_mode_equal_no_clocks);
927 944
928/** 945/**
929 * drm_mode_equal_no_clocks_no_stereo - test modes for equality 946 * drm_mode_equal_no_clocks_no_stereo - test modes for equality