#
…

2022-06-20

00:30yrlf has joined #asahi-gpu
00:41CME has joined #asahi-gpu
01:04spoogspoog[m] has joined #asahi-gpu
01:47bigtuna94[m] has joined #asahi-gpu
02:29PhilippvK has joined #asahi-gpu
06:32MajorBiscuit has joined #asahi-gpu
06:54MajorBiscuit has quit [Ping timeout: 480 seconds]
07:24MajorBiscuit has joined #asahi-gpu
07:43linaalyssa/Ella[m]: The blit stuff is documented in Metal, e.g. https://developer.apple.com/documentation/metal/textures/generating_mipmap_data
07:43linaAnd I've seen blit commands somewhere I think, though I haven't started reverse engineering them
07:44linaBut it probably maps pretty closely to that Metal thing
07:44linaOh, alyssa left :<
07:46Ella[m]lina: oh thanks, had a quick look at mvk and it uses this :)
07:46linaI 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?
07:47linaUp 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 ^^
07:51tophevich[m]line: nice job on the python driver cleanup and wiki documentation on it
07:53linaThanks! Still not quite there yet... I need to finish writing the 3D command walkthrough
07:53lina(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.)
07:54linaBut 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
07:54MajorBiscuit has quit [Ping timeout: 480 seconds]
07:56linatophevich[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! ^^
07:56linaFor 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.
07:57MajorBiscuit has joined #asahi-gpu
08:01tophevich[m]It worked well so far :) Also I love how your logging turned out, such a nice job on coloring, naming, indenting/spacing of those. Puts many a debugger to shame :D
08:02linaAhaha, thanks! I keep telling people that investing in tooling up front always pays off! ^^
08:02linaNow I just need a version of grep that ignores ANSI color sequences... wonder if anyone has written that yet or I should
08:04linaAlso credit goes to phire for the initial "make Constructs proper classes/objects" idea, that really worked out nicely!
08:07lina(That grep thing is probably a perl one liner, to be honest...)
08:08tophevich[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
08:08linaYeah, everyone always looks at m1n1 funny when they first hear about it... drivers in Python, what?!
08:09MajorBiscuit has quit [Ping timeout: 480 seconds]
08:10linaBut 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.
08:17tophevich[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
08:21MajorBiscuit has joined #asahi-gpu
08:22tophevich[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)
08:39chadmedwhen 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?
08:39chadmedim 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
08:43_jannau_it brings a few bindings but no drm, see https://rust-for-linux.github.io/docs/kernel/
08:44MajorBiscuit has quit [Ping timeout: 480 seconds]
08:44chadmedyeah thats what i thought the state of play was like
08:44tophevich[m]without anything using the bindings, they would be stale from the get-go, no?
08:44chadmedwell we want to get this upstreamed so spinning out a bespoke interface that no one else will ever use would preclude that immediately
08:45chadmedwhich 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
08:45tophevich[m]you'd have to be a bigger part of the effort than you most likely want to be
08:46MajorBiscuit has joined #asahi-gpu
08:47chadmedi mean rusty drm will get there eventually and nothings stopping us from porting the driver to rust once that happens
08:55MajorBiscuit has quit [Ping timeout: 480 seconds]
08:58MajorBiscuit has joined #asahi-gpu
09:13MajorBiscuit has quit [Ping timeout: 480 seconds]
09:16linachadmed: It's worth noting that DRM is two things, KMS and 3D
09:16linaKMS has a huge helper API surface, which would be very hairy to bind to Rust
09:17lina3D, maybe not quite as bad?
09:17MajorBiscuit has joined #asahi-gpu
09:17linaI plan to spend some time looking at DRM drivers to figure out what the best plan is
09:17linaMy 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
09:19linaNothing stops us from moving more of it to Rust over time, of course
09:19linaBut I think there's also no real reason not to use Rust to some extent if it ends up helping out with the driver
09:20linaI'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)
09:21_jannau_DCP is already pretty hairy to begin with, ignoring multiple supported versions
09:22linaYes...
09:22zx2c4lina: i highly recommend _not_ writing the kernel driver in rust at this point in time
09:22zx2c4it's still not clear that that stuff will ever get merged
09:22zx2c4rust people are hopeful. jury is still very much out wrt kernel people
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
09:24zx2c4it'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
09:25zx2c4and very likely much better off for the foreseeable future too
09:25linazx2c4: 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
09:26zx2c4i 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.
09:26zx2c4but yea, sure, i guess when you sit down to write it you'll see what the state is
09:26linaI'm obviously not going to start writing a driver in a language that isn't actually supported at that time...
09:27zx2c4well, technically you could do that and intend to rely on gobs of out of tree stuff from the rust-on-linux people
09:27zx2c4anyway, i suppose this means we're in simpledrm world for quite some time longer
09:29linaWe'll see :)
09:30linaBut 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.
09:30linaI'd rather work on that in Python first.
09:30linaThe 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.
09:30_jannau_the dcp (kms driver) is hopefully less far out, certainly for our fork
09:31linaThat yes
09:33zx2c4lina: 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
09:33zx2c4good to hear that's closer
09:39MajorBiscuit has quit [Ping timeout: 480 seconds]
09:40MajorBiscuit has joined #asahi-gpu
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
09:42_jannau_2. requires adding support usb-c display out since we need to figure out how to support multiple displays
09:43_jannau_exporting each dcp/dcpext as separate kms device would be to annoying to do
09:43svenand then we're back to the atcphy mess :<
09:46_jannau_so the solution will be to hanle each dcp as crtc but I'm unsure if the drm helpers can easily deal with crtc with separate IOMMUs
09:55MajorBiscuit has quit [Ping timeout: 480 seconds]
10:06MajorBiscuit has joined #asahi-gpu
10:36MajorBiscuit has quit [Ping timeout: 480 seconds]
10:51nehsou^ has joined #asahi-gpu
11:17nehsou^ has quit [Ping timeout: 480 seconds]
11:27MajorBiscuit has joined #asahi-gpu
12:37nehsou^ has joined #asahi-gpu
13:01nehsou^ has quit [Ping timeout: 480 seconds]
13:15intoxx[m] has joined #asahi-gpu
13:28MajorBiscuit has quit [Quit: WeeChat 3.5]
13:28MajorBiscuit has joined #asahi-gpu
13:43nehsou^ has joined #asahi-gpu
13:58alyssa has joined #asahi-gpu
13:59alyssa-1 on being the first rust drm driver in the kernel
13:59alyssathat's not a trophy we want. we do want the "it works at all" trophy.
13:59alyssawe're a community backed reverse-engineered driver. getting it working upstream at all is enough of a flex.
13:59alyssaand even for a 3D-only driver it'd be a pile of bindings work to do acceptably
14:00linaIt 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
14:00linaAssuming Rust support makes it in before we start
14:01alyssaI care more about getting stuff working upstream than making "neat" engineering decisions, IDK
14:01linaI care about the driver working properly, and if Rust helps us get there faster and with fewer bugs...
14:02linaYou'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...
14:02linaI'm not saying it's the right choice, but I'm saying I don't want to dismiss it from the get-go
14:03alyssaI guess so
14:03alyssathis is "old man [young girl] C programmer yells at cloud [newfangled language]" i admit :p
14:04alyssaOOP in C isn't that bad
14:04linaAnd besides, with the UABI to work out before it can go upstream, it's not like writing it in C would get us there quickly anyway... and all that time spent working out the UABI is also time to figure out Rust things (if, and only if, Rust support is already in by the time we start, of course)
14:05linaOOP C isn't that bad, but object lifetime management in C *is* bad.
14:05alyssaFinalizing the UABI doesn't block merging into asahilinux/linux and shipping to users ..
14:05linaThe kernel does a terrible job at that in all the exceptional cases, just try yanking a Thunderbolt cable and seeing how many different NULL derefs you manage to hit...
14:06linaIt doesn't, but nor does Rust if it's already upstream
14:06alyssa(Or more to the point, running userspace on bare metal Linux without drm-shim hacks)
14:06linaWe're definitely not going to gate the driver on hopes and dreams of Rust getting upstreamed, that's a hard dependency for taking that path.
14:08linaRealistically though, I'm going to be off a couple weeks next month, and there is still work to be done figuring out how this thing works before I'm comfortable starting to hack on a real driver, especially a C driver (C is definitely more painful to refactor than Rust)
14:09linaSo I would say mid august-september for a sensible timeline for actually starting to work on a real driver. And then, if I'm right about how I'm doing things, it should go very quickly since we'll understand this GPU enough.
14:09alyssaThat's fair
14:09chadmed_ has joined #asahi-gpu
14:09linaSo then it depends on what state Rust is in by then, and how I feel about it.
14:13chadmed_alyssa: "flex" might have been a slightly too loaded word :P
14:14chadmed_i didnt mean that we should any% a rust driver just for the sake of it/bragging rights, that would of course be ill advised
14:14_jannau_merge window for 5.19++ should be closed by end of july
14:15chadmed_it would merely be cool if things did line up fortuitously so as to allow a high quality, upstreamable driver to be written in rust
14:18linaI'd also be open to starting work in C and then starting to sneak Rust in once it goes upstream, if that isn't ready in time.
14:55os3 has joined #asahi-gpu
15:36nehsou^ has quit [Remote host closed the connection]
15:36nehsou^ has joined #asahi-gpu
15:39nehsou^ has quit [Remote host closed the connection]
15:41Gaspare has joined #asahi-gpu
15:52Gaspare has quit [Quit: Gaspare]
16:23alyssa has quit [Quit: leaving]
16:43Gaspare has joined #asahi-gpu
17:04zamadatix has joined #asahi-gpu
17:07zamadatix has left #asahi-gpu [#asahi-gpu]
17:07zamadatix has joined #asahi-gpu
17:07zamadatix is now known as zamadatix[m]
17:21MajorBiscuit has quit [Ping timeout: 480 seconds]
17:32zamadatix[m] has quit [Quit: issued !quit command]
17:34zamadatix[m] has joined #asahi-gpu
18:00chadmed_ has quit [Ping timeout: 480 seconds]
18:09chadmed_ has joined #asahi-gpu
18:18chadmed_ has quit [Ping timeout: 480 seconds]
18:23Gaspare has quit [Read error: Connection reset by peer]
18:27chadmed_ has joined #asahi-gpu
18:36chadmed_ has quit [Ping timeout: 480 seconds]
18:44Sobek[m]Isn’t rust in Linux getting merged in the next version ?
18:45chadmed_ has joined #asahi-gpu
18:47Sobek[m](I’ve read something suggesting that it is likely getting merged in 5.19 to be precise)
18:53chadmed_ has quit [Ping timeout: 480 seconds]
18:56dhromw^ has joined #asahi-gpu
19:03chadmed_ has joined #asahi-gpu
19:11chadmed_ has quit [Ping timeout: 480 seconds]
19:20chadmed_ has joined #asahi-gpu
19:28chadmed_ has quit [Ping timeout: 480 seconds]
19:36chadmed_ has joined #asahi-gpu
19:38MajorBiscuit has joined #asahi-gpu
19:44Raqbit9 has joined #asahi-gpu
19:45mort_2 has joined #asahi-gpu
19:45chadmed_ has quit [Ping timeout: 480 seconds]
19:45os has joined #asahi-gpu
19:45FLHerne_ has joined #asahi-gpu
19:45merry_ has joined #asahi-gpu
19:47gruetze_ has joined #asahi-gpu
19:47vup2 has joined #asahi-gpu
19:47akemin-dayo has joined #asahi-gpu
19:48kit_ty_kate2 has joined #asahi-gpu
19:48pg12 has joined #asahi-gpu
19:49Emantor has quit [reticulum.oftc.net liquid.oftc.net]
19:49PhilippvK has quit [reticulum.oftc.net liquid.oftc.net]
19:49CME has quit [reticulum.oftc.net liquid.oftc.net]
19:49lookitssky[m] has quit [reticulum.oftc.net liquid.oftc.net]
19:49os3 has quit [reticulum.oftc.net liquid.oftc.net]
19:49PthariensFlame[m] has quit [reticulum.oftc.net liquid.oftc.net]
19:49Raqbit9 is now known as Raqbit
19:49FLHerne_ is now known as FLHerne
19:53qdot has joined #asahi-gpu
19:53gtk2 has joined #asahi-gpu
19:54chadmed_ has joined #asahi-gpu
20:00CME has joined #asahi-gpu
20:00PhilippvK has joined #asahi-gpu
20:00Emantor has joined #asahi-gpu
20:00lookitssky[m] has joined #asahi-gpu
20:00dottedmag has joined #asahi-gpu
20:00ar has joined #asahi-gpu
20:00twoscomplement0b[m] has joined #asahi-gpu
20:00TellowKrinkle[m] has joined #asahi-gpu
20:00tophevich[m] has joined #asahi-gpu
20:00ExeciN[m] has joined #asahi-gpu
20:00nilsi[m] has joined #asahi-gpu
20:00IbrahimMAkrab[m] has joined #asahi-gpu
20:00long[m] has joined #asahi-gpu
20:00SuchirMishra[m] has joined #asahi-gpu
20:00willow[m]1 has joined #asahi-gpu
20:00bpalmer4[m] has joined #asahi-gpu
20:00fridtjof[m] has joined #asahi-gpu
20:00user1tt[m] has joined #asahi-gpu
20:00nik875[m] has joined #asahi-gpu
20:00metalgeardaner[m] has joined #asahi-gpu
20:00konr-72[m] has joined #asahi-gpu
20:00DanielHuisman[m] has joined #asahi-gpu
20:00tt022[m] has joined #asahi-gpu
20:00brstream[m] has joined #asahi-gpu
20:00CristianMgheruan-Stanciu[m] has joined #asahi-gpu
20:00silverocean[m] has joined #asahi-gpu
20:00solv[m]1 has joined #asahi-gpu
20:00eccli[m] has joined #asahi-gpu
20:00M7ooooo[m] has joined #asahi-gpu
20:00asie has joined #asahi-gpu
20:00MarcinPajkowski[m] has joined #asahi-gpu
20:00ognju[m] has joined #asahi-gpu
20:00tmosey[m] has joined #asahi-gpu
20:00Nilsson[m] has joined #asahi-gpu
20:00M0x8FFshulkk[m] has joined #asahi-gpu
20:00kedde[m] has joined #asahi-gpu
20:00shawnliu[m] has joined #asahi-gpu
20:00happy-dude[m] has joined #asahi-gpu
20:00orlofj[m] has joined #asahi-gpu
20:00luxio_39[m] has joined #asahi-gpu
20:00arnidg[m] has joined #asahi-gpu
20:00henje[m] has joined #asahi-gpu
20:00JasonAntwi-Appah[m] has joined #asahi-gpu
20:00YichaoYu[m] has joined #asahi-gpu
20:00photogrant[m] has joined #asahi-gpu
20:00dumistaken[m] has joined #asahi-gpu
20:00unsui[m] has joined #asahi-gpu
20:00swampertx[m] has joined #asahi-gpu
20:00plantaintion3[m] has joined #asahi-gpu
20:00EugeneChen[m] has joined #asahi-gpu
20:00badlydrawnface[m] has joined #asahi-gpu
20:00AdryzzOLEDEdition[m]1 has joined #asahi-gpu
20:00petermlyon[m] has joined #asahi-gpu
20:00PthariensFlame[m] has joined #asahi-gpu
20:00misteraftermath[m] has joined #asahi-gpu
20:00vivg[m] has joined #asahi-gpu
20:00Felix[m]1 has joined #asahi-gpu
20:00daelaam[m] has joined #asahi-gpu
20:00Fl1tzi[m] has joined #asahi-gpu
20:00Dcow[m] has joined #asahi-gpu
20:00Thib[m]1 has joined #asahi-gpu
20:00Augur[m] has joined #asahi-gpu
20:00Name[m] has joined #asahi-gpu
20:00alexanderwillner[m] has joined #asahi-gpu
20:00alexandruchi[m] has joined #asahi-gpu
20:00go4godvin has joined #asahi-gpu
20:00FilipJeretina[m] has joined #asahi-gpu
20:00aem64[m] has joined #asahi-gpu
20:00will[m] has joined #asahi-gpu
20:00meher1[m] has joined #asahi-gpu
20:00booffo[m] has joined #asahi-gpu
20:00domoarigatomrroboto[m] has joined #asahi-gpu
20:00melijah[m] has joined #asahi-gpu
20:00willow[m] has joined #asahi-gpu
20:00f-fritz[m] has joined #asahi-gpu
20:00M5Q[m] has joined #asahi-gpu
20:00jcramerus[m] has joined #asahi-gpu
20:00wollymilkcap[m] has joined #asahi-gpu
20:00blassphemy[m] has joined #asahi-gpu
20:00lazrfocus[m] has joined #asahi-gpu
20:00latosca[m] has joined #asahi-gpu
20:00RasmusEneman[m] has joined #asahi-gpu
20:00kaygalle[m] has joined #asahi-gpu
20:00fortelling[m] has joined #asahi-gpu
20:00notyou[m] has joined #asahi-gpu
20:00AndrewLee[m] has joined #asahi-gpu
20:00AkihikoOdaki[m] has joined #asahi-gpu
20:00probablykevin[m] has joined #asahi-gpu
20:00simosbara[m] has joined #asahi-gpu
20:00feta has joined #asahi-gpu
20:00peerp[m] has joined #asahi-gpu
20:00waytrue[m] has joined #asahi-gpu
20:00matthewayers[m] has joined #asahi-gpu
20:00retonlage[m] has joined #asahi-gpu
20:00Dementor[m] has joined #asahi-gpu
20:00daftfrog[m] has joined #asahi-gpu
20:00borhanborhan[m] has joined #asahi-gpu
20:00sepkov[m] has joined #asahi-gpu
20:00danielgek[m] has joined #asahi-gpu
20:00xiaoming[m] has joined #asahi-gpu
20:00QusarNe8ula[m] has joined #asahi-gpu
20:00Genbuchan[m] has joined #asahi-gpu
20:00rethematrix[m] has joined #asahi-gpu
20:00denden[m] has joined #asahi-gpu
20:00pulpy_orange2[m] has joined #asahi-gpu
20:00ryanhrob[m] has joined #asahi-gpu
20:00Taro[m] has joined #asahi-gpu
20:00shnert[m] has joined #asahi-gpu
20:00eaxk[m] has joined #asahi-gpu
20:00itsn0k[m] has joined #asahi-gpu
20:00AdityaJS[m] has joined #asahi-gpu
20:00WellHoney[m] has joined #asahi-gpu
20:00ashtez[m] has joined #asahi-gpu
20:12MajorBiscuit has quit [Ping timeout: 480 seconds]
20:18dhromw^ has quit [Ping timeout: 480 seconds]
20:33dhromw^ has joined #asahi-gpu
20:35gruetze_ is now known as gruetzkopf
20:39c10l has quit [Quit: Bye o/]
20:43c10l has joined #asahi-gpu
21:04c10l has quit [Quit: Bye o/]
21:08chadmed_ has quit [Ping timeout: 480 seconds]
21:09c10l has joined #asahi-gpu
21:16chadmed_ has joined #asahi-gpu
21:24MajorBiscuit has joined #asahi-gpu
21:24chadmed_ has quit [Ping timeout: 480 seconds]
21:32chadmed_ has joined #asahi-gpu
21:37MajorBiscuit has quit [Ping timeout: 480 seconds]
21:39dhromw^ has quit [Read error: Connection reset by peer]
21:40chadmed_ has quit [Ping timeout: 480 seconds]
21:50chadmed_ has joined #asahi-gpu
21:58chadmed_ has quit [Ping timeout: 480 seconds]
22:00chadmed_ has joined #asahi-gpu
22:09chadmed_ has quit [Ping timeout: 480 seconds]
22:17chadmed_ has joined #asahi-gpu
23:24dhromw^ has joined #asahi-gpu
23:46chadmed_ has quit [Ping timeout: 480 seconds]
23:54chadmed_ has joined #asahi-gpu
…