platform/upstream/weston.git
6 years agodesktop-shell: extract view_get_transform, make it reliable
Greg V [Tue, 24 Jul 2018 20:21:55 +0000 (23:21 +0300)]
desktop-shell: extract view_get_transform, make it reliable

Avoid crashes related to get_shell_surface returning NULL.

Surfaces are already allowed to be neither focus nor shell in
e.g. focus_state_surface_destroy.

6 years agoclients: A better fix for a crash when unlocking or unconfining a pointer
Dima Ryazanov [Thu, 15 Nov 2018 06:17:42 +0000 (22:17 -0800)]
clients: A better fix for a crash when unlocking or unconfining a pointer

This is a rewrite of the fix in:
https://lists.freedesktop.org/archives/wayland-devel/2018-May/038140.html

It addresses Pekka's concerns about window getting destroyed before the
unlock/unconfine event is triggered.

Signed-off-by: Dima Ryazanov <dima@gmail.com>
6 years agoclients: Delete an unused variable
Dima Ryazanov [Thu, 15 Nov 2018 05:15:16 +0000 (21:15 -0800)]
clients: Delete an unused variable

Signed-off-by: Dima Ryazanov <dima@gmail.com>
6 years agoRevert "Fix a crash when unlocking or unconfining a pointer"
Dima Ryazanov [Thu, 15 Nov 2018 05:03:35 +0000 (21:03 -0800)]
Revert "Fix a crash when unlocking or unconfining a pointer"

This reverts commit e0dc5d47cb5f29deec495efd958fcd5f6f833389.

Signed-off-by: Dima Ryazanov <dima@gmail.com>
6 years agocompositor-drm: Don't set linear modifier when not supported
Scott Anderson [Mon, 28 Jan 2019 02:40:55 +0000 (15:40 +1300)]
compositor-drm: Don't set linear modifier when not supported

This will cause gbm_surface_create_with_modifiers to fail on drivers
where modifiers are not yet supported (e.g. amdgpu). We need to make
sure we only end up using gbm_surface_create in this case.

This fixes the remoting plugin on these drivers.

Signed-off-by: Scott Anderson <scott.anderson@collabora.com>
6 years agocompositor-drm: Add an environmental variable to force RENDER-only mode of compositing
Marius Vlad [Fri, 25 Jan 2019 10:56:24 +0000 (12:56 +0200)]
compositor-drm: Add an environmental variable to force RENDER-only mode of compositing

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
6 years agocompositor-drm: Forgot to use mode variable when using render only mode of composition
Marius Vlad [Fri, 21 Dec 2018 10:48:22 +0000 (12:48 +0200)]
compositor-drm: Forgot to use mode variable when using render only mode of composition

In patch 5d767416c1847 we simplified a bit the way in which the
compositing mode was being printed with the purpose to improve
weston-debug.  It seems we forgot to use the mode when RENDER-only mode
is being used, so this patch fixes that.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
6 years agocompositor-drm: fix drm_output_prepare_overlay_view for non-matching format
Philipp Zabel [Tue, 22 Jan 2019 10:28:46 +0000 (11:28 +0100)]
compositor-drm: fix drm_output_prepare_overlay_view for non-matching format

Add missing drm_plane_state_put_back in case the view's pixel format
does not match any of the tested plane's supported formats.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
6 years agocompositor-drm: Display the pixel format of the framebuffer used by the plane
Marius Vlad [Wed, 9 Jan 2019 10:26:07 +0000 (12:26 +0200)]
compositor-drm: Display the pixel format of the framebuffer used by the plane

With this patch we also display the format in usage by the HW-plane.
This touches both legacy and atomic paths.

6 years agopixel-formats: Document pixel format human-friendly conversion methods
Marius Vlad [Tue, 22 Jan 2019 15:56:58 +0000 (17:56 +0200)]
pixel-formats: Document pixel format human-friendly conversion methods

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
6 years agocompositor-drm: Print DRM FB pixel format of the view in human-friendly form
Marius Vlad [Tue, 22 Jan 2019 15:56:36 +0000 (17:56 +0200)]
compositor-drm: Print DRM FB pixel format of the view in human-friendly form

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
6 years agogitlab-ci.yml: Install meson from 0.49 branch
Jonas Ådahl [Tue, 22 Jan 2019 10:05:19 +0000 (11:05 +0100)]
gitlab-ci.yml: Install meson from 0.49 branch

Otherwise CI might fail due to
https://github.com/mesonbuild/meson/issues/4718 but the fix isn't
included in any release yet, so install meson from the 0.49 branch.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
6 years agomeson: friendly error for simple-dmabuf-drm
Pekka Paalanen [Thu, 17 Jan 2019 13:49:10 +0000 (15:49 +0200)]
meson: friendly error for simple-dmabuf-drm

This is probably the most annoying ones. Some distributions do not even package
a libdrm_${driver} if the driver's hardware does not occur on the CPU
architecture, e.g. Debian x86_64 does not have libdrm_etnaviv.

Helps people to disable those.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agoclients/simple-dmabuf-egl: Render a moving square
Alexandros Frantzis [Wed, 9 Jan 2019 11:38:16 +0000 (13:38 +0200)]
clients/simple-dmabuf-egl: Render a moving square

Render a moving square instead of just clearing the buffer, to help
uncover rendering issues (e.g. modifier-related issues) which may not be
visible with a simple glClear.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
6 years agoclients/simple-dmabuf-egl: Support dmabuf format modifiers
Alexandros Frantzis [Tue, 8 Jan 2019 10:32:12 +0000 (12:32 +0200)]
clients/simple-dmabuf-egl: Support dmabuf format modifiers

Take into account format modifiers advertised by the compositor and the
EGL implementation and supported by the buffer creation mechanism, to
select the optimal buffer modifier.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
6 years agoRevert "meson: fix -Wno-foo argument testing"
Eric Engestrom [Thu, 10 Jan 2019 14:57:05 +0000 (14:57 +0000)]
Revert "meson: fix -Wno-foo argument testing"

This reverts commit bc315aa2881949d3961c03599e8c20e0273ec817

Turns out since meson 0.46 it knows about this quirk of compilers and
checks the right thing internally.

See https://github.com/mesonbuild/meson/pull/2284

6 years agomeson: better error for test-junit-xml dep
Pekka Paalanen [Tue, 8 Jan 2019 18:05:09 +0000 (20:05 +0200)]
meson: better error for test-junit-xml dep

Helps people avoid libxml if they... want to?

Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agomeson: better error for tests missing libX11
Pekka Paalanen [Mon, 7 Jan 2019 19:33:08 +0000 (21:33 +0200)]
meson: better error for tests missing libX11

Helps people avoid libX11 at the cost of disabling Xwayland support.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agotests: remove remnants of buffer-count test
Pekka Paalanen [Mon, 7 Jan 2019 13:04:21 +0000 (15:04 +0200)]
tests: remove remnants of buffer-count test

The buffer-count test was added in
40c0c3f91eeb747b86df64579e3b3706cc5450af and removed in
4938f93f578c0d73d63068e4a777250fce7db430, but the removal left around
the dependency to EGL headers in weston-test.c.

Removal of those unneeded includes allows us to drop the EGL dependency
completely from weston-test.c build.

For the Meson build this means that there are no dependency('egl')
directives anymore without the user friendly error message.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agomeson: better errors for VA-API deps
Pekka Paalanen [Mon, 31 Dec 2018 13:08:25 +0000 (15:08 +0200)]
meson: better errors for VA-API deps

Helps people avoid libva if they don't want it.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agomeson: better error for drm+gl deps
Pekka Paalanen [Mon, 31 Dec 2018 13:01:48 +0000 (15:01 +0200)]
meson: better error for drm+gl deps

Helps people avoid GBM if they don't have it.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agomeson: better error for x11+gl deps
Pekka Paalanen [Mon, 31 Dec 2018 13:00:21 +0000 (15:00 +0200)]
meson: better error for x11+gl deps

Helps people avoid egl in the rare case they don't have it.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agomeson: better error for wayland-backend wl-egl dep
Pekka Paalanen [Mon, 31 Dec 2018 12:53:04 +0000 (14:53 +0200)]
meson: better error for wayland-backend wl-egl dep

Helps people avoid wayland-egl if they don't want it.

Makes the check for wayland-egl explicit on the site instead of relying
on gl-renderer checking for it.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agomeson: better errors for image loader deps
Pekka Paalanen [Mon, 31 Dec 2018 12:40:01 +0000 (14:40 +0200)]
meson: better errors for image loader deps

Helps people avoid libjpeg or libwebp if they don't want them.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agomeson: better errors for systemd-notify deps
Pekka Paalanen [Mon, 31 Dec 2018 12:23:59 +0000 (14:23 +0200)]
meson: better errors for systemd-notify deps

Helps people avoid libsystemd if they don't want it.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agomeson: better error for cms-colord deps
Pekka Paalanen [Mon, 31 Dec 2018 12:20:40 +0000 (14:20 +0200)]
meson: better error for cms-colord deps

Helps people avoid colord if they don't want it.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agomeson: better error cms-static deps
Pekka Paalanen [Mon, 31 Dec 2018 12:17:23 +0000 (14:17 +0200)]
meson: better error cms-static deps

Helps people to avoid lcms2 if they don't want it.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agomeson: contain and check simple-dmabuf-egl deps
Pekka Paalanen [Mon, 31 Dec 2018 11:36:40 +0000 (13:36 +0200)]
meson: contain and check simple-dmabuf-egl deps

Check the egl, glesv2 and gbm dependencies locally instead of relying on
the dep_* variables from the top level meson.build or
libweston/meson.build (dep_gbm).

This should make these dependencies now explicitly checked when the app
is built, rather than relying on other components doing the checks. If
the drm-backend was disabled, this would have probably hit an error
using the undeclared variable dep_gbm.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agomeson: better errors for gl-renderer egl and glesv2
Pekka Paalanen [Mon, 31 Dec 2018 11:28:23 +0000 (13:28 +0200)]
meson: better errors for gl-renderer egl and glesv2

Helps people to avoid EGL and GLESv2 if they do not want them.

Stops using dep_egl and dep_glesv2 so that the human friendly error
message is alongside the dependency() statement, so that the message and
the statement can later be merged together once Meson offers the custom
error messages feature or something even more sophisticated.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agomeson: better errors for x11-backend deps
Pekka Paalanen [Mon, 31 Dec 2018 11:13:53 +0000 (13:13 +0200)]
meson: better errors for x11-backend deps

Helps people avoid X11 related dependencies if they don't want them.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agomeson: better error for freerdp
Pekka Paalanen [Mon, 31 Dec 2018 11:02:32 +0000 (13:02 +0200)]
meson: better error for freerdp

Helps people to avoid freerdp if they don't want it.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agomeson: better error for logind deps
Pekka Paalanen [Mon, 31 Dec 2018 10:29:12 +0000 (12:29 +0200)]
meson: better error for logind deps

Helps people to disable logind support if they do not want the
dependencies.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agomeson: better errors for xwayland deps
Pekka Paalanen [Mon, 31 Dec 2018 10:20:22 +0000 (12:20 +0200)]
meson: better errors for xwayland deps

Helps people to disable xwayland if they don't want to install the
dependencies.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agomeson: drop indent level from xwayland
Pekka Paalanen [Mon, 31 Dec 2018 10:13:39 +0000 (12:13 +0200)]
meson: drop indent level from xwayland

Use the pattern to avoid identing everything, when everything in the
file is under the one conditional.

Helps readability.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agomeson: better error for wcap dep cairo
Pekka Paalanen [Mon, 31 Dec 2018 10:09:24 +0000 (12:09 +0200)]
meson: better error for wcap dep cairo

Add human-friendly error message.

Cairo is a hard dependency on the whole at least because tests seem to
require it, but this will help if someone adds an option to disable
building tests to get rid of Cairo.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agomeson: fix pangocairo being optional
Pekka Paalanen [Fri, 14 Dec 2018 17:11:51 +0000 (19:11 +0200)]
meson: fix pangocairo being optional

Cannot use dependency() directly in the structure, because it will
execute regardless of the option. Instead, let's store the dependency
name in the structure and use the same logic as with simple_clients to
conditionally look for the dependencies.

As a bonus, this brings friendly error messages to demo-clients
dependencies.

subsurfaces' dependencies are also converted to maintain consistency
with simple_clients.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agobuild: replace IN_WESTON with UNIT_TEST
Pekka Paalanen [Thu, 20 Dec 2018 09:53:21 +0000 (11:53 +0200)]
build: replace IN_WESTON with UNIT_TEST

Remove IN_WESTON in favour of the already defined UNIT_TEST which is
used to modify a compilation unit to expose more functions for unit
tests to prod at.

Originally IN_WESTON meant that compilation unit was being compiled for
use in the Weston compositor, but it probably never really did anything
more than change what WL_EXPORT means in matrix.c.

This patch not only simplifies the logic, but it fixes the Meson build
of test-matrix: IN_WESTON was defined there even when matrix.c was being
built outside of Weston, which caused it to depend on libwayland
headers, which were not included in the Meson build of test-matrix.
Test-matrix has no reason to depend in libwayland in any way, so this
patch fixes that.

Reported-by: Greg V <greg@unrelenting.technology>
Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agobuild: add missing wayland-client dep in meson
Greg V [Thu, 13 Dec 2018 20:20:16 +0000 (23:20 +0300)]
build: add missing wayland-client dep in meson

Tests library requires Wayland headers to build.

Signed-off-by: Greg V <greg@unrelenting.technology>
6 years agobuild: use '-Wl,' wrapper for the -export-dynamic linker flag
Greg V [Thu, 13 Dec 2018 20:17:48 +0000 (23:17 +0300)]
build: use '-Wl,' wrapper for the -export-dynamic linker flag

Meson links with the C compiler, not the raw linker.
With clang+LLD, the bare flag would be ignored.

Signed-off-by: Greg V <greg@unrelenting.technology>
6 years agobuild: use pkg-config to find libjpeg in meson
Greg V [Thu, 13 Dec 2018 20:13:25 +0000 (23:13 +0300)]
build: use pkg-config to find libjpeg in meson

Signed-off-by: Greg V <greg@unrelenting.technology>
6 years agocompositor-fbdev: add support for ABGR
Pablo Castellano [Wed, 28 Nov 2018 07:45:46 +0000 (08:45 +0100)]
compositor-fbdev: add support for ABGR

Make fbdev work with some Android downstream kernels, like the
asus-grouper (Google Nexus 7 2012).

Signed-off-by: Oliver Smith <ollieparanoid@bitmessage.ch>
6 years agoclients: Add simple-dmabuf-egl
Alexandros Frantzis [Thu, 25 Oct 2018 14:32:36 +0000 (17:32 +0300)]
clients: Add simple-dmabuf-egl

Add a client that uses EGL/GLESv2 to draw to dmabuf buffers, utilizing
EGLImages and FBOs. The client uses GBM to create the dmabufs buffers.

The simple-dmabuf-egl client is partly based on patch [1] that changes
dmabuf clients to use GBM instead of libdrm code, but has been greatly
simplified since in this case we don't require direct pixel access or
non-RGBA formats.

[1] https://patchwork.freedesktop.org/patch/239796/

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
6 years agolibweston/screnshooter: Fix weston screenshot event done if there's no client running
Marius Vlad [Fri, 23 Nov 2018 10:04:27 +0000 (12:04 +0200)]
libweston/screnshooter: Fix weston screenshot event done if there's no client running

The 'done' event sent back to client with the weston screenshot interface
is not being sent if there is no damage on the plane. This patch (re-uses just
like recording part) weston_output_damage() to achieve that.

Otherwise the client will have to wait (and be blocked) until some
damage on the plane is being done.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
6 years agocompositor: Install weston-screenshooter in BINDIR
Marius Vlad [Sat, 15 Dec 2018 13:57:19 +0000 (15:57 +0200)]
compositor: Install weston-screenshooter in BINDIR

Previously weston-screenshooter was installed in LIBEXECDIR, but given
that now it can be invoked by the user whenever debug protocol is
enabled, let's intall it into BINDIR. This way, it can be invoked
without the need to modify PATH.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
6 years agocompositor: Add some handy wrappers for wet_get_binary_path()
Marius Vlad [Sat, 15 Dec 2018 13:51:57 +0000 (15:51 +0200)]
compositor: Add some handy wrappers for wet_get_binary_path()

This allows to possibility to specify where to look for the executable
but also simplifies the need of having to pass either BINDIR/LIBEXECDIR
for retrieving full-path of the executable.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
6 years agoivi-shell/hmi-controller: Include config.h as to not break ivi-shell build on meson
Marius Vlad [Thu, 13 Dec 2018 14:31:14 +0000 (16:31 +0200)]
ivi-shell/hmi-controller: Include config.h as to not break ivi-shell build on meson

We're going to eventually pass bindir to weston-screenshooter and we
will need config.h info.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
6 years agolibweston: Allow taking screenshots when debug protocol is enabled
Marius Vlad [Thu, 13 Dec 2018 21:04:52 +0000 (23:04 +0200)]
libweston: Allow taking screenshots when debug protocol is enabled

Screenshots of the outputs can only be taken by having a keyboard
plug-ed in, as to avoid potential malicious intent. On the other hand,
this is problematic as there are cases where a keyboard cannot
be used as a input device. A particular use-case is that for
multiple devices it can be cumbersome to connect a keyboard such
that using ssh can be much easier and can be further automated.

This patch allows taking screenshots without the need of having a
keyboard connected when debug protocol is enabled.

Add also a few words about the fact that this is a serious issue
and can lead to silently leaking the output contents.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
6 years agolibweston/weston-debug: Add a easy way to determine if the debug protocol has been...
Marius Vlad [Thu, 13 Dec 2018 21:03:30 +0000 (23:03 +0200)]
libweston/weston-debug: Add a easy way to determine if the debug protocol has been enabled

This allows additional debug features to depend on the debug protocol being enabled

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
6 years agoclients/screenshot: Allow weston-screenshooter to be called directly
Marius Vlad [Wed, 5 Dec 2018 12:40:31 +0000 (14:40 +0200)]
clients/screenshot: Allow weston-screenshooter to be called directly

As is stands now, libexec/weston-screenshooter can only be called from
within weston server. This will allow weston-screenshooter to be called
on the command line. The final scope here is to allow taking screenshots
without the need of a keyboard.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
6 years agoclients/screenshot: Avoid using global variables to pass down data between functions
Marius Vlad [Thu, 13 Dec 2018 13:24:08 +0000 (15:24 +0200)]
clients/screenshot: Avoid using global variables to pass down data between functions

This is just cosmetic and doesn't fixes anything.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
6 years agolibweston/compositor-drm: Add missing debug message for scanout_view
Marius Vlad [Tue, 18 Dec 2018 08:29:20 +0000 (10:29 +0200)]
libweston/compositor-drm: Add missing debug message for scanout_view

Print debug message when the fb coudn't be retrieved for the primary
plane.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
6 years agolibweston/compositor-drm: No need to test for invalid alpha for the view
Marius Vlad [Tue, 18 Dec 2018 08:27:31 +0000 (10:27 +0200)]
libweston/compositor-drm: No need to test for invalid alpha for the view

This is redundant and is already being checked drm_fb_get_from_view()

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
6 years agolibweston/compositor-drm: Print composition mode in weston-debug
Marius Vlad [Fri, 14 Dec 2018 09:56:10 +0000 (11:56 +0200)]
libweston/compositor-drm: Print composition mode in weston-debug

This fixes the situation when using only plane-state mode for
compositing there's no obvious debug message stating that. This patch
makes it slightly better/easier to dermine what mode the compositor is
using currently.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
6 years agoFix compiler warning: unused variable when building with DEBUG
Marius Vlad [Fri, 23 Nov 2018 12:10:16 +0000 (14:10 +0200)]
Fix compiler warning: unused variable when building with DEBUG

clients/keyboard.c: In function 'dbg':
clients/keyboard.c:276:6: warning: variable 'l' set but not used [-Wunused-but-set-variable]
  int l;

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
6 years agoFix compiler warnings: invalid type format
Marius Vlad [Fri, 23 Nov 2018 12:07:33 +0000 (14:07 +0200)]
Fix compiler warnings: invalid type format

This patch fixes the following warnings:

clients/weston-info.c: In function 'print_tablet_tool_info':
clients/weston-info.c:569:3: warning: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'uint64_t' [-Wformat=]
   printf("\t\t\thardware serial: %lx\n", info->hardware_serial);
   ^
clients/weston-info.c:572:3: warning: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'uint64_t' [-Wformat=]
   printf("\t\t\thardware wacom: %lx\n", info->hardware_id_wacom);

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
6 years agoFix compiler warnings: clobber variables
Marius Vlad [Fri, 23 Nov 2018 12:04:46 +0000 (14:04 +0200)]
Fix compiler warnings: clobber variables

This patchs fixes warnings generated by older toolchains:

shared/image-loader.c: In function 'load_png':
shared/image-loader.c:211:12: warning: variable 'data' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
  png_byte *data = NULL;

See https://linux.die.net/man/3/longjmp why is this needed.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
6 years agoFix compiler warnings generated by older toolchains/compiler
Marius Vlad [Fri, 23 Nov 2018 12:02:07 +0000 (14:02 +0200)]
Fix compiler warnings generated by older toolchains/compiler

This fixes warnings like ``may be used uninitialized''

libweston/compositor-drm.c: In function 'drm_device_is_kms':
libweston/compositor-drm.c:6374:12: warning: 'id' may be used uninitialized in this function [-Wmaybe-uninitialized]
  b->drm.id = id;

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
6 years agomeson: fix -Wno-foo argument testing
Eric Engestrom [Thu, 13 Dec 2018 17:05:31 +0000 (17:05 +0000)]
meson: fix -Wno-foo argument testing

gcc and clang ignore `-Wno-foo` arguments nowadays, so we need to
test the positive variant instead.

6 years agoCI: Add Meson build
Daniel Stone [Sun, 22 Jul 2018 14:38:54 +0000 (15:38 +0100)]
CI: Add Meson build

This uses pip to install Meson in order to get a sufficiently new
version.

Signed-off-by: Daniel Stone <daniels@collabora.com>
6 years agoCI: build rdp-backend
Pekka Paalanen [Sat, 24 Nov 2018 11:52:49 +0000 (13:52 +0200)]
CI: build rdp-backend

Extends CI build coverage to catch more issues.

freerdp2-dev needs stretch-backports.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agoCI: build remoting-plugin
Pekka Paalanen [Sat, 24 Nov 2018 11:51:04 +0000 (13:51 +0200)]
CI: build remoting-plugin

Extends CI build coverage to catch more issues.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agobuild: add meson to autotools dist tar-ball
Pekka Paalanen [Sat, 24 Nov 2018 12:13:02 +0000 (14:13 +0200)]
build: add meson to autotools dist tar-ball

This should let people using the dist tarballs to build with meson.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agoAdd Meson build system
Daniel Stone [Thu, 24 Nov 2016 15:54:51 +0000 (15:54 +0000)]
Add Meson build system

Meson is a build system, currently implemented in Python, with multiple
output backends, including Ninja and Make. The build file syntax is
clean and easy to read unlike autotools. In practise, configuring and
building with Meson and Ninja has been observed to be much faster than
with autotools. Also cross-building support is excellent.

More information at http://mesonbuild.com

Since moving to Meson requires some changes from users in any case, we
took this opportunity to revamp build options. Most of the build options
still exist, some have changed names or more, and a few have been
dropped. The option to choose the Cairo flavour is not implemented since
for the longest time the Cairo image backend has been the only
recommended one.

This Meson build should be fully functional and it installs everything
an all-enabled autotools build does. Installed pkg-config files have
some minor differences that should be insignificant. Building of some
developer documentation that was never installed with autotools is
missing.

It is expected that the autotools build system will be removed soon
after the next Weston release.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Co-authored-by: Pekka Paalanen <pq@iki.fi>
Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agotests: fix include in input-timestamps-helper.c
Daniel Stone [Sun, 9 Dec 2018 12:49:07 +0000 (14:49 +0200)]
tests: fix include in input-timestamps-helper.c

No need to use the protocol directory prefix. This may even be necessary
for the Meson build.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Extracted from the patch adding the Meson build system.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agoshared: remove fallback definition of backtrace()
Pekka Paalanen [Sat, 24 Nov 2018 09:39:48 +0000 (11:39 +0200)]
shared: remove fallback definition of backtrace()

The user of backtrace() was removed in
bb707dc0fe331c9af112a0552b7aa6fde755dd83 and has been unused since.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agoclients/simple-egl: include weston-egl-ext.h correctly
Pekka Paalanen [Sat, 17 Nov 2018 12:48:04 +0000 (14:48 +0200)]
clients/simple-egl: include weston-egl-ext.h correctly

weston-egl-ext.h was moved to shared/ in
ffff92d592e1635a7ee4511ad3e080f7576553bd

Use the correct include path, so that Meson build does not need to add
../shared to the include path just for this.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agotests: Rename surface-screenshot
Daniel Stone [Tue, 28 Aug 2018 21:53:59 +0000 (22:53 +0100)]
tests: Rename surface-screenshot

Give it a more regular name, matching all the other test plugins.

Signed-off-by: Daniel Stone <daniels@collabora.com>
6 years agordp-compositor: fix compilation with FreeRDP 2.0-rc4
David Fort [Tue, 4 Dec 2018 22:25:39 +0000 (23:25 +0100)]
rdp-compositor: fix compilation with FreeRDP 2.0-rc4

Some members have been removed from FreeRDP structs, so let's use local
variables.

6 years agocompositor: Make pixel format printing in human-friendly form
Marius Vlad [Tue, 20 Nov 2018 15:52:31 +0000 (17:52 +0200)]
compositor: Make pixel format printing in human-friendly form

This would make weston-debug much more readable when looking at
the pixel format of the buffer.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
6 years agopixel-formats: Added pixel_format_get_info_shm() helper for printing SHM buffers
Marius Vlad [Tue, 20 Nov 2018 15:04:57 +0000 (17:04 +0200)]
pixel-formats: Added pixel_format_get_info_shm() helper for printing SHM buffers

In current form SHM buffers pixel format can only be printed as 0 and 1.
With the help of this helper we align with DRM_FORMAT_ pixel format.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
6 years agocompositor-drm: parse all DRM format names
Pekka Paalanen [Wed, 26 Sep 2018 11:33:36 +0000 (14:33 +0300)]
compositor-drm: parse all DRM format names

Use the pixel format table to parse format names. This makes the parser
recognize almost all DRM format names.

Not all formats are usable, but we rely on the use to fail
appropriately. What we can use depends on the drivers anyway.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
6 years agopixel-formats: search by name
Pekka Paalanen [Wed, 26 Sep 2018 11:26:53 +0000 (14:26 +0300)]
pixel-formats: search by name

Add a function to find a format description by the DRM format name. This
will be useful when parsing configuration strings.

While at it, fix the two function formattings in pixel-formats.h to
match everything else in the file.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
6 years agopixel-formats: add name string
Pekka Paalanen [Wed, 26 Sep 2018 11:00:34 +0000 (14:00 +0300)]
pixel-formats: add name string

There is often a need to print the name of a pixel format. Printing the
raw numeric value is hard to decipher, printing the four ASCII
characters is slightly more human-friendly but still needs a decoder
table. Add a name that can be printed easily.

The bulk of this patch was done with:
sed -i -e 's/\.format = DRM_FORMAT_\(.\+\),/DRM_FORMAT(\1),/' libweston/pixel-formats.c

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
6 years agoDon't look for weston.ini in the current working directory
Dima Ryazanov [Thu, 15 Nov 2018 06:55:22 +0000 (22:55 -0800)]
Don't look for weston.ini in the current working directory

It's a bit surprising that Weston looks different when launched from the root
of the git repo vs from elsewhere.

But it's also technically a security vulnerability: if I launch it from
a directory like /tmp, it might pick up a weston.ini created by another user,
which could then load modules with arbitrary code. Basically, it's the same
problem as including "." in $PATH.

Signed-off-by: Dima Ryazanov <dima@gmail.com>
6 years agoivi-shell: remove input-method section from config
Emre Ucan [Fri, 2 Nov 2018 14:42:17 +0000 (15:42 +0100)]
ivi-shell: remove input-method section from config

input_method protocol is no longer supported.
Therefore, we should remove it from the example config

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
6 years agoivi-shell: remove unused functions and members
Emre Ucan [Fri, 2 Nov 2018 14:17:00 +0000 (15:17 +0100)]
ivi-shell: remove unused functions and members

input panel related members of ivi_shell struct are
not required anymore. Also get_default_view(),
input_panel_setup() and input_panel_destroy() are not used.
Therefore, we can remove them.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
6 years agoivi-shell: remove input panel implementation
Emre Ucan [Fri, 2 Nov 2018 14:09:48 +0000 (15:09 +0100)]
ivi-shell: remove input panel implementation

it is unused now

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
6 years agoivi-shell: don't use input panel implementation
Emre Ucan [Fri, 2 Nov 2018 14:04:49 +0000 (15:04 +0100)]
ivi-shell: don't use input panel implementation

input panel implementation puts contents of an
application, which uses input_method protocol,
on top of all other surfaces. It is not controllable
with ivi-layout interface.

This is not acceptable for an In-Vehicle Infotainment
platform. Because we have to ensure configured scenegraph
cannot be hijacked by any rogue application.

Therefore, I am removing input panel implementation

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
6 years agocompositor-drm: Log atomic commits and flips
Arkadiusz Hiler [Mon, 15 Oct 2018 08:06:11 +0000 (11:06 +0300)]
compositor-drm: Log atomic commits and flips

Add a couple log points for tracking atomic commits and flip processing.

Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
6 years agolibweston-desktop/xdg-shell: update view transforms for xdg popup surfaces
Michael Olbrich [Wed, 10 Oct 2018 11:49:45 +0000 (13:49 +0200)]
libweston-desktop/xdg-shell: update view transforms for xdg popup surfaces

For toplevel surfaces, the shell will do the same thing. Without this, the
commit does not trigger repaints, because the output mask for the surface
is not set.

Without this the popup is not shown unless something else triggers a
repaint. This is usually not seen because the mouse cursor triggers a
repaint at the same time.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
6 years agogl-renderer, pixman: disconnect the client on unhandled buffer type.
Vasilis Liaskovitis [Wed, 10 Oct 2018 14:14:55 +0000 (16:14 +0200)]
gl-renderer, pixman: disconnect the client on unhandled buffer type.

Introduce a helper function to disconnect the client on unhandled
buffer types, and use it in the gl and pixman renderers. The function
is modeled after linux_dmabuf_buffer_send_server_error.

Also print the egl error state in the gl renderer, in case the
unrecognized buffer error happens when querying an egl buffer.

https://gitlab.freedesktop.org/wayland/weston/issues/148

6 years agoclients: configure cursor theme from XCURSOR_* env
emersion [Wed, 10 Oct 2018 07:46:12 +0000 (09:46 +0200)]
clients: configure cursor theme from XCURSOR_* env

If XCURSOR_THEME or XCURSOR_SIZE is set, use it as the cursor theme
or cursor size.

This is similar to what Qt and some X11 apps do.

6 years agoFixed potential memory leaks in simple-dmabuf-drm.c found by Cppcheck.
orbitcowboy [Fri, 5 Oct 2018 16:02:10 +0000 (16:02 +0000)]
Fixed potential memory leaks in simple-dmabuf-drm.c found by Cppcheck.

6 years agocompositor-drm: Read FB2_MODIFIERS capability
Deepak Rawat [Fri, 24 Aug 2018 20:16:03 +0000 (13:16 -0700)]
compositor-drm: Read FB2_MODIFIERS capability

Not all drivers support fb2 modifiers so read the capability before
using drmModeAddFB2WithModifiers.

Signed-off-by: Deepak Rawat <drawat@vmware.com>
6 years agoivi-shell: check ivi_view mappedness in commit_changes()
Emre Ucan [Fri, 26 Oct 2018 12:42:21 +0000 (14:42 +0200)]
ivi-shell: check ivi_view mappedness in commit_changes()

If the view is not mapped, we do not need to update its
properties. We can use ivi_view_is_mapped() function to
check it.

Also we don't need to call weston_view_damage_below()
for weston_views, which were in the scenegraph. Because
we are calling weston_view_unmap for views of unmapped
ivi_views in build_view_list() function

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
6 years agoivi-shell: unmap views which are not in scenegraph
Emre Ucan [Fri, 26 Oct 2018 13:07:03 +0000 (15:07 +0200)]
ivi-shell: unmap views which are not in scenegraph

From Michael Olbrich:
"Both the core in weston_compositor_build_view_list() with view.link
and the ivi-shell in commit_screen_list() with view.layer_link
don't remove the old views from the list.

As a result, all views that are not currently in the list have
old broken links. Destroying such a view tries to remove
the view from these lists and will access the old, invalid pointers."

Therefore, we have to unmap weston_views which are not in current
scenegraph of ivi-shell. I implemented ivi_view_is_mapped() function
to check mappedness of ivi_views. The functions checks:
   - the view is on a layer's order list
   - the layer is on a screen
   - the layer and view's ivi_surface are visible

If ivi_view is not mapped but weston_view is still mapped,
we have to unmap the weston_view with weston_view_unmap() call.

Reported-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
6 years agoivi-shell: Add build_view_list function
Emre Ucan [Fri, 26 Oct 2018 12:15:15 +0000 (14:15 +0200)]
ivi-shell: Add build_view_list function

Move the implementation from commit_screen_list to
build_view_list function

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
6 years agoAdd remoting plugin for output streaming
Tomohito Esaki [Wed, 24 Jan 2018 08:08:02 +0000 (17:08 +0900)]
Add remoting plugin for output streaming

Remoting plugin support streaming image of virtual output on drm-backend
to remote output. By appending remote-output section in weston.ini,
weston loads remoting plugin module and creates virtual outputs via
remoting plugin. The mode, host, and port properties are configurable in
remote-output section.

This plugin send motion jpeg images to client via RTP using gstreamer.
Client can receive by using following pipeline of gst-launch.

gst-launch-1.0 rtpbin name=rtpbin \
   udpsrc caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,
encoding-name=JPEG,payload=26" port=[PORTNUMBER] !
          rtpbin.recv_rtp_sink_0 \
   rtpbin. ! rtpjpegdepay ! jpegdec ! autovideosink \
   udpsrc port=[PORTNUMBER+1] ! rtpbin.recv_rtcp_sink_0 \
   rtpbin.send_rtcp_src_0 !
          udpsink port=[PORTNUMBER+2] sync=false async=false

where, PORTNUMBER is specified in weston.ini.

Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
6 years agoweston: Add set up SIGUSR1 blocking early using pthread_sigmask()
Tomohito Esaki [Tue, 4 Sep 2018 08:18:06 +0000 (17:18 +0900)]
weston: Add set up SIGUSR1 blocking early using pthread_sigmask()

Xwayland block SIGUSR1 signal for handling this signal. However, if some
weston plugins creates additional threads before xwayland is loaded,
this signal get delivered these threads and causes weston quit.
Therefore, we should set up SIGUSR1 blocking early so that these threads
can inherit the setting when created.

Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
6 years agocompositor-drm: Add Support virtual output
Tomohito Esaki [Wed, 31 Jan 2018 08:50:48 +0000 (17:50 +0900)]
compositor-drm: Add Support virtual output

Add support virtual output for streaming image to remote output by
remoting-plugin which will be added by the patch:
"Add remoting plugin for output streaming."
The gbm bo of virtual output is the linear format.

Virtual output is implemented based on a patch by Grigory Kletsko
<grigory.kletsko@cogentembedded.com>.

Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
6 years agocompositor-drm: store gbm bo flags in drm_output
Tomohito Esaki [Wed, 31 Jan 2018 08:50:15 +0000 (17:50 +0900)]
compositor-drm: store gbm bo flags in drm_output

Store usage flags of gbm bo in drm_output in order to specify the bo
format for each output. A following patch will add a new type of
drm_output which requires different gbm_bo_flags.

Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
6 years agogl-renderer: provide fence sync fd for synchronizing with GPU rendering
Tomohito Esaki [Tue, 22 May 2018 03:05:14 +0000 (12:05 +0900)]
gl-renderer: provide fence sync fd for synchronizing with GPU rendering

Add new API to gl-renderer interface for providing fence sync fd. the
backend can wait for GPU rendering by this API.

Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
6 years agocompositor-drm: add num_planes to drm_fb structure
Tomohito Esaki [Mon, 10 Sep 2018 02:44:17 +0000 (11:44 +0900)]
compositor-drm: add num_planes to drm_fb structure

Add new member to store number of planes to drm_fb structure.

Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
6 years agolibweston: print EGL information as early as possible
Emil Velikov [Thu, 18 Oct 2018 14:58:09 +0000 (15:58 +0100)]
libweston: print EGL information as early as possible

In the case where CreateContext/MakeCurrent fails, we still want to
know what the EGL driver is capable of.

Move the EGL info printing, just after the eglInitialize() call to
ensure that.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
6 years agolibweston: split EGL and GL info logging
Emil Velikov [Thu, 18 Oct 2018 14:55:28 +0000 (15:55 +0100)]
libweston: split EGL and GL info logging

Split the two into separate functions. Former requires an initialized
EGL display, while the latter a current context.

We will use that distinction with the next patch.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
6 years agoxwayland: Silence format-truncation compilation warnings
Alexandros Frantzis [Fri, 12 Oct 2018 09:52:42 +0000 (12:52 +0300)]
xwayland: Silence format-truncation compilation warnings

We are currently formatting 32-bit signed integers into 8 byte buffers,
which are too small, causing the compiler to complain. Update the buffer
size to the minimum required value of 12 bytes: 1 for the sign, 10 for
the number, and 1 for the null byte terminator.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
6 years agocompositor-drm: Don't warn about missing backlight control
Daniel Stone [Fri, 21 Sep 2018 15:59:08 +0000 (16:59 +0100)]
compositor-drm: Don't warn about missing backlight control

Not every output will have a backlight control, and even if it does we
may just not be able to find it. Not having backlight control isn't an
error, so don't spam the log with it, as doing so can confuse users into
thinking this is an actual error which is responsible for their real
problems.

Signed-off-by: Daniel Stone <daniels@collabora.com>
6 years agogl-renderer: Remove warning on missing extensions
Daniel Stone [Fri, 21 Sep 2018 15:57:13 +0000 (16:57 +0100)]
gl-renderer: Remove warning on missing extensions

Not having swap_buffers_with_damage could cause a performance impact on
some backends, but at least on GBM it causes no issues. It also seems to
confuse users into thinking it's a legitimate error which could explain
session slowness.

Similarly with buffer_age, whilst we do lose a little bit of performance
by not being able to do partial renders, it is not a great deal, and the
user is unlikely to be able to do anything about it in any event.

Remove the warning; we print the full extension list at startup, so we
already have enough information from the logs to easily diagnose any
real errors.

Signed-off-by: Daniel Stone <daniels@collabora.com>
6 years agoweston: keep non-desktop displays turned off by default
Philipp Zabel [Thu, 30 Aug 2018 15:41:42 +0000 (17:41 +0200)]
weston: keep non-desktop displays turned off by default

Keep non-desktop heads representing e.g. head mounted displays turned off by
default. When using the DRM backend they can still be enabled by setting an
explicit [output] mode (or "mode=preferred") in weston.ini.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
6 years agocompositor-drm: check connector non-desktop property and mark head accordingly
Philipp Zabel [Thu, 30 Aug 2018 15:39:51 +0000 (17:39 +0200)]
compositor-drm: check connector non-desktop property and mark head accordingly

Use the DRM connector "non-desktop" property to mark weston_heads that
represent head mounted displays and other non-standard displays that the
desktop should not be extended to.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>