[Intel-gfx] [PATCH] drm/i915: Move has_aliasing_ppgtt_mapping setup into PPGTT funcs

ville.syrjala at linux.intel.com ville.syrjala at linux.intel.com
Thu Mar 7 12:31:26 CET 2013


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

Set has_aliasing_ppgtt_mapping from i915_ppgtt_{bind,unbind}_object().
This matches what we're doing for has_global_gtt_mapping.

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c            | 4 +---
 drivers/gpu/drm/i915/i915_gem_execbuffer.c | 5 +----
 drivers/gpu/drm/i915/i915_gem_gtt.c        | 4 ++++
 3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 1417fc6..4695937 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2491,10 +2491,8 @@ i915_gem_object_unbind(struct drm_i915_gem_object *obj)
 
 	if (obj->has_global_gtt_mapping)
 		i915_gem_gtt_unbind_object(obj);
-	if (obj->has_aliasing_ppgtt_mapping) {
+	if (obj->has_aliasing_ppgtt_mapping)
 		i915_ppgtt_unbind_object(dev_priv->mm.aliasing_ppgtt, obj);
-		obj->has_aliasing_ppgtt_mapping = 0;
-	}
 	i915_gem_gtt_finish_object(obj);
 
 	list_del(&obj->mm_list);
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 934396c..5fb272a 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -430,13 +430,10 @@ i915_gem_execbuffer_reserve_object(struct drm_i915_gem_object *obj,
 	}
 
 	/* Ensure ppgtt mapping exists if needed */
-	if (dev_priv->mm.aliasing_ppgtt && !obj->has_aliasing_ppgtt_mapping) {
+	if (dev_priv->mm.aliasing_ppgtt && !obj->has_aliasing_ppgtt_mapping)
 		i915_ppgtt_bind_object(dev_priv->mm.aliasing_ppgtt,
 				       obj, obj->cache_level);
 
-		obj->has_aliasing_ppgtt_mapping = 1;
-	}
-
 	if (entry->offset != obj->gtt_offset) {
 		entry->offset = obj->gtt_offset;
 		*need_reloc = true;
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 926a1e2..ee5ccac 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -284,6 +284,8 @@ void i915_ppgtt_bind_object(struct i915_hw_ppgtt *ppgtt,
 	ppgtt->insert_entries(ppgtt, obj->pages,
 			      obj->gtt_space->start >> PAGE_SHIFT,
 			      cache_level);
+
+	obj->has_aliasing_ppgtt_mapping = 1;
 }
 
 void i915_ppgtt_unbind_object(struct i915_hw_ppgtt *ppgtt,
@@ -292,6 +294,8 @@ void i915_ppgtt_unbind_object(struct i915_hw_ppgtt *ppgtt,
 	ppgtt->clear_range(ppgtt,
 			   obj->gtt_space->start >> PAGE_SHIFT,
 			   obj->base.size >> PAGE_SHIFT);
+
+	obj->has_aliasing_ppgtt_mapping = 0;
 }
 
 void i915_gem_init_ppgtt(struct drm_device *dev)
-- 
1.8.1.5




More information about the Intel-gfx mailing list