09:50 koty0f: Greetings. I would like to ask for help. I'm using A64 (Mali-400MP2) with lima. I just bumped my Yocto build to kirkstone which has Weston 10.0.2 and Mesa 22.0.3 (previously on honister with Weston 9.0.0 and Mesa 21.2.4 worked OK) and started to get error messages for all of the outputs `format 0x34325258 not supported by output` when I start Weston.
10:13 pq: pitust, the authoritative spec of the Wayland wire format is libwayland. Everything else is just reflecting or documenting that. Likewise, the authoritative spec of handling the XML language is wayland-scanner, unless it's something it doesn't care about but others do (like annotating something as a bitfield).
10:14 pq: I agree things could be better, but that's how it is today.
10:15 mvlad: koty0f, 0x34325258 matches that of XR24, which should be supported by the KMS driver (ubiquitous format). modetest or drm_info should tell you what driver says about it. Last time when this come up, it looks like IN_FORMATS property was found but it couldn't be decoded, which pretty much says that the format couldn't found. It suggest an issue with the driver.
10:16 mvlad: koty0f, if possible suggest trying a newer version of the driver, yocto/OE.
10:17 pq: the DRM KMS driver, which lima is not, is it?
10:40 koty0f: mvlad it seems supported by drm_info https://pastebin.com/GPpmMBwN I noticed I don't have libdrm up to date 2.4.110 while compiling the drm_info.
10:42 emersion: the IN_FORMATS is borked
10:45 pq: koty0f, you are looking at the legacy info. The IN_FORMATS plane property OTOH is totally broken. This is a bug in the sun4i-drm kernel driver.
10:55 pq: swick[m], thanks a lot for the SMPTE follow-up!
10:59 koty0f: emerson,pq huh. Sry never used drm_info before. Thanks for pointing it out. Lets bump the kernel then.
11:44 swick[m]: pq: I'm still failing to follow your interpretation of the HDR static metadata
11:45 swick[m]: I'd like to add something to color-and-hdr about the metadata but if you disagree with the interpretation I'm not sure if it's worth it
11:45 pq: swick[m], hmm? Where did I disagree?
11:46 swick[m]: > I could perhaps argue that chromatic adaptation could be still be fitted there
11:46 pq: ...but I won't.
11:46 swick[m]: got it :)
11:47 pq: that would be a play with the meaning of the word "color" used in some of the texts we're looking at
11:47 pq: like, is it a perceptual color or colorimetric color
11:50 swick[m]: especially "any color present in the image signal that is within the mastering color volume is assumed to have been presented as-is on the mastering display during creative approval." would have been much clearer if it said colorimetry
11:51 swick[m]: at a few places they are not clear about this, indeed
11:51 pq: yeah, that
11:52 pq: it could be a "slightly incorrect simplification to help an uneducated reader" like I have a habit of doing, or not
11:53 pq: (e.g. my use of the wording "color of light")
11:54 pq: ehm, s/uneducated/non-expert/ perhaps
14:27 wlb: wayland-protocols Merge request !253 opened by Sebastian Wick (swick) Draft: security-context-v1: Make sandbox engine names use reverse-DNS https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/253
14:33 pq: There is no way to make sure that a shared fd stays O_NONBLOCK, is there?
14:34 emersion: if you can open it twice, there is
14:35 pq: I've no idea where it was opened from.
14:35 pq: nor if I would have access to that path
14:36 emersion: there is the Linux-specific trick of /dev/fd/<n>
14:37 pq: yeah... eh
14:37 emersion: but no portable way
14:38 pq: read()'ing a shared fd has this problem, and mmap()'ing it has the SIGBUS catastrophe. *sigh*
14:39 manmower: heh, can you dup the fd and trust your private copy?
14:39 pq: dup does not make a copy
14:39 manmower: unix was a mistake
14:40 pq: adding more threads could unblock this...
14:41 pq: nnnno-
14:41 pq: oh hey, EINTR is a thing, just schedule continuous SIGALRM
14:42 pq: manmower, see, I'm learning from the best. You.
14:42 manmower: that does have a certain manmower charm to it
14:44 emersion: in wlroots we just have our own SIGBUS logic
14:45 pq: could do that, doesn't make it any prettier
14:45 emersion:remembers about that kernel patch
14:50 pq: wait a minute... if I try to read from a middle of a file with pread(), and I get EAGAIN, how does the kernel know when the fd should poll as readable again?
14:53 pq: maybe the kernel is smart, or maybe I'd just busyloop until the pread proceeds
14:55 manmower: I'm a little curious as to pread() behaviour in the non-EAGAIN case too.
14:56 pq: I'll leave this question to dan, it'll make a nice present when he comes back from holidays.
14:57 pq: which poison to pick
14:57 kennylevinsen: pq: does pread on a seekable file affect readability state in the first place? :S
14:58 manmower: ^ that's my wonder
14:58 pq: kennylevinsen, the thing I want to protect against is flaky network file systems or rotating disk gone to sleep kinda things. I *hope* getting EAGAIN there and then later poll signalling readable.
14:59 pq: but no, I don't know
14:59 pq: but if I mmap, it's guaranteed to block me, right?
15:00 pq: there's no SIGTRYMEMORYACCESSLATERKTHXBYE
15:00 pq: though that too has a "solution"
15:00 pq: moar thread
15:00 pq: s
15:00 pq: ^ example result
15:01 kennylevinsen: Hah
15:02 pq: hmm, or was there some mincore kind of magic to lock stuff into memory...
15:04 pq: madvise, MADV_POPULATE_READ...
15:04 pq: aaargh, SIGBUS on error >_<
15:05 pq: what is it with throwing everything under a SIGBUS
15:08 kennylevinsen: Ah yeah, there we go: > Regular files shall always poll TRUE for reading and writing.
15:09 pq: pfff
15:09 kennylevinsen: so to answer your question: yes, it will poll as readable again :D
15:10 pq: Are we going to need library to hide all the horribleness of accessing shared fds in? Oh, but that won't work because SIGBUS.
15:10 kennylevinsen: we'll make our own kernel! in webassembly! with hoo...
15:11 manmower: sounds like a solid GSoC project
15:11 pq: kennylevinsen, where did you find that note?
15:11 kennylevinsen: I imagine reviving emersion's old thread about new mmap flags might be a good way forward, at least for Linux...
15:11 kennylevinsen: pq: man 3 poll
15:12 pq: oh 3, not 2
15:12 bl4ckb0ne: linux 2 memory boogaloo
15:12 pq: ....maybe Linux is more useful than posix requires?
15:13 kennylevinsen: the manpage reads more like their good intentions than their implementation...
15:14 kennylevinsen: I doubt it - how would nfs know in advance that a future read RPC operation won't stall?
15:14 pq: is someone from the matrix trying to speak again?
15:15 pq: ah, no, I guess
15:15 kennylevinsen: (it was a response to you pq)
15:15 pq: nfs could cache the part of the file that was attempted
15:16 pq: sure, it could be out of date again, but then again
15:19 pq: so the only way things could be async is... threads
15:22 kennylevinsen: io_uring!
15:23 kennylevinsen: but yeah, from a portable perspective... everything blocks I/O for regular files, so a thread is an option
15:23 pq: good note
16:21 emersion:opens social thread about GNOME removing X11 session
16:21 emersion:closes thread
17:03 kennylevinsen: are you saying the thread wasn't... social?
17:06 manmower: he merely said he closed the thread, no other inference should be made. ;)
17:34 wlb: weston Issue #822 opened by Doğukan Korkmaztürk (dkorkmazturk) Closing a Steam client window crashes Weston https://gitlab.freedesktop.org/wayland/weston/-/issues/822
17:58 Riolku: curious, whats blocking ext-session-lock-v1 from becoming stable?
18:09 bl4ckb0ne: isnt it already?
18:17 zzag: bl4ckb0ne: no, it's not in stable/ directory
18:17 bl4ckb0ne: isnt staging the new stable
18:18 kennylevinsen: No, staging is the new "unstable" beacuse the name was confusing people a lot
18:18 zzag: bl4ckb0ne: no, it's considered as a testing ground
18:18 bl4ckb0ne: > gAfter a staging protocol has been sufficiently tested in the wild and proven adequate, its maintainers and the community at large may declare it "stable", meaning it is unexpected to become superseded by a new major version.
18:19 bl4ckb0ne: Riolku: probably time
18:20 kennylevinsen: it does not matter that much to implementers, protocols in staging are safe to implement and we avoid breaking them all the same
18:21 JoshuaAshton: I think the entire split system is just... :/
18:21 zzag:would prefer not to split protocols in stable and staging but it's bring old discussions up.....
18:21 zzag: bringing*
18:21 JoshuaAshton: srry i already did :D
18:22 kennylevinsen: idea: rename stable to something equally vague
18:22 bl4ckb0ne: horsey
18:22 vyivel: not_staging
18:22 kennylevinsen: "staged"
18:23 bl4ckb0ne: stalwart
18:24 zzag: JoshuaAshton: either way, it was discussed, but I don't remember the arguments in favor of still having "stable" protocols
18:24 JoshuaAshton: ancient
18:24 JoshuaAshton: crusty?
18:24 JoshuaAshton: crusty protocols
18:26 bl4ckb0ne: durable
18:27 bl4ckb0ne: or sturdy
18:27 zzag: JoshuaAshton: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/55#note_861701
18:29 JoshuaAshton: I've been making your point about not needing to get everything right from the start for a while
18:30 JoshuaAshton: Really we are in the best situation we have ever been for iterating on this side of the stack and discarding baggage, yet things move significantly slower than they did back on X11 :s
18:33 zzag: I think it's connected to the requirements that have to be met in order for a protocol to get in. A protocol must be agreed upon by some number of communities, but it's **also** has to be implemented by some number of compositors and clients
18:33 zzag: Depending on member priorities that can be challenging
18:33 zzag: On X11, you've got effectively only one server
18:34 zzag: So you don't need to worry about various members prioritizing implementing particular protocol
18:35 JoshuaAshton: I mean you also do not need to worry about that for Wayland. Wayland Protocols is just a repo of some protocol xmls, anyone can implement something in their compositor and have clients use it.
18:36 zzag: Sure, but depending on the protocol namespace, N parties have to implement the protocol so it can land in wayland-protocols
18:36 JoshuaAshton: Nothing technically has to land in wayland-protocols :p
18:37 manmower: oh come on, let's not give up entirely. we could just make everything ext- protocols. ;)
18:39 Riolku: looks like gnome, kde, and weston all dont support ext-session-lock-v1 yet
18:39 wlb: weston Issue #823 opened by Link Mauve (linkmauve) Weston crashes when starting Warcraft III in wine-wayland https://gitlab.freedesktop.org/wayland/weston/-/issues/823 [Input]
18:39 JoshuaAshton: I iterate pretty quickly on SteamOS/Gamescope using private protocols implemented in Gamescope + a Vulkan Layer. It's a pretty nice environment to play with. Stuff there could probably also be ext protocols, but not having to worry about API/ABI between Gamescope<->Layer is nice so I can just chop and change at wll.
18:41 kennylevinsen: Riolku: stable != supported
18:42 Riolku: Do those compositors have their own screen locking protocol? and... why?
18:42 kennylevinsen: The "ext_" namespace is for protocols that aren't necessarily meant to be supported across the entire ecosystem, just ones that are useful to a number of compositors/clients and would be good to not be private.
18:43 kennylevinsen: which is also why it's easier to get an ext_ protocol in than, say, wp_ or xdg_
18:43 Riolku: ah. Compatability would be nice
18:44 kennylevinsen: Riolku: GNOME handles screen locking internally in their shell with some integration with GDM IIRC
18:44 kennylevinsen: no wayland protocols in sight
18:44 Riolku: oh
18:47 vyivel: is there an easier way to run locally built weston than `WESTON_MODULE_MAP=<comically large mapping of at least 4 components> build/compositor/weston"?
19:18 pitust: okay so i'm trying to draw like actual content into my buffer now
19:18 pitust: and my seemingly correct rendering code (and its 2 for loops, you cant really fuck it up that hard) draws completly wrong
19:19 manmower: I guess stride, format, and modifiers are the easy traps to fall into...
19:20 manmower: you're using shm? probably a stride error?
19:20 pitust: wl_shm, yes
19:20 pitust: er, i'm setting my stride to buffer width * 4
19:21 pitust: setting it to one less makes sway really upset and it doesn't draw it anymore
19:22 manmower: width * 4 is pretty normal
19:22 pitust: not a hard error because who would want hard errors in this kind of scenario!
19:22 kennylevinsen: for ARGB8888 that would be correct. You're probably just mathing wrong. Position starts upper left, each line is *stride* long, remember alpha...
19:23 pitust: i'm drawing without alpha, format = wl_shm::format::xrgb8888
19:23 pitust: xrgb8888 is one of the two default ones, so i figured it's a safe bet
19:23 manmower: you're still throwing in a byte for alpha though, right?
19:23 manmower: it's just ignored, but still present
19:24 pitust: yes of course
19:24 pitust: i'm doing ((uint32_t*)buf2.mem)[x + y * maxW] = 0xffffff; to draw pixels
19:24 pitust: buf2.mem is memory_mapped_region + buffer_ofset, maxW is the width of the buffer
20:04 pitust: hmm okay
20:04 pitust: sway seems to have decided to scale my buffer for some reason?
20:05 pitust: okay so i needed to tell the viewporter that it should take [0x0, WxH] as the sourcce
20:06 kennylevinsen: only if your buffer isn't WxH
20:09 pitust: oh well yeah that makes sense
20:10 pitust: i preallocate a bunch of buffers that are really large, and then just use the viewporter to clip off all the stuff i don't need
20:10 kennylevinsen: why? wl_shm_pool lets you make multiple wl_shm from the same array if you for some reason want it to be one big allocation
20:11 kennylevinsen: s/array/anonymous file/
20:11 pitust: i know, but allocating contignous regions from a file is super pain
20:12 pitust: and my ID allocator is also incredibly crap and i'm sorta worried about running out of IDs
20:12 kennylevinsen: maybe fix that first then, pretty core to dealing with the wire protocol
20:13 pitust: well no i mean i can allocate them, i just don't handle freeing them yet
20:13 pitust: i should probably handle that too
20:14 kennylevinsen: sounds like a good idea
20:15 pitust: i can reuse an ID the moment i get a delete_id event from the compositor, right?
20:15 kennylevinsen: yeah, delete_id means the compositor acknowledged the ID as dead
20:16 pitust: cool. so that's implemented now
20:16 kennylevinsen: until then the ID is zombie-fied - not referring to anything, not valid to allocate
20:17 pitust: i guess if the compositor is slow enough at deallocating callbacks i'll just commit lots of ids
20:17 pitust: but thats fine
20:18 kennylevinsen: just remember to service your display connection to pick up the delete_ids, but yeah - allocate away
20:19 pitust: my absolutely incredible design choices have led me to construct a system where the event loop is handled by the wayland mini-library exclusively
20:19 pitust: i mean i read that this was definitely a bad idea for libwayland
20:19 pitust: but nahh
20:19 kennylevinsen: yes that is definitely a bad idea for any client that wishes to do anything *other* than talk to wayland
20:20 kennylevinsen: if you want an event loop in there, make sure it can be sanely driven by a parent event loop from the client
20:20 pitust: yeah i'll probably have to rework that part
20:21 vaxry: there is a typo in the governance.md of w-p in point 2.2 :(
20:22 vaxry: 2.3*. It says "if if" :(
20:24 i509vcb: vaxry: file an MR lol
20:25 vaxry: I find typo mrs low quality, can't someone who's a member just make a commit? lol
20:25 i509vcb: Or make an issue and let a bunch accumulate before someone makes a batch mr?
20:26 vaxry: fair point, I could do that. I'll scrub the MRs and see if any other are hiding
20:26 vaxry: MDs*
20:40 daniels: pq: I assume that question is for sima rather than me … ?
21:06 wlb: wayland-protocols Merge request !254 opened by vaxerski (vaxerski) Fix typos/grammar in README.md and GOVERNANCE.md https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/254
21:26 ojhsdfmne: Hello wayland friends! I am currently trying to implement the wayland protocol, but I am confused about returning errors. The documentation says "Events can be error conditions" "Each interface provides requests, events, and errors (which are really just special events)". But what does that actually mean? what kind of special events? what error conditions? the wl_shm enum says "These errors can be emitted in response to wl_
21:26 ojhsdfmne: [23:24] <ojhsdfmne> shm requests." but how do i emit them? with wl_display::error? That appearently is only for fatal errors though so are all errors considered fatal?
21:28 ifreund: yes, all protocol errors are fatal
21:28 ifreund: (to the client, the server of course keeps running)
21:28 ojhsdfmne: alright. so i have to use wl_display::error?
21:29 ifreund: that is the event to send error codes yes
21:30 i509vcb: I think wl_display::error is where the internal machinery for protocol errors is sent?
21:30 i509vcb: Non-fatal errors you'd just send via a plain ol event on the protocol object that raises the error
21:30 i509vcb: i.e. zwp_linux_dmabuf_params_v1::failed
21:32 ojhsdfmne: but not all interfaces with errors have such an error event. how would i decide what is fatal and what not then? or is the dmabuf extension just an exception?
21:34 i509vcb: for fatal errors use the *_post_error functions
21:34 i509vcb: for falliable errors send an event
21:34 i509vcb: Although if the protocol does not define an event to handle fallible errors then that's a whole other issue
21:35 ojhsdfmne: thats libwayland specific though right? i am writing my implemntation from scratch
21:35 i509vcb: Ah from scratch
21:35 i509vcb: The error in dmabuf is just a regular event
21:35 i509vcb: I'm less sure about the wl_display::error, if you can understand rust maybe look at the wayland-rs implementation?
21:36 ojhsdfmne: hm never used rust. i will try peeking at the scanner for guidance
21:36 ifreund: the description of wl_display.error in the protocol xml explains how it should be used
21:37 ifreund: also, just look at what wayland-scanner generates, it's like 1 line of code
21:38 ifreund: see the wl_shm.error enum for an example of how interfaces define error codes
21:38 ojhsdfmne: i cant find anything generating the *_post_error functions in the scanner
21:39 ojhsdfmne: yeah yeah i get how the errors are defined, just not how they are sent
21:39 ifreund: oh whoops, I forgot wayland-scanner doesn't generate interface-specific types on the server side
21:40 ifreund: it's just wl_resource_post_error()
21:43 ojhsdfmne: alright i think i figured it out. wl_resource_post_error just calls wl_resource_post_event(client->display_resource, WL_DISPLAY_ERROR, resource, code, buffer);
21:43 ojhsdfmne: so yeah it is using wl_display::error
21:45 ojhsdfmne: thank you so much for your help everyone. gn o/
22:09 Riolku: Curious, are some shm formats more efficient than others? Or does it depend solely on what my GPU supports, or something?
22:13 kennylevinsen: Riolku: the compositor isn't passing shm formats to your GPU, it's uploading it to a GPU texture first
22:15 kennylevinsen: Well I guess that copy counts as "passing to the GPU", but not in the efficient zero-copy sense
22:16 kennylevinsen: If you need performance or efficiency on the GPU side, you want dmabufs from a GPU resource (gl, vulkan, vaapi, etc.)
22:36 Riolku: oh, so i pay a copy regardless, interesting
22:37 Riolku: is linux-dmabuf an implementation of dmabufs that avoids a copy?
22:38 Riolku: as in, my buffer would not need any transformation before being sent to the gpu?