07:47 imirkin: gah, looks like despite encodings existing, nvidia hates 64-bit ATOMS ops
07:47 imirkin: at least on this GP108
07:50 imirkin: at least xchg/cas work
07:51 HdkR: What does hates mean this time?
07:53 imirkin: i think that's the purest expression of hatred :)
07:53 HdkR: huh, wonder if it doesn't exist on some chips
07:54 imirkin: shared memory tends to get the shaft with stuff like this
07:54 imirkin: maxwell is the first one where there's any ATOMS at all
07:54 HdkR: I believe it should work on Maxwell Tegra at least?
07:54 imirkin: for shared mem?
07:54 imirkin: for gmem it works fine
07:55 imirkin: maybe i'm doing the encoding wrong, but nvdisasm seems to like it
07:55 imirkin: i guess i should figure out how to ptx
07:55 HdkR: nvdisasm can be a bit...accepting
07:55 imirkin: yeah
07:55 imirkin: envydis is also happy with it, but that's just a mirror of nvdisasm :)
07:56 HdkR: I've seen cases where it accepts an instruction just because it ignores some bits in the encoding :D
07:56 HdkR: big oops
07:56 imirkin: heh
07:56 imirkin: do you know offhand how i can write a ptx program for this?
07:56 imirkin: i think i have stuff somewhere, but would have to find it
07:57 imirkin: nevermind, found something
07:58 imirkin: HdkR: https://hastebin.com/bakilefina.scss -- does that seem right?
07:58 imirkin: (but adjust the sm_35 -> sm_50 or whatever
07:58 HdkR: I've never written a ptx function like that. Not sure :D
07:59 HdkR: inline asm for ptx works, which is how I tinkered with it that way
08:02 imirkin: this is from ptxgen, which was used for some of the earlier RE
08:02 imirkin: (pre-my-time)
08:05 imirkin: HdkR: https://hastebin.com/behanadobu.less
08:05 imirkin: so ... yeah. just cas + xchg for 64-bit atoms it would seem
08:05 HdkR: huh
08:05 imirkin: this is with a sm_60 target
08:07 HdkR: Oh! I was thinking just CAS. Yes, I don't believe the other ops are there :D
08:07 imirkin: lol
08:07 imirkin: well, XCHG is there. but that's not such a huge lift once you have CAS :)
08:07 HdkR: Transforming the data when it is 64bit is hard
08:08 imirkin: i mean ... they do it for ssbo's
08:08 imirkin: (aka g[] memory)
08:08 imirkin: but not for shared
08:08 HdkR: right
08:08 imirkin: why is shared harder?
08:08 imirkin: the joke is that if i were to use the g[] one and try to access the shared memory window, it would also bail :)
08:09 imirkin: although that's probably not wildly surprising
08:09 imirkin: anyways ... loop it is.
08:09 imirkin: we already do it for the other gens
08:10 HdkR: uhh. That ends up as implementation detail where it is easier for global :P
08:10 imirkin: yeah, i mean i'm sure there's some reason
08:10 imirkin: but you can't just sit there and say "64-bit is hard"
08:11 imirkin: they do plenty of difficult things
08:11 imirkin: when there's a will, there's a way
08:11 HdkR: Yes there is a reason :)
08:11 imirkin: i bet the memcpy() op they added in ampere or whatever wasn't trivial either
08:12 imirkin: but there was reason enough to do it, so they did
08:12 HdkR: Of course
08:12 imirkin: whereas here i'm guessing the use-case was ... shall we say ... lighter
18:55 karolherbst: imirkin: mhhh.. so I have this silly situation, one thread triggers nouveau_fence_trigger_work, but another thread adds a work item to the same fence :/
18:56 karolherbst: which I think should never happen, but... maybe that's "okay" and we should just let the one thread finish the work list and the other one just calls the callbacks?
18:56 karolherbst: any opinions?
18:59 karolherbst: actually.. not sure this is even the same fence ...
18:59 karolherbst: ehh, wait, has to
19:00 RSpliet: I'd be very wary of trying to allow things that shouldn't happen when it comes to parallelis. It usually causes more trouble than it's worth down the line.
19:00 RSpliet: +m
19:00 karolherbst: maybe it's a false positive of tsan actually
19:01 karolherbst: can't get it to assert :/
19:01 karolherbst: mhh, let's see
19:03 imirkin: karolherbst: depending on locking, could def happen
19:54 karolherbst: imirkin: I am actually wondering if this is a "valid" scenario and how to deal with it
20:00 imirkin: the fence is per-screen
20:00 imirkin: work gets added to fences left and right
20:02 karolherbst: mhh, right
20:02 RSpliet: eh? the whole point of a fence is to have a serialising effect no?
20:02 imirkin: RSpliet: i mean the nouveau_fence object
20:03 imirkin: basically it has a list of work items to be run once a fence is "completed"
20:03 imirkin: and the "current" fence is generally not emitted yet, so it's just a placeholder
20:04 RSpliet: Right. Okay, so the question is where is the cut-off point where you can't schedule new work-items for launch *after* the fence. That makes more sense in my mind
20:06 karolherbst: but tsan also thinks that nouveau_fence_work and nouveau_fence_trigger_work can actually race on the work item
20:06 karolherbst: because...
20:06 karolherbst: it doesn't make much sense
20:07 karolherbst: I think..
20:07 karolherbst: at least it complains about a race when freeing it
20:08 karolherbst: tsan is also quite annoying to me anyway
20:10 imirkin: yes, i also prefer the "stick head into sand" approach
20:10 imirkin: that way i don't get worry lines ;)
20:12 imirkin: [fun fact - apparently ostriches do that to grab small stones to help their digestion]
20:12 karolherbst: funny thing is, I try to get the application to assert on that race, but apparently I can't figure out what the condition to that really is
20:17 karolherbst: well.. at least I don't see races on the pushbuffer stuff anymore :)
20:18 emersion: hi, i'm trying to figure out why this happens https://gitlab.freedesktop.org/drm/nouveau/-/issues/36
20:18 emersion: any ideas where to start?
20:19 imirkin: GF114 - that's an important detail
20:19 imirkin: ok, so
20:19 imirkin: you see how it prints a bunch of stuff, like addr: val
20:19 imirkin: or addr: val1 -> val2
20:19 imirkin: what it's saying is that in the "submit", the value either stayed the same or changed
20:19 imirkin: presumably the old values were fine, so something in the new values upset the hardware
20:19 imirkin: now
20:19 imirkin: wtf are all these things anyways
20:20 imirkin: [sec]
20:24 imirkin: urgh. the code moved to using symbolic names instead of hex values
20:24 imirkin: much harder to find stuff now.
20:30 imirkin: ok, so like the IMAGE stuff is https://github.com/skeggsb/nouveau/blob/master/drm/nouveau/dispnv50/base827c.c#L28
20:30 Lyude: fwiw, nowadays I usually rely on clangd to find references to symbols being used (through the youcompleteme plugin on vim, you almost certainly can find clangd-compatible plugins for whatever editor you use). i haven't tested it with macros but i'd assume it probably works a lot better then trying to grep things
20:31 imirkin: Lyude: well, i prefer to read code. makes it harder. wtvr.
20:31 imirkin: the symbolic stuff is nice too
20:32 imirkin: emersion: and the "top" stuff is https://nvidia.github.io/open-gpu-doc/classes/display/cl827c.h i think
20:33 emersion: ah
20:33 imirkin: so like 0xa0 is the notifier offset changing
20:33 emersion: i see
20:33 imirkin: and the two images are SURFACE_SET things on different heads
20:33 emersion: heads?
20:34 imirkin: monitors
20:34 imirkin: outputs
20:34 emersion: ok'
20:34 imirkin: there are only 2 on GF114
20:34 imirkin: also, don't make the foolish assumption that GF114 implements the GF110 display stuff
20:34 imirkin: (also don't make the equally foolish assumption that GF110 implements the GF110 display stuff ... it's just a wildly bad name)
20:35 Lyude: gf119 is the only one that implements it all the way iirc
20:35 imirkin: only GF119 implements the "GF110" display :)
20:35 imirkin: (since GF117 doesn't have display at all)
20:35 emersion: so SET_OFFSET and SET_STORAGE on these
20:36 emersion: hm how do you know it's two different heads/outputs? i would've guessed these were the cursor and primary planes
20:36 imirkin: those aren't images
20:36 imirkin: at least not in the GPU's terminology
20:36 emersion: "Image 0" :P
20:37 imirkin: https://nvidia.github.io/open-gpu-doc/classes/display/cl827d.h -- look at SET_CONTROL_CURSOR
20:37 imirkin: and SET_OFFSET_CURSOR
20:37 emersion: oh, you mean the cursor is not an image
20:37 emersion: okok
20:38 imirkin: and this guy to update the cursor location out of sync with the regular stuff: https://nvidia.github.io/open-gpu-doc/classes/display/cl827a.h
20:38 imirkin: in general all updates are written to a command fifo, which is interpreted one command at a time
20:38 imirkin: (and there's usually a "go" command)
20:38 imirkin: so it's very atomic already :)
20:38 emersion: nice
20:38 imirkin: except designed in 2006
20:39 emersion: this is using the legacy interface btw
20:39 imirkin: doesn't matter
20:39 imirkin: driver's atomic
20:39 emersion: yeah but i'd expect only one output to be updated at a time
20:39 emersion: not two together
20:39 imirkin: well
20:39 imirkin: they likely are backed by the same fb
20:40 imirkin: and that fb got updated? dunno
20:40 HdkR: Lyude: btw, if you're not using nvim yet, it really improves perf with YCM
20:40 emersion: hm, no, i had only one connected connector
20:41 Lyude: HdkR: I am!
20:41 emersion: i'll grab some drm debug logs with the latest drm-tip commit
20:41 Lyude: normal vim with ycm is border-line unusable
20:42 HdkR: yep :|
20:42 imirkin: emersion: maybe that's what's going wrong? dunno. i could also be wrong - could be the overlay image?
20:42 emersion: no, wlroots doesn't use these yet
20:42 imirkin: oh hm, yeah
20:42 imirkin: https://nvidia.github.io/open-gpu-doc/classes/display/cl827d.h
20:42 imirkin: i think it's actually HEAD_SET_PRESENT_CONTROL
20:42 emersion: also, the bug doesn't happen when i disable modifiers
20:42 imirkin: ah no, definitely not
20:42 imirkin: oh
20:43 imirkin: yeah, i don't think scanout works with modifiers.
20:43 imirkin: although
20:43 imirkin: it looks like both are linear surfaces
20:43 emersion: ugh, nouveau does advertise modifiers
20:43 imirkin: maybe it works. dunno
20:43 imirkin: but
20:43 ccr: "modifiers! get your fresh modifiers here!"
20:43 imirkin: here's what i can say
20:44 imirkin: #define NV827C_SURFACE_SET_STORAGE_MEMORY_LAYOUT 20:20
20:44 imirkin: #define NV827C_SURFACE_SET_STORAGE_MEMORY_LAYOUT_BLOCKLINEAR (0x00000000)
20:44 imirkin: #define NV827C_SURFACE_SET_STORAGE_MEMORY_LAYOUT_PITCH (0x00000001)
20:44 imirkin: (pitch = linear, blocklinear = tiled)
20:44 emersion: https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/nouveau/dispnv50/disp.c#L2770
20:44 imirkin: and that bit is set to 1 in both the old and new image
20:44 Lyude: oh, that reminds me while we're on the topic of modifiers
20:44 imirkin: so ...
20:44 imirkin: something sounds off
20:44 Lyude: cursor modifiers don't work and aren't supported in hw, will make sure to send the patch I've got sitting around for that to the ml today
20:44 Lyude: just so no one tries that
20:45 emersion: Lyude: got a link to the patch?
20:45 Lyude: emersion: lemme link you to my igt wip kernel branch, it's got a couple of fixes
20:45 emersion: because nouveau advertises non-linear modifiers for the cursor plane
20:45 Lyude: yeah-my fix is to stop it from doing that :P
20:45 emersion: excellent - i found it weird
20:45 Lyude: https://gitlab.freedesktop.org/lyudess/linux/-/commits/wip/evo-kms-plane-v1.2
20:46 emersion: https://gitlab.freedesktop.org/lyudess/linux/-/commit/ceef7767cae28de07717e554b62d54e966ad4220
20:46 emersion: nice
20:46 Lyude: i got the main stuff off my work plate today so i'll try to send most of this stuff out today
20:48 emersion: thanks for the pointers imirkin
20:48 imirkin: but -- i'm not 100% sure that modifiers work
20:48 imirkin: they might work on some hardware but not other hardware
20:48 imirkin: skeggsb would know for sure
20:49 imirkin: but he's in eastern australia, so probably asleep
20:49 Lyude: they do work
20:49 Lyude: actually - kms_plane_formats is one of the igt tests I have passing with flying colors
20:49 imirkin: Lyude: which hw?
20:50 Lyude: imirkin: should be anything from ~kepler-pascal, note though I am aware of some weird issues with small overlay planes on kepler
20:50 emersion: here's what i see with my card https://drmdb.emersion.fr/devices/1d62521d6f8c
20:50 Lyude: but i don't think that's unique to modifiers
20:50 imirkin: Lyude: emersion is on GF114
20:50 Lyude: oh yeah i have no idea about that then
20:50 imirkin: Lyude: yeah, i think i've seen problems with less than 32x32 or something
20:50 Lyude: especially since I think they still used the legacy linear modifiers
20:50 Lyude: imirkin: yeah that's it
20:51 emersion: okay, so maybe i can try to prune modifiers until it works
20:51 Lyude: (by legacy linear modifiers I'm referring to the 16X16 stuff)
20:51 imirkin: i dunno what that is
20:51 imirkin: is that just regular modifiers?
20:51 imirkin: and there's some fancy new hotness?
20:52 Lyude: imirkin: well i'm not super sure about the 16x16 stuff because none of my hardware supports it, i've just seen it mentioned in fourcc and seen it mentioned in nvidia docs. the "new" modifiers aren't actually that new, and should even work on fermi iirc
20:52 imirkin: oh, it's just a different representation for the same thing, i think
20:53 Lyude: the new ones specify the pagetype, block height, etc. etc.
20:53 imirkin: i.e. as far as the hw is concerned, it's all the same
20:53 Lyude: imirkin: i thought that was it but i wasn't sure because I saw the two mentioned side by side in some display docs
20:53 imirkin: but now it's better represented in the modifier thing
20:54 Lyude: emersion: btw-if you're very bored, no one has re'd the crc stuff for pre-gf119
20:55 Lyude: it'll probably be harder because the state cache on earlier cards like that doesn't match up precisely with the method numbers, but hey if you're up for the challenge :P
20:56 imirkin: yeah, getting them to cough up the docs for it was pretty nice :)
20:56 imirkin: did you ask about the earlier classes?
20:56 Lyude: imirkin: we've been asking about them for ages
20:56 imirkin: yeah figured
20:56 imirkin: "o well"
20:57 Lyude: i have a weird feeling there's some big difference with how everything cl5xx[acde] was designed vs everything after, because it seems weird it would be so difficult for them to get those docs
20:57 Lyude: but maybe they're just lazy, *shrugs*
20:58 imirkin: yeah, i suspect the crc mechanism is totally different
20:58 imirkin: and may involve non-evo
20:58 Lyude: yeah......... i have some other reasons to suspect that as well
21:00 Lyude: if we're lucky and it's not: be suspicious of state cache registers containing ffffff40 or ffffff00
21:00 imirkin: not to mention the ides of march...
21:04 Lyude: probably also worth checking if it's not the same CRC mechanism used on pre-evo GPUs
21:04 imirkin: do we know what *that* is?
21:04 Lyude: (i hope it's not, because then it's more or less useless :\)
21:05 Lyude: imirkin: yes actually
21:05 imirkin: oh
21:05 Lyude: i think it's in some docs we have
21:05 imirkin: fun. didn't know that.
21:05 Lyude: but it's really not useful, it's a lot like matrox (I suspect it might even be copied to or from there) CRCs where you have to select which bits from the RGB channels you want and you more or less can only look at one channel at a time
21:10 imirkin: ah
21:10 Lyude:is quite curious how they ever did hw verification with this...
21:13 imirkin: i dunno about you, but i'd just be super-happy my plug-in board didn't fry the motherboard when i plugged it in
21:14 imirkin: hw is hard :)
21:18 RSpliet: Lyude: RE kms_plane_formats: is flying colours a good thing? *drum roll*
21:19 Lyude: no it's bad
21:19 Lyude: kidding
21:19 Lyude: it's pretty rad tbh
21:19 Lyude: note i did have to fix a few bugs to get it there, which is where al ot of the commits on that branch came from :P
21:20 RSpliet: Story of a sw engineer. There's always a handful of hidden unexpected bugs between where you stand and where you want to go
21:20 RSpliet: But I was visualising shattered CRTs with colours flying all over the place
21:20 Lyude: I will say though, I was pretty pleasantly surprised by how many things were not broken. I've got kms-pipe-color totally passing, and kms-cursor-crc is close (one test is failing because of some pretty bizarre transparency issues)
21:20 RSpliet: :-)
21:20 imirkin: lol
21:20 imirkin: "wow, this is NOT broken?! what a surprise!"
21:21 Lyude: yeah!! lol, you guys did a pretty great job manually verifying all of this stuff over the ages
21:21 RSpliet: that's the treatment I give to most code that 1) I don't know yet, or 2) I've written myself
21:21 imirkin: "what idiot wrote this broken bs?! .... o wait, that was me"
21:21 RSpliet: Think display code is mostly on Ben :-)
21:21 imirkin: nah, the stuff he writes usually works
21:22 imirkin: (at least by the time he pushes it)
21:23 RSpliet: Yep!
21:23 imirkin: if i can fault him for one thing, it's probably perfectionism.
21:26 RSpliet: Ironic :-D But can tell you first hand that perfectionism is a pain.
21:27 RSpliet: Don't think I can count on two hands the times it's led to analysis paralysis, and resulting in no work getting done at all. And I can count in binary...
21:27 imirkin: yep.
21:27 imirkin: there's a pithy saying ... that i'm blanking on
21:27 imirkin: like
21:27 imirkin: perfect is the enemy of good
21:27 imirkin: or something like that
21:27 RSpliet: yeah I heard variations of that
21:28 Lyude: RSpliet: good to know it's not just me lol
21:28 RSpliet: Lyude: it's an entry requirement for the nouveau team :-P
21:28 imirkin: dunno, i'm definitely a "good enough for gov't work" kinda guy
21:28 imirkin: (good thing i don't work in gov't?)
21:29 RSpliet: turns out driver devs get a special kind of evil for code that isn't perfect. Well, at least on the phoronix forums. Although arguably that's not a place to go in the first place, that's more on them than on the devs.
21:29 imirkin: lol yeah, i ignore all that
21:29 Lyude: are people on phoronix reviewing nouveau code
21:29 imirkin: funny to read sometimes
21:29 Lyude: ???
21:29 imirkin: lots of just vitriolic stuff too
21:29 RSpliet: Lyude: there's always one grumpapuss who has to pour some vitriol whenever nouveau gets mentioned
21:30 imirkin: e.g. https://www.phoronix.com/forums/forum/linux-graphics-x-org-drivers/open-source-nvidia-linux-nouveau/1231743-open-source-nvidia-support-for-recent-gpus-is-poor-but-now-you-can-fake-it-for-testing
21:30 imirkin: in response to my adding drm-shim support
21:30 RSpliet: yeah, there's people who lift you up, and people who kick you down. Take-away message, don't be like that person, be in the first group. Better for your blood pressure :-P
21:30 imirkin: (why he thought that was newsworthy in the first place? couldn't tell ya)
21:31 RSpliet: Lyude: unless with code review you mean someone actually doing something useful instead of just bashing
21:31 RSpliet: in which case absolutely not!
21:32 Lyude: imirkin: you know that one time when I was first starting to work on mesa and you were helping me figure things out, I remember writing some extension for making it so that polygons vertices would be interpreted as squares. I mostly remember because phoronix wrote a news article on it that was like "WOW, what could Red Hat be planning with these extensions!? What magic future awaits??"
21:32 Lyude: my dude, i'm just learning mesa, that's it
21:32 imirkin: hehe
21:32 imirkin: yeah
21:32 imirkin: NV_fill_rectangle?
21:32 Lyude: yep
21:32 Lyude: that was the one
21:34 RSpliet: At times it's a bit like PAnon, but heck, it's the best we get when it comes to summarising events in OSS world
21:34 imirkin: i guess the events just aren't that interesting
21:34 imirkin: so he's gotta dig deep :)
21:36 RSpliet: Exactly. He's a nice enough dude, just trying to make ends meet and write things up the best he can for a wider audience
21:38 Lyude: yeah the phoronix guy is nice, can't fault him on that
21:40 karolherbst: yes, just the commentors are trolls
21:40 imirkin: yeah, michael seems like a nice enough guy. the stuff he says about nouveau is generally accurate
21:40 karolherbst: but yeah, Michael is quite okay
21:40 karolherbst: and he accepts if he is wrong and stuff
21:41 karolherbst: not all journalists do this
21:43 imirkin: emersion: just noticed this in your log
21:43 imirkin: [ 503.000786] nouveau 0000:06:00.0: DRM: Moving pinned object 000000006921082c!
21:43 imirkin: [ 503.092113] nouveau 0000:06:00.0: DRM: bo 000000006921082c pinned elsewhere: 0x00000001 vs 0x00000002
21:43 imirkin: that's bad.
21:43 emersion: how bad?
21:43 imirkin: it generally means you're trying to do some sort of sharing
21:43 imirkin: that doesn't work
21:43 imirkin: e.g. a BO is pinned in vram
21:43 imirkin: but you're trying to export it as a dma-buf, which means it has to sit in GART (aka sysmem)
21:44 Lyude: imirkin: check drm-tip
21:44 Lyude: there's a fix for that from me already
21:44 imirkin: Lyude: can that be fixed?
21:44 Lyude: (I can link you to it as well)
21:44 imirkin: it's a logical impossibility
21:44 emersion: imirkin: exporting as a dmabuf doesn't necessarily mean it will be shared
21:44 Lyude: wait-oh, missed the "pinned elsewhere" bit. I never got that, but I did definitely fix an issue with ttm accidentally evicting pinned buffers that was breaking buffer eviction for nouveau
21:44 imirkin: emersion: right, exporting as dma-buf isn't the action
21:45 imirkin: emersion: probably yeah, importing it elsewhere
21:45 emersion: hm
21:45 emersion: it may be related to the cursor plane
21:45 imirkin: anyways, it's not bad in that it won't cause crashes
21:45 imirkin: but it'll just lead to black screens
21:45 imirkin: and/or frozen contents
21:46 emersion: wlroots allocates the cursor plane with USE_SCANOUT via GBM
21:46 Lyude: https://cgit.freedesktop.org/drm-tip/commit/?id=70612d0e121e55ea3c057c526bf7374da41aa2f0 is the fix I'm talking about fwiw
21:46 imirkin: i don't remember if scanout from system memory is possible
21:46 karolherbst: imirkin: has to, no?
21:46 imirkin: karolherbst: why?
21:46 Lyude: iirc I don't think it is
21:46 emersion: and then nouveau has to do some migration when it realizes it's used on the cursor plane
21:46 Lyude: I asked skeggsb about this previously
21:46 karolherbst: well, GPUs with stolen RAM also have to support it
21:46 Lyude: hm.
21:46 karolherbst: but I guess that's different?
21:46 Lyude: you know there is a cap bit about this
21:47 karolherbst: ahhh
21:47 Lyude: that i never bothered looking at
21:47 imirkin: karolherbst: GPUs with stolen RAM have a bit which is treated as "VRAM"
21:47 imirkin: and you can only scan out from there
21:47 emersion: Lyude: PREFER_SHADOW?
21:47 karolherbst: sounds like cheating
21:47 Lyude: but also, I don't know if that's relevant
21:47 Lyude: emersion: no, it's uhhhh
21:47 Lyude: hang on i can find a link to it
21:47 emersion: anyways, wlroots doesn't scanout system memory
21:48 Lyude: https://github.com/NVIDIA/open-gpu-doc/blob/master/classes/display/cl507d.h#L45
21:48 emersion: there are just some migrations going on with cursor plane storage
21:48 imirkin: emersion: i mean a "buffer object" which is located in system memory, vs vram
21:48 emersion: ah
21:48 emersion: https://github.com/swaywm/wlroots/blob/c9760569ae380d99df4fb9c7d1f00d0c70f9e580/backend/drm/drm.c#L976
21:48 imirkin: (modern) GPUs have VMs which abstract this internally
21:49 emersion: GART → VRAM migration
21:49 imirkin: so a particular GPU VA might refer to memory backed by vram or it's a pci-bus away
21:49 imirkin: hm
21:49 imirkin: linear surfaces in vram should work totally fine
21:50 karolherbst: actually for prime it would make sense if the GPU can scanout to whatever memory
21:50 Lyude: yeah - i think if it does support scanout from gart it probably needs to be mapped to the pushbuffer
21:50 karolherbst: maybe
21:50 imirkin: karolherbst: yeah, it would. but it's not allowed. this is why you end up with black screens.
21:50 karolherbst: ehh :/
21:50 karolherbst: I see
21:50 Lyude: also - note those caps aren't indicative of anything if they aren't set to 1. I know there's some caps there that nvidia has confirmed never got implemented in any hardware
21:51 emersion: interesting
21:52 imirkin: (because one part of the stack thinks that the buffer has moved. but it hasn't.)
21:55 imirkin: karolherbst: in unrelated news - you good with https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8461 as-is?
21:55 karolherbst: sure
21:56 karolherbst: ehh..
21:56 karolherbst: wait
21:56 karolherbst: there was one thing
21:56 imirkin: waiting.
21:56 karolherbst: ahh no, I thought PIPE_CAP_GLSL_ZERO_INIT defaulted to something else
21:57 karolherbst: and I think PIPE_CAP_SHADER_ATOMIC_INT64 is good at least for pascal as I am sure I did test int64 atomics in CL
21:57 karolherbst: and made sure all test are pasing
21:57 karolherbst: but not sure if there are patches missing
21:57 karolherbst: imirkin: PIPE_CAP_SHADER_ATOMIC_INT64 is for buffers only, right?
21:57 karolherbst: uhm.. ssbos
21:58 imirkin: karolherbst: i have an impl already
21:58 karolherbst: I know
21:58 imirkin: it's in a different MR
21:58 imirkin: need to make it work for shared
21:58 imirkin: will do that tonight
21:58 karolherbst: ehhh
21:58 karolherbst: I think I have a patch for shared
21:58 imirkin: it's not hard
21:58 imirkin: oh, where?
21:58 karolherbst: wait..
21:58 imirkin: (and why?)
21:59 imirkin: basically i just need to write a simple loop with CAS. pretty easy.
21:59 karolherbst: CL
21:59 imirkin: ah
21:59 imirkin: pointer?
21:59 karolherbst: what do you mean with pointer?
21:59 imirkin: pointer to the change
21:59 karolherbst: searching
22:00 karolherbst: ahh, right,
22:00 karolherbst: imirkin: we also have PIPE_SHADER_CAP_INT64_ATOMICS....
22:00 karolherbst: because...
22:00 karolherbst: why not
22:00 imirkin: heh
22:00 imirkin: the more the merrier
22:01 karolherbst: mhhh, so I wrote a nir pass, but I also wrote a codegen version, which I am sure I have somewhere.. just must be an older branch
22:01 imirkin: ok. well, don't worry too much about it
22:01 imirkin: it's like 5 lines of code
22:01 imirkin: happy to reuse what you did, but equally happy to not :)
22:01 karolherbst: yeah.. well
22:01 karolherbst: it's more than that
22:01 karolherbst: because.. CFG and stuff
22:01 emersion: can someone move this to drm/nouveau btw? https://gitlab.freedesktop.org/xorg/driver/xf86-video-nouveau/-/issues/480
22:01 imirkin: karolherbst: yeah, but i can copy from the existing stuff
22:01 karolherbst: right
22:02 imirkin: emersion: done
22:02 karolherbst: mhh.. probably lost the commit or something
22:02 karolherbst: oh well
22:02 emersion: thx
22:03 karolherbst: but I know I wrote that commit :)
22:03 imirkin: wtvr
22:03 imirkin: not sure i'll get to it today anyways, but hopefully
22:03 imirkin: it's the old new year today
22:04 imirkin: [if you don't know what that means, you're better off that way]
22:04 karolherbst: imirkin: btw, you'll need this: https://github.com/karolherbst/mesa/commit/c7cf024fb23a8f824ab304e35090206303e0e141
22:04 karolherbst: ehh wait
22:04 karolherbst: no, you won't :D
22:04 imirkin: worksforme
22:04 imirkin: CAS and XCHG actually work fine
22:04 imirkin: everything else bails
22:05 imirkin: (coz the instructions aren't there, even tough nvdisasm is fine with it. but ptxas doesn't use them, so ... probably the hardware is right in the end)
22:06 karolherbst: yeah, it all works just fine
22:07 karolherbst: imirkin: but how does ptxas not use them?
22:07 karolherbst: what does it instead?
22:09 imirkin: i mean
22:09 imirkin: ptxas uses cas/xchg
22:09 imirkin: rather than e.g. atom min
22:09 imirkin: even though nvdisasm is happy with ATOM.MIN
22:09 imirkin: er, ATOMS.64.MIN
22:09 imirkin: or whatever
22:10 karolherbst: mhhh, interesting
22:10 karolherbst: sure?
22:10 imirkin: yea
22:10 karolherbst: ohh well, right
22:11 karolherbst: shared memory doesn't support it
22:11 karolherbst: so you have to lower all variants except cas/xchg
22:11 karolherbst: only global has 64 bit aotmics
22:11 karolherbst: *atomics
22:11 imirkin: /*0130*/ ATOMS.OR.U64 R0, [0x10], R2;
22:11 karolherbst: on the hw shared int 64 atomics just fail
22:11 karolherbst: I already tried
22:12 imirkin: yeah, you get illegal instr encodings
22:12 imirkin: i tried too =]
22:12 karolherbst: :)
22:15 imirkin: but nvdisasm is happy with those. oh well.
22:16 imirkin: i already complained about this yesterday :)
22:18 karolherbst: :D
22:18 imirkin: karolherbst: so ... good with the caps update?
22:18 karolherbst: yep
22:18 imirkin: cool thanks