#asahi-gpu · 2022-06-20 14:02
linaYou've seen the Python driver, the design has a lot of very object-oriented concepts going on at the firmware ABI level. It could a better fit for rust, especially managing the lifecycle of all those things...#asahi-gpu · 2022-06-20 14:01
linaI care about the driver working properly, and if Rust helps us get there faster and with fewer bugs...#asahi-gpu · 2022-06-20 14:00
linaAssuming Rust support makes it in before we start#asahi-gpu · 2022-06-20 14:00
linaIt doesn't have to all be Rust or even have bindings... we don't know how much it makes sense to write in Rust yet#asahi-gpu · 2022-06-20 09:31
linaThat yes#asahi-gpu · 2022-06-20 09:30
linaThe UABI is also a problem, that's going to be unstable for months which means it cannot be upstreamed, and the more we nail that down with Python prototypes the better.#asahi-gpu · 2022-06-20 09:30
linaI'd rather work on that in Python first.#asahi-gpu · 2022-06-20 09:30
linaBut really, I could start cranking out a badly designed C driver tomorrow... it'd even render stuff, but it would need a ton of work going forward.#asahi-gpu · 2022-06-20 09:29
linaWe'll see :)#asahi-gpu · 2022-06-20 09:26
linaI'm obviously not going to start writing a driver in a language that isn't actually supported at that time...#asahi-gpu · 2022-06-20 09:25
linazx2c4: I'm not going to be starting on the driver until months from now most likely, by which point it should be merged if it will be#asahi-gpu · 2022-06-20 09:22
linaYes...#asahi-gpu · 2022-06-20 09:20
linaI'm particularly interested in API compatibility breaks. I wonder what M2 did there. Rust should make it a lot easier to write generic code that can be specialized for different firmware ABIs, with C that gets pretty hairy (see: DCP)#asahi-gpu · 2022-06-20 09:19
linaBut I think there's also no real reason not to use Rust to some extent if it ends up helping out with the driver#asahi-gpu · 2022-06-20 09:19
linaNothing stops us from moving more of it to Rust over time, of course#asahi-gpu · 2022-06-20 09:17
linaMy current thinking is that if Rust lands, it might be a good reason to write *part* of the driver in Rust (e.g. the GPU structure management bits), even if the core driver that uses DRM APIs is written in C#asahi-gpu · 2022-06-20 09:17
linaI plan to spend some time looking at DRM drivers to figure out what the best plan is#asahi-gpu · 2022-06-20 09:17
lina3D, maybe not quite as bad?#asahi-gpu · 2022-06-20 09:16
linaKMS has a huge helper API surface, which would be very hairy to bind to Rust#asahi-gpu · 2022-06-20 09:16
linachadmed: It's worth noting that DRM is two things, KMS and 3D#asahi-gpu · 2022-06-20 08:10
linaBut it's so much faster to prototype in than C... I'd much rather write almost the entire kernel driver in Python, make sure I understand it and the achitecture is solid... and then just convert to C(/Rust?) once. It's a lot easier to rewrite something you already understand.#asahi-gpu · 2022-06-20 08:08
linaYeah, everyone always looks at m1n1 funny when they first hear about it... drivers in Python, what?!#asahi-gpu · 2022-06-20 08:07
lina(That grep thing is probably a perl one liner, to be honest...)#asahi-gpu · 2022-06-20 08:04
linaAlso credit goes to phire for the initial "make Constructs proper classes/objects" idea, that really worked out nicely!#asahi-gpu · 2022-06-20 08:02
linaNow I just need a version of grep that ignores ANSI color sequences... wonder if anyone has written that yet or I should#asahi-gpu · 2022-06-20 08:02
linaAhaha, thanks! I keep telling people that investing in tooling up front always pays off! ^^#asahi-gpu · 2022-06-20 07:56
linaFor now I plan on doing that silly tight memory-polling trick to watch structures update during a render, and hopefully get a better picture of what happens.#asahi-gpu · 2022-06-20 07:56
linatophevich[m]: I still have very little idea how to do lifecycle management properly, concurrency, barriers, all that... so if any of what I wrote so far rings any bells from the point of view of other GPUs please do tell! ^^#asahi-gpu · 2022-06-20 07:54
linaBut the version I pushed after that does have a lot of global s/// to make some names more reasonable, so now I can wrap up the wiki docs#asahi-gpu · 2022-06-20 07:53
lina(What actually happened is I was working on it on a laptop away from home and I didn't have my worktree with the latest field names... oops.)#asahi-gpu · 2022-06-20 07:53
linaThanks! Still not quite there yet... I need to finish writing the 3D command walkthrough#asahi-gpu · 2022-06-20 07:47
linaUp to you userspace people, whenever anyone starts looking at the blit commands at the IOGPU layer I'll be happy to help work out the kernel side ^^#asahi-gpu · 2022-06-20 07:46
linaI figure working out the blit commands won't be too much work, but it's probably still worth pushing for common code that can do it using the 3D pipeline?#asahi-gpu · 2022-06-20 07:44
linaOh, alyssa left :<#asahi-gpu · 2022-06-20 07:44
linaBut it probably maps pretty closely to that Metal thing#asahi-gpu · 2022-06-20 07:43
linaAnd I've seen blit commands somewhere I think, though I haven't started reverse engineering them#asahi-gpu · 2022-06-20 07:43
linaalyssa/Ella[m]: The blit stuff is documented in Metal, e.g. https://developer.apple.com/documentation/metal/textures/generating_mipmap_data#asahi-gpu · 2022-06-17 16:21
linaIt worked!!! (*^▽^*)#asahi-gpu · 2022-06-17 06:18
linaAnd I figured out the remaining corner cases for <64 size textures and things like that#asahi-gpu · 2022-06-17 06:17
linadougall figured out the weird padding thing!#asahi-gpu · 2022-06-10 05:49
linaI'm assuming that's the /dev/null renderer score ^^#asahi-gpu · 2022-06-09 06:27
linaThe buffer manager has to be in the kernel since that data structure is in kernel address space, but I was thinking the actual management should be done from userspace (making the decisions and donating pages of memory)#asahi-gpu · 2022-06-09 05:58
linaI didn't see anything that looked like a special event#asahi-gpu · 2022-06-09 05:58
linaI was just talking with alyssa earlier about whether we should do it in the kernel or userspace (both are ugly in their own way...).#asahi-gpu · 2022-06-09 05:57
linaI'm not sure how it decides to do it yet; it's not reading the obvious "number of partial draws" counters, but there's probably some other field elsewhere that tells it what it needs to know.#asahi-gpu · 2022-06-09 05:57
linaIt can add pages to the buffer manager and trigger a reconfigure#asahi-gpu · 2022-06-09 05:57
linaphire: The kernel handles that, I already looked at it in the last stream#asahi-gpu · 2022-06-08 18:10
linaSobek[m]: She wrote the software I'm using, so she probably has a backdoor...#asahi-gpu · 2022-06-05 11:12
lina1tri won't work since it hardcodes t8103-specific data in lots of places right now. Lots of power management / hardware related constants change for each SoC.