2023-02-15
00:10seeeath has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
00:13seeeath has joined #asahi-gpu
00:15seeeath has quit []
00:16kesslerd has joined #asahi-gpu
00:16seeeath has joined #asahi-gpu
01:08hightower4 has quit [Remote host closed the connection]
01:08hightower4 has joined #asahi-gpu
01:29hightower4 has quit [Ping timeout: 480 seconds]
01:31seeeath has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
01:34seeeath has joined #asahi-gpu
02:03kesslerd has quit [Quit: Leaving]
02:17seeeath has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
02:47seeeath has joined #asahi-gpu
03:01seeeath has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
03:41seeeath has joined #asahi-gpu
03:41seeeath has quit []
03:57seeeath has joined #asahi-gpu
04:28stipa has quit [Read error: Connection reset by peer]
04:29stipa has joined #asahi-gpu
05:20seeeath has quit [Read error: Connection reset by peer]
05:21seeeath has joined #asahi-gpu
05:23seeeath_ has joined #asahi-gpu
05:26seeeath__ has joined #asahi-gpu
05:29seeeath has quit [Ping timeout: 480 seconds]
05:30seeeath has joined #asahi-gpu
05:31seeeath_ has quit [Ping timeout: 480 seconds]
05:35seeeath__ has quit [Read error: Connection reset by peer]
05:35seeeath_ has joined #asahi-gpu
05:40seeeath has quit [Ping timeout: 480 seconds]
05:52seeeath has joined #asahi-gpu
05:53seeeath__ has joined #asahi-gpu
05:55seeeath_ has quit [Read error: Connection reset by peer]
05:55seeeath__ has quit [Read error: Connection reset by peer]
05:58seeeath_ has joined #asahi-gpu
06:00seeeath has quit [Ping timeout: 480 seconds]
07:11WindowPa- has joined #asahi-gpu
07:11WindowPain has quit [Read error: Connection reset by peer]
07:51MajorBiscuit has joined #asahi-gpu
08:44gorbypark has joined #asahi-gpu
08:45gorbypark has quit [Quit: Konversation terminated!]
08:45gorbypark has joined #asahi-gpu
08:51gorbypark has quit [Quit: Konversation terminated!]
10:07linaalyssa: This is triggering on the EGL testsuite: Assertion `maxx > minx && maxy > miny' failed
11:07cylm has quit [Read error: Connection reset by peer]
12:00MajorBiscuit has quit [Ping timeout: 480 seconds]
12:30MajorBiscuit has joined #asahi-gpu
12:46possiblemeatball has joined #asahi-gpu
13:06seeeath_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
13:19alyssa has quit [Quit: leaving]
13:33linaalyssa: With that commented out, we pass all the EGL tests except robust_gl_3* context creation stuff which sounds not applicable... ^^
13:53kesslerd has joined #asahi-gpu
14:02cylm has joined #asahi-gpu
14:09Cyrinux9 has quit []
14:09Cyrinux9 has joined #asahi-gpu
14:20kesslerd has quit [Ping timeout: 480 seconds]
15:11seeeath has joined #asahi-gpu
15:26linaPushed all the explicit sync stuff to gpu/explicit-sync (kernel) and agx/explicit-sync (mesa), seems to work well ^^
15:32linaOne little thing: sometimes you get GPU faults when killing things. Since everything is async now and BOs are tracked by userspace, if userspace dies in-progress GPU operations lose their BOs. The driver itself keeps all the critical structures alive until the jobs complete/fail, so nothing breaks, you just get GPU fault logs.
15:38alyssa has joined #asahi-gpu
15:40linaI'm still not sure if the firmware stuff is really 100% robust yet, we'll find out when I turn on timestamps again since that made it really obvious in the past.
15:41linaAlso perf works again. It was an upstream regression (on all ARM!), jannau found it while I was busy with mesa ^^
15:44linaAny ideas on how to land this? Most of the changes are in general code, but then end up talking to syncobjs of course. At this point we probably want to drop macOS first?
15:47linaalyssa: I also did some perf opt on the kernel side, there was some easy low-hanging CPU fruit with array initialization that gave me an extra 10% or so on glmark (for 4000+ FPS workloads, won't do as much for things that are more GPU-limited)
15:48linaAt this point I think the next biggest submission overhead thing is just memory allocs, so I probably want to add some general mechanism to pool together random unrelated allocs for a single submission. But that can probably wait a bit.
15:49linaI couldn't figure out how to get real-time traces, so I don't know how much of the overhead is context switching, mailbox stuff, etc.
15:55bluetail9 has joined #asahi-gpu
15:55mkurz has joined #asahi-gpu
15:56alyssa3. Rebase my agx/next upstream. It now consists of Linux UAPI patches + some feature work that's not yet ready. I drop the feature work and push an agx/linux branch.
15:56alyssa4. You rebase explicit sync on top of agx/linux and squash everything down to a new agx/linux-explicit-sync branch, that is just the new UAPI and not the old.
15:57bluetail91 has joined #asahi-gpu
15:57alyssaOnly question then is whether any of the code from agx/linux-explicit-sync is *not* specific to the UAPI (and should be upstreamed ahead of the new UAPI)
15:57alyssaOnly question then is whether any of the code from agx/linux-explicit-sync is *not* specific to the UAPI (and should be upstreamed ahead of the new UAPI)
15:57bluetail98 has joined #asahi-gpu
15:58alyssaDefinitely the memctx bug fix is, and should be split off into its own MR (this can happen ahead of the macOS stuff)
16:03thevar1able has joined #asahi-gpu
16:04bluetail9 has quit [Ping timeout: 480 seconds]
16:05bluetail91 has quit [Ping timeout: 480 seconds]
16:09linaMost of what I did today is not UAPI-specific, it's all the batch tracking stuff to make explicit sync work
16:12linaAny comments on the general approach? I just hacked on it until it worked, I want to know what you think about the submitted bitfield and all that
16:13linaAlso right now it doesn't try to track batch-to-batch dependencies so it always does a full barrier between batches (so no vert/frag concurrency). That can clearly be fixed but then we need to be more careful about when we need to insert the barrier and not.
16:22seeeath_ has joined #asahi-gpu
16:29seeeath has quit [Ping timeout: 480 seconds]
16:43kesslerd has joined #asahi-gpu
16:59seeeath_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
17:00linaAnother thing I added/fixed in this round is that GPU firmware crashes should actually cleanly abort all jobs (and mesa has an abort() in that path)
17:00alyssaI will hold off on debugging manhattan until you (or marcan) fixes this since it'll be too painful otherwise
17:01alyssayeah ok, gnome with two terminal windows open, tabbing between them quickly (meta+backtick) and you see sheered artefacts of the wrong terminal
17:02alyssaq17:01 < lina> KDE was glitchy as heck until I remembered that a gallium flush should be a full sync...
17:04linaWell KDE becomes a mess without it... so either kwin is broken or we're missing syncs in some other place...
17:06danielsin that case, if you're seeing horribly incomplete bits which suggest KWin's own rendering is broken (i.e. it's not due to stale client data but e.g. clients being intermingled), and you're confident that your internal batch-to-batch tracking is fine (or even oversyncing), it's probably missing synchronisation indeed
17:07danielsGallium flush only requires a hardware flush indeed, but there's a separate flush_frontbuffer which is your hook for eglSwapBuffers
17:07danielsthat would be the place at which you need to place a dma_fence for all batch completions on the dma_resv, then make sure the DCP driver respects that fence
17:08daniels(the other method is that KWin creates an EGLSyncKHR representing everything in that ctx being completed, exports that to a dma_fence, then places that as the IN_FENCE_FD on the plane during the KMS commit, but I don't think KWin does that, i.e. you need to rely on implicit sync for inter-device completion)
17:09danielsif it uses the drm_gem_shmem (IIRC) helper, then it'll wait on all fences before continuing
17:09jannaudcp does nothing explicitly, if the helpers do it correctly it should work otherwise it's broken
17:09danielsbut yeah, flush_frontbuffer is your place to update the dma_resv for implicit sync - it's the handover from your rendering to an external user, be it GBM or a Wayland server
17:10alyssaoh, ok. "active" means "unsubmitted and active", "submitted" means "submitted but not yet done". got it
17:11linaI just realized we're doing a CPU copy in there right now with no sync... I clearly glossed over it way too quickly today...
17:11danielsjannau: oh nice, looks like drm_atomic_helper_prepare_planes() even calls the default prepare_fb (i.e. wait on fences) for you, so if you're just using the stock atomic helpers then you shouldn't even need to set the prepare_fb func yourself
17:12alyssaI don't think we implement it on Panfrost, it's only in Asahi for the macOS "just pretend we're llvmpipe" code
17:13seeeath has joined #asahi-gpu
17:15linaI wasn't sure of what driver to look at, couldn't find a good reference for what has proper explicit sync...
17:17danielseglSwapBuffers -> dri2_wl_swap_buffers_with_damage -> dri2_flush_drawable_for_swapbuffers -> DRI2flushExt::flush_with_flags(__DRI2_FLUSH_DRAWABLE | __DRI2_THROTTLE_SWAPBUFFER) -> dri_flush -> st_context_flush(ST_FLUSH_END_OF_FRAME) -> st_context_flush(ST_FLUSH_END_OF_FRAME) -> st_flush(PIPE_FLUSH_END_OF_FRAME) -> pipe->flush(PIPE_FLUSH_END_OF_FRAME) -> your driver
17:18daniels(you can replace dri2_wl_swap_buffers_with_damage with dri2_drm_swap_buffers depending on context)
17:19linaagx_flush does do the fence right, but it also didn't work when I didn't also force a full sync so clearly something is broken...
17:20bisko has quit [Quit: Textual IRC Client: www.textualapp.com]
17:24danielslina: by 'do the fence right', do you mean that it'll update the excl slot in the dma_resv?
17:26linaThe function gets passed a pipe_fence_handle** and it replaces it with a new handle (that's from panfrost) which is a clone of the syncobj from the last batch flushed... is it supposed to do something different?
17:26* alyssaneeds to be eating lunch / doing homework / going to class / doing her day job right now so is going to pop off
17:26bisko has joined #asahi-gpu
17:28linaI should get some sleep... and other than the Rust meeting tomorrow night, I think I'm going to take a break until next week ^^
17:31danielslina: I mean down in the kernel driver - the agx DRM driver needs to know that it needs to update the dma_resv struct on the dma_buf struct with the fence, so then when the DCP goes to source from that dma_buf, it knows to wait first
17:31danielsthe old-school way to do that is to just put a flag on your CS ioctl that you should update the dma_resv (specifying either shared for read-only ops or excl for write/RW) with the fence generated by that CS
17:32danielsthe new-school way to do that is that gfxstrand has some helpers for Vulkan WSI which do that automatically (by using a separate dmabuf ioctl which shoves the fence into the resv without the need for the agx CS to do it), but how they're hooked up in Vulkan I don't know, and WSI is also not Gallium :P
17:34linaI think the plan was the new-school way, the kernel driver only knows about out syncobjs (which it replaces the fence on)
17:44kesslerd has quit [Quit: Leaving]
18:21lawrence has quit [Quit: The Lounge - https://thelounge.chat]
18:23lawrence has joined #asahi-gpu
18:41MajorBiscuit has quit [Quit: WeeChat 3.6]
18:59cylm_ has joined #asahi-gpu
19:01cylm has quit [Ping timeout: 480 seconds]
19:16possiblemeatball has quit [Quit: Quit]
19:16possiblemeatball has joined #asahi-gpu
19:17c10l9 has quit []
19:17c10l has joined #asahi-gpu
20:08possiblemeatball has quit [Quit: Quit]
22:58seeeath has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]