diff options
author | Matthew Auld <matthew.auld@intel.com> | 2022-02-21 14:16:15 +0000 |
---|---|---|
committer | Matthew Auld <matthew.auld@intel.com> | 2022-06-30 12:49:22 +0100 |
commit | 9e7756a2ef810709a1c38779c69eebdd768bfb0f (patch) | |
tree | 4750732ce70a93b0875c7c2667ebc929a6c66571 | |
parent | 9ed947c9610bf3b271b5f4d329db54922740c0ab (diff) |
lib/i915_drm_local: Add I915_GEM_CREATE_EXT_FLAG_NEEDS_CPU_ACCESS
For now dump into i915_drm_local.h. Once the uapi on the kernel side is
merged, and is part of drm-next, we can sync the kernel headers and
remove this.
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>
-rw-r--r-- | lib/i915/i915_drm_local.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/i915/i915_drm_local.h b/lib/i915/i915_drm_local.h index 9a2273c4..ac35abf6 100644 --- a/lib/i915/i915_drm_local.h +++ b/lib/i915/i915_drm_local.h @@ -23,6 +23,27 @@ extern "C" { #define DRM_I915_QUERY_GEOMETRY_SUBSLICES 6 +/* + * Signal to the kernel that the object will need to be accessed via + * the CPU. + * + * Only valid when placing objects in I915_MEMORY_CLASS_DEVICE, and only + * strictly required on platforms where only some of the device memory + * is directly visible or mappable through the CPU, like on DG2+. + * + * One of the placements MUST also be I915_MEMORY_CLASS_SYSTEM, to + * ensure we can always spill the allocation to system memory, if we + * can't place the object in the mappable part of + * I915_MEMORY_CLASS_DEVICE. + * + * Without this hint, the kernel will assume that non-mappable + * I915_MEMORY_CLASS_DEVICE is preferred for this object. Note that the + * kernel can still migrate the object to the mappable part, as a last + * resort, if userspace ever CPU faults this object, but this might be + * expensive, and so ideally should be avoided. + */ +#define I915_GEM_CREATE_EXT_FLAG_NEEDS_CPU_ACCESS (1 << 0) + #if defined(__cplusplus) } #endif |