From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm: Define user readable error codes for atomic ioctl
Date: Tue, 24 Feb 2026 10:26:59 +1000 [thread overview]
Message-ID: <review-patch1-20260223-atomic-v10-1-f59c8def2e70@intel.com> (raw)
In-Reply-To: <20260223-atomic-v10-1-f59c8def2e70@intel.com>
Patch Review
This patch defines the UAPI structures and enums for error reporting.
> +enum drm_mode_atomic_failure_codes {
> + DRM_MODE_ATOMIC_INVALID_API_USAGE,
> + DRM_MODE_ATOMIC_CRTC_NEED_FULL_MODESET,
> + DRM_MODE_ATOMIC_NEED_FULL_MODESET,
> + DRM_MODE_ATOMIC_ASYNC_PROP_CHANGED,
> +};
`DRM_MODE_ATOMIC_INVALID_API_USAGE` has the value 0. Since the error struct is zero-initialized, userspace cannot distinguish "no error code was set" from "the error was invalid API usage." The enum should start at 1, or a sentinel/none value should be added at 0.
`DRM_MODE_ATOMIC_NEED_FULL_MODESET` is defined here but never used in any patch in this series. Is it intended for future use? If so, it should not be part of the initial UAPI -- adding unused UAPI values creates a commitment without any implementation to validate the semantics.
> + * @DRM_MODE_ATOMIC_INVALID_API_USAGE: invallid API usage(DRM_ATOMIC not
> + * enabled, invalid falg, page_flip event
Typos: "invallid" should be "invalid", "falg" should be "flag."
> + * @failure_code: error codes defined in enum drm_moide_atomic_failure_code
Typo: "drm_moide_atomic_failure_code" should be "drm_mode_atomic_failure_codes."
> +struct drm_mode_atomic_err_code {
> + __u64 failure_code;
> + __u64 failure_objs_ptr;
> + __u64 reserved;
> + __u32 count_objs;
> + char failure_string[DRM_MODE_ATOMIC_FAILURE_STRING_LEN];
> +};
`failure_objs_ptr`, `count_objs`, and `reserved` are defined here but never populated by any patch in this series. For UAPI, it's better to add fields when they are actually implemented. Shipping dead fields creates an API contract without any way to validate it.
The `reserved` field in a new UAPI struct must be validated to be zero by the kernel if it's intended for future extension. No such validation exists.
The struct has a `__u32 count_objs` followed by a `char` array, which means the total struct size is 156 bytes (not a multiple of 8). While this works, adding an explicit `__u32 pad` after `count_objs` would be more consistent with DRM UAPI conventions.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-02-24 0:26 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-23 9:15 [PATCH v10 0/7] User readable error codes on atomic_ioctl failure Arun R Murthy
2026-02-23 9:15 ` [PATCH v10 1/7] drm: Define user readable error codes for atomic ioctl Arun R Murthy
2026-02-24 0:26 ` Claude Code Review Bot [this message]
2026-02-23 9:16 ` [PATCH v10 2/7] drm/atomic: Add error_code element in atomic_state Arun R Murthy
2026-02-24 0:26 ` Claude review: " Claude Code Review Bot
2026-02-23 9:16 ` [PATCH v10 3/7] drm/atomic: Call complete_signaling only if prepare_signaling is done Arun R Murthy
2026-02-24 0:26 ` Claude review: " Claude Code Review Bot
2026-02-23 9:16 ` [PATCH v10 4/7] drm/atomic: Allocate atomic_state at the beginning of atomic_ioctl Arun R Murthy
2026-02-24 0:27 ` Claude review: " Claude Code Review Bot
2026-02-23 9:16 ` [PATCH v10 5/7] drm/atomic: Return user readable error in atomic_ioctl Arun R Murthy
2026-02-24 0:27 ` Claude review: " Claude Code Review Bot
2026-02-23 9:16 ` [PATCH v10 6/7] drm/i915/display: Error codes for async flip failures Arun R Murthy
2026-02-24 0:27 ` Claude review: " Claude Code Review Bot
2026-02-23 9:16 ` [PATCH v10 7/7] drm: Introduce DRM_CAP_ATOMIC_ERROR_REPORTING Arun R Murthy
2026-02-24 0:27 ` Claude review: " Claude Code Review Bot
2026-02-23 10:07 ` [PATCH v10 0/7] User readable error codes on atomic_ioctl failure Murthy, Arun R
2026-02-24 0:26 ` Claude review: " Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-02-10 9:03 [PATCH v9 0/7] " Arun R Murthy
2026-02-10 9:03 ` [PATCH v9 1/7] drm: Define user readable error codes for atomic ioctl Arun R Murthy
2026-02-11 6:31 ` Claude review: " Claude Code Review Bot
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=review-patch1-20260223-atomic-v10-1-f59c8def2e70@intel.com \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/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