[PATCH v2 1/4] drm: Define user readable error codes for atomic ioctl
Biju Das
biju.das.jz at bp.renesas.com
Wed Jul 30 11:22:12 UTC 2025
Hi Arun,
> -----Original Message-----
> From: dri-devel <dri-devel-bounces at lists.freedesktop.org> On Behalf Of Arun R Murthy
> Sent: 30 July 2025 11:17
> Subject: [PATCH v2 1/4] drm: Define user readable error codes for atomic ioctl
>
> There can be multiple reasons for a failure in atomic_ioctl. Most often in these error conditions -
> EINVAL is returned. User/Compositor would have to blindly take a call on failure of this ioctl so as
> to use ALLOW_MODESET or any. It would be good if user/compositor gets a readable error code on failure
> so they can take proper corrections in the next commit.
> The struct drm_mode_atomic is being passed by the user/compositor which holds the properties for
> modeset/flip. Reusing the same struct for returning the error code in case of failure can save by
> creating a new uapi/interface for returning the error code.
> The element 'reserved' in the struct drm_mode_atomic is used for returning the user readable error
> code.Its a 64bit variable and should suffice 64 error codes that should be sufficient.
>
> Signed-off-by: Arun R Murthy <arun.r.murthy at intel.com>
> ---
> include/uapi/drm/drm_mode.h | 40 ++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 40 insertions(+)
>
> diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h index
> a122bea2559387576150236e3a88f99c24ad3138..87e8f623bfaaab09135be104db04996f0be4dcb4 100644
> --- a/include/uapi/drm/drm_mode.h
> +++ b/include/uapi/drm/drm_mode.h
> @@ -1157,6 +1157,46 @@ struct drm_mode_destroy_dumb {
> DRM_MODE_ATOMIC_NONBLOCK |\
> DRM_MODE_ATOMIC_ALLOW_MODESET)
>
> +/* atomic not set in the drm_file */
> +#define DRM_MODE_ATOMIC_CAP_NOT_ENABLED BIT(0)
> +/* atomic flag passed not in DRM_MODE_ATOMIC_FLAGS list */
> +#define DRM_MODE_ATOMIC_INVALID_FLAG BIT(1)
> +/* DRM_MODE_PAGE_FLIP_LEGACY not supported with atomic ioctl */
> +#define DRM_MODE_ATOMIC_PAGE_FLIP_ASYNC BIT(2)
> +/* flip event with atomic check only not supported */
> +#define DRM_MODE_ATOMIC_FLIP_EVENT_WITH_CHECKONLY BIT(3)
> +/* atomic property change requested need full crtc modeset */
> +#define DRM_MODE_ATOMIC_CRTC_NEED_FULL_MODESET BIT(4)
> +/* atomic property change requested has impact on all connected crtc */
> +#define DRM_MODE_ATOMIC_NEED_FULL_MODESET BIT(5)
> +/* async flip supported on only primary plane */
> +#define DRM_MODE_ATOMIC_ASYNC_NOT_PRIMARY BIT(6)
> +/* modifier not supported by async flip */
> +#define DRM_MODE_ATOMIC_ASYNC_MODIFIER_NOT_SUPPORTED BIT(7)
> +/* async flip with pipe joiner not allowed */
> +#define DRM_MODE_ATOMIC_ASYNC_PIPEJOINER_NOTALLOWED BIT(8)
For consistency, NOTALLOWED->NOT_ALLOWED ??
Cheers,
Biju
More information about the Intel-gfx
mailing list