mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-19 17:14:40 +08:00
fff1d972f4
Add an entry for the new uapi needed for small BAR on DG2+. v2: - Some spelling fixes and other small tweaks. (Akeem & Thomas) - Rework error capture interactions, including no longer needing NEEDS_CPU_ACCESS for objects marked for capture. (Thomas) - Add probed_cpu_visible_size. (Lionel) v3: - Drop the vma query for now. - Add unallocated_cpu_visible_size as part of the region query. - Improve the docs some more, including documenting the expected behaviour on older kernels, since this came up in some offline discussion. v4: - Various improvements all over. (Tvrtko) v5: - Include newer integrated platforms when applying the non-recoverable context and error capture restriction. (Thomas) Mesa: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16739 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: Tvrtko Ursulin <tvrtko.ursulin@linux.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> Cc: mesa-dev@lists.freedesktop.org Acked-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Acked-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com> Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Acked-by: Jordan Justen <jordan.l.justen@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220629174350.384910-1-matthew.auld@intel.com
48 lines
2.2 KiB
ReStructuredText
48 lines
2.2 KiB
ReStructuredText
==========================
|
|
I915 Small BAR RFC Section
|
|
==========================
|
|
Starting from DG2 we will have resizable BAR support for device local-memory(i.e
|
|
I915_MEMORY_CLASS_DEVICE), but in some cases the final BAR size might still be
|
|
smaller than the total probed_size. In such cases, only some subset of
|
|
I915_MEMORY_CLASS_DEVICE will be CPU accessible(for example the first 256M),
|
|
while the remainder is only accessible via the GPU.
|
|
|
|
I915_GEM_CREATE_EXT_FLAG_NEEDS_CPU_ACCESS flag
|
|
----------------------------------------------
|
|
New gem_create_ext flag to tell the kernel that a BO will require CPU access.
|
|
This becomes important when placing an object in I915_MEMORY_CLASS_DEVICE, where
|
|
underneath the device has a small BAR, meaning only some portion of it is CPU
|
|
accessible. Without this flag the kernel will assume that CPU access is not
|
|
required, and prioritize using the non-CPU visible portion of
|
|
I915_MEMORY_CLASS_DEVICE.
|
|
|
|
.. kernel-doc:: Documentation/gpu/rfc/i915_small_bar.h
|
|
:functions: __drm_i915_gem_create_ext
|
|
|
|
probed_cpu_visible_size attribute
|
|
---------------------------------
|
|
New struct__drm_i915_memory_region attribute which returns the total size of the
|
|
CPU accessible portion, for the particular region. This should only be
|
|
applicable for I915_MEMORY_CLASS_DEVICE. We also report the
|
|
unallocated_cpu_visible_size, alongside the unallocated_size.
|
|
|
|
Vulkan will need this as part of creating a separate VkMemoryHeap with the
|
|
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT set, to represent the CPU visible portion,
|
|
where the total size of the heap needs to be known. It also wants to be able to
|
|
give a rough estimate of how memory can potentially be allocated.
|
|
|
|
.. kernel-doc:: Documentation/gpu/rfc/i915_small_bar.h
|
|
:functions: __drm_i915_memory_region_info
|
|
|
|
Error Capture restrictions
|
|
--------------------------
|
|
With error capture we have two new restrictions:
|
|
|
|
1) Error capture is best effort on small BAR systems; if the pages are not
|
|
CPU accessible, at the time of capture, then the kernel is free to skip
|
|
trying to capture them.
|
|
|
|
2) On discrete and newer integrated platforms we now reject error capture
|
|
on recoverable contexts. In the future the kernel may want to blit during
|
|
error capture, when for example something is not currently CPU accessible.
|