summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu.h
diff options
context:
space:
mode:
authorAlex Xie <AlexBin.Xie@amd.com>2017-06-16 09:07:29 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-06-19 17:31:22 -0400
commit5ac55629d6b3fcde69f46aa772c6e83be0bdcbbf (patch)
tree8ed09ff14dd34aa048296aa3a32e92e749e12d34 /drivers/gpu/drm/amd/amdgpu/amdgpu.h
parent99eea4df901907b9121ad1c726d86c352a5eaca5 (diff)
downloadlwn-5ac55629d6b3fcde69f46aa772c6e83be0bdcbbf.tar.gz
lwn-5ac55629d6b3fcde69f46aa772c6e83be0bdcbbf.zip
drm/amdgpu: Optimize mutex usage (v4)
In original function amdgpu_bo_list_get, the waiting for result->lock can be quite long while mutex bo_list_lock was holding. It can make other tasks waiting for bo_list_lock for long period. Secondly, this patch allows several tasks(readers of idr) to proceed at the same time. v2: use rcu and kref (Dave Airlie and Christian König) v3: update v1 commit message (Michel Dänzer) v4: rebase on upstream (Alex Deucher) Signed-off-by: Alex Xie <AlexBin.Xie@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu.h')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 9f827aca90ee..12d61edb3597 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -869,6 +869,8 @@ struct amdgpu_fpriv {
struct amdgpu_bo_list {
struct mutex lock;
+ struct rcu_head rhead;
+ struct kref refcount;
struct amdgpu_bo *gds_obj;
struct amdgpu_bo *gws_obj;
struct amdgpu_bo *oa_obj;