ChanServ changed the topic of #asahi-dev to: Asahi Linux: porting Linux to Apple Silicon macs | Non-development talk: #asahi | General development | GitHub: https://alx.sh/g | Wiki: https://alx.sh/w | Logs: https://alx.sh/l/asahi-dev
<chadmed>
i just want to make sure we dont have any severe performance/interactivity regressions
mrhh has quit [Ping timeout: 480 seconds]
mikelee has joined #asahi-dev
mikelee has quit [Ping timeout: 480 seconds]
fenix144 has joined #asahi-dev
gabuscus has quit []
mikelee has joined #asahi-dev
fenix144 has quit [Remote host closed the connection]
gabuscus has joined #asahi-dev
mikelee has quit [Ping timeout: 480 seconds]
mikelee has joined #asahi-dev
jeisom has joined #asahi-dev
maria has joined #asahi-dev
mikelee has quit [Ping timeout: 480 seconds]
mikelee has joined #asahi-dev
mikelee has quit [Ping timeout: 480 seconds]
mikelee has joined #asahi-dev
chadmed has quit [Remote host closed the connection]
chadmed has joined #asahi-dev
mikelee has quit [Ping timeout: 480 seconds]
mikelee has joined #asahi-dev
erso has quit [Ping timeout: 480 seconds]
mikelee has quit [Ping timeout: 480 seconds]
Method has quit [Read error: Connection reset by peer]
jeisom has quit [Ping timeout: 480 seconds]
erso has joined #asahi-dev
erso has quit [Ping timeout: 480 seconds]
mikelee has joined #asahi-dev
erso has joined #asahi-dev
erso has quit [Ping timeout: 480 seconds]
mikelee has quit [Ping timeout: 480 seconds]
mikelee has joined #asahi-dev
erso has joined #asahi-dev
erso has quit [Ping timeout: 480 seconds]
mikelee has quit [Ping timeout: 480 seconds]
erso has joined #asahi-dev
mikelee has joined #asahi-dev
erso has quit [Ping timeout: 480 seconds]
mikelee has quit [Ping timeout: 480 seconds]
erso has joined #asahi-dev
mikelee has joined #asahi-dev
erso has quit [Ping timeout: 480 seconds]
erso has joined #asahi-dev
pg12_ has quit []
pg12 has joined #asahi-dev
mikelee has quit [Ping timeout: 480 seconds]
erso has quit [Ping timeout: 480 seconds]
zachole_ has joined #asahi-dev
zachole has quit [Remote host closed the connection]
erso has joined #asahi-dev
erso has quit [Ping timeout: 480 seconds]
mikelee has joined #asahi-dev
erso has joined #asahi-dev
mikelee has quit [Ping timeout: 480 seconds]
erso has quit [Ping timeout: 480 seconds]
mikelee has joined #asahi-dev
erso has joined #asahi-dev
erso has quit [Ping timeout: 480 seconds]
mikelee has quit [Ping timeout: 480 seconds]
erso has joined #asahi-dev
erso has quit [Ping timeout: 480 seconds]
mikelee has joined #asahi-dev
crabbedhaloablut has joined #asahi-dev
erso has joined #asahi-dev
sid-linux has joined #asahi-dev
<sid-linux>
chadmed: thanks again :)
<sid-linux>
sorry wrong username !
<sid-linux>
sid-linux: thanks for the link to the firmware overview ChaosPrincess -- very useful..
sid-linux has quit []
erso has quit [Ping timeout: 480 seconds]
mikelee has quit [Ping timeout: 480 seconds]
erso has joined #asahi-dev
erso has quit [Ping timeout: 480 seconds]
erso has joined #asahi-dev
<dottedmag>
I see previous discussion on lack of vblank IRQ (good riddance!) Does DCP provide a event+timestamp for "this fb/crtc configuration is being presented", and is it exposed by DRM somehow? 16ms is quite a bit of time room, so it would be nice to be able to synchronize with actual refresh.
mikelee has joined #asahi-dev
<jannau>
dottedmag: for now the swaps are immediate and blocking so you have a rough idea when the previous one was. the FW interface has timestamps, supposedly for VRR and async swaps. The driver doesn't use that yet and I haven't really looked into how that fits into drm/kms
erso has quit [Ping timeout: 480 seconds]
<dottedmag>
jannau: So, do I get it right that for now DRM_IOCTL_MODE_ATOMIC blocks, and DRM_MODE_ATOMIC_NONBLOCK is not supported?
<jannau>
unsure, DRM atomic helpers might handle DRM_MODE_ATOMIC_NONBLOCK for us but the fw/hw swap is blocking
<dottedmag>
I see. So when in the lifecycle of the frame swap unblocks? I'm not sure how it works. I guess at some point DCP should stop reading from one framebuffer and start reading from another. I guess that without further nudging it does not do that within the frame, so it's somewhere within vblank? Is it when DCP releases the previous framebuffer after it's done with the frame, or when DCP starts reading the new one?
erso has joined #asahi-dev
<dottedmag>
Or anywhere in between?
<jannau>
on DRM side we can release the FB only after DCP reported the swap to the new FB as completed. everything else led to crashes of the HW display controller due to reading unmapped memory
<chadmed>
is that why we get stuttering when doing ops like changing the CTM or brightness? or is that something else
<jannau>
I suppose DCP reports the swap as completed in vblank, i.e. after it stopped accessing the old FB
<dottedmag>
Yep, so the swap returns after the previous framebuffer has been dealt with. This leaves uncertainty when swap can return during the vblank (which is still >=4% of the frame length). I guess I'd better empirically test it.
erso has quit [Ping timeout: 480 seconds]
mikelee has quit [Remote host closed the connection]
mikelee has joined #asahi-dev
<jannau>
chadmed: I haven't noticed that but haven't tested specifically for it. For CTM updates it depends on how userspace handles them. if it does a CTM update independently of FB updates it will lose one FB update
<jannau>
brightness should be ok though but I better should check the implementation\
<chadmed>
yeah i tried to go through the iomfb swap implementation to see what was up a while ago but i ran out of time
<chadmed>
basically just stutters/fps drops when changing brightness which is also the only time the CTM seems to get updated
<chadmed>
but that could be a kwin thing
erso has joined #asahi-dev
Method has joined #asahi-dev
<jannau>
does that mean the color temperature preview in system settings doesn't work for you? change the setting to "always on night color" and move the "night color temperature" around while keep the left mouse button presses
<jannau>
if you move it fast you can see lag which is caused by blocking ctm updates and "stealing" frame updates from rendering
<jannau>
I suppose I should check if CTM updates need a swap, they probably don't
erso has quit [Ping timeout: 480 seconds]
mkurz has quit [Read error: Connection reset by peer]
mikelee has quit [Remote host closed the connection]
<chadmed>
correct, the preview doesnt work correctly
<jannau>
define correctly
<chadmed>
it does not update when you move the slider
<chadmed>
i would have assumed that a swap is necessary with the current implementation since the code that updates the CTM lives in iomfb swap
<jannau>
it does here
<chadmed>
i changed compositor settings to force lowest latency and it works
<chadmed>
so thats probably a kwin thing
<jannau>
the question is whether it's necessary to a swap with DCP. It lives in the function responsible for atomic updates
<jannau>
which setting was the previous one? I have "Force smoothest animations" and "Reduce latency by allowing screen tearing ...", not sure if/how the latter would make a difference with wayland
erso has joined #asahi-dev
<chadmed>
i had "force smoothest animations" set
<jannau>
color preview works with all settings here
<chadmed>
hm no yeah that wasnt it, it works now???
<chadmed>
dunno what would cause it to be intermittend
<chadmed>
intermittent*
erso has quit [Ping timeout: 480 seconds]
mikelee has joined #asahi-dev
mikelee has quit [Remote host closed the connection]
<jannau>
strange, except for the lag it has always worked here
<marcan>
chadmed: I don't think that's related, there's something wacky there
<marcan>
(the stuttering)
erso has joined #asahi-dev
<chadmed>
yeah its odd, ive experienced it since dcp was first merged in on both asahi and gentoo
<chadmed>
and ive detonated my root fs multiple times in between
<marcan>
the stutter on brightness happens for me everywhere
<marcan>
I've never seen it smooth
<jannau>
standalone CTM updates will consume one swap which can't be sed for screen updates. it shouldn't and probably doesn't need to
<dottedmag>
jannau: you mean CTM update should return and fold the change into next screen update?
erso has quit [Ping timeout: 480 seconds]
<jannau>
brightness updates probably consume a swap as well. I thought I left the code in which waits and checks if a swap already updated the brightness
<jannau>
dottedmag: no, at least from the FW interface CTM updates and swaps are decoupled, it's a driver limitation that it swaps after an CTM update
mikelee has joined #asahi-dev
zachole_ has quit [Read error: Connection reset by peer]
zachole has joined #asahi-dev
erso has joined #asahi-dev
erso has quit [Ping timeout: 480 seconds]
mikelee has quit [Ping timeout: 480 seconds]
zachole has quit [Read error: Connection reset by peer]
zachole_ has joined #asahi-dev
erso has joined #asahi-dev
pg12 has quit [Quit: pg12]
nsklaus has joined #asahi-dev
erso has quit [Ping timeout: 480 seconds]
pg12_ has joined #asahi-dev
pg12_ has quit []
erso has joined #asahi-dev
pg12 has joined #asahi-dev
rootbeerdan has quit [Ping timeout: 480 seconds]
erso has quit [Ping timeout: 480 seconds]
pg12 has quit [Quit: pg12]
erso has joined #asahi-dev
zachole_ has quit [Read error: Connection reset by peer]
darkapex has quit [Ping timeout: 480 seconds]
zachole has joined #asahi-dev
pg12 has joined #asahi-dev
ourdumbfuture has joined #asahi-dev
mikelee has joined #asahi-dev
<jannau>
not sure what happens with the CTM updates but I can't avoid the swap in the current form. I need to check what kwin does and if other drivers have special shortcuts for this. night color on intel (using gamma tables is smother)
mikelee has quit [Remote host closed the connection]
zachole has quit [Quit: Leaving...]
mikelee has joined #asahi-dev
ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mikelee has quit [Remote host closed the connection]
cylm has joined #asahi-dev
mikelee has joined #asahi-dev
mikelee has quit [Remote host closed the connection]
mikelee has joined #asahi-dev
mikelee has quit [Remote host closed the connection]
erso has quit [Ping timeout: 480 seconds]
erso has joined #asahi-dev
Z750 has quit [Quit: Ping timeout (120 seconds)]
Z750 has joined #asahi-dev
mikelee has joined #asahi-dev
mikelee has quit [Remote host closed the connection]
ourdumbfuture has joined #asahi-dev
mikelee has joined #asahi-dev
mikelee has quit [Remote host closed the connection]
jeisom has joined #asahi-dev
mikelee has joined #asahi-dev
ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mikelee has quit [Remote host closed the connection]
<chadmed>
at a loss for what needs to be implemented for the distortion stage of the pipeline though and i dont want to just wholesale rip off calf's implementation
<chadmed>
thats not how to learn things
<chadmed>
theres a fair amount of zipper noise on the biquads, dunno if thats because of the implementation in the crate or because im tearing down the entire array and rebuilding it each time i change Fc :P
mikelee_ has quit [Remote host closed the connection]
<kettenis>
sven: do the type-C ports remain powered in suspend on Linux?
hightower2 has joined #asahi-dev
mikelee has joined #asahi-dev
<jannau>
oh. `for b in $(seq 255); echo $b > /sys/class/backlight/apple-panel-bl/brightness; done` freezes/deadlocks dcp
mikelee has quit [Remote host closed the connection]
mikelee has joined #asahi-dev
mikelee has quit [Remote host closed the connection]
mikelee has joined #asahi-dev
<sven>
kettenis: I never checked tbh, but unless we suspend the tipd chip they should stay powered I think
<sven>
xhci suspend/resume is broke though as marcan noticed a while ago :/
<sven>
*broken
mikelee has quit [Remote host closed the connection]
mikelee has joined #asahi-dev
mikelee has quit [Remote host closed the connection]
mikelee has joined #asahi-dev
ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mikelee has quit [Remote host closed the connection]
mikelee has joined #asahi-dev
ourdumbfuture has joined #asahi-dev
ourdumbfuture has quit [Ping timeout: 480 seconds]
<eiln>
this is a much better script with the bootargs parsed
<eiln>
the next step is enabling fw print through the "ioctl"/cmd
<eiln>
im working on the irq & command arg structs
<kettenis>
sven: thanks, lemme try that
<ChaosPrincess>
eiln: i have this as tunables apply code, and while im not sure, i think you might be able to skip at least some of the writes in the bridge_evt_ctrs block https://paste.bingner.com/paste/xrn3w
<ChaosPrincess>
also, i dont think you need a reset after load_fw, but again, not 100% sure
<eiln>
ChaosPrincess: without the reset it doesn't run on the second run (and requires reboot). i need to look into it though
<eiln>
the +0x8000s aren't necessary, they're something to do with voltages in powertop
<eiln>
*powermetrics
eiln has quit [Quit: WeeChat 4.0.0]
jeisom_ has joined #asahi-dev
jeisom has quit [Read error: Connection reset by peer]
fenix144 has joined #asahi-dev
ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<sven>
jannau: my memory's a bit fuzzy for the multi-die t600x, do you remember how the crossbar works there? was is a single crossbar for each die that can only route between the ports on that die and the dcpext on that die?
<sven>
*it
fenix144 has quit [Remote host closed the connection]
<jannau>
sven: I think we concluded that the crossbars are per die without ultrafusion links
<sven>
okay, makes sense
<sven>
i'm trying to write down what we currently know while trying to turn my vague idea into something that resembles a device tree ;)
mrhh has joined #asahi-dev
mikelee has quit [Remote host closed the connection]
mikelee has joined #asahi-dev
mikelee_ has joined #asahi-dev
mikelee has quit [Read error: Connection reset by peer]
mikelee has joined #asahi-dev
mikelee has quit [Remote host closed the connection]
mikelee_ has quit [Ping timeout: 480 seconds]
mrhh has quit [Ping timeout: 480 seconds]
mrhh has joined #asahi-dev
erso has quit [Quit: leaving]
abd has joined #asahi-dev
mikelee has joined #asahi-dev
darkapex has joined #asahi-dev
abd has quit [Ping timeout: 480 seconds]
ourdumbfuture has joined #asahi-dev
mrhh has quit [Ping timeout: 480 seconds]
mikelee has quit [Remote host closed the connection]
ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ourdumbfuture has joined #asahi-dev
hightower2 has quit [Ping timeout: 480 seconds]
abd has joined #asahi-dev
Guest6081 has quit [Quit: Bridge terminating on SIGTERM]
rhysmdnz has quit [Quit: Bridge terminating on SIGTERM]
rhysmdnz has joined #asahi-dev
Jamie has joined #asahi-dev
Jamie is now known as Guest6167
<marcan>
sven: I hope the suspend thing just means we need more atcphy crap (ugh but doable) and not that it really is broken
<marcan>
need to trace dwc3/atcphy through a suspend cycle on macos...
abd has quit [Ping timeout: 480 seconds]
<sven>
someone*cough* just needs to make the hv survive the wake-up:p
<sven>
but didn’t xnu completely shut down atcphy when suspending? or do I remember that wrong?
hightower2 has joined #asahi-dev
WindowPa- has joined #asahi-dev
WindowPain has quit [Ping timeout: 480 seconds]
phire has quit [Remote host closed the connection]
phire has joined #asahi-dev
signaryk has joined #asahi-dev
jeisom_ has quit [Quit: Leaving]
eiln has joined #asahi-dev
abd has joined #asahi-dev
<eiln>
5am again, but i got the isp firmware to do its init dance
<sven>
I wish I could still do the „hack until 5am“ thing without regretting it for the next week or so :D
<sven>
nice work :)
<eiln>
sven: thank you, dcp/ipc.py was really helpful :)
<eiln>
ChaosPrincess: the sensors should be next. im really not familiar with the color/calibration magic though
eiln has quit [Quit: WeeChat 4.0.0]
jeisom has joined #asahi-dev
lewurm`` has quit [Ping timeout: 480 seconds]
jeisom has quit [Ping timeout: 480 seconds]
<jannau>
is it reasonable to assume that devices are shutdown sufficiently when they detach from the iommu so they don't access memory
<jannau>
looking into whether I need to save and restore the boot level one table for locked darts
<jannau>
so I guess I should be answer that for dcp but I guess other coprocessor without locked darts are affected as well
<jannau>
should be fine in the sane that we restore reserved boot regions when the device re-attaches
<jannau>
dcp should be fine in the sense that we will never return to simpledrm. also the use case for detaching from the iommu is a bit esoteric to begin with
<sven>
detaching is essentially „attach new iommu domain“ isn’t it?
<jannau>
I was looking at .release_device which should be fine. attaching to new iommu domain might be a problem if apple_dart_domain_free() is called
<jannau>
and I fear I will run into that once I use an unmanaged domain for dcp piodma
<sven>
oh, right, there’s also the „this device disappeared“ callback
<sven>
if our drivers aren’t broken we really shouldn’t try any DMA after that :D
<kettenis>
sven: S5 turns off VBUS, S3 doesn't
<sven>
good to know!
<sven>
so that SSPS command to S5 works?
<sven>
iirc there were also other power related commands for that tipd chip but they all didn’t work on apple’s firmware
<kettenis>
yup
<sven>
nice :)
<kettenis>
I put it back into S0 upon resume and the USB devices reattach
<kettenis>
(note that I don't have USB3 working yet)
<sven>
I’ll probably push some updates to the usb3 sequence next weekend or so fwiw
<sven>
the current one is slightly different from xnu and might have lead to some weird issues for some people
<kettenis>
might give it another try at that point
<sven>
and iirc the broken behavior happened when using the xhci suspend mechanism
<kettenis>
my previous attempt didn't work
<sven>
i think the ports got stuck it sone non-ready state ok resume
<sven>
atcphy is very picky when it comes to those magic pokes unfortunately :-(
<sven>
s/ok/on/
ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ourdumbfuture has joined #asahi-dev
roxfan has quit [Ping timeout: 480 seconds]
abd has quit [Ping timeout: 480 seconds]
abd has joined #asahi-dev
ourdumbfuture has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ourdumbfuture has joined #asahi-dev
jeisom has joined #asahi-dev
abd has quit [Ping timeout: 480 seconds]
nsklaus has quit [Ping timeout: 480 seconds]
crabbedhaloablut has quit []
c10l5 has quit []
c10l5 has joined #asahi-dev
fenix144 has joined #asahi-dev
fenix144 has quit [Remote host closed the connection]