Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 1/2] include: Add GEM_CHANGE_HANDLE to drm.h
@ 2026-11-25 14:41 David Francis
  2026-11-25 14:41 ` [PATCH v6 2/2] tests/intel: Add edge case and race condition tests for GEM_CHANGE_HANDLE David Francis
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: David Francis @ 2026-11-25 14:41 UTC (permalink / raw)
  To: igt-dev; +Cc: David Francis

This ioctl was added in kernel patch
https://lore.kernel.org/dri-devel/20250717143556.857893-2-David.Francis@amd.com/

It provides an interface to change the handle of a gem object.

To test it, we need this interface

Signed-off-by: David Francis <David.Francis@amd.com>
---
 include/drm-uapi/drm.h | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/include/drm-uapi/drm.h b/include/drm-uapi/drm.h
index baa620e3f..cf131da24 100644
--- a/include/drm-uapi/drm.h
+++ b/include/drm-uapi/drm.h
@@ -619,6 +619,21 @@ struct drm_gem_open {
 	__u64 size;
 };
 
+/**
+ * struct drm_gem_change_handle - Argument for &DRM_IOCTL_GEM_CHANGE_HANDLE ioctl.
+ * @handle: The handle of a gem object.
+ * @new_handle: An available gem handle.
+ *
+ * This ioctl changes the handle of a GEM object to the specified one.
+ * The new handle must be unused. On success the old handle is closed
+ * and all further IOCTL should refer to the new handle only.
+ * Calls to DRM_IOCTL_PRIME_FD_TO_HANDLE will return the new handle.
+ */
+struct drm_gem_change_handle {
+	__u32 handle;
+	__u32 new_handle;
+};
+
 /**
  * DRM_CAP_DUMB_BUFFER
  *
@@ -1296,6 +1311,14 @@ extern "C" {
  */
 #define DRM_IOCTL_MODE_CLOSEFB		DRM_IOWR(0xD0, struct drm_mode_closefb)
 
+/**
+ * DRM_IOCTL_GEM_CHANGE_HANDLE - Move an object to a different handle
+ *
+ * Some applications (notably CRIU) need objects to have specific gem handles.
+ * This ioctl changes the object at one gem handle to use a new gem handle.
+ */
+#define DRM_IOCTL_GEM_CHANGE_HANDLE    DRM_IOWR(0xD2, struct drm_gem_change_handle)
+
 /*
  * Device specific ioctls should only be in their respective headers
  * The device specific ioctl range is from 0x40 to 0x9f.
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-11-30 16:03 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 14:41 [PATCH v6 1/2] include: Add GEM_CHANGE_HANDLE to drm.h David Francis
2026-11-25 14:41 ` [PATCH v6 2/2] tests/intel: Add edge case and race condition tests for GEM_CHANGE_HANDLE David Francis
2026-11-30 16:01   ` Kamil Konieczny
2026-11-25 23:06 ` ✓ Xe.CI.BAT: success for series starting with [v6,1/2] include: Add GEM_CHANGE_HANDLE to drm.h Patchwork
2026-11-25 23:25 ` ✓ i915.CI.BAT: " Patchwork
2026-11-26  8:31 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-11-26 19:41 ` [PATCH v6 1/2] " Kamil Konieczny
2026-11-26 19:51   ` Francis, David
2026-11-30 16:00     ` Kamil Konieczny
2026-11-27  6:20 ` ✗ i915.CI.Full: failure for series starting with [v6,1/2] " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox