00:03 milek7: imirkin: what do you mean by that it doesn't do anything? it usually writes gl errors to stderr
00:04 imirkin: oh hm. i thought that was just enabled on debug builds
00:49 marex: ah ... I thought I finally got it all working, but it was only mesa pulling some other shader from the cache
00:49 marex: darn
00:57 anholt: mareko: I did a skim of the atomics reduction series and it looks pretty great. do you need more reviewers at this point?
01:11 anholt: robclark: I think once !8298 lands, it'll be time to revisit !4971
01:16 robclark: anholt: well, webgl aquarium is a pretty good benchmark for !4971 .. I'd be pretty happy if we can get to a point where indirect uploads for uniform state doesn't hurt (since I guess we'll need that regardless for threaded-context)
01:26 mareko: anholt: yes please
01:36 bl4ckb0ne: is there a way to clear the current egl context? I saw from the doc that calling eglMakeCurrent with EGL_NO_DISPLAY is not valid
01:45 HdkR: eglMakeCurrent(<current dpy>, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
01:49 bl4ckb0ne: EGLGetCurrentDisplay will do, thanks HdkR
01:50 bl4ckb0ne: would a patch to accept EGL_NO_DISPLAY be accepted?
01:52 marex: imirkin: that sprite_coord_enable, it is only seldom set when running e.g. neverball
01:53 marex: imirkin: so I have this patch https://gitlab.freedesktop.org/marex/mesa/-/commit/2a47cc2d8faf57bc33af0c342b8fa25941054f85 , which makes neverball work
01:53 marex: but when I only run the lowering pass if sprite_coord_enable bitfield is !0, then neverball point sprites are corrupted again
01:53 HdkR: bl4ckb0ne: Doubt. That would be against spec. With surfaceless you can just create a surfaceless dpy
01:53 imirkin: marex: is it in the shader key?
01:54 imirkin: marex: the same shader might be used both with pcoord replace and without
01:54 imirkin: marex: also only replace the varyings specified in the bitmask
01:54 imirkin: check other drivers how to go from varying slot to bit position
01:55 imirkin: iirc tex0 == bit 0, tex 1 == bit 1, etc
01:55 marex: imirkin: I added 16bits of it into the shader key, yes
01:55 marex: imirkin: all right, in that case, I will continue in a few days once I digested it all
01:56 marex: I think I'm getting some understanding of it, but it's still very incomplete
01:56 imirkin: yeah, this stuff takes a bit to wrap one's head around it
01:57 marex: imirkin: jekstrand: thanks for your patience and explanation, that really did help
01:57 marex: more than the docs and digging through code, by far
01:57 bl4ckb0ne: HdkR: i think its not specified in the spec but i see your point
01:58 HdkR: bl4ckb0ne: `As with other commands taking EGLDisplay parameters, if dpy is not a valid EGLDisplay handle, an EGL_BAD_DISPLAY error is generated` Right from EGL spec 1.5
02:04 bl4ckb0ne: HdkR: ty, fixed my issue
02:54 jenatali: Is there a list of places where the draw module is used? I'm curious on the tradeoff between size/speed for including LLVM in our GL driver, considering that on Windows we wouldn't be using a system shared LLVM
02:56 airlied: jenatali: it's used in GL for old feedback modes
02:56 airlied: glRenderMode()
02:56 jenatali: Ah, I think I saw that in my searches but didn't look close enough
02:59 jenatali: Yeah... it's apparently like 30MB per architecture to include LLVM in the GL driver just for that. I think I'm going to see about adding an option to build with LLVM, since we want it for our CL compiler, but not including LLVM in the draw module - or else I guess we could build those components separately, but an option seems simpler
03:00 airlied: jenatali: it should fallback to the non-llvm draw paths
03:00 jenatali: airlied: Yeah, building just the GL driver without LLVM works fine. But building GL + CL at once automatically includes LLVM into the GL driver, which bloats it
03:01 airlied: also glRasterPos
03:01 jenatali: Yeah that one I found
03:02 airlied: do you build from separate trees?
03:02 jenatali: No, right now we build them both together
03:02 airlied: that might be tricky to untangle then
03:02 jenatali: I'll see how bad it is - if it's not too bad I'll send an MR, if it's ugly I'll just build them separately on our side
03:02 airlied: I suppose your CL drivers as-is doesn't use much gallium
03:03 jenatali: Yeah we just need the Clang/LLVM frontend to get SPIR-V, from there it's just the NIR bits that're used
04:16 marex: jekstrand: imirkin: https://gitlab.freedesktop.org/marex/mesa/-/commit/2a47cc2d8faf57bc33af0c342b8fa25941054f85 so I think I figured out the NIR part, but TGSI still eludes me
04:16 marex: thats for later though
04:18 marex: correction , this https://gitlab.freedesktop.org/marex/mesa/-/commit/ad0ebd8f3299cab9d8612a19d8a6fc92865e3f88
09:22 emersion: daniels: gbm question: what should be the fallback when gbm_bo_get_plane_fd isn't available?
09:22 emersion: daniels: does this sounds the least bad possible thing to do? https://github.com/swaywm/wlroots/pull/2672
09:23 emersion: would i be able to check that each plane has the same handle?
09:23 emersion: (and fail if that isn't the case)
09:27 daniels: emersion: yeah, I think that makes sense: always call per-plane FD when available, if not available call get_handle and fail if it's different between any planes, then call get_fd
09:27 daniels: (my god what a pain)
09:27 emersion: ok!
09:27 emersion: yeah :S
11:12 danvet: emersion, maybe I wasn't clear, aside from the "must use" we should also explain when and what to consider maybe?
11:12 emersion: hm, what do you mean?
11:13 danvet: essentially if you have your fd from someone else, or shared with someone else like gbm
11:14 danvet: you must use that thing for importing
11:14 emersion: yeah, ok
11:14 emersion: makes sense
11:15 danvet: I'll add comments
11:16 kusma: ccr: That sounds an awful lot like what's mentioned here, perhaps you could file a ticket? https://gitlab.freedesktop.org/mesa/mesa/-/issues/3661#note_671465
11:18 kusma: ccr: I *assume* it's PIPE_SHADER_CAP_INDIRECT_CONST_ADDR that somehow triggers it, probably in combination with missing PIPE_CAP_PACKED_UNIFORMS if I understand zmike's comment right.
11:20 ccr: kusma, https://gitlab.freedesktop.org/mesa/mesa/-/issues/4132 :)
11:21 ccr: funny, 3661 is my ticket and while I've read the comments that one about the assert hadn't registered in my brain
11:32 emersion: danvet: so if a process sends a DRM FD to another process, and then both use GBM on it, things will go boom because the two GBMs won't be able to know the ref'count of the other instance?
11:44 kusma: ccr: awesome, thanks :)
11:45 kusma: ccr: doh, I should have realized that was you :)
11:45 danvet: emersion, yeah if those two gbm share the same drmfd
11:45 danvet: they both get the same gem_id back
11:45 danvet: but neither has that gem_id in its lookup table
11:45 danvet: and also no shared refcount
11:46 danvet: so if the last refcount drops on the first gem_bo it'll do a GEM_CLOSE
11:46 danvet: and now the handle the 2nd gbm thought it has has become invalid
11:46 danvet: or eventually will have some other buffer
11:54 MrCooper: aka "don't use the same DRM file description in multiple processes"
11:55 pq: It's like no-one ever imagined that one day people could be passing device FDs from one process to another, even though the mechanism for that has existed much longer.
11:56 imirkin: the real problem is that GEM's aren't refcounted
11:57 imirkin: adding refcounting on them would solve all these problems instantly afaik
11:57 MrCooper: time to dust off that time machine
11:57 pq: don't drivers (in userspace?) rely on being able to de-duplicate bos?
11:58 ccr:hums the BTTF theme
12:01 imirkin: MrCooper: well, could easily add a GEM_OPEN_REFCOUNT / GEM_CLOSE_REFCOUNT
12:01 imirkin: i guess i haven't thought it through
12:01 imirkin: but it all seems achievable
12:14 danvet: imirkin, userspace would still need to de-dupe to not upset command submission and other things
12:14 danvet: so seemed silly to refcount both in userspace and in the kernel
12:14 danvet: and now it's locked in and needs a time machine
12:15 danvet: MrCooper, even same process, iirc cros' ozone does the same trick and then gets pissed about the fallout
12:15 danvet: or at least was
12:18 imirkin: danvet: and we can't add some new ioctl's for new userspace to make use of?
12:20 danvet: could add a flag I guess
12:21 danvet: but it doesn't help you much, since you still need to support current kernels
12:21 danvet: and so no one bothers
12:22 emersion: but let's sayu someone bothers
12:22 emersion: say*
12:22 emersion: would it still be possible? pq's question sounds relevant
12:22 danvet: well kernel patch + igt + userspace, all revieweed
12:22 danvet: usually thing
12:22 danvet: we'd need to refcount gem_handles per fd
12:22 emersion: do driver rely on the kernel guarantee?
12:22 danvet: ofc
12:23 danvet: so you can only opt-in break it by userspace that hopefully knows what it's doing
12:23 danvet: hence the flag
12:23 imirkin: or just add different calls for open/close
12:23 emersion: ah, i guess keeping the guarantee and adding a ref'count would be enough
12:23 danvet: hm
12:23 danvet: you might need to also opt-in gbm
12:23 danvet: or it falls apart
12:23 imirkin: (or maybe just like add a refcnt call which does +/-1, and closes when it hits 0)
12:24 danvet: races
12:24 danvet: there's a reasons gbm has locks over this
12:24 pq: I mean, didn't driver command submission ioctls get upset if userspace submitted the same bo multiple times (even if different handles)?
12:24 imirkin: yeah, the +1 -1 case simultaneously is quite annoying
12:24 danvet: pq, yup, that's why we have it
12:24 pq: ..in the same ioctl
12:24 imirkin: pq: nouveau driver does
12:25 danvet: so we'd still need the de-dupe within a given gbm instance
12:25 imirkin: not sure if it's more global than that
12:25 danvet: but e.g. the compositor (for kms only) could have it's own thing
12:25 danvet: but really at that point, open the device yourself and you have all that
12:25 emersion: opening the device yourself might not work
12:25 danvet: emersion, why?
12:25 emersion: i've been wondering… you could in theory open the redner node and give it to GBM for allocation
12:26 emersion: then keep the DRM primary node where you are DRM master to drmPrimeFDToHandle
12:26 emersion: but what about dumb buffers?
12:26 danvet: emersion, it's not per-node
12:26 danvet: it's per open
12:26 danvet: gem_id is local to your fd
12:26 emersion: you'd need to be able to open the primary node
12:26 emersion: well, sure
12:26 danvet: well if you're a compositor, and you can't do that
12:26 emersion: what i'm worried about is
12:26 danvet: why do you care about that drmfd?
12:27 emersion: compositors get the DRM FD from logind/seatd
12:27 danvet: yeah
12:27 danvet: but if we assume modern system
12:27 emersion: nothign says that you can just open() it again
12:27 danvet: then you can open the render node for rendering whenever you feel like
12:27 emersion: open()ing the render node, i'm not too worried about
12:27 danvet: and that should be enough
12:28 emersion: what i'm worried about is dumb buffers
12:28 emersion: these only work on the primary node
12:28 danvet: nah
12:28 danvet: well
12:28 danvet: not sure my patch to restrict them ever landed
12:28 emersion: i get EPERM on the render node
12:28 danvet: but they're just normal gem buffers
12:28 danvet: emersion, with fd2handle and handle2fd?
12:28 emersion: yeah. so assume i create a dumb buffer, export it to a DMA-BUF via drmPrimeHandleToFD
12:29 emersion: then i want to get back my handle in a completely separate place, maybe in a different lib
12:29 emersion: if i just do drmPrimeFDToHandle, things will go boom
12:29 emersion: because it'll give the same handle
12:29 danvet: well yeah
12:30 emersion: and when both sides decide to GEM_CLOSE, rip
12:30 danvet: yeah don't do that :-)
12:30 danvet: but this is irrespective of dumb buffers
12:30 danvet: this can happen with anything really
12:31 emersion: so… i'd really like to be able to have two primary nodes, one for DRM master and KMS operations, and one for dumb buffer allocs
12:31 emersion: err, twop primary FDs
12:31 emersion: two*
12:31 danvet: uh
12:31 danvet: but if you import the same fd twice
12:31 danvet: you still go boom
12:31 danvet: even with the twice opened fd
12:31 emersion: the KMS part can refcount on its own
12:32 danvet: so why can't these two parts talk with each another?
12:32 emersion: because they aren't necessarily in the same lib, for instance
12:33 danvet: why?
12:33 emersion: let's say i have lib1 which creates some DMA-BUFs, and lib2 which consumes them
12:34 emersion: it just doesn't work if they share the DRM FD
12:34 danvet: yeah but how did they end up with the same fd and don't talk with each another?
12:34 danvet: also this is dumb buffers we're talking about
12:34 emersion: and there's no reliable way for me to have two DRM primary FDs
12:35 danvet: I'm not sure hiding dumb buffers behind a library interface that pretends dumb buffers with sw rendering and gl/vk rendering are the same thing is a good idea
12:35 emersion: yeah, non-dumb-buffers don't have this issue because i can just open() the render node
12:35 emersion: well, that's what i'm doing :S
12:35 danvet: yeah I'm not sold ...
12:35 emersion: why is it a bad idea?
12:36 danvet: next up people take this nice library which might give you dumb buffers
12:36 danvet: or real buffers
12:36 emersion: it's just DMA-BUFs
12:36 danvet: and just dma-buf share them all around, whether dumb or real
12:36 emersion: is there an issue with that?
12:36 danvet: yeah, that cat is out of the bag by accident
12:37 danvet: dumb buffers were supposed to be dumb
12:37 danvet: and people just love to abuse them for rendering, and buffer sharing, and everything
12:37 danvet: and then complain it doesn't work
12:37 danvet: sometimes at least
12:37 emersion: i don't really get it
12:37 danvet: worksforme is unfortunately very strong with dumb buffers
12:38 imirkin: along with mapping :)
12:40 emersion: i don't really want to scrap my nice API just because dumb buffers are dumb
12:40 pq: emersion, dumb buffers were never guaranteed to work properly with GPUs. Dumb buffers can be mmapped to CPU and displayed on KMS, and that is it. Anything else that may work is a happy/unfortunate accident. Therefore the end user experience is far from reliable.
12:40 emersion: i guess i'll just open the primary node twice and be done with it
12:41 pq: emersion, I suppose you can *try* to use a dumb buffer with a GPU, but you very much need a seamless fallback for it when it fails. Though I'm sure if danvet accepts even this approach?
12:42 pq: *I'm not sure
12:42 emersion: wait, dumb buffers weren't designed for GPUs?
12:42 pq: no
12:42 emersion: but it's part of DRM
12:42 pq: dumb buffers were specifically designed to be NOT used with GPUs
12:42 emersion: and there's no other way to do sw rendering
12:43 pq: display != GPU
12:43 emersion: ah. for me GPU includes both display and render
12:43 pq: when I say GPU, I mean a device capable of rendering
12:43 emersion: ok
12:43 danvet: pq, pragmatically, the cat is out of the bag, but airlied more than me has screamed about this stuff in the past
12:43 emersion: i'm just talking about primary nodes here
12:43 pq: emersion, it would help to drop that PC-specific thinking ;-)
12:44 danvet: emersion, dumb buffers where designed for boot splash
12:44 danvet: roughly
12:44 danvet: everything else is a more or less happy accident
12:44 danvet: plus a looooot of worksforme
12:44 pq: emersion, a primary node could be a display, render, or both. GPU=render, KMS=display.
12:44 emersion: i don't expect dumb buffers to work on GPUs
12:44 emersion: yes
12:45 danvet: so e.g. on most arm socs you have to allocate a dumb buffer on ther display primary node
12:45 danvet: and share that with the render device
12:45 danvet: because nothing else works
12:45 danvet: but it's really not all that great
12:45 emersion: yeah, i don't want to do that
12:45 danvet: emersion, well you have to, because nothing else will both render and scanout
12:45 danvet: on some socs
12:46 emersion: well i don't care about these socs :P
12:46 emersion: i just want to make it so i can have a sw rendering path which submits DMA-BUFs
12:47 emersion: without running into these ref'counting issues
12:47 emersion: but i guess the answer to that is "add ref'counting to the kernel" now?
12:47 pq: emersion, does the sw renderer also allocate the dmabufs? It probably shouldn't.
12:48 emersion: i want my sw rendering path to allocate dumb buffers, turn them into DMA-BUFs, import them on KMS, then display them
12:49 emersion: now that i'm thinking about it, GBM can do dumb buffers as well…
12:49 emersion: so i could get the magical GBM ref'counting if i wanted to
12:49 pq: yup
12:49 emersion: except i'm not sure GBM dumb buffers hook into the right driver ref'counting stuff
12:49 pq: weston GL-renderer with Mesa software renderer works.
12:50 emersion: yeah but you don't do DMA-BUFs in this codepath right?
12:50 emersion: it's just GEM handles
12:50 pq: mmm no
12:50 pq: right
12:51 pq: if dmabuf was the common interface, then you could mix up dumb buffers and GPUs
12:52 emersion: i don't plan to use dumb buffers when i have a render node
12:53 pq: doesn't your library have other users too?
12:54 emersion: users could force it into doing that, just like they can directly do it too
12:55 pq: not using an opaque structure with accessors to represent buffers, that could refuse to give a dmabuf fd if it's a dumb buffer?
12:55 emersion: so yeah, i have this opaque buffer structure with accessors
12:56 emersion: the only accessor is "get a DMA-BUF FD" right now
12:56 pq: sure, but the difference is, does one need to jump through hoops to do the wrong thing, or is it too easy
12:56 emersion: but how do i get to display the dumb buffer on the KMS side, if all i have is an opaque structure which refuses to give a DMA-BUF?
12:56 pq: get_gem_id could be another
12:57 emersion: yeah, except you need to be really careful about not giving a gem handle for a completely unrelated FD
12:57 emersion: you need to make sure both sides use the same DRM FD
12:58 pq: yup, so do that
12:58 emersion: so maybe have a get_gem_handle(target_drm_fd)?
12:58 pq: I suppose
12:58 emersion: which checks that the local DRM FD is the same as the target?
12:59 pq: same file description, yeah... but that might be a problem actually, I'm not sure how
12:59 emersion: my opaque structure has ref'counting built-in so that wouldn't be an issue
13:00 pq: maybe there was a new syscall or something, I remember discussing this in the past, but I forget the conclusion
13:00 emersion: hm
13:00 emersion: kcmp has KCMP_FILE apparently
13:01 pq: that sounds familiar
13:01 emersion: > Note that this syscall requires the kernel be compiled with CONFIG_CHECKPOINT_RESTORE set.
13:01 pq: yeah, that's the one
13:02 emersion: honestly… that isn't great
13:03 pq: the other option is just documentation: this handle will be valid only for the device you created your sw renderer object with
13:06 emersion: mesa has os_same_file_description
13:07 emersion: yea
13:35 emersion: in any case, thanks for the advice pq and danvet
13:36 pq: glad it was at least entertaining ;-)
13:36 emersion: :P
13:41 danvet: mripard, ack with the typos fixed?
13:41 danvet: on todo.rst
13:42 mripard: danvet: yep
13:43 danvet: thx
13:50 derRichard: hello!
13:51 MrCooper: danvet: same process is solvable in userspace, at least in theory; and per-fd refcount would break existing userspace which tracks GEM handles across different fds referencing the same file description
13:53 derRichard: hopefully this is the right place to ask. i'm developing a drm panel driver for linux and so far i'm unable to find a way on how to set the panel orientation. calling drm_connector_init_panel_orientation_property() triggers a warning in __drm_mode_object_add(). i fear the drm panel driver is not allowed to use this function. can you please point me in the right direction?
13:55 pq: derRichard, you're in the right place, but that's all I know about that. :-)
13:55 derRichard: :-)
13:59 danvet: derRichard, I think this isn't wired up yet
14:00 danvet: or at least tricky
14:00 pcercuei: derRichard, read the "rotation" DT property, it's a standard property for panels (see Documentation/devicetree/bindings/display/panel/panel-common.yaml)
14:01 danvet: pcercuei, but is that wired through already to the drm prop?
14:02 danvet: pcercuei, I'm not finding where the prop is added
14:03 danvet: hm found it
14:03 danvet: at least for panel-simple.c
14:03 danvet: but that's kinda the wrong place
14:04 danvet: yeah get_modes is very late, and might be too late
14:04 danvet: sravn, ^^
14:04 derRichard: pcercuei: i fear this works the other way around. my device needs to tell drm what the current rotation is. and not devicetree telling the driver what the expectet roation is.
14:04 danvet: derRichard, so it is wired up already with the property pcercuei mentioned
14:04 danvet: but it might be somewhat buggy
14:05 derRichard: goal is that xrandr can tell how the panel was mounted
14:06 danvet: drm_connector_set_panel_orientation <- this doesn't work for you?
14:07 danvet: derRichard, also upgrade to latest kernels, preferrably development trees
14:07 derRichard: hm, i don't have this function, i'm still on 5.4
14:07 danvet: your function got renamed
14:07 danvet: yeah that's horribly old :-)
14:07 danvet: for graphics at least
14:08 derRichard: well, i'm in embedded world, it's actually rather new :P
14:08 derRichard: and mainline. no vendor tree. at least something ;)
14:08 danvet: yeah it's getting somewhat better
14:08 danvet: it's not longer 5 year old vendor tree by default
14:08 danvet: but if you want to upstream, then it needs to be on upstream
14:09 derRichard: of course
14:09 derRichard: but the whole bsp right now works only with 5.4. i can only work in small steps
14:10 danvet: hm I'm still confused why this even works in upstream
14:10 danvet: derRichard, but yeah for examples of how it's done
14:10 danvet: $ git grep drm_connector_set_panel_orientation
14:10 danvet: in upstream
14:10 danvet: 3 panel drivers using that
14:10 danvet: sravn, tagr isn't drm_connector_set_panel_orientation() called from get_modes too late, i.e. after drm_dev_register?
14:10 derRichard: panel-simple is super generic
14:11 derRichard: let me see whether i can find all commits i need for backporting
14:12 danvet: derRichard, well there's 2 others if you need something specific
14:14 derRichard: hmm, in mainline drm_connector_set_panel_orientation is called in get_modes, just like in my driver on 5.4. but i do hit the warning
14:15 danvet: yeah that's what I'm confused about
14:15 danvet: I'd expect the upstream code to warn
14:17 derRichard: at least this time it is not me being dense ;-)
14:22 derRichard: panel-simple.c has the change since 5.10. maybe nobdoy really noticed so far ;-\
14:23 derRichard: *nobody
15:41 derRichard: danvet: should i send a mail to the mailinglist or file a bug regarding the issue?
15:47 danvet: derRichard, usually tagr and sravn are around here, they are herding panel stuff
15:47 danvet: ask them
15:47 danvet: derRichard, but yeah if you can hit a warning on upstream, that's good for a bug report somewhere
15:48 derRichard: ok!
15:48 derRichard: right now i don't have a 5.10 kernel with a working panel. ;-\
15:48 derRichard: let's wait for tagr and sravn a bit
18:05 neobrain[m]: mhm since when does issue editing require solving captchas? Would it be feasible to skip that for people with repo write access?
18:06 MrCooper: I've never had to do that
18:10 neobrain[m]: I've just seen it for the first time while fixing up formatting in another user's issue description, so it would be a recent change I suppose... or if it's not a Mesa config thing, maybe gitlab just decided I'm a bot :/
18:11 imirkin: all bots complain about that...
18:14 emersion: i've seen this as well
18:14 emersion:swears he's not one of them
18:49 zmike: I haven't
18:49 zmike:has good programming
18:50 ccr: program good. bug bad.
18:51 ccr: Conan the Debugger
19:11 sravn: derRichard, danvet: Renovating my new house comsume all my spare time and energy these days so no help from me until March/April time - sorry. And no, I cannot answer the orientation stuff from the top of my head
19:11 sravn: s/orientation/rotation
19:31 derRichard: sravn: no big deal :-)
19:44 zmike: anholt: any chance you (or someone else) wants to check out !8498
20:02 airlied: danvet: one Linus->Linux typo in your page faults writeup
20:05 danvet: thx fixed
20:06 airlied: danvet: next write up should be what a userspace fences stack looks like, how it interacts with mm etc
21:55 keithp: ajax: so, my question is 'how does anything work' without that patch?