mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-27 03:49:57 -04:00
drm/amdgpu: simplify VM update tracking a bit
Store the 64bit sequence directly. Makes it simpler to use and saves a bit of fence reference counting overhead. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
184a69ca4d
commit
e997b82745
@@ -51,7 +51,7 @@ static struct kmem_cache *amdgpu_sync_slab;
|
||||
void amdgpu_sync_create(struct amdgpu_sync *sync)
|
||||
{
|
||||
hash_init(sync->fences);
|
||||
sync->last_vm_update = NULL;
|
||||
sync->last_vm_update = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -184,7 +184,7 @@ int amdgpu_sync_vm_fence(struct amdgpu_sync *sync, struct dma_fence *fence)
|
||||
if (!fence)
|
||||
return 0;
|
||||
|
||||
amdgpu_sync_keep_later(&sync->last_vm_update, fence);
|
||||
sync->last_vm_update = max(sync->last_vm_update, fence->seqno);
|
||||
return amdgpu_sync_fence(sync, fence);
|
||||
}
|
||||
|
||||
@@ -376,8 +376,7 @@ int amdgpu_sync_clone(struct amdgpu_sync *source, struct amdgpu_sync *clone)
|
||||
}
|
||||
}
|
||||
|
||||
dma_fence_put(clone->last_vm_update);
|
||||
clone->last_vm_update = dma_fence_get(source->last_vm_update);
|
||||
clone->last_vm_update = source->last_vm_update;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -419,8 +418,6 @@ void amdgpu_sync_free(struct amdgpu_sync *sync)
|
||||
dma_fence_put(e->fence);
|
||||
kmem_cache_free(amdgpu_sync_slab, e);
|
||||
}
|
||||
|
||||
dma_fence_put(sync->last_vm_update);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user