]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
gpu: Move DRM buddy allocator one level up (part two)
authorJoel Fernandes <joelagnelf@nvidia.com>
Thu, 5 Feb 2026 22:52:38 +0000 (08:52 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 6 Feb 2026 01:38:35 +0000 (11:38 +1000)
commitba110db8e1bc206c13fd7d985e79b033f53bfdea
tree0dac8e37746d7c7ebb4e8e971a9d7a928486c3fa
parent4a9671a03f2be13acde0cb15c5208767a9cc56e4
gpu: Move DRM buddy allocator one level up (part two)

Move the DRM buddy allocator one level up so that it can be used by GPU
drivers (example, nova-core) that have usecases other than DRM (such as
VFIO vGPU support). Modify the API, structures and Kconfigs to use
"gpu_buddy" terminology. Adapt the drivers and tests to use the new API.

The commit cannot be split due to bisectability, however no functional
change is intended. Verified by running K-UNIT tests and build tested
various configurations.

Signed-off-by: Joel Fernandes <joelagnelf@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
[airlied: I've split this into two so git can find copies easier.
I've also just nuked drm_random library, that stuff needs to be done
elsewhere and only the buddy tests seem to be using it].
Signed-off-by: Dave Airlie <airlied@redhat.com>
30 files changed:
Documentation/gpu/drm-mm.rst
MAINTAINERS
drivers/gpu/Kconfig [new file with mode: 0644]
drivers/gpu/Makefile
drivers/gpu/buddy.c
drivers/gpu/drm/Kconfig
drivers/gpu/drm/Makefile
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c
drivers/gpu/drm/amd/amdgpu/amdgpu_res_cursor.h
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.h
drivers/gpu/drm/drm_buddy.c [new file with mode: 0644]
drivers/gpu/drm/i915/i915_scatterlist.c
drivers/gpu/drm/i915/i915_ttm_buddy_manager.c
drivers/gpu/drm/i915/i915_ttm_buddy_manager.h
drivers/gpu/drm/i915/selftests/intel_memory_region.c
drivers/gpu/drm/ttm/tests/ttm_bo_validate_test.c
drivers/gpu/drm/ttm/tests/ttm_mock_manager.c
drivers/gpu/drm/ttm/tests/ttm_mock_manager.h
drivers/gpu/drm/xe/xe_res_cursor.h
drivers/gpu/drm/xe/xe_svm.c
drivers/gpu/drm/xe/xe_ttm_vram_mgr.c
drivers/gpu/drm/xe/xe_ttm_vram_mgr_types.h
drivers/gpu/tests/Makefile
drivers/gpu/tests/gpu_buddy_test.c
drivers/gpu/tests/gpu_random.c
drivers/gpu/tests/gpu_random.h
drivers/video/Kconfig
include/drm/drm_buddy.h [new file with mode: 0644]
include/linux/gpu_buddy.h