The mode-setting pipeline can disabled damage clippings for a commit
by setting ignore_damage_clips in struct drm_plane_state. The commit
will then do a full display update. Commit 35ed38d58257 ("drm: Allow
drivers to indicate the damage helpers to ignore damage clips") introduced
ignore_damage_clips to selectively ignore damage clipping in certain
framebuffer changes.

The i915 driver does not modify the flag, but DRM's damage iterator
will soon rely on it. Calling drm_atomic_helper_check_plane_damage()
right before drm_atomic_helper_damage_merged() guarantees that it
has the correct state. The i915 driver does not do this elsewhere
so far.

Signed-off-by: Thomas Zimmermann <[email protected]>
Fixes: 35ed38d58257 ("drm: Allow drivers to indicate the damage helpers to 
ignore damage clips")
Cc: <[email protected]> # v6.4+
Cc: Javier Martinez Canillas <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: Zack Rusin <[email protected]>
Cc: [email protected]
Cc: <[email protected]> # v6.8+
---
 drivers/gpu/drm/i915/display/intel_psr.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_psr.c 
b/drivers/gpu/drm/i915/display/intel_psr.c
index e138982dc91f..e4f43eb5bd72 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -3018,6 +3018,9 @@ int intel_psr2_sel_fetch_update(struct intel_atomic_state 
*state,
                src = drm_plane_state_src(&new_plane_state->uapi);
                drm_rect_fp_to_int(&src, &src);
 
+               /* Prepare plane-damage state before using it */
+               drm_atomic_helper_check_plane_damage(&state->base, 
&new_plane_state->uapi);
+
                if (!drm_atomic_helper_damage_merged(&old_plane_state->uapi,
                                                     &new_plane_state->uapi, 
&damaged_area))
                        continue;
-- 
2.54.0

Reply via email to