[Intel-xe] [PATCH 1/3] drm/xe: Handle unmapped userptr in analyze VM
Matthew Brost
matthew.brost at intel.com
Fri Jun 9 18:26:25 UTC 2023
A corner exists where a userptr may have no mapping when analyze VM is
called, handle this case.
Signed-off-by: Matthew Brost <matthew.brost at intel.com>
---
drivers/gpu/drm/xe/xe_vm.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
index d1c380ad7f6b..e4311c48cc54 100644
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -3453,9 +3453,13 @@ int xe_analyze_vm(struct drm_printer *p, struct xe_vm *vm, int gt_id)
if (is_userptr) {
struct xe_res_cursor cur;
- xe_res_first_sg(vma->userptr.sg, 0, XE_PAGE_SIZE,
- &cur);
- addr = xe_res_dma(&cur);
+ if (vma->userptr.sg) {
+ xe_res_first_sg(vma->userptr.sg, 0, XE_PAGE_SIZE,
+ &cur);
+ addr = xe_res_dma(&cur);
+ } else {
+ addr = 0;
+ }
} else {
addr = __xe_bo_addr(vma->bo, 0, XE_PAGE_SIZE, &is_vram);
}
--
2.34.1
More information about the Intel-xe
mailing list