Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/atomic-state-helper: false mismatch on cropped plane src
  rect in compare
--

commit 2ca1ed51cdf19bd9781aa9d57f8d3b278be9993f
Author: Maxime Ripard <[email protected]>

drm/atomic-state-helper: Provide atomic_compare_state helpers

This commit adds default atomic state comparison helpers for planes, CRTCs,
connectors, and bridges to support post-commit hardware state readout
verification.

> diff --git a/drivers/gpu/drm/drm_atomic_state_readout_helper.c 
> b/drivers/gpu/drm/drm_atomic_state_readout_helper.c
> index 80eb467baefcf..d39d8e40f8947 100644
> --- a/drivers/gpu/drm/drm_atomic_state_readout_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_state_readout_helper.c
[ ... ]
> @@ -938,6 +939,396 @@ void drm_atomic_helper_sro_install_state(struct 
> drm_atomic_sro_state *state)
[ ... ]
> +bool drm_atomic_helper_plane_compare_state(struct drm_plane *plane,
> +                                        struct drm_printer *p,
> +                                        struct drm_plane_state *expected,
> +                                        struct drm_plane_state *actual)
> +{
[ ... ]
> +     /*
> +      * NOTE: We can't check src_x and src_y: the source offsets are
> +      * baked into the DMA base address and cannot be read back.
> +      */
> +     STATE_CHECK_U32_16_16(ret, p, plane->name, expected, actual, src_w);
> +     STATE_CHECK_U32_16_16(ret, p, plane->name, expected, actual, src_h);
[ ... ]
> +     STATE_CHECK_PTR(ret, p, plane->name, expected, actual, color_pipeline);
> +     STATE_CHECK_S32(ret, p, plane->name, expected, actual, src.x1);
> +     STATE_CHECK_S32(ret, p, plane->name, expected, actual, src.x2);
> +     STATE_CHECK_S32(ret, p, plane->name, expected, actual, src.y1);
> +     STATE_CHECK_S32(ret, p, plane->name, expected, actual, src.y2);

[Severity: Medium]
Won't comparing src.{x1,x2,y1,y2} always report a false mismatch whenever a
plane is committed with a non-zero src_x or src_y?

drm_atomic_helper_check_plane_state() initializes expected->src from
drm_plane_state_src() with x1 = src_x, y1 = src_y, x2 = src_x + src_w, and
y2 = src_y + src_h before clipping.  Since src_x and src_y are baked into
the DMA base address and cannot be read back, actual->src read out from
hardware will be rooted at (0, 0) instead of (src_x, src_y).  In addition,
src.{x1,x2,y1,y2} are 16.16 fixed-point values, so STATE_CHECK_S32 prints
them as raw integers on mismatch.

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

Reply via email to