07:30 wens: blah, the __nonnull_args() addition to drm_gem.h is giving me a lot of sparse check errors
08:44 mripard: jani: is there a way to test an unmerged kernel branch with an unmerged igt patch on intel's ci?
08:50 jani: mripard: it should be possible to send an igt series to the igt list, and then send a kernel series with "Test-with: <igt series cover letter message-id>" tag in the cover letter. For example, https://lore.kernel.org/r/20261104201331.2462-1-thomas.hellstrom@linux.intel.com
08:50 jani: DragoonAethis: is that ^ about right?
08:50 jani: (truth be told, I've never used it myself, I don't think)
09:05 mripard: oh, brilliant
09:05 mripard: thanks
09:23 jani: mripard: don't thank me until you got it working ;)
10:51 mripard: daniels: ping for https://lore.kernel.org/r/20261120-drm-reset-state-flag-v12-0-42d63d7417fc@kernel.org :)
11:09 jani: mripard: where's drm_atomic_helper_print_state_mismatch() defined? not in the tree?
11:11 jani: found it on the list, not sure if CI is going to find it though...
15:49 alyssa: robclark: where does !46574 fit in vs all the infrastructure I built up a few years ago?
15:49alyssa:hasnt read the whole thing yet
15:50 robclark: mostly I think it can replace nir_lower_builtin_functions() with some mako to generate nir-builder.cl
15:50 robclark: which seems like a nice cleanup
15:50 mripard: jani: yeah, it failed because it couldn't apply the patches
15:51 alyssa: robclark: Aight
15:51 mripard: I'll wait a bit for the dust to settle I guess
15:51 robclark: but I don't actually have any hw that uses nir_lower_builtin_functions()..
15:51 robclark: I could probably type up the mako part, but haven't had time yet
15:51 alyssa: lower_builtins is definitely a bit of a hack
15:51 alyssa: works well enough for what I needed but yeah
15:52 robclark: being able to generate nir-builder-for-cl fxns that use asm() to create nir instructions seems like it would be nicer
15:52 alyssa: I could see that
15:52 alyssa: https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/asahi/libagx/compression.cl?ref_type=heads#L107 <--- hack.
15:52 alyssa: as for all the linking stuff though, vtn_bindgen2 should really Just Work? I'm confused about that whole thread
15:53 robclark: the bigger question is more on the rusticl side
15:53 alyssa: alright..
15:53 robclark: we _dont_ want the stuff using asm() to end up in exported cl program binarier
15:53 alyssa: vtn_bindgen2 should do the job fine..?
15:53 karolherbst: alyssa: yeah.. the issue is here "convert OpenCL C to SPIR-V/nir for things neither clang nor the SPIRV-LLVM-Translator support"
15:53 robclark: I have some ideas.. but haven't had time to try typing it up yet
15:54 robclark: yeah, the vtn_bindgen2 part should be easy
15:54 alyssa: vtn_bindgen1 (now deleted) really did link functions and it was a whole mess
15:54 alyssa: the "2" rewrite was specifically "this is just spicy nir_builder"
15:54 karolherbst: alyssa: the issue is we can't add functions at nir time, because we need to compile fully linked binaries for the applications, unless we want to play the game of "which missing symbols are fine actually (tm)"
15:55 alyssa: yes. vtn_bindgen2 handles that.
15:55 alyssa: no?
15:55 karolherbst: well... no
15:55 karolherbst: soo
15:55 robclark: so the inline asm would have everything linked up front
15:55 robclark: since it would just be inline fxns in a header
15:55 karolherbst: imagine we want to support some_builting_from_vendor_ext(..) in CLC
15:55 karolherbst: but..
15:55 karolherbst: clang can't compile that for us to SPIR-V, because it's a ext not supported by upstream llvm
15:55 alyssa: vtn_bindgen2 generates stuff like https://alyssarosenzweig.ca/ex.c
15:55 robclark: (inline fxns for the vtn_bindgen2 case)
15:56 karolherbst: so we need a way to insert functions in the CLC compilation pipeline at runtime
15:56 karolherbst: which.. translate to nir somehow
15:56 alyssa: nir_call_serialized injects code directly inlined at the cursor, there's no linking stuff happening
15:56 karolherbst: yeah, but how do we know what to insert?
15:57 karolherbst: like..
15:57 karolherbst: we don't have the SPIR-V telling us
15:57 karolherbst: because upstream LLVM doesn't support the CLC builtins
15:57 karolherbst: so it can't give us a SPIR-V with OpSomeVendorExtInstruction
15:58 karolherbst: this isn't to implement something with CLC, it's to support CLC functions upstream doesn't
15:58 alyssa: I'm not following what that has to do with rob's MR
15:58 robclark: the vtn_bindgen2 case is kinda different from the rusticl case, the vtn_bindgen2 can just inject a header with inline fxns that use asm().. it doesn't have the same issue with rusticl needing a librusticl.cl that gets built separately and linked later
15:59 karolherbst: alyssa: it's the motivation
15:59 robclark: it doesn't really have anything to do with my MR.. it's just about how/if my MR can be wired up to rusticl
15:59 alyssa: Isn't the solution to fix LLVM upstream?
15:59 alyssa: and/or stop tracking upstream clc and just hard fork?
15:59 karolherbst: it also needs translator changes
16:00 karolherbst: alyssa: it's not clc
16:00 karolherbst: it's the frontend
16:00 karolherbst: like you are asking to hardfork clang+llvm here
16:00 alyssa: Okay.
16:00 robclark: so the motivation is that I have a big pile of qc cl extensions that are needed so various users no longer have dependency on closed cl driver.. we need a way to implement extensions that introduce builtins on mesa side
16:00 karolherbst: like normally.. for a CLC builtin we get a SPIR-V opcode in some form
16:00 karolherbst: be it clc ext instruction or some core spir-v or some spir-v extension thing
16:01 karolherbst: doesn't really matter.. we get the SPIR-V and deal with that
16:01 karolherbst: but what if the builtin we want to support isn't supported in upstream (yet)
16:01 karolherbst: one way is to have static inline functions doing inline nir asm e.g.
16:01 karolherbst: we could inject those via an internal CLC header
16:02 karolherbst: and then we get SPV_INTEL_inline_assembly with our asm
16:02 karolherbst: what I suggested as an alternative.. we could also just write spir-v asm and use that as well
16:02 karolherbst: just needs a way to wire it all up
16:03 karolherbst: so the problem isn't "how do we use CLC to implement stuff" but rather "how do we support more CLC builtins clang doesn't"
16:05 alyssa: I see
16:05 karolherbst: we could of course also just write patches against clang+llvm+translator/spirv backend and just wait on LLVM releases
16:05 alyssa: But that's pretty orthogonal IMHO
16:05 karolherbst: right... what I'm saying is just, inline_assembly would be one way to get there
16:06 alyssa: Sure
16:06 karolherbst: because that allows us to bypass the stack almost completely
16:06 karolherbst: but also... I don't really want nir asm... so I kinda prefer just writing SPIR-V asm code instead and mix that in
16:07 karolherbst: but there might be things we want to support that don't have a SPIR-V extension either...
16:08 robclark: I think first I want to solve how we can have librusticl.cl that is kept separate from what is provided by and exported as program binary... we want that either way
16:08 robclark: prob on the rusticl side we end up using some of both.. but maybe more nir asm at first since that doesn't involve generating spv asm wrapper fxns for spv instructions... which has some open questions still
16:09 robclark: I think the nir asm is maybe more needed on the bindgen2 side
16:09 karolherbst: yeah.. we probably will need kinda both, but also.. dunno if I ever want to expose any nir asm to applications...
16:09 karolherbst: maybe we shouldn't call it "nir asm"
16:09 karolherbst: I'd be happy to support an instruction set we extend over time and abstract that from nir
16:10 karolherbst: if we come up with an inline asm set that we guarantee won't ever change besides being extended, a lot of issues go away
16:11 karolherbst: and then things can also end up in exported binary programs, because.. it's stable or versioned or whatever
16:11 robclark: for now, not exposing "nir asm" to app is clear :-)
16:12 karolherbst: yeah.. but that's painful for the runtime ðŸ˜
16:12 karolherbst: maybe we should just do rusticl asm and define a set of instructions and it's just a list of things stable forever
16:13 karolherbst: and then just have C code to map that to nir
16:14 robclark: I'd like to separate our runtime from app either way.. I have some ideas that I'll try.. how quickly depends on how much time I have left in the day after everything else during the week :-)
16:15 karolherbst: I mean.. if we want to use inline_assembly for our internal CLC kernels... I'd also be kinda fine with that, because it kinda integrates more nicely with the vtn_bindgen2 stuff I figure?
16:15 karolherbst: maybe not.. dunno
16:15 karolherbst: at least we don't have the problem of the program binaries
16:16 karolherbst: so the asm ending up in the SPIR-V is no issue
16:16 robclark: right
16:17 robclark: I'll work on it.. but also need to where my (linux) kernel hat for a bit, and increase in internal contributors plus AI enabled external contributers increases my MR/patch review workload somewhat.. so we'll see how quickly that goes
16:17 robclark: s/where/wear/
16:24 tomeu: robclark: so, do I understand correctly that it would allow vulkan and opencl users to make use of HVX and HMX in their kernels?
16:25 robclark: the intention is not to expose it to users, at least not yet.. but allow internal .cl code (potentially including code that implements rusticl extensions) to use it.. as far as HVX/HMX.. idk too much about it but if they are nir alu/intrinsic/tex instructions then yes
16:26 robclark: exposing it to users requires a kind of abi commitment that I don't want to touch yet
16:27 robclark: but if some backend has special things it wants to expose and those map to nir instructions, then they could use inline asm in internal .cl (not exposed to users) to generate those instructions
16:27 robclark: (hopefully I explained that clearly)
16:28 karolherbst: I think if there is interest to expose inline_assembly to users we _could_ do that, just not sure if we should, but I guess if vendors want that...
16:28 robclark: right
16:30 alyssa: karolherbst: I'm strongly opposed to that
16:30 karolherbst: I feel the same way in principle
16:30 alyssa: NIR is not stable, and the minute there are external consumers we start getting bug reports when NIR evolves
16:31 alyssa: If there's going to be actual hw __asm__ for users (like SASS level), then sure
16:32 alyssa: but anything higher level should be a vendor spirv ext minimum
16:32 karolherbst: oh yeah I wouldn't expose a NIR asm
16:32 karolherbst: *Want to
16:32 karolherbst: we'd have to define some stable mesa asm or something and then have code mapping that to nir explicitly or whatever
16:32 alyssa: Yeah it's called spir-v.
16:32 robclark: note.. at the spv level, the inline_asm extension is defined in such a way that we could have multiple different asm targets (ie. for different vendors/etc).. clang and llvm-spirv-translator doesn't support that very well.. but we could work around that by having spv asm fxns or something like that.. anyways, that is getting far off what we want today (and maybe even ever want)
16:32 karolherbst: I know and there should be SPIR-V extension for everything
16:33 robclark: ie. spv functions wrapping the inline_asm opcodes
16:33robclark:bbiab
16:33 karolherbst: yeah.. maybe we want to support backend asm, but that kinda feels like... annoying from a "write the code" perspective
16:34 karolherbst: not sure we want to add infra for piping asm down to backend compilers
17:03 robclark: re: backend instructions... if backend vendor foo has a do_the_magic_awesome_thing instruction, they model it as nir_intrinsic_do_the_magic_awesome_thing_foo, the same as we always have.. and mesa internal .cl code implementing cl_foo_magic_awesome_thing builtin fxns can use __asm__() to get at that instruction. :-)
17:12 karolherbst: robclark: we couldn't model all nvidia instructions like that, or not in a way that it wouldn't be super awkward
17:13 karolherbst: but maybe it doesn't matter
17:14 robclark: all the nir passes btwn the frontend and backend need to _somehow_ grok the instructions to some degree... anyways, that is getting pretty far off into hypotheticals.. nir is malleable, it could be extended or whatever
17:15 karolherbst: I'm sure nir won't support alu instructions with multiple outputs of different types like.. ever :)
17:18 HdkR: opaque asm block where the text is hardware instructions and the only inputs and outputs are register or memory shaped things :P
17:18 HdkR: The worst of all worlds
17:24 robclark: karolherbst: multiple instructions for the different outputs, and backend pass to try and fuse things?
17:25 karolherbst: as I said: it would be super awkward
17:34 alyssa: karolherbst: returning a magic handle and separate instructions to unpack is how I solve a similar problem for intel
17:34 karolherbst: alyssa: for an alu instruction?
17:35 karolherbst: I mean... that could work.. but also... dunno..
17:36 alyssa: but also dont solve problems for the sake of solving problems
17:36 karolherbst: at least the main use case there are optimizations, maybe we should just optimize in the backend.. but we do have some weird things going on that it's a bit painful
17:36 karolherbst: it was just an example of things that are a bit awkward in nir
17:37 alyssa: sounds like job security to me :p
17:37 karolherbst: heh
17:37 karolherbst: our LOP3 instruction is impressive.. it's not just doing logic operations, it also tells you whether the result was 0 or not 🙃
17:49 robclark: that just sounds like having a flags register?
17:54 karolherbst: well.. kinda, but also kinda not
17:55 karolherbst: we have 7 general purpose predicates (booleans)
17:56 karolherbst: which replaced the flag register..
17:56 karolherbst: thing is.. they are general purpose and follow SSA semantics
17:57 robclark: hmm, ok
17:58 karolherbst: yeah.. turns out having them more flexible helps the compiler with scheduling stuff more efficiently or something
18:01 glehmann: for returning an int and a bool, using a vec2 and copy propagating b2i(a) != 0 in the backend works
18:01 glehmann: I did that for add with carry
18:02 glehmann: would be easier if nir has support for ssa structs