From: Andrey Grodzovsky <andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Andrey Grodzovsky
<andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>,
Marek.Olsak-5C7GfCeVMHo@public.gmane.org,
Christian.Koenig-5C7GfCeVMHo@public.gmane.org,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH libdrm] amdgpu: Fix wrappers for AMDGPU_VM IOCTL.
Date: Thu, 2 Nov 2017 10:29:55 -0400 [thread overview]
Message-ID: <1509632995-9775-1-git-send-email-andrey.grodzovsky@amd.com> (raw)
Rmove amdgpu_context_handle from the interface and use
amdgpu_device_handle instead. Uupdate VMID reservation test
accordingly.
Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
---
amdgpu/amdgpu.h | 4 ++--
amdgpu/amdgpu_vm.c | 8 ++++----
tests/amdgpu/vm_tests.c | 4 ++--
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h
index 597fc2b..df85a24 100644
--- a/amdgpu/amdgpu.h
+++ b/amdgpu/amdgpu.h
@@ -1496,7 +1496,7 @@ void amdgpu_cs_chunk_fence_info_to_data(struct amdgpu_cs_fence_info *fence_info,
*
* \return 0 on success otherwise POSIX Error code
*/
-int amdgpu_vm_reserve_vmid(amdgpu_context_handle context, uint32_t flags);
+int amdgpu_vm_reserve_vmid(amdgpu_device_handle dev, uint32_t flags);
/**
* Free reserved VMID
@@ -1505,7 +1505,7 @@ int amdgpu_vm_reserve_vmid(amdgpu_context_handle context, uint32_t flags);
*
* \return 0 on success otherwise POSIX Error code
*/
-int amdgpu_vm_unreserve_vmid(amdgpu_context_handle context, uint32_t flags);
+int amdgpu_vm_unreserve_vmid(amdgpu_device_handle dev, uint32_t flags);
#ifdef __cplusplus
}
diff --git a/amdgpu/amdgpu_vm.c b/amdgpu/amdgpu_vm.c
index 304b423..5ba7c08 100644
--- a/amdgpu/amdgpu_vm.c
+++ b/amdgpu/amdgpu_vm.c
@@ -30,24 +30,24 @@
#include "xf86drm.h"
#include "amdgpu_internal.h"
-int amdgpu_vm_reserve_vmid(amdgpu_context_handle context, uint32_t flags)
+int amdgpu_vm_reserve_vmid(amdgpu_device_handle dev, uint32_t flags)
{
union drm_amdgpu_vm vm;
vm.in.op = AMDGPU_VM_OP_RESERVE_VMID;
vm.in.flags = flags;
- return drmCommandWriteRead(context->dev->fd, DRM_AMDGPU_VM,
+ return drmCommandWriteRead(dev->fd, DRM_AMDGPU_VM,
&vm, sizeof(vm));
}
-int amdgpu_vm_unreserve_vmid(amdgpu_context_handle context, uint32_t flags)
+int amdgpu_vm_unreserve_vmid(amdgpu_device_handle dev, uint32_t flags)
{
union drm_amdgpu_vm vm;
vm.in.op = AMDGPU_VM_OP_UNRESERVE_VMID;
vm.in.flags = flags;
- return drmCommandWriteRead(context->dev->fd, DRM_AMDGPU_VM,
+ return drmCommandWriteRead(dev->fd, DRM_AMDGPU_VM,
&vm, sizeof(vm));
}
diff --git a/tests/amdgpu/vm_tests.c b/tests/amdgpu/vm_tests.c
index cbfafe9..5f18310 100644
--- a/tests/amdgpu/vm_tests.c
+++ b/tests/amdgpu/vm_tests.c
@@ -88,7 +88,7 @@ static void amdgpu_vmid_reserve_test(void)
CU_ASSERT_EQUAL(r, 0);
flags = 0;
- r = amdgpu_vm_reserve_vmid(context_handle, flags);
+ r = amdgpu_vm_reserve_vmid(device_handle, flags);
CU_ASSERT_EQUAL(r, 0);
@@ -142,7 +142,7 @@ static void amdgpu_vmid_reserve_test(void)
CU_ASSERT_EQUAL(r, 0);
flags = 0;
- r = amdgpu_vm_unreserve_vmid(context_handle, flags);
+ r = amdgpu_vm_unreserve_vmid(device_handle, flags);
CU_ASSERT_EQUAL(r, 0);
--
2.7.4
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
reply other threads:[~2017-11-02 14:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1509632995-9775-1-git-send-email-andrey.grodzovsky@amd.com \
--to=andrey.grodzovsky-5c7gfcevmho@public.gmane.org \
--cc=Christian.Koenig-5C7GfCeVMHo@public.gmane.org \
--cc=Marek.Olsak-5C7GfCeVMHo@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).