On 18-03-2026 20:35, Xaver Hugl wrote:
Hi,
I now have an implementation in KWin:
https://invent.kde.org/plasma/kwin/-/merge_requests/8991
One thing I noticed is still missing is the catch-all case / unspecified
error; the "invalid API usage" enum value would be quite misleading for
that.
Have added the remaining error codes to the enum
drm_mode_atomic_err_code, will push as part of patchset 11.
/**
* enum drm_mode_atomic_failure_codes - error codes for failures in
atomic_ioctl
* @DRM_MODE_ATOMIC_INVALID_API_USAGE: invallid API usage(DRM_ATOMIC not
* enabled, invalid falg, page_flip
event
* with test-only, etc)
* @DRM_MODE_ATOMIC_NEED_FULL_MODESET: Need full modeset on all
connected crtc's
* @DRM_MODE_ATOMIC_ASYNC_PROP_CHANGED: Property changed in async flip
* @DRM_MODE_ATOMIC_SCANOUT_BW: For a given resolution, refresh rate
and the
* color depth cannot be accomodated.
Resolution is
* to lower the refresh rate or color depth.
* @DRM_MODE_ATOMIC_CONNECTOR_BW: Refers to the limitation on the link
rate on
* a given connector.
* @DRM_MODE_ATOMIC_PIPE_BW: Limitation on the pipe, either pipe not
available
* or the pipe scaling factor limitation.
* @DRM_MODE_ATOMIC_MEMORY_DOMAIN: Any other memory/bandwidth related
limitation
* other then the ones specified above.
* @DRM_MODE_ATOMIC_SPEC_VIOLOATION: Limitation of a particular feature
on that
* hardware. To get to know the
feature, the
* property/object causing this is
being sent
* back to user @failure_objs_ptr in the
* struct drm_mode_atomic_err_code
*/
enum drm_mode_atomic_failure_codes {
DRM_MODE_ATOMIC_INVALID_API_USAGE,
DRM_MODE_ATOMIC_NEED_FULL_MODESET,
DRM_MODE_ATOMIC_ASYNC_PROP_CHANGED,
DRM_MODE_ATOMIC_SCANOUT_BW,
DRM_MODE_ATTOMIC_CONNECTOR_BW,
DRM_MODE_ATTOMIC_PIPE_BW,
DRM_MODE_ATOMIC_MEMORY_DOMAIN,
DRM_MODE_ATOMIC_SPEC_VIOLOATION,
};
As far as the enum INVALID_API_USAGE is concerned, there is a certain
understanding on the
usage of the atomic_ioctl, any miss in that would fall in this
category. Some of them include
- Driver doesnt support atomic, but still atomic_ioctl being used
- Invalid/Junk flags
- Async flip not supported
- Flag page flip event along with test only is not supported
If changing this INVALID_API_USAGE to UNSPECIFIED_ERROR makes more
sense, I can change that.
Thanks and Regards,
Arun R Murthy
-------------------
- Xaver