drm/i915/userptr: Enable read-only support on gen8+
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 12 Jul 2018 19:14:30 +0000 (20:14 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 13 Jul 2018 15:18:15 +0000 (16:18 +0100)
commit0b100760e3e8cbb2b5d09c1c2bcb01d50201c142
treef3f932fea667181e2af286a395cc00424932ffed
parentf8c1cce36ccb21b5e5ecc87fac65de0e29693f01
drm/i915/userptr: Enable read-only support on gen8+

On gen8 and onwards, we can mark GPU accesses through the ppGTT as being
read-only, that is cause any GPU write onto that page to be discarded
(not triggering a fault). This is all that we need to finally support
the read-only flag for userptr!

v2: Check default address space for read only support as a proxy for the
user context/ppgtt.

Testcase: igt/gem_userptr_blits/readonly*
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jon Bloomfield <jon.bloomfield@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Matthew Auld <matthew.william.auld@gmail.com>
Reviewed-by: Jon Bloomfield <jon.bloomfield@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180712191430.9269-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem_object.h
drivers/gpu/drm/i915/i915_gem_userptr.c