drm/i915: blow away userspace mappings before fence change

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, March 4, 2010 - 9:59 am

Gitweb:     http://git.kernel.org/linus/10ae9bd25acf394c8fa2f9d795dfa9cec4d19ed6
Commit:     10ae9bd25acf394c8fa2f9d795dfa9cec4d19ed6
Parent:     4a7266123fce399f695b62b7f87b467b317f1487
Author:     Daniel Vetter <daniel.vetter@ffwll.ch>
AuthorDate: Mon Feb 1 13:59:17 2010 +0100
Committer:  Eric Anholt <eric@anholt.net>
CommitDate: Mon Feb 22 11:54:42 2010 -0500

    drm/i915: blow away userspace mappings before fence change
    
    This aligns it with the other user of i915_gem_clear_fence_reg,
    which blows away the mapping before changing the fence reg.
    
    Only affects userspace if it races against itself when changing
    tiling parameters, i.e. behaviour is undefined, anyway.
    
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
    Signed-off-by: Eric Anholt <eric@anholt.net>
---
 drivers/gpu/drm/i915/i915_gem.c        |    6 ++++++
 drivers/gpu/drm/i915/i915_gem_tiling.c |    6 ------
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index a236bfb..7b12604 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2544,6 +2544,12 @@ i915_gem_object_put_fence_reg(struct drm_gem_object *obj)
 	if (obj_priv->fence_reg == I915_FENCE_REG_NONE)
 		return 0;
 
+	/* If we've changed tiling, GTT-mappings of the object
+	 * need to re-fault to ensure that the correct fence register
+	 * setup is in place.
+	 */
+	i915_gem_release_mmap(obj);
+
 	/* On the i915, GPU access to tiled buffers is via a fence,
 	 * therefore we must wait for any outstanding access to complete
 	 * before clearing the fence.
diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c
index f308fdf..b0cbe3a 100644
--- a/drivers/gpu/drm/i915/i915_gem_tiling.c
+++ b/drivers/gpu/drm/i915/i915_gem_tiling.c
@@ -371,12 +371,6 @@ i915_gem_set_tiling(struct drm_device *dev, void *data,
 			goto err;
 		}
 
-		/* If we've changed tiling, GTT-mappings of the object
-		 * need to re-fault to ensure that the correct fence register
-		 * setup is in place.
-		 */
-		i915_gem_release_mmap(obj);
-
 		obj_priv->tiling_mode = args->tiling_mode;
 		obj_priv->stride = args->stride;
 	}
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
drm/i915: blow away userspace mappings before fence change, Linux Kernel Mailing ..., (Thu Mar 4, 9:59 am)