drm/i915/gtt: Lazily allocate page directories for gen7
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 14 Jun 2018 13:43:14 +0000 (14:43 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 14 Jun 2018 18:20:33 +0000 (19:20 +0100)
commit549fe88bf71d30563f20dcfd7970b7424bf07907
treef30b75b076ae323652dcec2d9bfb0352984af69f
parent1fd00c0faeec0a89dfe97de842facbecc8a04efb
drm/i915/gtt: Lazily allocate page directories for gen7

As we were only supporting aliasing_ppgtt on gen7 for some time, we
saved a few checks by preallocating the page directories on creation.
However, since we need 2MiB of page directories for each ppgtt, to
support arbitrary numbers of user contexts, we need to be more prudent
in our allocations, and defer the page allocation until it is used. We
don't recover unused pages yet as we found that doing so on the fly
(i.e. altering TLB entries) would confuse the GPU.

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-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem_gtt.c