drm/i915: Clamp linetime wm to <64usec
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 25 Jun 2020 20:00:03 +0000 (23:00 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 29 Jun 2020 16:05:07 +0000 (19:05 +0300)
commit4003dac180d059ebd6f39b63dd33df408c1e4914
treecc30a7098b80a09ec233526d949cbc7bc0e800c9
parentaf9e1032ff6ead528f5e7284a4b8e207550e63bc
drm/i915: Clamp linetime wm to <64usec

The linetime watermark is a 9 bit value, which gives us
a maximum linetime of just below 64 usec. If the linetime
exceeds that value we currently just discard the high bits
and program the rest into the register, which angers the
state checker.

To avoid that let's just clamp the value to the max. I believe
it should be perfectly fine to program a smaller linetime wm
than strictly required, just means the hardware may fetch data
sooner than strictly needed. We are further reassured by the
fact that with DRRS the spec tells us to program the smaller
of the two linetimes corresponding to the two refresh rates.

Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200625200003.12436-1-ville.syrjala@linux.intel.com
Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
drivers/gpu/drm/i915/display/intel_display.c