mirror of
https://github.com/torvalds/linux.git
synced 2026-04-20 07:43:57 -04:00
drm/xe/bo: Simplify xe_bo_lock()
xe_bo_lock() was, although it only grabbed a single lock, unnecessarily using ttm_eu_reserve_buffers(). Simplify and document the interface. v2: - Update also the xe_display subsystem. v4: - Reinstate a lost dma_resv_reserve_fences(). - Improve on xe_bo_lock() documentation (Matthew Brost) Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230908091716.36984-2-thomas.hellstrom@linux.intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
This commit is contained in:
committed by
Rodrigo Vivi
parent
9fa81f914a
commit
08a4f00e62
@@ -204,9 +204,9 @@ static int evict_test_run_tile(struct xe_device *xe, struct xe_tile *tile, struc
|
||||
goto cleanup_bo;
|
||||
}
|
||||
|
||||
xe_bo_lock(external, &ww, 0, false);
|
||||
xe_bo_lock(external, false);
|
||||
err = xe_bo_pin_external(external);
|
||||
xe_bo_unlock(external, &ww);
|
||||
xe_bo_unlock(external);
|
||||
if (err) {
|
||||
KUNIT_FAIL(test, "external bo pin err=%pe\n",
|
||||
ERR_PTR(err));
|
||||
@@ -272,9 +272,9 @@ static int evict_test_run_tile(struct xe_device *xe, struct xe_tile *tile, struc
|
||||
ERR_PTR(err));
|
||||
goto cleanup_all;
|
||||
}
|
||||
xe_bo_lock(external, &ww, 0, false);
|
||||
xe_bo_lock(external, false);
|
||||
err = xe_bo_validate(external, NULL, false);
|
||||
xe_bo_unlock(external, &ww);
|
||||
xe_bo_unlock(external);
|
||||
if (err) {
|
||||
KUNIT_FAIL(test, "external bo valid err=%pe\n",
|
||||
ERR_PTR(err));
|
||||
@@ -282,28 +282,28 @@ static int evict_test_run_tile(struct xe_device *xe, struct xe_tile *tile, struc
|
||||
}
|
||||
}
|
||||
|
||||
xe_bo_lock(external, &ww, 0, false);
|
||||
xe_bo_lock(external, false);
|
||||
xe_bo_unpin_external(external);
|
||||
xe_bo_unlock(external, &ww);
|
||||
xe_bo_unlock(external);
|
||||
|
||||
xe_bo_put(external);
|
||||
|
||||
xe_bo_lock(bo, &ww, 0, false);
|
||||
xe_bo_lock(bo, false);
|
||||
__xe_bo_unset_bulk_move(bo);
|
||||
xe_bo_unlock(bo, &ww);
|
||||
xe_bo_unlock(bo);
|
||||
xe_bo_put(bo);
|
||||
continue;
|
||||
|
||||
cleanup_all:
|
||||
xe_bo_lock(external, &ww, 0, false);
|
||||
xe_bo_lock(external, false);
|
||||
xe_bo_unpin_external(external);
|
||||
xe_bo_unlock(external, &ww);
|
||||
xe_bo_unlock(external);
|
||||
cleanup_external:
|
||||
xe_bo_put(external);
|
||||
cleanup_bo:
|
||||
xe_bo_lock(bo, &ww, 0, false);
|
||||
xe_bo_lock(bo, false);
|
||||
__xe_bo_unset_bulk_move(bo);
|
||||
xe_bo_unlock(bo, &ww);
|
||||
xe_bo_unlock(bo);
|
||||
xe_bo_put(bo);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user