drm/i915/uapi: expose the avail tracking
Vulkan would like to have a rough measure of how much device memory can in theory be allocated. Also add unallocated_cpu_visible_size to track the visible portion, in case the device is using small BAR. Also tweak the locking so we nice consistent values for both the mm->avail and the visible tracking. v2: tweak the locking slightly so we update the mm->avail and visible tracking as one atomic operation, such that userspace doesn't get strange values when sampling the values. Testcase: igt@i915_query@query-regions-unallocated Testcase: igt@i915_query@query-regions-sanity-check 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> Reviewed-by:
Thomas Hellström <thomas.hellstrom@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220629174350.384910-3-matthew.auld@intel.com
Showing
- drivers/gpu/drm/i915/i915_query.c 9 additions, 1 deletiondrivers/gpu/drm/i915/i915_query.c
- drivers/gpu/drm/i915/i915_ttm_buddy_manager.c 23 additions, 8 deletionsdrivers/gpu/drm/i915/i915_ttm_buddy_manager.c
- drivers/gpu/drm/i915/i915_ttm_buddy_manager.h 3 additions, 0 deletionsdrivers/gpu/drm/i915/i915_ttm_buddy_manager.h
- drivers/gpu/drm/i915/intel_memory_region.c 14 additions, 0 deletionsdrivers/gpu/drm/i915/intel_memory_region.c
- drivers/gpu/drm/i915/intel_memory_region.h 3 additions, 0 deletionsdrivers/gpu/drm/i915/intel_memory_region.h
- include/uapi/drm/i915_drm.h 30 additions, 1 deletioninclude/uapi/drm/i915_drm.h
Loading
Please register or sign in to comment