Skip to content

Commit 03ee595

Browse files
matt-auldtursulin
authored andcommitted
drm/i915/ttm: only fault WILLNEED objects
Don't attempt to fault and re-populate purged objects. By some fluke this passes the dontneed-after-mmap IGT, but for the wrong reasons. Fixes: cf3e3e8 ("drm/i915: Use ttm mmap handling for ttm bo's.") Signed-off-by: Matthew Auld <[email protected]> Cc: Thomas Hellström <[email protected]> Reviewed-by: Thomas Hellström <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit f3cb4a2) Signed-off-by: Tvrtko Ursulin <[email protected]>
1 parent 4c2602b commit 03ee595

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/gpu/drm/i915/gem/i915_gem_ttm.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,11 @@ static vm_fault_t vm_fault_ttm(struct vm_fault *vmf)
883883
if (ret)
884884
return ret;
885885

886+
if (obj->mm.madv != I915_MADV_WILLNEED) {
887+
dma_resv_unlock(bo->base.resv);
888+
return VM_FAULT_SIGBUS;
889+
}
890+
886891
if (drm_dev_enter(dev, &idx)) {
887892
ret = ttm_bo_vm_fault_reserved(vmf, vmf->vma->vm_page_prot,
888893
TTM_BO_VM_NUM_PREFAULT);

0 commit comments

Comments
 (0)