From b34bafc38cd9573694f5049bb308387ba8d8c042 Mon Sep 17 00:00:00 2001 From: Thomas Hellström Date: Wed, 20 May 2026 12:16:16 +0200 Subject: drm/exec, drm/xe, drm/amdgpu: Add an accessor for struct drm_exec::ticket MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drivers were accessing this drm_exec member directly. While that may seem harmless, it will require action if the drm_exec utility is made a subclass of a dma-resv transaction utility as outlined in the cover-letter. Provide an accessor, drm_exec_ticket() to avoid that. v2: - Fix amdgpu compile error (Intel CI) - Update the commit message. Signed-off-by: Thomas Hellström Reviewed-by: Christian König Link: https://patch.msgid.link/20260520101616.41284-5-thomas.hellstrom@linux.intel.com --- include/drm/drm_exec.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/drm/drm_exec.h') diff --git a/include/drm/drm_exec.h b/include/drm/drm_exec.h index 99c7e1bb3c5b..8725ba92ff91 100644 --- a/include/drm/drm_exec.h +++ b/include/drm/drm_exec.h @@ -161,6 +161,17 @@ static inline bool drm_exec_is_contended(struct drm_exec *exec) goto *__drm_exec_retry_ptr; \ } while (0) +/** + * drm_exec_ticket - return the ww_acquire_ctx for this exec context + * @exec: drm_exec object + * + * Return: Pointer to the ww_acquire_ctx embedded in @exec. + */ +static inline struct ww_acquire_ctx *drm_exec_ticket(struct drm_exec *exec) +{ + return &exec->ticket; +} + void drm_exec_init(struct drm_exec *exec, u32 flags, unsigned nr); void drm_exec_fini(struct drm_exec *exec); bool drm_exec_cleanup(struct drm_exec *exec); -- cgit v1.2.3