OSDN Git Service

amdgpu: add amdgpu_bo_inc_ref() function.
authorQiang Yu <Qiang.Yu@amd.com>
Mon, 3 Sep 2018 06:55:09 +0000 (14:55 +0800)
committerChristian König <christian.koenig@amd.com>
Mon, 3 Sep 2018 08:55:53 +0000 (10:55 +0200)
For Pro OGL be able to work with upstream libdrm.

Signed-off-by: Qiang Yu <Qiang.Yu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
amdgpu/amdgpu-symbol-check
amdgpu/amdgpu.h
amdgpu/amdgpu_bo.c

index b5e4fe6..487610e 100755 (executable)
@@ -15,6 +15,7 @@ amdgpu_bo_cpu_map
 amdgpu_bo_cpu_unmap
 amdgpu_bo_export
 amdgpu_bo_free
+amdgpu_bo_inc_ref
 amdgpu_bo_import
 amdgpu_bo_list_create
 amdgpu_bo_list_destroy
index a8c353c..e1f93f8 100644 (file)
@@ -721,7 +721,20 @@ int amdgpu_find_bo_by_cpu_mapping(amdgpu_device_handle dev,
 int amdgpu_bo_free(amdgpu_bo_handle buf_handle);
 
 /**
- * Request CPU access to GPU accessible memory
+ * 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
  * \param   cpu        - \c [out] CPU address to be used for access
index a2fc525..dceab01 100644 (file)
@@ -438,6 +438,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;