aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c
diff options
context:
space:
mode:
authorAndres Rodriguez <andresx7@gmail.com>2017-09-15 20:44:06 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-10-09 16:30:19 -0400
commit177ae09b5d699a5ebd1cafcee78889db968abf54 (patch)
treea05b42c1155df2dac688952df8378315a7849980 /drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c
parentb82485fd384a56c27fae44e649552eca6334237a (diff)
drm/amdgpu: introduce AMDGPU_GEM_CREATE_EXPLICIT_SYNC v2
Introduce a flag to signal that access to a BO will be synchronized through an external mechanism. Currently all buffers shared between contexts are subject to implicit synchronization. However, this is only required for protocols that currently don't support an explicit synchronization mechanism (DRI2/3). This patch introduces the AMDGPU_GEM_CREATE_EXPLICIT_SYNC, so that users can specify when it is safe to disable implicit sync. v2: only disable explicit sync in amdgpu_cs_ioctl Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Andres Rodriguez <andresx7@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c
index c586f44312f9..a4bf21f8f1c1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c
@@ -169,14 +169,14 @@ int amdgpu_sync_fence(struct amdgpu_device *adev, struct amdgpu_sync *sync,
169 * 169 *
170 * @sync: sync object to add fences from reservation object to 170 * @sync: sync object to add fences from reservation object to
171 * @resv: reservation object with embedded fence 171 * @resv: reservation object with embedded fence
172 * @shared: true if we should only sync to the exclusive fence 172 * @explicit_sync: true if we should only sync to the exclusive fence
173 * 173 *
174 * Sync to the fence 174 * Sync to the fence
175 */ 175 */
176int amdgpu_sync_resv(struct amdgpu_device *adev, 176int amdgpu_sync_resv(struct amdgpu_device *adev,
177 struct amdgpu_sync *sync, 177 struct amdgpu_sync *sync,
178 struct reservation_object *resv, 178 struct reservation_object *resv,
179 void *owner) 179 void *owner, bool explicit_sync)
180{ 180{
181 struct reservation_object_list *flist; 181 struct reservation_object_list *flist;
182 struct dma_fence *f; 182 struct dma_fence *f;
@@ -191,6 +191,9 @@ int amdgpu_sync_resv(struct amdgpu_device *adev,
191 f = reservation_object_get_excl(resv); 191 f = reservation_object_get_excl(resv);
192 r = amdgpu_sync_fence(adev, sync, f); 192 r = amdgpu_sync_fence(adev, sync, f);
193 193
194 if (explicit_sync)
195 return r;
196
194 flist = reservation_object_get_list(resv); 197 flist = reservation_object_get_list(resv);
195 if (!flist || r) 198 if (!flist || r)
196 return r; 199 return r;