Commit 046c12c6 authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/amdgpu: remove sync_to from sync obj v2

Not needed any more without semaphores.

v2: remove unused variables as well
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarChunming Zhou <david1.zhou@amd.com>
Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent ea5e4c87
...@@ -636,7 +636,6 @@ int amdgpu_mode_dumb_mmap(struct drm_file *filp, ...@@ -636,7 +636,6 @@ int amdgpu_mode_dumb_mmap(struct drm_file *filp,
* Synchronization * Synchronization
*/ */
struct amdgpu_sync { struct amdgpu_sync {
struct fence *sync_to[AMDGPU_MAX_RINGS];
DECLARE_HASHTABLE(fences, 4); DECLARE_HASHTABLE(fences, 4);
struct fence *last_vm_update; struct fence *last_vm_update;
}; };
......
...@@ -46,11 +46,6 @@ struct amdgpu_sync_entry { ...@@ -46,11 +46,6 @@ struct amdgpu_sync_entry {
*/ */
void amdgpu_sync_create(struct amdgpu_sync *sync) void amdgpu_sync_create(struct amdgpu_sync *sync)
{ {
unsigned i;
for (i = 0; i < AMDGPU_MAX_RINGS; ++i)
sync->sync_to[i] = NULL;
hash_init(sync->fences); hash_init(sync->fences);
sync->last_vm_update = NULL; sync->last_vm_update = NULL;
} }
...@@ -104,7 +99,6 @@ int amdgpu_sync_fence(struct amdgpu_device *adev, struct amdgpu_sync *sync, ...@@ -104,7 +99,6 @@ int amdgpu_sync_fence(struct amdgpu_device *adev, struct amdgpu_sync *sync,
struct fence *f) struct fence *f)
{ {
struct amdgpu_sync_entry *e; struct amdgpu_sync_entry *e;
struct amdgpu_fence *fence;
if (!f) if (!f)
return 0; return 0;
...@@ -113,27 +107,20 @@ int amdgpu_sync_fence(struct amdgpu_device *adev, struct amdgpu_sync *sync, ...@@ -113,27 +107,20 @@ int amdgpu_sync_fence(struct amdgpu_device *adev, struct amdgpu_sync *sync,
amdgpu_sync_test_owner(f, AMDGPU_FENCE_OWNER_VM)) amdgpu_sync_test_owner(f, AMDGPU_FENCE_OWNER_VM))
amdgpu_sync_keep_later(&sync->last_vm_update, f); amdgpu_sync_keep_later(&sync->last_vm_update, f);
fence = to_amdgpu_fence(f); hash_for_each_possible(sync->fences, e, node, f->context) {
if (!fence || fence->ring->adev != adev) { if (unlikely(e->fence->context != f->context))
hash_for_each_possible(sync->fences, e, node, f->context) { continue;
if (unlikely(e->fence->context != f->context))
continue;
amdgpu_sync_keep_later(&e->fence, f);
return 0;
}
e = kmalloc(sizeof(struct amdgpu_sync_entry), GFP_KERNEL);
if (!e)
return -ENOMEM;
hash_add(sync->fences, &e->node, f->context); amdgpu_sync_keep_later(&e->fence, f);
e->fence = fence_get(f);
return 0; return 0;
} }
amdgpu_sync_keep_later(&sync->sync_to[fence->ring->idx], f); e = kmalloc(sizeof(struct amdgpu_sync_entry), GFP_KERNEL);
if (!e)
return -ENOMEM;
hash_add(sync->fences, &e->node, f->context);
e->fence = fence_get(f);
return 0; return 0;
} }
...@@ -247,16 +234,6 @@ int amdgpu_sync_wait(struct amdgpu_sync *sync) ...@@ -247,16 +234,6 @@ int amdgpu_sync_wait(struct amdgpu_sync *sync)
kfree(e); kfree(e);
} }
for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
struct fence *fence = sync->sync_to[i];
if (!fence)
continue;
r = fence_wait(fence, false);
if (r)
return r;
}
return 0; return 0;
} }
...@@ -283,8 +260,5 @@ void amdgpu_sync_free(struct amdgpu_device *adev, ...@@ -283,8 +260,5 @@ void amdgpu_sync_free(struct amdgpu_device *adev,
kfree(e); kfree(e);
} }
for (i = 0; i < AMDGPU_MAX_RINGS; ++i)
fence_put(sync->sync_to[i]);
fence_put(sync->last_vm_update); fence_put(sync->last_vm_update);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment