drm/i915: Activate DRRS after state readout
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 20 Oct 2022 12:07:06 +0000 (15:07 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Sat, 22 Oct 2022 09:34:30 +0000 (12:34 +0300)
commit4c35e5d1190058be31236876ae1f12681ddba137
tree55d6d6d8247cbcc65b009e4440b469396513ca55
parent2bd0db4b3f0bd529f75b32538fc5a3775e3591c0
drm/i915: Activate DRRS after state readout

On BDW+ we have just the one set of DP M/N registers. The
values we write into said registers depends on whether we
want DRRS to be in high or low gear. This causes issues
for the state checker which currently has to assume either
set of M/N (high or low refresh rate) values may appear there.
That sort of works for M/N itself, but all other values
derived from the M/N (dotclock, pixel rate) are not handled
correctly, leading to potential for state checker mismatches.

Let's avoid all those problems by simply keeping DRRS in
high gear until the state checker has done its hardware
state readout.

Note that hitting this issue presumable became very hard
after commit 1b333c679a0f ("drm/i915: Do DRRS disable/enable
during pre/post_plane_update()") since the state check would
have to laze about for one full second (delay used by
intel_drrs_schedule_work()) to see the low refresh rate.
But it is still theoretically possible.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221020120706.25728-1-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_display.c