#
✕ nick:chadmed
#asahi-dev · 2025-12-27 23:21
chadmednot sure but i doubt the light sensor can spit out a ready to use CTM
#asahi-dev · 2025-12-27 23:18
chadmedit happens in iomfb. macos feeds it a colour transform matrix and it applies that to screen space after its composited all the swap surfaces
#asahi-dev · 2025-12-27 23:12
chadmedthere might be a cal blob somewhere, but this is less important than just getting dcp to output in the display's proper colour space
#asahi-dev · 2025-12-27 23:07
chadmedthats okay we can fake it, as long as we can force a modeset into the correct colorimetry and eotf
#asahi-dev · 2025-12-27 23:03
chadmedagain making sure its idea of what the display can do is important when multiple surfaces have content of different colour/dynamic range. we cant rely on DCP_COLORSPACE_NATIVE doing the right thing.
#asahi-dev · 2025-12-27 23:03
chadmed"default" RGB for the builtin screens. we know the 14/16" machines are DisplayP3 and can do both HLG and PQ, and DCP supports all this
#asahi-dev · 2025-12-27 23:02
chadmedcurrently ColorElements and TimingElements only show SDR and
#asahi-dev · 2025-12-27 23:01
chadmedfaking edid for the builtin screens seems fine though, but we will need to force dcp to put the panel colorimetry and eotf into the correct mode or the resutls will be "wrong"
#asahi-dev · 2025-12-27 23:00
chadmeddoing that will also not play nice once we wire up ddc for external monitors
#asahi-dev · 2025-12-27 23:00
chadmedthe driver should not force a backlight value. let userspace do what it wants with it
#asahi-dev · 2025-12-27 12:36
chadmedi dont want to give up on zero copy scanout from the gpu but i cannot figure out where the heck we're supposed to tell iomfb that the format is tiled/twiddled even after spending all evening in ghidra :/
#asahi-dev · 2025-12-27 12:35
chadmedbut once it looks more like a real kms atomic driver we should port it
#asahi-dev · 2025-12-27 12:35
chadmedim happy to keep hacking on the C version because my kernel rust is even worse than my kernel C
#asahi-dev · 2025-12-27 12:35
chadmedyeah
#asahi-dev · 2025-12-27 12:26
chadmedsimilarly it would be good to drop 12.3 out of the dcp driver since we already know iomfb changed again
#asahi-dev · 2025-12-27 12:25
chadmedobv doesnt matter if its just for a bit of fun at 39c3 but for prod i would want to bring everything up to a new lowest common denominator (drm uapi stability guarantees notwithstanding)
#asahi-dev · 2025-12-27 12:24
chadmedyeah but do we want to support 14.x and then yet another for m4
#asahi-dev · 2025-12-27 12:15
chadmednot sure if 26.x firmware expects SPTM though
#asahi-dev · 2025-12-27 12:15
chadmedintegralpilot: 26.x is going to be your best bet as there were some nasty bugs in 15.x that _should_ all be fixed now
#asahi-dev · 2025-12-27 12:14
chadmedoliver: the devicetrees have them, but i think for the dcp/dispX thing its not obvious and probably should be documented somewhere
#asahi-dev · 2025-12-27 09:02
chadmedthats way more impressive lol
#asahi-dev · 2025-12-27 07:56
chadmedwe're not fudging it in the parser afaict
#asahi-dev · 2025-12-27 07:53
chadmedunsure as to why we get back sdr/srgb for the 14" and 16" builtin screens as the only colour mode when the screens are supposed to be dci-p3
#asahi-dev · 2025-12-27 07:46
chadmedARGB2101010 works now though so thats nice
#asahi-dev · 2025-12-27 07:37
chadmedthe fourccs macos uses dont even appear in the dcp firmware lmfao, but they are only one character off ones that do
#asahi-dev · 2025-12-27 04:53
chadmed3 being "uc"
#asahi-dev · 2025-12-27 04:53
chadmedthere are actually two compression formats, "uc" and agx. i thought "uc" would be whatever avd spits out but macos sets the compression type to 3 for framebuffers coming out of the gpu
#asahi-dev · 2025-12-27 04:49
chadmedthe firmware does not match the traces
#asahi-dev · 2025-12-27 04:48
chadmedthe compression info itself seems simple but i havent got a nice way to set that up without hard coding a bunch of magic numbers, and i cant test the magic numbers because the fourccs are not obvious
#asahi-dev · 2025-12-27 04:47
chadmedthe firmware also does support AGX compressed framebuffers but you need to set the compression metadata pointers and fb format appropriately or iomfb will just complain
#asahi-dev · 2025-12-27 04:47
chadmedneat we have 4:2:0, 4:2:2 and 4:4:4 scanout
#asahi-dev · 2025-12-26 14:21
chadmedwhich is why i suggested forcing software decode. we at least have _some_ documentation for the agx formats
#asahi-dev · 2025-12-26 14:21
chadmeddownside is the framebuffer formats are all totally fucked and youll have to reverse engineer them :P
#asahi-dev · 2025-12-26 14:20
chadmedso then you know which swap request, which iosurface, and the fb that corresponded to both
#asahi-dev · 2025-12-26 14:20
chadmedyou could read out the framebuffer and store it with the corresponding surface and swap request and then decode that all later
#asahi-dev · 2025-12-26 14:12
chadmedjust ucomment the block i commented out if you still want/need to see the other messages
#asahi-dev · 2025-12-26 14:12
chadmeddo something like this to make life a little easier
#asahi-dev · 2025-12-26 14:12
chadmedalso if you havent already: https://github.com/chadmed/m1n1/commit/b000ada977896a265e5ee972aaace1a7297b4adb
#asahi-dev · 2025-12-26 14:11
chadmeddcp supports both HLG and PQ, which both will use the BT.2020 colour primaries
#asahi-dev · 2025-12-26 14:11
chadmedlikewise the transfer functions are going to matter a lot for correct hdr
#asahi-dev · 2025-12-26 14:10
chadmedcolourspace is going to be important for _correct_ looking video on overlay surfaces
#asahi-dev · 2025-12-26 14:08
chadmedyeah break into the hv shell and try to read out the framebuffer at the iova in the swap request i guess
#asahi-dev · 2025-12-26 14:07
chadmedare you setting the colourspace and framebuffer format appropriately too
#asahi-dev · 2025-12-26 14:06
chadmedits probably just software tone mapping and local dimming then i guess
#asahi-dev · 2025-12-26 14:04
chadmeddo the video and media controls go back on to the primary surface? thats not how i interpreted your message sorry
#asahi-dev · 2025-12-26 14:02
chadmedquicktime also ends up with windowed content on its own surface
#asahi-dev · 2025-12-26 13:59
chadmedtry using ffmpeg to force sw decode and bypass all the compressed/tiled avd format bs
#asahi-dev · 2025-12-26 13:57
chadmedif a video is playing and nothing else on the screen is changing, then yes it will only scan out the iosurface with the video on it. thats the whole point, we dont need to be constantly scanning out and refreshing surfaces where nothing is going on
#asahi-dev · 2025-12-26 13:56
chadmedim not 100% sure, just a guess from what ive seen playing back hdr video on a machine being traced
#asahi-dev · 2025-12-26 13:19
chadmedkwin really does not want to play ball with the overlays though so ive mostly been testing from a tty, which is not really a fair test since most of the primary surface is black lol

plus ›