Re: [PATCH 10/11] drm/i915/gtt: Only keep gen6 page directories pinned while active

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Chris Wilson (2018-06-05 10:19:48)
> In order to be able to evict the gen6 ppgtt, we have to unpin it at some
> point. We can simply use our context activity tracking to know when the
> ppgtt is no longer in use by hardware, and so only keep it pinned while
> being used a request.
> 
> For the kernel_context (and thus aliasing_ppgtt), it remains pinned at
> all times, as the kernel_context itself is pinned at all times.
> 
> Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
> Cc: Mika Kuoppala <mika.kuoppala@xxxxxxxxxxxxxxx>
> Cc: Matthew Auld <matthew.william.auld@xxxxxxxxx>

<SNIP>

> @@ -1321,6 +1344,10 @@ __ring_context_pin(struct intel_engine_cs *engine,
>                 ce->state->obj->pin_global++;
>         }
>  
> +       err = __context_pin_ppgtt(ce->gem_context);
> +       if (err)
> +               goto err_unpin;
> +
>         i915_gem_context_get(ctx);
>  
>         /* One ringbuffer to rule them all */
> @@ -1329,6 +1356,9 @@ __ring_context_pin(struct intel_engine_cs *engine,
>  
>         return ce;
>  
> +err_unpin:
> +       if (ce->state)
> +               i915_vma_unpin(ce->state);

Adding __context_unpin and calling it here might cause less confusion.

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>

Regards, Joonas

>  err:
>         ce->pin_count = 0;
>         return ERR_PTR(err);
> -- 
> 2.17.1
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux