drm/i915/uapi: add NEEDS_CPU_ACCESS hint
authorMatthew Auld <matthew.auld@intel.com>
Wed, 29 Jun 2022 17:43:43 +0000 (18:43 +0100)
committerMatthew Auld <matthew.auld@intel.com>
Fri, 1 Jul 2022 07:30:00 +0000 (08:30 +0100)
commit525e93f6317a08a03cc42847b3e075c92a382c99
tree7915e5922de6195976b29c0dc8448b1d2b6220d6
parent1dbd07e088673dbf0e10f4bcfa17f971fd870195
drm/i915/uapi: add NEEDS_CPU_ACCESS hint

If set, force the allocation to be placed in the mappable portion of
I915_MEMORY_CLASS_DEVICE. One big restriction here is that system memory
(i.e I915_MEMORY_CLASS_SYSTEM) must be given as a potential placement for the
object, that way we can always spill the object into system memory if we
can't make space.

Testcase: igt@gem-create@create-ext-cpu-access-sanity-check
Testcase: igt@gem-create@create-ext-cpu-access-big
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: Jon Bloomfield <jon.bloomfield@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Cc: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220629174350.384910-6-matthew.auld@intel.com
drivers/gpu/drm/i915/gem/i915_gem_create.c
include/uapi/drm/i915_drm.h