00:46 anarsoul|2: I'm working on adding atan and atan2 opcodes to nir. What whould be the best place to add lowering for them to avoid adding another lowering pass to each backend compiler?
00:47 karolherbst: anarsoul|2: nir_opt_algebraic if it's not too complex
00:48 karolherbst: anarsoul|2: I hope you mean like glsl atan, right?
00:48 anarsoul|2: I would dare to rewrite this amount of C in py
00:48 anarsoul|2: karolherbst: yeah
00:48 anarsoul|2: why?
00:49 anarsoul|2: see https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/compiler/nir/nir_builtin_builder.c#L176
00:49 karolherbst: yeah.. I just searched for that..
00:50 karolherbst: do we actually have hardware supporting this natively?
00:50 anarsoul|2: karolherbst: yeah
00:50 anarsoul|2: ARM :)
00:50 anarsoul|2: at least utgard (lima) and midgard (bifrost)
00:50 karolherbst: .... is it actually faster?
00:51 anarsoul|2: karolherbst: yes, see https://gitlab.freedesktop.org/mesa/mesa/-/issues/9323
00:51 karolherbst: interesting...
00:51 karolherbst: I see that nvidia has native tanh btw
00:52 karolherbst: anarsoul|2: maybe... we should just check if the backends have it and either call nir_atan or emit the opcode...
00:52 karolherbst: could be the easiest way out
00:52 karolherbst: just add a "has_atan" flag to nir compiler options
00:53 anarsoul|2: but is backend already initialized when we translate glsl to nir?
00:54 karolherbst: glsl_to_nir takes a nir_shader_compiler_options at least
00:54 karolherbst: let's see if this is also the driver one...
00:55 karolherbst: yeah.. looks like it
00:56 karolherbst: NirOptions set inside src/mesa/state_tracker/st_extensions.c, and NirOptions passed to glsl_to_nir
00:56 karolherbst: so I think you can actually use it this way
00:56 karolherbst: I think we also do something with this with ffma? mhh
00:56 karolherbst: maybe that was a patch of mine
01:00 alyssa: anarsoul|2: the "proper" answer is nir_lower_alu but I don't know if all backends call it
01:01 anarsoul|2: alyssa: unfortunately not all backends call it, I checked
01:01 anarsoul|2: that was my first thought
01:01 anarsoul|2: karolherbst: thanks, it works!
01:03 karolherbst: though I guess nir_lower_alu would work as well.... mhhh.... annoying.. maybe st/mesa should just call nir_lower_alu?
01:04 karolherbst: depends if you also want to add fancy optimizations based on atan
01:14 anarsoul|2: oof, atan2 in utgard isn't really nir or ppir friendly :)
01:14 karolherbst: what does that mena?
01:15 karolherbst: it clobbers other registers?
01:15 anarsoul|2: it should be lowered to temp.xyz = atan2_pt1(y, x); temp.x *= temp.y; result = atan2_pt2(temp.xyz)
01:15 karolherbst: ohh wait...
01:15 karolherbst: we have something like that on nvidia as well
01:16 anarsoul|2: well, I guess temp is a reg and not ssa
01:16 karolherbst: or at least we had....
01:18 karolherbst: is atan2_pt1 maybe something like 1/2π?
01:18 karolherbst: ehh a * 1/2π I mean
01:19 karolherbst: mhh.. though doens't make sense if it takes two values?
01:19 karolherbst: guess it's just something funky
01:20 anarsoul|2: no, atan2_pt1 produces a vec3
01:20 anarsoul|2: and yeah, it takes 2 values
01:21 anarsoul|2: atan_pt2 is common for atan and atan2, it takes vec3 and produces actual result
01:22 anarsoul|2: for atan2 you also need to multiply temp.x by temp.y
01:24 karolherbst: I'm sure deep down all of this makes sense
01:50 alyssa: anarsoul|2: what's wrong with translating nir_op_atan2 to that series of 3 ppir instructions?
01:53 anarsoul|2: alyssa: nothing, we just never had to create an additional ppir_reg in ppir before (currently each nir_reg corresponds to ppir_reg), so some plumbing is necessary
01:54 anarsoul|2: slightly more work than I originally anticipated
02:07 alyssa: anarsoul|2: speaking of, can I put you down for the lima bits of https://gitlab.freedesktop.org/mesa/mesa/-/issues/9051 ?
02:07 alyssa: I'm optimistc !23089 will land this week
02:10 anarsoul|2: alyssa: I can't commit to any reasonable ETA at the moment. Try pinging enunes?
02:10 alyssa: ack
02:11 alyssa: enunes: ^
02:11 anarsoul|2: is there any documentation on your rework?
02:12 alyssa: MR description of https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23089
02:13 alyssa: for lima/pp, the path of least resistance will be the nir_legacy.h api https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23089/diffs?commit_id=bc29ff93c196249549e0fd76e6a3430dd35b1451#2fd7aea6f6e1a294376aa95196bcc4a119e86c1e_0_1
02:14 alyssa: for lima/gp, since gpir needs explicit load/store register instructions anyway, you can just translate nir load_reg/store_reg to gpir load_reg/store_reg without anything else
02:16 anarsoul|2: I'd run your lima/gp suggestion through cwabbott if he still remembers gpir details
02:23 anarsoul|2: honestly, it'd be easier to rewrite ppir from scratch than writing an optimizer for its current version. Yet it's enormous amount of work and I just don't have that much spare time atm
02:23 alyssa: really?
02:23 alyssa: ppir looked pretty clean to me
02:23 anarsoul|2: alyssa: it's hard to transform it
02:23 alyssa: ah..
02:23 alyssa: well, nir_legacy will be there for you then :)
02:25 anarsoul|2: I guess what we lack is nir_builder equivalent for ppir
02:38 alyssa: yeah..
05:14 marcan: I figure if anywhere people here might know: what is the "usual"/"intended" mechanism to avoid racing KMS driver probe/hotplug with things like display managers/X?
05:15 marcan: we used to have dcp returning from the probe function and initializing asynchronously, which caused problems with gdm. making it synchronous fixed that, but now I ran into a similar thing where the Fedora initial setup GUI tries to start X in the middle of the DCP probe
05:15 marcan: I always assumed there had to be some udev settle thing but I guess that's not a thing these days... so how are things supposed to be sequenced to avoid these races?
05:31 airlied: marcan: you should just send an updated hotplug even when you find new things connected
05:37 airlied: are you still discovering connectors at that stage?
05:37 airlied: or just connected/disconnected?
05:53 Lynne: emulating raytracing is unvulkan
05:55 airlied: all of raytracing is emulated
05:55 airlied: it should have been done in a layer :-P
05:57 Lynne: if raytracing is emulated, I ask, nay, demand, that the driver exposes multiple queues even if no such exist just to alleviate the overhead of externally synchronized submissions
05:57 Lynne: it's literally free fps
05:58 airlied: I do wonder how much of raytracing could have been done with custom compute shader launch mechanisms
06:04 ishitatsuyuki: raytracing hardware are invoked from shaders, there's no separate queues
06:21 marcan: airlied: still discovering connectors because there's no inherent serialization with device probe as far as I can tell?
06:21 marcan: it gets even messier with the handoff from simpledrmfb, since that means one drm device goes away and another one replaces it
06:21 marcan: which is fine for TTYs but we need to wait until the "real" device comes in before starting any display servers/managers if we don't want things to go really wrong
06:22 marcan: the issue here was that X died with "no screens"
06:22 Lynne: ishitatsuyuki: I meant in general, not specifically for raytracing, it was a spec mistake, and someone from microsoft here happily pointed out d3d12 made no such errors
06:22 ishitatsuyuki: hm
06:23 marcan: Lynne: just wait until you discover how much of vulkan will be emulated on Apple hardware :p
06:24 Lynne: you mean moltenvk or asahi?
06:24 marcan: asahi
06:25 marcan: transform feedback? emulated. geometry shaders? emulated. tessellation? depending on what you do, emulated. blending? emulated.
06:27 marcan: (but at least emulated on the GPU, not like macOS which does half of those things on the *CPU* for OpenGL. yes really.)
06:30 airlied: marcan: how did you make it sync to fix gdm?
06:31 airlied: like you could block on the first kms interaction until you have at least one connector found
06:31 marcan: the kernel stuff got reworked to block driver probe until all the initial stuff is ready, that seemed to fix it. my assumption was there would be serialization between that modprobe and gdm, which at least on ALARM is the case I believe (since the modprobe happens in the initramfs while gdm obviously runs from the rootfs)
06:32 marcan: previously it was just going off and kicking the init asynchronously and returning from probe quickly, before the actual DRM device got created
06:33 airlied: you could do that and then just block on the first open or get resources
06:33 marcan: but in this case it looks like X isn't being serialized with anything, and I'm not sure we can do much on the kernel side about that? if it doesn't at least wait until the real KMS DRM device is created, it's either going to find simpledrm and get it yanked out from under it a second later, or find no device at all
06:34 marcan: airlied: not if the DRM device doesn't even exist yet
06:35 airlied: well when you start modprobing it should kick out simpledrm straight away
06:35 airlied: but yeah you'd need to create the device to stop something finding no devices
06:35 marcan: yeah but if nothing is waiting for the probe func to return at all then there's no way to close that race
06:35 marcan: which seems to be the case here I think
06:37 marcan: AFAIK we do create the device before returning from probe, but clearly X isn't waiting for that
06:37 airlied: X doesn't know to wait for anything
06:37 marcan: and if it's not waiting for the module load to complete (which probes synchronously as far as I know), then it's always going to be racy
06:37 marcan: right, which is why I thought distros had to serialize this somehow
06:38 marcan: in traditional initramfs setups where you do your thing, wait for it to be done, then pivot to the real root, that point is suitably serializing
06:38 marcan: but it seems these days systemd does some handoff something something and udev doesn't actually wait for settling in the initramfs or anything, it just all gets parallelized
06:38 marcan: and now I'm wondering what the serialization point is, if any (or are all systems just broken and just not hitting the race by chance? :p)
06:40 marcan: https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/1958488 looks like I'm not the only one running into this...
06:41 marcan: https://gitlab.gnome.org/GNOME/gdm/-/commit/ecbd9694458194e24f356ba9d37fc4f3a515c3dd#note_1402863 apparently there's a CanGraphical thing...
06:43 emersion: systemd CanGraphical is deprecated
06:43 emersion: userspace needs to wait for a KMS device with a timeout
06:44 airlied: where is the deprecation mentiond?
06:46 emersion: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/2093
06:47 emersion: well not deprecated, but... not the right tool
06:48 airlied: does CanGraphical signal for this case with simpledrm or something?
06:50 marcan: SUBSYSTEM=="drm", KERNEL=="card[0-9]*", TAG+="seat", TAG+="master-of-seat"
06:50 marcan: looks like it will fire for any DRM device
06:51 marcan: # Allow efifb / uvesafb to be a master if KMS is disabled
06:51 marcan: SUBSYSTEM=="graphics", KERNEL=="fb[0-9]", IMPORT{cmdline}="nomodeset", TAG+="master-of-seat"
06:52 marcan: I'd say that udev rulefile needs to be updated to ban simpledrm... but under what conditions? doesn't "nomodeset" also break simpledrm since it's KMS?
06:53 marcan: the problem though is ideally we *do* want simpledrm fallback to work... and again the only way I can think of to make that work is to just wait for all drm drivers to probe
06:54 marcan: (the idea being that dcp might not exist or fail to probe under some situations, but you still want a dumb GUI to work)
06:55 airlied: yeah it's the age old problem, of when to take the fallback path as the only path
06:55 marcan: https://github.com/systemd/systemd/issues/10435 looks like systemd basically gave up on this
06:56 marcan: and then there's the renderonly GPU/kmsro issue to deal with, if DCP probes before the GPU that's also going to break
07:20 mripard: jani: if it's still relevant, you have my acked-by
07:20 mripard: (and an additional: yes, finally!) :)
07:33 tzimmermann: marcan, it's not really uerspace' job to second-guess the DRM devices; just use whatever /dev/dri/card is there (even if simpledrm isbeing removed shortly afterwards); and if nothing's there userspace should wait
07:34 tzimmermann: wrt Xorg: just give up, even if Xorg can be made to work correctly, it's probably either a hack or a rewrite of the DRM backend
07:34 emersion: ^
07:34 emersion: the renderonly case is a bit shaky though
07:35 tzimmermann: i think, i missed half of the discussion
07:35 emersion: i don't have good ideas to fix that one, except a list of KMS drivers which are expected to have a separate render node…
07:35 emersion: in mesa
07:36 emersion: so that mesa can block for a bit
07:36 emersion: but that breaks as soon as there's a system with just a display device and no render device
07:37 emersion: well, s/breaks/times out/, which is not a nice UX
07:37 tzimmermann: i missed the first half of the discussion. what was the initial problem? there's a render node and the modesetting node comes up late?
07:37 mripard: instead of a KMS drivers list, can't we use the driver features which shouldn't have DRIVER_MODESET?
07:40 emersion: mripard: the compositor will wait for a display device to come up
07:41 emersion: so the compositor already waits for the DRIVER_MODESET device to come up
07:41 emersion: the problem is when the render device is late
07:41 emersion: the compositor doesn't know when a KMS device is renderonly or not, the only way to know is to try to create a GL context
07:42 emersion: at that point, we're in mesa and mesa sees only the KMS device it's been initialized with, but no render node
07:42 mripard: sorry, I meant DRIVER_RENDER
07:42 emersion: some systems don't have a render device
07:42 emersion: we can't stall these systems for 5s just in case a render device shows up later
07:43 mripard: sure, but if it causes an issue, I'd expect the list of platforms that would run a compositor without a render node to be fairly small
07:43 mripard: so maybe we can have a list of devices that are known not to have GPU?
07:43 mripard: and just assume they do
07:44 emersion: i'd really rather have the contrary…
07:44 mripard: but I'm not even sure that the driver name is the right tool for that
07:44 emersion: renderonly requires mesa changes anyways
07:44 mripard: I'm pretty sure we have drivers that run on both platforms
07:44 emersion: right
07:45 mripard: not platforms, but systems with and without GPUs
07:45 emersion: that's what i was scared of
07:45 emersion: is devicetree of any help here?
07:48 javierm: marcan: how plymouth worked around this was to threat simpledrm as a fallback and only use it without a timeout if modeset or plymouth.use-simpledrm is in the cmdline
07:48 javierm: marcan: https://gitlab.freedesktop.org/plymouth/plymouth/-/merge_requests/163/diffs?commit_id=83b385061ccbf5a46ea77f7f12c1c7bfc72a09f2
07:49 jannau: javierm: s/ modeset / nomodeset / ?
07:49 javierm: jannau: yes, sorry. A typo
07:49 mripard: emersion: could be, we could link the GPU to the display through the device tree, and even expose that through sysfs if it makes sense
07:50 mripard: also, we have platforms using ACPI that show up, so I'm not sure it's the proper solution
07:50 tzimmermann: javierm, OMG i really wish they had at least tried to fix this in simpledrm
07:50 emersion: iirc sima was not a fan of having the kernel involved
07:51 emersion: anyways, we can have whatever logic we want in the mesa loader
07:51 javierm: tzimmermann: yeah... but I guess this is inevitable. When I first replaced {efi,vesa}fb with simpledrm, a lot of stuff broke due efifb behind harcoded all over the stack
07:51 javierm: tzimmermann: I guess now we have simpledrm instead :)
07:52 emersion: :/
07:52 javierm: *being hardcoded
07:52 mripard: worst case scenario, we use the driver name like you suggested, and if some platforms break we can always use the platform name as a secondary check
07:53 emersion: is the platform name different when there is no GPU?
07:53 emersion: or do you mean something else than the KMS device platform name?
07:54 emersion: there is a mesa MR somewhere to use driver names in the loader iirc
07:55 tzimmermann: javierm, they should have looked whether the information is there (edid, orientation, etc) rather than hard-coding driver workarounds
07:56 javierm: tzimmermann: yes, I don't disagree but what I tried to say is that user-space will always workaround the kernel if needed
07:57 javierm: tzimmermann: another example is mutter having a deny list for atomic KMS (i.e: virtgpu due missing cursor hotspots support in atomic)
07:58 emersion: ;_;
07:58 emersion: fwiw, in wlroots we have a policy of no workarounds
07:59 javierm: pq: speaking of which, I see that you are still discussing with vmware folks. But IIRC you just asked for more documentation ?
07:59 tzimmermann: i'm beginning to look at this as a challenge >:‑)
08:00 emersion: lol
08:00 javierm: haha
08:02 sima: marcan, airlied yeah I think the entire driver load sync is a) busted and b) the bucket is just passed around because everyone says it's too hard to solve
08:03 sima: emersion, not really getting the full context from scrollback?
08:04 emersion: sima, discussion about how to solve the renderonly problem, where user-space needs to figure out when a KMS device should be used with a separate render device
08:04 emersion: we discussed at some point to have a kernel API "is this renderonly?"
08:04 emersion: but iirc it was deemed user-space's problem to solve
08:05 emersion: not sure that's enough context
08:05 sima: emersion, don't you have that already? if it's not supporting kms or not listing any outputs at all it's probably a renderonly drm node?
08:05 emersion: i mean, i can detect renderonly nodes just fine
08:05 sima: and vice versa, if you can't instantiate a gl or vk render context on a drmfd, then it's a kmsonly one
08:06 emersion: llvmpipe :-)
08:06 sima: emersion, I guess then I'm not seeing the issue?
08:06 sima: oh
08:06 emersion: the problem is usually, i have a KMS-only node, should i try to use GL or not
08:06 sima: who knows?
08:06 sima: :-/
08:06 emersion: and now there's the additional issue that the render node might show up late
08:06 sima: yeah
08:06 sima: or the kms node might show up late and you're stuck on simpledrm
08:06 sima: or some of these might never show up
08:06 sima: and there's not really a way to tell the difference
08:07 emersion: and there are cases where the KMS-only node cannot be used with a render node
08:07 emersion: vkms, displaylink stuff, etc
08:07 emersion: right
08:07 sima: in general we should fix these by patching the prime support I think
08:08 emersion: well, if PRIME is supported, that doesn't mean i can scan out PRIME-imported buffers
08:08 sima: yeah that's why xorg has lots of copy fallbacks :-/
08:08 sima: I think ideally the compositor can fully cope with hotplug of anything
08:09 emersion: that's… not going to work very well i think
08:09 sima: so maybe you boot up with simpledrm + llvmpipe, and then more or less seamlessly upgrade to kmsonly + renderonly once these show up
08:09 emersion: that's a *lot* of work
08:09 sima: yeah reality probably means it's a compositor reset
08:10 sima: and I have no idea how wayland clients would cope
08:10 sima: probably equally badly
08:10 javierm: sima, emersion: it's even more complicated because now there's a timeout for probe deferral that defaults to 10 secs :/
08:10 emersion: tbh i don't think it can really work in practice
08:10 sima: I guess the cope-out could be a compositor event/popup that tells the user to restart their session
08:10 sima: javierm, where's that timeout? in the kernel?
08:10 emersion: once some formats have been advertised, you can't take it back
08:11 javierm: sima: in the kernel, yes
08:11 sima: javierm, ugh ... sha1?
08:12 javierm: sima: it's a long history, I tried to disable it by default and mention all the commits involved here https://lore.kernel.org/lkml/20221116120236.520017-1-javierm@redhat.com/
08:12 javierm: but was told that disabling it would break other use cases...
08:13 javierm: but it was added by commit 25b4e70dcce9 ("driver core: allow stopping deferred probe after init")
08:14 sima: wtf why are people trying to make optional dependencies work
08:14 sima: they. just. dont.
08:15 sima:sighs
08:16 javierm: sima: the worst thing is that Rob added it as a debugging mechanism and then somehow got "promoted" in commit e2cec7d68537 ("driver core: Set deferred_probe_timeout to a longer default if CONFIG_MODULES is set")
08:16 sima: javierm, ah you're trying to make this a debug hack, that looks reasonable
08:16 javierm: sima: that was the original intention, see commit 25b4e70dcce9
08:16 sima: this feels like i915 and the preliminary hw support
08:16 javierm: but commit e2cec7d68537 changed from "this is a debug option" to "make 30 secs the default"
08:16 sima: every few years you need to rename the knob
08:17 javierm: for me makes no sense to have this. Either is a best effort or not, you can't have both
08:18 sima: yeah, and the default must be to reprobe forever
08:18 javierm: sima: exactly, otherwise you are breaking for instance modules loading
08:18 javierm: anyways, I got tired to argue and gregkh attitude of we know better than you let me drop that series
08:19 javierm: *led me to
08:19 sima: hm gregkh not supporting this is a bit funny, since he's the one that usually insists that the kernel can't tell userspace when it's done probing all the drivers
08:19 sima: (because it fundamentally can't)
08:19 sima: javierm, so you just carry the last patch as a fedora fixup?
08:20 javierm: sima: I don't. I just built-in some drivers to make it work and moved on
08:20 pq: javierm, yes, I was failing to communicate that I want some vague doc about how input ties to output in order to define how hotspot works. And not a vmware code level spec of what their stack does.
08:21 javierm: pq: cool, agreed that it would be useful (as said, it took me some time to understand what cursor hotspots and cursor commandeering was or worked)
08:21 mripard: emersion: I meant the SoC name
08:22 emersion: ok, i don't know about this, but this sounds more reliable
08:22 emersion: but potentially a pain to list all SoCs
08:22 mripard: like I said, only for drivers that support both drivers with and without GPUs
08:24 javierm: mripard: but even in that case you never known whether let's say v3d will eventually show up for vc4 to use it or fallback to llvmpipe / SW rendering
08:24 mripard: sure
08:25 javierm: sima: to wrap up the probe deferral and time out dicussion, IMO the only sensible option would be for user-space to tell the kernel to give up
08:26 sima: javierm, yeah that might be one option
08:26 javierm: because only user-space knows when it doesn't have for example more modules to load
08:26 javierm: and if people want to do it earlier, they can do in the initramfs
08:32 pq: javierm, happy to see someone at least skim my emails, because usually no kernel dev confirms nor disagrees with my comments so I can't know if what I'm saying makes sense. And it's difficult to comment when you doubt if you are not leading someone in a wrong direction.
08:34 javierm: pq: I did read the emails in that thread but didn't have anything useful to say :)
08:34 javierm: I mentioned earlier in that thread that agreed with you about having proper uAPI documentation about cursor hotspots since is not a trivial concept to wrap your head around
08:35 sima: +1 on that, especially since with cursor hotspot defacto it was just a lot of "hacked until it did what we wanted with Xorg"
08:35 pq: the last hotspot thread did run off in a tangent, but I mean also other threads like solid_fill and...
08:35 sima: for some vague notion of "this makes the user feel like the entire thing is more responsive than it really is"
08:36 sima: pq, imo kms uapi needs at least one ack from a compositor person (especially for the documentation part)
08:37 pq: sima, that's cool :-)
08:38 pq: ...VKMS stuff
08:39 sima: https://dri.freedesktop.org/docs/drm/gpu/drm-kms.html#requirements hm maybe we should clarify the docs here that it's about documenting the semantics for compositors?
08:39 javierm: pq: I usually read the threads you are involved and basically learn from your answers :)
08:40 javierm: pq: since you are mostly focused on the uAPI side, it's a useful POV
08:40 pq: heh, thanks, and yeah except for VKMS
08:40 sima: or maybe a "Documentation requirement for userspace api" section is needed here https://dri.freedesktop.org/docs/drm/gpu/drm-uapi.htm
08:41 sima: I think we're more or less ready to make "cross driver interfaces, especially anything for the modeset api, must be documented" line :-)
08:41 sima: emersion, ^^ ?
08:41 sima: since you've typed up a lot of the missing bits in this area recently
08:41 emersion: pq, i agree with all you've said
08:42 pq: emersion, thanks!
08:44 emersion: ah, an "l" was cut off that URL
08:44 emersion: (funny, because ".htm" is a widely used extension)
08:44 pq: sima, btw. "what even is atomic" doc hidden in here: https://lists.freedesktop.org/archives/dri-devel/2023-July/412530.html
08:45 emersion: ty for writing this btw!
08:45 emersion: i should review, but haven't had the time yet
08:45 pq: it also defines "modeset" which people might want to bikeshed about
08:45 pq: :-)
08:46 emersion: so, in terms of new uAPI requirements, there is https://dri.freedesktop.org/docs/drm/gpu/drm-uapi.html#open-source-userspace-requirements
08:46 emersion: and then the link above as well
08:47 sima: pq, note that the no-op out is not entirely true, it does have an impact on locking and sync
08:47 emersion: ah, but that section linked above is for props only
08:47 sima: so if you e.g. including a different crtc, even if you change nothing, you'll sync/block against that
08:47 pq: FYI, I practically never look at the userspace coming with new UAPI, so I might not even notice it is missing.
08:47 emersion: and there are no links between the 2, because we don't know how to make these in Sphinx
08:48 sima: emersion, we've not been requiring docs for uapi formally, so this gap is not an oversight
08:48 emersion: "Each new property introduced in a driver needs to meet a few requirements, in addition to the one mentioned above"
08:48 emersion: above where?
08:48 sima: but I think consensus has moved that we should require docs for at least new uapi
08:48 pq: sima, is there a good reason to sync/block there?
08:48 pq: rather than just check the actual change comes out to nothing, so drop it
08:49 sima: pq, the kernel doesn't support dropping only part of a state after validating it
08:49 pq: you can't drop it before validating?
08:49 sima: I guess we could do some opt and check the current prop value, and if it matches not get that state
08:50 sima: pq, we'd need to not acquire the kernel-side state struct to begin with I think
08:50 sima: everything else is a bit too brittle
08:50 pq: ok, sounds too complicated for any benefit
08:51 sima: emersion, maybe an earlier version of that patch added this section in the uapi file?
08:51 sima: I think a link to the userspace requirements and the test/validation requirements would be good
08:51 sima: pq, I think checking and not grabbing the state might work without causing issues
08:51 sima: hm
08:51 emersion: oh right we also have a test/validation section
08:52 sima: not sure, because "what is the current value of this prop" works by a) grabbing the current state b) converting the value from kernel state representation to property value
08:52 sima: so we can't even really do that
08:52 sima: pq, I guess adding a note that it might lead to oversynchronization across crtc would be good
08:53 sima: emersion, but yeah more links for all this would be good, and then maybe 2nd patch to put down a formal requirement for new uapi to be documented and that doc being acked by userspace folks?
08:53 emersion: yeah, sounds good
08:54 emersion: i need to learn how to do links now :<
08:54 sima: I think we're essentially there now, and the leftover gaps in existing uapi docs isn't too bad to make this an onerous requirement for a small addition
08:54 sima: emersion, I have to google it every time too :-P
08:54 pq: sima, indeed - will you reply on the patch, or should I deliver your greetings?
08:57 sima: pq, I replied
08:58 pq: thanks!
09:44 dviola: bisected it: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9321
09:48 dviola: gerddie: hi, I think it's your commit :)
11:43 emersion: thanks for pushing the patch jani!
12:04 jani: emersion: np!
12:17 alyssa:regrets touching blend enums
12:20 alyssa:regrets touching C
12:21 alyssa: that was a long time catching the bug of "header guard collision".
12:21 alyssa: great language.
12:21 penguin42: alyssa: #pragma once
12:21 alyssa: penguin42: in C?
12:22 penguin42: alyssa: Technically non standard but everyone supports it https://en.wikipedia.org/wiki/Pragma_once
12:22 alyssa: Interesting
12:22 alyssa: I would love to convert Mesa to it..
12:23 alyssa: if even MSVC supports it I see no reason not to use it
12:23 alyssa: jenatali: ^
12:23 jenatali: Sure
12:24 penguin42: Libreoffice is moving to it
12:24 alyssa:thought it was a C++ only thing
12:25 penguin42: hmm, I'll admit to not trying it in C, although I see a few examples of it in qemu's generated headers
12:27 pq: Weston uses it in C in couple of headers. The old style guards are still prevalent.
12:28 pq: gcc and clang are happy with it
12:37 emersion: it was rejected in C23
12:37 penguin42: oh great; for making life too easy?
12:38 emersion: tbh i never got bitten by a duplicate #ifdef guard
12:43 CounterPillow: I've never been in a car crash, airbags clearly aren't needed
12:44 penguin42: emersion: I think I've been bitten by it once in a long time; but I've seen a few close calls - typically where people start out by duplicating a header and modifying it and then forgetting to change the guards
12:45 penguin42: emersion: Or where there are multiple headers of the same name and people don't agree on a scheme
12:46 emersion: CounterPillow: not a good argument for thsi discussion
12:46 emersion: penguin42: yes, agreeing on a scheme is important indeed
12:47 penguin42: emersion: I think it's rare enough not to need someone doing a global replace, but common enough that it's probably a good idea for new headers or if you're already making a close change
12:47 emersion: i think standards are important
12:49 penguin42: fair
12:50 pq: but if #pragma once is not it, then there is no standard?
12:53 emersion: i personally think the standard way (ifdef guard) isn't too much of a hassle to justify diverging from the standard
12:53 emersion: but yeah, some people have no problem writing gcc-specific or gcc-and-friends-specific code
12:54 pq: If you're used to it, sure, but not having to do it and just slap a #pragma once feels sooo goood, and guaranteed to not silently fail causing wtf moments.
12:55 daniels: emersion: tbf, 'and friends' here does seem to include every compiler I've heard of and many I haven't
12:56 emersion: i don't really care, i want someone writing a compiler from just the standard to be able to compile my code
12:56 pq: if the pragma is ignored, the build failures will be very obvious - and frustrating
12:56 emersion: pq, no
12:56 emersion: https://en.cppreference.com/w/cpp/preprocessor/impl
12:57 emersion: > Any pragma that is not recognized is ignored.
12:57 pq: for C? haa haa. for Rust? There is no standrd? What about Go?
12:57 emersion: Go has a standard
12:57 emersion: and it's quite short
12:57 emersion: Rust doesn't have a standard and that's a major flaw
12:57 psykose: language standard debate hour woo
12:58 emersion: yeah, sorry about that
12:58 emersion:goes back to writing C
12:58 psykose:hands a + to emersion, just the one
12:58 emersion: :D
12:58 daniels: psykose: not a #?
12:58 psykose: that's four +'s
12:59 penguin42: emersion: I sympathise, the '#pragma once' seems to be a little unusual in being a bit wider than 'gcc and friends' but as you say still not a standard
12:59 penguin42: the four plusses of the apocalypse
12:59 daniels: psykose: or two ✝
13:00 lumidify: https://old.reddit.com/r/C_Programming/comments/f81zyz/what_is_the_story_of_gcc_v134_playing_games_when/
13:00 lumidify: In case someone is using GCC 1.34 :P
14:01 alyssa: bbrezillon: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24076
14:01 alyssa: ended up reworking a pile of panfrost blend code, cc'ing you for review since you probably understand it better than I do tbh
14:06 bbrezillon: alyssa: I'll try to have a look tomorrow
14:07 alyssa: thx
14:26 Pierce[m]: I thought I'd ask here rather than making an issue on the mesa Gitlab, but where would be the best place to ask about the pvr driver supporting different chips in the same family?
14:28 kisak: (from not-a-mesa dev) Looking for support on newer hardware than what the driver supports or older hardware. There's a high chance there's a massive pile of technical restrictions on hardware going older.
14:30 Pierce[m]: Same family, so not older or newer per se
14:33 Pierce[m]: Afaict the driver only supports the AXE-1-16M and GX6250, meanwhile there are a couple RISC-V devices that use the BXM-4-64 and the BXE-4-32
14:33 kisak: Looking at https://netsplit.de/channels/?chat=mesa , I'm thinking #powervr
14:34 Pierce[m]: Sweet, thank you
14:55 alyssa: kisak: Given the MASSIVE improvements going from RGX to AGX... I shudder to think what the older PowerVR was like...
14:58 daniels: you definitely don't get Vulkan on SGX, but given it's roughly contemporary with r4xx, that's fair enough really
14:59 alyssa: fair
14:59 alyssa: DavidHeidelberg[m]: Any idea why my panfrost manual jobs aren't triggering? https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24076
14:59 alyssa: Usually I just click the containers and then all the hw jobs run, for some reason panfrost doesnt want to do that anymore
15:01 alyssa: so unless panfrost ci got switched to alpine when i wasn't looking..
15:01 DavidHeidelberg[m]: alyssa: u need also trigger `alpine/x86_64_lava_ssh_client`
15:01 DavidHeidelberg[m]: (that's needed for every LAVA based job)
15:01 daniels: but also .gitlab-ci/bin/ci_run_n_monitor.py --target '^panfrost.*'
15:02 alyssa: daniels: I wanted a full run actually
15:02 alyssa: (or at least, a significant one)
15:02 daniels: --target '.*' :P
15:02 alyssa: ...Ah, well
15:02 alyssa: :p
15:03 alyssa: anyway
15:03 alyssa: back to vulkan~
15:21 emersion: sima, gfxstrand: please correct me if i'm saying inaccurate/nonsense again https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/90#note_1996334
17:09 dottedmag: Is DRM_IOCTL_MODE_DIRTYFB still relevant? I see wlroots does not use drmModeDirtyFB.
17:11 sima: dottedmag, only if you do frontbuffer rendering, it does nothing when you're pageflipping
17:11 sima: well, nothing useful :-)
17:12 dottedmag: sima: Thanks
17:12 sima: emersion, makes sense to me
17:14 emersion: ty
17:22 austriancoder: alyssa: if you have time it would be nice if you could have a second look at !24054
18:17 zmike: anholt / DavidHeidelberg[m]: what do you think about having a couple frames from steam in ci trace jobs?
18:20 DavidHeidelberg[m]: zmike: the steam overlay? Make sense. (I guess it'll be small)
18:21 zmike: like the main steam client
18:21 zmike: it's pretty small
18:21 DavidHeidelberg[m]: Yeah. I recall some long (long) time ago I feel like I saw some corruption there, so I guess it eould be nice.
18:22 zmike: unfortunately a lot of issues in steam come from glx
18:22 zmike: which can't be tested through traces
18:23 karolherbst: penguin42: I hit a weird fail with device and host timer today, and the CTS complains about this: deviceStartTime: 3577608128229, deviceEndTime: 3469253489
18:23 karolherbst: and... I have no idea how that can happen...
18:25 karolherbst: took like 200 runs to hit it once
18:33 everfree: could anyone point me at where id start trying to figure out why my graphics hardware can do 1920x1080 output but not 1280x1024? (embedded stuff because of course it is). I have run into this before with a different chip and I vaguely remember finding a table of supported dispaly clocks hardcoded into the drm driver source code or something like that. i also remember not being able to figure out how
18:33 everfree: to properly figure out all the numbers to add a new clock, and im not sure if thats how every drm driver works
18:35 everfree: the hdmi output is added via an out of tree patch so that's extra fun (i.MX cadence)
19:10 airlied: everfree: usually there are pll calculations
19:10 airlied: instead of mode tables
19:50 penguin42: all very pretty
20:27 benjaminl: ooh, shader trap handlers sounds like a huge improvement. what I've been doing currently is binary-searching the shader by cutting it off at different points
20:27 benjaminl: works, but kinda miserable
20:44 gfxstrand: zmike: Mind quick looking at https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23089/diffs?commit_id=16e34a3caab13447f53a77712c2382de138b9717
20:44 gfxstrand: zmike: The gallivm patch in the nir register MR
20:44 gfxstrand: zmike: I think it looks okay but IDK what's going on with thet AOS stuff. Passes CI at least.
20:47 zmike: probably want airlied for a more comprehensive review
20:47 zmike:-> couchmode
20:48 airlied: int nae = nir_intrinsic_num_array_elems(decl);
20:48 airlied: int num_array_elems = nir_intrinsic_num_array_elems(decl);
20:48 airlied: consistent :-P
20:48 airlied: you want airlied in a few hours maybe, this airlied isn't useful
20:49 gfxstrand: I think we might actually ship this mess today
20:54 airlied: okay rb for the gallivm supplied
20:56 karolherbst: I need a soltuion for initializers on global memory I think...
20:59 karolherbst: or global global mem in general I think :D
21:13 gfxstrand: Yeah...
21:13 gfxstrand: TBH, I don't think it should be that hard.
21:13 karolherbst: well
21:13 karolherbst: the details are hard
21:13 karolherbst: like imagine you have 5 variables
21:13 gfxstrand: Biggest problem will be linking
21:14 karolherbst: and one entry point only accesses three of them
21:14 karolherbst: and nir happily DCEing the others
21:14 karolherbst: though
21:14 gfxstrand: Don't DCE them
21:14 karolherbst: we could also just bind a buffer per variable
21:14 karolherbst: okay, but does vtn also ensure they are processed in the same order?
21:14 gfxstrand: No, let's not bind a buffer per variable unless we really need to
21:15 gfxstrand: Same order? It should
21:15 karolherbst: right
21:15 gfxstrand: The bigger question, IMO, is linking. What happens if there's more than on SPIR-V used to create a program?
21:15 karolherbst: it doesn't matter
21:15 karolherbst: it only matters for like fully linked programs
21:16 karolherbst: maybe spirv-link might need some fixing there, but I think it handles it just fine
21:16 karolherbst: there is also no way to actually extract the data besides through a kernel part of the final binary
21:17 karolherbst: "This information is only available after a successful program executable has been built for at least one device in the list of devices associated with program." and other sentences like that
21:17 karolherbst: (though that's for ctors/dtors)
21:17 tleydxdy: is there a way to tell which process hold a reference to a dma-buf? I'm running into a problem unloading amdgpu because there's one dma_buf not releases
21:18 tleydxdy: I did a trace for module_put/get and it's from a dma_buf_export did by Xorg
21:19 tleydxdy: but xorg is dead already so I wonder what's keeping the dma_buf alive
21:23 karolherbst: gfxstrand: I think the biggest open qusestion for me atm is, who is responsible for extracting the initializer? Should we just accept our fate and let vtn do it on any entrypoint and provide the full thing or should we have a helper function just for extracting it?
21:24 robclark: tleydxdy: /sys/kernel/debug/dma_buf/bufinfo has some info, but it looks like not which processes have it imported.. perhaps lsof and/or `ls -l /proc/*/fd/|grep dmabuf`
21:25 robclark: actually just `lsof | grep dmabuf` would work
21:25 karolherbst: maybe we have to split spirv_to_nir into two functions... one for general processing with a parsed result which one then can crate nir_shaders from... or something.. dunno
21:25 karolherbst: might also allow for some reduction of CPU overhead
21:26 tleydxdy: yeah, I tried listing /proc/*/fd but none of the fd is a dmabuf
21:26 karolherbst: I suspect almost everything before "vtn_build_cfg(b, words, word_end);" could be done per spirv, and then everything after that is per entry point
21:26 gfxstrand: karolherbst: We have `nir_gather_explicit_io_initializers()`
21:26 karolherbst: right.. but what if you have a spirv with like 10 entrypointers, do you do it for every nir containting the same data?
21:26 gfxstrand: So if we don't dead-code and we know all the SPIR-Vs in have the same global variable order, that should do the trick.
21:26 karolherbst: or do we have a special case for ctors/dtors?
21:26 karolherbst: mhhh
21:27 karolherbst: actually...
21:27 karolherbst: we could allow spirv_to_nir to create ctor nir shaders and only that would contain the initializer
21:27 karolherbst: need it anyway if we want to support ctors
21:28 karolherbst: Initializer execution mode I mean
21:28 tleydxdy: fwiw the dma-buf have a write fence by drm_sched on gfx queue
21:29 karolherbst: sooo.. from a cl runtime perspective we could either make clc report if we have Initializers (either constant data or an actual Initializer entry point) and then ask spirv_to_nir to build that one for us, or we just try it always and spirv_to_nir might fail to give one to us...
21:30 karolherbst: the only constant data case might look weird then as there are no instructions...
21:30 robclark: tleydxdy, hmm, sounds a bit like amdgpu needs to block unload until scheduled jobs complete or are successfully canceled, because it is deadlocking itself..
21:30 karolherbst: anyway.. that's kinda the part I'm the most concerned about atm
21:30 tleydxdy: the fence is signaled tho
21:31 robclark: sure, that doesn't really matter
21:31 robclark: hmm, or maybe something in the job cleanup path hangs
21:31 tleydxdy: also if I don't see Xorg doing dma_buf_release wouldn't that be a problem in itself?
21:32 karolherbst: gfxstrand: do you think it would be weird to create a nir_shader without any instructions/functions, but only variables + some global init data?
21:33 karolherbst: though I guess the runtime could also just check if the function body actually has any instructions
21:33 karolherbst: and like not run it if there isn't any
21:34 gfxstrand: If we're going to have an init shader, we can make it do the initialization
21:34 gfxstrand: Then it would have stuff
21:34 gfxstrand: Or we can do the initialization with a memcpy from the CPU
21:34 gfxstrand: :shrug:
21:34 karolherbst: yeah well.. the thing is, those init kernels are expected to run single thread...
21:34 karolherbst: *threaded
21:34 karolherbst: but yeah.. we could also just always do it on the GPU side
21:35 karolherbst: and then from a runtime perspective it would look the same
21:35 karolherbst: yeah... maybe just do this, it's sucks a little, because you'll probably end up binding a constant buffer which copies the content...
21:36 robclark: tleydxdy: not sure.. but if Xorg process has exited all it's file handles should be closed.. I trust the kernel process tear-down codepaths a lot more than any driver unload codepath
21:36 karolherbst: I'll play around with it and see where it leads me to
21:36 robclark: process cleanup paths actually get tested
21:38 gfxstrand: karolherbst: A little constant buffer doesn't sound like a bad plan.
21:39 tleydxdy: yeah, therefore I was thinking something must be keeping the dma-buf alive
21:39 tleydxdy: but what
21:39 karolherbst: yeah.. it just fails pointless to copy the exact some content to another buffer on the gpu side :D
21:39 karolherbst: *feels
21:40 karolherbst: gfxstrand: how about.. if the Initializer nir_shader has a constant buffer and no instructions, the runtime just uses the constant buffer to init the global one
21:40 karolherbst: ...
21:40 karolherbst: feels dirty, but...
21:41 karolherbst: maybe I shouldn't worry about it too much
21:43 karolherbst: let's see...
21:45 karolherbst: ahh.. most impls these days report 64k as the max size.. whatever then
21:45 karolherbst: though they used to report 1G-10G
21:46 karolherbst: AMD PAL and APP.. whatever
21:55 karolherbst: I think I'll look into this once I'm done with non uniform work groups :D
22:58 alyssa: robclark: what's the current state of a2xx?
22:59 alyssa: trying to figure out who's going to do the a2xx portion of https://gitlab.freedesktop.org/mesa/mesa/-/issues/9051
22:59 alyssa: !23089 is finally reviewed and in the Marge queue
22:59 alyssa: which means it's time for me to start figuring out who's doing what so we can keep things moving :)
23:00 alyssa: are you maintaining a2xx? would you be up for writing the patch?
23:00 alyssa: if not, do you have some way to test a2xx if I write the patch with my eyes closed?
23:00 alyssa: if not, is now the time to move a2xx to amber?
23:01 alyssa: karolherbst: ^ friendly ping wrt nv50, should be easy enough to do the direct translate approach
23:03 alyssa: samuelig: I assume the usual crew will take care of vc4 and v3d conversion?
23:18 penguin42:would hope from precisely one thing from a NonNull pointer type
23:45 karolherbst: alyssa: ahh right, I'll take a look and see how painful it would be
23:45 karolherbst: or do you mean just using the new stuff for now?