Commit 790bdc7c authored by Matthew Brost's avatar Matthew Brost Committed by Rodrigo Vivi
Browse files

drm/xe: Handle unmapped userptr in analyze VM



A corner exists where a userptr may have no mapping when analyze VM is
called, handle this case.

Reviewed-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
Reviewed-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
Signed-off-by: default avatarMatthew Brost <matthew.brost@intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 9f8f93be
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -3455,9 +3455,13 @@ int xe_analyze_vm(struct drm_printer *p, struct xe_vm *vm, int gt_id)
		if (is_userptr) {
			struct xe_res_cursor 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);
		}