Commit Graph

7237 Commits

Author SHA1 Message Date
Daniel Stone 8ca5d73355 drm/state-propose: Reduce variable scope
Reduce the scope of surface_overlap to where it's actually used, which
is only in the per-view loop, where it gets initialised and destroyed
every time.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2020-09-04 11:04:26 +00:00
Daniel Stone b625cdcf20 drm/state-propose: Remove special casing for cursor plane
Previously we assumed that cursor planes occluded nothing and would
always be blended, but overlay and scanout planes would always occlude
what's behind them. This is not actually true, as we can support alpha
blending on any kind of plane type now.

Remove the special case, which might hopefully fix some weird display
issues along the way. (Noticed by inspection.)

Signed-off-by: Daniel Stone <daniels@collabora.com>
2020-09-04 11:04:26 +00:00
Daniel Stone 9217ec9c6c drm/state-propose: Remove unused planes_region member
We used to use planes_region for the output regions which were being
displayed on hardware planes; before we grew zpos awareness, we couldn't
have any planes overlapping with each other, since the ordering would be
undefined.

Since the zpos awareness though, this region is unused, so we can just
remove it.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2020-09-04 11:04:26 +00:00
Michael Olbrich 0e4f097d08 compositor: clip the opaque region with the scissor area
The opaque region is used to determine where the views underneath the current
view must be drawn. If the opaque is not clipped, then the area that is part of
the opaque region but not part of the scissor area is not drawn at all.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2020-09-04 11:01:26 +00:00
Michael Olbrich cb04f9894f compositor: update scissor region before using it
Subsurfaces inherit the scissor region from the parent surface. Currently
the region is updated at the end of weston_view_update_transform(). As a
result, the old region is used to clip the transform.boundingbox of the
subsurface.

Change the order to update the scissor region after the transform.matrix is
updated but before it is used.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2020-09-04 11:01:26 +00:00
Simon Ser bce7450040 releasing: make sure to add release artifacts to wayland.fdo
I forget those too often.

Signed-off-by: Simon Ser <contact@emersion.fr>
2020-09-04 10:46:03 +00:00
James Hilliard 80b585f8d2 pipewire: add support for 0.3 API
Fixes: #369

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
2020-09-04 10:39:15 +00:00
Marius Vlad c4076ef88a plug-ins: Migrate pipewire and remoting plug-ins headers to public header
directory

Weston is also a user of the plug-ins, so make use of it. With this
change we unconditionally install the plug-in headers even though
libweston might not be built with support for them.

Suggested-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2020-09-04 10:36:48 +00:00
Simon Ser a5570695c5
build: re-open master for regular development 2020-09-04 12:32:26 +02:00
Simon Ser 04d3ae265d
build: bump to version 9.0.0 for the official release 2020-09-04 12:20:00 +02:00
Simon Ser 13f501c51b
build: bump to version 8.0.93 for the RC1 release 2020-08-27 22:58:53 +02:00
Marius Vlad 380ceee6a1 remoting, pipewire: Install pipewire and remoting plug-ins headers
Required for other users of libweston.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2020-08-27 14:32:26 +03:00
Marius Vlad e0b937af28 remoting: Add DPMS support in remoting pluging
Just like pipewire, add DPMS support in remoting plug-in. Mechanical
change mimicking a24a326bb1.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2020-08-27 14:14:27 +03:00
Leandro Ribeiro 2ac73a8b53 exposay: delete outer padding from struct exposay_output
After some changes in the exposay layout, the outer padding makes
no sense anymore. It was used to avoid the panel to get overlapped
by the exposay surfaces and to keep distance from the borders
of the window.

Currently, the exposay is centralized and the panel cannot get
overlapped. The outer padding just creates unnecessary unused
space, what makes exposay's surfaces smaller.

Delete outer padding from struct exposay_output.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-08-26 14:10:50 +00:00
Leandro Ribeiro 82b4d42943 exposay: centralize surfaces of the last row when we don't have enough surfaces
The exposay grid is square, but we don't always have enough surfaces
to fill all the columns of the last row. The code to centralize
the surfaces of the last row is not working.

Fix the code that centralizes the surfaces in the last row, making
it more visually pleasant.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-08-26 14:10:50 +00:00
Leandro Ribeiro 55b4b47ec1 exposay: centralize exposay's surfaces in their own square
Commit "exposay: add margins to centralize exposay" has centralized
the whole exposay, but that's not enough. The internal surfaces of
exposay are not centralized.

Each internal surface of exposay is a square, but most of the windows
are rectangular. Add margin to centralize exposay's surfaces in their
own square.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-08-26 14:10:50 +00:00
Leandro Ribeiro 048c628139 exposay: add margins to centralize exposay
The exposay is being rendered in the top-left corner of the
screen. Add margins to render it in the center, making it
more visually pleasant.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-08-26 14:10:50 +00:00
Leandro Ribeiro 33e29d88cc exposay: make inner border dependent of exposay's surfaces size
We've been using an inner border of fixed size (80px), but this
is dangerous. If you have too many open applications or a small
window, the surface size computed will be negative, crashing
the exposay: "error: weston_view transformation not invertible".

Also, it creates a lot of unnecessary space, making the exposay
unusable when we have a small window or many applications open.

Make inner border to be 10% of surface size and surface size to
be 90% of its original size, avoiding the crashes and making it
more visually pleasant.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-08-26 14:10:50 +00:00
Leandro Ribeiro b68454e893 exposay: do not account panel size to compute exposay area
Commit "desktop-shell: make get_output_work_area() global" allowed
the usage of get_output_work_area() in exposay. This is necessary to
avoid overlapping the panel when rendering exposay's surfaces.

Use get_output_work_area() to not take into account the panel size,
instead of considering that the whole screen is available to
render exposay's surfaces.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-08-26 14:10:50 +00:00
Leandro Ribeiro 0c59e92f0c desktop-shell: make get_output_work_area() global
get_output_work_area() can be used by exposay to know the free space
where it can render its surfaces, what avoids overlapping the panel.

Currently this function is declared as static in
desktop-shell/shell.c, so it cannot be used by exposay.

Remove static from get_output_work_area() and add it to shell.h
so it can be used by exposay as well.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-08-26 14:10:50 +00:00
Leandro Ribeiro fd874ff533 exposay: move constant value calculation out of loop
In exposay_layout(), int pad is being calculated within the
loop. This is unnecessary, as its value is constant. Move it
out of the loop.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-08-26 14:10:50 +00:00
Marius Vlad 67b382ccdc compositor: Avoid using weston_log() in weston_view_is_opaque()
As from commit b7e5f10bf4, weston_view_is_opaque() is called from
debug_scene_graph_cb(), which on its own represents a (different)
scope. By default, we already have a subscriber for the 'log' scope,
which will cause a harmless, yet spurious, message.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2020-08-24 14:19:02 +03:00
Michael Olbrich a24a326bb1 pipewire: implement DPMS
Pipewire doesn't need to wait for any hardware. The finish_frame() callback is
just artifically delayed to generate the desired framerate.

So when the DPMS level changes, we can just call finish_frame() immediately if
necessary and cancel the timer.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2020-08-19 08:50:45 +02:00
Michael Olbrich d70e712c2f drm: always check the repaint_status in update_complete
Initially finish_frame() was never called in drm_output_update_complete() for
'dpms_off_pending = true'. This is wrong for repaint_status ==
REPAINT_AWAITING_COMPLETION and that was fixed in
68d49d772c ("compositor-drm: run finish_frame when
dpms is turned off in update_complete").
However finish_frame() may now be called for repaint_status !=
REPAINT_AWAITING_COMPLETION, which is not allowed and results in a failed
assertion.

Fix this by checking dpms and repaint_status unconditionally.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2020-08-19 07:35:14 +02:00
Marius Vlad 5130a8c21a backend-drm: Correctly tear down the DRM backend
It seem that we skipped to put back in TEXT mode the tty, in case a DRM
device node wasn't present at that time, or it isn't present at all. This
orders the destroy part correctly as to handle that case as well.

As a side effect, as the tty will still be set to GRAPHICS mode we will
require a manual change of the tty number, which might be not possible
on all systems. Properly putting back the tty to TEXT mode should avoid
that, and allows to re-use the same tty no in case the DRM device has
been created at a later point in time.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2020-08-18 12:59:50 +03:00
Andreas Heynig 2592d6591e libweston/launcher-direct.c: do not fail if already in graphics mode
In case of a crash tty remains in graphic mode. This change allows to restart weston without
taking care of the actual tty mode.

Signed-off-by: ahe <Andreas.Heynig@meetwise.com>
2020-08-17 11:59:39 +00:00
Stefan Agner 465ab2cd92 backend-drm: allow to disable GBM modifiers
Allow to disable GBM modifiers at runtime using the environment variable
WESTON_DISABLE_GBM_MODIFIERS.

This can be useful for debugging or when modifiers cause issues, e.g. in
case modifiers use higher memory bandwidth and hence impose a lower
resolution limit as it is the case with Intel Kaby Lake graphics.

Related to: https://gitlab.freedesktop.org/wayland/weston/-/issues/404
Signed-off-by: Stefan Agner <stefan@agner.ch>
2020-08-17 10:17:30 +00:00
Michael Olbrich 43ebb7e25a backend-drm: the GL renderer is a hard requirement for DRM virtual outputs
Building fails without it. So don't just warn about it but fail immediately.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2020-08-17 10:12:54 +00:00
Michael Olbrich 27fb564a19 backend-drm: build DRM virtual support when the pipewire plugin is enabled
The pipewire plugin uses this API as well, not just the remoting plugin. So
enable it if either is enabled.

And disable pipewire in the no-gl-renderer CI build. The virtual outputs don't
work without it.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2020-08-17 10:12:54 +00:00
Rajendraprasad K J 4a378afa3b ivi-shell: Avoid unnecessary scaling of the view transformation matrix
The opaque region of a weston view is updated only if the alpha value is 1
and the transform matrix is of type WESTON_MATRIX_TRANSFORM_TRANSLATE.

While using ivi-shell, opaque region is never updated, as we are performing
scaling operations to the view transform matrix, even when the scaling
factor is 1 and thereby changing the type to WESTON_MATRIX_TRANSFORM_SCALE.

Perform scaling of the view transformation matrix only when the scaling
factor is non-zero.

Signed-off-by: Rajendraprasad K J <KarammelJayakumar.Rajendraprasad@in.bosch.com>
2020-08-17 09:58:23 +00:00
Michael Olbrich 3097acc702 backend-drm: reorder plane checks to avoid unnecessary rendering
If a surface is not visible, then is does not matter if the view is on multiple
outputs. It will be skipped anyways when the output is rendered.

So check first if the surface is acually visible on the output before doing any
checks that might force rendering. This avoids unnecessary rendering.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2020-08-17 09:53:38 +00:00
Alexandros Frantzis 53a71cb186 drm: Reset associated universal plane states when finalizing a crtc
When dissociating a universal plane from a crtc, we currently don't
reset the current state of the plane (plane->state_cur). When attempting
to use this plane in the future, we can run into invalid memory accesses
due to left over associations with potentially freed drm backend
objects. This commit resets the state of the scanout and cursor
universal planes associated with a crtc.

The following scenario exhibits the problem:

1. Start a (fullscreen) client that is suitable for and assigned to
   the scanout plane. The plane's state_cur->output value is set.
2. Unplug the monitor: the scanout plane is "released" but still
   maintains the state_cur->output association.
3. Replug the monitor: the plane is deemed unavailable due to an
   existing, albeit invalid, state_cur->output value. Note the memory
   errors trying to access the drm_output which was freed at step (2).

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2020-08-17 09:44:45 +00:00
Alexandros Frantzis 9975134593 drm: Introduce drm_plane_reset_state() helper function
Introduce a helper function to reset the current state of a drm_plane.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2020-08-17 09:44:45 +00:00
Olivier Fourdan 85382d394a clients: deprecate weston-info
weston-info is now deprecated in favor of wayland-info which is part of
wayland-utils.

Add a note to weston-info to inform users that weston-info is deprecated
and will be removed soon.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2020-08-14 10:31:49 +00:00
ganjing c1e7151eb6 desktop-shell: check memory allocation in switcher_binding
after calling malloc() , be sure to determine whether the allocating for memory space is successful

Signed-off-by: ganjing <ganjing@uniontech.com>
2020-08-14 02:00:25 +00:00
Simon Ser 06d51cc4cb
build: bump to version 8.0.92 for the beta release 2020-08-13 21:09:40 +02:00
Michael Olbrich ad41ad968a gl-renderer: remove incorrect assertion
The refcount is not zero if the corresponding buffer is attached to multiple
surfaces.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2020-08-13 18:50:57 +00:00
Michael Olbrich c5ea495f7a compositor: ignore views on other outputs during compositor_accumulate_damage()
compositor_accumulate_damage() is called for each output during repaint.
The DRM backend will only set keep_buffer for the surfaces that are visible on
the current output. So a buffer_ref is released that may still be needed. When
the output that shows the surface is repainted, the buffer_ref is gone and the
surface cannot be put on a plane.

Ignore all surfaces that are not visible on the current output to avoid this.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2020-08-12 11:03:43 +00:00
Michael Olbrich b7e5f10bf4 compositor: use weston_view_is_opaque() to check for opacity in debug_scene_view_print()
Currently the debug output for 'drm-backend' can be confusing. In the output of
debug_scene_view_print() views may be listed as 'not opaque' but later, during
plane assignment, other views underneath such a view is reported as 'occluded on
our output'.
This happens because weston_view_is_opaque() has some extra checks to determine
if a view is fully opaque, such as 'is_opaque' provided by the renderer for
formats that have no alpha channel.

Use weston_view_is_opaque() in debug_scene_view_print() as well to get more
accurate results.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2020-08-11 16:41:14 +02:00
Michael Olbrich 3ac911f69b drm: remove duplicate function declarations
These functions are all declared twice in the same file. Remove on of the two
declarations.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2020-08-06 10:22:18 +02:00
Simon Ser 905ddbb3b0
build: bump to version 9.0.91 for the alpha release 2020-07-30 22:56:04 +02:00
Alexandros Frantzis 87c1679a0a kiosk-shell: Introduce kiosk/fullscreen shell for desktop apps
kiosk-shell is fullscreen shell for apps that use the xdg-shell
protocol. The goal is to make life easier for people shipping embedded
devices with simple fullscreen shell requirements, and reduce the
proliferation of desktop-shell hacks.

Top level surfaces are made fullscreen, whereas dialogs are placed on
top in the center of the output and retain their natural sizes. Dialogs
can be moved and (un)maximized, but resizing is currently not supported.

An app can be directed to a particular output by populating the
"app-ids" field with the app's XDG app id, in the relevant
"[output]" section in the weston config file.

Fixes: #277

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2020-07-30 14:38:49 +00:00
Leandro Ribeiro ea4d13b3e3 drm-backend: remove log that advertises universal planes support
There's a log that advertises support for universal planes. That
can make users think there's something wrong with Weston or their
systems when universal planes are not supported, but that's not
the case. Remove this log from the code.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2020-07-28 11:13:53 -03:00
Kirill Chibisov c46c70dac8 libweston: Send wl_keyboard.modifiers after wl_keyboard.enter
The core Wayland protocol explicitly states that wl_keyboard.modifiers
must be send after wl_keyboard.enter.

This commit also changes the behavior of `seat_get_keyboard` to not
send `wl_keyboard.modifiers` in case where seat had pointer focus,
but not keyboard one.

Signed-off-by: Kirill Chibisov <contact@kchibisov.com>
2020-07-09 17:47:11 +03:00
Jimmy Ohn f7f8f5f1a8 xwayland/window-manager: add a NULL check to fail when frame_create fails
This adds a NULL check to fail when frame_create fails. This can happen
crash in frame_resize_inside function if frame is NULL.
2020-07-01 19:16:13 +09:00
Jimmy Ohn e55c86a167 screen-share: don't get weston_config object before zalloc
we don't need to get the weston_config object before zalloc success.
2020-07-01 18:58:38 +09:00
Leandro Ribeiro a12ba0b30a gitlab CI: add support for DRM-backend tests
In order to run DRM-backend tests, a DRM-device is needed. As we
do not necessarily have control of the hardware that is going to
run our tests in GitLab CI, DRM-backend tests were being skipped.
This patch add support to run the tests using VKMS (virtual KMS).
To achieve this, virtualization is needed, as we need to run a
custom kernel during the CI job. We've decided to go with virtme,
as it is simpler to setup and works good for our use case.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2020-06-25 10:17:31 +00:00
Leandro Ribeiro 887a7e5717 launcher: do not touch VT/tty while using non-default seat
Launcher-direct does not allow us to run using a different
seat from the default seat0. This happens because VTs are
only exposed to the default seat, and users that are on
non-default seat should not touch VTs.

Add check in launcher-direct to skip VT/tty management if user
is running on a non-default seat.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2020-06-25 10:17:31 +00:00
Frank Binns 77d06f7b8b shared: fix unused variable warning
Fix the following build warning by moving the 'seals' declaration inside the
HAVE_MEMFD_CREATE guard:

  ../shared/os-compatibility.c: In function ‘os_ro_anonymous_file_get_fd’:
  ../shared/os-compatibility.c:341:6: warning: unused variable ‘seals’ [-Wunused-variable]
    int seals, fd;
        ^

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
2020-06-24 11:11:31 +01:00
Marius Vlad 6ebda36a3f desktop-shell: Avoid retrieving output's width/height if none present
As in some circumstances there could be no output connected, avoid
retrieving the width/height of the output if none was found/connected.

Fixes: #384

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2020-06-23 10:36:47 +00:00