Commit Graph

8334 Commits

Author SHA1 Message Date
Derek Foreman 2ca2eac39a libweston: Split notify_pointer focus into notify/clear
This lets us say what we really mean instead of passing a NULL output
and garbage co-ordinates.

This will help later when manufacturing garbage coordinates becomes much
harder to do.

The clear_pointer_focus() path continues to do nothing, and is just a FIXME
macro, as it has been for a very long time...

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2022-10-25 15:58:24 -05:00
Michael Olbrich bdc39b5909 ivi-layout: fix rectangle calculation by calc_inverse_matrix_transform()
It's ok if the rectangle is too large: If the calculation fails, the
bounding rectangle is used anyways. However, a rectangle that is too small
will create incorrect results. So make sure to round all edges outwards.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2022-10-24 17:37:05 +03:00
Alexandros Frantzis 723709aa07 kiosk-shell: Don't use a modifier for surface activation bindings
The mouse button and touch bindings to activate a surface shouldn't
use the binding modifier.

Fixes: https://gitlab.freedesktop.org/wayland/weston/-/issues/679

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2022-10-21 15:19:18 +03:00
Michael Tretter c56e69bc85 ivi-shell: fix free in get_layers_under_surface
If a controller requests the layers under a surface that has no views attached,
Weston crashes since it tries to free the array that would be used to return the
found layers, but has not been allocated before.

Free the ppArray only if it was allocated in ivi_layout_get_layers_under_surface
before and no layers were found.

While at it, make it obvious that checking the length is an integer comparison
by comparing it to 0.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
2022-10-19 14:16:06 +02:00
Philipp Zabel 2f0be4b4d0 backend-vnc: use configured keymap
Use the keymap rules/model/layout configured in the weston.ini [keyboard]
section.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2022-10-18 16:06:13 +02:00
Philipp Zabel 5cd87ff801 backend-vnc: implement direct key code handling
Allow clients that support the QEMU Extended Key Event Message to send
keycodes directly.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2022-10-18 16:06:13 +02:00
Philipp Zabel ad936f1de8 man: add a man page for the VNC backend
Add a new weston-vnc man page, based on the weston-rdp man page.
Also add links in the main weston man page.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2022-10-18 07:31:42 +02:00
Stefan Agner 12f7665310 backend-vnc: add VNC support using Neat VNC library
This adds basic VNC protocol support using the Neat VNC library
(https://github.com/any1/neatvnc). Neat VNC depends on the AML main
loop library. The backend makes use of AML's integrated epoll backend
and connects AML via file descriptor with the Wayland event loop.

This implementation does not support authentication and hardcodes the
pixel format currently.

Co-authored-by: Philipp Zabel <p.zabel@pengutronix.de>
Co-authored-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
Signed-off-by: Stefan Agner <stefan@agner.ch>
[r.czerwinski@pengutronix.de:
 - use new (as of 0.5.0) Neat VNC buffer API, with a buffer pool]
Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de>
[p.zabel@pengutronix.de:
 - transform repaint damage to output coordinates
 - transform pointer coordinates into global space
 - check that outputs and heads are in fact ours, see aab722bb1785..060ef82d9360
 - track damage across multiple frame buffers
 - choose pixel format by drm_fourcc, see 8b6c3fe0ad
 - enable ctrl and alt modifiers
 - fix frame timing to achieve a constant repaint rate
 - pass initial size explicitly, see f4559b0760
 - use resize_output with pixman-renderer, see 55d08f9634e8..84b5d0eb4bee
 - allow configuring the refresh rate]
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2022-10-18 07:31:42 +02:00
Philipp Zabel 9e5922744d ci: Build and install aml and neatvnc
Since aml and neatvnc are not packaged yet, build them from source and
install them into the container image, to prepare for building the VNC
backend.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
2022-10-14 20:36:49 +02:00
Pekka Paalanen 60c47701c3 Revert "CI: work around Gitlab Cobertura parsing quirk"
This reverts commit f6ff85b1b7.

This hack should not be needed anymore for Gitlab at freedesktop.org.

Mainly I worry that it might throw pycobertura off track in a
future patch.

See also: https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/1027

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-10-12 14:45:35 +03:00
Alexandros Frantzis 341d09d232 kiosk-shell: Update view transform after activation.
The activation of a view implies, among other things, a change in the
associated view layer which is initially unset. In order for this change
to be reflected in the corresponding surface's output mask, and hence
allow surface damage to trigger output repaints, we need to update the
view transform.

Fixes #674

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2022-10-11 14:04:42 +03:00
Simon Ser 722f211518 build: deprecate launcher-logind
Deprecate launcher-logind and disable it by default.

launcher-libseat supports logind, so this shouldn't cause any
regression.

Signed-off-by: Simon Ser <contact@emersion.fr>
References: https://gitlab.freedesktop.org/wayland/weston/-/issues/488
2022-10-10 13:58:09 +02:00
Robert Mader ff459f0273 simple-egl: Add option for fixed width/height fullscreen ratio
As a realistic scenario used by clients.

The motivation is to have an easy way to test correct fullscreen
behavior of compositors, as they have to compensate for the smaller
buffer size by adding black bars.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2022-10-05 15:42:35 +03:00
Paul Kocialkowski 0afd3428dc screenshooter: Add SHM buffer destroy listener to avoid invalid memcpy
This adds a destroy listener on the SHM buffer provided by our client.
It will unregister the frame notify listener in case our buffer is
destroyed before the frame signal is emitted and thus avoid a memcpy
to invalid memory.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
2022-10-03 16:52:16 +02:00
Tomohito Esaki 036a76e3eb hmi-controller: don't add surface to layer in mode_random_replace()
There is no need to call layer_add_surface() in mode_random_replace()
because the surface has already been added to the layer. Rather, calling
layer_add_surface() has the issue that the child surface is displayed
below the parent surface.

Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
2022-09-29 11:08:55 +09:00
Tomohito Esaki 9cdb7c7450 ivi-shell: activate keyboard focus for xdg-shell surface
Activate keyboard focus for surfaces created with xdg-shell protocol. If
the surface has child surface, the child surface is activated instead of
the parent surface.

Fixes: #630

Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
2022-09-29 11:08:55 +09:00
Vitaly Prosyak 52e6052f32 tests/color-icc-output: replace dump file name
Not a functional change. The replacement of const
dump file to use suffix of appropriate sub tests
(sRGB->sRGB, sRGB->adobeRGB, etc).

Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
2022-09-28 10:28:28 +00:00
Vitaly Prosyak 6678f8150c color-lcms: add support for matrices
This patch adds the essential LittleCMS color pipeline optimizations and
analysis that is necessary for extracting matrices from pipelines
correctly. When we can extract a matrix and 1D curve sets, we can use
those with GL-renderer without needing an inherently heavy and imprecise
3D LUT. This should improve color transformation precision and
performance when a 3D LUT is not necessary.

The core of the optimization and analysis is a custom plugin for
LittleCMS. The optimization step comprises of repeatedly merging
sequential matrices and sequential curve sets into one and eliminating
identity elements which may allow for more merging. The analysis step
takes the optimized LittleCMS pipeline and attempts to fit all of its
elements into the weston_color_transform model. If it fits, we have an
optimized color transformation and do not need a 3D LUT. If it does not
fit, we use a 3D LUT as before.

Co-authored-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-09-28 10:28:28 +00:00
Pekka Paalanen 1874f4db92 color-lcms: add cmlcms_category_name()
This will be used by debug logging and error reporting.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-09-28 10:28:28 +00:00
Vitaly Prosyak f3277a4fa5 color-lcms: drop locals in cmlcms_color_transform_create()
Restructing cmlcms_color_transform_create for readibility.

Also dropped zalloc() check in favor of xzalloc() as per the recent
Weston development policy.

Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
Co-authored-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-09-28 10:28:28 +00:00
Pekka Paalanen 40e06794ad color-lcms: restructure xform_set_cmap_3dlut()
Right now this function only creates a CMM pipeline and produces a 3D
LUT from it, but in the future it can produce other types of
transformations. The function is renamed to xform_realize_chain()
because it creates a chain of profiles, forms a multi-profile-transform
from them, and fits that into weston_color_transform.

The further refactoring supports the future changes, and attempts to
make the code more readable.

There is provision for easily adding more profiles into the chain.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-09-28 10:28:28 +00:00
Pekka Paalanen 711b27797d color-lcms: relax cmlcms_fill_in_output_inv_eotf_vcgt()
Relax the types of color transformations categories where this function
can be used. Yes, it is only useful for BLEND_TO_OUTPUT, but that is for
the user of this function to take care of. This function always works as
named regardless. The only condition is that output_inv_eotf_vcgt has
been populated, so fill_in_curves() may as well assert that.

While at it, make the code a little more concise. The 'len' assertion
belongs in fill_in_curves() because that is where the problem would
appear if the assertion failed.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-09-28 10:28:28 +00:00
Vitaly Prosyak 06d89fe192 color-lcms: rename cmslcms_fill_in_pre_curve
Rename cmslcms_fill_in_pre_curve to cmlcms_fill_in_output_inv_eotf_vcgt
due to importance what the function is fetching:
profile->output_inv_eotf_vcgt.

Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
2022-09-28 10:28:28 +00:00
Vitaly Prosyak 003252a5bb color-lcms: rename output_eotf to eotf
Eotf is the transfer function whose inverse must be used for
converting from output light-linear space to sink electrical space.

Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
2022-09-28 10:28:28 +00:00
Vitaly Prosyak cd888bde6f gl-renderer: add matrix
Add matrix in color.h
Matrix is used as an optimized method for
color mapping vs 3DLUT.
Nothing sets color mapping to matrix yet.

Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
2022-09-28 10:28:28 +00:00
Vitaly Prosyak 96f0fc3974 gl-renderer: add post-curve set to identity
Add post-curve support in color.h.
Pre-curve and post-curve describe color pipeline components
in a single GL shader invocation.The GL shader is supposed
to match struct weston_color_transform exactly.
We have the following color pipeline:
shader A -> blending -> shader B -> KMS. Both A and B shaders
using the same source file :fragment.glsl.
Each shader has pre and post curve.

The typical color pipeline with 3DLUT:
Shader A: pre-curve identity->3DLUT->blending->post-curve identity
Shader B: pre-curve->3DLUT identity->post-curve identity->KMS

The typical color pipeline with matrix (in next commits):
Shader A: pre-curve->matrix->blending->post-curve identity
Shader B: pre-curve->matrix identity->post-curve identity->KMS
The pre-curve plays role of EOTF (shader A) or INV_EOTF
(shader B) becouse we are stiching the shaders.

We assume that someone in the future may use both pre-curve
and post-curve, for example, when it is not possible to combine
these curves into 3DLUT and we will do mapping elements based on
their location in ICC profile.

Signed-off-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
2022-09-28 10:28:28 +00:00
Derek Foreman 118ee6674b screen-share: split up damage tracking variables
This is all a little confusing, so let's split up the variables and throw
around some comments that better explain what's going on.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2022-09-28 09:14:19 +00:00
Derek Foreman 40804adbe1 screen-share: Fix first buffer damage
Our shared buffer isn't actually in output co-ordinates, so
initializing with the output's width/height isn't correct.

While we're here, remove the misleading comment. In a future
patch I'll try to document this code more accurately.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2022-09-28 09:14:19 +00:00
Derek Foreman d68ee26ff5 screen-share: Copy the damage region instead of intersecting it
The region has already been intersected with the output's region before
it was passed to us.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2022-09-28 09:14:19 +00:00
Michael Olbrich 631b60b38b backend-wayland: always propagate touch frame event
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2022-09-24 13:54:57 +02:00
Michael Olbrich 5448580111 input: send touch frame event after up event
Currently the frame event gets lost: The touch focus is removed in the 'up'
event. So the focus is gone when the frame event arrives so it is never sent to
the clients.

To avoid this, keep the touch focus until the frame is handled.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2022-09-24 13:54:57 +02:00
Pekka Paalanen db47898ff8 gl-renderer: replace remaining current_mode and borders[]
Replace all the remaining weston_output::current_mode and borders[] uses
with the fb_size and the compositing area. The result is the same, but
we stop depending on weston_output, and border texture sizes which may
not be the same as border sizes.

This is more correct, semantically.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-09-23 15:48:51 +03:00
Pekka Paalanen 02879a93d7 gl-renderer: use fb_size/area in egl_y_invert
Do not use border texture size when we have the area stored. This
decouples border texture size further.

We also have buffer_height available directly from fb_size, so do not
reverse-engineer it.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-09-23 15:48:51 +03:00
Pekka Paalanen 39a9b654b9 gl-renderer: use a loop in output_get_border_damage()
Pure refactoring to make the code easier to read.

Also drop the redundant all-clean check.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-09-23 15:48:51 +03:00
Pekka Paalanen 326a762e25 gl-renderer: use a loop in draw_output_borders()
Pure refactoring to make the code easier to read.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-09-23 15:48:51 +03:00
Pekka Paalanen 5b82324b79 gl-renderer: stop using texture sizes for border area
Compute the border area from the framebuffer size and composited area
only.

Now the border textures can be freely sized while they will be stretched
to fill the respective border areas. In fact, this was already made use
of by having left/right image height=1 as special cases. Now all the
texture dimensions behave the same.

No change in behavior, the values are the same, just computed
differently.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-09-23 15:48:51 +03:00
Pekka Paalanen fccb21f17e gl-renderer: refactor into output_get_border_area()
This moves the identical code from draw_output_borders() and
output_get_border_damage() into a new shared function. Reduces code
duplication.

This is a pure refactoring, all the computations stay the same.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-09-23 15:48:39 +03:00
Pekka Paalanen 7e49d1ada1 gl-renderer: use fb_size and area for border
This step prepares to share the coordinate computations between
draw_output_borders() and output_get_border_damage(). The use of
weston_output is replaced with gl_output_state, so that when sharing the
code in a new function, it does not need a weston_output.

This stops the function from accessing output->current_mode and use the
gl-renderer tracked frambuffer size and compositing area instead. Not
using current_mode is a small step towards allowing gl-renderer to
render for other targets than an output.

No behavioral changes, all the values are still the same.

See the diagram in gl-renderer.h for the border areas.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-09-23 15:47:00 +03:00
Pekka Paalanen 8c4f75f0ea backend-x11: use resize_output with GL-renderer
We get rid of unnecessary GL-renderer output state destroy and create,
meaning we don't destroy and create an EGLSurface either.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-09-23 12:42:05 +00:00
Pekka Paalanen a989d12c04 gl-renderer: implement shadow resizing
This is necessary if you want to resize an output that uses a shadow
framebuffer, instead of destroying and re-creating the renderer state.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-09-23 12:42:05 +00:00
Pekka Paalanen 7886cbe4b9 gl-renderer: pass initial output area explicitly
This changes the GL-renderer interface to pass the initial framebuffer
size and compositing area explicitly. All backends are changed to
provide the correct parameters.

GL-renderer mostly does not yet use these values, but later patches
will. The pbuffer path uses it already, because they replaced the
existing fields.

All this is to make GL-renderer aware of the different sizes, so it can
implement the future revision of the screenshooting API.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-09-23 12:42:05 +00:00
Pekka Paalanen 84b5d0eb4b backend-x11: use resize_output with pixman-renderer
Now that resize_output() exists and is implemented for Pixman-renderer,
use it.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-09-23 12:42:05 +00:00
Pekka Paalanen e78e0cf53d backend-rdp: use resize_output with pixman-renderer
This is a slightly better way of keeping pixman-renderer aware of the
target size.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-09-23 12:42:05 +00:00
Pekka Paalanen 55d08f9634 pixman-renderer: track framebuffer size explicitly
This will make sure that backends do not forget to tell us about
resizes.

composite_*() functions still read the size from the destination buffer,
because pixman_output_state is not available there.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-09-23 12:42:05 +00:00
Pekka Paalanen f4559b0760 pixman-renderer: pass initial size explicitly
In a journey to decouple renderer from weston_output, pass the initial
framebuffer size to Pixman-renderer explicitly.

Now Pixman-renderer will never look into weston_output::current_mode.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-09-23 12:42:05 +00:00
Pekka Paalanen deff50963e pixman-renderer: implement shadow resize
This is necessary if you want to resize a Pixman rendered output that
uses the shadow.

Also reset the current hw_buffer to NULL, because surely it needs to
change and we don't want to keep an old buffer live for no reason if
there happens to be one.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-09-23 12:42:05 +00:00
Pekka Paalanen 8636422309 libweston: add weston_renderer::resize_output()
Previously renderers were not told when the output (framebuffer they
need to draw) size changed. Renderers just pulled that information out
from weston_output::current_mode when they happened to need it. This
makes some things awkward, like resizing the shadow or intermediate
buffers. In fact, Pixman-renderer does not even support resizing its
shadow buffer, nor does GL-renderer. DRM-backend has to destroy and
re-create the renderer output state anyway, but rdp, x11 and wayland
backends would be natural users of resizing API.

This commit adds an API for resizing with empty implementations. Actual
implementations will be added in following patches for each renderer
while moving parts of resizing code from backends into the renderers.
No-op renderer needs no implementation.

Only wayland-backend has actual resizing code already, and that is made
to call the new API. Unfortunately, Pixman and GL renderers differ: one
does not blit them while the other does. In order to assert the
functionality of each renderer to keep the API consistent,
wayland-backend needs to lie to pixman-renderer. That's not new, it
already does so in wayland_output_get_shm_buffer() where the 'pm_image'
addresses only the interior area instead of the whole buffer.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2022-09-23 12:42:05 +00:00
Colin Kinloch c67b064e62 meson.build: Add devenv for running from the build directory
Signed-off-by: Colin Kinloch <colin.kinloch@collabora.com>
2022-09-23 12:28:13 +00:00
Derek Foreman cb5872f0a6 screen-share: Use weston_output_contains_point
Let's not open code this here anymore.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2022-09-23 12:08:34 +00:00
Derek Foreman bb8ef7d271 libweston: Refactor point in output test
This is arguably a little nicer without calling the pixman functions
directly.

In the future when we have different datatypes for coordinates in different
spaces, this test will only be valid on global coordinates, so this change
is also a precursor to stronger type validation.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2022-09-23 12:08:34 +00:00