On Thu, Mar 7, 2013 at 12:31 PM, <ville.syrjala at linux.intel.com> wrote: > 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> 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 > --- > 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 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch