* [PATCH] amdgpu: add interface for reserve/unserve vmid
@ 2017-04-28 9:22 Chunming Zhou
[not found] ` <1493371366-10581-1-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Chunming Zhou @ 2017-04-28 9:22 UTC (permalink / raw)
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Chunming Zhou
Change-Id: If533576eb8a65bd019a3480d6fe2a64f23e3c944
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
---
amdgpu/amdgpu.h | 13 +++++++++++++
amdgpu/amdgpu_cs.c | 30 ++++++++++++++++++++++++++++++
2 files changed, 43 insertions(+)
diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h
index 4772006..7afade0 100644
--- a/amdgpu/amdgpu.h
+++ b/amdgpu/amdgpu.h
@@ -1626,6 +1626,19 @@ int amdgpu_cs_signal_sem(amdgpu_device_handle dev,
uint32_t ip_instance,
uint32_t ring,
amdgpu_sem_handle sem);
+/**
+ * reserve vmid for this process
+ *
+ * \param dev - [in] Device handle. See #amdgpu_device_initialize()
+ */
+int amdgpu_cs_reserved_vmid(amdgpu_device_handle dev);
+
+/**
+ * unreserve vmid for this process
+ *
+ * \param dev - [in] Device handle. See #amdgpu_device_initialize()
+ */
+int amdgpu_cs_unreserved_vmid(amdgpu_device_handle dev);
/**
* wait sem
diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c
index 62b595a..df362ee 100644
--- a/amdgpu/amdgpu_cs.c
+++ b/amdgpu/amdgpu_cs.c
@@ -754,3 +754,33 @@ int amdgpu_cs_destroy_sem(amdgpu_device_handle dev,
return 0;
}
+
+int amdgpu_cs_unreserved_vmid(amdgpu_device_handle dev)
+{
+ union drm_amdgpu_vm args;
+ int r;
+
+ if (NULL == dev)
+ return -EINVAL;
+
+ /* Create the context */
+ memset(&args, 0, sizeof(args));
+ args.in.op = AMDGPU_VM_OP_UNRESERVE_VMID;
+ r = drmCommandWriteRead(dev->fd, DRM_AMDGPU_VM, &args, sizeof(args));
+ return r;
+}
+
+int amdgpu_cs_reserved_vmid(amdgpu_device_handle dev)
+{
+ union drm_amdgpu_vm args;
+ int r;
+
+ if (NULL == dev)
+ return -EINVAL;
+
+ /* Create the context */
+ memset(&args, 0, sizeof(args));
+ args.in.op = AMDGPU_VM_OP_RESERVE_VMID;
+ r = drmCommandWriteRead(dev->fd, DRM_AMDGPU_VM, &args, sizeof(args));
+ return r;
+}
--
1.9.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 3+ messages in thread[parent not found: <1493371366-10581-1-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>]
* Re: [PATCH] amdgpu: add interface for reserve/unserve vmid [not found] ` <1493371366-10581-1-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org> @ 2017-04-28 9:23 ` zhoucm1 2017-05-02 2:30 ` Zhang, Jerry (Junwei) 1 sibling, 0 replies; 3+ messages in thread From: zhoucm1 @ 2017-04-28 9:23 UTC (permalink / raw) To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW anyone could give a quick review? Regards, David Zhou On 2017年04月28日 17:22, Chunming Zhou wrote: > Change-Id: If533576eb8a65bd019a3480d6fe2a64f23e3c944 > Signed-off-by: Chunming Zhou <David1.Zhou@amd.com> > --- > amdgpu/amdgpu.h | 13 +++++++++++++ > amdgpu/amdgpu_cs.c | 30 ++++++++++++++++++++++++++++++ > 2 files changed, 43 insertions(+) > > diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h > index 4772006..7afade0 100644 > --- a/amdgpu/amdgpu.h > +++ b/amdgpu/amdgpu.h > @@ -1626,6 +1626,19 @@ int amdgpu_cs_signal_sem(amdgpu_device_handle dev, > uint32_t ip_instance, > uint32_t ring, > amdgpu_sem_handle sem); > +/** > + * reserve vmid for this process > + * > + * \param dev - [in] Device handle. See #amdgpu_device_initialize() > + */ > +int amdgpu_cs_reserved_vmid(amdgpu_device_handle dev); > + > +/** > + * unreserve vmid for this process > + * > + * \param dev - [in] Device handle. See #amdgpu_device_initialize() > + */ > +int amdgpu_cs_unreserved_vmid(amdgpu_device_handle dev); > > /** > * wait sem > diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c > index 62b595a..df362ee 100644 > --- a/amdgpu/amdgpu_cs.c > +++ b/amdgpu/amdgpu_cs.c > @@ -754,3 +754,33 @@ int amdgpu_cs_destroy_sem(amdgpu_device_handle dev, > > return 0; > } > + > +int amdgpu_cs_unreserved_vmid(amdgpu_device_handle dev) > +{ > + union drm_amdgpu_vm args; > + int r; > + > + if (NULL == dev) > + return -EINVAL; > + > + /* Create the context */ > + memset(&args, 0, sizeof(args)); > + args.in.op = AMDGPU_VM_OP_UNRESERVE_VMID; > + r = drmCommandWriteRead(dev->fd, DRM_AMDGPU_VM, &args, sizeof(args)); > + return r; > +} > + > +int amdgpu_cs_reserved_vmid(amdgpu_device_handle dev) > +{ > + union drm_amdgpu_vm args; > + int r; > + > + if (NULL == dev) > + return -EINVAL; > + > + /* Create the context */ > + memset(&args, 0, sizeof(args)); > + args.in.op = AMDGPU_VM_OP_RESERVE_VMID; > + r = drmCommandWriteRead(dev->fd, DRM_AMDGPU_VM, &args, sizeof(args)); > + return r; > +} _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] amdgpu: add interface for reserve/unserve vmid [not found] ` <1493371366-10581-1-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org> 2017-04-28 9:23 ` zhoucm1 @ 2017-05-02 2:30 ` Zhang, Jerry (Junwei) 1 sibling, 0 replies; 3+ messages in thread From: Zhang, Jerry (Junwei) @ 2017-05-02 2:30 UTC (permalink / raw) To: Chunming Zhou, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW On 04/28/2017 05:22 PM, Chunming Zhou wrote: > Change-Id: If533576eb8a65bd019a3480d6fe2a64f23e3c944 > Signed-off-by: Chunming Zhou <David1.Zhou@amd.com> > --- > amdgpu/amdgpu.h | 13 +++++++++++++ > amdgpu/amdgpu_cs.c | 30 ++++++++++++++++++++++++++++++ > 2 files changed, 43 insertions(+) > > diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h > index 4772006..7afade0 100644 > --- a/amdgpu/amdgpu.h > +++ b/amdgpu/amdgpu.h > @@ -1626,6 +1626,19 @@ int amdgpu_cs_signal_sem(amdgpu_device_handle dev, > uint32_t ip_instance, > uint32_t ring, > amdgpu_sem_handle sem); > +/** > + * reserve vmid for this process > + * > + * \param dev - [in] Device handle. See #amdgpu_device_initialize() > + */ > +int amdgpu_cs_reserved_vmid(amdgpu_device_handle dev); > + > +/** > + * unreserve vmid for this process > + * > + * \param dev - [in] Device handle. See #amdgpu_device_initialize() > + */ > +int amdgpu_cs_unreserved_vmid(amdgpu_device_handle dev); > > /** > * wait sem > diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c > index 62b595a..df362ee 100644 > --- a/amdgpu/amdgpu_cs.c > +++ b/amdgpu/amdgpu_cs.c > @@ -754,3 +754,33 @@ int amdgpu_cs_destroy_sem(amdgpu_device_handle dev, > > return 0; > } > + > +int amdgpu_cs_unreserved_vmid(amdgpu_device_handle dev) We might provide one more parameter for UMD flexibly, even if it's unused for now. i.e. the number of reserved vmid(constrained by KMD limitation, of course) and anything else like that. Did we have any discussion about it with UMD guys? > +{ > + union drm_amdgpu_vm args; > + int r; > + > + if (NULL == dev) > + return -EINVAL; > + > + /* Create the context */ It looks typo in comment for the actual code > + memset(&args, 0, sizeof(args)); > + args.in.op = AMDGPU_VM_OP_UNRESERVE_VMID; > + r = drmCommandWriteRead(dev->fd, DRM_AMDGPU_VM, &args, sizeof(args)); > + return r; > +} > + > +int amdgpu_cs_reserved_vmid(amdgpu_device_handle dev) > +{ > + union drm_amdgpu_vm args; > + int r; > + > + if (NULL == dev) > + return -EINVAL; > + > + /* Create the context */ Same typo as above comment Jerry > + memset(&args, 0, sizeof(args)); > + args.in.op = AMDGPU_VM_OP_RESERVE_VMID; > + r = drmCommandWriteRead(dev->fd, DRM_AMDGPU_VM, &args, sizeof(args)); > + return r; > +} > _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-05-02 2:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-28 9:22 [PATCH] amdgpu: add interface for reserve/unserve vmid Chunming Zhou
[not found] ` <1493371366-10581-1-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2017-04-28 9:23 ` zhoucm1
2017-05-02 2:30 ` Zhang, Jerry (Junwei)
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.