#
…

2022-09-30

00:23zzywysm has joined #asahi-dev
00:24thelounge7571340 has joined #asahi-dev
00:24thelounge7571340 has quit [Remote host closed the connection]
00:47robinp has quit [Remote host closed the connection]
00:47robinp has joined #asahi-dev
01:16derzahl has quit [Ping timeout: 480 seconds]
01:26thelounge7571340 has joined #asahi-dev
01:27thelounge7571340 has quit [Remote host closed the connection]
02:14marcanpovik: let me know if I should drop or include the binding patch in the end
02:28thelounge7571340 has joined #asahi-dev
02:29thelounge7571340 has quit [Remote host closed the connection]
03:02kevans91woot! da0: <Kingston DataTraveler 70 PMAP> Removable Direct Access SPC-4 SCSI device
03:07kevans91it turns out I had a stale config that was disabling the xhci driver for dwc3, I was inspecting the wrong device entirely
03:07nela has quit [Quit: leaving.]
03:08nela has joined #asahi-dev
03:29thelounge7571340 has joined #asahi-dev
03:30thelounge7571340 has quit [Remote host closed the connection]
03:38kov has quit [Quit: Coyote finally caught me]
04:31thelounge7571340 has joined #asahi-dev
04:32thelounge7571340 has quit [Remote host closed the connection]
05:13robinp has quit [Ping timeout: 480 seconds]
05:31thelounge7571340 has joined #asahi-dev
05:31thelounge7571340 has quit [Remote host closed the connection]
06:31povikmarcan: sure, will wait for Vinod's reply
06:32thelounge7571340 has joined #asahi-dev
06:32thelounge7571340 has quit [Remote host closed the connection]
06:35svenjannau: I need to figure out how usb4 tunneling works first to figure out more details, but I think it already makes sense to change two things inside dcp:
06:35sven1) the top level node shouldn't be called disp0 and also shouldn't attach to the disp0 iommu. instead it probably needs to take pairs of dcp(extN), dispN
06:36sven2) split dcp.c into dcp.c and iofm.c (i think that's how apple calls the main dcp endpoint) so that struct apple_dcp can be used for other endpoint
06:36svenI'll add dptx.c and dcpav.c and povik can then later add audio.c :-P
06:36sven*iomfb.c actually
06:37svenpovik: you know you want to :D
06:37svenit actually doesn't look too complicated fwiw
06:39jannaunot sure what to do about the disp* darts. It would be convenient to share the page tables over all of them for multiple displays/overlays shared between two displays
06:39svenmaybe just add all of them to the main node then :D
06:40svenor adjust dart.c to allow more than 2 darts/domain and just attach them all to the same one
06:43povik(ideally someone extracts signatures of the relevant IPCs; seems to me you have some process figured out for it)
06:43* povik've surveyed the audio-display interaction in kernel, to see what we will need to do
06:43svenlooks like atc-dpin0/1 both have an interrupt. maybe that's how they know when a stream needs to be tunneled
06:44svenpovik: I'll need to prepare one more PR for the DCP EPIC pretty printer. then the extraction literally is "add bt() to the unknown command handler after loading kext symbols"
06:45povikah, so they have some presumably-automatically generated stubs for all the IPCs? then it's simple
06:46sventhe dcp->ap side is still missing though
06:46jannaulet's start with one dcpext and assing both stream 0 of the disp dart to the same domain and see if that is what we want
06:46sveni'll prepare a PR to handle that as well this weekend
06:47svenbut then you can just stare at trace_dcp.py and probably figure out audio in a day or so. I took a very brief look and it seemed rather simple
07:06MajorBiscuit has joined #asahi-dev
07:30goldsoultheory has joined #asahi-dev
07:34thelounge7571340 has joined #asahi-dev
07:34thelounge7571340 has quit [Remote host closed the connection]
07:40gonzogonzales[m] has joined #asahi-dev
08:38thelounge7571340 has joined #asahi-dev
08:39thelounge7571340 has quit [Remote host closed the connection]
09:43thelounge7571340 has joined #asahi-dev
09:43thelounge7571340 has quit [Remote host closed the connection]
10:46thelounge7571340 has joined #asahi-dev
10:46thelounge7571340 has quit [Remote host closed the connection]
10:55marcanI'm surprised they're pushing audio through the EPIC interface
10:55marcanI honestly expected some extra hardware involved, some DMA engine
10:56marcanbut also, povik: HDMI/DP audio is its own pile of cursedness with things like dolby/DTS/multichannel PCM modes, so this might be more DRM subsystem stuff than ASoC subsystem stuff (I think DRM has helpers for some of this, infoframes/etc?)
10:56marcannot sure what level the DCP interface is at of course
10:56marcanbut worth noting
11:02svenat least the setup seems to happen via that epic Interface, dunno how they actually push the data then
11:05_jannau_dp-audio* has dma-parent/dma-channels
11:06_jannau_I'd assume that is used to push ausio data
11:17povikyeah, pretty sure they push the audio through SIO
11:24fossdd has quit [Ping timeout: 480 seconds]
11:25povikfrom my looking into this earlier, this is what i expect we need to implement on the DRM side around the EPIC interface
11:25povikand the rest, including the data-streaming, belongs to the ASoC side...
11:26poviki also expect we can circumwent the SIO at first, feeding the data directly into dp-audio MMIO
11:26povikfrom my short time poking at it, it seemed like it could be the entry side of a FIFO
11:28kov has joined #asahi-dev
11:31povikthis btw consumes the interface from above, doing a proper ASoC codec around it
11:31povikit may deal with all the dolby stuff for us
11:35thelounge7571340 has joined #asahi-dev
11:35thelounge7571340 has quit [Remote host closed the connection]
11:51chipxxx has joined #asahi-dev
12:25yuyichao_ has joined #asahi-dev
12:29yuyichao has quit [Ping timeout: 480 seconds]
12:36thelounge7571340 has joined #asahi-dev
12:36thelounge7571340 has quit [Remote host closed the connection]
12:51tobhe_ is now known as tobhe
12:54c10l has quit [Quit: Bye o/]
12:56c10l has joined #asahi-dev
13:07bisko has joined #asahi-dev
13:38thelounge7571340 has joined #asahi-dev
13:38thelounge7571340 has quit [Remote host closed the connection]
14:08donnyjoe[m] has joined #asahi-dev
14:22Capta1nT0ad[m] has joined #asahi-dev
14:37goldsoultheory has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
14:45thelounge7571340 has joined #asahi-dev
14:45thelounge7571340 has quit [Remote host closed the connection]
15:03Soroush has quit []
15:04Soroush has joined #asahi-dev
15:05Soroush has quit []
15:07svenjannau: what is your current DCP branch? that September one? And I guess I’ll also need some m1n1 patch for the reserved regions?
15:07svenlooks like the dpin connected signal comes as a packet on the thunderbolt NHI, so we’ll eventually have to hook that up as well…
15:08Gaspare has joined #asahi-dev
15:09_jannau_yes, asahi-dcp-september. m1n1 changes are in https://github.com/AsahiLinux/m1n1/pull/256
15:09_jannau_sven: ^^^
15:11chipxxx has quit [Read error: Connection reset by peer]
15:11svennice, thanks.
15:12_jannau_I think for dcpext/dispext only dcp text and heap are pre-mapped, so that should be easy to add in m1n1
15:13sveni've also thought a bit about how to hook this all up
15:14sventhe atc-crossbar will probably be a separate node in the FDT. either we just stuff the driver into drm/apple as well or maybe it actually fits into drivers/mux (or possibly even somewhere else)
15:14sventhen tps6598x will be connected via those graph bindings to at least atcphy and the top-level dispay-subsystem node
15:15sventhe atcphy connection to configure the electrical side, the display-subsytem one to trigger the dcpext<->atcphy connection
15:15sventhen we'll probably need a connection from the thunderbolt NHI to the display-subsystem as well to trigger dcpext<->dpin0/1 connections
15:16_jannau_I think the connectors should link against the dcps/crtcs in the dt
15:16sventhat's the top-level node, isn't it?
15:16svenfor now i'll just a constant connection to atcphy1/dpphy anyway and just configure atcphy from python before I start linux ;)
15:16sven*i'll just hardcode
15:18_jannau_I haven't looked how it is supposed to look in the dt but crtc should map to dcp/dcpext* so not the top level display system node
15:18svenhuh, does that node already exists?
15:19_jannau_the disp0 node
15:20svenso when I said "top level display subsytem node" above I meant that one
15:20sventhe thing that also has apple,coprocessors or however it's called with the list of DCPs
15:21_jannau_yes. I mean that too. not sure how he connectors are supposed to work
15:22svenwhat do you mean with connectors?
15:23_jannau_I assume the "typec1: connector" nodes from tps6598x should somehow link to the display
15:23svensimilar to how they're connected to e.g. dwc3 or atcphy right now
15:24Soroush has joined #asahi-dev
15:24sveniirc the bindings for that already exist. port@0 is usb2, port@1 is usb3/SS lanes with their default use and port@2 is "anything else"
15:24_jannau_I guess for dispext it makes more sense if there are connected to the top level node
15:25svenand you can have multiple connections per port
15:25svenyeah, i think so
15:25svenbecause we can mux any dispext to any atcphy afaict
15:26_jannau_but dcp will have drm level connector which might make more sense to bind to dcp
15:26_jannau_mostly so that we do not call the internal display HDMI-A
15:26jakebot6022 has joined #asahi-dev
15:27svenwhat is a drm level connector?
15:27* svenhas no clue about drm so far
15:27jakebot602 has quit [Ping timeout: 480 seconds]
15:27jakebot6022 is now known as jakebot602
15:29svenbut anyway, just the thoughts I had in the last days. there's still plenty of time to change it. as i said, i'll first hardcode everything for dcpext0->atcphy0-dpphy
15:29sven*atcphy1 actually
15:30_jannau_the internal display pipeline in drm: see https://www.kernel.org/doc/html/v4.15/gpu/drm-kms.html for some pictures
15:31svenwow, documentation with nice pictures :D
15:31* svenlikes drm already
15:32_jannau_drm documentaion is not bad, only problem is that all the legacy stuff is documented as well. It would be nice if there was a stripped down version
15:38svenokay, so essentially we'll have one "internal screen" (macbooks) or "HDMI" (mac mini) connector and then "USB-C #n DP altmode", "USB-C #n USB4 Tunnel #0" and "USB-C #n USB4 Tunnel #1" for each atcphy
15:39svenoh, and that special HDMI port on uhhh.. the macbook pro
15:42_jannau_that looks right
15:46svenand I guess each of those can fire a hotplug event which we get from tps6598x for dp-altmode and thunderbolt-nhi for the others
15:47thelounge7571340 has joined #asahi-dev
15:47thelounge7571340 has quit [Remote host closed the connection]
15:47svenhrm, I guess we actually only fire that hotplug event after we've already configured the crossbar and everything I think
15:50_jannau_but how do we then know when/how to configure the crossbar?
15:51sventhen when is the easy part: when tps6598x or thunderbolt-nhi wants a stream
15:51sventhe how is going to be annoying
15:52svenespecially if I can actually hack dual external screens for the M1
15:52svenbut essentially we need to find a free dcpext and match that one to the atcphy input
15:53sventhe typec subsystem will needs some adjustments to forward the required stuff to atcphy anyway
15:53svenand I think I saw some patch series that introduced a OOB notification specifically for drm
15:55_jannau_with hotplug you meant the actual display hotplug. I assumed it meant the electril port hotplug as hint that a dcpext needs to be connected to that port
15:56svennow i'm confused :D
15:57sventhere's the electrical hotplug that comes from tps6598x/thunderbolt-nhi. once we get that we know that there's something that wants a DP stream and we need to select a dcpext and configure the crossbar
15:57_jannau_me too. starting from "I guess we actually only fire that hotplug event after we've already configured the crossbar"
15:57svenand then i think there's the drm hotplug which we only fire after the crossbar is configured and dcpext has done its link training
15:58tobhe_ has joined #asahi-dev
15:59_jannau_agreed. did't come the hotplug event before the link training? i.e. you saw it even before the link training was working
16:00svenit maybe comes at the start of link training
16:00svennot sure though
16:00svenbut it definitely only comes after atcphy is configured and the required methods on that dcpdptx-port-epic are called
16:01_jannau_yes, I was confused because I thought you were speaking about the exlectric hotplug
16:01tobhe has quit [Ping timeout: 480 seconds]
16:02svenI think I confused myself somewhere along the way and switched the meaning of hotplug :)
16:02svenI also don't think we can hardcode the dcpext<->atcphy relationship because there are situations where a single atcphy wants streams from two separate dcpexts for usb4 tunneling
16:04_jannau_hardcoding doesn't work at all when we have fewer dcpext than ports
16:04_jannau_i.e. it would only somewhat work on m1 max and ultra
16:05svensomething greedy should work at first though :D
16:05svenwhenever there's a new electrical hotplug just steal a dcpext or complain if none are available ;)
16:06_jannau_hardcode it in the beginning. I think it's reasonable to say during development external displays work only on port b
16:08svenoh, yeah, for now it'll only be atcphy1/dispext0
16:15svendottedmag: you had that tiled thunderbolt display that worked on m1, didn't you? do you have time to generate another trace for me sometime?
16:15dottedmagsven: sure
16:15svennice! i'll prepare something tomorrow or so
16:16svenessentially I hope that I can make dcp think that two separate displays connected to atcphy0 and atcphy1 are a single tiled display
16:16_jannau_does macos offers a display selection if you have more screens connected than dcpexts?
16:17dottedmag_jannau_: I can check what happens if I plug two monitors into M1 Air
16:18_jannau_I can check myself, not really a question which urgently needs an answer. thanks
16:26svendottedmag: https://github.com/svenpeter42/m1n1/blob/dcp-tracer-2/proxyclient/hv/trace_dcp.py if you have some time. preferably with that display connected at boot time. no need to disconnect it or anything afterwards
16:26sventhis will also generate a *lot* of spam
16:27svennote that there sometimes seems to be a bug where it complains about not being able to read from some DART page and then falls back into a python shell
16:27svenjust reboot in those cases and try again
16:29svenoh, and you can stop the trace the moment something appears on your screen
16:38goldsoultheory has joined #asahi-dev
16:43dottedmagsven: something appears or monitor says it has got the signal?
16:43svensomething appears to be safe
16:46dottedmagsven: okay, I tried three times and it failed during boot every time, before anything was displayed on the external screen.
16:46dottedmagdoes it matter if the lid is closed (so that I can force progress bar on the external screen)?
16:47svenfailed?
16:47svenclosing the lid should be fine
16:47dottedmagstopped with unmapped page
16:47svenhrm, that's quite frequent. it very rarely happens here
16:47svenyou can also try to just type "cont" and hope that nothing important is missing in the trace then
16:49MajorBiscuit has quit [Quit: WeeChat 3.5]
16:50thelounge7571340 has joined #asahi-dev
16:50thelounge7571340 has quit [Remote host closed the connection]
16:52Gaspare has quit [Quit: Gaspare]
16:52dottedmagsven: https://tea.dottedmag.net/~dottedmag/m1-lg5k-dcp-tracer-2.trace — 4 or 5 unmapped page complaints during boot though
16:53svenweird. i should look into why that happens
16:54sven[dptxport] [dcpdptx-port-epic0] > connectTo(target=0x8011 (CORE=0x1, ATC=0x1, DIE=0x0, CONNECTED=1), unk1=0x101)
16:54sven[dptxport] [dcpdptx-port-epic1] > connectTo(target=0x8012 (CORE=0x2, ATC=0x1, DIE=0x0, CONNECTED=1), unk1=0x101)
16:54svenso that's pretty much what I expected
16:55sveni guess CORE is actually ATCPHY_INPUT or something like that
16:55brentr123[m]My phone is blowing up right now
16:55brentr123[m]With notifications from here Jesus
16:57tobhe has joined #asahi-dev
17:04sveniomfb looks pretty normal
17:04svenso maybe it's literally just bring up both dptx and hope for the best
17:04tobhe_ has quit [Ping timeout: 480 seconds]
17:06svenit does start a DCPAVSplitDisplayVideoInterface though
17:16tobhe_ has joined #asahi-dev
17:16svenoh well. guess i'll have to add support to the linux driver and see what happens if I do that with two sreens
17:16svenunfortunately this m1 only has two usb-c ports which makes it impossible to test this from python :(
17:19tobhe has quit [Ping timeout: 480 seconds]
17:32yuyichao_ has quit [Ping timeout: 480 seconds]
17:52thelounge7571340 has joined #asahi-dev
17:53thelounge7571340 has quit [Remote host closed the connection]
18:02Gaspare has joined #asahi-dev
18:21jluthra has quit [Remote host closed the connection]
18:22jluthra has joined #asahi-dev
18:24Gaspare has quit [Quit: Gaspare]
18:36yamii has quit [Quit: WeeChat 3.6]
18:38yamii has joined #asahi-dev
18:40konradybcio has joined #asahi-dev
18:42konradybciosven: so basically I'm debating about the "default fallback" aic compatible and it would be nice if somebody could test whether or not m1 works with apple,s5l8960x-aic from the patchset
18:42konradybcioif it doesn't, it would make sense to keep the current apple,aic where it is and introduce a legacy fallback, I think
18:51cobcobs[m] has left #asahi-dev [#asahi-dev]
18:53thelounge7571340 has joined #asahi-dev
18:54thelounge7571340 has quit [Remote host closed the connection]
19:21yuyichao_ has joined #asahi-dev
19:47ljs has joined #asahi-dev
19:58thelounge7571340 has joined #asahi-dev
19:59thelounge7571340 has quit [Remote host closed the connection]
20:22goldsoultheory has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
20:31goldsoultheory has joined #asahi-dev
20:52nullroute has quit [Read error: Connection reset by peer]
20:53nullroute has joined #asahi-dev
20:59thelounge7571340 has joined #asahi-dev
20:59thelounge7571340 has quit [Remote host closed the connection]
21:08goldsoultheory has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
21:12bluetail has joined #asahi-dev
21:14ljs has quit [Remote host closed the connection]
21:19jlco has quit [Ping timeout: 480 seconds]
21:32goldsoultheory has joined #asahi-dev
21:53SSJGZ has quit [Ping timeout: 480 seconds]
22:04thelounge7571340 has joined #asahi-dev
22:04thelounge7571340 has quit [Remote host closed the connection]
22:29chipxxx has joined #asahi-dev
22:33goldsoultheory has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
22:45teddys has joined #asahi-dev
22:54gff_ has joined #asahi-dev
22:59gff has quit [Ping timeout: 480 seconds]
23:04thelounge7571340 has joined #asahi-dev
23:04thelounge7571340 has quit [Remote host closed the connection]
23:31snowcra5h has joined #asahi-dev
23:39CME has quit [Read error: No route to host]
23:40snowcra5h has quit [Quit: B1tch eX]
23:40snowcra5h has joined #asahi-dev
23:40CME has joined #asahi-dev
23:57rqou_ has joined #asahi-dev
23:58rqou_rcombs: (reading logs) i would like to poke you wrt ProRes
23:59rqou_rcombs: i've done enough reverse engineering of the hardware that it should be possible to start developing a linux-side driver, but i don't know anything about what would be needed on the kernel-userspace interface or above
…