#
#asahi-gpu · 2023-03-07 12:34
alyssanotably, multiDrawIndirect, which is like draw indirect but now draws an arbitrary number of draws indirectly with the draw count loaded from memory
#asahi-gpu · 2023-03-07 12:33
alyssabut if you have an API requirement that the hw doesn't accommodate, you're kinda screwed
#asahi-gpu · 2023-03-07 12:33
alyssathere's hardware support for a few important types of indirects, where there's a special control word to do an indirect draw or whatever
#asahi-gpu · 2023-03-07 12:33
alyssagenerally this means that AGX is easier to program -- and the AGX control stream is a lot more compact than the Mali command stream -- but there's a pretty low ceiling for what you can do with AGX in terms of indirection
#asahi-gpu · 2023-03-07 12:31
alyssabut that has general purpose "load/store registers from/to memory" instructions, conditional branching based on the values of registers, a simple integer ALU, etc
#asahi-gpu · 2023-03-07 12:31
alyssae.g. Mali-G610 exposes an entire Turing-complete-by-design ISA where the state vector is passed in registers that the driver sets with MOV_IMM32 instructions
#asahi-gpu · 2023-03-07 12:30
alyssathis is very different than GPUs with real command streams,
#asahi-gpu · 2023-03-07 12:30
alyssait's just a bunch of control packets one after the other, plus a link command to jump between control streams
#asahi-gpu · 2023-03-07 12:29
alyssathe distinction being, it isn't executed / interpeted in any meaningful way, it's not structured as commands or bytecode or anything
#asahi-gpu · 2023-03-07 12:29
alyssa*GX actually has a "control stream" in powervr lingo, not a command stream
#asahi-gpu · 2023-03-07 12:28
alyssalina: nit, "the VDM level (in the GPU command stream)"
#asahi-gpu · 2023-03-07 11:12
linaWrote this to attach to the DRM submission ^^ (cc ella-0 & alyssa): https://github.com/AsahiLinux/docs/wiki/SW:AGX-driver-notes
#asahi-gpu · 2023-03-07 09:12
linaOK, alyssa was using the debug allocator and I think we're hitting a firmware bug/race, but I don't think we use that codepath at all in the regular mode so I'm just going to punt on it...
#asahi-gpu · 2023-03-07 06:08
i509vcbbytemuck does have some safety notes that might be worth considering even though you seem to be rolling your own type -> bytes conversion: https://docs.rs/bytemuck/1.13.1/bytemuck/trait.Pod.html
#asahi-gpu · 2023-03-07 05:54
alyssanini
#asahi-gpu · 2023-03-07 05:54
alyssafiiiiine
#asahi-gpu · 2023-03-07 05:54
linaI'll test with your kernel
#asahi-gpu · 2023-03-07 05:54
linaOK, go to sleep sis ^^
#asahi-gpu · 2023-03-07 05:54
alyssahttps://rosenzweig.io/I is with your patch
#asahi-gpu · 2023-03-07 05:54
alyssalina: Nope, still no good
#asahi-gpu · 2023-03-07 05:49
alyssa(OK, I hit the issue with firefox in sway on the older kernel. good to know it's not just gnome)
#asahi-gpu · 2023-03-07 05:49
linaCan you check if the last patch fixed it? It's all I've got...
#asahi-gpu · 2023-03-07 05:48
linaSo that's not unsafe
#asahi-gpu · 2023-03-07 05:48
linaYou can't assume anything about the layout, but you could restore it into an identical struct
#asahi-gpu · 2023-03-07 05:48
alyssais that portable?
#asahi-gpu · 2023-03-07 05:48
linaIt is, if you know there is no padding (which can be known)
#asahi-gpu · 2023-03-07 05:47
alyssabecause even in an unsafe{} block it is literally never legal to get raw bytes of repr(Rust)
#asahi-gpu · 2023-03-07 05:47
linaHence the Castable thing (that's supposed to mean "safe to get the raw bytes" but this isn't a core language feature yet)
#asahi-gpu · 2023-03-07 05:47
alyssastill feels like this is a footgun API
#asahi-gpu · 2023-03-07 05:47
linaIt isn't, it's all unsafe, yeah
#asahi-gpu · 2023-03-07 05:47
alyssaor is this happening in an unsafe{} block with a botched SAFETY comment?
#asahi-gpu · 2023-03-07 05:47
alyssawhat I mean is, how is it ever sound to get the raw bytes of a repr(Rust) struct
#asahi-gpu · 2023-03-07 05:46
linaI think it's something that should eventually be a core feature
#asahi-gpu · 2023-03-07 05:46
linaIt's an FFI thing, you need to set the struct layout... Once I add the Castable thing it should catch some (but not all) of these issues
#asahi-gpu · 2023-03-07 05:45
alyssaim kinda surprised rust doesn't catch this sort of bug
#asahi-gpu · 2023-03-07 05:45
linaAdded more reprs though it was kinda trivial stuff, I don't know if that's it...
#asahi-gpu · 2023-03-07 05:42
alyssasway + stk is fine
#asahi-gpu · 2023-03-07 05:42
alyssaIDK why it's only happening with gnome
#asahi-gpu · 2023-03-07 05:41
linaCould be a repr(C) thing and your Rust compiler really wants to shuffle structs around for some reason
#asahi-gpu · 2023-03-07 05:41
alyssahttps://rosenzweig.io/Image.gz
#asahi-gpu · 2023-03-07 05:40
linaCan you upload your kernel binary somewhere and go to sleep? I can probably track it down running it in the hypervisor.
#asahi-gpu · 2023-03-07 05:40
alyssano
#asahi-gpu · 2023-03-07 05:40
linaIs there anything earlier? That just looks like the firmware died...
#asahi-gpu · 2023-03-07 05:39
alyssamore missing repr(C)?
#asahi-gpu · 2023-03-07 05:39
alyssahttps://rosenzweig.io/splat
#asahi-gpu · 2023-03-07 05:38
linaAny messages?
#asahi-gpu · 2023-03-07 05:38
alyssakernel
#asahi-gpu · 2023-03-07 05:38
linakernel or mesa?
#asahi-gpu · 2023-03-07 05:38
lina;;;;;;;;;;;
#asahi-gpu · 2023-03-07 05:38
alyssaooh, oof, this is your bug after all

plus ›