#asahi-re · 2022-03-28 09:49
marcanall display output hardware has scaling these days...#asahi-re · 2022-03-28 09:49
marcanyou can put the video surface below an overlay layer with the rest of the UI#asahi-re · 2022-03-28 09:49
marcanand basic scaling#asahi-re · 2022-03-28 09:49
marcanDCP supports alpha channels, it can composite for you#asahi-re · 2022-03-28 09:47
marcanand the reason for this is so that macos can do stuff like play 4K youtube videos in safari with the GPU *off* and the video decoder feeding directly into a DCP surface with minimum memory bandwidth usage#asahi-re · 2022-03-28 09:46
marcanDCP has a whole bunch of that#asahi-re · 2022-03-28 09:46
marcanrqou_: also re compressed formats, at least some of them need additional out of band metadata beyond dimensions/pitch as usual#asahi-re · 2022-03-28 09:44
marcanand around things like keeping decode output in VRAM, which is also not the case here#asahi-re · 2022-03-28 09:44
marcane.g. the x86 world of video decoding is centered around GPUs doing it, which is not the case here#asahi-re · 2022-03-28 09:44
marcanalso keep in mind that "the x86 way" is often the wrong way#asahi-re · 2022-03-28 09:43
marcansomething along those lines is probably the way to go, but it needs to be discussed with upstream to make sure what we're doing makes sense#asahi-re · 2022-03-28 09:43
marcanfor video codecs there's different frameworks, stuff like v4l m2m#asahi-re · 2022-03-28 09:42
marcanour goal is to do things right and upstream them, and that isn't upstreamable#asahi-re · 2022-03-28 09:42
marcanleave that nonsense to lazy hardware vendors#asahi-re · 2022-03-28 09:42
marcanwe're shaving all the yaks here, no char/misc devices please#asahi-re · 2022-03-28 09:42
marcanyeah no#asahi-re · 2022-03-25 08:35
marcanbasically drop code that is not necessary to make the hardware work, unless there is good reason to suspect it might be necessary in some cases#asahi-re · 2022-03-25 08:34
marcanyou could try using an asm snippet to race the write/read as fast as possible, if you can't get it to ever fail the loop condition on the first readback, just drop the whole loop#asahi-re · 2022-03-25 08:33
marcanmight even be a workaround for broken older hardware#asahi-re · 2022-03-25 08:33
marcanre the RST_INTERVAL thing, if the HV trace shows that condition being immediately met, it could just be something we can ignore without the poll#asahi-re · 2022-03-25 08:26
marcansame thing I do when I end up looking at code#asahi-re · 2022-03-25 08:26
marcanyeah, looks like you did a good job then :)#asahi-re · 2022-03-25 08:25
marcan(which might just be because this driver is just extra dumb in how it sets up the hardware)#asahi-re · 2022-03-25 08:25
marcanyou've basically written hardware docs with this, it's practically cleanroom already this way the way it ended up#asahi-re · 2022-03-25 08:24
marcanbut the whole point of these m1n1 scripts is to serve as a cleanroom-ish firewall, and given the state this one's in, I'm perfectly happy with someone else taking it and writing the Linux version#asahi-re · 2022-03-25 08:24
marcananother story is writing the Linux driver, since that would depend on trusting you not to "accidentally" carry over more than what is actually written down in that script per se; that I cannot guarantee yet (though you do seem to know what you're doing)#asahi-re · 2022-03-25 08:22
marcanbut if you're telling me it's RE'd and I look at it and it's so dumbed down there's nothing copyrightable left... then we're good#asahi-re · 2022-03-25 08:21
marcanas I said in the policy, the rule is "cleanroom if I don't know you" by default, especially because I *absolutely* don't want anyone sneaking in RE'd code without declaring it as such, that would get us in a ton of trouble#asahi-re · 2022-03-25 08:20
marcanI'd say so#asahi-re · 2022-03-25 08:19
marcanwhat becomes a problem is when you have nontrivial algorithms#asahi-re · 2022-03-25 08:19
marcanI've heard a lawyer's opinion that register names are not copyrightable either, though I prefer to change them anyway because usually the "official" names are terrible, but basically I'm not worried about looking at and rewriting register names#asahi-re · 2022-03-25 08:18
marcanespecially if you're going through python (which is one very good reason why I prototype in m1n1) since that wipes out any copyritability of language-specific details#asahi-re · 2022-03-25 08:18
marcanthe unwritten rules are that MMIO traces are fair game, and facts about how the hardware works are not copyrightable, nor are trivial mathematical expressions that are the one obvious way to implement a particular function (like those you have in there) or stuff like a for loop to clear an array#asahi-re · 2022-03-25 08:16
marcanbasically though, I'm very much not worried about what you have in that dump#asahi-re · 2022-03-25 08:16
marcanbut not strictly required#asahi-re · 2022-03-25 08:15
marcanright, and working those things out is much preferred#asahi-re · 2022-03-25 08:15
marcanit's what I do too#asahi-re · 2022-03-25 08:15
marcanyeah, that's a very good thing#asahi-re · 2022-03-25 08:14
marcani.e. just document for each register what values / fields get set for specific formats#asahi-re · 2022-03-25 08:14
marcansince it's again going to be the same info you get from a trace#asahi-re · 2022-03-25 08:14
marcanif the table boils down to "these are the register values for this format" then simply document that and let someone else write the ~same table#asahi-re · 2022-03-25 08:13
marcanbut it depends on what those tables are#asahi-re · 2022-03-25 08:13
marcanideally we'd work out those permutations from HV traces, or from guesswork at this point#asahi-re · 2022-03-25 08:12
marcanactually the last time I had to really blindly do it with a driver was for WiFi on T2s... there's some nonsense for those chips and I don't have a HV setup for those#asahi-re · 2022-03-25 08:12
marcanI've done that before too, looked at a bit of a driver to see what it does in what order and why and then just do the same thing, though I usually prefer to start from the trace and *then* fill in gaps that are hard to figure out from the driver, it's safer#asahi-re · 2022-03-25 08:10
marcanI'm pragmatic about this, if you lower RE'd code to a list of register pokes there's nothing copyrightable left, you could've done the same thing by just copying and pasting a trace (which I've done before too)#asahi-re · 2022-03-25 08:10
marcanif you get rid of param1 in that set_default_regs, all that's left is an MMIO trace#asahi-re · 2022-03-25 08:08
marcanthat sounds like it came from the driver and something is not understood properly#asahi-re · 2022-03-25 08:08
marcanrqou_: the only part that bugs me is why RST_INTERVAL is treated as some kind of reset bit/polled#asahi-re · 2022-03-17 04:36
marcanso we'd still have to re-ghidra at some point