drm/i915: Move has_aliasing_ppgtt_mapping setup into PPGTT funcs
Subsystems (2)
PATCH 1/1 drm/i915: Move has_aliasing_ppgtt_mapping setup into PPGTT funcs
From: Ville Syrjälä <[email protected]>
Set has_aliasing_ppgtt_mapping from i915_ppgtt_{bind,unbind}_object(). This matches what we're doing for has_global_gtt_mapping.
--- 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(-)
drivers/gpu/drm/i915/i915_gem.c +1 -3
@@ -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);
drivers/gpu/drm/i915/i915_gem_execbuffer.c +1 -4
@@ -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;
drivers/gpu/drm/i915/i915_gem_gtt.c +4 -0
@@ -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)
Signature · 6 lines
1.8.1.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 6 lines · On Thu, Mar 7, 2013 at 12:31 PM, <[email protected]> wrote:
From: Ville Syrjälä <[email protected]>
Set
has_aliasing_ppgtt_mappingfrom i915_ppgtt_{bind,unbind}_object(). This matches what we're doing forhas_global_gtt_mapping.Signed-off-by Ville Syrjälä <[email protected]>
The idea behind the split is that those functions are generally useful to punt ptes for a given object into an address space. It doesn't quite work like that yet, but I can keep on dreaming about different ppgtts ;-)
-Daniel
Quoted 70 lines
--- 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(-)drivers/gpu/drm/i915/i915_gem.c +1
-3@@ -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);drivers/gpu/drm/i915/i915_gem_execbuffer.c +1
-4@@ -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;drivers/gpu/drm/i915/i915_gem_gtt.c +4
-1@@ -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
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
Quoted 6 lines · Daniel Vetter
Quoted 5 lines · On Thu, Mar 7, 2013 at 12:31 PM, <[email protected]> wrote:
From: Ville Syrjälä <[email protected]>
Set
has_aliasing_ppgtt_mappingfrom i915_ppgtt_{bind,unbind}_object(). This matches what we're doing forhas_global_gtt_mapping.
Quoted 6 lines
Quoted 1 line
Signed-off-by Ville Syrjälä <[email protected]>The idea behind the split is that those functions are generally useful to punt ptes for a given object into an address space. It doesn't quite work like that yet, but I can keep on dreaming about different ppgtts ;-)
OK that makes sense. Let's drop the patch then.
Signature · 2 lines
Ville Syrjälä Intel OTC
Quoted 6 lines · On Thu, Mar 07, 2013 at 01:31:26PM +0200, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
Set
has_aliasing_ppgtt_mappingfrom i915_ppgtt_{bind,unbind}_object(). This matches what we're doing forhas_global_gtt_mapping.Signed-off-by Ville Syrjälä <[email protected]>
I've been wanting to do that since the first day I saw it. -Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre