Commit Graph

27 Commits

Author SHA1 Message Date
Bilal Elmoussaoui
7fafb9f268 cleanup: Prefix & rename create_socketpair 2023-06-23 22:28:34 +02:00
Christian Hergert
43dda37c79 license: update sources to LGPLv2.1+
See merge request !25
2023-06-02 10:18:05 -07:00
Bilal Elmoussaoui
7c67084055 Relicense as LGPLv2.1+ 2023-06-01 12:04:35 +01:00
Bilal Elmoussaoui
6b29de7164 Drop duplicated create_socketpair 2023-05-25 09:59:45 +02:00
Bilal Elmoussaoui
5736f4e19f paintable: Properly close DMABuf FD
As g_unix_fd_list_get will dup the FD, we must close it once we are done
with it.
The issue went unnoticable during my testing as apprently, the max
number of open FDs is not in sync between host & toolbox and that is
annoying podman issue...
2023-05-24 15:17:46 +02:00
Bilal Elmoussaoui
c7772df9aa docs: Document most of the public APIs 2023-05-23 12:34:01 +02:00
Bilal Elmoussaoui
c259212be5 dmabuf: Properly propagate damage area
The current approach makes use of
- A tiled rendering to work around gdk_texture_diff only doing pointer
comparaison
- Assumes that we would only recieve a scanout cmd followed by multiple
flush ones

In reality, with virtio-gpu at least, the scanout cmd is always
submitted followed by a flush one containing the damaged region.

With the assumption currently made, we end up creating a new paintable
for every scanout cmd causing a full redraw instead
of only redrawing the damaged areas.
Isntead we create the paintable once and call import whenever
we receive a flush cmd (UpdateDMABUF) so we can properly
pass the damage area when creating a GdkGLTexture making
the tiled rendering no longer needed.
2023-05-17 13:08:37 -07:00
Christian Hergert
4c7711823a lib: make cairo formats conditional 2023-02-17 16:27:36 -08:00
Christian Hergert
24dafbe067 lib: handle GL textures with y0 at top 2023-02-15 19:40:48 -08:00
Christian Hergert
0a7c1ff21c lib: use mouse-set from peer to update local position
We may need to tweak this for relative mouse positions if we find we dont
get reliable information from the peer. But this is a start, which I see
we get back from Qemu at least when we're in -enable-kvm mode.
2023-02-15 12:16:47 -08:00
Christian Hergert
5c52047800 lib: set cursor from guest provided texture data 2023-02-15 12:02:03 -08:00
Christian Hergert
2286183747 lib: export paintable properties
This is mostly useful so that we can see things within the inspector at
runtime in case we need to debug what backends are used.
2023-02-15 07:01:32 -08:00
Christian Hergert
2e842f7e7f lib: add GdkDmabufPaintable
This just starts on the DMA-BUF code and abstracts MksPaintable so it can
encapsulate both MksDmabufPaintable and MksCairoFramebuffer.

Currently, the dmabuf just tailes everything (fully) but we can fix that
with snapshot work stil. Either way, want to get the abstraction landed
first before we dive deeper into that.
2023-02-14 16:27:09 -08:00
Christian Hergert
ddd6a58adc lib: use g_variant_get_data_as_bytes() to get byte array
We don't want to go through get_bytestring() as this is a bit cleaner as
to ensure we're holding onto references for the rest of the function
lifetime. Otherwise, completing the operation could cause our parameters
to be released (at least theoretically).
2023-02-14 12:24:15 -08:00
Christian Hergert
de3505e864 lib: remove debug code 2023-02-14 12:23:24 -08:00
Christian Hergert
441b7355ef lib: tweak cairo drawing a bit and fix invalidation 2023-02-14 11:59:04 -08:00
Christian Hergert
6beaf8b925 lib: encapsulate GtkPicture within MksDisplay
We don't need to do this manually now that we have GtkPicture working
correctly with content-fit. We still want to maintain our own widget to
manage things like grabs and all that though.
2023-02-14 11:18:48 -08:00
Christian Hergert
01dab99590 lib: add MksCairoFramebuffer
This adds MksCairoFramebuffer which does tessellation to get damage regions
for the framebuffer. Still some bugs involved, but good enough to get some
bits on the screen which is what I'm looking for right now.
2023-02-13 17:38:30 -08:00
Christian Hergert
84d1d827c1 lib: start wiring up framebuffer to paintable
Still things to sort out here, but just wanted to lay some plumbing
between the two objects.
2023-02-12 10:39:14 -08:00
Christian Hergert
2a0f0be8c0 lib: decode pixman_format_t into cairo_format_t 2023-02-11 09:19:29 -08:00
Christian Hergert
204271fafd lib: add pixman format conversion to cairo format 2023-02-10 17:32:09 -08:00
Christian Hergert
35d99a50b1 lib: stub out success for various RPCs 2023-02-10 17:21:33 -08:00
Christian Hergert
56e9997919 lib: connect asynchronously to socketpair peer
Because the other side is doing AUTHENTICATION_SERVER, which really it
has no business doing any flags, we have to connect asynchronously or we'd
block because it doesn't yet have our FD to communicate with.

So connect asynchronously, return our FD, and then process from there.

This is somewhat annoying because it means you can't connect your
object until the otherside already sees our connection. We delay message
processing to help with that though.
2023-02-10 17:13:05 -08:00
Christian Hergert
084edf38eb lib: fix params to socketpair() 2023-02-10 16:29:38 -08:00
Christian Hergert
ed03ea5148 lib: move PaintableListener into MksPaintable
The goal here is to keep the MksPaintableListener inside of MksPaintable
so that we don't have to create API between the two. Additionally, the
MksPaintable can own it's own G-DBus connection as we don't want to share
them for updates with anything else (as they can have large data chunks
coming across).
2023-02-10 16:14:51 -08:00
Christian Hergert
629cfd0e28 lib: add mks_screen_attach()
This is ultimately going to give us back a paintable, but it's only in
partial state right now. We need to figure out the right semantics for
ownership between the listener/paintable/screen/etc.

We may want the widget to be the owner of everything (and keep the
painable/listener internal API) which is likely the most convenient from
an object ownership standpoint.
2023-02-09 17:32:00 -08:00
Christian Hergert
dac3fc284a lib: add MksPaintable
This is intended to be connected to a MksScreen and create a Listener to
get DMA-BUF scanout from Qemu.
2023-02-09 04:38:48 -08:00