#
…

2021-03-18

02:53JusticeEX has joined #asahi-gpu
03:36phiologe has quit [Ping timeout: 244 seconds]
03:37phiologe has joined #asahi-gpu
04:10Baughn has quit [Ping timeout: 260 seconds]
04:11Baughn has joined #asahi-gpu
04:38odmir has quit [Remote host closed the connection]
04:41linuxgemini has quit [Read error: Connection reset by peer]
04:51Necrosporus is now known as Guest13098
04:51Guest13098 has quit [Killed (weber.freenode.net (Nickname regained by services))]
04:51Necrosporus has joined #asahi-gpu
05:28dougallchrisf: sure - i'll try to fill it out sometime this week (in the mean time, it's really rattling around in the emulator, if that's of any use https://github.com/dougallj/applegpu/blob/30845306a9b685def1a580586dc0f08d008aee37/applegpu.py#L4042-L4220 )
07:41linuxgemini has joined #asahi-gpu
08:20jix_morelightning[m]: FYI, if you write multi-line messages in matrix, they get bridged to IRC as a https link to a .txt file, so if you mention someone in them they might not see that
08:23morelightning[m]oh, is there a better software I should use? (It's been over a decade since I've used this stuff)
08:25jix_using matrix is fine IMO, it's just good to be aware of how the bridge handles multi line messages... it's suitable for posting code or logs etc, but not so much for conversations
08:26jix_ is now known as jix
08:29jixI'm using both matrix and irc, but for irc channels I usually connect directly, but that requires a persistent connection if you want to see all messages in channels that are not publicly logged (this one is though, see topic)... tastes in preferred clients vary widely and discussions about that usually lead to long off-topic discussions so I'd rather not go there
09:12JusticeEX has quit [Ping timeout: 256 seconds]
10:10linkmauve has joined #asahi-gpu
11:29jobbe has quit [Quit: The Lounge - https://thelounge.chat]
11:58jobbe has joined #asahi-gpu
12:40jobbe has quit [Quit: The Lounge - https://thelounge.chat]
13:01g3rp has joined #asahi-gpu
13:25clayfreeman has joined #asahi-gpu
14:02g3rp has quit [Quit: leaving]
14:05JusticeEX has joined #asahi-gpu
14:09zkrx has quit [Ping timeout: 264 seconds]
14:23zkrx has joined #asahi-gpu
14:25morelightning[m]Is there any insight yet into bypassing the window compositor or how that connects? My initial assumption would be that metal's "present drawable" does a composite with a basic shader, and then it just passes the frame buffer along at some point... maybe thats around CoreDisplay?
14:33bloomNo, I very intentionally have prioritized off-screen rendering since CoreGraphics would be a massive r/e effort with 0 payoff for Linux.
14:47morelightning[m]Well, what I mean is, on linux, we'll have to route the frame buffer to the display somehow - is that part of the hardware addressing identified already?
14:50opticron has quit [Ping timeout: 240 seconds]
14:51TheJollyRoger has quit [Ping timeout: 268 seconds]
14:51opticron has joined #asahi-gpu
14:52TheJollyRoger has joined #asahi-gpu
14:53morelightning[m]My assumption, was that if we haven't identified those yet, that I might find them defined inside CoreDisplay or close to it.
14:56bloomThat's not the GPU, that's the display controller.
14:56bloommarcan: ^
14:56sventhe frame buffer is pre-configured by iboot for us as some buffer in main memory. we'll eventually have to figure out how the display controller works, but as long as we can render to some buffer from the gpu it'll work for now
14:58svenand ideally we'll figure out the display controller by observing MMIO reads/writes once marcan implements a mini-hypervisor in m1n1
15:16marcandisplay controllers are boring, it's just a pile of mode parameters and stuff like that
15:16marcanobserve mmio writes, tweak things, figure out what they mean
15:17marcanit's a bunch of work to write the driver but all the annoying details are going to be around things like DisplayPort link training, HDMI InfoFrames, and all that "fun" stuff
15:18marcanit should be pretty much completely divorced from the GPU, and since Linux has a very mature DRM/KMS framework for handling all that stuff, which is going to be very different from how macOS does things (most likely), there isn't really any reason to try to figure out how macOS does things there
15:18chrisfmarcan: do we expect the apple display controller to be small like desktop, or a mobile-style behemoth?
15:18marcandefine mobile-style behemoth?
15:19chrisfmarcan: on socs designed for android the display controllers are often enormous -- tons of planes, etc
15:19marcanoh, you mean compositing
15:19marcangood question
15:19marcanI don't really know; my gut feeling is Apple would use the GPU for that, but I guess we'll find out
15:20marcanthey definitely do basic scaling at least, since that's how their entire macOS DPI scaling is implemented
15:20marcan(AIUI they only do a couple fixed DPI values, then scale for everything else)
15:30marcanoh yeah, one thing that's going to be fun is memory bandwidth calculation stuff
15:30marcannot looking forward to *that* one...
15:35morelightning[m]The m1 mac window compositor is showing up as a Metal vertex/fragment shader in Instruments, just like the iPad. So I was supposing that all the information we need is just sitting defined inside the window server process.
15:35morelightning[m]On the iPad, I vaguely remember something new in the last few years about needing to control the contrast range of the display - so I was assuming we'd run into that on the mac too.
15:35marcanI don't think we should need *anything* about the compositor
15:35marcanit's just more 3D
15:37marcanOTOH, I just did a bit of `strings` recon on their display controller driver
15:39marcanchrisf: looks like it's huge, but not because of compositing stuff... there's a whole mailbox protocol involved apparently, and some rather fancy stuff
15:39marcanI get the feeling we can *probably* get away without a lot of it, since it's probably intended for mobile panels where there are a million variants, with weirdo OLED subpixel layouts and stuff like that
15:39marcanthe only OLED panel we have to deal with is the Touch Bar, but that can wait a bit
15:40marcan(going to be funny extending x11/wayland screens into that; putting the Plasma taskbar on the Touch Bar, anyone? :p)
15:40marcanit might support... 3 layers?
15:45marcanwhat worries me is I think I see some firmware in here... I hope this is legacy
15:46marcanthere's a DCP that iBoot2 loads for us at least
15:49marcanlooks like DCP is probably the DP/HDMI encoder block, so I guess most of that is handled by firmware with some kind of mailbox to talk to it
15:50marcanthere's a whole 7MB of firmware for that, which is insane. I wonder what's in here.
15:50marcanat least that probably means it does link training for us
15:59marcanthe DCP firmware is definitely also working with things at the framebuffer level, at least to some extent, so maybe in the end it'll boil down to a big mailbox thing?
15:59modwizcodeWould the plan be to extract that or were you saying that iBoot loads it for us?
15:59marcanoh well, either way this is going to be fun
16:00marcanmodwizcode: for everything iBoot2 loads for us, they're just files next to iBoot2; all that stuff will have to be copied from the recovery partition for our "clean" installer
16:01modwizcode? not exactly clear what you mean there.
16:01modwizcodeIt sounds like you're saying that iboot loads it but also that it doesn't?
16:01marcanit does, but iBoot2 is part of the "OS" install, so we need to put it there if we're doing a from-scratch install
16:02marcanalong with all the firmware blobs it loads
16:02modwizcodeI didn't realize where iBoot2 resides
16:03danielschrisf: if I had to guess, more complex than desktop, less complex than Qualcomm
16:03danielsgiven their battery life figures, I have a hard time believing that they're using the GPU to composite every frame (at least when not doing fullscreen desktop)
16:04modwizcodeI'm surprised that more of that isn't done honestly
16:04marcanthey used a tiling architecture and the framebuffer is also tiled, so it would make sense for them to do a dirty tiles thing for updates, instead of compositing the entire frame
16:05odmir has joined #asahi-gpu
16:05marcanbut so far I've seen mentions of 3 layers in here, so I don't think they delegate much compositing to the display controller
16:05modwizcodeeven the OLPC people implemented a basic display controller level redraw handling thing, it's hardly cutting edge.
16:06modwizcodefor compositing tiles would be plenty
16:07svenoh... that mailbox probably explains why the framebuffer only sometimes broke when i wrote different values to the area called "piodma" that is mapped after the framebuffer
16:07danielsmarcan: 3 is plenty: one for system UI, one for browser chrome, one for Netflix content
16:08danielsrealistically you don't need too many more if you do the HWC thing of using the GPU to flatten your static-ish content to a single buffer, then using the display controller for the more dynamic content
16:09marcanmakes sense
16:10bloom^ seconding what daniels said, given how optimized for power efficiency the rest of the apple soc's are, and how cheap an extra overlay plane is, this would be a really bizarre place to skimp on gates
16:10daniels(not surprising that Apple actually did it properly, but it is sadly uncommon for GPU render targets and display controller fetch to share tiling formats ...)
16:11danielsbut yeah, enabling things like PSR is a seriously frustrating long-tail effort
16:11bloomM1 has full support for tiled compressed framebuffers, documented absolutely nowhere
16:12bloomGotta hand it to Apple, even Arm and Qualcomm brag about AFBC/UBWC despite keeping the internals proprietary.
16:12bloomApple has managed to excise every mention of a compression scheme from public docs/source.
16:13bloomAdmittedly I don't nknow what the display controller ingests, I just saw this in flight from app<-->compositor
16:14bloombut again Apple is far too competent to not have their display controller ingest their compression scheme as well
16:14modwizcodeI mean if you're making both you might as well reuse your hdl c;
16:15marcanbloom: there is plenty of mention of tiling/compression in these blobs
16:16bloomBetter question is if the cameras support the compression scheme too
16:16bloom(at least on the iPhones with fancy 4k@60..)
16:16marcangood question
16:16modwizcodedon't they use off the shelf camera parts tho?
16:16marcanthere's a separate image processor, presumably for that stuff
16:17bloomI know Arm has camera stuff feeding into AFBC but I don't know if it (or anything like it) ever shipped.
16:17bloomLikewise, can the video decoder recompress to the native format on the fly?
16:17bloom(IIRC Arm has this too, also not shipping afaik)
16:19bloom4k on mobile is rather painful withot compression, so
16:19danielsArm never got their media-codec IP in any shipping SoC TTBOMK, but they will license AFBC to you if you want to do that
16:19daniels(I've also not seen it in the wild)
16:20danielsbut given that your phone doesn't have a 4K display, rather than compressing 4K output, the secret is to just ... not have it
16:21danielskeep an internal camera -> ISP -> codec pipeline which spits out a downscaled YUV/RGB frame for display, and then the codec goes straight to H.264/HEVC/whatever, ideally without touching sysmem
16:22daniels(yes it's a lot of out-of-band storage, but cheaper in power than keeping DDR lit up full)
16:24marcanI actually can't find the video decoder firmware, and now I wonder if it's in the SEP. because DRM.
16:26danielsmarcan: presumably it's a stateless impl -> very possibly no firmware?
16:26danielsjust a big old userspace blob
16:26marcancould be
16:27danielsany idea if it's in-house or licensed?
16:28marcanI should start listing these engines on a wiki page somewhere. e.g. AOP is "hey siri" and other sensor stuff, PMP is power, ISP is the camera stuff, DCP is the displayport/display stuff, AVE is the encoder, ANE is neural engine
16:29modwizcodeThere's already a glossary page, want me to make a seperate one?
16:29marcanyeah, there should be a separate page for these engines
16:29danielsmarcan: SEP -> Secure Enclave Processor? -> ... T2?
16:30marcanT2 is not a thing any more on M1
16:30marcanit's integrated
16:30marcanno, separate CPU
16:30marcanthere is no EL3
16:30marcanthese engines are all random little side CPUs
16:30marcanthey do use a TrustZone carveout though, to share DRAM with the SEP
16:31danielsright sorry, I misread 'integrated' as 'on-CPU' rather than 'on-die'
16:31marcanbasically what happened is Apple took an old iPhone, put it into a laptop, stuck an Intel CPU on the side as a coprocessor and called it a "T2 Mac"
16:32marcanthen when they had a good enough CPU, they just beefed that up and dropped the Intel
16:32marcanand that's the M1
16:35modwizcodeI swear I had a better place where I'd seen some of these elements defined awhile ago but I have no idea where that was
16:37sveni think i read AON = always-on processor somewhere. not sure if that was in some strings or some old iphone wiki though
16:38modwizcodeHell I'll throw it in in some quotes
16:39svenhttps://machinelearning.apple.com/research/hey-siri nope, it was apple's ML blog actually :-)
16:39sven"To avoid running the main processor all day just to listen for the trigger phrase, the iPhone’s Always On Processor (AOP)"
16:41balrogFWIW Apple brags about their camera ISP
16:41bloomdaniels: lol, true
16:43danielsbalrog: it's strong differentiator for every SoC vendor, there's basically no commonality in ISP
16:43modwizcodeOkay cleaned up the page a bit
16:43balrogmodwizcode: also AMX
16:43modwizcodeIs that really a coprocessor though?
16:44modwizcodeI think it's coprocessor like but I thought it was part of the cores themselves?
16:44bloomcocoprocessor
16:44bloomused for accelerating video decode of the award-winning Pixar film
16:45modwizcode"the award-winning Pixar film"
16:46bloomdid it not win any awards it should've :>
16:46modwizcodeI don't know what film we're talking about was all I meant
16:46modwizcodealso isn't there built in video decoding? Why did they use AMX?
16:47bloomthey don't I was making a joke
16:47modwizcodeSadly it didn't land with me
16:48bloomthat's normal i just say say things
16:48modwizcodeI mean I was mostly acknowledging that as a personal failing of myself c;
16:54bloomdefinitely not, I'm just like this
17:04jaalsa has quit [Read error: Connection reset by peer]
18:20DarkShadow4444 has joined #asahi-gpu
18:40AlJaMa has quit [Ping timeout: 264 seconds]
18:44AlJaMa has joined #asahi-gpu
18:44AlJaMa has quit [Changing host]
18:44AlJaMa has joined #asahi-gpu
19:19DarkShadow4444 has quit [Quit: Leaving]
19:59g3rp has joined #asahi-gpu
20:03taowa has quit [Quit: Gateway shutdown]
20:09bloomCoco for Coco Puff!
20:19AlJaMa has quit [Ping timeout: 264 seconds]
20:22AlJaMa has joined #asahi-gpu
20:22AlJaMa has joined #asahi-gpu
20:22AlJaMa has quit [Changing host]
20:49g3rp has quit [Quit: leaving]
20:50g3rp has joined #asahi-gpu
21:14g3rp has quit [Quit: Lost terminal]
21:26Mary_ has quit [Read error: Connection reset by peer]
21:29aquijoule__ has joined #asahi-gpu
21:30aquijoule_ has quit [Remote host closed the connection]
21:30Mary_ has joined #asahi-gpu
21:31neobrain2 has quit [Ping timeout: 246 seconds]
21:31neobrain has joined #asahi-gpu
21:50crabbedhaloablut has quit [Ping timeout: 264 seconds]
21:50crabbedhaloablut has joined #asahi-gpu
21:51Raqbit has quit [Quit: Ping timeout (120 seconds)]
21:52Raqbit has joined #asahi-gpu
…