> Subject: [PATCH v7 5/5] drm/i915/display: Error codes for async flip failures
> 
> For failures in async flip atomic check/commit path return user readable error
> codes in struct drm_atomic_state.
> 
> Signed-off-by: Arun R Murthy <[email protected]>

LGTM,
Reviewed-by: Suraj Kandpal <[email protected]>

> ---
>  drivers/gpu/drm/i915/display/intel_display.c | 25 ++++++++++++++-----------
>  1 file changed, 14 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c
> b/drivers/gpu/drm/i915/display/intel_display.c
> index
> 81b3a6692ca20198ed4460af25a61b2d48e76023..737a07f9c0ca08682b13c20ab
> 5877c1b57c09990 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -6016,9 +6016,10 @@ static int intel_async_flip_check_uapi(struct
> intel_atomic_state *state,
>       }
> 
>       if (intel_crtc_needs_modeset(new_crtc_state)) {
> -             drm_dbg_kms(display->drm,
> -                         "[CRTC:%d:%s] modeset required\n",
> -                         crtc->base.base.id, crtc->base.name);
> +             drm_mode_atomic_add_error_msg(&state->base.error_code,
> +
> DRM_MODE_ATOMIC_CRTC_NEED_FULL_MODESET,
> +                                           "[CRTC:%d:%s] requires full
> modeset",
> +                                           crtc->base.base.id, crtc-
> >base.name);
>               return -EINVAL;
>       }
> 
> @@ -6085,9 +6086,10 @@ static int intel_async_flip_check_hw(struct
> intel_atomic_state *state, struct in
>       }
> 
>       if (intel_crtc_needs_modeset(new_crtc_state)) {
> -             drm_dbg_kms(display->drm,
> -                         "[CRTC:%d:%s] modeset required\n",
> -                         crtc->base.base.id, crtc->base.name);
> +             drm_mode_atomic_add_error_msg(&state->base.error_code,
> +
> DRM_MODE_ATOMIC_CRTC_NEED_FULL_MODESET,
> +                                           "[CRTC:%d:%s] requires full
> modeset",
> +                                           crtc->base.base.id, crtc-
> >base.name);
>               return -EINVAL;
>       }
> 
> @@ -6125,11 +6127,12 @@ static int intel_async_flip_check_hw(struct
> intel_atomic_state *state, struct in
> 
>               if (!intel_plane_can_async_flip(plane, new_plane_state->hw.fb-
> >format,
>                                               new_plane_state->hw.fb-
> >modifier)) {
> -                     drm_dbg_kms(display->drm,
> -                                 "[PLANE:%d:%s] pixel format %p4cc /
> modifier 0x%llx does not support async flip\n",
> -                                 plane->base.base.id, plane->base.name,
> -                                 &new_plane_state->hw.fb->format->format,
> -                                 new_plane_state->hw.fb->modifier);
> +                     drm_mode_atomic_add_error_msg(&state-
> >base.error_code,
> +
> DRM_MODE_ATOMIC_ASYNC_MODIFIER_NOT_SUPP,
> +                                                   "[PLANE:%d:%s] pixel
> format %p4cc / 0x%llx modifier does not support async flip",
> +                                                   plane->base.base.id,
> plane->base.name,
> +                                                   &new_plane_state->hw.fb-
> >format->format,
> +                                                   new_plane_state->hw.fb-
> >modifier);
>                       return -EINVAL;
>               }
> 
> 
> --
> 2.25.1

Reply via email to