Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-16 Thread Boris Brezillon
On Wed, 16 Apr 2025 16:16:05 +0100 Steven Price wrote: > On 15/04/2025 10:47, Boris Brezillon wrote: > > On Mon, 14 Apr 2025 16:34:35 +0100 > > Steven Price wrote: > > > >> On 14/04/2025 13:47, Boris Brezillon wrote: > >>> On Fri, 11 Apr 2025 16:39:02 +0200 > >>> Boris Brezillon wrote: > >

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-16 Thread Steven Price
On 15/04/2025 10:47, Boris Brezillon wrote: > On Mon, 14 Apr 2025 16:34:35 +0100 > Steven Price wrote: > >> On 14/04/2025 13:47, Boris Brezillon wrote: >>> On Fri, 11 Apr 2025 16:39:02 +0200 >>> Boris Brezillon wrote: >>> On Fri, 11 Apr 2025 15:13:26 +0200 Christian König wrote: >>

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-15 Thread Boris Brezillon
On Mon, 14 Apr 2025 09:03:55 -0400 Alyssa Rosenzweig wrote: > > Actually, CSF stands in the way of re-allocating memory to other > > contexts, because once we've allocated memory to a tiler heap, the FW > > manages this pool of chunks, and recycles them. Mesa can intercept > > the "returned chunk

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-15 Thread Liviu Dudau
On Mon, Apr 14, 2025 at 01:22:06PM +0200, Boris Brezillon wrote: > Hi Sima, > > On Fri, 11 Apr 2025 14:01:16 +0200 > Simona Vetter wrote: > > > On Thu, Apr 10, 2025 at 08:41:55PM +0200, Boris Brezillon wrote: > > > On Thu, 10 Apr 2025 14:01:03 -0400 > > > Alyssa Rosenzweig wrote: > > > > > >

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-15 Thread Daniel Stone
Hi, On Mon, 14 Apr 2025 at 16:34, Steven Price wrote: > On 14/04/2025 13:47, Boris Brezillon wrote: > > Hm, I might have been too prompt at claiming this was doable. In > > practice, doing that might regress Lima and Panfrost in situations > > where trying harder than GFP_NOWAIT would free up som

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-15 Thread Boris Brezillon
On Mon, 14 Apr 2025 16:34:35 +0100 Steven Price wrote: > On 14/04/2025 13:47, Boris Brezillon wrote: > > On Fri, 11 Apr 2025 16:39:02 +0200 > > Boris Brezillon wrote: > > > >> On Fri, 11 Apr 2025 15:13:26 +0200 > >> Christian König wrote: > >> > > > Background is that you do

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-14 Thread Steven Price
On 14/04/2025 13:47, Boris Brezillon wrote: > On Fri, 11 Apr 2025 16:39:02 +0200 > Boris Brezillon wrote: > >> On Fri, 11 Apr 2025 15:13:26 +0200 >> Christian König wrote: >> > Background is that you don't get a crash, nor error message, nor > anything indicating what is happeni

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-14 Thread Boris Brezillon
On Mon, 14 Apr 2025 16:34:47 +0200 Simona Vetter wrote: > On Mon, Apr 14, 2025 at 02:08:25PM +0100, Liviu Dudau wrote: > > On Mon, Apr 14, 2025 at 01:22:06PM +0200, Boris Brezillon wrote: > > > Hi Sima, > > > > > > On Fri, 11 Apr 2025 14:01:16 +0200 > > > Simona Vetter wrote: > > > > > > >

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-14 Thread Simona Vetter
On Mon, Apr 14, 2025 at 01:22:06PM +0200, Boris Brezillon wrote: > Hi Sima, > > On Fri, 11 Apr 2025 14:01:16 +0200 > Simona Vetter wrote: > > > On Thu, Apr 10, 2025 at 08:41:55PM +0200, Boris Brezillon wrote: > > > On Thu, 10 Apr 2025 14:01:03 -0400 > > > Alyssa Rosenzweig wrote: > > > > > >

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-14 Thread Simona Vetter
On Mon, Apr 14, 2025 at 02:08:25PM +0100, Liviu Dudau wrote: > On Mon, Apr 14, 2025 at 01:22:06PM +0200, Boris Brezillon wrote: > > Hi Sima, > > > > On Fri, 11 Apr 2025 14:01:16 +0200 > > Simona Vetter wrote: > > > > > On Thu, Apr 10, 2025 at 08:41:55PM +0200, Boris Brezillon wrote: > > > > On T

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-14 Thread Alyssa Rosenzweig
> I'm still trying to see if we can emulate/have incremental-rendering on > JM hardware I guess since we don't advertise vertex shader side effects... Lol, maybe that could work...

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-14 Thread Alyssa Rosenzweig
> Actually, CSF stands in the way of re-allocating memory to other > contexts, because once we've allocated memory to a tiler heap, the FW > manages this pool of chunks, and recycles them. Mesa can intercept > the "returned chunks" and collect those chunks instead of re-assiging > then to the tiler

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-14 Thread Boris Brezillon
On Fri, 11 Apr 2025 16:39:02 +0200 Boris Brezillon wrote: > On Fri, 11 Apr 2025 15:13:26 +0200 > Christian König wrote: > > > > > > >> Background is that you don't get a crash, nor error message, nor > > >> anything indicating what is happening. > > > The job times out at some point, bu

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-14 Thread Boris Brezillon
Hi Sima, On Fri, 11 Apr 2025 14:01:16 +0200 Simona Vetter wrote: > On Thu, Apr 10, 2025 at 08:41:55PM +0200, Boris Brezillon wrote: > > On Thu, 10 Apr 2025 14:01:03 -0400 > > Alyssa Rosenzweig wrote: > > > > > > > > In Panfrost and Lima, we don't have this concept of "incremental > > > > > >

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-11 Thread Simona Vetter
On Fri, Apr 11, 2025 at 12:55:57PM +0200, Christian König wrote: > Am 11.04.25 um 10:38 schrieb Boris Brezillon: > > On Fri, 11 Apr 2025 10:04:07 +0200 > > Christian König wrote: > > > >> Am 10.04.25 um 20:41 schrieb Boris Brezillon: > >>> On Thu, 10 Apr 2025 14:01:03 -0400 > >>> Alyssa Rosenzweig

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-11 Thread Simona Vetter
On Fri, Apr 11, 2025 at 02:50:19PM +0200, Christian König wrote: > Am 11.04.25 um 14:01 schrieb Simona Vetter: > > On Thu, Apr 10, 2025 at 08:41:55PM +0200, Boris Brezillon wrote: > >> On Thu, 10 Apr 2025 14:01:03 -0400 > >> Alyssa Rosenzweig wrote: > >> > >> In Panfrost and Lima, we don't hav

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-11 Thread Simona Vetter
On Fri, Apr 11, 2025 at 09:52:30AM -0400, Alyssa Rosenzweig wrote: > > 2. Device Lost > > -- > > > > At this point we're left with no other choice than to kill the context. > > And userspace should be able to cope with VK_DEVICE_LOST (hopefully zink > > does), but it will probably not

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-11 Thread Christian König
Am 11.04.25 um 15:00 schrieb Boris Brezillon: > On Fri, 11 Apr 2025 14:45:49 +0200 > Christian König wrote: > >> Am 11.04.25 um 14:02 schrieb Boris Brezillon: > I guess this leaves older GPUs that don't support incremental > rendering in a bad place though. Well what's the handlin

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-11 Thread Boris Brezillon
On Fri, 11 Apr 2025 15:13:26 +0200 Christian König wrote: > > > >> Background is that you don't get a crash, nor error message, nor > >> anything indicating what is happening. > > The job times out at some point, but we might get stuck in the fault > > handler waiting for memory, which is pre

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-11 Thread Alyssa Rosenzweig
> 2. Device Lost > -- > > At this point we're left with no other choice than to kill the context. > And userspace should be able to cope with VK_DEVICE_LOST (hopefully zink > does), but it will probably not cope well with an entire strom of these > just to get the first frame out. > >

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-11 Thread Boris Brezillon
On Fri, 11 Apr 2025 14:45:49 +0200 Christian König wrote: > Am 11.04.25 um 14:02 schrieb Boris Brezillon: > >>> I guess this leaves older GPUs that don't support incremental > >>> rendering in a bad place though. > >> Well what's the handling there currently? Just crash when you're > >> OOM?

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-11 Thread Christian König
Am 11.04.25 um 14:01 schrieb Simona Vetter: > On Thu, Apr 10, 2025 at 08:41:55PM +0200, Boris Brezillon wrote: >> On Thu, 10 Apr 2025 14:01:03 -0400 >> Alyssa Rosenzweig wrote: >> >> In Panfrost and Lima, we don't have this concept of "incremental >> rendering", so when we fail the allocat

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-11 Thread Christian König
Am 11.04.25 um 14:02 schrieb Boris Brezillon: >>> I guess this leaves older GPUs that don't support incremental >>> rendering in a bad place though. >> Well what's the handling there currently? Just crash when you're OOM? > It's "alloc(GFP_KERNEL) and crash if it fails or times out", yes. Oh, pl

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-11 Thread Boris Brezillon
On Fri, 11 Apr 2025 12:55:57 +0200 Christian König wrote: > Am 11.04.25 um 10:38 schrieb Boris Brezillon: > > On Fri, 11 Apr 2025 10:04:07 +0200 > > Christian König wrote: > > > >> Am 10.04.25 um 20:41 schrieb Boris Brezillon: > >>> On Thu, 10 Apr 2025 14:01:03 -0400 > >>> Alyssa Rosenzweig

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-11 Thread Simona Vetter
On Thu, Apr 10, 2025 at 08:41:55PM +0200, Boris Brezillon wrote: > On Thu, 10 Apr 2025 14:01:03 -0400 > Alyssa Rosenzweig wrote: > > > > > > In Panfrost and Lima, we don't have this concept of "incremental > > > > > rendering", so when we fail the allocation, we just fail the GPU job > > > > > wi

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-11 Thread Christian König
Am 11.04.25 um 10:38 schrieb Boris Brezillon: > On Fri, 11 Apr 2025 10:04:07 +0200 > Christian König wrote: > >> Am 10.04.25 um 20:41 schrieb Boris Brezillon: >>> On Thu, 10 Apr 2025 14:01:03 -0400 >>> Alyssa Rosenzweig wrote: >>> >>> In Panfrost and Lima, we don't have this concept of "inc

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-11 Thread Boris Brezillon
On Fri, 11 Apr 2025 10:04:07 +0200 Christian König wrote: > Am 10.04.25 um 20:41 schrieb Boris Brezillon: > > On Thu, 10 Apr 2025 14:01:03 -0400 > > Alyssa Rosenzweig wrote: > > > > In Panfrost and Lima, we don't have this concept of "incremental > > rendering", so when we fail the all

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-11 Thread Boris Brezillon
Hi Christian, On Thu, 10 Apr 2025 20:52:27 +0200 Christian König wrote: > Am 10.04.25 um 19:20 schrieb Boris Brezillon: > > [SNIP] > Faulting is only legal when you have something like HMM, SVM or > whatever you call it. And then you can just use a plain shmem > object to provid

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-11 Thread Christian König
Am 10.04.25 um 20:41 schrieb Boris Brezillon: > On Thu, 10 Apr 2025 14:01:03 -0400 > Alyssa Rosenzweig wrote: > > In Panfrost and Lima, we don't have this concept of "incremental > rendering", so when we fail the allocation, we just fail the GPU job > with an unhandled GPU fault. >

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-10 Thread Christian König
Am 10.04.25 um 19:20 schrieb Boris Brezillon: > [SNIP] Faulting is only legal when you have something like HMM, SVM or whatever you call it. And then you can just use a plain shmem object to provide you with backing pages. I mean we could in theory allow faulting on GEM obj

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-10 Thread Boris Brezillon
On Thu, 10 Apr 2025 14:01:03 -0400 Alyssa Rosenzweig wrote: > > > > In Panfrost and Lima, we don't have this concept of "incremental > > > > rendering", so when we fail the allocation, we just fail the GPU job > > > > with an unhandled GPU fault. > > > > > > To be honest I think that this is

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-10 Thread Alyssa Rosenzweig
> > > In Panfrost and Lima, we don't have this concept of "incremental > > > rendering", so when we fail the allocation, we just fail the GPU job > > > with an unhandled GPU fault. > > > > To be honest I think that this is enough to mark those two drivers as > > broken.  It's documented that thi

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-10 Thread Boris Brezillon
Hi Christian, On Thu, 10 Apr 2025 18:43:29 +0200 Christian König wrote: > Hi Boris, > > Am 10.04.25 um 17:53 schrieb Boris Brezillon: > > Hi Christian, > > > > On Thu, 10 Apr 2025 17:05:07 +0200 > > Christian König wrote: > > > >> Hi Boris, > >> > >> thanks for looping me in. Can you also se

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-10 Thread Christian König
Hi Boris, Am 10.04.25 um 17:53 schrieb Boris Brezillon: > Hi Christian, > > On Thu, 10 Apr 2025 17:05:07 +0200 > Christian König wrote: > >> Hi Boris, >> >> thanks for looping me in. Can you also send the full patch set to me since I >> don't see that on the mailing list (yet maybe). >> >> Am 10

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-10 Thread Boris Brezillon
Hi Christian, On Thu, 10 Apr 2025 17:05:07 +0200 Christian König wrote: > Hi Boris, > > thanks for looping me in. Can you also send the full patch set to me since I > don't see that on the mailing list (yet maybe). > > Am 10.04.25 um 16:48 schrieb Boris Brezillon: > > +Christian, Alyssa and F

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-10 Thread Christian König
Hi Boris, thanks for looping me in. Can you also send the full patch set to me since I don't see that on the mailing list (yet maybe). Am 10.04.25 um 16:48 schrieb Boris Brezillon: > +Christian, Alyssa and Faith, as suggested by Sima. I'll make sure to > Cc you on v4, but before that, I'd like t

Re: [PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-10 Thread Boris Brezillon
+Christian, Alyssa and Faith, as suggested by Sima. I'll make sure to Cc you on v4, but before that, I'd like to get your opinion on the drm-gem/drm-gem-shmem changes to see if sending a v4 is actually desirable or if I should go back to the drawing board. On Fri, 4 Apr 2025 11:26:26 +0200 Boris

[PATCH v3 0/8] drm: Introduce sparse GEM shmem

2025-04-04 Thread Boris Brezillon
This patch series is a proposal for implementing sparse page allocations for shmem objects. It was initially motivated by a kind of BO managed by the Panfrost/Panthor and Lima drivers, the tiler heap, which grows on demand every time the GPU faults on a virtual address within the heap BO range. Be