[PATCH] drm: don't run atomic_async_check for disabled planes

Alex Deucher alexdeucher at gmail.com
Mon Jul 28 18:59:50 UTC 2025


On Wed, Jul 23, 2025 at 11:08 AM Xaver Hugl <xaver.hugl at kde.org> wrote:
>
> It's entirely valid and correct for compositors to include disabled
> planes in the atomic commit, and doing that should not prevent async
> flips from working. To fix that, this commit skips the async checks
> if the plane was and still is not visible.
>
> Fixes: fd40a63c drm/atomic: Let drivers decide which planes to async flip

This should be:
Fixes: fd40a63c63a1 ("drm/atomic: Let drivers decide which planes to
async flip")

> Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4263
>
> Signed-off-by: Xaver Hugl <xaver.hugl at kde.org>
> ---
>  drivers/gpu/drm/drm_atomic_uapi.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c
> index c2726af6698e..2e62561fd94d 100644
> --- a/drivers/gpu/drm/drm_atomic_uapi.c
> +++ b/drivers/gpu/drm/drm_atomic_uapi.c
> @@ -1066,6 +1066,7 @@ int drm_atomic_set_property(struct drm_atomic_state *state,
>         }
>         case DRM_MODE_OBJECT_PLANE: {
>                 struct drm_plane *plane = obj_to_plane(obj);
> +               struct drm_plane_state *old_plane_state;
>                 struct drm_plane_state *plane_state;
>                 struct drm_mode_config *config = &plane->dev->mode_config;
>                 const struct drm_plane_helper_funcs *plane_funcs = plane->helper_private;
> @@ -1086,8 +1087,15 @@ int drm_atomic_set_property(struct drm_atomic_state *state,
>                                 ret = drm_atomic_check_prop_changes(ret, old_val, prop_value, prop);
>                         }
>
> +                       old_plane_state = drm_atomic_get_old_plane_state(state, plane);
> +                       if (IS_ERR(old_plane_state)) {
> +                               ret = PTR_ERR(plane_state);
> +                               break;
> +                       }
> +
>                         /* ask the driver if this non-primary plane is supported */
> -                       if (plane->type != DRM_PLANE_TYPE_PRIMARY) {
> +                       if (plane->type != DRM_PLANE_TYPE_PRIMARY &&
> +                                       (plane_state->visible || old_plane_state->visible)) {
>                                 ret = -EINVAL;
>
>                                 if (plane_funcs && plane_funcs->atomic_async_check)
> --
> 2.50.1
>


More information about the Intel-gfx mailing list