summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/tests
diff options
context:
space:
mode:
authorThomas Hellström <thomas.hellstrom@linux.intel.com>2023-09-08 12:17:12 +0300
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-21 19:41:07 +0300
commitd00e9cc28e1e42108618e7a146969a26679170a2 (patch)
tree8a2c8a9e74ab0ad9dec8308f164e8e624ef94f6a /drivers/gpu/drm/xe/tests
parent08a4f00e62bc96eabf7d876933f84600a3dc5e69 (diff)
downloadlinux-d00e9cc28e1e42108618e7a146969a26679170a2.tar.xz
drm/xe/vm: Simplify and document xe_vm_lock()
The xe_vm_lock() function was unnecessarily using ttm_eu_reserve_buffers(). Simplify and document the interface. v4: - Improve on xe_vm_lock() documentation (Matthew Brost) v5: - Rebase conflict. 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-3-thomas.hellstrom@linux.intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/tests')
-rw-r--r--drivers/gpu/drm/xe/tests/xe_bo.c9
-rw-r--r--drivers/gpu/drm/xe/tests/xe_migrate.c5
2 files changed, 6 insertions, 8 deletions
diff --git a/drivers/gpu/drm/xe/tests/xe_bo.c b/drivers/gpu/drm/xe/tests/xe_bo.c
index 97788432a122..ad6dd6fae853 100644
--- a/drivers/gpu/drm/xe/tests/xe_bo.c
+++ b/drivers/gpu/drm/xe/tests/xe_bo.c
@@ -180,7 +180,6 @@ static int evict_test_run_tile(struct xe_device *xe, struct xe_tile *tile, struc
unsigned int bo_flags = XE_BO_CREATE_USER_BIT |
XE_BO_CREATE_VRAM_IF_DGFX(tile);
struct xe_vm *vm = xe_migrate_get_vm(xe_device_get_root_tile(xe)->migrate);
- struct ww_acquire_ctx ww;
struct xe_gt *__gt;
int err, i, id;
@@ -188,10 +187,10 @@ static int evict_test_run_tile(struct xe_device *xe, struct xe_tile *tile, struc
dev_name(xe->drm.dev), tile->id);
for (i = 0; i < 2; ++i) {
- xe_vm_lock(vm, &ww, 0, false);
+ xe_vm_lock(vm, false);
bo = xe_bo_create(xe, NULL, vm, 0x10000, ttm_bo_type_device,
bo_flags);
- xe_vm_unlock(vm, &ww);
+ xe_vm_unlock(vm);
if (IS_ERR(bo)) {
KUNIT_FAIL(test, "bo create err=%pe\n", bo);
break;
@@ -263,9 +262,9 @@ static int evict_test_run_tile(struct xe_device *xe, struct xe_tile *tile, struc
if (i) {
down_read(&vm->lock);
- xe_vm_lock(vm, &ww, 0, false);
+ xe_vm_lock(vm, false);
err = xe_bo_validate(bo, bo->vm, false);
- xe_vm_unlock(vm, &ww);
+ xe_vm_unlock(vm);
up_read(&vm->lock);
if (err) {
KUNIT_FAIL(test, "bo valid err=%pe\n",
diff --git a/drivers/gpu/drm/xe/tests/xe_migrate.c b/drivers/gpu/drm/xe/tests/xe_migrate.c
index 5c8d5e78d9bc..8bb081086ca2 100644
--- a/drivers/gpu/drm/xe/tests/xe_migrate.c
+++ b/drivers/gpu/drm/xe/tests/xe_migrate.c
@@ -396,14 +396,13 @@ static int migrate_test_run_device(struct xe_device *xe)
for_each_tile(tile, xe, id) {
struct xe_migrate *m = tile->migrate;
- struct ww_acquire_ctx ww;
kunit_info(test, "Testing tile id %d.\n", id);
- xe_vm_lock(m->q->vm, &ww, 0, true);
+ xe_vm_lock(m->q->vm, true);
xe_device_mem_access_get(xe);
xe_migrate_sanity_test(m, test);
xe_device_mem_access_put(xe);
- xe_vm_unlock(m->q->vm, &ww);
+ xe_vm_unlock(m->q->vm);
}
return 0;