]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915: clean up pipe's ddb usage in intel_crtc_disable_noatomic()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 6 Mar 2025 16:34:08 +0000 (18:34 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 7 Mar 2025 17:02:30 +0000 (19:02 +0200)
Update the ddb tracking information when we disable a pipe
during sanitization. Avoids leaving stale junk in the states.

Currently this doesn't do anything as we haven't read out this
state yet when we do the sanitization, but that will change soon.

Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250306163420.3961-7-ville.syrjala@linux.intel.com
drivers/gpu/drm/i915/display/skl_watermark.c

index 4930e52322d31683b8bffcba765929da638e8dc2..9584d4da13d0ecf4ad0e83057a2cea268d4faff0 100644 (file)
@@ -3848,6 +3848,8 @@ static void skl_wm_get_hw_state_and_sanitize(struct drm_i915_private *i915)
 void skl_wm_crtc_disable_noatomic(struct intel_crtc *crtc)
 {
        struct intel_display *display = to_intel_display(crtc);
+       struct intel_crtc_state *crtc_state =
+               to_intel_crtc_state(crtc->base.state);
        struct intel_dbuf_state *dbuf_state =
                to_intel_dbuf_state(display->dbuf.obj.state);
        enum pipe pipe = crtc->pipe;
@@ -3856,6 +3858,13 @@ void skl_wm_crtc_disable_noatomic(struct intel_crtc *crtc)
                return;
 
        dbuf_state->active_pipes &= ~BIT(pipe);
+
+       dbuf_state->weight[pipe] = 0;
+       dbuf_state->slices[pipe] = 0;
+
+       memset(&dbuf_state->ddb[pipe], 0, sizeof(dbuf_state->ddb[pipe]));
+
+       memset(&crtc_state->wm.skl.ddb, 0, sizeof(crtc_state->wm.skl.ddb));
 }
 
 void intel_wm_state_verify(struct intel_atomic_state *state,