#
✕ nick:daniels
#asahi-gpu · 2023-03-14 12:05
danielsit's also painful for some systems - particularly etnaviv on i.MX6 - where you need a resolve step in between GPU & KMS. eglSwapBuffers gives that barrier point where you can do the copy to the shadow, but you don't have that with FBOs.
#asahi-gpu · 2023-02-15 17:32
danielsthe 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
#asahi-gpu · 2023-02-15 17:31
danielsthe 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
#asahi-gpu · 2023-02-15 17:31
danielslina: 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
#asahi-gpu · 2023-02-15 17:24
danielslina: by 'do the fence right', do you mean that it'll update the excl slot in the dma_resv?
#asahi-gpu · 2023-02-15 17:18
daniels(you can replace dri2_wl_swap_buffers_with_damage with dri2_drm_swap_buffers depending on context)
#asahi-gpu · 2023-02-15 17:17
danielseglSwapBuffers -> 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
#asahi-gpu · 2023-02-15 17:11
danielsjannau: 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
#asahi-gpu · 2023-02-15 17:09
danielsbut 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
#asahi-gpu · 2023-02-15 17:09
danielsif it uses the drm_gem_shmem (IIRC) helper, then it'll wait on all fences before continuing
#asahi-gpu · 2023-02-15 17:09
danielsthe easiest way to find out is to grep it for prepare_fb
#asahi-gpu · 2023-02-15 17:08
danielsheh
#asahi-gpu · 2023-02-15 17:08
daniels(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)
#asahi-gpu · 2023-02-15 17:07
danielsthat 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
#asahi-gpu · 2023-02-15 17:07
danielsGallium flush only requires a hardware flush indeed, but there's a separate flush_frontbuffer which is your hook for eglSwapBuffers
#asahi-gpu · 2023-02-15 17:06
danielsin 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
#asahi-gpu · 2023-02-15 17:06
danielsgood answer :)
#asahi-gpu · 2023-02-15 17:05
danielslina: is this KWin as a Wayland compositor (backing on to GBM) or as an Xorg WM?
#asahi-gpu · 2023-02-15 12:20
danielsthe latter is good anyway if you don't want your running session to get trashed
#asahi-gpu · 2023-02-15 12:19
danielstry either skipping that subset of tests, or EGL_PLATFORM=surfaceless
#asahi-gpu · 2023-02-15 12:18
danielsah yes
#asahi-gpu · 2023-02-15 11:58
danielslina: which winsys?
#asahi-gpu · 2023-01-25 10:20
danielslina: np, it's weird and subtle :) you can talk about the number of tests in the CTS we pass, just not describe it as 'being conformant' until we've got a conformance submission accepted by Khronos
#asahi-gpu · 2023-01-24 21:30
danielsalyssa: we used to have ‘implements the OpenGL API’ for that, but they’re much more relaxed on that these days, particularly if there’s real effort to get it there
#asahi-gpu · 2023-01-04 16:05
danielssingle-planar also works fine with wl_shm, you just don’t get to choose your chroma offset or stride
#asahi-gpu · 2022-12-06 15:40
danielsI would 100% suspect KWin fractional scaling issues until proven otherwise
#asahi-gpu · 2022-11-30 09:30
danielshuh, is FOSDEM hybrid these days?
#asahi-gpu · 2022-10-27 00:14
danielsalyssa: yeah, weston
#asahi-gpu · 2022-10-04 03:12
danielsDcow[m]: it’ll take some time, but lina is forging the path :)
#asahi-gpu · 2022-10-02 12:26
danielsalyssa: it’s actually less uncommon than you might think - or was at least
#asahi-gpu · 2022-10-02 12:17
danielskarolherbst: mutter used to do window picking by rendering with solid colours and reading back, but not for a while now
#asahi-gpu · 2022-10-02 12:12
danielsgdm is Wayland-native
#asahi-gpu · 2022-09-08 13:24
danielsT&L obviously got replaced with programmable shading units
#asahi-gpu · 2022-09-08 13:24
danielsskmp__: TA is still there and semi-ganged with 3D from a job submission PoV, but anything to do with I/O got massively refactored with VDM/PDM/PDS/etc/etc/etc
#asahi-gpu · 2022-09-08 13:23
danielsthe very earliest ones shipped with MBX, but yeah, SGX and RGX look similar enough at the ultra low-level
#asahi-gpu · 2022-09-08 13:22
danielsthough RGX and SGX certainly share more than MBX and SGX
#asahi-gpu · 2022-09-08 13:22
danielslina: *direct descendant of RGX
#asahi-gpu · 2022-08-18 21:55
danielsleidenfrost[m]: ‘do they’ if you want to be really pedantic, but yes ‘they’ is correct in this case :)
#asahi-gpu · 2022-08-16 15:39
danielslina: yep :)
#asahi-gpu · 2022-08-16 15:39
danielsmort_: GLES also has compute shaders
#asahi-gpu · 2022-08-16 15:33
danielslina: yeah, they still go through the 3D queue iirc
#asahi-gpu · 2022-08-16 15:17
danielslina: (ah sorry, I didn't spot the subtlety of compute vs. CL - core compute support is there, it's just not hooked up to Clover because Clover ... rusticl ftw!)
#asahi-gpu · 2022-08-16 15:16
danielsChainfire: Metal on Linux isn't a thing
#asahi-gpu · 2022-08-16 15:13
danielslina: Panfrost does have compute
#asahi-gpu · 2022-06-01 13:16
danielsexciting!
#asahi-gpu · 2022-05-27 17:49
danielsheh yeah, you want Vetter to be helping you paint your bikeshed :)
#asahi-gpu · 2022-05-26 14:54
daniels^ most common approach
#asahi-gpu · 2022-05-20 14:37
danielsrowang077[m]: eventually, yeah :)
#asahi-gpu · 2022-02-10 15:47
danielsIIRC IMG is PR(imitive) -> TA -> 3D
#asahi-gpu · 2022-02-10 15:39
danielsyeah, that sounds about right

plus ›