public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@collabora.com>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: simona@ffwll.ch, airlied@gmail.com, mripard@kernel.org,
	maarten.lankhorst@linux.intel.com, ogabbay@kernel.org,
	mamin506@gmail.com, lizhi.hou@amd.com,
	maciej.falkowski@linux.intel.com,
	karol.wachowski@linux.intel.com, tomeu@tomeuvizoso.net,
	frank.binns@imgtec.com, matt.coster@imgtec.com, yuq825@gmail.com,
	robh@kernel.org, steven.price@arm.com,
	adrian.larumbe@collabora.com, liviu.dudau@arm.com,
	mwen@igalia.com, kraxel@redhat.com,
	dmitry.osipenko@collabora.com, gurchetansingh@chromium.org,
	olvaffe@gmail.com, corbet@lwn.net,
	dri-devel@lists.freedesktop.org, lima@lists.freedesktop.org,
	virtualization@lists.linux.dev, linux-doc@vger.kernel.org
Subject: Re: [RFC][PATCH 00/13] drm: Introduce GEM-UMA memory management
Date: Tue, 9 Dec 2025 16:30:11 +0100	[thread overview]
Message-ID: <20251209163011.436e613b@fedora> (raw)
In-Reply-To: <2b95d76e-2672-4cae-a545-73c407f2b20c@suse.de>

On Tue, 9 Dec 2025 15:51:21 +0100
Thomas Zimmermann <tzimmermann@suse.de> wrote:

> Hi
> 
> Am 09.12.25 um 15:27 schrieb Boris Brezillon:
> > On Tue,  9 Dec 2025 14:41:57 +0100
> > Thomas Zimmermann <tzimmermann@suse.de> wrote:
> >  
> >> Duplicate GEM-SHMEM to GEM-UMA. Convert all DRM drivers for UMA
> >> systems if they currently use GEM-SHMEM.
> >>
> >> Many DRM drivers for hardware with Unified Memory Architecture (UMA)
> >> currently builds upon GEM-SHMEM and extends the helpers with features
> >> for managing the GPU MMU. This allows the GPU to access the GEM buffer
> >> content for its operation.
> >>
> >> There is another, larger, set of DRM drivers that use GEM-SHMEM merely
> >> as buffer management with no hardware support. These drivers copy the
> >> buffer content to the GPU on each page flip. The GPU itself has no direct
> >> access. Hardware of this type is usually in servers, behind slow busses
> >> (SPI, USB), or provided by firmware (drivers in sysfb/).
> >>
> >> After some discussion with Boris on the future of GEM-SHMEM, it seems
> >> to me that both use cases more and more diverge from each other. The
> >> most prominent example is the implementation of gem_prime_import,
> >> where both use cases use distinct approaches.
> >>
> >> So we discussed the introduction of a GEM-UMA helper library for
> >> UMA-based hardware. GEM-UMA will remain flexible enough for drivers
> >> to extend it for their use case. GEM-SHMEM will become focused on the
> >> simple-hardware use case. The benefit for both libraries is that they
> >> will be easier to understand and maintain. GEM-SHMEM can be simplified
> >> signiifcantly, I think.
> >>
> >> This RFC series introduces GEM-UMA and converts the UMA-related drivers.
> >>
> >> Patches 1 and 2 fix issues in GEM-SHMEM, so that we don't duplicate
> >> errornous code.
> >>
> >> Patch 3 copies GEM-SHMEM to GEM-UMA. Patch 4 then does soem obvious
> >> cleanups of unnecessary code.  
> > Instead of copying the code as-is, I'd rather take a step back and think
> > about what we need and how we want to handle more complex stuff, like
> > reclaim. I've started working on a shrinker for panthor [1], and as part
> > of this series, I've added a commit implementing just enough to replace
> > what gem-shmem currently provides. Feels like the new GEM-UMA thing
> > could be designed on a composition rather than inheritance model,
> > where we have sub-components (backing, cpu_map, gpu_map) that can be
> > pulled in and re-used by the driver implementation. The common helpers
> > would take those sub-components instead of a plain GEM object. That
> > would leave the drivers free of how their internal gem_object fields are
> > laid out and wouldn't require overloading the ->gem_create_object()
> > function. It seems to be that it would better match the model you were
> > describing the other day.  
> 
> Yeah, I've seen your update to that series. Making individual parts of 
> the memory manager freely composable with each other is a fine idea.
> 
> But the flipside is that I also want the simple drivers to move away 
> from the flexible approach that GEM-SHMEM currently takes. There are 
> many drivers that do not need or want that. These drivers benefit from 
> something that is self contained. Many of the drivers are also hardly 
> maintained, so simplifying things will also be helpful.
> 
> I could have added a new GEM implementation for these drivers, but there 
> are less UMA drivers to convert and the GEM-UMA naming generally fits 
> better than GEM-SHMEM.
> 
> I'd rather have GEM-UMA and evolve it from where it stands now; and also 
> evolve GEM-SHMEM in a different direction. There's a difference in 
> concepts here.

Problem is, we'll be stuck trying to evolve gem-uma to something
cleaner because of the existing abuse of gem-shmem that you're moving
to gem-uma, so I'm not sure I like the idea to be honest. I'm all for
this gem-uma thing, but I'm not convinced rushing it in is the right
solution.

  reply	other threads:[~2025-12-09 15:30 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-09 13:41 [RFC][PATCH 00/13] drm: Introduce GEM-UMA memory management Thomas Zimmermann
2025-12-09 13:41 ` [PATCH 01/13] drm/gem-shmem: Fix typos in documentation Thomas Zimmermann
2025-12-11 10:00   ` Boris Brezillon
2025-12-11 12:03   ` Thomas Zimmermann
2025-12-09 13:41 ` [PATCH 02/13] drm/gem-shmem: Fix the MODULE_LICENSE() string Thomas Zimmermann
2025-12-11 10:01   ` Boris Brezillon
2025-12-11 12:04   ` Thomas Zimmermann
2025-12-09 13:42 ` [PATCH 03/13] drm: Add GEM-UMA helpers for memory management Thomas Zimmermann
2025-12-09 13:42 ` [PATCH 04/13] drm/gem-uma: Remove unused interfaces Thomas Zimmermann
2025-12-09 13:42 ` [PATCH 05/13] drm/imagination: Use GEM-UMA helpers for memory management Thomas Zimmermann
2025-12-09 13:42 ` [PATCH 06/13] drm/lima: " Thomas Zimmermann
2025-12-09 13:42 ` [PATCH 07/13] drm/panfrost: " Thomas Zimmermann
2025-12-09 13:42 ` [PATCH 08/13] drm/panthor: " Thomas Zimmermann
2025-12-09 13:42 ` [PATCH 09/13] drm/v3d: " Thomas Zimmermann
2025-12-09 13:42 ` [PATCH 10/13] drm/virtgpu: " Thomas Zimmermann
2025-12-09 13:42 ` [PATCH 11/13] accel/amdxdna: " Thomas Zimmermann
2025-12-09 13:42 ` [PATCH 12/13] accel/ivpu: " Thomas Zimmermann
2025-12-09 14:24   ` Karol Wachowski
2025-12-09 14:25   ` Karol Wachowski
2025-12-09 13:42 ` [PATCH 13/13] accel/rocket: " Thomas Zimmermann
2025-12-09 14:27 ` [RFC][PATCH 00/13] drm: Introduce GEM-UMA " Boris Brezillon
2025-12-09 14:51   ` Thomas Zimmermann
2025-12-09 15:30     ` Boris Brezillon [this message]
2025-12-10  7:34       ` Thomas Zimmermann
2025-12-10  9:21         ` Boris Brezillon
2025-12-10  9:57           ` Thomas Zimmermann

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=20251209163011.436e613b@fedora \
    --to=boris.brezillon@collabora.com \
    --cc=adrian.larumbe@collabora.com \
    --cc=airlied@gmail.com \
    --cc=corbet@lwn.net \
    --cc=dmitry.osipenko@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=frank.binns@imgtec.com \
    --cc=gurchetansingh@chromium.org \
    --cc=karol.wachowski@linux.intel.com \
    --cc=kraxel@redhat.com \
    --cc=lima@lists.freedesktop.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=liviu.dudau@arm.com \
    --cc=lizhi.hou@amd.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=maciej.falkowski@linux.intel.com \
    --cc=mamin506@gmail.com \
    --cc=matt.coster@imgtec.com \
    --cc=mripard@kernel.org \
    --cc=mwen@igalia.com \
    --cc=ogabbay@kernel.org \
    --cc=olvaffe@gmail.com \
    --cc=robh@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=steven.price@arm.com \
    --cc=tomeu@tomeuvizoso.net \
    --cc=tzimmermann@suse.de \
    --cc=virtualization@lists.linux.dev \
    --cc=yuq825@gmail.com \
    /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