drm/i915: Stop clobbering old crtc state during state check
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 4 Oct 2023 15:55:57 +0000 (18:55 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 6 Oct 2023 20:58:33 +0000 (23:58 +0300)
commit2745bdda20952fa9ef0a1af415de89fb4f5dd2bd
treef21967ebf05c182a099bccf958e1a70f4653c8a5
parent12e03c805806829e823a1154d43cdfef68cb12c3
drm/i915: Stop clobbering old crtc state during state check

The state checker overwrites the old crtc state with the
current hardware state. While that does save a kmalloc() it seems
rather dubious as there might still be something that we need
in the old crtc state.

Stop doing that and just allocate a temporary state for the state
checker. Should the extra malloc during the commit phase turn out
too annoying we could of course preallocate one for each crtc, but
let's proceed with the straightforward approch for now.

And while at it let's mark the new crtc state as const to make
sure the state checker doesn't mess it up.

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