[PATCH v10 6/7] drm/i915/display: Error codes for async flip failures

Arun R Murthy
2026-02-23T09:18:06Z

For failures in async flip atomic check/commit path return user readable
error codes in struct drm_atomic_state.

v8: Replaced DRM_MODE_ATOMIC_ASYNC_NOT_SUPP_PLANE,
DRM_MODE_ATOMIC_ASYNC_MODIFIER_NOT_SUPP with INVALUD_API_USAGE
(Xaver)

Signed-off-by: Arun R Murthy <arun.r.murthy@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
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 33821cc2948b6ea1f96a8adceb459a08c255d9e3..b648dbe1f0b3c70eef093f32e3e35d9187961d94 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -6055,9 +6055,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;
}

@@ -6124,9 +6125,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;
}

@@ -6164,11 +6166,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_INVALID_API_USAGE,
+ "[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