#asahi-gpu · 2022-10-02 14:33
linaOhhh wwwwwwwww#asahi-gpu · 2022-10-02 14:33
linaWhat is Arduino?#asahi-gpu · 2022-10-02 14:29
linaThe addresses are so random...#asahi-gpu · 2022-10-02 14:28
linaI have no idea how that even happens.#asahi-gpu · 2022-10-02 14:27
lina(That was a joke, click the link. That's my favorite WTF hardware graphics bug I saw while looking at GPU drivers.)#asahi-gpu · 2022-10-02 14:26
linahttps://github.com/torvalds/linux/blob/master/arch/x86/kernel/setup.c#L693#asahi-gpu · 2022-10-02 14:26
linaEveryone knows Intel GPUs are the best and most perfect GPUs ^^#asahi-gpu · 2022-10-02 14:21
linaI'm just saying this isn't a big deal in the grand scheme of things, as far as hardware differences go#asahi-gpu · 2022-10-02 14:21
linaYes, this is funny hardware ^^#asahi-gpu · 2022-10-02 14:20
linaBut the command buffers themselves are going to be full of fields telling the hardware what to do... what's the difference between the kernel rejecting your command buffer and the hardware bugging out? Both indicate the driver did the wrong thing and allowed something to go through that isn't allowed.#asahi-gpu · 2022-10-02 14:19
linaNo difference to this ^^#asahi-gpu · 2022-10-02 14:19
linaYeah but I'm sure you have hardware limits that cannot be exceeded for correct output, right?#asahi-gpu · 2022-10-02 14:18
linaThat's a bug in mesa#asahi-gpu · 2022-10-02 14:18
linaI mean you need to make sure everything submitted is correct anyway, you wouldn't want to feed the kernel something it rejects at any point#asahi-gpu · 2022-10-02 14:18
linaSure, but that's life for tiled architectures...#asahi-gpu · 2022-10-02 14:17
linaYou can do as many render passes to as many separate sets of render targets as you want in AGX, each one just has to be a separate job submission#asahi-gpu · 2022-10-02 14:16
linaRight?#asahi-gpu · 2022-10-02 14:16
linaOf the same dimensions#asahi-gpu · 2022-10-02 14:16
linaAs in MRT#asahi-gpu · 2022-10-02 14:16
linaYes, but there is a max # of *simultaneous* render targets#asahi-gpu · 2022-10-02 14:15
linaApple lists those limits in a big PDF somewhere#asahi-gpu · 2022-10-02 14:15
linaI don't think this is special#asahi-gpu · 2022-10-02 14:15
linaEvery GPU has a max # of render targets, right?#asahi-gpu · 2022-10-02 14:15
linaYeah but userspace will know about the max ahead of time#asahi-gpu · 2022-10-02 14:14
linaWait what's hard about attachment lists?#asahi-gpu · 2022-10-02 14:14
linaI don't think AGX is special here#asahi-gpu · 2022-10-02 14:14
linaI think separate submissions per render pass is typical for all tiled architectures?#asahi-gpu · 2022-10-02 14:13
linaSo yeah#asahi-gpu · 2022-10-02 14:13
linaSupplying bad data to firmware crashes the GPU and your entire machine in practice...#asahi-gpu · 2022-10-02 14:13
linaEverything else is static#asahi-gpu · 2022-10-02 14:13
linaThat's the only variable length structure involved here that I can think of though.#asahi-gpu · 2022-10-02 14:13
linaalyssa: The kernel needs to copy the attachment list over for one, but I also don't think the firmware will appreciate the count being > the list size#asahi-gpu · 2022-10-02 14:12
lina(Because this is a tiler)#asahi-gpu · 2022-10-02 14:12
linaIf you switch render targets, that does need a separate job#asahi-gpu · 2022-10-02 14:12
linaOne job submission to the kernel = one batch of rendering to the same set of render targets#asahi-gpu · 2022-10-02 14:12
linakarolherbst: Ah yes, you can do that as many times as you want.#asahi-gpu · 2022-10-02 14:12
linaalyssa: There are some things to sanitize (e.g. not exceeding max # of attachments), but it's fairly obvious stuff.#asahi-gpu · 2022-10-02 14:11
linaDepends on what you mean by "render job"#asahi-gpu · 2022-10-02 14:10
linaSo we make up an arbitrary uABI for that to contain the data we need, and the kernel just copies it over to the firmware structs and fires the job#asahi-gpu · 2022-10-02 14:10
linaIt's just that the fixed-sized, job description structures need to be populated by the kernel, partially from userspace data#asahi-gpu · 2022-10-02 14:10
linaUserspace still fills the actual draw/shader bind/etc command stream of course#asahi-gpu · 2022-10-02 14:09
linaWell, it's not really problematic, it's just... annoying#asahi-gpu · 2022-10-02 14:09
linaIn this case the kernel fills command buffers because Apple decided to architect their firmware such that those command buffers have to be trusted.#asahi-gpu · 2022-10-02 14:08
linaIn this case we've been learning that some of those fields correspond directly to hardware registers (some of them fully or partially match PowerVR registers...), and since that ABI is dictated by hardware and therefore fixed, it's safe to expose to userspace directly.#asahi-gpu · 2022-10-02 14:08
linaIt's just that we're still figuring out what fields of the corresponding giant firmware render structures actually need to be exposed to userspace and which don't.#asahi-gpu · 2022-10-02 14:07
linaThey'd just be fields in the render struct. It's job data like everything else already there.#asahi-gpu · 2022-10-02 13:35
linaI don't know what I'm doing with mesa anyway, I just copied and pasted bits of Panfrost code so I'm not surprised it's broken... ^^;;;#asahi-gpu · 2022-10-02 10:58
linaSounds good! It's just Z clip so if it's wrong you'll just get messed up clipping, it won't otherwise break everything. When I tested GL mesa on non-GL mode, I was getting half a cube. Vulkan on GL mode is probably just the opposite, so it'll probably display fine as long as nothing is behind the camera?#asahi-gpu · 2022-10-02 10:56
linaBut the way the driver does memory management, queue allocation, waiting, and scheduling is going to be completely redesigned for the real uAPI#asahi-gpu · 2022-10-02 10:56
linaFor now, the first step is to just move into the uAPI all the registers that GL actually needs to pass the CTS (and also that GL mode bit). Most of that render command design can carry over to the real uAPI progressively.