00:00Venemo: Lynne: awesome, thank you for helping me through all this
00:01Lynne: sure, thanks for looking into it
00:01Venemo: of course
00:38karolherbst: anybody any actual good idea on why this use-after-free can triger? https://gist.githubusercontent.com/karolherbst/6c49f0ef258983ff46e8c91b48e2f7bb/raw/b0faa94ea32508dcea53c217aa1470c8345d8fbe/gistfile1.txt
00:38karolherbst: *trigger
00:38karolherbst: loc info on top of 2f205caea484e3882a209d4262f2f1ce1e0734a8
10:11kode54: Lucky me, I found a regression in amdgpu going from 6.7 rc4 to rc5
10:55kode54: false alarm, patch from my kernel package, not rc5
15:32Company: so, I want to test my dmabuf reading code
15:32Company: for that, I need some reference images/data blobs/whatever, so I can confirm my implementation is actually correct
15:32Company: is there a way to get those?
15:35Company: just so I can make sure I didn't accidentally swap DRM_FORMAT_XRGB2101010 and DRM_FORMAT_RGBX1010102 and things like that
15:38dj-death: afaik it's completely opaque
15:40Company: not for the linear variant
15:40Company: drm_fourcc.h even tries to document it
15:41Company: I could go by those docs, but I'd like to have some external verification
15:43Company: I also kinda need that if I want to make sure I write the right code in Vulkan
15:45dj-death: must have misunderstood your question then
15:45dj-death: I thought you were asking if the dmabuf carries some metadata but its content
15:46Company: no
15:46dj-death: you want to mmap the dmabuf and do memcmp on it?
15:47pq: Company, vivid? Kernel V4L2 test driver.
15:47Company: pq: that doesn't have all the formats - and it's V4L2's idea of dmabuf formats, which doesn't cover drm_fourcc.h
15:48pq: right
15:48Company: they have their own fourccs (dmabufs rock!)
15:49pq: Nothing comes to mind. :-/
15:49pq: IGT theoretically maybe?
15:49Company: I mean, I can just implement something and then wait for someone to file bugs, but that seems like a suboptimal solution
15:51pq: That's what I've intended to do with Weston testing and so far never got to it yet.
15:51Company:has recently been annoyed by dmabuf vs Vulkan vs GL vs GLES all having different descriptions for the same and slightly different formats
15:51Company: so I'm not centralizing the code in GTK that handles those
15:52Company: and originally I thought I'm just gonna be a genius and write perfect bugfree code, but then it turned out I might not be able to do that
15:52Company: so now I'm looking for tests
15:53gfxstrand: Few of us can...
16:01dj-death: Company: I just found an interesting kind of related drm modifier issue
16:01dj-death: one more!!
16:02Company: I don't even care about modifiers yet
16:02Company: I only know about LINEAR, INVALID, and everything else
16:02Company: which goes as DONT_TOUCH
16:04alyssa: i go to gfxstrand for all my perfect bugfree code needs
16:05DemiMarie: Can nonlinear modifiers be interconverted via a shader?
16:07dj-death: DemiMarie: interconverted?
16:08Company: DemiMarie: modifiers are about memory layout, which may involve allocating in a specific region of GPU memory, or just tiling/aligning memory - it's a free for all
16:08Company: so some of them could probably be conferted with shaders, but I'd go with DONT_TOUCH unless you're driver code
16:09emersion: pq: tentative has a helper script for this
16:09emersion: er
16:09emersion: Company: ^
16:09Company: tentative?
16:10emersion: https://git.sr.ht/~emersion/tentative/tree/master/item/contrib/drm-convert
16:11Company: it has the 8 formats that I already have working
16:12emersion: lol
16:15emersion: might be able to use pixfmtdb for this but will require some work
16:17sima: Company, to add to your fun you also need to test dma-bufs that need the DMA_BUF_SYNC_START/END ioctls
16:17sima: and/or implicit fence handling (which the above does for you too)
16:17mattst88: dcbaker: what happened with mesa-23.2 stable releases?
16:18sima: on top of the format stuff
16:18sima: I guess a little debugfs node that you can pass buffer metadata and it gives you a dma-buf fd back would be neat for this ...
16:18Company: sima: I just use that all the time, so I'm on the safe side there
16:18sima: for implicit sync igt uses vgem
16:18emersion: sima: isn't this vgem?
16:19emersion: or system dma-heap?
16:19Company: sima: currently I use Vulkan to create my dmabufs
16:19sima: emersion, only the implicit sync stuff I think
16:19sima: Company, yeah but that limits you to what that specific driver supports
16:19Company: no
16:19sima: unless you aim for lavapipe, which I think supports very little
16:19Company: I just stuff it in a VkBuffer
16:19emersion: I think system dma-heap would work
16:19Company: not even
16:20sima: Company, well but who generates the test data then to make sure it's not wrong the same way as your code?
16:20Company: vkAllocateMemory() + vkGetMemoryFdKHR()
16:20Company: sima: right - that requires something else anyway, because Mesa only knows the common formats - plus most of them aren't writable
16:20Company: like, NV12
16:21sima: emersion, on x86 at least vgem gives you wc, so no explicit flushing/invalidating needed
16:22emersion: oh
16:22Company: emersion, sima: speaking of lavapipe, we had a discussion recently about a future with software rendering (for cloud-based desktops etc), and supporting dmabufs on llvmpipe was something that seemed important
16:22sima: and yeah I guess adding some code to vgem to fill a buffer with a pattern for a specific format would be useful
16:22emersion: Company: should already work
16:22sima: we do kinda have the drm format lib already ...
16:23sima: DemiMarie, if you know what the modifier does exactly, you should be able to emulate it with a compute shader
16:23emersion: right
16:24Company: emersion: llvmpipe doesn't do dmabufs - at least not with EGL
17:48FL4SHK[m]: Let's say I've got a GCC backend for my GPU where the GPU specific operations (SIMD) are intrinsics in the GPU. Could a Mesa GPU driver use that GCC backend?
17:59agd5f: FL4SHK[m], mesa already uses LLVM GPU backends for shader compilation.
18:04dcbaker: mattst88: I happened to them... Let me see what state the branch is in and try to pull something together today
18:04mattst88: dcbaker: I don't need it or anything -- I was just curious
18:05mattst88: 23.3.1 was just released today, so I'm not sure there's much point in 23.2.x stable releases at this point
18:05dcbaker: Yeah, this was just a me issue
18:05dcbaker: :(
18:06FL4SHK[m]: <agd5f> "FL4SHK, mesa already uses LLVM..." <- I'm developing a new GPU and I find GCC easier to write backends for than LLVM.
18:06FL4SHK[m]: Is it possible to use GCC instead of LLVM?
18:06mattst88: dcbaker: don't worry about it -- you've had a ton of stuff going on
18:06agd5f: FL4SHK[m], sure in theory
18:06FL4SHK[m]: cool
18:06dcbaker: Yeah, I still shouldn't have just let if fall on the floor though
18:06FL4SHK[m]: I'll work towards that
18:15DemiMarie: FL4SHK: Honestly you would be better off writing a native Mesa backend. Mesa is moving away from LLVM because it causes quite a few problems.
18:16FL4SHK[m]: oh I see
18:16FL4SHK[m]: that's fine with me
18:17FL4SHK[m]: Out of curiosity, can you tell me what kind of problems exist?
18:25DemiMarie: https://www.gfxstrand.net/faith/blog/2022/01/in-defense-of-nir/ from gfxstrand
18:39FL4SHK[m]: cool
19:43alyssa: preemptive nak on new LLVM (or GCC or QBE or whatever) gpu backends in mesa
19:44alyssa: amd's grandfathered in but if it were proposed today it'd be a nak from me tbh
19:44alyssa: (and amd is moving towards aco anyway)
19:50airlied: a gcc backend for a gpu would be the most pointless place to start
19:51airlied: shows someone designing a cpu :-P
20:06FL4SHK[m]: it really depends on the design of the GPU
20:07FL4SHK[m]: if GPUs are a large number of scalar cores, then they're a kind of CPU anyway
20:07FL4SHK[m]: I know GPUs are arranged in SIMT configurations
20:07FL4SHK[m]: I intended on doing just that
20:51alyssa: if this is a hobby project only, do what you want & don't let anyone rain on your parade :>
20:51alyssa: but for in-tree mesa drivers... anything not-NIR in 2023 is a really hard sell for me
20:53HdkR: What about RISC-V GPU?
20:55mattst88: IMO, people in this channel spend way too much effort answering questions about speculative/impractical/unrealistic ideas
20:55kisak: if the hardware is GLES 3.1 era at least, there's a pretty big carrot to bootstrap Vulkan and get it healthy enough to run Zink to bring up both Vulkan and OpenGL at the same time.
21:03FL4SHK[m]: <alyssa> "but for in-tree mesa drivers..." <- I'm happy to make a NIR driver
21:08agd5f: I would argue that fixing any deficiencies in LLVM would be a better long term solution as compute and gfx start to converge more, otherwise, you end up writing two compilers which sucks
21:28DemiMarie: agd5f: The hardware is different and needs a different IR
21:29mattst88: DemiMarie: seriously? stop.
21:32airlied: agd5f: haven't people been trying that for 15 years now :)
21:32airlied: maybe fastisel will solve all my problems
21:33airlied: I think llvm is fundamentally at odds with being a compiler you'd want to use at runtime esp in gaming scenarios and efforts to change that are very difficult
21:34airlied: for compute and offline usecases it likely has a lot better advantages in abiltity to optimise
21:34airlied: but I don't think divergence is solved problem
21:40agd5f: perhaps, but I think a lot of it is NIH. Rather than fixing someone else's project, I'll just write a new one tailored to my specific use case.
21:47airlied: I think if I was designing a SIMD type thing I'd go LLVM, for SIMT I think NIR is definitely superior
22:36DemiMarie: mattst88: will do