[Intel-gfx] [PATCH 12/12] drm/i915: Only the zap the VMA after updating the tiling parameters
chris at chris-wilson.co.uk
Tue Apr 17 16:31:35 CEST 2012
If we fail to unbind and so abort the change in tiling, we will have
removed the VMA for the object for no reason. The likelihood of unbind
failing is slim (other than ERESTARTSYS which will cause userspace to
try again), so the change is mostly for the principle.
Also improve the slightly stale comment.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
drivers/gpu/drm/i915/i915_gem_tiling.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c
index e51d892..6a2bd54 100644
@@ -354,9 +354,10 @@ i915_gem_set_tiling(struct drm_device *dev, void *data,
/* We need to rebind the object if its current allocation
* no longer meets the alignment restrictions for its new
* tiling mode. Otherwise we can just leave it alone, but
- * need to ensure that any fence register is cleared.
+ * need to ensure that any fence register is updated before
+ * the next fenced (either through the GTT or by the BLT unit
+ * on older GPUs) access.
obj->gtt_space == NULL ||
@@ -380,6 +381,9 @@ i915_gem_set_tiling(struct drm_device *dev, void *data,
obj->tiling_mode = args->tiling_mode;
obj->stride = args->stride;
+ /* Force the fence to be reacquired for GTT access */
/* we have to maintain this existing ABI... */
More information about the Intel-gfx