2026-07-20
00:12voidah has quit [Ping timeout: 480 seconds]
00:14voidah has joined #asahi-dev
00:43debtquity has quit [Ping timeout: 480 seconds]
00:48nela has quit [Quit: Ping timeout (120 seconds)]
00:49debtquity has joined #asahi-dev
00:49nela has joined #asahi-dev
02:00yurix has quit [Remote host closed the connection]
02:00yurix has joined #asahi-dev
03:13runxiyu has quit [Quit: updating weechat]
03:15SlShahafLevi[m]1 has joined #asahi-dev
03:24runxiyu_ has joined #asahi-dev
03:41nora has joined #asahi-dev
03:43nora_ has quit [Ping timeout: 480 seconds]
03:51nela has quit [Quit: Ping timeout (120 seconds)]
03:51nela has joined #asahi-dev
04:47voidah has quit [Ping timeout: 480 seconds]
04:55voidah has joined #asahi-dev
04:55mattia013 has quit [Remote host closed the connection]
05:03voidah has quit [Ping timeout: 480 seconds]
05:11voidah has joined #asahi-dev
05:20voidah has quit [Ping timeout: 480 seconds]
05:29voidah has joined #asahi-dev
05:37voidah has quit [Ping timeout: 480 seconds]
05:46voidah has joined #asahi-dev
05:54voidah has quit [Ping timeout: 480 seconds]
06:03voidah has joined #asahi-dev
06:18voidah has quit [Ping timeout: 480 seconds]
06:21dj has joined #asahi-dev
06:25voidah has joined #asahi-dev
06:34voidah has quit [Ping timeout: 480 seconds]
06:39voidah has joined #asahi-dev
06:47voidah has quit [Ping timeout: 480 seconds]
06:56voidah has joined #asahi-dev
07:04voidah has quit [Ping timeout: 480 seconds]
07:06runxiyu_ has quit [Remote host closed the connection]
07:06Stary has quit [Ping timeout: 480 seconds]
07:07runxiyu_ has joined #asahi-dev
07:10chadmed_ has joined #asahi-dev
07:10chadmed has quit [Read error: Connection reset by peer]
07:12voidah has joined #asahi-dev
07:14djvery cool work on T6050 recently, i was reading the logs here and tried it out on my m5 pro machine. got m1n1 proxy working and basic shell loaded with keyboard
07:14djtried starting other cores few ways, but its just not responding. excited to tinker more with it tomorrow though
07:15Stary has joined #asahi-dev
07:19hardy94 has joined #asahi-dev
07:21voidah has quit [Ping timeout: 480 seconds]
07:29voidah has joined #asahi-dev
07:33hardy1994 has joined #asahi-dev
07:37voidah has quit [Ping timeout: 480 seconds]
07:38hardy94 has quit [Ping timeout: 480 seconds]
07:38hardy1994 is now known as hardy94
07:39runxiyu_ has quit [Ping timeout: 480 seconds]
07:46chadmed_ is now known as chadmed
07:47voidah has joined #asahi-dev
07:56voidah has quit [Ping timeout: 480 seconds]
08:05voidah has joined #asahi-dev
08:06runxiyu_ has joined #asahi-dev
08:07chaos_princessusb is awesome, i managed to somehow wedge the usb stack on host machine with an atc tracer
08:09chaos_princesschanges for now - need a mwait or an interrupt wait after the spmi wake, spmi regmap is broken for reads of >16bytes (typo).
08:13voidah has quit [Ping timeout: 480 seconds]
08:21voidah has joined #asahi-dev
08:29voidah has quit [Ping timeout: 480 seconds]
08:37voidah has joined #asahi-dev
08:46voidah has quit [Ping timeout: 480 seconds]
08:54voidah has joined #asahi-dev
08:56ddxtanx has quit [Ping timeout: 480 seconds]
08:57ddxtanx has joined #asahi-dev
09:02voidah has quit [Ping timeout: 480 seconds]
09:10voidah has joined #asahi-dev
09:12marvin24 has quit [Ping timeout: 480 seconds]
09:18voidah has quit [Ping timeout: 480 seconds]
09:25voidah has joined #asahi-dev
09:34voidah has quit [Ping timeout: 480 seconds]
09:43voidah has joined #asahi-dev
09:45sofushmm, im trying to plan how to "prettify" the avd driver. rkvdec's approach seem unfeasable for avd, if anyone knows a better approach than define+genmask+field_prep (for register like things) please let me know!
09:51voidah has quit [Ping timeout: 480 seconds]
09:59JamesCalligeros[m]sofus: that approach seems sane enough for registers etc. if it was variants of functions id say to use a function table/avd_ops struct and tie that to the compatible or something like that
09:59voidah has joined #asahi-dev
09:59JamesCalligeros[m]If there are a silly amount of register differences between variants just put each variant in its own header
10:01JamesCalligeros[m]You could do something like dcp :p
10:01JamesCalligeros[m](Do NOT do this)
10:01sofusso like defining everything in something like https://github.com/AsahiLinux/linux/blob/f4dd286f7888b348c757b9a2f28dd7bde4c3532b/drivers/media/platform/apple/avd/avd-hevc.c#L448
10:03sofusi dont really get how dcp's macros work, like how does it know what version to build with?
10:03JamesCalligeros[m]Evil evil evil crimes against the preprocessor
10:03JamesCalligeros[m](It builds both lmfao)
10:05chaos_princesshttps://en.wikipedia.org/wiki/X_macro - something like a derivative of this technique
10:07voidah has quit [Ping timeout: 480 seconds]
10:15voidah has joined #asahi-dev
10:16JamesCalligeros[m]Yeah the abi-sensitive stuff
10:16JamesCalligeros[m]The functions kms calls into are wrappers that call the real function based on the fw abi detected by m1n1
10:18sofusWe cant really get rid of this because of devices with never versions right? Whats the plan to upstream this? (if there is one)
10:21JamesCalligeros[m]Refer to the m1n1 pr and kernel branch i posted last night :p
10:22JamesCalligeros[m]We will get rid of the 12.x fw and potentially 13.x and keep 14.x once it actually works, and then any future ones as required
10:22JamesCalligeros[m]There was some talk of a rust rewrite ages ago to make this easier
10:24voidah has quit [Ping timeout: 480 seconds]
10:25JamesCalligeros[m]No way, only fine artisanal barely-functional slop :p
10:27JamesCalligeros[m]Eh, its unavoidable. We are at Apple’s mercy, and they do stupid shit like move EPIC tags by +/- 1 with each fw release
10:27JamesCalligeros[m]Theyve added like 0x230 extra bytes of 0xaa to the swap/page flip command buffer
10:28JamesCalligeros[m]It doesnt actually seem to do anything, but the swap request will be rejected if the buffer is not the right size
10:29Sobek[m]<JamesCalligeros[m]> "We will get rid of the 12.x fw..." <- How in practice will you deploy this ?
10:29pb17 has quit [Ping timeout: 480 seconds]
10:29chaos_princessfor 12.x - reinstall
10:29chaos_princessthere should be next to no installs left on it
10:29JamesCalligeros[m]No one should be using 12.x so reinstall. For 13.x installs, tbd but hopefully we can work something out that does not require a trip to macos. Maybe.
10:30chaos_princessit probably will, unless you want to write a rw apfs driver
10:30JamesCalligeros[m]Im good :p
10:33voidah has joined #asahi-dev
10:37JamesCalligeros[m]The nice thing is that there’s scant prior art on this subject that isn’t our own
10:38JamesCalligeros[m]Which makes our slopdar’s job very easy
10:38pb17 has joined #asahi-dev
10:44voidah has quit [Ping timeout: 480 seconds]
10:52voidah has joined #asahi-dev
10:57sofusre the avd rewrite, im also debating if i should make the instruction generation into a shared function and use function tables for the codec specifik things
10:58sofusthe instruction sequence looks kinda like hdr -> codec_flags -> codec_bufs -> output -> ref_buffers -> slices/tiles
11:00voidah has quit [Ping timeout: 480 seconds]
11:07chadmedi think i suggested that a while ago, and i think it makes the most sense and makes it easier to reason about the code and add new variants
11:07chadmedavd->ops->generate_stream(...) where you then just set .generate_stream=avd_v*_generate_stream on probe
11:09voidah has joined #asahi-dev
11:11sofusbut like the differences between variants are at most 3 if statments, i dont think thats enough for a seperate function
11:13chaos_princesswhat key
11:13chadmedmy preference is typically toward generic/extensible solutions in most cases especially when we cannot know what horrors we will be subjected to by apple in the future
11:17voidah has quit [Ping timeout: 480 seconds]
11:22fl0_idchaos_princess well isn't the apfs part of the drive encrypted, even without filevault? that's at least what my experiments apfs-fuse and paragon apfs suggest. That they worked on drives I created manually, but not on system. There was also an error about sth sth keybag, so I assumed it was related to encryption that cannot be accessed from linux.
11:22chaos_princessright, you will need that too.
11:25voidah has joined #asahi-dev
11:26sofuschadmed: will do my best to make it generic, although based on changes between rev3 and rev4 im not really worried
11:29chadmedyeah ultimately it does not _really_ matter as long as it's readable and reasonably easy to add new variants
11:31chadmedsaves some cycles by having some of the stuff prefilled (e.g. statically allocate the ops for each variant, then once youve devm_kzalloced your driver data struct just avd->ops = &avd_v*_ops or whatever which is the usual pattern)
11:33chadmedbut vk video is where desktop video offload is going so it's gonna have to happen at some point
11:35chadmedand im sure some vaapi-to-vkv thing will end up in mesa or some such however we are then relying on two translation layers to DTRT
11:37sofusfrom the little i tested the vaapi brigde thing it did not seem like it used much more power
11:38chadmedyeah im not concerned about that, its the kind of workload the scheduler will force on to the ecores anyway
11:39sofusi would rather make a vk translation layer as i suspect other people would be interested in that
11:40voidah has quit [Ping timeout: 480 seconds]
11:49voidah has joined #asahi-dev
11:57voidah has quit [Ping timeout: 480 seconds]
12:03hookyoung has quit [Quit: Connection closed for inactivity]
12:03fl0_idchaos_princess do you know if it would in principle be possible to access this encryption, or not, as it is part of the os / security separation and is something one might not want to mess with?
12:04leiofwiw, the NVK rust vulkan video driver draft MR was at https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31867
12:04chaos_princessit is possible to access it, kinda. you order sep to load specific keys into the nvme controller, and then magic happens
12:06voidah has joined #asahi-dev
12:15voidah has quit [Ping timeout: 480 seconds]
12:18mira_ has quit [Ping timeout: 480 seconds]
12:23voidah has joined #asahi-dev
12:28sofusvk video does not seem to expose all the things we need. We would need to parse the bitstream
12:32voidah has quit [Ping timeout: 480 seconds]
12:36voidah has joined #asahi-dev
12:39leioI haven't looked, I assumed most rust stuff you need from mesa generic stuff would be in that PR at least
12:39JamesCalligeros[m]Its all nvk specific stuff
12:45voidah has quit [Ping timeout: 480 seconds]
12:45leiosofus: I knew the application is expected to be parsing the bitstream and passes you lower level stuff already?
12:52voidah has joined #asahi-dev
12:54sofusi looked at the headers here: https://gitlab.freedesktop.org/mesa/mesa/-/tree/main/include/vk_video
13:01voidah has quit [Ping timeout: 480 seconds]
13:10voidah has joined #asahi-dev
13:18voidah has quit [Ping timeout: 480 seconds]
13:27voidah has joined #asahi-dev
13:29leiosofus: btw, could the bitstream parsing be something that the CM3 might be capable to handle?
13:36voidah has quit [Ping timeout: 480 seconds]
13:37voidah has joined #asahi-dev
13:43ndufresne has joined #asahi-dev
13:45ndufresnehi sofus, at linux kernel level, the V4L2 stateless API supports both slice and frame based decoders, this is because Allwinner CPU access codecs are slice based, but most other are frame based
13:46voidah has quit [Ping timeout: 480 seconds]
13:46ndufresneOn HEVC we have a third mode, frame based with slices, this allow for batching in slice based HEVC decoder, or for less capable frame based decoders
13:47ndufresneWe are working on introduce VV specific (HW specific) drivers in the long term to slim down the software, and more some bits to userspace in the long run
13:48ndufresneBut its not really a thing today, I talks to about it to the Linux Media group already, have lined up a talk at Linux Plumber in Prague this year, and we have a encoder (kernel side in Rust as a bonus) in the development for the RK3588 chips
13:52ndufresne has left #asahi-dev [User left]
13:55voidah has joined #asahi-dev
13:57ndufesne has joined #asahi-dev
13:59ndufesneWith V4L2, the kernel API you need here is that stateless codec one, and its more of less the final API implemented by the kernel, so you can already guess that the kernel side is bigger
13:59ndufesneThe general long term idea, is that with HW specific driver + user space driver (aka in mesa), through VV standard API, you can move the hard work into userspace
14:03ndufesneI suppose you are already familiar with https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20847 (needed for Firefox support), that you can enable support for Chromium directly and that gstreamer supports that too
14:08jannauI don't think firefox has patched ffmpeg. so https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20847 still has to be released and merged in firefox ffmpeg copy
14:13ndufesneJust general info, this could be interesting to follow: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/14987
14:13ndufesneThere is also a (vide coded :-S) proto driver of VV on V4L2 Stateless https://gitlab.freedesktop.org/sree/mesa/-/tree/v4l2-vulkan-video
14:14sofushttps://github.com/mozilla-firefox/firefox/blob/7fa9b602777418732e08b26d1ef6c9945c4bbd72/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp#L3278
14:16ndufesneI didn't mean its would just work, but the stateful plumbing should be the same as the stateless one, from user point of view, there is no difference
14:21ndufesne has left #asahi-dev [User left]
14:22ndufesne has joined #asahi-dev
14:22sofusthanks, one thing i never understod is what the kernel driver should do / expose when using VV
14:24ndufesneSo, a VV kernel driver is going to look like a GPU driver. Assuming you have an IOMMU, the driver don't need to protect against operation that would cause an decode error, or would try to read passed the allocated memory. You can let the mmu do its job.
14:25ndufesneSo if you have a command based hw, you can expose a kernel uAPI that match your command interface, if its CPU accessed (aka mmio interface), you can likely expose a submission queue, and have some of the register data just memcpy
14:26ndufesneIts quite likely you driver won't need to know a lot about the specific codec, that knowledge will be in the userspace driver
14:27ndufesneSo in general, I would expect something like:... (full message at <https://matrix.org/oftc/media/v1/media/download/AeRIfNcsBSjrJ9UNNRQgvZo42baqTeknC47ff3sNNDGpl0xi2naMwR-nFTrCS8rEiI2fCHtGlBdzEzJB6Ue53_tCefyAYFTQAG1hdHJpeC5vcmcvbnJ4RFhhcGJCZlJVSnJaTnpEdUhUZEhS>)
14:28ndufesneThis will of course clarify itself as we make drivers that way, and we'll be building common block, as codecs HW are quite alike
14:29ndufesneIn contrast, in V4L2, you don't really queue commands, but buffers, the request are just object that holds on controls data (the decode parameters), and that kernel driver completely validate the data to prevent any form of overflow, because tradionally in v4l2, the mmus are optional, you can outcompile them
14:30ndufesneA v4l2 driver, is mostly a thread that wakes when there conditions are met:... (full message at <https://matrix.org/oftc/media/v1/media/download/ASTaligxgi03m5Rnhqpt5rpQhe6D4jo3a1kForzB5mZT2bIgm8hysA_uvylAp4PxwcaCeT3UQ92cTxEt-2sIB2lCefyAiV-gAG1hdHJpeC5vcmcvV1dPTnFHY1NISm9SeXNLZ2lQQ3NwYndn>)
14:31ndufesneSo it is always a little ackward, since you basically build a "command", the is wrapped by a request, yet the driver does not process the request in their queued order ....
14:35chaos_princessjust smuggle it via drm/accel
14:35sofusa very large chunk of our driver is rkvdec copy paste, so im kinda hoping upstreaming is not to hard
14:38sofusthanks a lot for the help! Based on what you have said, my plan is to continue v4l2, but design it such that porting to VV would be easy
14:43chaos_princesssofus: from what i understand the idea is to design a "correct" kernel api for vv, with you being one of the trailblazers for that. So, a year makes ssense
14:43ndufesnesofusyou can't upstream this type of driver without a ready to use open source counterpart
14:43voidah has quit [Ping timeout: 480 seconds]
14:44chaos_princessndufesne: its more of a slight dig at x86 people with gpu-integrated media engines that can throw it in together with their gpu api. and also at drm/accel being kinda the gpu-like-things-except-for-graphics-part
14:45rodmac has joined #asahi-dev
14:45ndufesnecurrent status is that drm tree won't take drivers that don't have a GPU, accel tree is just a jungle, so that's less interesting. Linux Media have had some opening to accept this type of driver (which would be easy for me, as I already maintain the v4l2 side of codecs/m2m), but I'm very open to where this thing will live
14:48ndufesnein the end, I think its giving future dev a very valid choice, plus fence based programming, which is not available in v4l2
14:51voidah has joined #asahi-dev
14:52ndufesnesofus btw, very happy to ear the progress you made, and really looking forward seeing your driver on the ML!
15:01voidah has quit [Remote host closed the connection]
15:01voidah has joined #asahi-dev
15:40ralim8 has quit [Ping timeout: 480 seconds]
15:44ralim8 has joined #asahi-dev
15:46rodmac has quit [Quit: leaving]
15:59voidah has quit [Ping timeout: 480 seconds]
16:06mattia013 has joined #asahi-dev
16:09voidah has joined #asahi-dev
16:17voidah has quit [Ping timeout: 480 seconds]
16:25voidah has joined #asahi-dev
16:33chaos_princessBus 001 Device 002: ID 05ac:12a8 Apple, Inc. iPhone 5/5C/5S/6/SE/7/8/X/XR
16:33chaos_princessthat's a start i guess
16:34voidah has quit [Ping timeout: 480 seconds]
16:41voidah has joined #asahi-dev
16:44rhysmdnz has quit [Quit: Bridge terminating on SIGTERM]
16:44enick_381 has quit [Quit: Bridge terminating on SIGTERM]
16:48Jamie has joined #asahi-dev
16:49Jamie is now known as Guest13793
16:49voidah has quit [Ping timeout: 480 seconds]
16:49rhysmdnz has joined #asahi-dev
16:57NickChan[m] has joined #asahi-dev
16:57chaos_princessm3max, so spmi tipd
16:58voidah has joined #asahi-dev
17:00chaos_princessyours + my fixes + i intend to change regmap_spmi more
17:06voidah has quit [Ping timeout: 480 seconds]
17:14voidah has joined #asahi-dev
17:18lethalbit|wut has joined #asahi-dev
17:23voidah has quit [Ping timeout: 480 seconds]
17:27voidah has joined #asahi-dev
17:35voidah has quit [Ping timeout: 480 seconds]
17:44voidah has joined #asahi-dev
17:52voidah has quit [Ping timeout: 480 seconds]
17:59nst has quit [Quit: WeeChat 4.7.2]
18:00voidah has joined #asahi-dev
18:04nst has joined #asahi-dev
18:08voidah has quit [Ping timeout: 480 seconds]
18:17voidah has joined #asahi-dev
18:26voidah has quit [Ping timeout: 480 seconds]
18:28voidah has joined #asahi-dev
18:36voidah has quit [Ping timeout: 480 seconds]
18:42runxiyu_ has quit [Remote host closed the connection]
18:44runxiyu_ has joined #asahi-dev
18:44voidah has joined #asahi-dev
18:45gargantua has joined #asahi-dev
18:53voidah has quit [Ping timeout: 480 seconds]
18:57voidah has joined #asahi-dev
19:05voidah has quit [Ping timeout: 480 seconds]
19:13nela has quit [Quit: Ping timeout (120 seconds)]
19:13nela has joined #asahi-dev
19:14voidah has joined #asahi-dev
19:23voidah has quit [Ping timeout: 480 seconds]
19:25Lyude has quit [Quit: Bouncer restarting]
19:28ddxtanx has quit [Read error: Connection reset by peer]
19:28ddxtanx has joined #asahi-dev
19:29voidah has joined #asahi-dev
19:37voidah has quit [Ping timeout: 480 seconds]
19:38ddxtanx has quit [Remote host closed the connection]
19:45voidah has joined #asahi-dev
19:54voidah has quit [Ping timeout: 480 seconds]
20:03voidah has joined #asahi-dev
20:04Lyude has joined #asahi-dev
20:25voidah has quit [Ping timeout: 480 seconds]
20:25djinteresting, so cores do start on t6050 but pc doesn’t change but when I did a half read at pc I did see the pc it was just stuck at start
20:30voidah has joined #asahi-dev
20:35averne has joined #asahi-dev
20:35djthe cores are released and pc changes from 0 to rvbar+0x200. 32 bit utt read exposes the real low pc. 64 bit read for some reason says 0
20:38voidah has quit [Ping timeout: 480 seconds]
20:47voidah has joined #asahi-dev
20:56voidah has quit [Ping timeout: 480 seconds]
21:04voidah has joined #asahi-dev
21:13JamesCalligeros[m]yuka: docs kinda fell by the wayside by the time we got to t6020 unfortunately. Contributions welcome :3
21:15yukadj: I don't really understand this: "I did see the pc it was just stuck at start" <- how do you see this?
21:18Yushi has quit [Remote host closed the connection]
21:19Yushi has joined #asahi-dev
21:29gargantua has quit [Ping timeout: 480 seconds]
21:29djI’m reading the per-core uttdebug. read32(cpu-uttdbg-reg + 0x90). Sampling both halves I got the exact pc. I’m decently new to this, could be very off lol
21:31djmy guess was it was getting into an exception state soon as you start it but I’m losing progress on that end, doesn’t seem to hold up..
21:37chaos_princessor nop slide the entire suspected area?
21:38yukayes but it seems 0x200 is indeed already something else, I don't know if that can be relocated just like that
21:40djI can’t get to read the pc first few cycles before it’s at +0x200, initial read was completely 0 but starting at rvbar+0 (reset) it ends up at exception vector. I’ll try making it an endless loop
21:42djI had tried to replace +0 before but it still ended up at 0x200 as if the replacement didn’t work is it cause it’s chain loaded?
21:56mattia013 has quit [Quit: mattia013]
22:03sckova[m] has joined #asahi-dev
22:05djok the replacement def lands - verified it via read back but it just ends up at +0x200. tried to update held bit from +0 but it just seems like core never executes it and the pc read hack just reports +0x200 on the third sample. so loop and nop both didn’t work
22:05lkoledic has joined #asahi-dev
22:10sckova[m] is now known as kovahehim[m]
22:20djsomething related to per-core execution/memory ownership state - is there anything like that which rings a bell?
22:34lkoledic has quit [Remote host closed the connection]
22:58JamesCalligeros[m]xnu is source-available
22:58JamesCalligeros[m]but i think youll need to look at iboot and/or sptm for your machine too
23:02JamesCalligeros[m]you can do so but keep the chat to #asahi-re and know that you wont be able to contribute m1n1 or kernel code directly if you do so
23:08djI can provide documentation through disasm, and someone else can implement it - am I getting it right?
23:12JamesCalligeros[m]pretty much yeah
23:20chaos_princessit is unlikely that you will succeed
23:20chaos_princessthe relevant bits are in iboot, and you can't change it