#asahi-gpu · 2022-06-05 11:12
linaI think someone did and it worked with some issues, so some numbers probably need tweaking...#asahi-gpu · 2022-06-05 08:25
linaDoesn't sound like that then...#asahi-gpu · 2022-06-05 08:22
linaIt seems to use limited range luma but with a different offset, since you get negative RGB at Y=16/256#asahi-gpu · 2022-06-05 08:17
linarkjnsn: Do you have the coefficients for that? Check #6 here: https://gist.github.com/asahilina/2a80fe5e4476de56412508ec78245b9b#asahi-gpu · 2022-06-05 08:16
linayuni: I saw that!! ^^#asahi-gpu · 2022-06-03 16:06
linaI think at that point the answer to "Rust at all or not" is up to us, and the answer to "Rust all the way or not" depends on the DRM subsystem folks.#asahi-gpu · 2022-06-03 16:05
linaChances are high that the Rust support will be merged by the time I actually start on the kernel driver...#asahi-gpu · 2022-06-03 07:49
linaYeah, I don't think it's worth committing that. That code will be at the very least refactored to load arbitrary dumps very soon, and then directly integrate into mesa later.#asahi-gpu · 2022-06-02 12:41
linaSigh...#asahi-gpu · 2022-06-02 03:54
linaYeah, I did that collab with Low Layer Girls and they use 3D avatars with full hand tracking, but I've never seen it done for 2D...#asahi-gpu · 2022-06-02 03:40
linamarcan: And I had to fix your broken cross-page load/store emulation, and add a bunch of instructions, and fix a bunch of bugs... ^_^;;#asahi-gpu · 2022-06-02 03:35
linaa bit~ ^^#asahi-gpu · 2022-06-01 16:18
linayuni: <3#asahi-gpu · 2022-06-01 04:58
linaAh, that makes sense! I'm going to get new mesa traces today so I'll shrink the framebuffer then. Thanks ^^#asahi-gpu · 2022-05-27 18:37
linaI might have gotten them mixed up there, yes ^^#asahi-gpu · 2022-05-26 14:59
lina*don't have#asahi-gpu · 2022-05-26 14:58
lina(Since we get to pick all the names here, and I don't experience with other GPUs so I don't know what's recognizable to others)#asahi-gpu · 2022-05-26 14:57
linadaniels: Since you're around... I'd love to sit down and get your opinion on this wonderfully weird AGX GPU one of these days. Stuff related to the kernel UABI once we get there, and right now I'm wondering if you have any takes on how to name things.#asahi-gpu · 2022-05-26 14:39
linaalyssa: I don't think computing those matrices is a big deal. Worst case if we don't have the time to figure out the exact rounding, we guess. Nobody's going to complain about the YUV conversions being off by 1 lsb with everything else going on...#asahi-gpu · 2022-05-26 10:58
linaSo for limited-range you extend with zeroes at >8 bits (this would work for 1.0 == 1<<n across depths), while for full-range you extend with ones (needs 1.0 == (1<<n)-1 across depths), and assuming the hardware only does one thing across the board, it can't be right for both.#asahi-gpu · 2022-05-26 10:56
linaLimited-range white is defined as 235 << (8-n), while full-range white is defined as (1 << n) - 1#asahi-gpu · 2022-05-26 10:54
linaBecause it turns out that the definition of full-range quantization and limited-range quantization interact with the bit depth differently, and therefore with any given single implementation of rounding/scaling you can only generalize the correct matrix for one of those two cases across all bit depths#asahi-gpu · 2022-05-26 10:53
linaAaaaaa, and as far as I can tell it's actually *not possible* to program correct coefficients, assuming this needs to work across different bit depths (assuming the hardware does not special case the quantization differently for the full-range and limited-range slots)#asahi-gpu · 2022-05-26 10:24
linaWe'll have to do some actual tests to figure out what the correct matrices would be, though, since I'm not sure if the interpretation is fixed-point 1.0 = 255 (actual max brightness) or fixed-point 1.0 = 256 (out of range but easier on the hardware) for these matrices, on both the RGB and YUV sides.#asahi-gpu · 2022-05-26 10:22
linahttps://www.khronos.org/registry/DataFormat/specs/1.2/dataformat.1.2.html#asahi-gpu · 2022-05-26 10:21
linaAh, khronos has an actual spec for this and it refers to BT.2100 / T.871, and that confirms Apple's coefficients are definitely wrong here.#asahi-gpu · 2022-05-26 07:47
linaBut either way I can't see how *all* of these matrices can be consistent; I'm pretty sure no matter how you interpret them, there is weirdness.#asahi-gpu · 2022-05-26 07:45
linaYUV full range is kind of dodgy by definition anyway because "no chroma" is supposed to be 128 but that's not the middle of the range, so I need to figure out what's correct and whether that implies that Y and UV have to have different scaling#asahi-gpu · 2022-05-26 07:44
linachadmed: It's 3x3 + offset column (affine transform)#asahi-gpu · 2022-05-26 07:43
linaI need to look up the relevant standards to figure out what's correct, but I'm fairly certain that whatever Apple did here isn't#asahi-gpu · 2022-05-26 07:43
linaThey seem to use /255 scaling for the RGB side and /256 scaling for the YUV side to get round numbers, for all components, which doesn't make sense (white ends up as 256, 128, 128 in fullrange YUV which is out of range for Y)#asahi-gpu · 2022-05-26 07:42
linaso there is one unknown matrix, the rest "make sense" but the rounding is weird and I'm pretty sure there are off by one errors#asahi-gpu · 2022-05-26 07:42
linahttps://gist.github.com/asahilina/2a80fe5e4476de56412508ec78245b9b#asahi-gpu · 2022-05-26 07:13
linaAh, I think I figured out YUV->RGB limited. There's the weird off by one error again but it's not wrong, there's just strange scaling involved.#asahi-gpu · 2022-05-26 06:53
linaI just called it HWDataB now#asahi-gpu · 2022-05-26 06:53
linaYeah...#asahi-gpu · 2022-05-26 06:47
linaRGB->YUV full has the textbook coefficients; RGB->YUV limited range I suspect they have an off-by-one error in the limited range adjustment; YUV->RGB full has weird rounding error (e.g. zero coefficients that are some small number instead), and YUV->RGB limited I just can't make sense of, it looks like the limited adjustment is either wildly off there or I don't understand the input scaling.#asahi-gpu · 2022-05-26 06:45
linait has RGB<->YUV for BT.601, BT.709, BT.2020, each full/limited range, plus one I haven't identified yet, one identity (or negation?) matrix and an empty slot#asahi-gpu · 2022-05-26 06:44
linaSo we can probably do a *better* job than them.#asahi-gpu · 2022-05-26 06:44
linaThe better news is I'm pretty sure Apple's matrices have excessive rounding error at least, and some might be outright wrong.#asahi-gpu · 2022-05-26 06:43
linaThe good news is we can regenerate it ourselves easily.#asahi-gpu · 2022-05-26 06:43
linaI figured it out... it's... colorspace conversion matrices.#asahi-gpu · 2022-05-26 06:43
linaphire: Remember that mystery blob next to the iomaps?#asahi-gpu · 2022-05-24 19:10
linano comment~#asahi-gpu · 2022-05-24 19:09
lina*97%#asahi-gpu · 2022-05-24 19:08
linahopefully she can improve that while I work on the kernel side#asahi-gpu · 2022-05-24 19:08
linaDcow[m]: so yuni apparently found out the other day that "passes like 97 of GLES tests" does not imply "apps actually work"... ^^;#asahi-gpu · 2022-05-22 10:50
linajannau: I think if the commit is signed off, any files missing the header are assumed to be MIT (and anyone else can fix that), assuming the author didn't mess up and copy and paste code or something like that.#asahi-gpu · 2022-05-22 10:50
linayuni: You should post it with the tag!!#asahi-gpu · 2022-05-22 10:48
linajannau: Yes, of course. I just did that one in a rush during the stream since I was tired of that screen popping up, and I forgot to copy and paste the header... ^^;