#
…

2022-10-01

00:00rqou_rcombs: i might not be consistently online, but i read logs periodically
00:01rqou_i've also been intermittently working on AVD but don't have much to show for it yet
00:03rcombsrqou_: hey! yeah prores will be interesting since there's not really any standard API bits for it outside of macOS… how complex is the userspace driver going to need to be?
00:04rqou_the hardware is simply "feed it a frame (and a dma descriptor) and the hardware tells you when it's done"
00:15thelounge7571340 has joined #asahi-dev
00:15thelounge7571340 has quit [Remote host closed the connection]
00:31chipxxx has quit [Remote host closed the connection]
00:31yuyichao_ has quit [Ping timeout: 480 seconds]
00:31amarioguy has joined #asahi-dev
00:31rcombswell that's nice and simple
00:32rcombslemme see here
00:34rcombsrqou_: is AVD/AVE similarly simple?
00:36rcombsrqou_: for prores, I think your best bet is probably gonna be to expose an V4L2_PIX_FMT_PRORES, along with various V4L2_CID_[*] controls for tuning options and such
00:37chadmed[m]AVD is a little bit more complex
00:38rcombsbasically, if you'd have an easy time taking a coded packet as a single buffer and throwing it at the hardware entirely within the kernel, your best bet is probably v4l2 m2m
00:38rcombsif not, there are a bunch of other potential options to consider
00:39chadmed[m]It’s got a whole boatload of tunables, DMA regions, a big blob of firmware, multiple hardware blocks for VP9, HEVC and H.264 and a peculiar control register layout
00:40rcombswell, the biggest question is "how much work is there that could/should reasonably be offloaded to a userspace driver"
00:40rcombslike, does something have to parse packets and break them down into several smaller buffers before feeding them to the hardware?
00:41rcombsor on the encode side, does the hardware generate an intermediate format that requires substantial further processing (gluing pieces together, adding headers, etc) to produce a valid coded packet?
00:42rcombsalso on encode, how much rate control feedback needs to be done in software?
00:43chadmed[m]I dont think either is the case. Jamie managed to coax a frame out of AVD just poking it from m1n1 so thats promising
00:43rcombscan you tell the encoder unit "target this bitrate for the stream" and just roll with that, or do you have to tell it e.g. what quantization settings to use for each macroblock?
00:44rcombsa lot of those more complex pieces might be better-off in a userspace driver
00:45rcombsbut if it's really just "feed raw input data and high-level settings, get finalized output", then the whole thing can probably live in the kernel just fine via v4l2
01:04rcombsthe other major options are VAAPI and OMX; OMX has the advantage of being very open and extensible, but has the downside of being absolute hot trash at every level
01:07rcombsVAAPI has the advantage of not sucking (and being widely-deployed in desktop usage), but the disadvantage of being potentially more complex to integrate with codecs that it doesn't already support, along with being designed to integrate at a somewhat lower level than "pass in opaque bag of bytes, get out pile of pixels"
01:09rcombswhatever you do for decode, you'll want to make sure you're capable of spitting out buffers that are in a format (or can easily be mapped by userspace code into a format) that the GL driver can import
01:16rcombsffmpeg/mpv/etc already support doing that with drmprime buffers or VAAPI frames (which are internally drmprime dmabuf fds)
01:17rcombsbut ffmpeg _doesn't_ yet support using dmabuf fds with v4l2, so if you go that route I'll need to add that :)
01:20Emantor has quit [Quit: ZNC - http://znc.in]
01:20Emantor has joined #asahi-dev
01:21thelounge7571340 has joined #asahi-dev
01:22thelounge7571340 has quit [Remote host closed the connection]
01:32Gaspare has joined #asahi-dev
01:40Gaspare has quit [Quit: Gaspare]
02:06marcansven: I want to say the stream allocation needs to happen when the DCP DRM driver actually wants to turn on an output, not when there is merely a monitor connected... but then how do you get EDID ahead of time?
02:07marcanso yeah, maybe we do have to greedily allocate DCPs as soon as anything is plugged in, due to the architecture
02:07marcankind of sucks since ideally users would be able to use as many monitors as they want as long as they only actually turn on a certain number (this is how crtc limitations can be implemented in DRM)
02:07marcanbut if we can't even get EDID without a DCP...
02:08marcaneither way, we do need a DRM connector created upfront for every physical output, even if they aren't mapped to any DCPs until hotplug
02:10snowcra5h has quit [Quit: B1tch eX]
02:15bluetailDRM=Digital rights management, DCP=?
02:16Capta1nT0ad[m]bluetail: The Direct Rendering Manager (DRM) is a subsystem of the Linux kernel responsible for interfacing with GPUs of modern video cards. DRM exposes an API that user-space programs can use to send commands and data to the GPU and perform operations such as configuring the mode setting of the display.
02:16Capta1nT0ad[m]DCP is display co-proccessor
02:17bluetailThanks. I wrote that down since I had issues finding it through google
02:19Capta1nT0ad[m]* display co-proccessor and you won't find much about it on google
02:20Capta1nT0ad[m]* display co-proccessor and you won't find much about it on google apart from https://www.theiphonewiki.com/wiki/DCP
02:33c10l7 has joined #asahi-dev
02:38c10l has quit [Ping timeout: 480 seconds]
02:38thelounge7571340 has joined #asahi-dev
02:39thelounge7571340 has quit [Remote host closed the connection]
02:59leif has joined #asahi-dev
03:00leifAlyssa gives a good description of DCP here https://youtu.be/ObS6sdfus2w?t=62
03:01leif has quit []
03:21kov has quit [Quit: Coyote finally caught me]
03:41thelounge7571340 has joined #asahi-dev
03:41thelounge7571340 has quit [Remote host closed the connection]
04:31thelounge7571340 has joined #asahi-dev
04:31thelounge7571340 has quit [Remote host closed the connection]
04:47SSJGZ has joined #asahi-dev
05:34thelounge7571340 has joined #asahi-dev
05:34thelounge7571340 has quit [Remote host closed the connection]
06:36thelounge7571340 has joined #asahi-dev
06:37thelounge7571340 has quit [Remote host closed the connection]
06:54chadmed has joined #asahi-dev
06:56jannausven: pushed updates to my dcp branches which boots dcpext and uses disp0/dispext0 darts in a single domain
06:58jannauthere's are 2 vblank related warning during initialization from drm but hdmi works
07:00jannaumost convenient way to check if everything works is /sys/kernel/debug/dri/2/state, number might differ, its 2 for me since I have vgem enabled
07:04jannauI plan to work on dcp this weekend but I guess if I move the the dcpep code first to iomfb.c there will be little conflict if we work on it at the same time
07:22bisko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
07:24bisko has joined #asahi-dev
07:32bisko has quit [Ping timeout: 480 seconds]
07:39bisko has joined #asahi-dev
07:42thelounge7571340 has joined #asahi-dev
07:42thelounge7571340 has quit [Remote host closed the connection]
07:47bisko has quit [Ping timeout: 480 seconds]
07:57chadmed has quit [Remote host closed the connection]
08:05goldsoultheory has joined #asahi-dev
08:21svenjannau: feel free to start the move, I probably won’t have much time before Monday
08:22svenmarcan: yup, I thought about that but don’t see how that’s possible with this architecture yet. Pretty sure the stream needs to be connected to DCP before we can tell anything
08:23svenkonradybcio: I’ll test it later this weekend
08:42jannausven: did you test trace_dcp.py on dcp? I get subtype 0xc0 commands with a length of 17. trace_dcp.py:321ff
08:43thelounge7571340 has joined #asahi-dev
08:43svenuh, i think so
08:43thelounge7571340 has quit [Remote host closed the connection]
08:43svenJust on t8103 though
08:45jannauI'm testing on the mini
08:45svenSame here, so what exactly fails?
08:46bisko has joined #asahi-dev
08:51goldsoultheory has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
08:54bisko has quit [Ping timeout: 480 seconds]
08:54svenhrm, I think I occasionally saw that invalid magic as well but just ignored it
08:57jannauthe invalid magic is not the problem. I get tx.cmd's shorter than 64 bytes and empty replies instead of at least 16 bytes which breaks the parsing in handle_reply/handle_cmd
08:57jannauworked around that for now by ignoring it
09:00goldsoultheory has joined #asahi-dev
09:07svendont think that ever happened here
09:07svenbut there is something that’s broken because I sometimes get that unmapped dart page thing
09:07svenit just happens so rarely that insider care to investigate
09:07sven*i didn‘t
09:08goldsoultheory has quit [Ping timeout: 480 seconds]
09:12svendid you trace macOS or m1n1 there?
09:12svenI never tried that
09:16jannauconfirmed, doesn't happen with macos
09:17jannaudcpext somehow confuses Xorg or kde. kde's display settings shows a second monitor with an made up 1024x768 mode
09:18jannaua little concering is that the identify boxes are displayed on the hdmi connected display
09:46thelounge7571340 has joined #asahi-dev
09:47thelounge7571340 has quit [Remote host closed the connection]
10:07laci has quit [Quit: Connection closed for inactivity]
10:13sveniirc the current driver always marks the screen as connected
10:14sventhat probably confuses xorg
10:29svenlooks like drivers/mux is a very thin abstraction that would give us devicetree bindings for the display crossbar
10:33svenkonradybcio: t8103 boots with uncore_regs and fast_ipi set to false
10:34konradybcioOk thanks, I'll send a v(n+1) soon
10:47thelounge7571340 has joined #asahi-dev
10:49thelounge7571340 has quit [Remote host closed the connection]
11:17jannausven: yes, already fixed. I thought it's marked at some point as not connected
11:51thelounge7571340 has joined #asahi-dev
11:51thelounge7571340 has quit [Remote host closed the connection]
12:13ChaosPrincess has quit [Quit: WeeChat 3.6]
12:14ChaosPrincess has joined #asahi-dev
12:39bisko has joined #asahi-dev
12:56thelounge7571340 has joined #asahi-dev
12:56thelounge7571340 has quit [Remote host closed the connection]
13:04bisko has quit [Ping timeout: 480 seconds]
13:15bisko has joined #asahi-dev
13:23bisko has quit [Ping timeout: 480 seconds]
13:36zzywysm has quit [Quit: Textual IRC Client: www.textualapp.com]
13:37zzywysm has joined #asahi-dev
13:58thelounge7571340 has joined #asahi-dev
13:59thelounge7571340 has quit [Remote host closed the connection]
14:12fossdd has joined #asahi-dev
14:23svenhow many dispext/dcpext does the largest SoC have right now?
14:24sven3 for each die?
14:26svenjannau: can you run [hex(read32(u.adt["/arm-io/atc%d-dpxbar" % i].get_reg(0)[0] + 0x800)) for i in range(N)] on a multi die SoC and replace N with the number of atcphys there?
14:26bisko has joined #asahi-dev
14:26svenand a ADT from a multi-die soc would also be very useful
14:27jannauI think 4 per die on the m1 max
14:28svenah, yes, 4 makes sense.
14:28sveni just had an off-by-one error
14:29jannauultra has dcpext7
14:30svenon a single die? huh
14:33jannauon both dies
14:34bisko has quit [Ping timeout: 480 seconds]
14:34svenok, would be interesting to see the initial value of that crossbar register i mentioned above
14:35svenessentially unrouted dispext inputs are stuck at 1 there
14:36yuyichao_ has joined #asahi-dev
14:40jannausven: all zero: ['0x0', '0x0', '0x0', '0x0', '0x0', '0x0']
14:40svencan you read 0x804 as well?
14:41jannau['0x1ff', '0x1ff', '0x1ff', '0x1ff', '0x1ff', '0x1ff']
14:42svenhrm.. so that's at most 9 inputs for the crossbar but each dcpext should be 2 separate streams
14:44svenand yet the ADT only has a single display crossbar top-level node that seems to list everything
14:47jannauapple claims for the studio without distinction between max and ultra to support four 6k displays
14:48svena single dcp should be able to drive a 6k display, shouldn't it?
14:49svenor do you need two dcps for that? :s
14:50jannauyes, using 2 stream. there are 6 thunderbolt 4 ports so it seems apple might have been lazy wrt to the number of supported displays
14:50svenokay, that might make sense
14:51svenstill, the crossbar is a bit weird unless you can actually only route within a single die and they hardcoded that inside some kext or something
14:51jannauno, I think that should be possible with dcpextX,0:dcpextX,1 as dottedmag sees with the tiled thunderbolt display
14:51skoobasteeve has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
14:52skoobasteeve has joined #asahi-dev
14:52svendisplay-crossbar0 in the ADT claims 16 UFP which matches 8 x dcpext and 2 streams/dcpext
14:52jannauI guess we could try if the front thunderbolt ports support display out
14:53sventhere is a single xbar for each atcphy
14:53sventhe weird part is the dcpextN,M input side
14:53sveni assumed there should be 16 of those per crossbar but there seem to be 9
14:53skoobasteeve has quit []
14:54bisko has joined #asahi-dev
14:54skoobasteeve has joined #asahi-dev
15:05thelounge7571340 has joined #asahi-dev
15:06thelounge7571340 has quit [Remote host closed the connection]
15:06marcanjannau: they do, I tried that
15:07marcansven: 8 (4x DCPEXT on one die) + StreamCodec
15:07svenStreamCodec?
15:07marcanthat's one of the ProRes blocks
15:07marcanmost likely related to their secret VR project
15:07svenah, lol
15:08marcanso this sounds like there is no inter-die routing
15:08svenso I guess they hardcoded that rouing can only happen within a single die somewhere
15:08sven*routing
15:08marcanwhich makes sense, because why would you actually want that? one die can drive all of its ATCs
15:09svenyeah, I would've just expected to see that represented in the ADT
15:09marcannot the first time the ADT lies
15:09svenbut then again, the ADT is full of hacks anyway
15:10jannaubut shouldn't there then be a second crossbar on the second die and it should be possible to drive 6 6k displays
15:10marcanjust add the die offset to the xbar regs, does it exist?
15:10svennote that there is "crossbar" and "dpxbar" in the ADT
15:10svencrossbar is their fake top-level node that decides routing
15:11svendpxbar is actual HW and there's one of those per ATC
15:11marcanah, then yeah, it all checks out
15:12bisko has quit [Ping timeout: 480 seconds]
15:12svenyeah, I guess in their "fake crossbar kext" they just hardcoded that it will only match a dpxbar and a dcpext from the same die
15:12marcanand if I had to guess a realistic reason for the 4 display limitation, something something real time memory bandwidth limits? though it doesn't make much sense considering how much real bandwidth this thing has. could also just be marketing / keeping both Studio variants equal
15:13svenI'm pretty sure that they could also support two external screens on the normal M1 if they modified their DCP firmware a bit. my guess is marketing ;)
15:14marcanre hack mode support, DCP does two layers right?
15:14svenlayers?
15:14marcandisplay layers
15:14marcanper display
15:14jannauat least 2
15:15marcancan we just take one for each output stream and support separate streams with separate FBs that way, at the cost of losing the cursor plane or similar? probably a lot nicer to the compositor than trying to do something horrible with fake-tiled framebuffers
15:15marcaninternally you'd just tile it in space and have the layers not overlap
15:15svendon't know yet
15:16marcan(this would require some funky logic in the driver to allocate DCPs discretely first, then start oversubscribing them if the user turns on too many outputs)
15:16marcanbut it would also allow 4 displays on the M1 Pro machines, which is cute
15:16sventhe actual implementation will be pretty cursed if it works out, yes
15:16marcanwhat I don't know is how it deals with EDIDs and modes
15:16marcanlike does it only work with identical displays?
15:17svenno idea yet, it's still all very vague
15:17marcan(would still be very useful, I have an IVB laptop with that exact limitation)
15:17marcan(3 displays, two have to have the same clock)
15:17svenso far I just have an idea how to convince it to connect two streams and probably how to route them to separate atcs
15:17svenno idea what iomfb itself does. i'll probably annoy dottedmag for more traces once I get there
15:18marcandunno if I mentioned we have an apple studio display donor
15:18svenbut on the trace from yesterday it looked very similar to the situation when just a single screen was connected
15:18marcanyou're in line for that if you sign up for it ;)
15:18marcan(otherwise I'll get it, when I have the bandwidth for this)
15:18sveni feel like i've already signed up for this cursed mess when I wanted thunderbolt anyway :D
15:20svenwhat is that display anyway? just thunderbolt with some special usb devices?
15:20marcanprobably
15:20marcanwell, I wouldn't be surprised if it has some cursed thunderbolt stuff a la T2
15:21bisko has joined #asahi-dev
15:21marcanbut the display stuff should be standard I'd hope
15:21svenI assume it also works on the m1 non-pro/max?
15:22marcanI assume so? it'd be dumb for it not to
15:23svenlol, apparently it essentially runs ios
15:23jannaut8103 supports pro display xdr, so it should support the the studio display
15:24marcansven: yup
15:24marcanhence why I said the T2 thing
15:25svenofc it also has firmware updates
15:26svenyeah, I guess I could do that. probably a nice test case for thunderbolt anyway
15:27marcanyou're in .de right? I can ping the sponsor about this, maybe just wait until next week :)
15:52bisko has quit [Ping timeout: 480 seconds]
15:54thelounge7571340 has joined #asahi-dev
15:55thelounge7571340 has quit [Remote host closed the connection]
15:58svenokay, i think apple collects the valid dispext<->dpxbar connections inside a "domain" and the ADT then has dp-switch-ufp-domain
15:58svenwhich is zero for everything on the first die and one for everything on the second die
15:58svenand then dfp-switch-ufp-endpoint encodes the index inside the dpxbar
15:59svenso that all makes sense now
16:04mokou has joined #asahi-dev
16:19jannaumarcan: any objections over using a custom header with the payload size for initramfs payloads?
16:20jannauthat makes it simple to support concatenated cpio archives and we can rely on the kernel for decompression (for zstd support)
16:21jannauonly mildly annoying part is writing binary numbers from shell scripts like run_guest_kernel.sh
16:22teul[m] has joined #asahi-dev
16:40skoobasteeve has quit [Ping timeout: 480 seconds]
16:45skoobasteeve has joined #asahi-dev
17:01thelounge7571340 has joined #asahi-dev
17:02thelounge7571340 has quit [Remote host closed the connection]
18:06thelounge7571340 has joined #asahi-dev
18:06thelounge7571340 has quit [Remote host closed the connection]
18:22jluthra has quit [Remote host closed the connection]
18:22jluthra has joined #asahi-dev
18:37snowcra5h has joined #asahi-dev
18:58snowcra5h has quit [Quit: B1tch eX]
19:12thelounge7571340 has joined #asahi-dev
19:12thelounge7571340 has quit [Remote host closed the connection]
19:54tired has quit [Quit: /]
19:55tired has joined #asahi-dev
20:06tired has quit [Quit: /]
20:07tired has joined #asahi-dev
20:14thelounge7571340 has joined #asahi-dev
20:14thelounge7571340 has quit [Remote host closed the connection]
21:13amarioguyquick question if you're submitting a "v2" patch should you include a link to the v1 version as well?
21:13amarioguyand should that go after the '---' part or before as a rule of thumb?
21:15skoobasteeve has quit [Quit: No Ping reply in 180 seconds.]
21:15skoobasteeve has joined #asahi-dev
21:16thelounge7571340 has joined #asahi-dev
21:16thelounge7571340 has quit [Remote host closed the connection]
21:26kov has joined #asahi-dev
21:54jnamarioguy: i tend to include it. i put it after the dash line, because i think it's irrelevant for the final commit once applied to git
21:59SSJGZ has quit [Ping timeout: 480 seconds]
22:13chipxxx has joined #asahi-dev
22:14arekm has quit [Quit: leaving]
22:15arekm has joined #asahi-dev
22:18goldsoultheory has joined #asahi-dev
22:24thelounge7571340 has joined #asahi-dev
22:25thelounge7571340 has quit [Remote host closed the connection]
22:26* amarioguyhas sent v2 of a patch to mailing lists, hopefully correctly this time
22:44jakebot602 has quit [Quit: The Lounge - https://thelounge.chat]
22:51jakebot6022 has joined #asahi-dev
23:13goldsoultheory has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
23:29thelounge7571340 has joined #asahi-dev
23:30thelounge7571340 has quit [Remote host closed the connection]
23:40marcanwoke up, and of course Manjaro is doing a Manjaro. Sigh.
23:41marcanjannau: no objections (as long as we keep the current support too)
23:49marcanapparently they are taking my latest (non prod) tag and putting the rc6-rc7 diff on top? that's... something
23:51marcanI also don't see anything about firmware updates in that repo
…