Commit graph

8499 commits

Author SHA1 Message Date
Derek Foreman 0e71aff8ea libweston: Make weston_head_set_device_changed public
Some backends have special head specific state that doesn't fit into the
existing generic head setter functions, and is too specific to make more
functions for.

RDP's primary output flag is an example.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-01-10 12:12:49 +00:00
Derek Foreman f5e9904d4a libweston: Update view transform in seat_get_pointer
This triggers my new favourite assert sometimes when making RDP
connections, so just update the transform here.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-01-10 12:12:49 +00:00
Pekka Paalanen 409993639e backend-drm: reset CRTC_VRR_ENABLED
Libweston has no support for VRR yet, so make sure it cannot be on by
accident.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2023-01-10 11:28:27 +00:00
Pekka Paalanen e0d267fb12 backend-drm: reset CRTC_CTM
We are assuming that CRTC_CTM is pass-through, so better ensure it
really is pass-through rather than whatever the previous KMS client left
there.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2023-01-10 11:28:27 +00:00
Pekka Paalanen d1ca5f71ee backend-drm: reset CRTC_DEGAMMA_LUT
We are assuming that CRTC_DEGAMMA_LUT is pass-through, so better ensure
it really is pass-through rather than whatever the previous KMS client
left there.

This too falls under deprecated_gamma_is_set check, because the legacy
gamma could use either GAMMA or DEGAMMA.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2023-01-10 11:28:27 +00:00
Pekka Paalanen 1acf69ac2f backend-drm: reset gamma on legacy KMS
We are assuming that gamma LUT is pass-through, so better ensure it
really is pass-through rather than whatever the previous KMS client left
there.

Unfortunately the legacy ioctl does not offer any way to reset the LUT
without actually crafting an identity LUT.

If the legacy gamma libdrm function indicates the feature is not
supported, do not try to use it again. This avoids hammering the legacy
gamma every frame when deprecated drm_output_set_gamma() is not used.

drm_output_set_gamma() is not updated to check/set this flag in order to
maintain its old behavior.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2023-01-10 11:28:27 +00:00
Pekka Paalanen debfeb3049 backend-drm: reset CRTC_GAMMA_LUT
We are assuming that CRTC_GAMMA_LUT is pass-through, so better ensure it
really is pass-through rather than whatever the previous KMS client left
there.

Unfortunately, we have old drm_output_set_gamma() API that cms-static
and cms-colord plugins are using. To avoid trampling over them, do not
touch gamma after they did. Those plugins are deprecated, so there is no
reason to make set_gamma work through atomic.

drm_output_set_gamma() is called from weston_compositor_add_output()
through the output_created_signal. This is after drm_output_enable() and
before any KMS modeset or atomic commit on the CRTC. Therefore it is not
possible that there would be any KMS action in flight when
drm_output_set_gamma() is called, and so setting deprecated_gamma_is_set
should be non-racy - like setting CRTC_GAMMA_LUT itself.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2023-01-10 11:28:27 +00:00
Pekka Paalanen dbce396c7c backend-drm: move *_add_prop() debug earlier
Move the debug printing before the bail-out if the property does not
exist. This means that trying to set a missing property will be logged,
and it can be identified by the property id being 0.

We are starting to program more KMS properties, and if KMS state
building fails, this gives better chances to figure out what happened.
For example, if we accidentally assume that some property always exists
when it doesn't.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2023-01-10 11:28:27 +00:00
Thomas Weißschuh ec27b2a1d3 tests: add TAP version line
Otherwise new versions of "meson test" will report a warning about every test.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2023-01-10 11:23:11 +00:00
Daniel Stone 75b3ecfcc3 frontend: Add common --renderer=foo argument
Rather than reinventing --use-pixman and --use-gl throughout each
backend, just have a common --renderer=foo argument which can be used to
explicitly specify the renderer.

The old arguments are still handled for backwards compatibility.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-01-10 10:59:04 +02:00
Daniel Stone 54356be853 backend-vnc: Add renderer parameter to backend config
Add an explicit request to the backend config to choose the renderer.
Currently, only Pixman remains supported, with auto defaulting to that.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-01-10 10:59:04 +02:00
Daniel Stone 6a45ae871c backend-rdp: Add renderer parameter to backend config
Add an explicit request to the backend config to choose the renderer.
Currently, only Pixman remains supported, with auto defaulting to that.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-01-10 10:59:04 +02:00
Daniel Stone 53a32e7888 backend-x11: Use renderer enum type for config selection
When we're selecting our renderer, use the enum rather than a boolean to
force Pixman on.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-01-10 10:59:04 +02:00
Daniel Stone 0a5bb7acff backend-wayland: Use renderer enum type for config selection
When we're selecting our renderer, use the enum rather than a boolean to
force Pixman on.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-01-10 10:59:04 +02:00
Daniel Stone b846c26d97 backend-headless: Use renderer enum type for config selection
When we're selecting our renderer, use the enum rather than two
mutually-exclusive booleans to not use the no-op renderer.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-01-10 10:59:04 +02:00
Daniel Stone c683ebdea3 backend-drm: Use renderer enum type for config selection
When we're selecting our renderer, use the enum rather than a boolean to
force Pixman on.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-01-10 10:59:04 +02:00
Daniel Stone e1da6c6615 libweston: Add WESTON_RENDERER_AUTO type
Add an 'auto' or unspecified renderer type, so we can use enum
weston_renderer_type during the configuration stage, where the target
renderer may be unspecified or unknown.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-01-10 10:59:04 +02:00
Daniel Stone ca4bdae05f libweston: Expose weston_renderer_type as ABI
Similar to the backend type, also expose the renderer type enum as ABI.
This makes it possible to implement a more consistent config API, as
opposed to every backend hand-rolling its own use-the-other-one bool.

The enums are explicitly numbered to avoid 0, so 0 can be used as a
'not-specified' sentinel value to allow backwards compatibility with the
old config interfaces.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-01-10 10:59:04 +02:00
Daniel Stone 59968f7d78 frontend: Use enums for backend type, not strings
Convert our backend type to an enum early, and use it in place of a
string.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-01-10 10:59:04 +02:00
Daniel Stone ef87ad2237 build: Add unreachable()
unreachable() is used to hint to the compiler that a certain branch
cannot ever be reached. The implementation is taken from Mesa.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-01-10 10:59:04 +02:00
Daniel Stone 35f04139c8 man: Reformat shell section, add kiosk-shell
Reformat the shell section of the manpage to be more similar to the backend
section.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-01-10 10:53:02 +02:00
Daniel Stone 2c3693bf2e frontend: Use short-form names for shell argument
Instead of passing --shell=foo-shell.so, just pass --shell=foo, whilst
accepting the old form for compatibility.

Whilst we're at it, document the --shell argument in the manpage and
README.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-01-10 10:53:02 +02:00
Derek Foreman e7251a759b xwm: Preserve unmaximized window size at map time
This fixes a problem that can be seen with Firefox running under xwayland.
- Start it (or another client that remembers its size and maximized state),
- resize it
- maximize it
- exit it
- restart it
- unmaximize it

The size will be changed to a default size and not the previous unmaximized
size.

To fix this, save the unmaximized height and width like we do for the
fullscreen case.

Co-authored-by: Steve Pronovost <spronovo@microsoft.com>
Co-authored-by: Brenton DeGeer <brdegeer@microsoft.com>
Signed-off-by: Hideyuki Nagase <hideyukn@microsoft.com>
Signed-off-by: Steve Pronovost <spronovo@microsoft.com>
Signed-off-by: Brenton DeGeer <brdegeer@microsoft.com>
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-01-09 22:16:29 +00:00
Marius Vlad eeef6be8e2 doc/sphinx: Include weston-config and shell-utils in docs
libweston contains weston_config and weston_shell_utils utilities
functions so include these in the sphinx documentation as well.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2023-01-09 22:13:07 +00:00
Marius Vlad 6293ab1f90 libweston, shared: Move out weston_shell_get_binding_modifier
This doesn't really belong into shell-utils,  so better move it out to
shared/config-parser. Renamed to weston_config_get_binding_modifier
to maintain the same namespace.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2023-01-09 22:13:07 +00:00
Marius Vlad 58c3e263a0 shell-utils: Add missing macros and C++ compat/install header
Allow C++ access from within C code and add macros to avoid
multiple inclusion of the header. Also, install the header for other
users of libweston to actually make use of it.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2023-01-09 22:13:07 +00:00
Marius Vlad 19d32da742 shell-utils: Integrate shell-utils into libweston
These shell utils functions are potentially useful to other shells as
well, so make them widely available.

Renamed all functions to weston_shell_utils namespace.

No functional change, copied ad litteram.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2023-01-09 22:13:07 +00:00
Derek Foreman 68cad4db42 drm: Use cached matrix in drm_paint_node_transform_supported
We've passed the paint node deeply enough that we can now use the cached
matrix in it to save some calculations.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-01-09 21:58:19 +00:00
Derek Foreman 05eee6eaef drm: Pass paint node to drm_view_transform_supported
Rename it as well.

By passing the paint node we'll have access to the cached buffer to output
matrix later.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-01-09 21:58:19 +00:00
Derek Foreman 2a1a8994c4 drm: Cache buffer to output matrix in paint node
We use this a few times for plane tests, so we can cache it here to avoid
recalculating it.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-01-09 21:58:19 +00:00
Derek Foreman 7c7489fe79 drm: Pass paint node to drm_plane_state_coords_for_view
Rename the function as well, as it no longer takes a view.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-01-09 21:58:19 +00:00
Derek Foreman a65ba82232 drm: Pass paint node to drm_output_try_view_on_plane
Rename the function as it no longer tests views, but paint nodes.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-01-09 21:58:19 +00:00
Derek Foreman 263e78d0fc drm: Pass paint node to cursor view prep function
Rename this as well, since it no longer takes a view.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-01-09 21:58:19 +00:00
Derek Foreman 567ed2706a drm: pass paint node to drm_fb_get_from_view
This is a preamble to saving a bit of matrix maths.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-01-09 21:58:19 +00:00
Marius Vlad 0b9620b83e fullscreen-shell: Trigger output repaints
This fixes up fullscreen-shell as with commit 'libweston: Update view
transforms more often' we no longer trigger output repaints making the
RPD backend (mostly) unsable.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2023-01-09 14:33:40 +02:00
Daniel Stone 50809097a8 man: Rewrite Xwayland section
Try to make it more useful and accessible to users. And capitalise it
correctly.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-01-03 11:12:03 +02:00
Daniel Stone a14fa9071c man: Make --config vs. --no-config more explicit
Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-01-03 11:12:03 +02:00
Daniel Stone 5ffda17e21 man: Alphabetise weston command-line options
Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-01-03 11:12:03 +02:00
Daniel Stone 515708040a README: Reorder sections, rewrite intro + libweston
Reorder the sections into what people care about: what is it, how do I
build it, how do I run it, where are the docs for when I want to do
more?

The libweston section has been substantially rewritten to trim the
details down to what is accurate and relevant, and the introduction has
accordingly been updated to reflect the reality of Weston as a project
today.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-01-03 11:12:03 +02:00
Daniel Stone 6c3eb6b17e README: Make doc section more useful
Not only are Sphinx and Breathe clearly not placeholders by this point,
but no-one really cares about the development history, just what it
means to them, i.e. how to use it.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-01-03 11:12:03 +02:00
Daniel Stone 1a94c4a3cb README: Delete misleading API-versioning section
All of this sounded nice, but none of this was true.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-01-03 11:12:03 +02:00
Daniel Stone f825def623 README: Delete packager-guidance section
To the extent that it's accurate, it's already obvious. Packagers have
figured out how to package it anyway.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-01-03 11:12:03 +02:00
Daniel Stone e716d8550b README: Fix wayland-protocols URL
It's on GitLab now.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-01-03 11:12:03 +02:00
Daniel Stone 0278383e38 README: Delete reference to GNOME and KDE
No need to itemise every environment around; it's common enough these
days that people can work it out.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-01-03 11:12:03 +02:00
Daniel Stone 651df5b587 man: Update ancient URLs
We don't use Bugzilla, and we also have TLS on our site.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-01-03 11:12:03 +02:00
Andrei Makeev 5b7561b25d compositor: don't pass the signal flags to autolaunched process
Signed-off-by: Andrei Makeev <amaksoft@gmail.com>
2022-12-30 14:06:22 +00:00
Marius Vlad ab1a3c8164 libweston/input: update view transforms when handling touch_down
Another leftover from d611ab24 "libweston: Update view transforms more
often".

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2022-12-30 14:02:59 +00:00
Daniel Stone 03dd560d45 tests: Don't leak single-pixel-buffer factory object
Signed-off-by: Daniel Stone <daniels@collabora.com>
2022-12-29 17:41:24 +00:00
Daniel Stone 5a26809560 tests: Store output description into correct field
We were storing the output description into the name field, which was
harmless but did cause a leak.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2022-12-29 17:41:24 +00:00
Leandro Ribeiro 04cc477afa libweston/input: update view transforms when handling confined pointer motion
When the pointer is confined and we are handling motion, we need
up-to-date view transforms in order to respect the confinement. So
update view transforms in such case.

This fixes an issue in which we'd try to transform views with dirty
transforms in weston_pointer_clamp_event_to_region(), hitting an assert.

This is a leftover of d611ab24 "libweston: Update view transforms more
often".

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2022-12-19 17:05:37 -03:00