On to, 2015-06-11 at 20:37 +0300, Mika Kuoppala wrote: > When we touch gen8+ page maps, mark them dirty like we > do with previous gens. > > v2: Update comment (Joonas) > Reviewed-by: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx> > Signed-off-by: Mika Kuoppala <mika.kuoppala@xxxxxxxxx> > --- > drivers/gpu/drm/i915/i915_gem_gtt.c | 22 ++++++++++++---------- > 1 file changed, 12 insertions(+), 10 deletions(-) > > diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c > index 619dad1..0a906e4 100644 > --- a/drivers/gpu/drm/i915/i915_gem_gtt.c > +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c > @@ -830,6 +830,16 @@ err_out: > return -ENOMEM; > } > > +/* PDE TLBs are a pain to invalidate on GEN8+. When we modify > + * the page table structures, we mark them dirty so that > + * context switching/execlist queuing code takes extra steps > + * to ensure that tlbs are flushed. > + */ > +static void mark_tlbs_dirty(struct i915_hw_ppgtt *ppgtt) > +{ > + ppgtt->pd_dirty_rings = INTEL_INFO(ppgtt->base.dev)->ring_mask; > +} > + > static int gen8_alloc_va_range(struct i915_address_space *vm, > uint64_t start, > uint64_t length) > @@ -915,6 +925,7 @@ static int gen8_alloc_va_range(struct i915_address_space *vm, > } > > free_gen8_temp_bitmaps(new_page_dirs, new_page_tables); > + mark_tlbs_dirty(ppgtt); > return 0; > > err_out: > @@ -927,6 +938,7 @@ err_out: > unmap_and_free_pd(ppgtt->pdp.page_directory[pdpe], vm->dev); > > free_gen8_temp_bitmaps(new_page_dirs, new_page_tables); > + mark_tlbs_dirty(ppgtt); > return ret; > } > > @@ -1267,16 +1279,6 @@ static void gen6_ppgtt_insert_entries(struct i915_address_space *vm, > kunmap_atomic(pt_vaddr); > } > > -/* PDE TLBs are a pain invalidate pre GEN8. It requires a context reload. If we > - * are switching between contexts with the same LRCA, we also must do a force > - * restore. > - */ > -static void mark_tlbs_dirty(struct i915_hw_ppgtt *ppgtt) > -{ > - /* If current vm != vm, */ > - ppgtt->pd_dirty_rings = INTEL_INFO(ppgtt->base.dev)->ring_mask; > -} > - > static void gen6_initialize_pt(struct i915_address_space *vm, > struct i915_page_table *pt) > { _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/intel-gfx