[PATCH v3][libdrm] amdgpu: add amdgpu_bo_inc_ref() function.

Yu, Qiang Qiang.Yu at amd.com
Fri Jun 24 13:33:39 UTC 2016


Fix type error of "reference".


Regards,

Qiang

________________________________
From: Qiang Yu <yq882255 at 163.com>
Sent: Friday, June 24, 2016 9:30:48 PM
To: amd-gfx at lists.freedesktop.org; Koenig, Christian
Cc: Yu, Qiang
Subject: [PATCH v3][libdrm] amdgpu: add amdgpu_bo_inc_ref() function.

From: Qiang Yu <Qiang.Yu at amd.com>

Change-Id: Icdc00d3e22e48120ca6f4d73ffd05ba43551ad2c
Signed-off-by: Qiang Yu <Qiang.Yu at amd.com>
---
 amdgpu/amdgpu.h    | 13 +++++++++++++
 amdgpu/amdgpu_bo.c |  6 ++++++
 2 files changed, 19 insertions(+)

diff --git a/amdgpu/amdgpu.h b/amdgpu/amdgpu.h
index 693d841..d8c436f 100644
--- a/amdgpu/amdgpu.h
+++ b/amdgpu/amdgpu.h
@@ -716,6 +716,19 @@ int amdgpu_find_bo_by_cpu_mapping(amdgpu_device_handle dev,
 int amdgpu_bo_free(amdgpu_bo_handle buf_handle);

 /**
+ * Increase the reference count of a buffer object
+ *
+ * \param   bo - \c [in]  Buffer object handle to increase the reference count
+ *
+ * \return   0 on success\n
+ *          <0 - Negative POSIX Error code
+ *
+ * \sa amdgpu_bo_alloc(), amdgpu_bo_free()
+ *
+*/
+int amdgpu_bo_inc_ref(amdgpu_bo_handle bo);
+
+/**
  * Request CPU access to GPU accessable memory
  *
  * \param   buf_handle - \c [in] Buffer handle
diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c
index aa0d001..c3f5fb9 100644
--- a/amdgpu/amdgpu_bo.c
+++ b/amdgpu/amdgpu_bo.c
@@ -424,6 +424,12 @@ int amdgpu_bo_free(amdgpu_bo_handle buf_handle)
         return 0;
 }

+int amdgpu_bo_inc_ref(amdgpu_bo_handle bo)
+{
+       atomic_inc(&bo->refcount);
+       return 0;
+}
+
 int amdgpu_bo_cpu_map(amdgpu_bo_handle bo, void **cpu)
 {
         union drm_amdgpu_gem_mmap args;
--
1.9.1


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20160624/64c112a8/attachment.html>


More information about the amd-gfx mailing list