2022-05-26
00:53Telvana has joined #asahi-gpu
01:00DragoonAethis has quit [Quit: hej-hej!]
01:00DragoonAethis has joined #asahi-gpu
02:58phiologe has joined #asahi-gpu
03:01PhilippvK has quit [Ping timeout: 480 seconds]
03:34kov has quit [Quit: Coyote finally caught me]
03:43pyropeter2 has joined #asahi-gpu
03:45pyropeter1 has quit [Ping timeout: 480 seconds]
04:07kode54like, moving my mouse over some objects, and it will only be repainting the mouseovers that are under the square encompassing the mouse cursor
04:09kode54https://irc.losno.co/uploads/89994885572cbd9b/Screen%20Recording%202022-05-25%20at%203.10.42%20PM.mp4
05:03al3xtjames3 has joined #asahi-gpu
05:03bpye3 has joined #asahi-gpu
05:03conradev8 has joined #asahi-gpu
05:03ave363 has joined #asahi-gpu
05:03tbodt_ has joined #asahi-gpu
05:03Manouchehri_ has joined #asahi-gpu
05:03gpanders_ has joined #asahi-gpu
05:03d4ve_ has joined #asahi-gpu
05:03jkkm_ has joined #asahi-gpu
05:03coder_kalyan_ has joined #asahi-gpu
05:04linuxgemini956 has joined #asahi-gpu
05:04nepeat_ has joined #asahi-gpu
05:04mmarchini_ has joined #asahi-gpu
05:04sa1_ has joined #asahi-gpu
05:04guan_ has joined #asahi-gpu
05:04jabashque_ has joined #asahi-gpu
05:04taowa_ has joined #asahi-gpu
05:04philpax__ has joined #asahi-gpu
05:04jbowen_ has joined #asahi-gpu
05:04tardyp_ has joined #asahi-gpu
05:05austriancoder_ has joined #asahi-gpu
05:05yuyichao_ has joined #asahi-gpu
05:06skoobasteeve has joined #asahi-gpu
05:06Method_ has joined #asahi-gpu
05:07rbenua has quit [synthon.oftc.net larich.oftc.net]
05:07conradev has quit [synthon.oftc.net larich.oftc.net]
05:07al3xtjames has quit [synthon.oftc.net larich.oftc.net]
05:07boardwalk has quit [synthon.oftc.net larich.oftc.net]
05:07AoV has quit [synthon.oftc.net larich.oftc.net]
05:07jabashque has quit [synthon.oftc.net larich.oftc.net]
05:07yuyichao has quit [synthon.oftc.net larich.oftc.net]
05:07ids1024 has quit [synthon.oftc.net larich.oftc.net]
05:07opticron has quit [synthon.oftc.net larich.oftc.net]
05:07TheFirst has quit [synthon.oftc.net larich.oftc.net]
05:07linuxgemini95 has quit [synthon.oftc.net larich.oftc.net]
05:07rcombs has quit [synthon.oftc.net larich.oftc.net]
05:07lain has quit [synthon.oftc.net larich.oftc.net]
05:07skoobasteeve_ has quit [synthon.oftc.net larich.oftc.net]
05:07bpye has quit [synthon.oftc.net larich.oftc.net]
05:07gpanders has quit [synthon.oftc.net larich.oftc.net]
05:07d4ve has quit [synthon.oftc.net larich.oftc.net]
05:07coder_kalyan has quit [synthon.oftc.net larich.oftc.net]
05:07Method has quit [synthon.oftc.net larich.oftc.net]
05:07tbodt has quit [synthon.oftc.net larich.oftc.net]
05:07austriancoder has quit [synthon.oftc.net larich.oftc.net]
05:07philpax_ has quit [synthon.oftc.net larich.oftc.net]
05:07guan has quit [synthon.oftc.net larich.oftc.net]
05:07sa1 has quit [synthon.oftc.net larich.oftc.net]
05:07Lightsword has quit [synthon.oftc.net larich.oftc.net]
05:07tardyp has quit [synthon.oftc.net larich.oftc.net]
05:07mmarchini has quit [synthon.oftc.net larich.oftc.net]
05:07Manouchehri has quit [synthon.oftc.net larich.oftc.net]
05:07jkkm has quit [synthon.oftc.net larich.oftc.net]
05:07nepeat has quit [synthon.oftc.net larich.oftc.net]
05:07ave36 has quit [synthon.oftc.net larich.oftc.net]
05:07jbowen has quit [synthon.oftc.net larich.oftc.net]
05:07taowa has quit [synthon.oftc.net larich.oftc.net]
05:07al3xtjames3 is now known as al3xtjames
05:07conradev8 is now known as conradev
05:07jackhill has quit [synthon.oftc.net larich.oftc.net]
05:07bpye3 is now known as bpye
05:07guan_ is now known as guan
05:07sa1_ is now known as sa1
05:07tardyp_ is now known as tardyp
05:07Manouchehri_ is now known as Manouchehri
05:07jkkm_ is now known as jkkm
05:07AoV has joined #asahi-gpu
05:07boardwalk has joined #asahi-gpu
05:08lain has joined #asahi-gpu
05:08Lightsword has joined #asahi-gpu
05:08austriancoder_ has quit []
05:08Lightsword is now known as Guest357
05:09austriancoder has joined #asahi-gpu
05:09TheFirst has joined #asahi-gpu
05:10rcombs has joined #asahi-gpu
05:11rbenua has joined #asahi-gpu
05:12jackhill has joined #asahi-gpu
05:12opticron has joined #asahi-gpu
05:14ids1024 has joined #asahi-gpu
05:44jakebot has quit [Quit: The Lounge - https://thelounge.chat]
05:47jakebot6 has joined #asahi-gpu
05:49povik has joined #asahi-gpu
05:51Guest357 has quit []
05:52Lightsword_ has joined #asahi-gpu
05:58jbowen_ is now known as jbowen
05:59Lightsword_ has quit []
06:00Lightsword_ has joined #asahi-gpu
06:44linaThe better news is I'm pretty sure Apple's matrices have excessive rounding error at least, and some might be outright wrong.
06:45linait 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
06:47linaRGB->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.
06:53phirethis unkptr_1a0 sturucture is such a mismash of (read-only?) data. Color conversion, io mappings, power states
06:55Lightsword_ has quit []
06:56Lightsword has joined #asahi-gpu
07:13linaAh, 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.
07:27Telvana has quit [Ping timeout: 480 seconds]
07:42linaso 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
07:43linaThey 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)
07:43linaI 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
07:45Sobek[m]chadmed: Identity matrices have to be square. Their the neutral element of square matrices multiplication.
07:45linaYUV 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
07:47linaBut 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.
09:21trouter has quit [Ping timeout: 480 seconds]
09:40trouter has joined #asahi-gpu
10:21linaAh, 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.
10:24linaWe'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.
10:53linaAaaaaa, 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)
10:54linaBecause 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
10:56linaLimited-range white is defined as 235 << (8-n), while full-range white is defined as (1 << n) - 1
10:58linaSo 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.
11:04kov has joined #asahi-gpu
12:58bisko has quit [Read error: Connection reset by peer]
13:02alyssalina: Can we skip programming these matrices (or do all 0s) for now and gate YUV support behind a kernel UABI bump in the future when we have a use case?
13:08alyssajannau: For the fast path, ideally that skips the GPU completely and goes straight to a YUV overlay plane in the DCP
13:09alyssaFor the !fast path where you go through the GPU, the time spent texturing (both reading from memory and in the actual sampler hardware) will eclipse the little bit of arithmetic needed to do a matrix multiply
13:10alyssa(and of course, it doesn't reall matter how fast it is as long as it's above 60fps, it's vsynced)
13:12alyssaAdmittedly I'm unsure if Linux userspace is set up for either YUV overlay planes or hw YUV textures
13:14jannauI agree that it's not an use case which must be supported from the beginning. the overlay path might not available due to another video playing
13:17Leidenfrost has joined #asahi-gpu
13:27Telvana has joined #asahi-gpu
13:55alyssadottedmag: right, I know the plumbing is there, just not sure if in practice it gets used (needs support from everyone: kernel, compositor, application, ..)
14:00jannauI unsure about the desktop linux userland status but both yuv overlays and yuv textures are used in embedded linux userland
14:03LeidenfrostHi all
14:03LeidenfrostQuestion, will the GPU driver cover hardware video decode?
14:03jannau2 orders of magnitude larger "devices" and I don't think apple silicon will play a role there
14:04LeidenfrostI see
14:08TheLinkI see not much point in hardware video decoding if the cpu is so strong and has many cores
14:11alyssa"How many hours of video can you watch on $DEVICE before the battery dies?" is a metric Apple cares abou
14:11alyssa"hw vdec + display YUV overlay plane with no GPU in between and framebuffer compression in flight" is a winning strategy there
14:15Jamie[m]the macos scheduler has input from the inbuilt smoke detector to migrate the process to icestorm if there’s too much fire happening
14:39linaalyssa: 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...
14:43marcandottedmag: I don't know if compressed YUV is a thing Apple does, but if it is the HW vdec would definitely support it, since it's the primary use case for that.
14:44jannaudottedmag: not sure if we have the decoder already RE-ed enough to say that but I would expect that it supports framebuffer compression, the mjpeg decoder does
14:44marcan< TheLink> the greatest advantage of hw video decoding is only with safari afaik <- only because nobody else supports it properly
14:45marcanchrome does not support the overlay surface offload on macOS so it keeps the GPU turned on
14:51Jamie[m]vague memory of suggestions that it supported a yuv compressed format last time i looked at it
14:51jannauI would expect that DRM use cases are easier to support without GPU, assuming their is platform support for it
14:52Jamie[m]yeah, iirc there’s a webkit header file that define the relevant VT format constant, but it’s not in VT public headers themselves
14:54marcanjannau: I'm not sure if apple actually implements anything like PAVP; my suspicion is they just rely on kernel integrity and the actual DRM key management/decrypting is in SEP and it'll refuse to do it if you've downgraded security
14:57linadaniels: 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.
14:58lina(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)
17:26Telvana has quit [Ping timeout: 480 seconds]
17:34Telvana has joined #asahi-gpu
19:10Telvana2 has joined #asahi-gpu
19:11Telvana has quit [Ping timeout: 480 seconds]
21:20al3xtjames6 has joined #asahi-gpu
21:20al3xtjames has quit [Ping timeout: 480 seconds]
21:20al3xtjames6 is now known as al3xtjames
21:22Leidenfrost has quit [Quit: Connection closed]
21:58MajorBiscuit has joined #asahi-gpu
22:04MajorBiscuit has quit [Quit: WeeChat 3.4]
23:36Telvana2 has quit [Ping timeout: 480 seconds]
23:47jole_ has joined #asahi-gpu
23:50Telvana has joined #asahi-gpu