Commit c79828e0 authored by Himal Prasad Ghimiray's avatar Himal Prasad Ghimiray Committed by Matthew Brost

drm/xe: Use xe_bo_lock()/xe_bo_unlock() helpers

There is no change in functionality. Using the helper function
defined within the driver for locking/unlocking the reservation
object.

Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
Suggested-by: default avatarMatthew Brost <matthew.brost@intel.com>
Reviewed-by: default avatarMatthew Brost <matthew.brost@intel.com>
Signed-off-by: default avatarHimal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Signed-off-by: default avatarMatthew Brost <matthew.brost@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240424043910.2190376-3-himal.prasad.ghimiray@intel.com
parent a1adb3d2
...@@ -1382,7 +1382,7 @@ void xe_lrc_snapshot_capture_delayed(struct xe_lrc_snapshot *snapshot) ...@@ -1382,7 +1382,7 @@ void xe_lrc_snapshot_capture_delayed(struct xe_lrc_snapshot *snapshot)
if (!snapshot->lrc_snapshot) if (!snapshot->lrc_snapshot)
goto put_bo; goto put_bo;
dma_resv_lock(bo->ttm.base.resv, NULL); xe_bo_lock(bo, false);
if (!ttm_bo_vmap(&bo->ttm, &src)) { if (!ttm_bo_vmap(&bo->ttm, &src)) {
xe_map_memcpy_from(xe_bo_device(bo), xe_map_memcpy_from(xe_bo_device(bo),
snapshot->lrc_snapshot, &src, snapshot->lrc_offset, snapshot->lrc_snapshot, &src, snapshot->lrc_offset,
...@@ -1392,7 +1392,7 @@ void xe_lrc_snapshot_capture_delayed(struct xe_lrc_snapshot *snapshot) ...@@ -1392,7 +1392,7 @@ void xe_lrc_snapshot_capture_delayed(struct xe_lrc_snapshot *snapshot)
kvfree(snapshot->lrc_snapshot); kvfree(snapshot->lrc_snapshot);
snapshot->lrc_snapshot = NULL; snapshot->lrc_snapshot = NULL;
} }
dma_resv_unlock(bo->ttm.base.resv); xe_bo_unlock(bo);
put_bo: put_bo:
xe_bo_put(bo); xe_bo_put(bo);
} }
......
...@@ -3352,7 +3352,7 @@ void xe_vm_snapshot_capture_delayed(struct xe_vm_snapshot *snap) ...@@ -3352,7 +3352,7 @@ void xe_vm_snapshot_capture_delayed(struct xe_vm_snapshot *snap)
} }
if (bo) { if (bo) {
dma_resv_lock(bo->ttm.base.resv, NULL); xe_bo_lock(bo, false);
err = ttm_bo_vmap(&bo->ttm, &src); err = ttm_bo_vmap(&bo->ttm, &src);
if (!err) { if (!err) {
xe_map_memcpy_from(xe_bo_device(bo), xe_map_memcpy_from(xe_bo_device(bo),
...@@ -3361,7 +3361,7 @@ void xe_vm_snapshot_capture_delayed(struct xe_vm_snapshot *snap) ...@@ -3361,7 +3361,7 @@ void xe_vm_snapshot_capture_delayed(struct xe_vm_snapshot *snap)
snap->snap[i].len); snap->snap[i].len);
ttm_bo_vunmap(&bo->ttm, &src); ttm_bo_vunmap(&bo->ttm, &src);
} }
dma_resv_unlock(bo->ttm.base.resv); xe_bo_unlock(bo);
} else { } else {
void __user *userptr = (void __user *)(size_t)snap->snap[i].bo_ofs; void __user *userptr = (void __user *)(size_t)snap->snap[i].bo_ofs;
......
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