Commit 4a9671a0 authored by Joel Fernandes's avatar Joel Fernandes Committed by Dave Airlie
Browse files

gpu: Move DRM buddy allocator one level up (part one)



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: default avatarJoel Fernandes <joelagnelf@nvidia.com>
Reviewed-by: default avatarDave 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: default avatarDave Airlie <airlied@redhat.com>
parent 779ec12c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -526,10 +526,10 @@ DRM GPUVM Function References
DRM Buddy Allocator
===================

DRM Buddy Function References
-----------------------------
Buddy Allocator Function References (GPU buddy)
-----------------------------------------------

.. kernel-doc:: drivers/gpu/drm/drm_buddy.c
.. kernel-doc:: drivers/gpu/buddy.c
   :export:

DRM Cache Handling and Fast WC memcpy()
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
# drm/tegra depends on host1x, so if both drivers are built-in care must be
# taken to initialize them in the correct order. Link order is the only way
# to ensure this currently.
obj-y			+= host1x/ drm/ vga/
obj-y			+= host1x/ drm/ vga/ tests/
obj-$(CONFIG_IMX_IPUV3_CORE)	+= ipu-v3/
obj-$(CONFIG_TRACE_GPU_MEM)		+= trace/
obj-$(CONFIG_NOVA_CORE)		+= nova-core/
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@
#include <linux/module.h>
#include <linux/sizes.h>

#include <drm/drm_buddy.h>
#include <linux/gpu_buddy.h>
#include <drm/drm_print.h>

enum drm_buddy_free_tree {
+0 −4
Original line number Diff line number Diff line
@@ -269,10 +269,6 @@ config DRM_SCHED
config DRM_PANEL_BACKLIGHT_QUIRKS
	tristate

config DRM_LIB_RANDOM
	bool
	default n

config DRM_PRIVACY_SCREEN
	bool
	default n
+0 −1
Original line number Diff line number Diff line
@@ -69,7 +69,6 @@ config DRM_KUNIT_TEST
	select DRM_EXPORT_FOR_TESTS if m
	select DRM_GEM_SHMEM_HELPER
	select DRM_KUNIT_TEST_HELPERS
	select DRM_LIB_RANDOM
	select DRM_SYSFB_HELPER
	select PRIME_NUMBERS
	default KUNIT_ALL_TESTS
Loading