00:00 karolherbst: but it's a bit more tricky as you can run into alignment issues
00:00 fincs: Can't see past OP_MERGE
00:00 karolherbst: yes
00:00 karolherbst: but that's also due to the order of the opts
00:00 karolherbst: eg with nir you don't get the OP_MERGE, because we can load the 64 bit value directly
00:00 karolherbst: so.. with nir we can skip a lot of those OP_MERGE and OP_SPLIT ops
00:01 fincs: Is there any way to do a piecewise 64-bit load directly without OP_MERGE then?
00:01 karolherbst: not how the TGSI stuff works right now
00:01 fincs: This is already past the tgsi translation code
00:01 karolherbst: but we also need to be careful with alignment
00:01 karolherbst: it's not that simple
00:01 fincs: I'm talking, NVC0LoweringPass::loadResInfo64
00:02 karolherbst: fincs: okay.. but then LoadPropagation should be able to opt this
00:03 karolherbst: but..
00:03 drathir: imirkin: thanks added to check list as well...
00:03 karolherbst: I don't know if we allow that for 64 bit ops
00:04 karolherbst: fincs: you need to debug TargetNVC0::insnCanLoad to see why that doesn't happen
00:05 karolherbst: fincs: but if you talk about loadresInfo64 you talk about an int add, aren't you?
00:05 fincs: Yeah
00:05 fincs: It's doing u64 + u32 add
00:05 karolherbst: can the hw do a 64 bit int add with a cb load at all?
00:05 fincs: It's just IADD / IADD.X
00:06 karolherbst: sure
00:06 karolherbst: mhhh
00:06 fincs: Basically I observe this
00:06 fincs: MOV R0, c[0x0][0x140] ; MOV R1, c[0x0][0x144] ; IADD R2.CC, R0, R2 ; IADD.X R3, R1, RZ ;
00:06 fincs: Those movs are superfluous, as IADD/IADD.X could just use c[] instead :\
00:06 karolherbst: I guess so
00:07 karolherbst: fincs: can you check if those are there right before loadpropagation?
00:07 karolherbst: I am sure they aren't
00:07 fincs: Hmm, how do I do that
00:07 karolherbst: we do the 64 bit lowering quite late
00:07 karolherbst: call prog->print() between the passes
00:08 karolherbst: uhm
00:08 karolherbst: just print)=
00:08 karolherbst: *print()
00:09 fincs: Hmmmmmm
00:09 fincs: It's not printing anything
00:10 fincs: Maybe I broke something
00:10 fincs: Ah, of course
00:10 fincs: NDEBUG lol
00:14 fincs: Okay so this compute shader: https://github.com/switchbrew/switch-examples/blob/master/graphics/deko3d/deko_examples/source/sinewave.glsl
00:15 fincs: This is what print() prints prior to LoadPropagation: https://gist.github.com/fincs/fde1f26b22588d11f122277ebd3cdce0
00:15 karolherbst: yeah...
00:15 karolherbst: so those are still 64 bit adds
00:19 fincs: Hmm
00:19 fincs: I think I'm barking up the wrong tree
00:19 fincs: LDC.64 should be optimized to MOV if the offset is constant
00:20 fincs: I undid the change in loadResInfo64 and apparently it *is* able to see past the 64-bit load and use c[] in IADD/IADD.X (!)
00:20 karolherbst: ehh
00:21 fincs: It seems to like this better
00:21 fincs: 46: ld u64 %r107d c17[0x140] (0)
00:21 fincs: 47: add u64 %r108d %r107d %r90 (0)
00:21 fincs: --> IADD R0.CC, R6, c[0x0][0x140] ; IADD.X R1, RZ, c[0x0][0x144] ;
00:21 imirkin: fincs: there's a thing which says whether a particular op can load a value or not
00:22 imirkin: i think we don't allow 64-bit consts anywhere
00:22 imirkin: HOWEVER
00:22 imirkin: an integer 64-bit add gets broken up into 2x 32-bit things
00:22 imirkin: in split64BitOp or something like that in build_util.cpp
00:22 imirkin: which obviously can load the const
00:22 imirkin: so ... perhaps just a bit of adjustment necessary to make it happen
00:22 karolherbst: ohh, right
00:23 fincs: Hmmmmmm
00:23 karolherbst: we handle the load propagation there directly as well
00:23 karolherbst: ehhh
00:23 karolherbst: refcount
00:23 karolherbst: :/
00:23 fincs: I see why I was observing LDC.64
00:23 fincs: In a different shader I'm loading something from offset 0 within the ssbo
00:23 karolherbst: fincs: you loaded the 64 bit value instead 2 32 bit ones? :p
00:23 fincs: So it's doing LDC.64 R0, c[0x0][0x98] ; LDG.E R0, [R0] ;
00:23 fincs: There's no add
00:23 fincs: Which means it can't optimize into c[]
00:26 fincs: The previous situation where it was doing the optimized load was a non-constant offset
00:26 fincs: And it had to do IADD/IADD.X
00:26 fincs: With a constant offset codegen prefers LD/ST with [reg+offset] instead
00:26 fincs: Where reg is the 64-bit reg pair, that is
00:26 imirkin: coz of the thing i mention
00:27 fincs: I guess we need to add a pass to convert any remaining >32-bit non-indirect loads from cbuf into movs
00:29 imirkin: or do the thing i said
00:29 fincs: Not sure what's the best solution
00:30 karolherbst: what imirkin said :p
00:31 karolherbst: it's already there
00:31 fincs: So changing loadResInfo64 and fixing the opt somewhere else is the better solution?
00:31 karolherbst: no?
00:31 karolherbst: why changing loadResInfo64?
00:31 fincs: To turn the 64-bit load into 32-bit loads
00:32 karolherbst: but then you might end up hurting other use cases
00:32 imirkin: just tell nouveau it's ok to have 64-bit constbufs in the u64 add/mul ops
00:32 imirkin: and everything will work itself out.
00:32 karolherbst: yeah, and handle that in the lowering if needed
00:33 karolherbst: ohh
00:33 karolherbst: it is already handled
00:33 karolherbst: so yeah...
00:33 fincs: nouveau is already optimizing 64-bit load from constbuf + add into IADD/IADD.X with c[]
00:33 imirkin: so what's the issue?
00:33 fincs: The problem is the case in which it doesn't need to do an add
00:33 imirkin: ?
00:33 imirkin: what's wrong with LDC.64 R0, c[0x0][0x98] ; LDG.E R0, [R0] ?
00:33 fincs: Because it loads the 64-bit value from the cbuf and uses it directly as the address of a LD/ST
00:34 fincs: LDC.64 is slower than MOV + MOV because former is variable latency
00:34 karolherbst: can you load with an address in a cb?
00:34 imirkin: oh
00:34 imirkin: if you don't want that stuff to get joined
00:34 imirkin: you can tell it not to
00:34 karolherbst: mhhhhh
00:34 fincs: There is already code which splits up non-indirect loads from cbuf into MOVs, but IIRC it runs before ssbo pointer loads are lowered
00:35 karolherbst: heh...
00:35 HdkR: fincs: amortized cost the LDC.64 will beat the dual moves in most cases :P
00:35 karolherbst: why did nvidia add an pointless ldc then..
00:35 fincs: LDC.64+ is totally fine with indirect
00:35 karolherbst: or not
00:36 karolherbst: only for uniform values :)
00:36 fincs: LDC itself (which is needed for indirect) is also variable latency
00:36 fincs: HdkR: I've observed nvidia's compiler preferring mov/mov
00:36 karolherbst: fincs: which doesn't proof it's slower
00:36 karolherbst: but yeah
00:36 HdkR: It does yes but for a different reason
00:36 karolherbst: I think nvidia prefers movs
00:36 fincs: Actually nvidia's compiler almost never wants to use the non-32bit loads/stores
00:37 fincs: Even for stuff like AST/ALD which is var-latency anyway
00:37 HdkR: "Different Reason"
00:37 fincs: I guess register allocation related?
00:37 karolherbst: fincs: the big problem we have in codegen is the order of opts
00:37 fincs: The wide loads/stores force you to have consecutive registers
00:38 karolherbst: so because we only goes once through that... sometimes ordering messes things up
00:38 HdkR: Hardware behaviour related, not RA related
00:38 karolherbst: either... clean it up with a new pass or don't care :)
00:38 fincs: So what nouveau does right now is fine?
00:38 fincs: If so, then I elect for "don't care"
00:38 karolherbst: well.. you can always add more opt to clean that up
00:38 karolherbst: thing is.. it doesn't matter all that much
00:39 karolherbst: as long as it's not too often
00:39 karolherbst: and with ssbos you are hurt by the global mem access already
00:39 karolherbst: so that cb stuff really doesn't matter
00:39 fincs: Okay
00:39 karolherbst: you can always write a microbenchmark and dump the perf counters though
00:39 karolherbst: and then you have the numbers :)
00:40 fincs: Okay
00:40 karolherbst: maybe it's a bigger impact than we think it is
00:40 fincs: Another thing
00:40 fincs: I simplified the dual issue logic to just "lol first insn needs to be ALU, second one needs to be non-ALU"
00:40 karolherbst: probably that's good enough I guess
00:41 fincs: Yeah
00:41 karolherbst: I am in the process of reverse engineering the perf counters though
00:41 karolherbst: then I can dig into that for real
00:42 fincs: So basically it's just this atm: https://0bin.net/paste/fF2cQuUxLrNK8t4K#qqXOKmC+cpciqgXFji64xhlGfMcumtt0eWKISPLmYcx
00:42 karolherbst: yeah.. looks way simplier
00:42 karolherbst: I am just not sure if you can really dual issue with every non alu
00:42 karolherbst: but maybe we can...
00:42 karolherbst: dunno
00:47 karolherbst: I want to be able to upload any shader... :D
00:48 karolherbst: would make reverse engineering this stuff way easier
00:48 fincs: I kind of can with my setup
00:48 fincs: (However you still need to wrap the raw shader code with the proper metadata/header/etc I define in my DKSH format)
00:49 karolherbst: well, if you can verify every combination real quick then :p
00:49 karolherbst: and verify it with the dual issue perf counter
00:49 karolherbst: that would be great
00:49 fincs: Someone is using raw sass to do hwtests: https://github.com/ReinUsesLisp/nxgputests
00:50 karolherbst: that doesn't scale as well though
00:50 fincs: (however they haven't implemented any scheduling stuff yet in their shader assembler)
00:50 karolherbst: really want something testing every combination of stuff
00:50 fincs: Need dynamic codegen for that :)
00:51 karolherbst: or a crappy cl_mesa_shader_re extension :p :D dunno
00:51 HdkR: Maxwell JIT time
00:51 fincs: Would be cool to do Maxwell codegen tinkering tbh
00:51 fincs: However I lack the time/skills needed to actually work on something like that
11:31 karolherbst: interesting.. most of those static constants actually make sense
11:31 karolherbst: llike 0.299000, 0.587000, 0.114000 which is apparently some RGB stuff
11:31 karolherbst: used for luma calculation
12:31 cyberpear: karolherbst: thrilled to see your gp108 workaround fix merged after 2+ years! https://github.com/torvalds/linux/commit/028a12f5aa829b4ba6ac011530b815eda4960e89
12:31 karolherbst: yeah.. we still would like to know what's going on :D
13:17 AndrewR: hi all. I compiled Blender 2.79b, and while it mostly works (after patching for python 3.7) - preferences (but also file open window) doesn't look right: https://ibin.co/5JmG6ab5I50O.png Anyone saw something like this?
13:34 linkmauve: AndrewR, I think Blender is at 2.82 nowadays, maybe you should upgrade first?
13:36 AndrewR: linkmauve, another recompile :}
13:39 linkmauve: Why did you go for such an old version first?
13:41 linkmauve: I have no idea if this is related to your issue in any way, but then at least you will know that it wasn’t a known fixed bug.
13:45 Doeme: I usually also use a 2.79 build, since 2.82 is the most robust way of crashing nouveau since webgl got more widespread
13:47 Doeme: which is incidentally why I joined here. But alas, I did not get around to debug it yet. Still on the lower side of my to-do list :/
13:59 AndrewR: linkmauve, because my friend used it ....
14:00 imirkin: Doeme: generically, webgl should work
14:00 imirkin: Doeme: issues arise when multiple threads do GL concurrently
15:44 karolherbst: :) https://github.com/karolherbst/mesa/commit/562c640d72746e5077e48ecc7e17b38df11a9bd0
15:50 karolherbst: ohhhh crap
15:50 karolherbst: heh.. wait
15:50 karolherbst: doesn't matter
15:51 Doeme: imirkin: webgl got really stable lately (with lately I mean: the last 3-4 years or so :). the concurrency issues sounds like something blender would run into, though.
15:51 karolherbst: mhhh
15:52 karolherbst: imirkin: any good idea how to prevent stuff like this? https://gist.githubusercontent.com/karolherbst/375c90f8c4721a2c8f8bd4cf1efedbab/raw/ea22b5aa11eb2d9167083ad0235212bdfe548692/gistfile1.txt
15:52 karolherbst: check if usecount or something better?
15:52 karolherbst: mhhh
15:53 karolherbst: I guess I could check the use count of all potential propagation and choose the one with the lower count
15:53 imirkin: karolherbst: yeah, that's a bitch...
15:53 imirkin: i ran into issues like that
15:53 imirkin: with address stuff iirc
15:53 imirkin: where the "wrong" thing gets inlined
15:53 karolherbst: mhhh
15:53 karolherbst: I think it's easy though
15:54 karolherbst: we can iterate over all sources and pick the one with the lowest use count
15:54 imirkin: yeah, i think i do it if one has usecount 1
15:54 karolherbst: maybe run DCE once before loadpropagation to have better numbers...
15:54 imirkin: or osmethin
15:54 karolherbst: yeah.. but then we are screwed in cases where we have 2 vs 3 as a use count
15:54 karolherbst: but yeah..
15:54 karolherbst: annoying
15:55 karolherbst: imirkin: maybe we should do the loop twice in load propagation
15:55 karolherbst: first round, only fold in with use count 1
15:55 karolherbst: in the second round everything
15:56 karolherbst: heh.. this mad doesn't get optimized to the limm form btw
15:58 imirkin: limm form requires regs to match up
15:58 karolherbst: yeah
15:58 karolherbst: but RA tries its best though
15:58 imirkin: it does
15:58 imirkin: well
15:58 imirkin: maybe not its best
15:58 imirkin: but it tries =]
15:58 karolherbst: :)
15:59 karolherbst: I kind of like the idea of looping twice.. maybe that helps overall as well
17:01 karolherbst: ehh.. that hurts more than it helps
17:11 karolherbst: imirkin: if I do two rounds, but the first refuses to propgate values with just one use https://gist.githubusercontent.com/karolherbst/a97a4d5405f35ec50303e8263283f7f2/raw/3696610d14de6886f910ac54e10cdbdc9f79a6e5/gistfile1.txt
17:11 imirkin: this stuff is tricky.
17:11 imirkin: https://cgit.freedesktop.org/mesa/mesa/tree/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp#n215
17:11 karolherbst: I blame scheduling :p
17:12 karolherbst: ohh.. right .
17:12 imirkin: i did that for adds
17:12 imirkin: primarily
17:12 imirkin: your problem is slightly different i think
17:12 karolherbst: yeah
17:12 imirkin: but could potentially be solved similarly
17:12 karolherbst: doubtful
17:13 karolherbst: it looks like a scheduling issue simply
17:13 karolherbst: so if you propagate the value used more often and it gets eliminated (the load) you reduce live values
17:13 karolherbst: so... mhh
17:13 karolherbst: this is more of a "propagate the most used values, but only if we get rid of the initial load" kind of thing
17:13 karolherbst: and both workarounds are just workarounds
17:14 imirkin: i propagate the less-used values :)
17:14 karolherbst: yeah...
17:14 karolherbst: hurts gpr count
17:14 karolherbst: :p
17:14 imirkin: eh
17:14 imirkin: chances are the more-used value won't be able to get inlined anyways
17:14 karolherbst: right
17:14 imirkin: but yeah - it's not exhaustive.
17:14 karolherbst: but maybe we could check that.. will costs only a bit of CPU
17:15 karolherbst: mhh
17:15 karolherbst: annoying
17:16 karolherbst: the annoying part is, that sources can be swapped
17:18 karolherbst: maybe we should approach this pass differently: 1. find each load 2. calculate which load can be eliminated also by swapping sources 3. sort by use count 4. start with the highest one and "repair" the list as we go
19:00 polm: Hello, I recently have had trouble starting X and it seems to be something wrong with nouveau. I'm getting an error like the one at the top of the TroubleShooting page (drm failed to open device) but I don't seem to have any of the problems mentioned there.
19:01 polm: Here's my xorg.log: https://gist.github.com/polm/c0006523307853caad169fd29e751e40
19:03 polm: It seems like KMS is setting an invalid mode on my monitor. Using "nomodeset" lets the framebuffer work, but I can't get any "video=" option to work.
19:10 karolherbst: polm: why are you using video= in the first place?
19:12 polm: I was not using video= to start with, but it was mentioned in TroubleShooting, so I tried it.
19:12 polm: I am not using it at the moment.
19:12 karolherbst: mhh
19:12 karolherbst: polm: mind sharing your dmesg?
19:13 polm: sure, here's the parts that mention nouveau (let me know if there are other parts I should look for): https://gist.github.com/polm/d14b89bd15ed1e8f3b6bc32afdc36c5b
19:20 karolherbst: polm: what's your /etc/X11/xorg.conf?
19:21 polm: This is what is is now: https://gist.github.com/polm/bd5bf9480cdc28ad73cfd6fc7398b949
19:21 RSpliet: polm: mind just dumping the entire dmesg. There could well be other non-related hints in there
19:22 polm: OK, will dump all of dmesg. I have a ton of audit messages from cron though
19:22 karolherbst: polm: well. remove that xorg.conf file
19:22 polm: I also tried using no xorg.conf and the minimal four-line one mentioned in troubleshooting.
19:22 karolherbst: that's just nvidia generated garbage, no?
19:22 polm: ah, the header is really old but I rewrote most of it over time
19:22 karolherbst: why?
19:23 polm: One part is for marble mouse support
19:23 karolherbst: I see nothing of value in it
19:23 karolherbst: mhh
19:23 karolherbst: isn't that picked up automatically?
19:23 polm: I believe the refresh rates on my TV had issues with xrandr too
19:23 karolherbst: huh..
19:23 karolherbst: well
19:23 karolherbst: you should get rid of the driver sections at least
19:23 polm: Some of the minor buttons don't work without config
19:23 karolherbst: :/
19:24 karolherbst: usually a libinput bug then though
19:24 karolherbst: anyway, the GPU device shouldn't be needed
19:24 karolherbst: and the mouse one should be fixable through libinput
19:25 karolherbst: the screen is also filled with random stuff...
19:25 karolherbst: mhh
19:25 karolherbst: but if you say that a removed config won't help
19:25 karolherbst: weird
19:25 RSpliet: I don't see how that will solve [drm] Failed to open DRM device for pci:0000:02:00.0: -19 though
19:25 RSpliet: (-ENODEV)
19:25 imirkin: polm: so you have an internal panel which is 1280x720, but nouveau thinks it's 1920x1080?
19:26 imirkin: nomodeset = "disable graphics completely"
19:26 imirkin: so no accel no nothing
19:26 polm: Here's xorg.log with no xorg.conf: https://gist.github.com/polm/fb32c36faa665a1e12c834735a40f05d
19:26 RSpliet: open /dev/dri/card0: Permission denied
19:26 RSpliet: I mean, that's a pretty descriptive error
19:26 polm: yeah, if I use nomodeset the framebuffer/console is fine. If I don't use nomodeset, when the login is displayed my tv gets an unsupported signal
19:26 karolherbst: heh...
19:27 imirkin: ok, so your TV is reporting a bad EDID then
19:27 polm: oh
19:27 imirkin: saying it can do things that it can't =/
19:27 polm: ah
19:27 imirkin: using video= will override the logic that picks the highest mode for the console
19:27 imirkin: but Xorg will then happily use that highest mode again
19:28 polm: I see
19:28 karolherbst: imirkin: can this cause that ENODEV though?
19:28 imirkin: it seems like you're also having permissions issues, and you appear to be using systemd/sddm/whatever, so unfortunately my expertise is limited there
19:28 karolherbst: I guess it can..
19:28 imirkin: well, the thing could be not there
19:28 imirkin: or you don't have permissions
19:28 imirkin: and you're not using that shared manager thing
19:28 karolherbst: polm: is X started as a user or root?
19:28 polm: as a user
19:28 karolherbst: mind trying as root?
19:28 RSpliet: Is /dev even mounted? Lots of interesting questions :-D
19:28 polm: oh dear :P, let me try as root
19:29 karolherbst: I guess some permission messup can mess it up quite good
19:30 polm: xorg.log after running as root: https://gist.github.com/polm/e0d8f97c34c96cff2917b451c21041fe
19:31 RSpliet: But was it working? It looks a lot better
19:31 imirkin: VIC 5: 1920x1080i 60.000 Hz 16:9 33.750 kHz 74.250 MHz (native)
19:31 imirkin: VIC 16: 1920x1080 60.000 Hz 16:9 67.500 kHz 148.500 MHz
19:31 imirkin: perhaps there's an issue with the interlaced mode.
19:31 polm: I still can't see anything and the xorg process isn't running
19:32 polm: OK, that would make sense. the default mode with xrandr always had issues
19:32 imirkin: could be the driver doesn't do something properly
19:32 imirkin: 1920x1080i should definitely be supported by a TV
19:32 karolherbst: imirkin: on a new enough one..
19:32 RSpliet: I recall someone mentioning fixes for that
19:32 karolherbst: ohhhhh
19:32 karolherbst: ehhh
19:32 polm: Is it possible there's something weird about the refresh rate?
19:32 karolherbst: forget that
19:33 imirkin: anything's possible
19:33 karolherbst: interlaced is broken with DP, but that doesn't matter
19:33 karolherbst: it will just mess up the picture
19:33 polm: hm
19:33 polm: the tv is just showing "unsupported signal" this whole time
19:33 karolherbst: polm: it seemed like X started and stopped directly
19:33 karolherbst: .. soo
19:33 karolherbst: dunno why it stopped
19:34 imirkin: the EDID decodes like this: http://paste.debian.net/plain/1141617
19:34 imirkin: polm: you can specify a different default mode
19:35 imirkin: or as root, do DISPLAY=:1 xrandr -s 1280x720
19:35 imirkin: er
19:35 imirkin: DISPLAY=:0 xrandr -s 1280x720
19:35 karolherbst: imirkin: X doesn't run ;)
19:35 imirkin: X runs fine
19:35 karolherbst: nope
19:35 karolherbst: last line
19:35 imirkin: no client
19:35 imirkin: or i dunno
19:35 karolherbst: ohhh
19:35 karolherbst: ehh
19:35 imirkin: maybe he quit
19:35 karolherbst: wait...
19:36 polm: I didn't quit
19:36 karolherbst: polm: how did you start X?
19:36 karolherbst: startx or Xorg?
19:36 polm: I am typing startx
19:36 karolherbst: try "Xorg" instead
19:36 polm: ok
19:36 karolherbst: startx is weird...
19:36 imirkin: ah, probably an issue in your .xsession or whatever
19:36 karolherbst: it doesn't like missing applications and stuff
19:37 polm: oh, now X is running, still can't see anything. I'll try xrandr
19:38 karolherbst: or DISPLAY=:0 glxgears or so :p
19:38 polm: hm, "unsupported signal" went away and I have a black screen
19:38 karolherbst: some displays are...
19:38 karolherbst: shit
19:38 imirkin: move mouse around
19:38 karolherbst: go off if the picture is all black
19:38 karolherbst: imirkin: I know displays where even that isn't enough
19:38 RSpliet: X.org just gives a black background without clients no?
19:39 imirkin: yes
19:39 karolherbst: yes
19:39 imirkin: used to do that mask thing
19:39 imirkin: but they got rid of it =/
19:39 karolherbst: :/
19:39 RSpliet: "that mask thing"? N95?
19:39 polm: glxgears showed up
19:39 imirkin: i think you can still enable it
19:39 polm: !
19:39 karolherbst: :=
19:39 karolherbst: :)
19:39 polm: Thank you!
19:39 imirkin: RSpliet: yes, N95.
19:39 imirkin: RSpliet: but there was a shortage, so they turned it off.
19:39 karolherbst: well, glad to figure out it's not our bug :D
19:39 RSpliet: polm: so there you go, 1 permission issue and 1 EDID issue, but your GPU is running fine!
19:39 karolherbst: :p
19:40 polm: that's a relief
19:40 polm: At least now I know what's going on
19:40 RSpliet: Didn't expect otherwise from a GT218
19:40 karolherbst: polm: for a rootless X you need some kind of login manager handling all the werid shit
19:40 karolherbst: it's weird
19:41 karolherbst: well.. login manager with logind support at least
19:41 karolherbst: plain X won't do
19:41 karolherbst: or maybe it does?
19:41 karolherbst: dunno
19:41 polm: Aaah ok
19:41 RSpliet: It worked on Fedora before they switched to Wayland
19:41 karolherbst: mind just need a special group
19:41 RSpliet: So there must be a way
19:41 karolherbst: making it pointless to run as a user
19:41 karolherbst: ...
19:41 polm: I've always used a plain login with no manager, but maybe Arch added something
19:42 RSpliet: polm: can you just get the permissions from /dev/dri/card0?
19:42 karolherbst: usually video group
19:42 RSpliet: owner, group, rwx, that kind of stuff
19:42 polm: root:video
19:42 polm: crw-rw---- 1 root video 226, 0 Apr 21 03:50 /dev/dri/card0
19:42 karolherbst: yeah...
19:42 karolherbst: adding your user to the video group makes it all pointless in the end
19:42 karolherbst: at least better as full root though
19:42 polm: ah, sure enough I'm not in it
19:42 polm: the video group
19:42 karolherbst: yeah...
19:43 karolherbst: with logind the thing usually goes like that: login manager starts as a user with access to the card* files, if user log ins, it starts a second X server with handed over fds under the users user
19:43 karolherbst: so you are all safe
19:43 polm: aaah, ok
19:43 karolherbst: but I think only gdm supports it
19:43 karolherbst: so everything else is less secure :p
19:44 polm: I think I can sort it out from here, but thank you all so much!
19:44 RSpliet: polm: cool; good luck!
19:44 karolherbst: the point is to remove access to card* from your user, so mailicious softare just can't do crappy shit with it
19:44 karolherbst: yeah.. good luck :)
19:44 RSpliet: Well, that's one point. The other point is not being able to gain privileges when you find a bug in X.org. Which I'm sure there are plenty
19:44 imirkin: polm: also you have to be root to do modesetting.
19:44 imirkin: doesn't matter if you have rw perms on the device node
19:45 karolherbst: imirkin: modesetting as in changing resolution?
19:45 imirkin: (or rather, CAP_SYS_ADMIN)
19:45 karolherbst: why would you?
19:45 imirkin: why would you what?
19:45 imirkin: to become drm master you need it.
19:46 karolherbst: need priviliges for changing the resolution...
19:46 karolherbst: ah yeah..
19:46 karolherbst: might work through logind for me
19:46 imirkin: the process that takes master must be CAP_SYS_ADMIN
19:46 karolherbst: at least my wayland compotior runs under my user and my user doesn't have that privilige :)
19:46 imirkin: if it then passes file handles around, that's it's own business
19:46 RSpliet: funny how logind now sounds like the daemon you want to find security bugs in rather than X.org
19:46 imirkin: yes. funny.
19:47 imirkin: who could have predicted such a thing
19:47 karolherbst: RSpliet: yep
19:47 karolherbst: well..
19:47 karolherbst: at least that's a step forward, as X has the bigger attack surface :p
19:47 karolherbst: and I am sure loginds code is less horrible than Xs
19:47 airlied: yeah logind is missing completely overflowable protocols and rendering stacks
19:48 karolherbst: :p
19:48 karolherbst: yeah.. X is something alright