From: "Murthy, Arun R" <arun.r.murthy@intel.com>
To: Xaver Hugl <xaver.hugl@kde.org>
Cc: <dri-devel@lists.freedesktop.org>,
<intel-gfx@lists.freedesktop.org>,
<intel-xe@lists.freedesktop.org>, Simona Vetter <simona@ffwll.ch>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
Jani Nikula <jani.nikula@linux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
<naveen1.kumar@intel.com>, <uma.shankar@intel.com>,
<harry.wentland@amd.com>
Subject: Re: [PATCH v3 1/4] drm: Define user readable error codes for atomic ioctl
Date: Sat, 23 Aug 2025 11:16:18 +0530 [thread overview]
Message-ID: <3d0136ee-fa1d-40ff-8304-da4d7432b1f1@intel.com> (raw)
In-Reply-To: <CAFZQkGwqgo7FavPQecKgwaZ1DcXccY9urRzcfocg+Srd4P9WPA@mail.gmail.com>
On 22-08-2025 21:44, Xaver Hugl wrote:
>> +#define DRM_MODE_ATOMIC_FAILURE_REASON \
>> + FAILURE_REASON(DRM_MODE_ATOMIC_CAP_NOT_ENABLED, "DRM_ATOMIC capability not enabled") \
>> + FAILURE_REASON(DRM_MODE_ATOMIC_INVALID_FLAG, "invalid flag") \
>> + FAILURE_REASON(DRM_MODE_ATOMIC_PAGE_FLIP_ASYNC, "Legacy DRM_MODE_PAGE_FLIP_ASYNC not to be used in atomic ioctl") \
>> + FAILURE_REASON(DRM_MODE_ATOMIC_FLIP_EVENT_WITH_CHECKONLY, "requesting page-flip event with TEST_ONLY") \
>> + FAILURE_REASON(DRM_MODE_ATOMIC_CRTC_NEED_FULL_MODESET, "Need full modeset on this crtc") \
>> + FAILURE_REASON(DRM_MODE_ATOMIC_NEED_FULL_MODESET, "Need full modeset on all the connected crtc's") \
>> + FAILURE_REASON(DRM_MODE_ATOMIC_ASYNC_NOT_SUP_PLANE, "Async flip not supported on this plane") \
>> + FAILURE_REASON(DRM_MODE_ATOMIC_ASYNC_MODIFIER_NOT_SUPPORTED, "Modifier not supported on this plane with async flip") \
>> + FAILURE_REASON(DRM_MODE_ATOMIC_ASYNC_PROP_CHANGED, "No property change allowed when async flip is enabled")
> As mentioned before, some of these errors are a bit too specific. We
> don't need to have an enum value for every way the API can be used
> wrongly - CAP_NOT_ENABLED, INVALID_FLAG, PAGE_FLIP_ASYNC and
> MODIFIER_NOT_SUPPORTED should all just be one enum value for "invalid
> API usage".
> In general, there should only be enum values that the compositor
> implementation can actually use on end-user systems. For further
> information when debugging a broken compositor implementation, other
> tools can be used instead, like drm debug logging or the returned
> string.
I have considered your comment in the last series and have removed
driver specific errors.
Anyway will have a look again on this and will get back.
>> +#define FAILURE_REASON(flag, reason) flag,
>> +typedef enum {
>> + DRM_MODE_ATOMIC_FAILURE_REASON
>> +} drm_mode_atomic_failure_flag;
>> +#undef FAILURE_REASON
>> +
>> +#define FAILURE_REASON(flag, reason) #reason,
>> +extern const char *drm_mode_atomic_failure_string[];
>> +#undef FAILURE_REASON
> The intention for the string wasn't for the enum values to be paired
> with a description of the enum - that belongs into documentation, not
> uAPI.
>
> The idea behind it was that drivers could add driver-specific
> information in the string for compositors to log (only in commits
> where failure isn't normally expected), so we have an easier time
> debugging issues a user system experienced by looking at the
> compositor logs. Sending the enum value again in string form isn't
> useful.
We are not sending enum value in string. Its just a single place where
we have both enum and string. Upon user adding new error codes if both
enum and string are at a single place it would be easy for the user.
Hence adding both in a single place using X macros.
Its not mandatory to have a string for every enum, the string can be
left empty if not required, or later in the driver user can overwrite
the string as well.
Thanks and Regards,
Arun R Murthy
--------------------
> - Xaver
next prev parent reply other threads:[~2025-08-23 5:46 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-22 7:00 [PATCH v3 0/4] User readable error codes on atomic_ioctl failure Arun R Murthy
2025-08-22 7:00 ` [PATCH v3 1/4] drm: Define user readable error codes for atomic ioctl Arun R Murthy
2025-08-22 10:37 ` Jani Nikula
2025-08-23 5:37 ` Murthy, Arun R
2025-08-25 9:44 ` Jani Nikula
2025-08-25 10:26 ` Murthy, Arun R
2025-08-22 16:14 ` Xaver Hugl
2025-08-23 5:46 ` Murthy, Arun R [this message]
2025-08-25 9:47 ` Jani Nikula
2025-08-25 10:32 ` Murthy, Arun R
2025-08-22 7:00 ` [PATCH v3 2/4] drm/atomic: Add error_code element in atomic_state Arun R Murthy
2025-08-22 7:00 ` [PATCH v3 3/4] drm/atomic: Return user readable error in atomic_ioctl Arun R Murthy
2025-08-22 10:50 ` Jani Nikula
2025-08-25 5:24 ` Murthy, Arun R
2025-08-22 7:00 ` [PATCH v3 4/4] drm/i915/display: Error codes for async flip failures Arun R Murthy
2025-08-22 11:31 ` Maarten Lankhorst
2025-08-22 11:46 ` Jani Nikula
2025-08-25 5:32 ` Murthy, Arun R
2025-08-22 8:02 ` ✗ i915.CI.BAT: failure for User readable error codes on atomic_ioctl failure (rev2) Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3d0136ee-fa1d-40ff-8304-da4d7432b1f1@intel.com \
--to=arun.r.murthy@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=naveen1.kumar@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=simona@ffwll.ch \
--cc=uma.shankar@intel.com \
--cc=xaver.hugl@kde.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).