OSDN Git Service

drm/i915/gtt: Free unused page tables on unbind the context
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 14 Jun 2018 13:43:15 +0000 (14:43 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 14 Jun 2018 18:20:33 +0000 (19:20 +0100)
commit4a192c7e8b14a2bf8f30b1fac3599a7d391dfcf9
treeedd6b70d40df46eaddb1763090ae88a89cbc0fdc
parent549fe88bf71d30563f20dcfd7970b7424bf07907
drm/i915/gtt: Free unused page tables on unbind the context

As we cannot reliably change used page tables while the context is
active, the earliest opportunity we have to recover excess pages is when
the context becomes idle. So whenever we unbind the context (it must be
idle, and indeed being evicted) free the unused ptes.

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