qyliss changed the topic of #spectrum to: A compartmentalized operating system | https://spectrum-os.org/ | Logs: https://logs.spectrum-os.org/spectrum/
saji has joined #spectrum
sudo has quit [Ping timeout: 265 seconds]
<qyliss> Back to crosvm today
<qyliss> If it doesn't use WAYLAND_DISPLAY, how does sommelier's client connect to sommelier?
<leah2> inbox nntpd at spectrum-os.org down?
<qyliss> oh no
<qyliss> possibly
<qyliss> leah2: that better?
<leah2> gnus approves!
<qyliss> yay
<qyliss> Something weird is going on with my certificate permissions
<qyliss> Think a couple of services might be fighting over the
<qyliss> *them
<leah2> does it have starttls?
<qyliss> Err
<qyliss> I don't recall
<qyliss> But it does have TLS
<qyliss> I think it should also have STARTTLS
<puck> qyliss: WAYLAND_SOCKET
<puck> aka pass in a file descriptor, i think
<qyliss> ahh
<qyliss> that's cool
<qyliss> puck: while I have your attention, do you know what the "version" mentioned here is? https://chromium.googlesource.com/chromiumos/platform2/+/master/vm_tools/sommelier/sommelier-display.c#28
<puck> yes
<puck> so. in wayland, every protocol has a "version". and with each version you get new features etc
<qyliss> Right
<puck> the registry is the one hard-coded resource etc, which you use to bind to any other "globals". this checks that the global that sommelier implements is equal or newer than the version that the client requests
<puck> e.g. one may ask for the `xdg_wm_base' interface, which is currently v2
<puck> so if a client were to ask for v3, sommelier will just exit, because it doesn't know what v3 changed
<qyliss> Rigght
<puck> (note that a proper client wouldn't ever do this, since it gets to know which globals are available)
<qyliss> sway does it
<puck> wha
<qyliss> I was trying to run sway in sommelier
<puck> do you know what it's trying to bind to?
<qyliss> Let me do some printf debugging and find out
<puck> (run sway with WAYLAND_DEBUG=client)
<qyliss> oh cool
<puck> that will log all messages sent to and received from sommelier
<qyliss> If I'm reading this right, it's wl_output v3
<puck> hrmm
<puck> that seems wrong
<puck> what's your list of bind()s?
<qyliss> let me send the logs
<puck> (wl_output v3 was committed 4 years ago)
<puck> what is even going on during boot
<qyliss> it's booting two VMs at once
<qyliss> interleaved into the same stream
<qyliss> because I'm still using the demo of inter-VM networking
<puck> 2020-01-15 17:39:16 - [backend/wayland/backend.c:66] Remote wayland global: wl_compositor v3
<puck> [805695.006] -> wl_registry@2.bind(3, "wl_compositor", 4, new id [unknown]@3)
<puck> that's the issue there
<puck> it's trying to bind to wl_compositor v4, but v3 is the only available on.e
<puck> i think this is from ~a year ago, not sure why.
<qyliss> Sommelier seems to be quite far behind
<qyliss> Remember xdg_shell?
<puck> yeah, i guess
<puck> wl_compositor (and wl_surface) v4 are from 4yrs ago too
<qyliss> Is it likely to be similarly straightforward to update? Could I just do it?
<puck> errrr, unsure. i think (but don't quote me on this) it might be easier to downgrade the version of wl_compositor that wlroots expects
<qyliss> hmmm
<qyliss> or use an old sway
<puck> dang, this is false
<qyliss> but that's not really sustainable
<puck> also, running sway *inside* sommelier is a weird choice
<puck> since it'll just output into a single window?
<qyliss> That's what I want
<puck> mmm
<qyliss> For debugging, you understand
<puck> okay, so implementing a fallback damage_buffer is probably trivial, lemme see
<qyliss> I would like to have VM sway inside by host sway
<puck> so for making a faux-implementation, you could look at https://gitlab.freedesktop.org/wayland/wayland/commit/3384f69ecf043d62a4e036c0353c2daa01d7c4d0 and look at sommelier.c around line 1529, and then line 1737 for where the implementation would have to go
<puck> i believe it'd be trivial to "faux-implement" it by e.g. just damaging the entire surface
<puck> then update the wl_compositor interface to v4
<qyliss> hmmmmmm
<qyliss> okay
tilpner has quit [Quit: tilpner]
tilpner has joined #spectrum
tazjin has quit [Ping timeout: 272 seconds]
feepo has quit [Ping timeout: 252 seconds]
manveru has quit [Ping timeout: 264 seconds]
tazjin has joined #spectrum
feepo has joined #spectrum
manveru has joined #spectrum
<puck> this probably exists because they have to compile with v4 in the headers but found no reason to implement it
<qyliss> puck: I'm not really sure what I'm supposed to be looking for in sommelier.c?
<qyliss> I think I understand the Wayland commit message
<qyliss> But I don't see what that has to do with those two line numbers you said?
<puck> err, there's a secondary assert(0) somewhere in a same damage_buffer impl i think
<puck> wait, or
<puck> yeah, old version nvm
manveru has quit [Ping timeout: 272 seconds]
<qyliss> puck: so, wouldn't implementing damage be as simple as
<qyliss> wl_surface_damage_buffer(wl_resource_get_user_data(resource)->proxy, x, y, width, height);
<qyliss> in that function that currently asserts 0?
<puck> err, not quite, i'd believe
<qyliss> why not?
<puck> because damaging the buffer means having to side-effect the backing surface (that sommelier keeps separate) too
<puck> see sl_host_surface_damage
<qyliss> ah..
<puck> this shouldn't be too hard
<qyliss> wait what's the difference between damage and damage_buffer?
<puck> damage uses surface coordinates, damage_buffer uses buffer coordinates
<qyliss> I see
<puck> basically, in wayland, you register a "buffer", then create surfaces out of parts of that buffer
<puck> the cheapest way to implement this is to just damage the entire surface for now, i think
<qyliss> So wl_surface_damage_buffer(wl_resource_get_user_data(resource)->proxy, 0, 0, INT32_MAX, INT32_MAX); ?
<qyliss> (Or the same with wl_surface_damage?)
<puck> the same as wl_surface_damage does, but i'm not entirely sure how buffer->damage ends up getting used
<puck> ah, copies stuff when committing
<qyliss> You mean sl_host_surface_damage?
<puck> yeah
<puck> i think you probably want to end up calling wl_surface_damage with the full surface size.. not 100% certain on this
<qyliss> Just pushed a change that means we don't have to build half of Chromium OS any more just to get Sommelier
<qyliss> Which is nice
<qyliss> No weird dependencies on two different modemmanagers, etc.
<Shell> woo!