diff options
author | Christian König <christian.koenig@amd.com> | 2018-01-31 16:03:19 +0100 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-02-19 20:19:18 +0100 |
commit | 3af81440a9b02e2c6e244539ee567063c3d62292 (patch) | |
tree | 869c184af030c2b386101e5f4b92200836ab74ca /drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | |
parent | drm/amdgpu: restructure amdgpu_vmid_grab (diff) | |
download | linux-3af81440a9b02e2c6e244539ee567063c3d62292.tar.xz linux-3af81440a9b02e2c6e244539ee567063c3d62292.zip |
drm/amdgpu: cache the fence to wait for a VMID
Beneficial when a lot of processes are waiting for VMIDs.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c index 156e026046b5..7d2805729c20 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c @@ -205,6 +205,9 @@ static int amdgpu_vmid_grab_idle(struct amdgpu_vm *vm, unsigned i; int r; + if (ring->vmid_wait && !dma_fence_is_signaled(ring->vmid_wait)) + return amdgpu_sync_fence(adev, sync, ring->vmid_wait, false); + fences = kmalloc_array(sizeof(void *), id_mgr->num_ids, GFP_KERNEL); if (!fences) return -ENOMEM; @@ -239,9 +242,9 @@ static int amdgpu_vmid_grab_idle(struct amdgpu_vm *vm, } r = amdgpu_sync_fence(adev, sync, &array->base, false); - dma_fence_put(&array->base); + dma_fence_put(ring->vmid_wait); + ring->vmid_wait = &array->base; return r; - } kfree(fences); |