[Intel-gfx] [PATCH] drm/i915: Check the right binding exists in i915_vma_misplaced()

Chris Wilson chris at chris-wilson.co.uk
Tue Jun 11 13:43:13 UTC 2019


As a final check, after checking the various alignment and placement,
check that we exist in the right binding alias.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_vma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index 80050f6a0893..adecd7e16647 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -473,7 +473,7 @@ bool i915_vma_misplaced(const struct i915_vma *vma,
 	    vma->node.start != (flags & PIN_OFFSET_MASK))
 		return true;
 
-	return false;
+	return (vma->flags & flags & I915_VMA_BIND_MASK) == 0;
 }
 
 void __i915_vma_set_map_and_fenceable(struct i915_vma *vma)
-- 
2.20.1



More information about the Intel-gfx mailing list