Commit graph

9724 commits

Author SHA1 Message Date
Gyeyoung Baek
483a5a73cb clients/ivi-shell-user-interface.c: Add 'command' config
Previously, commands could only be specified by their path,
so it was not possible to pass arguments.
Use the 'command' config first,
and if it is NULL, fall back to the existing 'path' config.

Signed-off-by: Gyeyoung Baek <gyeyoung976@gmail.com>

Co-authored-by: Michael Olbrich <m.olbrich@pengutronix.de>
2024-12-04 12:36:20 +00:00
Michael Olbrich
3866ecc5d3 libweston: fix crash when a client queries a destroyed output
A client can call get_xdg_output() at any time. If the output was destroyed,
then all output resources are orphaned. This includes clearing the user data of
the resource.
This can happen, for example, when a monitor or HDMI switch quickly toggles the
HDMI hotplug pin.

So check if a head is associated with the resource. If not, just create the
resource and then return immediately.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2024-12-04 11:02:36 +00:00
Tomek Bury
67253b30e8 tests: fix test build error on older Linux
The linux/input-even-codes.h was split from linux/input.h but it's still
included from linux/input.h

Signed-off-by: Tomek Bury <tomek.bury@gmail.com>
2024-12-03 21:50:33 +00:00
Derek Foreman
53189ebb89 compositor: re-order paint node placeholder checks
Doing these in the wrong order breaks content protection, and breaks
placing direct-display paint nodes on underlays.

Fixes: 827e2276 ("gl-renderer: Draw holes on primary plane for the view on underlay")
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-12-03 21:33:41 +00:00
Derek Foreman
8dbb3e17d0 drm: Fix underlay test
We need to reset the underlay check inside the view evaluation loop,
otherwise once we need an underlay we'll treat every following view as
needing an underlay.

Fixes: 1065d23406 ("backend-drm: Improve plane assignment for underlay platform")
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-12-03 11:33:05 -06:00
Tomek Bury
b14461b13b gl-renderer: make DMABUF allocator optional
The dmabuf allocator pulls in libgbm which lives inside Mesa and is built
as a non-standalone part Mesa. This makes gl-renderer hard-wired to Mesa.

The allocator is only used by an optional pipewire backend so make
the allocator optional too.

Signed-off-by: Tomek Bury <tomek.bury@gmail.com>
2024-12-03 13:41:50 +00:00
Marius Vlad
bf7b2311e7 gl-renderer: Take direct-display into consideration
The buffer_init function added with commit 83b37c0ac4, "renderers: pull
dmabuf initial setup out of attach", doesn't take into consideration the
the buffer's direct-display property.

Previously, gl_renderer_attach_dmabuf, wasn't being called when dmabuf's
direct-display  was turned on, but with commit 83b37c0ac4 this has been changed.

So with commit 83b37c0ac4, linux_dmabuf_buffer_get_user_data will never
return a valid gb (gl buffer state), causing a crash using
direct-display extension. This adds an explicit check to return early
when this happens.

Fixes: 83b37c0ac4, "renderers: pull dmabuf initial setup out of attach"
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-12-01 23:17:50 +02:00
Marius Vlad
dae61f3321 windowed-output-api.h: Do an explicit cast to avoid C++ build failure
Address the following build issue:

error: invalid conversion from ‘const void*’ to ‘const
weston_windowed_output_api*’ [-fpermissive] return
weston_plugin_api_get(compositor, api_names[type],
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
const void* sizeof(struct weston_windowed_output_api));

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-11-25 11:26:35 +00:00
Marius Vlad
8634c7e349 shared/helpers.h: Migrate helpers.h to libweston
As weston_windowed_output_get_api needs ARRAY_LENGTH() move helpers to a
libweston/ so other users can re-use that instead of re-defining these
all over. Easier for other front-ends to make use of them.

With this change windowed-output-api.h also includes the helpers header.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-11-25 11:26:35 +00:00
Ian Ray
fc278fb3cc shared: fix binding-modifier none
Fix binding-modifier "none" which was defaulting to Super.

Commit [1] introduced the original support for "none" but the logic was
subsequently lost in f7ba35f5.

[1] 553d1248 ("desktop-shell: Allow binding-modifier weston.ini option to be none")

Fixes: #976

Fixes: f7ba35f5 ("kiosk-shell: Enable debug keybindings")
Signed-off-by: Ian Ray <ian.ray@gehealthcare.com>
2024-11-20 22:16:59 +02:00
Tomek Bury
c313543364 tests: fix build warnings when backend-drm is not enabled
Signed-off-by: Tomek Bury <tomek.bury@gmail.com>
2024-11-20 12:10:57 +00:00
Derek Foreman
4f2cc67fde compositor: Prevent startup crash when hdcp mode is set on display
We can startup with the display already in type1 content protection mode.
When this happens, we call weston_output_dirty_paint_nodes() on a display
that hasn't yet been enabled. The paint node list isn't initialized yet,
so we crash.

We don't actually need to touch the paint nodes here anyway, as
weston_output_damage() ensures a repaint if the ourput is enabled, and
weston_output_dirty_paint_nodes() just forces calculation of things
unrelated to protection, and we'll override most of that in
maybe_replace_paint_node() if necessary when we get there.

Just drop the weston_output_dirty_paint_nodes() call to stop the
crash.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-11-20 09:23:08 +00:00
Philipp Zabel
b4386289d6 vnc: Allow neatvnc in version 0.9.0
Neat VNC 0.9.0 is backwards compatible.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2024-11-20 08:54:10 +00:00
Robert Mader
4f4011d79e pixel-formats: Add P030
Which is used on the RPi4/5 by the HEVC HW decoder for 10bit content.

Note that this is not enough to make KMS offloading work as the
decoder uses the BROADCOM_SAND128 modifier which - for now - requires
manual/unusual handling (i.e. this requires going through GL).

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2024-11-11 12:17:36 +01:00
Jonas Ådahl
10ecf60848 xdg-shell: Allow poup grab on non-grabbing popup
Grabbing requires a single chain of grabbing popups, but it doesn't require
grabbing to start with a toplevel, it could just as well start with a
non-grabbing popup.

Avoid seding an error when a client attempts to do this.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2024-11-06 10:43:27 +02:00
Alexey Yerin
d30683341c clients: don't redraw on xdg_toplevel.configure
Signed-off-by: Alexey Yerin <yyp@disroot.org>
Signed-off-by: Kirill Primak <vyivel@eclair.cafe>
2024-11-06 10:12:51 +02:00
Derek Foreman
1ee1b93bac desktop-shell: Don't crash if the output is removed in startup
If the output is destroyed between setting the panel and committing the
panel, or between setting the background and committing the background,
we have a use after free crash.

Handle this by clearing the surface private pointers on output destroy
so we can skip the useless commits.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-11-05 11:29:39 -06:00
Marius Vlad
fe35be5013 gitlab-ci: Bump libdrm to 2.4.118 to add NV{15,20,30} fmts
And add ifndef guards for cases were do have support for it.

While at it I need to change how we build it due to:

'meson.build:21:0: ERROR: Value "false" (of type "string") for combo
option "Enable support for vc4's KMS API." is not one of the choices.
Possible choices are (as string): "enabled", "disabled", "auto".'

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-11-04 16:40:46 +02:00
Leandro Ribeiro
a3fd8f3c97 color-lcms: accept ICC profiles of device class ColorSpace
From "color: update color-management protocol to xx-v4" onwards, we
should accept ICC profiles of device class ColorSpace, as the CM&HDR
protocol says. So do that.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2024-11-04 13:13:22 +00:00
Daniel Stone
8fdc55c03f pixel-formats: Add NV15/20/30 YUV 10bpc formats
NV15/20/30 are a family of 10bpc YUV formats which have 4
horizontally-adjacent samples packed into a 40-bit cluster. The
difference between 15/20/30 is in the subsampling.

No fallbacks are provided, as there is no format pairing which would
allow us to sensibly unpack the clusters.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2024-11-01 15:05:28 +00:00
Derek Foreman
16dc3b2b7f clients/simple-egl: simplify wait for configure loop
Just move the init function outside of the loop and we can drop the
if/continue.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-10-21 10:46:27 +00:00
Marius Vlad
80e47a7161 libweston/desktop: Avoid a potential crash on invalid resource
This checks for a valid resource when getting a xdg_popup. Similar to
the check in get_toplevel.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-10-21 11:14:48 +03:00
Marius Vlad
8b5bb588df libweston/desktop: Don't destroy the xdg_surface
Upon xdg_toplevel::destroy we seem to be calling xdg_surface::destroy
destroy handler. Protocol states that we should umap the surface with
client having the posibility to getting another toplevel role for the
same xdg_surface and re-map the window.

This also adds a guard for an unlikely invalid resource.

Fixes: #774

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-10-21 11:14:46 +03:00
Marius Vlad
a501acd291 libweston/matrix: Fix narrow conversion with C++
Fixes the following C++ narrow conversion:

/include/libweston-14/libweston/matrix.h: In function ‘weston_coord
weston_coord_truncate(weston_coord)’:
/include/libweston-14/libweston/matrix.h:212:39: error: narrowing
conversion of ‘(int)in.weston_coord::x’ from ‘int’ to ‘double’
[-Werror=narrowing] 212 |         return (struct weston_coord){
	(int)in.x, (int)in.y };
      |                                       ^~~~~~~~~
/home/mvlad/install-new/include/libweston-14/libweston/matrix.h:212:50:
error: narrowing conversion of ‘(int)in.weston_coord::y’ from ‘int’ to
‘double’ [-Werror=narrowing] 212 |         return (struct weston_coord){
	(int)in.x, (int)in.y };

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-10-18 20:40:56 +03:00
James Le Cuirot
9a536962a5
tests: Make some tests dependent on the shell-desktop option
The internal-screenshot and text tests are dependent on the feature and
fail with it disabled.

Signed-off-by: James Le Cuirot <chewi@gentoo.org>
2024-10-14 22:47:13 +01:00
James Le Cuirot
486d96a162
tests: Make the kiosk test dependent on the shell-kiosk option
The test is dependent on the feature and fails with it disabled.

Signed-off-by: James Le Cuirot <chewi@gentoo.org>
2024-10-14 22:46:34 +01:00
Marius Vlad
217fb30847 desktop-shell: Don't attempt to re-add the view to panel layer
This change fixes a side-effect of weston_view_move_to_layer helper
which would basically unmap the view because the layer entry list is no
longer visible. Only add the view to panel layer the first time.

Fixes: #956

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-10-11 11:36:03 +03:00
Jeri Li
04f27f1be2 libweston/desktop: avoid weston crash while xdg_surface ack_configure
checks the resource and sends a protocol error if the client tries to
send a request to an inert object then returns out of the request
handler

Signed-off-by: Jeri Li <jeri.li@mediatek.com>
2024-10-11 11:22:21 +03:00
Marius Vlad
68bbc4cf51 libweston: Move weston_get_backend_type after enum declaration
Fix: #951

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-10-10 07:56:59 +00:00
Jan Engelhardt
f86ff8c07d build: insert missing wayland-server-protocol dependency
A new build error sprung up in weston-14 compared to 13.0.0.
Fix it.

FAILED: tests/liblib_lcms_util.a.p/lcms_util.c.o
cc -Itests/liblib_lcms_util.a.p -Itests -I../tests -I. -I.. -Iinclude
-I../include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall
-Winvalid-pch -Wextra -Wpedantic -std=gnu99 -Wmissing-prototypes
-Wno-unused-parameter -Wno-shift-negative-value
-Wno-missing-field-initializers -Wno-pedantic -Wundef
-fvisibility=hidden -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3
-fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables
-fstack-clash-protection -Werror=return-type -flto=auto -g -fPIC -MD
-MQ tests/liblib_lcms_util.a.p/lcms_util.c.o -MF
tests/liblib_lcms_util.a.p/lcms_util.c.o.d -o
tests/liblib_lcms_util.a.p/lcms_util.c.o -c ../tests/lcms_util.c
In file included from ../tests/lcms_util.c:35:
../include/libweston/matrix.h:33:10: fatal error:
wayland-server-protocol.h: No such file or directory

   33 | #include <wayland-server-protocol.h>

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
2024-10-08 19:36:09 +02:00
David Edmundson
fe64eee3ae libweston: Send seat name before announcing devices
Clients need to know the seat name at the time they create mouse and
keyboard objects. This brings Weston in line with other compositors.

The documentation upstream currently is not super clear. It states name
is explicitly sent on bind, capabilities don't mention being sent on
bind in any way.

Signed-off-by: David Edmundson <davidedmundson@kde.org>
2024-09-26 13:28:30 +00:00
EatingSumo
312c8bea66 libweston/screenshooter: Fix build when __builtin_clz is not available
Fix compilation error when `__builtin_clz` is not available by renaming variable 'u' to 'run'

Signed-off-by: Junyu Long <877730493@qq.com>
2024-09-26 13:17:27 +00:00
Derek Foreman
067e977fe1 desktop-shell: Don't try to move parented views on output removal
These should be repositioned relative to their parents, attempting to
move them independently not only doesn't make sense, but violates
weston_coord sanity checks.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-09-18 09:13:19 -05:00
Jan Alexander Steffens (heftig)
0e451e8dc3
libweston/noop-renderer: Check shm_buffer for NULL
Copy the check from the pixman renderer.

Fixes: https://gitlab.freedesktop.org/wayland/weston/-/issues/953
Signed-off-by: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
2024-09-14 06:38:47 +02:00
Derek Foreman
2e51def212 libdisplay-info: Bump wrap version
We need libdisplay-info 0.2.0 for some features, but our wrapper
currently builds 0.1.1, leading to some surprising errors when
trying to use those features.

Bump the wrap version so if we're pulling this in from a wrap
we get the latest features.

We leave the hard dependency alone for now, as it's still not
widely deployed.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-09-13 09:43:04 -05:00
Joan Torres
a266c5fff5 clients: Add color
Add a client that creates a surface with one color using single pixel buffer.

Set to that surface an image_description created with the parametric creator of
the color management protocol.

This client can get as params:
  1. Width and height
  2. Color channels R, G, B, A
  3. The name of primaries
  4. The name of a transfer function
  5. The min, max, ref luminance levels

Signed-off-by: Joan Torres <joan.torres@suse.com>
2024-09-09 13:51:51 +00:00
Joan Torres
53419eb991 clients/window: Allow rendering frame wihout shadow
Rendering the shadow currently renders some dark color near the border inside
the inner content.

Altough the content is on top of it, if the content has some transparency,
that dark color appears and this might be unwanted.

Add an option to not render the shadow to avoid that problem.

Signed-off-by: Joan Torres <joan.torres@suse.com>
2024-09-09 13:51:51 +00:00
Marius Vlad
e026fd6540 meson.build: reopen main for regular development
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-09-04 12:12:34 +03:00
Marius Vlad
60981998b2 build: bump to version 14.0.0 for the official release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-09-04 11:53:50 +03:00
Marius Vlad
186937dc95 build: bump to version 13.0.95 for the RC3 release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-09-02 10:56:26 +03:00
Derek Foreman
50d92f9d6f libweston: Fix crash with mirror-of
Since c4eb15d453 we keep a copy of
native mode parameters, however we forgot to initialize the
native mode parameters in some situations, which breaks the
output mirroring code when it sees uninitialized data.

Fixes c4eb15d453
Fixes #949

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-08-30 08:16:45 -05:00
Marius Vlad
f81c0358c5 build: bump to version 13.0.94 for the RC2 release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-30 09:43:45 +03:00
Marius Vlad
3dc28308e6 libweston/color-management: Add fallback for static_assert
Attempt to fix the following with clang-18:

../weston-9999/libweston/color-management.c:890:2: error: call to
undeclared function 'static_assert'; ISO C99 and later do not support
implicit function declarations [-Wimplicit-function-declaration] 890 |
static_assert(UINT32_MAX <= SIZE_MAX, |         ^

Fixes: #948

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-29 16:20:47 +03:00
Marius Vlad
6bcf9ca6ba build: bump to version 13.0.93 for the RC1 release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-28 10:40:07 +03:00
Marius Vlad
fe2ea233b1 libweston/drm-virtual: Point output base backend the DRM backend
This would allow output_repaint_timer_handler() to find a backend
as well for the DRM virtual outputs created by DRM virtual API and
with it to trigger a repaint for the outputs created by
plug-ins (remoting and pipewre).

Fixes 1f8c49d5bdd20, 'compositor: repaint backends separately'

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Suggested-by: Michael Olbrich <m.olbrich@pengutronix.de>
2024-08-27 17:32:30 +03:00
Marius Vlad
b4726ef024 libweston/drm-virtual: Add prepare_repaint to perform a repaint
With commit a1f8c49d5b, 'compositor: repaint backends
separately' a prepare repaint was introduced. Use it for DRM virtual API
to allow repainting the remoting/pipewire output.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-27 17:19:11 +03:00
Marius Vlad
aa3fe6a27a build: bump to version 13.0.92 for the beta release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-21 12:01:02 +03:00
Derek Foreman
60d777803d drm: Remove unnecessary parameter from drm_output_state_alloc()
We never pass this anything but NULL.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-08-19 10:25:25 -05:00
Marius Vlad
49278973c0 build: bump to version 13.0.91 for the alpha release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-08-14 11:23:07 +03:00
Lukasz Czechowski
2fe23ad389 man: Update documentation of weston-vnc
Document the possibility to enable VNC backend with password-only
authentication.

Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
2024-08-14 07:48:09 +00:00