aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák2016-01-12 15:13:07 -0600
committerMarek Olšák2016-01-19 19:14:46 -0600
commit6afadeaf13279fcdbc48999f522e1dc90a9dfdaf (patch)
tree4401a7685e86ec8bf24c70637bd8bef19bb7dfa0 /amdgpu/amdgpu_internal.h
parentf06c9928198d9348fb31325a2a480afbc29c04b8 (diff)
downloadexternal-libgbm-6afadeaf13279fcdbc48999f522e1dc90a9dfdaf.tar.gz
external-libgbm-6afadeaf13279fcdbc48999f522e1dc90a9dfdaf.tar.xz
external-libgbm-6afadeaf13279fcdbc48999f522e1dc90a9dfdaf.zip
amdgpu: add semaphore support
the semaphore is a binary semaphore. the work flow is: 1. create sem 2. signal sem 3. wait sem, reset sem after signalled 4. destroy sem. Signed-off-by: Chunming Zhou <david1.zhou@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
Diffstat (limited to 'amdgpu/amdgpu_internal.h')
-rw-r--r--amdgpu/amdgpu_internal.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/amdgpu/amdgpu_internal.h b/amdgpu/amdgpu_internal.h
index 7dd5c1c7..557ba1f1 100644
--- a/amdgpu/amdgpu_internal.h
+++ b/amdgpu/amdgpu_internal.h
@@ -111,8 +111,23 @@ struct amdgpu_bo_list {
111 111
112struct amdgpu_context { 112struct amdgpu_context {
113 struct amdgpu_device *dev; 113 struct amdgpu_device *dev;
114 /** Mutex for accessing fences and to maintain command submissions
115 in good sequence. */
116 pthread_mutex_t sequence_mutex;
114 /* context id*/ 117 /* context id*/
115 uint32_t id; 118 uint32_t id;
119 uint64_t last_seq[AMDGPU_HW_IP_NUM][AMDGPU_HW_IP_INSTANCE_MAX_COUNT][AMDGPU_CS_MAX_RINGS];
120 struct list_head sem_list[AMDGPU_HW_IP_NUM][AMDGPU_HW_IP_INSTANCE_MAX_COUNT][AMDGPU_CS_MAX_RINGS];
121};
122
123/**
124 * Structure describing sw semaphore based on scheduler
125 *
126 */
127struct amdgpu_semaphore {
128 atomic_t refcount;
129 struct list_head list;
130 struct amdgpu_cs_fence signal_fence;
116}; 131};
117 132
118/** 133/**