#asahi-gpu · 2022-09-15 17:32
linaSo I don't think I should be trying to use real floats just for this, a little software implementation makes more sense if we need it...#asahi-gpu · 2022-09-15 17:32
linaBut this is just for initialization, it doesn't have to be fast, and it's just calculating constants so it doesn't have to be fully correct or handle all corner cases.#asahi-gpu · 2022-09-15 17:31
linaAnd I think that part of the code doesn't work properly on ARM... ^^#asahi-gpu · 2022-09-15 17:20
linaI think that would work, I just need to add it to the Rust helpers.c and export helpers for add/sub/mul/div, then I can expose it as a type in Rust with proper operators and everything.#asahi-gpu · 2022-09-15 17:19
linajannau: Ah, I didn't realize that existed as a stand-alone module like that!#asahi-gpu · 2022-09-15 16:55
linaIf I do end up needing to do math in the kernel, it's probably only going to be add/sub/mul/div, and if it comes down to that I can *probably* write some little integer-only implementations of that? It doesn't have to handle any corner cases so it doesn't have to be fully IEEE754 compliant.#asahi-gpu · 2022-09-15 16:50
linaThen the remaining issue is the places that might need math to compute something rather than pass it straight through, but I don't know how big that problem is right now, so we might be able to get away with just copying data from the DT unmodified.#asahi-gpu · 2022-09-15 16:49
linaBut we need some data to come from the DT, so we need to get float data in there in a way that the kernel can eventually turn it into a real float32 bit pattern, even if it doesn't call it that.#asahi-gpu · 2022-09-15 16:48
linaThe way the driver does it is all the non-DT float constants are specified as floats, but are converted to u32s at compile time, so there is no float code at runtime#asahi-gpu · 2022-09-15 16:48
linaIf we used strings then the kernel would need an integer-only string to float parser...#asahi-gpu · 2022-09-15 16:48
linarobher: The kernel can just treat them as u32s, but they are floats, and they need to be floats when we pass them to the GPU#asahi-gpu · 2022-09-15 13:54
linaIn that case though, it would be useful if dtc also supported operating on floats so we don't have to hardcode the result of the computations...#asahi-gpu · 2022-09-15 13:53
linaThe other issue is that of course the kernel can't actually operate on the floats, but it might need to in some cases. Though we might be able to just pre-compute any dependent values and put them in the DT, hopefully it's not that many.#asahi-gpu · 2022-09-15 13:53
linaOtherwise we'd have to specify them as raw hex which is not great...#asahi-gpu · 2022-09-15 13:52
linaI take it dtc does not support floats... would you be okay with adding that?#asahi-gpu · 2022-09-15 13:52
linarobher: I just noticed something... The GPU firmware takes in a bunch of power-related constants as floats, and some of those come from Apple's device tree. And they differ between different hardware platforms using the same SoC...#asahi-gpu · 2022-09-11 14:53
linaWhoops, sorry, that was unintentional ;;#asahi-gpu · 2022-09-11 14:53
linaPlus power management, which is probably very complicated (the firmware runs a lot of crazy estimation algorithms for that)#asahi-gpu · 2022-09-11 07:39
linaPlus power management, which is probably very complicated (the firmware runs a lot of crazy estimation algorithms for that)#asahi-gpu · 2022-09-11 07:39
linaAnd it probably saves power too, since doing those things on a dedicated coprocessor is probably a lot more efficient than waking up the main cores for them#asahi-gpu · 2022-09-11 07:38
linaThe firmware does a lot of things, like handle preemption, IRQs, and recovery, so it would be a lot of work to reverse engineer all that and implement it on the bare hardware#asahi-gpu · 2022-09-10 04:14
linaThe rest of it is the same as ARM page tables, it's just that they used yet another permission interpretation (just like SPRR...)#asahi-gpu · 2022-09-10 03:30
linaI looked at this recently but haven't updated the code yet...#asahi-gpu · 2022-09-10 03:30
linaIt doesn't actually work like that#asahi-gpu · 2022-09-10 03:30
linaThat was what phire wrote based on standard ARM permissions#asahi-gpu · 2022-09-10 03:29
linaThose are wrong ^^#asahi-gpu · 2022-09-10 03:17
linaNext stream I'll probably add permissions to the allocator stuff and fix the IOMMU side interpretation!#asahi-gpu · 2022-09-10 03:14
linaWith the bit off the firmware uses SPRR and the GPU has no access. With the bit on SPRR is ignored and a different set of permissions applies, for both firmware and the GPU (different ones)#asahi-gpu · 2022-09-10 03:14
linaI already have all the permissions mapped out ^^#asahi-gpu · 2022-09-10 03:14
linantrung03[m]: It's not SPRR bypass exactly, it changes the permission interpretation to a different one#asahi-gpu · 2022-09-08 13:35
linaI just like messing around ^^#asahi-gpu · 2022-09-08 13:34
linaAnd I like the loop! It keeps me concentrated!!!#asahi-gpu · 2022-09-08 13:33
linaWorking on the merch! So many things to do...#asahi-gpu · 2022-09-08 13:33
linaAlso https://rosenzweig.io/#asahi-gpu · 2022-09-08 13:32
linaShe's around here sometimes, and also @alyssarzg on Twitter#asahi-gpu · 2022-09-08 13:32
linaYeah, then maybe talk to alyssa ^^#asahi-gpu · 2022-09-08 13:31
linaMaybe it makes more sense to emulate the actual rendering side? alyssa would know if that's useful for her#asahi-gpu · 2022-09-08 13:31
linaHmm... I mean, most of the work that's left is just porting over my prototype driver to the real kernel on the kernel side. You could definitely emulate the firmware (it's just AArch64) if you wanted to LLE that, but I already get nice crash dumps out of it and there is tons of tracing so I'm not sure we'd get much more out of it?#asahi-gpu · 2022-09-08 13:29
linaAs evidenced by how Apple themselves mix together TA/VDM and 3D/PDM...#asahi-gpu · 2022-09-08 13:29
linaOf course it makes sense, but then it's not just the tiling part, and from a software perspective it's not good naming#asahi-gpu · 2022-09-08 13:29
linaI know#asahi-gpu · 2022-09-08 13:28
linaThat might have made sense before programmable shaders but now... it's just vertex attributes...#asahi-gpu · 2022-09-08 13:28
linaLike TA is actually running the vertex programs, and 3D the pixel programs but as an identifier it's horrible because it starts with a number#asahi-gpu · 2022-09-08 13:27
linaImgtec naming is... kind of terrible...#asahi-gpu · 2022-09-08 13:27
linaI might go with their public name#asahi-gpu · 2022-09-08 13:27
linaWhich is a terrible name, Apple calls it the Tiled Vertex Buffer in the one public mention they have of its existence, which is a much better name#asahi-gpu · 2022-09-08 13:26
linaThere is a "parameter buffer", yes#asahi-gpu · 2022-09-08 13:25
linaBut there is special purpose hardware around it#asahi-gpu · 2022-09-08 13:25
linaIt's just tile memory on one end and RAM on spills (or if the user wants a real Z buffer)#asahi-gpu · 2022-09-08 13:25
linaWell, internal as in special-cased