drm/i915/gtt: Only keep gen6 page directories pinned while active
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 14 Jun 2018 09:41:03 +0000 (10:41 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 14 Jun 2018 13:35:13 +0000 (14:35 +0100)
commita2bbf714834288da0ed4668d4e4d895ffef73de2
treec180280f5e285c4dacb1869330940b6b5a5b83e8
parente62230deeeae1f096a4be2360204536caf9ad8b6
drm/i915/gtt: Only keep gen6 page directories pinned while active

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@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Matthew Auld <matthew.william.auld@gmail.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180614094103.18025-5-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem_gtt.c
drivers/gpu/drm/i915/i915_gem_gtt.h
drivers/gpu/drm/i915/intel_ringbuffer.c