Skip to contentSkip to conversation

amdgpu: add vm ioctl support

PATCH In review Chunming Zhou 2 participants 3 messages Apr 28, 2017 2 messages not in the archive DRM drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 amdgpu: add vm ioctl support

Change-Id I3c1ea377dad8f6d64a992b071a6ec36a1143e416
---
 include/drm/amdgpu_drm.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
include/drm/amdgpu_drm.h +22 -0
index 26d02ba..28cda3a 100644
@@ -47,6 +47,7 @@
 #define DRM_AMDGPU_GEM_OP		0x10
 #define DRM_AMDGPU_GEM_USERPTR		0x11
 #define DRM_AMDGPU_WAIT_FENCES		0x12
+#define DRM_AMDGPU_VM			0x13
 /* hybrid specific ioctls */
 #define DRM_AMDGPU_SEM                  0x5b
 #define DRM_AMDGPU_GEM_DGMA		0x5c
@@ -66,6 +67,7 @@
 #define DRM_IOCTL_AMDGPU_GEM_OP		DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_OP, struct drm_amdgpu_gem_op)
 #define DRM_IOCTL_AMDGPU_GEM_USERPTR	DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_USERPTR, struct drm_amdgpu_gem_userptr)
 #define DRM_IOCTL_AMDGPU_WAIT_FENCES	DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_WAIT_FENCES, union drm_amdgpu_wait_fences)
+#define DRM_IOCTL_AMDGPU_VM		DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_VM, union drm_amdgpu_vm)
 /* hybrid specific ioctls */
 #define DRM_IOCTL_AMDGPU_GEM_DGMA	DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_DGMA, struct drm_amdgpu_gem_dgma)
 #define DRM_IOCTL_AMDGPU_FREESYNC	DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_FREESYNC, struct drm_amdgpu_freesync)
@@ -201,6 +203,26 @@ union drm_amdgpu_ctx {
 	union drm_amdgpu_ctx_out out;
 };
 
+/* vm ioctl */
+#define AMDGPU_VM_OP_RESERVE_VMID	1
+#define AMDGPU_VM_OP_UNRESERVE_VMID	2
+
+struct drm_amdgpu_vm_in {
+	/** AMDGPU_VM_OP_* */
+	__u32	op;
+	__u32	flags;
+};
+
+struct drm_amdgpu_vm_out {
+	/** For future use, no flags defined so far */
+	__u64	flags;
+};
+
+union drm_amdgpu_vm {
+	struct drm_amdgpu_vm_in in;
+	struct drm_amdgpu_vm_out out;
+};
+
 /* sync file related */
 #define AMDGPU_SEM_OP_CREATE_SEM       1
 #define AMDGPU_SEM_OP_WAIT_SEM         2
Signature · 6 lines
1.9.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1493347100-5732-1-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org

author
#2 lore raw

This is drm patch for dedicated vmid.
Kernel patch has pushed to staging, anyone could have a quick review on this? Jerry? Guess Christian is in dream at current time.

Regards,
David Zhou

Quoted 43 lines · Chunming Zhou
Change-Id I3c1ea377dad8f6d64a992b071a6ec36a1143e416
---
  include/drm/amdgpu_drm.h | 22 ++++++++++++++++++++++
  1 file changed, 22 insertions(+)
include/drm/amdgpu_drm.h +15 -0
index 26d02ba..28cda3a 100644
@@ -47,6 +47,7 @@
  #define DRM_AMDGPU_GEM_OP		0x10
  #define DRM_AMDGPU_GEM_USERPTR		0x11
  #define DRM_AMDGPU_WAIT_FENCES		0x12
+#define DRM_AMDGPU_VM			0x13
  /* hybrid specific ioctls */
  #define DRM_AMDGPU_SEM                  0x5b
  #define DRM_AMDGPU_GEM_DGMA		0x5c
@@ -66,6 +67,7 @@
  #define DRM_IOCTL_AMDGPU_GEM_OP		DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_OP, struct drm_amdgpu_gem_op)
  #define DRM_IOCTL_AMDGPU_GEM_USERPTR	DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_USERPTR, struct drm_amdgpu_gem_userptr)
  #define DRM_IOCTL_AMDGPU_WAIT_FENCES	DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_WAIT_FENCES, union drm_amdgpu_wait_fences)
+#define DRM_IOCTL_AMDGPU_VM		DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_VM, union drm_amdgpu_vm)
  /* hybrid specific ioctls */
  #define DRM_IOCTL_AMDGPU_GEM_DGMA	DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_DGMA, struct drm_amdgpu_gem_dgma)
  #define DRM_IOCTL_AMDGPU_FREESYNC	DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_FREESYNC, struct drm_amdgpu_freesync)
@@ -201,6 +203,26 @@ union drm_amdgpu_ctx {
  	union drm_amdgpu_ctx_out out;
  };
 
+/* vm ioctl */
+#define AMDGPU_VM_OP_RESERVE_VMID	1
+#define AMDGPU_VM_OP_UNRESERVE_VMID	2
+
+struct drm_amdgpu_vm_in {
+	/** AMDGPU_VM_OP_* */
+	__u32	op;
+	__u32	flags;
+};
+
+struct drm_amdgpu_vm_out {
+	/** For future use, no flags defined so far */
+	__u64	flags;

include/drm/amdgpu_drm.h union drm_amdgpu_ctx { · line 228

Quoted 10 lines
include/drm/amdgpu_drm.h +7 -0
+};
+
+union drm_amdgpu_vm {
+	struct drm_amdgpu_vm_in in;
+	struct drm_amdgpu_vm_out out;
+};
+
  /* sync file related */
  #define AMDGPU_SEM_OP_CREATE_SEM       1
  #define AMDGPU_SEM_OP_WAIT_SEM         2

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): [email protected]

Reviewed-by Junwei Zhang
#4 lore raw

Regards,
Jerry (Junwei Zhang)

Linux Base Graphics
SRDC Software Development
_____________________________________

Quoted 77 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of zhoucm1
Sent: Friday, April 28, 2017 10:59
To: [email protected]
Subject: Re: [PATCH] amdgpu: add vm ioctl support

This is drm patch for dedicated vmid.
Kernel patch has pushed to staging, anyone could have a quick review on this? Jerry? Guess Christian is in dream at current time.

Regards,
David Zhou

Quoted 19 lines · Chunming Zhou
Change-Id I3c1ea377dad8f6d64a992b071a6ec36a1143e416
---
  include/drm/amdgpu_drm.h | 22 ++++++++++++++++++++++
  1 file changed, 22 insertions(+)
include/drm/amdgpu_drm.h index renamed from include/drm/amdgpu_drm.h +0 -0

26d02ba..28cda3a 100644

include/drm/amdgpu_drm.h +1 -0
@@ -47,6 +47,7 @@
  #define DRM_AMDGPU_GEM_OP		0x10
  #define DRM_AMDGPU_GEM_USERPTR		0x11
  #define DRM_AMDGPU_WAIT_FENCES		0x12
+#define DRM_AMDGPU_VM			0x13
  /* hybrid specific ioctls */
  #define DRM_AMDGPU_SEM                  0x5b
  #define DRM_AMDGPU_GEM_DGMA		0x5c

include/drm/amdgpu_drm.h line 67

Quoted 1 line
include/drm/amdgpu_drm.h +0 -0
@@ -66,6 +67,7 @@
  #define DRM_IOCTL_AMDGPU_GEM_OP

DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_OP, struct
drm_amdgpu_gem_op)

include/drm/amdgpu_drm.h line 68

Quoted 1 line
include/drm/amdgpu_drm.h +0 -0
  #define DRM_IOCTL_AMDGPU_GEM_USERPTR

DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_USERPTR,
struct drm_amdgpu_gem_userptr)

include/drm/amdgpu_drm.h line 69

Quoted 1 line
include/drm/amdgpu_drm.h +0 -0
  #define DRM_IOCTL_AMDGPU_WAIT_FENCES

DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_WAIT_FENCES,
union drm_amdgpu_wait_fences)

include/drm/amdgpu_drm.h line 70

Quoted 1 line
include/drm/amdgpu_drm.h +1 -0
+#define DRM_IOCTL_AMDGPU_VM

DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_VM, union
drm_amdgpu_vm)

include/drm/amdgpu_drm.h line 72

Quoted 2 lines
include/drm/amdgpu_drm.h +0 -0
  /* hybrid specific ioctls */
  #define DRM_IOCTL_AMDGPU_GEM_DGMA

DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_GEM_DGMA,
struct drm_amdgpu_gem_dgma)

include/drm/amdgpu_drm.h line 73

Quoted 1 line
include/drm/amdgpu_drm.h +0 -0
  #define DRM_IOCTL_AMDGPU_FREESYNC

DRM_IOWR(DRM_COMMAND_BASE + DRM_AMDGPU_FREESYNC,
struct drm_amdgpu_freesync)

Quoted 24 lines
include/drm/amdgpu_drm.h +20 -0
@@ -201,6 +203,26 @@ union drm_amdgpu_ctx {
  	union drm_amdgpu_ctx_out out;
  };
 
+/* vm ioctl */
+#define AMDGPU_VM_OP_RESERVE_VMID	1
+#define AMDGPU_VM_OP_UNRESERVE_VMID	2
+
+struct drm_amdgpu_vm_in {
+	/** AMDGPU_VM_OP_* */
+	__u32	op;
+	__u32	flags;
+};
+
+struct drm_amdgpu_vm_out {
+	/** For future use, no flags defined so far */
+	__u64	flags;
+};
+
+union drm_amdgpu_vm {
+	struct drm_amdgpu_vm_in in;
+	struct drm_amdgpu_vm_out out;
+};
+
Quoted 8 lines

include/drm/amdgpu_drm.h union drm_amdgpu_ctx { · line 228

Quoted 3 lines
include/drm/amdgpu_drm.h +0 -0
  /* sync file related */
  #define AMDGPU_SEM_OP_CREATE_SEM       1
  #define AMDGPU_SEM_OP_WAIT_SEM         2

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx