From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: drm/atomic: Allocate atomic_state at the beginning of atomic_ioctl Date: Wed, 11 Feb 2026 16:31:47 +1000 Message-ID: In-Reply-To: <20260210-atomic-v9-3-525c88fd2402@intel.com> References: <20260210-atomic-v9-0-525c88fd2402@intel.com> <20260210-atomic-v9-3-525c88fd2402@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Mailer: Claude Code Patch Reviewer Patch Review **Issues:** ```c + state = drm_atomic_state_alloc(dev); + if (!state) + return -ENOMEM; + + drm_modeset_acquire_init(&ctx, DRM_MODESET_ACQUIRE_INTERRUPTIBLE); + state->acquire_ctx = &ctx; + state->allow_modeset = !!(arg->flags & DRM_MODE_ATOMIC_ALLOW_MODESET); + /* disallow for userspace that has not enabled atomic cap (even * though this may be a bit overkill, since legacy userspace * wouldn't know how to call this ioctl) */ if (!file_priv->atomic) { ``` - **Performance Regression**: Now allocating state for requests that will immediately fail validation. This wastes memory and CPU cycles for invalid requests. ```c - if (arg->reserved) { - drm_dbg_atomic(dev, "commit failed: reserved field set\n"); - ret = -EINVAL; - goto out; - } ``` - **ABI Change**: Removing the `reserved` field check fundamentally changes the userspace contract. Old userspace that accidentally sets this field will now have different behavior. - **Backward Compatibility**: This breaks the principle that reserved fields must be zero. --- Generated by Claude Code Patch Reviewer