The return values for most of the API functions will be removed and replaced by
asserts. So checking return values will no longer work and passing invalid
arguments will trigger asserts. Modify and remove the tests accordingly.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
There are V4L2 devices that will output NV12 but will do so using one dma
buffer. To support this, we need to add the same dma buffer twice but with
a different offset for the chrominance plane.
Also supports situations of 3 planes (e.g. YU12) inside a single dma buffer.
Fixes: #712
Signed-off-by: Bram Stolk (b.stolk@gmail.com)
Add documentation for the PipeWire backend.
Co-authored-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Add a separate PipeWire backend based on the PipeWire plugin. The backend
requires PipeWire 0.3.x.
The PipeWire backend can be used as a standalone-backend backend for streaming
and composing Wayland clients to PipeWire.
The backend supports the on-demand creation of heads via the
weston_pipewire_output_api_v1. It also supports per-output pixel format
configuration via a gbm-format option.
Multiple PipeWire outputs can be created by setting the num-outputs option in
the [pipewire] section.
Co-authored-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Currently, if a head is detached, the entire state of the device is invalidated
to make sure that the connector is disabled on the next atomic commit. Side
effect of the invalid state is that all planes are disabled on the next commit.
This includes planes that are used with a different head that is not part of the
next atomic commit. Disabling the planes of unrelated outputs causes a blanking
of these outputs until output is repainted and the plane is reenabled.
Store the detached heads in a list on the output and disable the connectors for
all heads in this list in the next atomic commit.
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Pass the VNC backend to vnc_head_create().
That way the already known backend will not have to be found from the
compositor. This is trivial now, but in the multi-backend case would
entail iterating over all backends to find the correct one.
Also remove the now unused to_vnc_backend() helper.
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Pass the RDP backend to rdp_head_create().
That way the already known backend will not have to be found from the
compositor. This is trivial now, but in the multi-backend case would
entail iterating over all backends to find the correct one.
Also remove the now unused to_rdp_backend() helper.
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Pass the backend instead of the compositor to the windowed output API
create_head() method and increment the API version.
That way the backend will not have to find the backend pointer from the
compositor. This is trivial now, but in the multi-backend case would
entail iterating over all backends to find the correct one.
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
The output move listener removal was incomplete. Remove the remaining
bits to fix a segfault on shutdown.
Fixes: 40f5eaf401 ("backend-vnc: use output power_state to disable repainting while disconnected")
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
I tried this, and it causes a crash. Leave a note for the future when we
happen to use some other backend with xwayland and find a "leak".
The reason this is a comment and not a Gitlab issue is that you probably
would not go looking for a Gitlab issue saying an idea is a bad one.
This comment is more likely to be found.
It's not really a leak either, it only needs to be fixed if you want a
clean ASan leak report.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This was not found in the test suite, but if you run wayland-backend
manually with ASan, you see the same leaks as in
backend-headless: fully release pango and fontconfig
Fix them the same way.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
With weston_output_power_on/off() we can use power_state to disable
repainting completely while no VNC client is connected. This allows
to remove the initial repaint and per-output damage tracking.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
And use it to exit with using the KEY_ESC, similar to simple-egl.
This was ripped from simple-egl ad litteram.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Rather than having them as an array. This would simplify handling of
maximized and fullscreen and make things easier to reason with.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Move our DRM test fixture setup later, where we already have a bunch of
per-backend splits, so we can choose to skip our tests at the right
time.
Doing this allows us to skip DRM tests with no memory leaks.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Now that we have color profile, transformation and optimizer debug
scopes, make use them in this test.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Whenever a color transformation is being created, this debug scope
prints its pipeline before and after being optimized. It should be used
with the color-lcms-transformations scope.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
It prints the existent color profiles for new subscribers. Also prints
any creation/destruction of color profiles.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
It prints the existent color transformations for new subscribers. Also
prints any creation/destruction of color transformations.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
We have a string describing the ICC profile. cmsGetProfileVersion()
returns a float value, and we are converting that to string with "%f"
and saving to this description. Instead, use "%.1f" to restrict it to a
single decimal value, which is enough. With this change we have e.g.
"version 4.4" instead of "version 4.4000000".
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
LCMS API cmsStageAllocToneCurves uses cmsDupToneCurve which internally
re-allocates a new table of points. As a result, we have to free the old
table returned from lcmsJoinToneCurve.
Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
We were declaring that the binding handler took an enum in the
declaration (good!), but then using a uint in the definition (oops).
cf. wayland/weston!1205
Signed-off-by: Daniel Stone <daniels@collabora.com>
Upon connector reconnect/disconnect we seem to ignore any kind of window
state we might have previously to disconnect so this takes that into
account and avoids a change in the state in case we detect one set-up
previously.
Fixes: #731
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
wl_array_for_each() returns a pointer to each storage location; as we're
storing a pointer to drm_fb, this means that we have a drm_fb **, not a
drm_fb *.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Rather than setting the initial power state when adding
it (using weston_compositor_add_output), do that at the initilization
stage.
Reason being that the compositor can set up the output from the start as
FORCED_OFF, before enabling the output, rather than enabling the output
and then turning off the power of the output.
Signed-off-by: marius vlad <marius.vlad@collabora.com>
Rather than damaging the output before the output has been added with
weston_compositor_add_output, do that afterwards as to avoid scheduling
a repaint for that output *before* actually adding the output.
This would avoid the awkward case where we attempt to set initial power
state to normal, but we can't apply it at that stage.
Signed-off-by: marius vlad <marius.vlad@collabora.com>
For some reason we'd managed to have a mismatching header prototype and
implementation. Fix this up to consistently use enums everywhere.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Output repaint uses a pair of fence syncs to profile GPU execution by
retrieving their timestamps once signalled. While the end timestamp
can be rather inaccurate in some cases (drivers reusing sync objects
from previous command buffers), the begin timestamp is never correct
because fence syncs are signalled on command buffer completion.
Get rid of the begin fence sync and use the EXT_disjoint_timer_query
extension to measure the actual repaint duration and extrapolate the
begin timestamp from the end one.
Fixes#342
Signed-off-by: Loïc Molinari <loic.molinari@gmail.com>
Note that this application does not follow best practices for handling tablet
events. The events are grouped by frame, all processing should be done in the
frame instead of the respective handler.
A good toolkit would accumulate the data in the events and provide them as one
event to the actual client once the frame is received. toytoolkit just hooks
up the handler one-by-one, so we're doing this here as well.
Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Lyude Paul <thatslyude@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Bastian Farkas <bfarkas@de.adit-jv.com>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Based on patches from:
Peter Hutterer <peter.hutterer@who-t.net>
Lyude Paul <thatslyude@gmail.com>
Bastian Farkas <bfarkas@de.adit-jv.com>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Lyude Paul <thatslyude@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Bastian Farkas <bfarkas@de.adit-jv.com>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
When it comes to a window frame, a tablet tool and cursor act almost
identical; they click things, drag things, etc. The tool type and extra
axes don't serve any use in the context of a window frame, so tablet
pointers share the frame_pointer structures used for the mouse pointer.
Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Lyude Paul <thatslyude@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Bastian Farkas <bfarkas@de.adit-jv.com>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Again, a lot of this is code that has been reused from the cursor code
for pointers.
Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Lyude Paul <thatslyude@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Bastian Farkas <bfarkas@de.adit-jv.com>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Based on a patch from:
Peter Hutterer <peter.hutterer@who-t.net>
Lyude Paul <thatslyude@gmail.com>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
The tablet is given a separate cursor. Most tablet interaction is an absolute
interaction and shouldn't need a cursor at all, but usually the cursor is used
to indicate the type of virtual tool currently assigned.
Based on patches from
Peter Hutterer <peter.hutterer@who-t.net>
Lyude Paul <thatslyude@gmail.com>
Bastian Farkas <bfarkas@de.adit-jv.com>
Maniraj Devadoss <Maniraj.Devadoss@in.bosch.com>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Based on a patches from
Peter Hutterer <peter.hutterer@who-t.net>
Lyude Paul <thatslyude@gmail.com>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Based on a patch from
Peter Hutterer <peter.hutterer@who-t.net>
Lyude Paul <thatslyude@gmail.com>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Closely modelled after the pointer focus handling
Co-authored-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Lyude Paul <thatslyude@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Bastian Farkas <bfarkas@de.adit-jv.com>
Based on a patch from
Peter Hutterer <peter.hutterer@who-t.net>
Lyude Paul <thatslyude@gmail.com>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Introduces three new structs, weston_tablet and weston_tablet_tool for the
respective devices, with the respective information as it's used on the protocol.
And weston_tablet_tool_id to track the tools of a tablet.
Note that tools are independent of tablets, many tools can be used across
multiple tablets.
The nesting on the protocol level requires a global tablet manager, a tablet
seat nested into weston_seat. The list of tablets and tools are also part of
the weston_seat.
Most functions are stubs except for the actual tablet and tablet tool
creation and removal.
This is based on patches from Peter Hutterer <peter.hutterer@who-t.net> and
Bastian Farkas <bfarkas@de.adit-jv.com>.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
We have an optimization to skip composition if there's no damage on the
primary plane and we already have a renderer buffer active. But we don't
allow this optimization if there's a pending capture task for the
output. For the renderer-based sources, that is really necessary, but
for the writeback source we should allow this optimization.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>