Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [High] drm_atomic_helper_check_plane_damage() is placed too late in the 
atomic check pipeline and conditionally bypassed, breaking the damage clipping 
contract during modesets.
--

commit 5c79bcf5010895b431b3c2135c7b80a5163d8e9f
Author: Thomas Zimmermann <[email protected]>

drm/i915/display: Handle struct drm_plane_state.ignore_damage_clips

This commit introduces a call to drm_atomic_helper_check_plane_damage() in
intel_psr2_sel_fetch_update() to selectively ignore damage clipping in certain
framebuffer changes.

> diff --git a/drivers/gpu/drm/i915/display/intel_psr.c 
> b/drivers/gpu/drm/i915/display/intel_psr.c
> index 92af21d823a37..5a155f60110fb 100644
> --- a/drivers/gpu/drm/i915/display/intel_psr.c
> +++ b/drivers/gpu/drm/i915/display/intel_psr.c
[ ... ]
> @@ -2949,6 +2949,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,

[Severity: High]
Is this call to drm_atomic_helper_check_plane_damage() placed too late in the
atomic check pipeline?

By placing it here in intel_psr2_sel_fetch_update() (which runs during the CRTC
check phase), intel_plane_atomic_check() has already run and called
intel_plane_copy_uapi_plane_damage(). That means new_plane_state->damage was
already calculated using the unsanitized fb_damage_clips before this check
could clear them during a full modeset.

Additionally, this loop selectively skips planes on non-PSR2 CRTCs or planes
with changed visibility (e.g. via the continue statements earlier in the loop).
Doesn't this mean the damage state is left unsanitized for those skipped
planes, potentially causing visual corruption when restricted clip rectangles
are used instead of updating the full plane?

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=1

Reply via email to