#
#asahi-dev · 2025-12-18 11:27
oliver_how can i read out the mmio, you have any pointers for me?
#asahi-dev · 2025-12-18 11:26
chadmedthat or the driver is waiting for a swap to finish then just going ts_prev + 1/refresh rate when doing the next swap
#asahi-dev · 2025-12-18 11:25
chaos_princessprobably getting it from that dcp mmio?
#asahi-dev · 2025-12-18 11:25
oliver_looks like it is keeping track of its own "virtual" time
#asahi-dev · 2025-12-18 11:24
oliver_yes, i get that, i would assume that macos writes ts1=cntpct+8.33ms... but it doesnt, it just writes ts1=ts1_prev + 8.33ms, even if cntpct increased by 100ms
#asahi-dev · 2025-12-18 11:24
chadmedif ts1 _seems_ to always be tied to the "target" refresh rate then perhaps as i suspected last night it should be tied to the currently set mode when submitting a swap
#asahi-dev · 2025-12-18 11:23
chadmedcntpct is going to keep incrementing at 24mhz no matter what youre doing so that could explain why the values drift (if im reading your plot correctly)
#asahi-dev · 2025-12-18 11:23
chadmedi wouldnt discount m1n1 itself stealing time in this case. tracing is slow as heck and if youre only getting a swap complete every 100ms then your real timing is going to be way off
#asahi-dev · 2025-12-18 11:22
oliver_haha, yea i know what 8.33ms means, my question is: why is it set totally independent of the real time
#asahi-dev · 2025-12-18 11:20
chadmedoliver_: now do 8.333^-1 :P
#asahi-dev · 2025-12-18 11:09
oliver_what i do see is that the dcp ts1 is updated by exactly 8.33ms, even when we get a real frame only every 100ms while tracing. for ts2 and ts3 macos adds ~14ms and ~12ms on top, independent of the target frame rate. so maybe it does not even depend on the realtime clock. thats something i'll try out now
#asahi-dev · 2025-12-18 10:23
oliver_I did verify that cntpct correlates to realtime values. any idea why this might be the case?
#asahi-dev · 2025-12-18 10:23
oliver_interesting: when comparing cntpct against the timestamps that are submitted in dcp swap requests, the values are totally off when tracing. cntpct vs dcp ts value: https://files.narf.zone/156ad921f5d8432d/Screenshot%20From%202025-12-18%2011-16-39.png
#asahi-dev · 2025-12-18 01:55
b074should I get the kernelcache from a copy of macOS with the same version as the kernel, or can I just install KDK on my primary install and create the cache from it?
#asahi-dev · 2025-12-17 17:53
oliver_Thank you
#asahi-dev · 2025-12-17 17:09
jannauoliver_: https://gist.github.com/jannau/522cccad57274dbefe9ae174c6df1143
#asahi-dev · 2025-12-17 16:55
jannauoliver_: HV has `show_timestamps` which reads CNTPCT_EL0
#asahi-dev · 2025-12-17 16:53
oliver_print(f"XXX Timestamps {ts3:0.2f}\t{ts1-ts3:0.2f}ms\t{ts2-ts3:0.2f}ms\t{ts1-ts2:0.2f}ms\t{fps}hz")
#asahi-dev · 2025-12-17 16:52
jannauthe other columns are ts1, ts2 - t1, ts2?
#asahi-dev · 2025-12-17 16:52
nickchancntvct_el0 is just a sysreg
#asahi-dev · 2025-12-17 16:51
oliver_CNTVCT_EL0 or the clock of the dcp if that can differ.
#asahi-dev · 2025-12-17 16:50
oliver_the first timestamp is ts3, the third timestamp in the payload. i did not yet look into how to read cntvct_el0. if you could give me a hint i can try that tomorrow ... at least if my kid doesnt need to stay home
#asahi-dev · 2025-12-17 16:49
jannauno need for traces I have my own. the timestamp in the beginning are CNTVCT_EL0?
#asahi-dev · 2025-12-17 16:48
nickchana7-a11 pmu events v9... fixed some stuff up regarding 32-bit instruction events. this may be getting annoying
#asahi-dev · 2025-12-17 16:47
jannauI ordered some cheapish photo diodes with over the top specs. the rest I have on hand
#asahi-dev · 2025-12-17 16:46
oliver_i can send you the trace file if you're interested and dont want to trace yourself
#asahi-dev · 2025-12-17 16:45
oliver_in the gist? yea, offsets from the first value, which is ts3 in swap_submit
#asahi-dev · 2025-12-17 16:44
jannauare these are offsets from the first value?
#asahi-dev · 2025-12-17 16:43
chaos_princesslatency measuring tool
#asahi-dev · 2025-12-17 16:43
oliver_ldat?
#asahi-dev · 2025-12-17 16:43
chaos_princessi guess we now need someone with a ldat to see what would happen if we set it to 6ms instead
#asahi-dev · 2025-12-17 16:42
chaos_princessweird
#asahi-dev · 2025-12-17 16:42
chaos_princesshuh
#asahi-dev · 2025-12-17 16:41
oliver_i did some more dcp tracing to make more sense of the timestamps. interestingly, it looks like it doesnt really matter. in my traces, macos always sets ts1 to 12-13ms and ts2 to ~2ms. https://gist.github.com/oliverbestmann/96f2831df41874b77fab1939a98fc654
#asahi-dev · 2025-12-17 14:49
lm_Who said anything about it working :D
#asahi-dev · 2025-12-17 14:49
nickchanbut i am glad that method does work for usb2
#asahi-dev · 2025-12-17 14:49
nickchanthat doesn't really work for any phy more complex than usb2
#asahi-dev · 2025-12-17 14:48
lm_Just RE with your eyes closed...
#asahi-dev · 2025-12-17 14:43
sven that tbt controller (or maybe atcphy) also has a watchdog that likes to reset the entire SoC if you look at it wrong
#asahi-dev · 2025-12-17 14:43
lm_Memory safety bugs probably
#asahi-dev · 2025-12-17 14:42
svenlol, what could go wrong :D
#asahi-dev · 2025-12-17 14:40
lm_But no pressure
#asahi-dev · 2025-12-17 14:40
lm_Most hyped live RE event of the year and maybe decade
#asahi-dev · 2025-12-17 14:38
j`eydo a live demo of tbt bring up instead of slides :P
#asahi-dev · 2025-12-17 14:38
svenif I get slides done before 39c3 I’ll do tbt bring up there. So far I don’t have a single slide ready though
#asahi-dev · 2025-12-17 14:37
svenpossibly, DCP probably isn’t though
#asahi-dev · 2025-12-17 14:37
lm_Is the world ready for Asahi with DP-altmode?
#asahi-dev · 2025-12-17 14:35
svenI think that’s even mentioned in the cover letter
#asahi-dev · 2025-12-17 14:35
svenit’s hardly a secret that I’ll get tbt working and upstream after atcphy ;)
#asahi-dev · 2025-12-17 14:34
lm_Don't jinx it

plus ›