mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-28 12:53:14 +01:00
drm/amdgpu: enable eviction fence
This patch enables attachment and detachment of eviction fences. This is just a fork of eviction fence enabling code from the first patch of the series so that the CI testing can happen on fully fledged code. Cc: Alex Deucher <[email protected]> Cc: Christian Koenig <[email protected]> Reviewed-by: Christian Koenig <[email protected]> Signed-off-by: Shashank Sharma <[email protected]> Signed-off-by: Arvind Yadav <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
This commit is contained in:
1 parent
a242a3e4b5
commit
31f7efcdca
2 files changed
+12
No files matched your search
@@ -177,6 +177,8 @@ void amdgpu_eviction_fence_destroy(struct amdgpu_eviction_fence_mgr *evf_mgr)
|
|||||||
if (!ev_fence)
|
if (!ev_fence)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
dma_fence_wait(&ev_fence->base, false);
|
||||||
|
|
||||||
/* Last unref of ev_fence */
|
/* Last unref of ev_fence */
|
||||||
dma_fence_put(&evf_mgr->ev_fence->base);
|
dma_fence_put(&evf_mgr->ev_fence->base);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -294,6 +294,13 @@ static int amdgpu_gem_object_open(struct drm_gem_object *obj,
|
|||||||
else
|
else
|
||||||
++bo_va->ref_count;
|
++bo_va->ref_count;
|
||||||
|
|
||||||
|
/* attach gfx eviction fence */
|
||||||
|
r = amdgpu_eviction_fence_attach(&fpriv->evf_mgr, abo);
|
||||||
|
if (r) {
|
||||||
|
DRM_DEBUG_DRIVER("Failed to attach eviction fence to BO\n");
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
amdgpu_bo_unreserve(abo);
|
amdgpu_bo_unreserve(abo);
|
||||||
|
|
||||||
/* Validate and add eviction fence to DMABuf imports with dynamic
|
/* Validate and add eviction fence to DMABuf imports with dynamic
|
||||||
@@ -344,6 +351,9 @@ static void amdgpu_gem_object_close(struct drm_gem_object *obj,
|
|||||||
struct drm_exec exec;
|
struct drm_exec exec;
|
||||||
long r;
|
long r;
|
||||||
|
|
||||||
|
if (!amdgpu_vm_is_bo_always_valid(vm, bo))
|
||||||
|
amdgpu_eviction_fence_detach(&fpriv->evf_mgr, bo);
|
||||||
|
|
||||||
drm_exec_init(&exec, DRM_EXEC_IGNORE_DUPLICATES, 0);
|
drm_exec_init(&exec, DRM_EXEC_IGNORE_DUPLICATES, 0);
|
||||||
drm_exec_until_all_locked(&exec) {
|
drm_exec_until_all_locked(&exec) {
|
||||||
r = drm_exec_prepare_obj(&exec, &bo->tbo.base, 1);
|
r = drm_exec_prepare_obj(&exec, &bo->tbo.base, 1);
|
||||||
|
|||||||
Reference in new issue
Block a user