drm/i915: Add belts and suspenders locking for seamless M/N changes
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 10 Mar 2023 23:58:26 +0000 (01:58 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Sat, 18 Mar 2023 12:24:51 +0000 (14:24 +0200)
commit6e8acb6686d805ac5d127fb691e28e742248c523
tree36c82fbb2942a5a96810e7854c8afcb7113384f1
parent8cb1f95cca68421b08333175719fdd3615372ca8
drm/i915: Add belts and suspenders locking for seamless M/N changes

Add some (probably overkill) locking to protect the vblank
timestamping constants updates during seamless M/N fastsets.

As everything should be naturally aligned I think the individual
pieces should probably end up updating atomically enough. So this
is only really meant to guarantee everyone sees a consistent whole.

All the drm_vblank.c usage is covered by vblank_time_lock,
and uncore.lock will take care of __intel_get_crtc_scanline()
that can also be called from outside the core vblank functionality.

Currently only crtc_clock and framedur_ns can change, but in
the future might fastset also across eg. vtotal/vblank_end
changes, so let's just grab the locks across the whole thing.

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