#asahi-dev · 2023-11-24 18:01
ArcaneNibbleso... apple split out some cm3 IRQs?#asahi-dev · 2023-11-24 18:00
ArcaneNibblethe others use a revision number in a completely different range#asahi-dev · 2023-11-24 18:00
ArcaneNibbleso it might be A14?#asahi-dev · 2023-11-24 17:59
ArcaneNibbleclover might be older than viola? it uses smaller numbers in the unreadably messy start() function#asahi-dev · 2023-11-24 17:53
ArcaneNibbleno idea#asahi-dev · 2023-11-24 17:53
eilnwhat soc was clover?#asahi-dev · 2023-11-24 17:52
eilnpost executing PP, it's supposed to poll and do two magic writes into the status register. that value slightly differs per codec. https://github.com/eiln/m1n1/blob/avd/proxyclient/m1n1/fw/avd/decoder.py#L92C9-L92C23. these are after PP is completely done so it doesn't affect the output but it "resets" PP for the following runs.#asahi-dev · 2023-11-24 17:50
ArcaneNibblefrom a quick eyeball of the firmwares we have on hand here, clover/viola are different from dahlia/radish/lilyC/lilyD#asahi-dev · 2023-11-24 17:45
ArcaneNibbleoh! viola firmware IRQs are totally different!#asahi-dev · 2023-11-24 17:44
eilnj293ap 13.5 viola, it's in the tarball#asahi-dev · 2023-11-24 17:44
ArcaneNibblewhich version are you looking at?#asahi-dev · 2023-11-24 17:44
ArcaneNibblehmm, maybe lilyD is totally different#asahi-dev · 2023-11-24 17:43
eilnwe might be talking about different things, but it's not an infinite loop, it's polling the status register to change. it's why I added the w_40104060 hook#asahi-dev · 2023-11-24 17:42
ArcaneNibblefirst one pokes a status register then calls a shared handler that logs 'CtxD', second one logs 'H?Er' (error?), and the other two do more complicated things#asahi-dev · 2023-11-24 17:41
ArcaneNibbleso groups of 4, stride of 5#asahi-dev · 2023-11-24 17:41
ArcaneNibbleoh sorry, the 5th one is always an infinite loop#asahi-dev · 2023-11-24 17:40
eiln5, interesting.#asahi-dev · 2023-11-24 17:39
eilnif you unpack that into data/* you should be able to run my forked avd_emu.py#asahi-dev · 2023-11-24 17:39
eilncan you get this? https://www.dropbox.com/scl/fi/255zktwxy4z98bd31vlx9/avd-sample.tar.gz?rlkey=qj8mw6h1fqlbsa1lvwvknndd6&dl=0#asahi-dev · 2023-11-24 17:38
ArcaneNibblewhich we had been guessing was interrupts for each VP being done or having an error#asahi-dev · 2023-11-24 17:36
ArcaneNibblein groups of 5#asahi-dev · 2023-11-24 17:36
ArcaneNibblein lilyD, there's handlers in the cm3 firmware for IRQ78 and up#asahi-dev · 2023-11-24 17:35
eilnlet me upload a tarball of j293 trace samples#asahi-dev · 2023-11-24 17:33
ArcaneNibble(we're looking at a very different version of the firmware so the addresses won't match up)#asahi-dev · 2023-11-24 17:32
ArcaneNibbleeiln: oh, you mean writes to registers at 40100124 and after?#asahi-dev · 2023-11-24 17:31
nicolas17janneg: there's registers for (in order): H265, ???, H264, VP9#asahi-dev · 2023-11-24 17:30
jannegnicolas17: VP9? they supposedly added that for Google/Youtube on A* chips but didn't want to support it / let the world know#asahi-dev · 2023-11-24 17:30
nicolas17time to shine for the data hoarders#asahi-dev · 2023-11-24 17:28
nicolas17eiln: I just read your blog post... I wonder if there's some version of macOS where they did leave behind code for the mystery codec :o#asahi-dev · 2023-11-24 17:26
eilnbut I can't imagine a cortex-m3 is any faster, and I don't think that's worth the IPC#asahi-dev · 2023-11-24 17:25
eilnsorry https://github.com/eiln/avd/blob/main/avd_emu.py#L608-L609#asahi-dev · 2023-11-24 17:25
ArcaneNibblebut i was thinking that for an RE'd implementation we'd either want "m3 does almost nothing, just proxies interrupts" or "m3 does a lot of offloading in a more competent way than apple"#asahi-dev · 2023-11-24 17:24
ArcaneNibbledon't quite follow which bits of code you're looking at#asahi-dev · 2023-11-24 17:21
eilnavd has another power domain which is not in the device tree and not PMGR, lovely. it's enabled by write 0xfff I believe. it's gated on that. and I believe there is no "off" write#asahi-dev · 2023-11-24 17:19
eilnline 607 in avd_emu.py (heh) is the non-aic (PP) interrupt I believe. it does two writes at the polled status register which, if it doesn't, PP fails after the fifth-ish run#asahi-dev · 2023-11-24 17:19
ArcaneNibbleis the M3's memory lost on power gate?#asahi-dev · 2023-11-24 17:18
eilnexecuting code in a power-gated range is such a nightmare that I'd like to avoid that if we can#asahi-dev · 2023-11-24 17:10
ArcaneNibbleit *also* polls status registers, yes#asahi-dev · 2023-11-24 17:10
ArcaneNibblethe firmware definitely has IRQ handlers in the vector table#asahi-dev · 2023-11-24 17:09
nicolas17I'm not a video codec expert, but I understand like, MPEG2 at a conceptual level#asahi-dev · 2023-11-24 17:08
eilnI don't think VP/PP interrupts at all considering CM3 polls a status register#asahi-dev · 2023-11-24 17:05
eilnI'm not a video codec expert (jannau is) but I haven't ran into much math stuff. it's mostly RTFM and figuring out bitfields#asahi-dev · 2023-11-24 17:03
ArcaneNibblewhich is one thing that the M3 notably does#asahi-dev · 2023-11-24 17:03
ArcaneNibblehm, pretty sure the VP/PP interrupts aren't routed to the main CPU?#asahi-dev · 2023-11-24 17:02
eilnArcaneNibble: good to hear from you :) I don't even plan on using the coprocessor, let alone firmware#asahi-dev · 2023-11-24 17:02
eilnnicolas17: prores is an intra-only codec so people editing video can seek fast#asahi-dev · 2023-11-24 16:47
ArcaneNibbleexcellent work!#asahi-dev · 2023-11-24 16:47
ArcaneNibbleooh, just found https://eiln.net/avd-notes2.html#asahi-dev · 2023-11-24 16:24
ArcaneNibblei think we'd want to completely rip out apple's M3 firmware for it though, it is terrible#asahi-dev · 2023-11-24 16:23
ArcaneNibblethe biggest blocker for AVD on my part (other than burnout) is not knowing all that much about video codecs