ChanServ changed the topic of #wayland to: https://wayland.freedesktop.org | Discussion about the Wayland protocol and its implementations, plus libinput | register your nick to speak
tzimmermann has quit [Ping timeout: 480 seconds]
columbarius has joined #wayland
co1umbarius has quit [Ping timeout: 480 seconds]
leon-p has quit [Quit: leaving]
<ishitatsuyuki> it concerns me how we have a million ways now to configure input sensitivity depending on what compositor one is using
<ishitatsuyuki> perhaps we should have something similar to wlr-output-management but for xinput configurations?
txtsd has quit [Ping timeout: 480 seconds]
<whot> ishitatsuyuki: it's unlikely that you'll get gnome to sign up for it
<ishitatsuyuki> :(
<ishitatsuyuki> because they're gsettings purist?
leon-p has joined #wayland
zebrag has quit [Quit: Konversation terminated!]
dcz has joined #wayland
leon-p_ has joined #wayland
leon-p has quit [Ping timeout: 480 seconds]
Lyude has quit [Quit: WeeChat 3.2]
Lyude has joined #wayland
<ishitatsuyuki> whot: actually, why do you think gnome would be reluctant about this?
<whot> ishitatsuyuki: it's a can of worms that doesn't allow for a good UI. you have a lot of input devices (some of which you never want to expose to the user anyway) and each of those has different settings
<whot> ishitatsuyuki: on those settings you need different UIs depending on the device, you need to store those settings in some special way so they correctly apply to the various devices lter, etc.
<whot> ishitatsuyuki: it's a suprisingly difficult thing to do right (esp. with a GUI) and it only improves things very slightly for a lot of effort
<ishitatsuyuki> whot: are you referring to xinput by "it's a can of worms"?
<ishitatsuyuki> I guess there are device specific quirks that need handling, but the key value interface should still work decently in practice
<whot> xinput the commandline tool?
<whot> xinput is basically an X compatible version of sysfs. You need to know which value you can pipe into which key, with virtually no discoverability and very little feedback if you do it wrong
<whot> it's powerful, in the same way as echo "foo" > /sys/whatever is powerful
dcz_ has joined #wayland
dcz has quit [Ping timeout: 480 seconds]
<ishitatsuyuki> fair
leon-p_ has quit []
jgrulich_ has joined #wayland
agners has quit [Read error: Connection reset by peer]
hardening has joined #wayland
pnowack has joined #wayland
danvet has joined #wayland
rgallaispou has joined #wayland
hill has joined #wayland
rasterman has joined #wayland
<romangg> Is there some DRM way to know when the back buffer for the next vblank has been updated? So not the time the vblank happens, but when (hopefully) before we have updated what comes onto the next front buffer.
<romangg> My current assumption is I need to measure the rendering time with the graphics API. But maybe there is another way?
<ishitatsuyuki> sounds like you want explicit sync, but idk
<romangg> It sounds at least somewhat related.
<romangg> I need to know that btw in the compositor, not as a client.
<emersion> i don't understand exactly what you're looking for
<jadahl> romangg: are you trying to avoid committing non-ready buffers to kms?
<romangg> jadahl: no, it's for timing/delaying the commit to reduce latency.
<romangg> need to know how long it took to put the last 1-100 buffers on the screen to make an estimate how much I can delay the next submission.
<jadahl> romangg: mutter does that, I can link you to the MR that implements it
<romangg> or not "how long it took to put it on the screen" but "how long it took to be ready to put on the screen".
<romangg> jadahl: Thanks, much appreciated.
<romangg> Thank you. So I guess from https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1762/diffs?commit_id=fbe6740df121db60e1dbe0fbc6b01a72a6401461 this one measures the duration of the rendering with Gl calls.
<romangg> Great MR.
<emersion> do you want to measure the time between "buffer ready because rendering is finished" and "buffer programmed into hw so that it'll soon be displayed on screen"?
<romangg> yes, but also how long the (async) rendering before that needs, what I assume is much longer usually than between "rendering finished" and "programmed into hw so that it'll soon be displayed on screen".
<emersion> ok, then look at mutter yeah, it does exactly this
<emersion> it measures the rendering time
<romangg> Is there a way to know the second?
<emersion> it doesn't measure the time it takes to program the hw, because that's quick and there's no way to find out rn
<romangg> ah ok. :)
<emersion> or maybe with a synchronous kms commit?
<emersion> would be unfortunate, and maybe would include other things
<romangg> Quickly looking at the explicit sync protocol would sync fences not also be a (more generic) method to measure the rendering?
<emersion> fences can help, but could be less precise?
<emersion> yeah
<emersion> the GL ext may give timings local to the GPU clock
<romangg> meh
<emersion> fences need to signal the CPU and then hope the scheduler doesn't take too long etc
<emersion> so, GL timings should be ,more precise, but no idea whether that matters
<emersion> and how much of a difference it makes
<emersion> i guess one difference is that it's not easy to figure out when rendering has started with fences?
<emersion> i don't remember how mutter does this w/ the GL ext
<emersion> also sometimes rendering starts before the destination buffer is touched…
<emersion> depending on client logic
<zzag> emersion: there is a kwin patch, we use cpu timestamp as the starting point of rendering
<emersion> zzag: so, the wl_surface.commit time?
<zzag> cpu timestamp - start
<zzag> max(gpu timestamp, cpu timestamp) - end
<emersion> i guess it's better than nothinbg
<emersion> what is "start" and "end" here?
<zzag> start - started rendering; end - finished rendering
<emersion> oh, so "-" isn't a minus sign :P
<zzag> heh, my bad. "=" would be a better choice xD
<emersion> why is the max() needed?
<emersion> isn't the gpu timestamp enough to figure out the end?
<pq> Aren't cpu and gpu timestamps in different time domains?
<zzag> emersion: it takes care of the case where timer queries are not supported, but yeah, maybe it's not needed
<zzag> pq: from my testing, cpu timestamps retrieved using gl, i.e. not using clock_gettime(), seem to be in the same domain
<emersion> they shouldn't be
<zzag> it's worth checking the spec again though as my statement can be utterly wrong :p
<pq> emersion, what "shouuldn't be"?
<emersion> i think GPU time domain != CPU time domain
<pq> I didn't know you can query CPU timestamps with GL. Does the API guarantee a common (but unspecified?) time domain then?
<emersion> the GL spec doesn't seem to
<emersion> no, i don't think you can query CPU time with GL
<romangg> zzag: You added the gpu timestamping later? because I looked at https://invent.kde.org/plasma/kwin/-/merge_requests/507/diffs?commit_id=ad5f8c5c595a59d391b7199654106762df6685f6 where it says it doesn't do this yet.
<zzag> emersion: you can query timestamps though, no? glGetInteger64v(GL_TIMESTAMP, &timestamp);
<emersion> yes, timestamps with an undefined base
<zzag> romangg: there is another merge request that kwin take gpu render time into account
<zzag> that makes kwin*
hendursa1 has joined #wayland
<emersion> they might be aligned with the CPU clock if you're lucky (iGPU maybe?), but might not
<pq> zzag, is glGetInteger64v(GL_TIMESTAMP, &timestamp); what you called "cpu timestamp"?
<romangg> emersion: They are sufficient for measuring time durations though, so I guess if that's what he is doing (comparing a cpu to cpu timestamp with a gpu to gpu timestamp) then it's fine.
<romangg> zzag: got a link?
<emersion> yes, as long as you're not mixing apples and bananas it's fine
<emersion> but zzag said that "start = cpu time" and "end = gpu time"
<pq> ...hence it's important to not call a banana "an apple" ;-)
<emersion> so "end - start" is an invalid operation
<emersion> ahah :P
<romangg> I'm eating a banana and grapes a the moment. So check mate time dimensions!
<zzag> pq: ah, sorry, I call it "cpu timestamp" because it's the gl time after a specific cpu instruction has been executed
<zzag> i.e. it's not necessarily CLOCK_MONOTONIC
<pq> zzag, so it's a gpu timestamp, it is just from an immediate read.
hendursaga has quit [Ping timeout: 480 seconds]
<zzag> yeah, I guess you could put it that way. it just makes it easier for me to reason about timestamps
<pq> it confuses the hell out of everyone else :-)
<zzag> sorry! xD
<zzag> for clarity sake, maybe a start and an end timer queries can be inserted, but I remember pq saying something about timer queries not working as expected
<pq> With timestamps, the clock domain is important, and mixing timestamps from different domains is a common mistake and a very easy one to do. What that timestamp corresponds to is another thing. and how it was read is usually less interesting.
<zzag> maybe start and end*
<pq> zzag, the thing that does not work is inserting a *fence* at the beginning of a GPU job.
<romangg> At the moment my assumption is that gl timer queries are the way to go for measuring the rendering time. It's also what the gnome mr does from what I can see.
<romangg> pq: why is that again?
<pq> romangg, because some drivers return the fence timestamp for the latest GPU job that did complete, and you didn't give any work to the GPU yet, so who knows what that timestamp is about.
<romangg> ah, bad drivers! thank you.
<emersion> submitting a no-op rendering operation might avoid this…
<pq> no, it's very intentional
<emersion> … but maybe drivers optimize it out…
<pq> the spec wording is explicitly misleading
<romangg> emersion pinging faster that issue ticket than I can click the link.
<emersion> pro mlg pinger here
<romangg> ok, but then there is at least a logical definition and only the wording needs to be clarified.
<romangg> that's good
<pq> yes, there is nothing wrong with sync points of fences
<pq> and nothing wrong in drivers
<zzag> there are a couple of interesting open questions though
<pq> it's just a piece of API you simply cannot use for one particular thing that would seem like an obvious use case (getting GPU job starting timestamp)
<zzag> the direct scanout problem is solved by attaching dmabufs to fbos in mutter
<zzag> another one is the transfer time between gpus
<pq> zzag, I do not suggest to replacing the immediate GL timestamp read with a timer query. The read is fine (GL time right now). Just don't call it cpu timestamp. :-)
<zzag> yeah, I will call it "current gl time when compositing starts"
<pq> yes!
<pq> I don't know how timer queries work, so I can't say anything about them, particularly the special case of a query without other commands first.
<pq> weston is still measuring it wrong, btw: https://gitlab.freedesktop.org/wayland/weston/-/issues/342
<MrCooper> pq: a timer query is like a GPU command which records a timestamp, it should work for "GPU finished drawing no later than" even if there are no other pending commands
<pq> MrCooper, well, I thought the same was obviously true with fences as well, by reading the spec. What stops drivers from optimizing that away? :-)
<pq> I guess the question is, what does "finished drawing" mean if there is no drawing to be done first.
<MrCooper> then that command doesn't need to wait for anything before recording the GPU timestamp
<pq> or maybe it doesn't even query the gpu timestamp at all, just returns the timestamp from the last finished job ages ago?
<pq> what makes that illegal?
<MrCooper> it boils down to sampling some GPU registers, not sure what "the last finished job" has to do with it
<pq> to optimize avay the need to read registers
<MrCooper> it appears to be working as intended with Mesa and nvidia drivers
<pq> i.e. to optimize away the need to touch the GPU at all
<pq> ok
<MrCooper> I'm afraid you're overthinking this
<pq> the "begin fence" seemed to work fine on intel too, IIRC
<pq> I am paranoid about the API guarantees, yes, because being burned before
<MrCooper> fences are coupled to flushes, timer queries are not
<pq> and also because gfx drivers are known for bending the rules to get more performance.
hill has quit [Remote host closed the connection]
<pq> flushing had nothing to do with the fence problem though
<pq> flushing a command buffer that only contains a "fence command" (which doesn't exist) will then deliver a timestamp from the end of an earlier GPU job that could could be any time in the past, on amd I was told.
<pq> so no, I do not trust common sense here
<romangg> zzag: Thanks for the link. I'll likely copy over the libkwineffects changes. Regarding you mentioning direct scanout in the MR: isn't mutter's fbo solution also kind of wasteful? After all the idea of direct scanout is to not wake up the renering infrastructure of the compositor at all.
hill has joined #wayland
<romangg> jadahl: What do you think?
kennylevinsen has quit [Remote host closed the connection]
<romangg> I mean the idea itself is cool. But just for measuring the client's rendering being finished doing context switch and all that kind of defeats the purpose of direct scanout, not?
kennylevinsen has joined #wayland
<MrCooper> what context switch?
kennylevinsen has quit [Remote host closed the connection]
<MrCooper> dynamic scheduling requires some kind of measurement
kennylevinsen has joined #wayland
<MrCooper> pq: I appreciate your concern, but timer queries are not like fences
<pq> MrCooper, that's good. I hope all driver devs agree.
<pq> ...with the spec.
<jadahl> romangg: hmm? haven't been following the discussion
<romangg> jadahl: The question was if the solution with the fbo in https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1762 to measure the client's rendering time to the scanout isn't defeating the purpose of the direct scanout.
<MrCooper> that's a pretty clear no
<romangg> As in to not wake up the compositor rendering pipeline at all.
<romangg> MrCooper: Ok, thanks. Would you please explain some more why that is?
<MrCooper> even without caching as in my follow-up MR, the CPU work should be minimal compared to actually compositing, and it saves the GPU compositing work
<romangg> MrCooper: So all the rendering calls in meta_drm_buffer_gbm_fill_timings are negligible?
<MrCooper> there are no rendering calls, only the timestamp query
<romangg> Yea, I meant gl commands. What about cogl_egl_texture_2d_new_from_image?
<romangg> Inexpensive?
<romangg> Sorry, not an expert but I like to learn. :)
<MrCooper> per https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1963#note_1251595 ~200 microseconds of CPU work that can be saved with caching
<MrCooper> leaving just over 100 microseconds of CPU work for the measurement
<romangg> Ah, that's fine. Good profiling and improvement too.
<romangg> interesting numbers
<MrCooper> admittedly that's with a pretty beefy CPU (Ryzen 5 3600X)
Lucretia has quit []
Lucretia has joined #wayland
gryffus has joined #wayland
<emersion> pq, if you have time to review some docs: https://lists.freedesktop.org/archives/dri-devel/2021-September/321974.html
<pq> emersion, ah, that's new, thanks. I'm still 3.5k emails behind on dri-devel since holidays.
<emersion> ahah
<emersion> i think i have noticed another one which may be of interest
<pq> including a few series that did cc me
<pq> thanks, I marked that too
<pq> hm, I didn't know the kernel was wiping anything after a KMS device was closed.
<emersion> i don't think it is
leon-p has joined #wayland
leon-p_ has joined #wayland
leon-p has quit [Ping timeout: 480 seconds]
<wlb> weston Merge request !686 merged \o/ (Make the DRM-format API leaner https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/686)
<wlb> weston/main: Leandro Ribeiro * drm-formats: save result of intersection in the first array https://gitlab.freedesktop.org/wayland/weston/commit/c51d4ad9c8f2 libweston/drm-formats.c libweston/libweston-internal.h tests/drm-formats-test.c
<wlb> weston/main: Leandro Ribeiro * drm-formats: remove create() and destroy() from the API https://gitlab.freedesktop.org/wayland/weston/commit/0750ceae6cd1 libweston/drm-formats.c libweston/libweston-internal.h tests/drm-formats-test.c
hill has quit [Remote host closed the connection]
fmuellner has joined #wayland
ecloud has quit [Ping timeout: 480 seconds]
fmuellner has quit []
fmuellner has joined #wayland
fmuellner has quit []
co1umbarius has joined #wayland
ecloud has joined #wayland
columbarius has quit [Ping timeout: 480 seconds]
fmuellner has joined #wayland
fmuellner has quit []
gryffus has quit [Remote host closed the connection]
gryffus has joined #wayland
zebrag has joined #wayland
gryffus has quit [Remote host closed the connection]
gryffus has joined #wayland
hendursa1 has quit []
hendursaga has joined #wayland
tdeo has quit [Remote host closed the connection]
tdeo has joined #wayland
dvlbr^ has joined #wayland
leon-p has joined #wayland
leon-p_ has quit [Ping timeout: 480 seconds]
pnowack has quit [Quit: pnowack]
autistic has joined #wayland
autistic has left #wayland [#wayland]
papojari[m] has joined #wayland
autistic has joined #wayland
<autistic> Hello there! I am trying to get my way into wayland code, for fun at first, but I am struggling with wl_display_connect always returning NULL
<autistic> Then I ended up wondering: am I really running wayland?
<wb9688> Is $WAYLAND_DISPLAY set?
<autistic> No, and that´s what got me wondering
<autistic> I am connected to the machine I´m using for test using xrdp
<autistic> It should be running wayland
<autistic> And I´m kinda struggling to get what I might be doing wrong
<wb9688> Well, xrdp uses X
<autistic> Ohhh, that explains then
<autistic> Is there any alternative available using wayland?
pnowack has joined #wayland
<autistic> I´m connecting from a W10 client, I am currently in a place where I don´t have a Linux environment installed locally
HAL_6900 has joined #wayland
HAL_6900 has left #wayland [#wayland]
jgrulich_ has quit [Ping timeout: 480 seconds]
gryffus_ has joined #wayland
gryffus has quit [Read error: Connection reset by peer]
<danieldg> autistic: you need a wayland server somewhere to connect to. If that server is remote, you can use waypipe and/or wayvnc
<danieldg> if W10 only provides an X server (no idea if it does that or not) then you'll need to run a wayland server yourself
FbioPacheco[m] has joined #wayland
dcz_ has quit [Ping timeout: 480 seconds]
<autistic> danieldg, it doesn´t, and I don´t want to run it on W10, I just mentioned W10 because the solution must have a client widely available, like in case xrdp, but I will do everything on a Linux machine
<autistic> I´ll take a look at wayvnc, it seems like VNC must be supported on W10 machines
<danieldg> there are certainly vnc clients, yes
autistic has quit [Ping timeout: 480 seconds]
mooff has quit [Quit: Quit]
mooff has joined #wayland
co1umbarius has quit [Quit: co1umbarius]
gryffus_ has quit []
mooff has quit [Quit: Quit]
mooff has joined #wayland
danvet has quit [Ping timeout: 480 seconds]
amos has joined #wayland
fmuellner has joined #wayland
nik has joined #wayland
nik has quit []
dvlbr^ has quit [Ping timeout: 480 seconds]
fmuellner has quit []
fmuellner has joined #wayland
hardening has quit [Ping timeout: 480 seconds]
linguist has joined #wayland
columbarius has joined #wayland
fmuellner has quit [Ping timeout: 480 seconds]
linguist has quit [Ping timeout: 480 seconds]
marex has quit [Ping timeout: 480 seconds]
rasterman has quit [Quit: Gettin' stinky!]
Seirdy has quit [Ping timeout: 480 seconds]
Seirdy has joined #wayland