From: "Alexandre Courbot" <acourbot@nvidia.com>
To: "Joel Fernandes" <joelagnelf@nvidia.com>
Cc: linux-kernel@vger.kernel.org, "David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"Jonathan Corbet" <corbet@lwn.net>,
"Shuah Khan" <skhan@linuxfoundation.org>,
"Matthew Auld" <matthew.auld@intel.com>,
"Arun Pravin" <arunpravin.paneerselvam@amd.com>,
"Christian Koenig" <christian.koenig@amd.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Jani Nikula" <jani.nikula@linux.intel.com>,
"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
"Tvrtko Ursulin" <tursulin@ursulin.net>,
"Huang Rui" <ray.huang@amd.com>,
"Matthew Brost" <matthew.brost@intel.com>,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
"Helge Deller" <deller@gmx.de>,
"Danilo Krummrich" <dakr@kernel.org>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Dave Airlie" <airlied@redhat.com>, "Gary Guo" <gary@garyguo.net>,
"Daniel Almeida" <daniel.almeida@collabora.com>,
"Koen Koning" <koen.koning@linux.intel.com>,
dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org,
rust-for-linux@vger.kernel.org, linux-doc@vger.kernel.org,
amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
intel-xe@lists.freedesktop.org, linux-fbdev@vger.kernel.org
Subject: Re: [PATCH v10 2/8] gpu: Move DRM buddy allocator one level up (part two)
Date: Thu, 19 Feb 2026 12:18:06 +0900 [thread overview]
Message-ID: <DGIM3AE5HMTB.1INPUXJQ5GQ4P@nvidia.com> (raw)
In-Reply-To: <20260218205507.689429-3-joelagnelf@nvidia.com>
On Thu Feb 19, 2026 at 5:55 AM JST, Joel Fernandes wrote:
> 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.
Patches 1 and 2 have the exact same commit log, but each one does only
part of it. Let's only keep the part of the log that applies to each
patch.
>
> 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>
> ---
> Documentation/gpu/drm-mm.rst | 6 +
> MAINTAINERS | 8 +-
> drivers/gpu/Kconfig | 13 +
> drivers/gpu/Makefile | 1 +
> drivers/gpu/buddy.c | 556 +++++++++---------
> drivers/gpu/drm/Kconfig | 1 +
> drivers/gpu/drm/Makefile | 2 +-
> drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 2 +-
> .../gpu/drm/amd/amdgpu/amdgpu_res_cursor.h | 12 +-
> drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 79 +--
> drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.h | 18 +-
> drivers/gpu/drm/drm_buddy.c | 77 +++
> drivers/gpu/drm/i915/i915_scatterlist.c | 8 +-
> drivers/gpu/drm/i915/i915_ttm_buddy_manager.c | 55 +-
> drivers/gpu/drm/i915/i915_ttm_buddy_manager.h | 4 +-
> .../drm/i915/selftests/intel_memory_region.c | 20 +-
> .../gpu/drm/ttm/tests/ttm_bo_validate_test.c | 4 +-
> drivers/gpu/drm/ttm/tests/ttm_mock_manager.c | 18 +-
> drivers/gpu/drm/ttm/tests/ttm_mock_manager.h | 2 +-
> drivers/gpu/drm/xe/xe_res_cursor.h | 34 +-
> drivers/gpu/drm/xe/xe_svm.c | 12 +-
> drivers/gpu/drm/xe/xe_ttm_vram_mgr.c | 71 +--
> drivers/gpu/drm/xe/xe_ttm_vram_mgr_types.h | 2 +-
> drivers/gpu/tests/Makefile | 2 +-
> drivers/gpu/tests/gpu_buddy_test.c | 412 ++++++-------
> drivers/gpu/tests/gpu_random.c | 16 +-
> drivers/gpu/tests/gpu_random.h | 18 +-
> drivers/video/Kconfig | 1 +
> include/drm/drm_buddy.h | 18 +
> include/linux/gpu_buddy.h | 120 ++--
> 30 files changed, 853 insertions(+), 739 deletions(-)
> create mode 100644 drivers/gpu/Kconfig
> create mode 100644 drivers/gpu/drm/drm_buddy.c
> create mode 100644 include/drm/drm_buddy.h
>
> diff --git a/Documentation/gpu/drm-mm.rst b/Documentation/gpu/drm-mm.rst
> index ceee0e663237..32fb506db05b 100644
> --- a/Documentation/gpu/drm-mm.rst
> +++ b/Documentation/gpu/drm-mm.rst
> @@ -532,6 +532,12 @@ Buddy Allocator Function References (GPU buddy)
> .. kernel-doc:: drivers/gpu/buddy.c
> :export:
>
> +DRM Buddy Specific Logging Function References
> +----------------------------------------------
> +
> +.. kernel-doc:: drivers/gpu/drm/drm_buddy.c
> + :export:
> +
> DRM Cache Handling and Fast WC memcpy()
> =======================================
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index dc82a6bd1a61..14b4f9af0e36 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -8905,15 +8905,17 @@ T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
> F: drivers/gpu/drm/ttm/
> F: include/drm/ttm/
>
> -DRM BUDDY ALLOCATOR
> +GPU BUDDY ALLOCATOR
> M: Matthew Auld <matthew.auld@intel.com>
> M: Arun Pravin <arunpravin.paneerselvam@amd.com>
> R: Christian Koenig <christian.koenig@amd.com>
> L: dri-devel@lists.freedesktop.org
> S: Maintained
> T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
> -F: drivers/gpu/drm/drm_buddy.c
> -F: drivers/gpu/drm/tests/drm_buddy_test.c
> +F: drivers/gpu/drm_buddy.c
This line should be `drivers/gpu/drm/drm_buddy.c`.
> +F: drivers/gpu/buddy.c
> +F: drivers/gpu/tests/gpu_buddy_test.c
> +F: include/linux/gpu_buddy.h
These files have been moved in patch 1, so their MAINTAINERS entry
should also be modified there.
next prev parent reply other threads:[~2026-02-19 3:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260218205507.689429-1-joelagnelf@nvidia.com>
2026-02-18 20:55 ` [PATCH v10 2/8] gpu: Move DRM buddy allocator one level up (part two) Joel Fernandes
2026-02-19 3:18 ` Alexandre Courbot [this message]
2026-02-18 20:59 ` [PATCH v10 0/8] Preparatory patches for nova-core memory management Joel Fernandes
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DGIM3AE5HMTB.1INPUXJQ5GQ4P@nvidia.com \
--to=acourbot@nvidia.com \
--cc=airlied@gmail.com \
--cc=airlied@redhat.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=arunpravin.paneerselvam@amd.com \
--cc=christian.koenig@amd.com \
--cc=corbet@lwn.net \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=deller@gmx.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=gary@garyguo.net \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=joelagnelf@nvidia.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=koen.koning@linux.intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=matthew.auld@intel.com \
--cc=matthew.brost@intel.com \
--cc=mripard@kernel.org \
--cc=nouveau@lists.freedesktop.org \
--cc=ojeda@kernel.org \
--cc=ray.huang@amd.com \
--cc=rodrigo.vivi@intel.com \
--cc=rust-for-linux@vger.kernel.org \
--cc=simona@ffwll.ch \
--cc=skhan@linuxfoundation.org \
--cc=thomas.hellstrom@linux.intel.com \
--cc=tursulin@ursulin.net \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox