#
…

2022-03-20

00:27phire has quit [Server closed connection]
00:27phire has joined #asahi-re
00:32amw has quit [Server closed connection]
00:32amw has joined #asahi-re
00:35_whitelogger has joined #asahi-re
00:41rikkaa has joined #asahi-re
00:59arekm has quit [Remote host closed the connection]
00:59arekm has joined #asahi-re
01:03chadmed has joined #asahi-re
01:03MikaB[m] has joined #asahi-re
01:12m6wiq has quit []
02:05robinp_ has joined #asahi-re
02:07robinp_ is now known as robinp
02:52riker77_ has joined #asahi-re
02:57riker77 has quit [Ping timeout: 480 seconds]
02:57riker77_ is now known as riker77
03:13PhilippvK has joined #asahi-re
03:17phiologe has quit [Ping timeout: 480 seconds]
03:37nicolas17 has quit [Ping timeout: 480 seconds]
03:45rqou_hmm, trying to create a DARTTracer for the jpeg dart crashes m1n1
03:55kylealanhale has joined #asahi-re
03:57rqou_tracing with trace_device works, but i'm trying to understand how to create a more complicated tracing tool
03:59rqou_i guess i'm clearly struggling trying to figure out how the m1n1 tooling works, since addresses that i can trace the macos kernel accessing crash whenever i try to read32 them
04:10kylealanhale has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
04:14rqou_ah, figured it out. need to turn on the dart with pmgr_adt_clocks_enable first
05:09rqou_finally figured out how to use the mmio tracing framework. is there an example of how to use _reloadcls? i can't seem to figure out how that's intended to be used
05:48kameks has joined #asahi-re
06:37r0ni has quit [Quit: Textual IRC Client: www.textualapp.com]
06:46kameks has quit [Ping timeout: 480 seconds]
07:11doggkruse has quit [Quit: Konversation terminated!]
07:13doggkruse has joined #asahi-re
07:17the_lanetly_052 has joined #asahi-re
07:28doggkruse has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
07:56aycippo[m] has joined #asahi-re
08:01the_lanetly_052 has quit [Ping timeout: 480 seconds]
08:19swampertx[m] has joined #asahi-re
08:25kylealanhale has joined #asahi-re
08:45riker77 has quit [Quit: Quitting IRC - gone for good...]
08:56MajorBiscuit has joined #asahi-re
09:00rqou_hmm, the dart iomap function seems to be crashing m1n1 when i try to run it in the shell?
09:01riker77 has joined #asahi-re
09:03jannaurqou_: are you using DART.from_adt()? if not it might be simply the wrong dart type
09:06rqou_oops no, that fixes it
09:07rqou_i tried copying the function from audio_capture.py which... doesn't do that
09:11rikkaa has quit [Quit: Connection closed for inactivity]
09:19jannauthat's from simpler times when there was only m1 or it was only ever used on m1 and not m1 pro/max
09:41rqou_success! (note contains reverse engineered macos driver code) https://gist.github.com/rqou/2dafd40cfe0362cc84c3ee26c68b2b36
09:44rqou_works only with a 4:2:0 jpeg that is 120x80 in size
09:45rqou_aka exactly what alyssa's iosurface poc was hardcoded for
09:45j`eydumb q, what does it give you back? just some raw rgb values in some format?
09:46rqou_it currently gives back raw rgb, but there should be other options as well
09:46rqou_i _barely_ understand how to drive this hardware and basically just duplicated exactly what happens when you run alyssa's poc
09:46rqou_which is itself hardcoded to these parameters
09:51the_lanetly_052 has joined #asahi-re
09:58kameks has joined #asahi-re
10:03rqou_btw if anybody is deeply familiar with jpeg and can tell me why there's a 11-entry matrix involved in the process, that would be appreciated
10:07henje[m]JPEG encodes blocks of 8x8 pixels using a discrete cosine transformation. The cosine coefficients form a matrix and are multiplied with a quantization matrix, which effectively eliminates unneeded coefficients. But both matrices should be 8x8.
10:08rqou_yeah, that's in a separate block of registers
10:08rqou_this is a matrix for... something else
10:09abrasivean 11×11 matrix, or a matrix with 11 nonzero entries?
10:10Jamie[m]1the latter, it looks like
10:11rqou_a matrix with 11 entries of 4 bytes each
10:11rqou_possibly not even a matrix
10:11rqou_but the driver refers to it as a matrix multiplication... thingy
10:11Jamie[m]1it certainly looks like 32-bit signed values
10:11Jamie[m]1given the leading ffffff in some of them
10:12Jamie[m]1vary them and see what happens to the image? :D
10:13henje[m]So if it’s a quantization matrix in some form, later entries should effect higher frequency contents, i.e. sharp edges
10:15henje[m]rqou_: if you mind, could you dump the values and share them?
10:16Jamie[m]1they're in the gist henje
10:16abrasiveis JPEG in YCbCr?
10:17abrasivebecause YCbCr -> RGB is about that
10:17henje[m]But 11 values? Shouldn’t that be 9?
10:17Jamie[m]1ahhh, 3x3 matrix plus a separate numerator/denominator for the whole thing?
10:21abrasiveinverting that matrix gives me ['0x100', '0x0', '0x166', '0x100', '-0x58', '-0xb6', '0xff', '0x1c5', '0x0']
10:21abrasive(with truncation rather than rounding, so)
10:22rqou_awesome, thanks
10:22rqou_uh, i wonder what the last two entries do?
10:23abrasive1.0 = 0x100 in the matrix btw
10:23Jamie[m]1-128 potentially makes sense for the subtraction
10:24abrasivevery probably constants added before/after the multiply
10:24abrasivepresumably only for Cb/Cr which is why there's only two?
10:24Jamie[m]1who needs ANE, we can do matmul in the jpeg block :D
10:25rqou_ok, i'm going to see if i can figure out how to give it an image of different sizes
10:26rqou_also probably do a sleep
10:34henje[m]Is the QTBL register the quantization matrix? In the gist it does not seem to be set
10:34rqou_i assume it isn't used for decoding, only encoding
10:35rikkaa has joined #asahi-re
10:36rqou_not sure if diving back into the driver re for a bit is useful or simply frustrating
10:36henje[m]So MATRIX_MULT has to be set differently for decoding and encoding, right?
10:36rqou_iosurface is incredibly confusing
10:36rqou_idk, haven't looked at encoding whatsoever
10:42henje[m]It should be if it’s just a matrix, because one does RGB -> YCbCr, and the other does YCbCr -> RGB, which need another matrix
10:43henje[m]You could also go to HSL or whatever uses the same matrix format for conversion
10:48m6wiq has joined #asahi-re
10:51Jamie[m]1yeah the forwards matrix is in the (12.3) AppleJPEGDriver binary at 0x50cc
10:51Jamie[m]1(i.e. 256 times the screenshot abrasive posted)
10:56ExeciN[m] has joined #asahi-re
11:10rqou_i found the register that controls the output alpha value (0x158) and the register that makes the output ARGB instead of BGRA (0x154)
11:10rqou_sleep time
11:23Axe has joined #asahi-re
11:29kloenk has quit [Remote host closed the connection]
11:30Axe has quit [Remote host closed the connection]
12:24kameks has quit [Ping timeout: 480 seconds]
12:27kylealanhale has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
12:52chadmed has quit [Ping timeout: 480 seconds]
13:24qiuren[m] has joined #asahi-re
13:36the_lanetly_052 has quit [Ping timeout: 480 seconds]
13:49JasonAntwi-Appah[m] has joined #asahi-re
14:06m6wiq1 has joined #asahi-re
14:08m6wiq has quit [Read error: Connection reset by peer]
14:18m6wiq1 has quit [Remote host closed the connection]
14:24justeinkemp[m] has joined #asahi-re
14:24skipwich has quit [Quit: DISCONNECT]
14:25skipwich has joined #asahi-re
14:47MajorBiscuit has quit [Ping timeout: 480 seconds]
14:51rikkaa has quit [Quit: Connection closed for inactivity]
15:26kloenk has joined #asahi-re
15:33brstream[m] has joined #asahi-re
16:41cadawerum1[m] has joined #asahi-re
16:56AdwyzzOLEDEdition[m] is now known as AdryzzOLEDEdition[m]
17:02kylealanhale has joined #asahi-re
17:07doggkruse has joined #asahi-re
17:23nicolas17 has joined #asahi-re
18:11meenmachine has joined #asahi-re
18:17meenmachine has quit [Read error: Connection reset by peer]
18:27m6wiq has joined #asahi-re
18:46meenmachine has joined #asahi-re
18:56yuyichao_ has joined #asahi-re
18:57meenmachine has quit [Quit: Textual IRC Client: www.textualapp.com]
18:57yuyichao has quit [Read error: Connection reset by peer]
18:57meenmachine has joined #asahi-re
19:47meenmachine has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
19:51doggkruse has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
19:53doggkruse has joined #asahi-re
19:58m6wiq has quit []
20:09doggkruse has quit [Ping timeout: 480 seconds]
20:13m6wiq has joined #asahi-re
20:23kylealanhale has quit [Quit: Textual IRC Client: www.textualapp.com]
20:38chengsun has quit [Quit: Quit]
20:38chengsun has joined #asahi-re
20:38m6wiq has quit []
20:42meenmachine has joined #asahi-re
20:58M1bn3mar[m]hey, i found a way to adjust the brightness in asahi i thought that it might be useful in development :)
20:59j`eywhat did you find?
21:20m6wiq has joined #asahi-re
21:42meenmachine has quit [Read error: Connection reset by peer]
21:54m6wiq has quit []
22:11sirn has quit [Server closed connection]
22:11sirn has joined #asahi-re
22:27abrasive has quit [Server closed connection]
22:28abrasive has joined #asahi-re
22:34phire has quit [Server closed connection]
22:34phire has joined #asahi-re
22:40robinp has quit [Server closed connection]
22:40robinp has joined #asahi-re
22:44chengsun has quit [Quit: Quit]
22:44chengsun has joined #asahi-re
23:00yrlf has quit [Quit: The Lounge - https://thelounge.chat]
23:02yrlf has joined #asahi-re
23:20nicolas17is there any public 'trace file' from m1n1, for example from the DCP tracer? (I don't have M1 hardware myself >.>)
23:21nicolas17IIUC trace_dcp.py dumps raw binary data sent to the DCP mailbox and shared memory, and then a different script parses it into something readable
23:27nicolas17I wanted to play with something related to that but I can't do my own trace...
23:35pphilipss has joined #asahi-re
…