00:00 karolherbst: maybe there is hardware with bigger ones?
00:00 karolherbst: or smaller
00:00 imirkin: (on nvidia hw. other hw can be larger)
00:00 endrift: is that the minimum necessary?
00:00 endrift: because like, I care about Intel and AMD here too
00:00 imirkin: yes. because that's what nvidia supported, they ensured it was sufficient to be complaint.
00:00 karolherbst: imirkin: wasn't there some magic on the ISA?
00:00 karolherbst: where you put in an offset and it just reads from the next UBO if it overflows?
00:00 imirkin: karolherbst: you can indirect to another ubo.
00:00 imirkin: that's how indirect accesses across ubo's work
00:00 karolherbst: sure.. but if you address 112k you have to check the high bit
00:01 endrift: the maximum offset you can address from a base I THINK is 64kiB
00:01 karolherbst: I was thining about c1[$r0] which reads from c2[$r0 - 64k]
00:01 endrift: let me check
00:01 karolherbst: imirkin: can we do something like that?
00:01 karolherbst: normally we would have a load with two sources
00:01 karolherbst: one for each indirection
00:02 endrift: ok there's one shader that needs 75kB contiguous but that's easy to circumvent
00:02 endrift: I can just upload it in two blocks
00:02 karolherbst: yeah...
00:02 karolherbst: that was my idea
00:02 karolherbst: and it would be constant for the entire frame, right?
00:02 karolherbst: so just _one_ upload per frame
00:02 karolherbst: well
00:02 karolherbst: two
00:02 endrift: well
00:02 endrift: no
00:02 endrift: it can change midframe
00:02 karolherbst: ehh
00:02 karolherbst: but I guess it doesn't happen all that often?
00:03 karolherbst: but you have an ubo
00:03 karolherbst: you can do partial updates
00:03 endrift: no, but I do have a pathological test
00:03 karolherbst: ahh
00:03 endrift: hm
00:03 endrift: I might be able to flip between two VRAM textures to avoid stalls
00:03 karolherbst: yeah
00:03 endrift: I'm currently only using one
00:03 karolherbst: you can use even more if you still stall :p
00:04 endrift: yeah but it means more bandwidth
00:04 endrift: that said, it's still a low amount of bandwidth
00:04 endrift: and the reason it was slowing down was stalls, not latency
00:05 karolherbst: why would it mean more bandwidth?
00:05 karolherbst: you don't upload more data
00:05 endrift: I do, because I need to make sure the data gets to both textures eventually
00:05 endrift: I mean I could do a texture copy
00:05 endrift: but that's a little annoying
00:06 karolherbst: heh? why though?, just bind the other texture instead
00:06 endrift: unless I'm uploading the whole texture at once
00:06 karolherbst: or well, if you don't reupload the entire texture every time then yeah.. you would need more
00:06 endrift: ^
00:06 endrift: that's what I'm doing
00:06 endrift: I have it in 24 discrete subtextures
00:06 karolherbst: ahh
00:10 endrift: I can see about doing a ring buffer of textures :P
00:43 imirkin: skeggsb: so it looks like DRM is meant to work with 0..1 (which makes sense), so we have to make use of USE_GAIN_OFS... which is only on 507c, but is on both 827c/827d
00:44 imirkin: i'm thinking only enable the format on G84+?
00:44 imirkin: or add the requirement on G80 that it's all-or-nothing
00:45 imirkin: i.e. all heads must have fp16 or none
00:45 imirkin: yeah, that actually makes more sense.
00:49 skeggsb: i think it's fine that only 507c has it, that's where you'd want to control it from anyway
00:49 skeggsb: not sure the core channel control would have any effect the way we use evo anyway
00:52 imirkin: hm ok
00:52 imirkin: i still don't understand what any of this stuff is ...
00:53 imirkin: like ... how does this even work? base507c_image_set
00:53 imirkin: how does it know which head it's referring to with the width/height thing?
00:53 imirkin: er hm. i guess there's one big image for everyone to scan out from...
00:54 imirkin: (but that's not necessarily the case, is it...)
00:54 skeggsb: each base channel is associated with a particular head, there's a static mapping
00:54 imirkin: ah.
00:55 imirkin: and the difference between "base" and "head" is?
00:55 imirkin: i.e. NV827C_SET_PROCESSING vs NV827D_HEAD_SET_PROCESSING?
00:58 skeggsb: the core channel can also scanout an image (until volta, anyway).. i believe the intention was for the desktop to be defined there, and the base channels get handed to a 3D application to control directly for fullscreen stuff etc
00:58 skeggsb: the base channel image overrides the one on the core channel
00:58 skeggsb: we only use the base channel, and just configure the core channel in such a way that it doesn't annoy the cross-channel error checks
01:06 imirkin: and how does this base/core channel stuff map onto things like head?
01:06 imirkin: i.e. 827d
01:07 skeggsb: "head" is just "crtc".. the core channel controls all of them, the mode, output routing etc. the base channels are basically an overlay, one per head
01:07 imirkin: ok. and does base507c map onto this "base" channel? or core? or?
01:08 skeggsb: base channel
01:08 imirkin: and head507d would be ... also base channel?
01:08 skeggsb: nope, core
01:08 imirkin: so how does it know which head is which?
01:09 imirkin: oh, i see.
01:09 imirkin: cl827d.h:#define NV827D_HEAD_SET_PROCESSING(a) (0x00000910 + (a)*0x00000400)
01:09 skeggsb: what do you mean?
01:09 skeggsb: yes :)
01:09 imirkin: it knows based on the offset
01:09 imirkin: so the same setting can be effected via core and base channels
01:10 imirkin: can't see how *that* might backfire...
01:10 skeggsb: it's not the same setting, if the base channel is active, the core one will be irrelevant
01:10 imirkin: is the base channel ever not active in nouveau's usage?
01:10 skeggsb: it completely overrides the image-related stuff on the core channel
01:11 skeggsb: no, we always use the base channel, it's got more "features" (control over swap interval, semaphores, ability to lock heads together to display simultaneously etc etc etc) than the core channel can manage
01:12 imirkin: right ok
01:12 skeggsb: also, NVDisplay's core channel has zero image-related controls, it's all in "window" (combined features of base/overlay) channels
01:12 imirkin: and remind me again what "asy" is in "asyh", "asyw", etc?
01:13 imirkin: [yeah, i've asked like 50 times already]
01:13 skeggsb: it's the "assembly" state, ie. not yet active on hw
01:13 imirkin: right
01:13 skeggsb: those names come from nvidia register definitions for evo's double-buffered state fwiw
01:13 imirkin: so ... basically like "pending"
01:13 skeggsb: yes
01:13 imirkin: heh
01:25 imirkin: skeggsb: hey, i don't think our overlays support alpha-based transparency, do they?
01:25 imirkin: or am i doing something wrong?
01:26 skeggsb: no, they don't
01:26 imirkin: looks like source/dest color key, or plain opaque...
01:26 skeggsb: i believe they do on NVDisplay, but not prior
01:26 imirkin: ok. should probably remove the alpha formats from the overlay lists...
01:27 imirkin: (NVD == volta, right?)
01:27 skeggsb: yeah
01:28 imirkin: well, i probably won't be seeing any of that until a GT 1630 comes out...
01:28 imirkin: and dell starts shipping it by default in their pc's, and we order such a pc at work :)
01:45 imirkin: alright. let's see if this gain thing works as advertised. bbl.
02:11 imirkin: skeggsb: it works =]
02:11 imirkin: should test on the GK208 too ... hm
02:15 imirkin: of course, it looks like the 907d+ displays (at least the GK208 one) really does want stuff in the range 0..1
02:15 imirkin: and not 0..1024
02:15 imirkin: heh
02:17 imirkin: skeggsb: suggestions? this is my current code -- https://hastebin.com/aresimerug.php
02:17 imirkin: should i ... conditionally set conv_gain_offset? or make it internal to the 50/82 bases?
02:18 imirkin: i'm thinking the latter
02:35 imirkin: skeggsb: this seems to work, and isn't too intrusive: https://hastebin.com/himebusenu.php
02:35 imirkin: obviously only limited testing, but ... meh
02:39 imirkin: if you're happy with it, let me know, and i'll send a proper patch
02:45 HdkR: `ok there's one shader that needs 75kB contiguous but that's easy to circumvent`
02:45 HdkR: Does Nouveau not support the indirect UBO index mode that can index multiple cbufs?
02:45 imirkin: ya
02:45 imirkin: not user-accessible though, unless they really have a ubo array and are doing indirect access in it
02:46 HdkR: I guess it would actually be hard to do in GL since there is no way to do indirect selection of a UBO?
02:47 imirkin: sure there is
02:47 imirkin: and that's when you can do it
02:47 imirkin: but if you're just doing an indirect ubo element access, we don't flip that mode on
02:47 HdkR: ah
02:47 imirkin: so you have to be doing an indirect on the buffers themselves
02:47 imirkin: LDC.IS iirc
02:47 HdkR: Are you able to have an array of UBO bindings?
02:48 imirkin: sure
02:48 HdkR: I guess that's how to do it then :P
02:48 imirkin: GL 4.0 functionality, iirc (ARB_gpu_shader5)
02:48 HdkR: ah that's why, I get fuzzy past GL 3.x
02:48 imirkin: not 100% sure that ever came out in ES though... maybe OES_gpu_shader5 allows it?
02:49 HdkR: Although if you're dynamically indexing, you don't get to inline any of the UBO acceses in the instructions. Have to use LDC.* for all
02:49 imirkin: can't win 'em all
02:50 HdkR: :)
02:50 HdkR: Time for Turing to add a inline indirect UBO access for every instruction
02:54 skeggsb: imirkin: what classes did you manage to test? i'll check nv50,and gv100+ in a short while, assuming you don't have those
02:54 imirkin: i tested with a G84 and GK208
02:54 imirkin: let me push a modetest branch
02:54 skeggsb: ok, i'll confirm 507c then, because nv50 is annoying like that sometimes.. and i swear i tested this on gv100 already and it didn't work, but i'll try again just in case
02:55 imirkin: skeggsb: https://github.com/imirkin/drm.git 30bpp
02:55 imirkin: build modetest -- that's what i was testing with. then run -s ...@XB4H or whatever
02:56 skeggsb: ack, thanks
02:56 skeggsb: i'll let you know how it goes a bit later on
02:57 imirkin: skeggsb: well, if gv100 doesn't have the cap, then maybe more checking should be done (caps bits, whatever)
02:57 imirkin: gv100 might be special though
02:57 skeggsb: yeah indeed, it's also possible i messed up :P
02:57 imirkin: i did have to fix up the depth, otherwise i just got EINVAL's
02:58 imirkin: let me mail you a proper patch, so it's easier to apply
02:58 imirkin: i think hastebin messes up tabs (or rather i mess them up when pasting in there)
05:29 imirkin: skeggsb: i'm out for a while, but let me know if you hit any snags in your testing that you want me to address.
05:29 imirkin: i'll be checking scrollback
05:30 imirkin: [and email, obviously]
05:31 skeggsb: imirkin: ack, i'm not far off taking a look at it
11:16 coderobe: tried karolherbst's secboot_fixes on GP104 and at least it doesn't crash anymore, woo! https://shr.codero.be/ConfusedSilverGoldfish4.txt
11:16 karolherbst: mhh
11:17 karolherbst: still secboot failing
11:17 karolherbst: oh well, at least the runpm issue is resolved, which was the worse issue anyway
11:19 coderobe: yeah
12:59 PaulePanter: Lyude, karolherbst: Regarding the hang problem from some days ago.
12:59 PaulePanter: https://paste.fedoraproject.org/paste/t2H4f~UJx21wPzaeSQk2hQ
12:59 PaulePanter: I changed the cable, but the problem remains.
13:00 PaulePanter: The DP monitor is turned off, so it should be fine that no EDID is sent.
13:00 karolherbst: mhh
13:00 karolherbst: weird
13:00 karolherbst: I assume the display firmware is actually broken
13:01 karolherbst: if it is turned of, why would it want to communicate with the GPU?
13:01 PaulePanter: That’s possible.
13:01 karolherbst: what happens if you turn the display on?
13:02 karolherbst: and what happens if you boot without the display connected and then connect it while it's off?
13:03 PaulePanter: If the display is on, no errors are reported. Same with disconnected display.
13:04 PaulePanter: The problematic thing is, with the turned off monitor, running xfce4-display-settings for example, the system “freezes”.
13:04 PaulePanter: Usage increase over time, and in the end it reboots. That time differs.
13:05 PaulePanter: Unfortunately, I do not see the process responsible for the usage in top or ps output.
13:05 PaulePanter: `sudo perf top` is also not very helpful.
13:07 PaulePanter: Looks like the state of the turned of display switches between connected and disconnected really fast(?)?
13:07 PaulePanter: xrandr can trigger it too.
13:08 PaulePanter: There were no problems with the proprietary Nvidia driver 390.x. We switched to Nouveau some weeks ago.
13:08 PaulePanter: brb
13:17 karolherbst: Lyude: ^^ enough information?
13:18 karolherbst: airlied: ^^ any ideas on what to do here?
13:18 karolherbst: sounds like something other drivers might have been running into already
18:25 endrift: Had a dream last night about optimizing VRAM uploads. Oops
18:37 karolherbst: :D
18:39 karolherbst: endrift: btw, did you try the VRAM as UBO thing? would be interesting to see how much benefit that would give you
18:39 karolherbst: or maybe using ssbo instead of texture
19:16 endrift: karolherbst: not yet. And I don't want to use SSBOs because of the minimum version requirement
19:26 karolherbst: yeah..
19:26 karolherbst: SSBOs are VRAM anyway
19:28 endrift: According to the Khronos wiki UBOs are minimum 16kiB, not 64
19:32 endrift: And does that mean I can't use any other uniforms if I make a UBO that big?
19:44 endrift: I may try doing 4x16kiB UBOs just to be safe
20:37 karolherbst: endrift: you are required to have at least 8 UBOs
20:37 karolherbst: + uniforms
20:38 karolherbst: endrift: also, you can query the driver to know the size of an UBO
20:38 endrift: Yeah I know but I don't want to bother with adjusting the shader at compile time
20:38 karolherbst: for graphic shaders you have at least 14 ubos on nvidia
20:38 karolherbst: ahh
20:39 endrift: I may have to. I don't have any computers of the right vintage to test on though
21:11 endrift: I think I'm gonna try to do palettes as a UBO first, since VRAM updates, while they are annoying, are less impactful in the scenes where they are bad
21:12 karolherbst: endrift: the point was that reading from an UBO is much faster than reading from a texture/VRAM
21:12 karolherbst: and if you don't have as many updates and many reads still, there can be a significant perf improvement
21:13 endrift: well sure but this'll give me an easier test first, plus improve the performance in a bunch of games
21:13 endrift: and if I can get that working I'll do VRAM next
21:13 karolherbst: ohh, there is no benefit in UBOs over a uniform array
21:13 karolherbst: so if you have the uniform stuff working you can just keep that
21:14 endrift: No I mean, palettes are currently a 256 element array, as opposed to a 160x256 element array which lets me not have to worry about palette updates mid-frame
21:14 karolherbst: ahhh
21:14 karolherbst: I see
21:14 karolherbst: so the palette is fixed for each entire frame?
21:14 endrift: midframe palette updates are a common technique
21:15 endrift: no, I'm currently dividing frames up every time the palette is updated
21:15 karolherbst: or would you be able to retrieve the entire palette for the entire frame before drawing?
21:15 karolherbst: ahh, I see
21:15 endrift: this would let me remove that dividing
21:15 karolherbst: yeah, just tried to refresh my memory on that
21:15 karolherbst: sounds like a good idea
21:15 endrift: I need to figure out how to use UBOs first though
21:16 karolherbst: :)
21:16 endrift: doesn't look too hard
21:16 endrift: and before that I need to get my cat off of my chair so I can sit down :P
21:16 karolherbst: but yeah, that sounds like something which could speed up things a lot
21:16 endrift: yep I have a pathological test case for it
21:17 endrift: I have lots of pathological test cases :D
21:17 karolherbst: might make sense to have two rendered paths. one for pre 3.0 hardware and one for modern
21:17 karolherbst: maybe even three
21:17 karolherbst: pre 3.0, 3.3 and 4.6
21:17 endrift: is there a utility that can tell me the values of the various system glGets without me having to write it?
21:17 endrift: I thought glxinfo did it but I can't find it
21:18 endrift: I'm not supporting pre-3.0 for this
21:18 endrift: I'm probably gonna bump the requirement from 3.0 to 3.2 Core
21:18 endrift: maybe 3.3 Core
21:18 endrift: The software renderer works fine if you have pre-3
21:18 endrift: it just can't do fancy upscaling
21:21 karolherbst: yeah.. on older hardware it might even make much sense to use the GPU for that
21:21 karolherbst: endrift: do you know how much faster GPU rendering is compared to the software one?
21:22 endrift: not very
21:22 endrift: if at all
21:22 karolherbst: yeah...
21:22 endrift: I'm doing this for the fancy upscaling
21:22 karolherbst: ahh, I see
21:22 wrl: endrift: 3.2 is a good target
21:23 wrl: core, forward
21:23 karolherbst: endrift: I was more refering to the frame splitting stuff as this is kind of a big difference for the rendering
21:23 endrift: I thought Core was the replacement for forward
21:23 karolherbst: but if you require 3.2 core you have UBOs anyway
21:24 wrl: it might be
21:24 wrl: i dunno
21:24 endrift: oh, yeah, if I don't frame split it is faster
21:24 wrl: i ask for core
21:24 karolherbst: forward is something somebody requested without knowing why
21:24 endrift: wrl: are you the wrl I think you are
21:24 wrl: endrift: are there any other wrls i should know about
21:24 endrift: depends on if you make music software
21:25 karolherbst: apple is the only reason forward profiles exists
21:25 karolherbst: I mean it
21:25 wrl: endrift: it me
21:25 wrl: i'm shipping 3.2 core and nobody's complained
21:25 karolherbst: yeah, 3.2 core is good enough
21:25 karolherbst: you could just require 3.3 though
21:26 wrl: on mac 3.2 is all you can request
21:26 endrift: Nothing I found supports 3.2 but not 3.3
21:26 karolherbst: all hardware which can do 3.2 can also do 3.3
21:26 wrl: there's just one define for it, rip
21:26 karolherbst: well.. apple
21:26 endrift: yeah I noticed that
21:26 wrl: y e p
21:26 endrift: you can request 3.2 or 4.1
21:26 endrift: but nothing in between
21:26 karolherbst: not that 3.3 is all that useull
21:26 wrl: well... you can request 3.2, and if the OS is new enough you'll get 4.1
21:26 karolherbst: it has GL_ARB_timer_query though
21:26 wrl: it's the same constant
21:26 endrift: my cat is making it hard to type
21:27 karolherbst: ohh, GL_ARB_instanced_arrays
21:27 karolherbst: okay, 3.3 is useful :D
21:27 karolherbst: instanced drawing is the best anyway
21:27 wrl: oh i guess there *is* a NSOpenGLProfileVersion4_1Core
21:27 endrift: yes that's what I was talking about
21:27 endrift: ack claws
21:28 wrl: i could have sworn i looked for that the other day and it wasn't there
21:28 wrl: ah, well, whatever. apple.
21:28 karolherbst: endrift: with instanced drawing you can select texture in the vertex stage for the fragment stage
21:28 karolherbst: essentially
21:28 karolherbst: and other weird shit
21:28 endrift: !
21:28 karolherbst: can eliminate tons of draw calls
21:28 endrift: that's actually huge
21:28 karolherbst: yes
21:29 endrift: means I can move a bunch of stuff from fragment stage to vertex stage
21:29 karolherbst: endrift: https://www.khronos.org/opengl/wiki/Vertex_Rendering#Instancing
21:29 endrift: my fragment shaders are on the heavy side
21:29 endrift: though afaik they don't spill registers (thankfully)
21:29 wrl: endrift: anyway i'm shipping 3.2 in cadmium and while i was expecting people to complain that their hw doesn't support it, nobody has
21:29 wrl: there's been like... 1 person with a lappy from 2007 or sth
21:29 wrl: intel integrated
21:30 endrift: mmm GMAs
21:30 wrl: literally the only report i've had and that was 4 years back
21:30 wrl: you are well into the clear with 3.2 core
21:30 karolherbst: endrift: mhh, maybe you need bindless_textures to make really use of all that though
21:31 endrift: oddly I have someone complaining that they don't have working graphics on an old ATI Radeon that should support 3.3
21:31 karolherbst: :D
21:31 endrift: even though I'm only requesting 3.0
21:31 endrift: but I don't have enough diagnostic info to debug
21:31 wrl: endrift: windows?
21:31 endrift: yep
21:31 karolherbst: yeah.. they don't do fp64
21:31 wrl: you're requesting 3.0 core?
21:31 endrift: there's no such thing as 3.0 core
21:31 wrl: we;lp
21:31 endrift: I'm requesting 3.0 fc
21:32 wrl: got it
21:32 endrift: profiles were introduced in 3.2
21:32 wrl: yeah i ran into some amd/ati issues on windows which were because i wasn't specifically asking for 3.2, i was just checking to make sure the context supported everything i needed
21:32 endrift: yep that's what I'm doing
21:33 endrift: do you expect it'll work if I request 3.2 core?
21:33 karolherbst: endrift: ohh, wait. I mistook instanced drawing with bindless textures way of selecting textures
21:33 wrl: usually it worked fine but amd gpus ended up in a "standards-whatever" mode. 3.0 shored up some Dumb Shit that GPUs could do and just requesting a 3.2 core profile context fixed my amd issues
21:33 karolherbst: endrift: instanced drawing allows you to draw the same object multiple times at different locations
21:34 endrift: ahaha if I request 3.2 core I get a context that doesn't work
21:34 karolherbst: with one draw, instead of N
21:34 endrift: but if I request 3.3 core it works
21:34 wrl: it was something dumb like... unbound textures should effectively just be vec4(0.0) under >=3.0 but before that on amd the shader would crash intermittently
21:34 wrl: which is Good
21:35 karolherbst: instanced drawing is essentially geometry shader in non crappy
21:35 wrl: (i wasn't even sampling from the texture either, it was behind a conditional in the fragment shader. if the call was even there then the shader would crash)
21:36 wrl: anyway, i only brought it up because "amd on windows" has been my only outlier
21:36 karolherbst: but you can still output a texture id if you have multiple texture bound and do an indirect texture access in the fragment shader and select a different shader for each drawn object though
21:36 karolherbst: bindless_texture just makes that less messy
22:40 endrift: urgh I can't figure out this compiler error
22:40 endrift: I wish mesa compiler errors were better :/
22:41 imirkin: what's the error?
22:41 endrift: ...the error was that I was spelling uniform wrong
22:41 imirkin: then you get a unknown token error or something
22:41 endrift: "error: syntax error, unexpected NEW_IDENTIFIER, expecting $end"
22:41 imirkin: yeah
22:42 imirkin: does it at least give you a line number?
22:42 endrift: it was very difficult to turn that into "you spelled uniform wrong" without syntax highlighting
22:42 endrift: yes
22:42 endrift: but I'm a bit dyslexic
22:42 imirkin: should narrow it down
22:42 imirkin: anyways, patches welcome :)
22:42 imirkin: turns out it's _really_ hard to make good errors
22:42 endrift: oh I know
22:43 endrift: hire me to work on Mesa and I'll write patched ;)
22:43 imirkin: esp without a custom lexer/etc
22:43 endrift: *patches
23:52 imirkin: skeggsb: btw, what do you think about the adjusted_mode vs mode thing?
23:52 imirkin: or haven't gotten to that yet?
23:53 skeggsb: i'll have a look shortly, i can't remember where that function fits into things exactly
23:53 imirkin: and i never knew :)