#asahi-gpu · 2022-06-20 09:43
svenand then we're back to the atcphy mess :<#asahi-gpu · 2022-06-20 09:43
_jannau_exporting each dcp/dcpext as separate kms device would be to annoying to do#asahi-gpu · 2022-06-20 09:42
_jannau_2. requires adding support usb-c display out since we need to figure out how to support multiple displays#asahi-gpu · 2022-06-20 09:40
_jannau_I have a working driver for the main display out. main issues to be solved before upstreaming are: 1. support for firmware allocated iommu mappings, 2. dt-bindings for the display out#asahi-gpu · 2022-06-20 09:33
zx2c4good to hear that's closer#asahi-gpu · 2022-06-20 09:33
zx2c4lina: oh, yea, i had in mind just the actual drm part, sans 3D, which indeed is tons of work. so i guess just the kms part#asahi-gpu · 2022-06-20 09:31
linaThat yes#asahi-gpu · 2022-06-20 09:30
_jannau_the dcp (kms driver) is hopefully less far out, certainly for our fork#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:27
zx2c4anyway, i suppose this means we're in simpledrm world for quite some time longer#asahi-gpu · 2022-06-20 09:27
zx2c4well, technically you could do that and intend to rely on gobs of out of tree stuff from the rust-on-linux people#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:26
zx2c4but yea, sure, i guess when you sit down to write it you'll see what the state is#asahi-gpu · 2022-06-20 09:26
zx2c4i would be entirely unsurprised if in a year from now, it's merged. actually, i'd be totally surprised if it were merged in a year from now.#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:25
zx2c4and very likely much better off for the foreseeable future too#asahi-gpu · 2022-06-20 09:24
zx2c4it's probably reasonable to do *userspace* stuff in rust -- whatever helper code you have there, mesa, shader compilers, etc. but the dm driver itself? much better off in C at this point in time#asahi-gpu · 2022-06-20 09:23
_jannau_in the worst case we could add version specific Call/Callback tables and hope that the driver logic stays mostly the same#asahi-gpu · 2022-06-20 09:22
zx2c4rust people are hopeful. jury is still very much out wrt kernel people#asahi-gpu · 2022-06-20 09:22
zx2c4it's still not clear that that stuff will ever get merged#asahi-gpu · 2022-06-20 09:22
zx2c4lina: i highly recommend _not_ writing the kernel driver in rust at this point in time#asahi-gpu · 2022-06-20 09:22
linaYes...#asahi-gpu · 2022-06-20 09:21
_jannau_DCP is already pretty hairy to begin with, ignoring multiple supported versions#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:47
chadmedi mean rusty drm will get there eventually and nothings stopping us from porting the driver to rust once that happens#asahi-gpu · 2022-06-20 08:45
tophevich[m]you'd have to be a bigger part of the effort than you most likely want to be#asahi-gpu · 2022-06-20 08:45
chadmedwhich means we either have to port DRM *sanely* to Rust or wait for someone else to do it and lose the first mover trophy :P #asahi-gpu · 2022-06-20 08:44
chadmedwell we want to get this upstreamed so spinning out a bespoke interface that no one else will ever use would preclude that immediately#asahi-gpu · 2022-06-20 08:44
tophevich[m]without anything using the bindings, they would be stale from the get-go, no?#asahi-gpu · 2022-06-20 08:44
chadmedyeah thats what i thought the state of play was like#asahi-gpu · 2022-06-20 08:43
_jannau_it brings a few bindings but no drm, see https://rust-for-linux.github.io/docs/kernel/#asahi-gpu · 2022-06-20 08:39
chadmedim thinking it would be an enormous flex and achievement to have the first proper rust driver in the kernel, but the burden of having to bring DRM to Rust would be enormous#asahi-gpu · 2022-06-20 08:39
chadmedwhen rust support drops into mainline, does it come with rust bindings for all the kernel interfaces or is that something that's up to early adopters to port/implement? #asahi-gpu · 2022-06-20 08:22
tophevich[m]I also have a feeling that it being cursed and all might have some blessings in disguise, some edge-cases you might find out now that maybe with a driver on hardware might not show up so pronounced and obvious. (There is obviously a flip-side but, hey looking at the bright side here :D)#asahi-gpu · 2022-06-20 08:17
tophevich[m]From what I've seen, I'd wholeheartedly say go for it, it will also help you for next hardware, and the one after that#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:08
tophevich[m]yea, and it shows that python is really a good tool for the job, does really give you quite a leg up on doing those kind of things#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!