aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.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_ttm.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_ttm.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 10952c3e5eb6..a2282bacf960 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -1489,7 +1489,8 @@ int amdgpu_copy_buffer(struct amdgpu_ring *ring, uint64_t src_offset,
1489 job->vm_needs_flush = vm_needs_flush; 1489 job->vm_needs_flush = vm_needs_flush;
1490 if (resv) { 1490 if (resv) {
1491 r = amdgpu_sync_resv(adev, &job->sync, resv, 1491 r = amdgpu_sync_resv(adev, &job->sync, resv,
1492 AMDGPU_FENCE_OWNER_UNDEFINED); 1492 AMDGPU_FENCE_OWNER_UNDEFINED,
1493 false);
1493 if (r) { 1494 if (r) {
1494 DRM_ERROR("sync failed (%d).\n", r); 1495 DRM_ERROR("sync failed (%d).\n", r);
1495 goto error_free; 1496 goto error_free;
@@ -1581,7 +1582,7 @@ int amdgpu_fill_buffer(struct amdgpu_bo *bo,
1581 1582
1582 if (resv) { 1583 if (resv) {
1583 r = amdgpu_sync_resv(adev, &job->sync, resv, 1584 r = amdgpu_sync_resv(adev, &job->sync, resv,
1584 AMDGPU_FENCE_OWNER_UNDEFINED); 1585 AMDGPU_FENCE_OWNER_UNDEFINED, false);
1585 if (r) { 1586 if (r) {
1586 DRM_ERROR("sync failed (%d).\n", r); 1587 DRM_ERROR("sync failed (%d).\n", r);
1587 goto error_free; 1588 goto error_free;