platform/upstream/weston.git
5 years agobuild: remove dir_include
Pekka Paalanen [Thu, 28 Mar 2019 13:49:54 +0000 (15:49 +0200)]
build: remove dir_include

It was unused.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
5 years agolibweston: fix protocol install path
Pekka Paalanen [Thu, 28 Mar 2019 12:45:40 +0000 (14:45 +0200)]
libweston: fix protocol install path

These protocols are from libweston, not weston.
Even the pkg-config files is called libweston-6-protocols.pc.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
5 years agomeson.build/libweston: Fix clang warning for export-dynamic
Marius Vlad [Tue, 16 Apr 2019 14:37:10 +0000 (17:37 +0300)]
meson.build/libweston: Fix clang warning for export-dynamic

Identical to 8a8558dd, where we need to pass `-Wl` as linker args.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agomeson.build: Fix warning for configure_file
Harish Krupo [Tue, 16 Apr 2019 05:11:01 +0000 (10:41 +0530)]
meson.build: Fix warning for configure_file

We claim to support meson versions >= 0.47 but the `install:` argument
in configure_file was introduced in version 0.50. This produces the
following meson warning:

WARNING: Project specifies a minimum meson_version '>= 0.47' but uses
features which were added in newer versions:
 * 0.50.0: {'install arg in configure_file'}

From the documentation for the install argument [1]:
" When omitted it (install) defaults to true when install_dir is set and
not empty, false otherwise."

So, remove the `install:` argument and just depend on `install_dir` for
installing.

Fixes: https://gitlab.freedesktop.org/wayland/weston/issues/225
[1] https://mesonbuild.com/Reference-manual.html#configure_file

Signed-off-by: Harish Krupo <harish.krupo.kps@intel.com>
5 years agoFix incorrect include
Luca Weiss [Sun, 14 Apr 2019 10:38:25 +0000 (10:38 +0000)]
Fix incorrect include

In file included from ../clients/multi-resource.c:38:
/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp]
 #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
  ^~~~~~~

5 years agosupport byte-by-byte reproducible build
Héctor Orón Martínez [Thu, 28 Mar 2019 15:24:42 +0000 (16:24 +0100)]
support byte-by-byte reproducible build

build path ends in the final binary package causing the
build not to be reproducible byte-by-byte.

Reference:
https://bugs.debian.org/899358

Signed-off-by: Héctor Orón Martínez <zumbi@debian.org>
5 years agoFIX: weston: clients: typo in simple-dmabuf-egl.c
Kamal Pandey [Thu, 4 Apr 2019 14:15:45 +0000 (19:45 +0530)]
FIX: weston: clients: typo in simple-dmabuf-egl.c

Fix variable EGL_NO_IMAGE to EGL_NO_IMAGE_KHR in
clients/simple-dmabuf-egl.c

Signed-off-by: Kamal Pandey <pandeykamal13526@gmail.com>
5 years agocairo-util: Don't set title string to Pango layout if the title is NULL
Tomohito Esaki [Mon, 1 Apr 2019 08:51:35 +0000 (17:51 +0900)]
cairo-util: Don't set title string to Pango layout if the title is NULL

If buttons list isn't empty and title is NULL, SEGV is occured in
pango_layout_set_text(). This patch fixes this problem.

Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
5 years agobuild: add missing dep to x11 backend
Pekka Paalanen [Fri, 29 Mar 2019 11:37:56 +0000 (13:37 +0200)]
build: add missing dep to x11 backend

All other backends already link to libweston, x11 backend should too.

This fixes a build failure:

[1/50] Compiling C object 'libweston/2b98b6d@@x11-backend@sha/compositor-x11.c.o'.
FAILED: libweston/2b98b6d@@x11-backend@sha/compositor-x11.c.o
cc -Ilibweston/2b98b6d@@x11-backend@sha -Ilibweston -I../../git/weston/libweston -Ilibweston/.. -I../../git/weston/libweston/.. -Ilibweston/../shared -I../../git/weston/libweston/../shared -Iprotocol -I/home/pq/local/include -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/libdrm -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu99 -g -Wno-unused-parameter -Wno-shift-negative-value -Wno-missing-field-initializers -fvisibility=hidden -fPIC  -MD -MQ 'libweston/2b98b6d@@x11-backend@sha/compositor-x11.c.o' -MF 'libweston/2b98b6d@@x11-backend@sha/compositor-x11.c.o.d' -o 'libweston/2b98b6d@@x11-backend@sha/compositor-x11.c.o' -c ../../git/weston/libweston/compositor-x11.c
../../git/weston/libweston/compositor-x11.c:51:10: fatal error: xkbcommon/xkbcommon.h: No such file or directory
 #include <xkbcommon/xkbcommon.h>

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
5 years agocompositor: Fix missing new line when displaying buffer type for EGL buffer
Marius Vlad [Sun, 17 Mar 2019 16:22:21 +0000 (18:22 +0200)]
compositor: Fix missing new line when displaying buffer type for EGL buffer

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agocompositor: Fix invalid view numbering in scene-graph
Marius Vlad [Sun, 17 Mar 2019 16:10:09 +0000 (18:10 +0200)]
compositor: Fix invalid view numbering in scene-graph

With the addition of patch 433f4e77b7729 we display the same view id (0)
for every view as we're modifying the local variable.

Displaying sub-surfaces based views is also problematic. The caller need
to modify the view number as well, so we instead we pass the address as
to allow that to happen. Otherwise we end up repeating the same number
for views without sub-subrfaces once those have been printed.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agoREADME: refer to version numbers in meson.build
Pekka Paalanen [Thu, 14 Mar 2019 15:08:30 +0000 (17:08 +0200)]
README: refer to version numbers in meson.build

configure.ac is no more, and in meson.build there are no minor or patch
versions for libweston, only major.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
5 years agotests: fix references to automake
Pekka Paalanen [Thu, 14 Mar 2019 14:56:27 +0000 (16:56 +0200)]
tests: fix references to automake

There is no automake anymore, I suppose it is ninja that handles it now.

There are still a couple references to automake left to point out where the
conventions originated, e.g. the exit code 77.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
5 years agoClean up .gitignore after autotools removal
Pekka Paalanen [Thu, 14 Mar 2019 14:43:19 +0000 (16:43 +0200)]
Clean up .gitignore after autotools removal

There is no such thing as building in-tree anymore, so no need to ignore build
artifacts.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
5 years agoRemove autotools build
Pekka Paalanen [Thu, 14 Mar 2019 14:25:14 +0000 (16:25 +0200)]
Remove autotools build

Weston 6.0.0 was released with both autotools and Meson build systems. That
should be enough for downstream to migrate to Meson build on their on pace.

Maintaining two build systems is a hassle, keep the one that is easier to work
with and let the other one go.

doc/dozygen/tool*.doxygen.in are not deleted, because they have not been
integrated with Meson yet.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
5 years agomeson: dep fix for compositor.h needing xkbcommon.h
Pekka Paalanen [Thu, 28 Mar 2019 10:26:47 +0000 (12:26 +0200)]
meson: dep fix for compositor.h needing xkbcommon.h

This fixes:

[    5s] cc -Ilibweston/2b98b6d@@session-helper@sta -Ilibweston -I../libweston -Ilibweston/.. -I../libweston/.. -Ilibwes
ton/../shared -I../libweston/../shared -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/dbus-1.0 -I/usr/lib6
4/dbus-1.0/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -std=gnu99 -Wno-unused-parameter -Wno-shift-n
egative-value -Wno-missing-field-initializers -fvisibility=hidden -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong
 -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g -fPIC  -MD -MQ 'libweston/2b98b6d@@session-hel
per@sta/launcher-util.c.o' -MF 'libweston/2b98b6d@@session-helper@sta/launcher-util.c.o.d' -o 'libweston/2b98b6d@@sessio
n-helper@sta/launcher-util.c.o' -c ../libweston/launcher-util.c
[    5s] In file included from ../libweston/launcher-util.c:29:
[    5s] ../libweston/compositor.h:39:10: fatal error: xkbcommon/xkbcommon.h: No such file or directory
[    5s]  #include <xkbcommon/xkbcommon.h>

For completeness, also add the same for wayland-server.h.

Reported-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
5 years agocompositor-drm: Set damage for scanout plane
Deepak Rawat [Tue, 24 Jul 2018 21:13:34 +0000 (14:13 -0700)]
compositor-drm: Set damage for scanout plane

Copy the damage region to scanout drm_plane_state which will be sent to
kernel during atomic state update.

Signed-off-by: Deepak Rawat <drawat@vmware.com>
5 years agocompositor-drm: Add support for drm plane FB_DAMAGE_CLIPS property
Deepak Rawat [Tue, 24 Jul 2018 21:05:37 +0000 (14:05 -0700)]
compositor-drm: Add support for drm plane FB_DAMAGE_CLIPS property

The plane property FB_DAMAGE_CLIPS provides a way to mark damaged
regions on the plane in framebuffer coordinates of the framebuffer
attached to the plane.

This patch adds a new member "damage" to compositor version of
drm_plane_state and set FB_DAMAGE_CLIPS property whenever damage is
available.

v2: Rebase, check if plane support FB_DAMAGE_CLIPS property before
setting it.

Signed-off-by: Deepak Rawat <drawat@vmware.com>
5 years agoOptimize PNGs with zopflipng
Riku Viitanen [Thu, 28 Mar 2019 10:09:52 +0000 (10:09 +0000)]
Optimize PNGs with zopflipng

5 years agoCI: containerize the CI
Benjamin Tissoires [Mon, 18 Mar 2019 14:51:07 +0000 (15:51 +0100)]
CI: containerize the CI

Reuse the templates from wayland/ci-templates:
whenever DEBIAN_TAG is changed, this will rebuild a new container.

This adds two things:
- better reliability (we do not randomly pull packages whenever the CI
  runs and we can reproduce with this particular environment)
- faster builds, as we do not need to pull the universe at each run

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
[Pekka: bump DEBIAN_TAG]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
5 years agoclients/simple-dmabuf-egl: Properly check for error in gbm_bo_get_handle_for_plane
Alexandros Frantzis [Wed, 13 Mar 2019 10:16:29 +0000 (12:16 +0200)]
clients/simple-dmabuf-egl: Properly check for error in gbm_bo_get_handle_for_plane

gbm_bo_get_handle_for_plane returns handle.s32 == -1 on error, at least
for the Mesa dri implementation.

Reported-by: Marius Vlad <marius.vlad@collabora.com>
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
5 years agomeson: DRM-backend demands GBM
Pekka Paalanen [Fri, 22 Mar 2019 15:05:11 +0000 (17:05 +0200)]
meson: DRM-backend demands GBM

All the GBM code is unconditional in compositor-drm.c, so while disabling the
GL-renderer would stop GBM from being used, GBM headers would still be needed
for building and GBM library for linking.

Leave a note to fix it properly later. At least we now check for GBM and do not
mislead with the error message.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
5 years agomeson: link remoting with glib and gobject
Pekka Paalanen [Fri, 22 Mar 2019 12:37:39 +0000 (14:37 +0200)]
meson: link remoting with glib and gobject

remoting-plugin.c calls things like g_error_free() and g_object_set(), so it
needs to link glib-2.0 and gobject-2.0 explicitly, instead of relying on
GStreamer pkg-config bringing them in.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
5 years agomeson: link cms-colord with glib and gobject
Pekka Paalanen [Fri, 22 Mar 2019 12:20:51 +0000 (14:20 +0200)]
meson: link cms-colord with glib and gobject

cms-colord.c calls things like g_string_free() and g_object_unref(), so it
needs to link glib-2.0 and gobject-2.0 explicitly, instead of relying on colord
pkg-config bringing them in.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
5 years agomeson: link editor with gobject-2.0
Pekka Paalanen [Fri, 22 Mar 2019 11:58:30 +0000 (13:58 +0200)]
meson: link editor with gobject-2.0

editor.c calls g_clear_object(), so it should link to gobject directly instead
of relying on pangocairo pulling it in in its pkg-config.

Fixes: https://gitlab.freedesktop.org/wayland/weston/issues/211
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
5 years agocompositor: Don't ignore --use-pixman for Wayland backend
Daniel Stone [Fri, 22 Mar 2019 12:26:19 +0000 (12:26 +0000)]
compositor: Don't ignore --use-pixman for Wayland backend

We loaded the use-pixman configuration value from both the command line
and the configuration file, but completely ignored the former. Make sure
we actually use both.

Tested with all permutations of config/command line.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
5 years agobuild: reopen master for regular development
Pekka Paalanen [Thu, 28 Mar 2019 08:50:11 +0000 (10:50 +0200)]
build: reopen master for regular development

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
5 years agoconfigure.ac/meson.build: bump version to 6.0.0 for the official release
Derek Foreman [Thu, 28 Mar 2019 01:11:52 +0000 (20:11 -0500)]
configure.ac/meson.build: bump version to 6.0.0 for the official release

5 years agoautotools: Fix tags/cscope targets with autools
Marius Vlad [Wed, 27 Mar 2019 09:15:53 +0000 (11:15 +0200)]
autotools: Fix tags/cscope targets with autools

This was introduced with a95bb6f7e554c1a7 (clients: Support explicit
synchronization)

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agoconfigure.ac/meson.build: bump to version 5.0.94 for the RC2 release
Derek Foreman [Thu, 21 Mar 2019 00:49:58 +0000 (19:49 -0500)]
configure.ac/meson.build: bump to version 5.0.94 for the RC2 release

5 years agomeson: fix building screen-share module
Stefan Agner [Tue, 19 Mar 2019 23:09:51 +0000 (00:09 +0100)]
meson: fix building screen-share module

When building screen-share module with meson loading the module
fails with:
  [00:01:28.604] Failed to load module: /usr/local/lib/weston/screen-share.so: undefined symbol: os_create_anonymous_file
  Failed to process Wayland connection: Broken pipe
  failed to create display: Broken pipe

The function os_create_anonymous_file is defined in libshared,
adding libshared to the dependency makes sure the function gets
compiled into screen-share.so.

Fixes: https://gitlab.freedesktop.org/wayland/weston/issues/208
Signed-off-by: Stefan Agner <stefan@agner.ch>
5 years agoconfigure.ac: bump version to 5.0.93 for the RC1 release
Derek Foreman [Thu, 14 Mar 2019 02:27:12 +0000 (21:27 -0500)]
configure.ac: bump version to 5.0.93 for the RC1 release

5 years agocompositor-drm: clear gbm_surface pointer after destroying the GBM surface
Philipp Zabel [Wed, 6 Mar 2019 10:12:47 +0000 (11:12 +0100)]
compositor-drm: clear gbm_surface pointer after destroying the GBM surface

Since commit ee1d968e641e ("compositor-drm: Fall back if GBM surface fails with
modifiers"), drm_output_init_egl requires output->gbm_surface to be NULL, or
gbm_surface_create will not be called if HAVE_GBM_MODIFIERS is enabled but no
modifiers are supported by the plane. This could happen if _init_egl is called
after drm_ouptut_fini_egl drom drm_output_switch_mode.

Add an assert to guarantee the requirement and clears the gbm_surface pointer
after the surface is destroyed.

Signed-off-by: Philipp Zabel <p.pzabel@pengutronix.de>
5 years agomeson: allow to build weston-simple-dmabuf-egl
Philipp Zabel [Tue, 5 Mar 2019 16:28:08 +0000 (17:28 +0100)]
meson: allow to build weston-simple-dmabuf-egl

It is all hooked up in clients/meson.build, just the option to enable it
was missing.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
5 years agoconfigure.ac: bump to version 5.0.92 for the beta release
Derek Foreman [Tue, 5 Mar 2019 23:21:49 +0000 (17:21 -0600)]
configure.ac: bump to version 5.0.92 for the beta release

5 years agoclients/simple-dmabuf-egl: Create the EGL display using the GBM platform
Alexandros Frantzis [Tue, 5 Mar 2019 10:51:14 +0000 (12:51 +0200)]
clients/simple-dmabuf-egl: Create the EGL display using the GBM platform

Since we are managing and rendering to buffers on our own with GBM,
create the EGL display using the GBM platform with the DRM render node,
instead of using the Wayland EGL platform.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
6 years agocompositor-drm: fix gbm_bo_get_handle_for_plane error handling
Philipp Zabel [Fri, 15 Feb 2019 13:52:00 +0000 (14:52 +0100)]
compositor-drm: fix gbm_bo_get_handle_for_plane error handling

gbm_bo_get_handle_for_plane returns -1 on error, not 0.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
6 years agocompositor-drm: Add missing newline to debug print
Daniel Stone [Sat, 16 Feb 2019 16:16:10 +0000 (16:16 +0000)]
compositor-drm: Add missing newline to debug print

The 'created new mode blob' print was missing a newline, unlike all the
others.

Signed-off-by: Daniel Stone <daniels@collabora.com>
6 years agoFix typos all around (thanks codespell!)
Emmanuel Gil Peyrot [Wed, 20 Feb 2019 15:33:32 +0000 (16:33 +0100)]
Fix typos all around (thanks codespell!)

6 years agoconfigure.ac: bump to version 5.0.91 for the alpha release
Derek Foreman [Tue, 19 Feb 2019 18:48:10 +0000 (12:48 -0600)]
configure.ac: bump to version 5.0.91 for the alpha release

6 years agocompositor: Fix scene-graph debug scope missing views based on sub-surfaces
Marius Vlad [Sun, 17 Feb 2019 20:14:23 +0000 (22:14 +0200)]
compositor: Fix scene-graph debug scope missing views based on sub-surfaces

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
6 years agocompositor-drm: Print pixel format in human-friendly form when failing to assign...
Marius Vlad [Sat, 16 Feb 2019 19:19:51 +0000 (21:19 +0200)]
compositor-drm: Print pixel format in human-friendly form when failing to assign view to a overlay plane

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
6 years agomeson: Remove freerdp1 as it no longer builds
Marius Vlad [Sat, 16 Feb 2019 18:43:24 +0000 (20:43 +0200)]
meson: Remove freerdp1 as it no longer builds

../libweston/compositor-rdp.c: In function ‘rdp_peer_refresh_rfx’:
../libweston/compositor-rdp.c:213:25: error: invalid type argument of unary ‘*’ (have ‘SURFACE_BITS_COMMAND’ {aka ‘struct _SURFACE_BITS_COMMAND’})
  memset(&cmd, 0, sizeof(*cmd));

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
6 years agoFix .editorconfig: use tabs for Meson files
emersion [Mon, 18 Feb 2019 10:21:07 +0000 (11:21 +0100)]
Fix .editorconfig: use tabs for Meson files

6 years agocompositor-drm: Fall back if GBM surface fails with modifiers
Daniel Stone [Thu, 31 Jan 2019 00:02:25 +0000 (00:02 +0000)]
compositor-drm: Fall back if GBM surface fails with modifiers

If we cannot create a gbm_surface using a list of modifiers, fall back
to using the old pre-modifier version.

This fixes initialisation on systems where KMS supports modifiers but
the GBM driver does not, such as old i915 systems like Pine View using
the unified KMS driver but the old i915 Mesa driver.

Signed-off-by: Daniel Stone <daniels@collabora.com>
6 years agoAdd .editorconfig
emersion [Fri, 15 Feb 2019 21:51:31 +0000 (22:51 +0100)]
Add .editorconfig

6 years agodesktop-shell: don't crash if a surface disappears while grabbed
Sergey Bugaev [Mon, 11 Feb 2019 19:55:09 +0000 (22:55 +0300)]
desktop-shell: don't crash if a surface disappears while grabbed

A surface can get destroyed while a shell grab is active, which can
for example happen if the command running in weston-terminal exits.

When a surface gets destroyed, grab->shsurf is reset to NULL by
destroy_shell_grab_shsurf(), but otherwise the grab remains active and
its callbacks continue to be called. Thus, dereferencing grab->shsurf
in a callback without checking it for NULL first can lead to undefined
behavior, including crashes.

Several functions were already properly checking grab->shsurf for NULL,
move_grab_motion() being one example. Others, however, were not, which
is what this commit fixes.

Related to https://gitlab.freedesktop.org/wayland/weston/issues/192

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
6 years agodesktop-shell: remove surface destroy listener when focus state is destroyed
Greg V [Thu, 6 Dec 2018 22:33:34 +0000 (01:33 +0300)]
desktop-shell: remove surface destroy listener when focus state is destroyed

Changing the focused surface did remove the surface_destroy_listener from the wl_signal list,
but destroying the focus state did not. As a result, sometimes the same listener would be added
to two surfaces, which would join their wl_signal lists together, which would cause infinite
loops and use-after-frees when closing desktop surfaces.

6 years agodesktop-shell: fix resize grab related crash
Greg V [Wed, 7 Nov 2018 21:24:56 +0000 (00:24 +0300)]
desktop-shell: fix resize grab related crash

This crash was happening when *releasing* a pointer button on a window
that was being resized and got destroyed during the grab.

[@daniels: Cosmetic fixes; apply same fix to grab cancel.]

6 years agoxwm: fix resize grab related crash
Greg V [Wed, 7 Nov 2018 21:27:04 +0000 (00:27 +0300)]
xwm: fix resize grab related crash

This crash was happening *during resizing* of an xwayland window that was destroyed.

Discovered by: John Good @archiesix

[@daniels: Moved tests below declarations.]

6 years agoxwayland: fix clipboard related crash
Greg V [Wed, 7 Nov 2018 21:24:15 +0000 (00:24 +0300)]
xwayland: fix clipboard related crash

6 years agomeson: fix compositor build with xwayland disabled
Philipp Zabel [Wed, 13 Feb 2019 14:59:59 +0000 (15:59 +0100)]
meson: fix compositor build with xwayland disabled

If xwayland is disabled, compositor/weston is built without
compositor/xwayland.c, which defines wet_load_xwayland.

  compositor/fb12c4d@@weston@exe/main.c.o: In function `main':
  ../weston-5.0.0-169-g2d4cc4f4dd6a/compositor/main.c:3103: undefined reference to `wet_load_xwayland'

Provide an empty stub for wet_load_xwayland if xwayland is disabled.
With that we also have to remove xwayland.c from the autotools build
if xwayland is disabled, to avoid a multiple definition error.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
6 years agomeson: add missing libweston EGL dependency if renderer-gl is enabled
Philipp Zabel [Wed, 13 Feb 2019 14:10:35 +0000 (15:10 +0100)]
meson: add missing libweston EGL dependency if renderer-gl is enabled

If the 'renderer-gl' option is enabled, ENABLE_EGL is defined, and
libweston/pixel-formats.c includes EGL/egl.h. This requires an egl
dependency, as X11-less platforms need the MESA_EGL_NO_X11_HEADERS
define from egl.pc cflags:

  In file included from /usr/include/EGL/egl.h:39:0,
                   from ../libweston/pixel-formats.c:42:
  /usr/include/EGL/eglplatform.h:124:10: fatal error: X11/Xlib.h: No such file or directory
  compilation terminated.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
6 years agomeson: IVI plugin tests do not use config
Pekka Paalanen [Wed, 6 Feb 2019 12:03:21 +0000 (14:03 +0200)]
meson: IVI plugin tests do not use config

If Weston is not installed, running ivi-layout test would fail on lots of image
files not found which presumably causes the creation of some ivi surfaces to
fail, leading to an assert failure.

Looking at the test setup in weston-tests-env, these IVI plugin tests are
supposed to run with --no-config instead.

Fixes: https://gitlab.freedesktop.org/wayland/weston/issues/195
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agomeson: set WESTON_DATA_DIR for tests
Pekka Paalanen [Wed, 6 Feb 2019 11:51:55 +0000 (13:51 +0200)]
meson: set WESTON_DATA_DIR for tests

It seems WESTON_DATA_DIR was missed. If you have already installed Weston, then
the files will be found in the install location, but if not, they were not
found at all.

This caused the xwayland test to SEGV the compositor in
weston_wm_window_create_frame() when frame_crate() returned NULL.

This patch fixes the test suite only.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agolibweston: bump major to 6
Pekka Paalanen [Fri, 8 Feb 2019 13:10:48 +0000 (15:10 +0200)]
libweston: bump major to 6

At least the following commits break the libweston ABI, strictly speaking:
a5630eafec4f139adf1da4a5ba54894715d7b50f
ce62cb3d05505777893ccdfacbf2a013c82e4ce2
195dadeb2add729735c32b9e394d7d1397cf065c
c18ffd3939499897fb3eefc6ff3627140d88a23d
ea54c2fda65aacd87c6385461dc7e7f7fb0d425d
27d7c395c7600e9bf6b13dd8b3d06ee19aab1aba
acff29b3b3c3ab804db54fcc8524df53b6b9e1fb
676296749a5ddb82d2f378829f419398602e5ce4
c9c247730b37a0101570f7a2596b1fb8b6ac66b5
65e1be1234fcbb7455fc9b41ac9916d258cf39f8

Furhtermore, 64fbd0f41f4eb175b772a2eddba8bfccb66e016a break the weston
executable exported ABI.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agocompositor-wayland: use xdg_shell stable instead of v6
ant8me [Wed, 28 Nov 2018 21:46:37 +0000 (22:46 +0100)]
compositor-wayland: use xdg_shell stable instead of v6

Better to excercise the current rather than outdated protocol.

Pekka:
- split the patch, rewrote commit message
- rename xdg_shell_ping to xdg_wm_base_ping
- rename xdg_shell_listener to wm_base_listener
- fix continued line alignment

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agoclients: use xdg_shell stable instead of v6
ant8me [Wed, 28 Nov 2018 21:46:37 +0000 (22:46 +0100)]
clients: use xdg_shell stable instead of v6

Now that Weston supports the stable revision, use it. Better to excercise the
current rather than outdated protocol.

Pekka:
- split the patch, rewrote commit message
- rename xdg_shell_ping to xdg_wm_base_ping
- rename xdg_shell_listener to wm_base_listener
- rename shell to wm_base
- fix continued line alignment
- drop unrelated change of adding parentheses around bit-wise and

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agolibweston-desktop: implement the new xdg_shell (stable) protocol
ant8me [Wed, 28 Nov 2018 21:46:37 +0000 (22:46 +0100)]
libweston-desktop: implement the new xdg_shell (stable) protocol

Some clients like the mpv video player now request the xdg_shell
protocol so these will fail if the compositor only provides the
xdg_shell_unstable_v6 protocol. Compositors like mir and gnome provide
both protocols.

The two protocols are very similar therefore the code in xdg-shell-v6.c
has been refactored to work with the new xdg_shell protocol and now
resides in xdg-shell.c.

Pekka:
- split the patch
- fix continued line alignment

Daniel
- allow anchor_rect to initially have zero dimensions
- account for get_popup allowing NULL parent surface

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Signed-off-by: Daniel Stone <daniels@collabora.com>
6 years agoconfigure: require opt-in to autotools
Pekka Paalanen [Fri, 1 Feb 2019 15:05:00 +0000 (17:05 +0200)]
configure: require opt-in to autotools

Autotools is going away. Break the autotools build so that people are
guaranteed to notice before it is gone. If they have problems with Meson, they
can still use --enable-autotools to build with autotools, but we really want to
hear about any problems.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agoREADME: Meson for build
Pekka Paalanen [Fri, 1 Feb 2019 15:01:14 +0000 (17:01 +0200)]
README: Meson for build

Explain how to use with Meson, as autotools is going away.

The instructions have been copied from
https://wayland.freedesktop.org/building.html .

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agoconfig-parser: export functions to open a config file
Michael Olbrich [Mon, 8 Oct 2018 14:04:44 +0000 (16:04 +0200)]
config-parser: export functions to open a config file

The in-tree clients can access the functions via libshared, but they are
currently not available for external clients, such as custom shell helper
applications similar to weston-desktop-shell or
weston-ivi-shell-user-interface.
The functions to read the content of the config are already exported.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
6 years agowindow client: remove ivi-application support
Michael Teyfel [Wed, 11 Oct 2017 15:17:29 +0000 (17:17 +0200)]
window client: remove ivi-application support

Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
6 years agosimple-shm: remove ivi-application support
Michael Teyfel [Wed, 11 Oct 2017 15:09:57 +0000 (17:09 +0200)]
simple-shm: remove ivi-application support

Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
6 years agosimple-egl: remove ivi-application support
Michael Teyfel [Tue, 17 Oct 2017 09:13:02 +0000 (11:13 +0200)]
simple-egl: remove ivi-application support

Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
6 years agohmi-controller: register for desktop_surface_configured
Michael Teyfel [Mon, 9 Apr 2018 12:14:50 +0000 (14:14 +0200)]
hmi-controller: register for desktop_surface_configured

Since ivi-shell now supports xdg-protocol, the surface_created listener
can be removed and the desktop_surface_configured listener is needed.
ivi-layout: libweston-desktop api is used to send configure event to
application.

Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
6 years agoivi-shell: create weston_desktop in wet_shell_init
Michael Teyfel [Tue, 17 Oct 2017 09:10:58 +0000 (11:10 +0200)]
ivi-shell: create weston_desktop in wet_shell_init

Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
6 years agoivi-shell: remove surface_destroy_listener
Michael Teyfel [Tue, 17 Oct 2017 09:10:18 +0000 (11:10 +0200)]
ivi-shell: remove surface_destroy_listener

Since the surface_destroy_listener is only registered for ivi-shell
applications, it should only be removed for ivi-shell applications.

Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
6 years agoivi-shell: added libweston-desktop-api implementation
Michael Teyfel [Tue, 5 Feb 2019 14:25:56 +0000 (15:25 +0100)]
ivi-shell: added libweston-desktop-api implementation

Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
6 years agoivi-layout: use libweston-desktop api for configure event
Michael Teyfel [Wed, 6 Feb 2019 15:10:09 +0000 (16:10 +0100)]
ivi-layout: use libweston-desktop api for configure event

The libweston-desktop api is used to send configure
event to application.

Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
6 years agoivi-layout: use libweston-desktop api for views
Michael Teyfel [Mon, 6 Nov 2017 11:55:07 +0000 (12:55 +0100)]
ivi-layout: use libweston-desktop api for views

Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
6 years agoivi-shell: linked libweston-desktop and added structs
Michael Teyfel [Fri, 1 Feb 2019 14:17:35 +0000 (15:17 +0100)]
ivi-shell: linked libweston-desktop and added structs

Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
6 years agoivi-layout: introduced surface create and configure
Michael Teyfel [Tue, 5 Feb 2019 14:15:22 +0000 (15:15 +0100)]
ivi-layout: introduced surface create and configure

Introduced surface create and configure function for xdg-apps.

Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
6 years agoivi-layout: introduced configure_desktop_changed
Michael Teyfel [Tue, 17 Oct 2017 09:03:38 +0000 (11:03 +0200)]
ivi-layout: introduced configure_desktop_changed

Introduced signal configure_desktop_changed with interface. This signal
should be sent, when a desktop-surface is configured.

Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
6 years agolayout-interface: added interface to change surface id
Michael Teyfel [Tue, 17 Oct 2017 08:35:47 +0000 (10:35 +0200)]
layout-interface: added interface to change surface id

This interface enables an id-agent to change the surface ids of an
ivi-layout-surface once.

Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
6 years agoivi-shell: introduction of IVI_INVALID_ID
Michael Teyfel [Tue, 17 Oct 2017 08:31:09 +0000 (10:31 +0200)]
ivi-shell: introduction of IVI_INVALID_ID

Introduction of IVI_INVALID_ID for xdg-shell applications.

Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
6 years agoivi-shell: removed assert
Michael Teyfel [Tue, 17 Oct 2017 08:29:21 +0000 (10:29 +0200)]
ivi-shell: removed assert

Removed assert, that checks if ivi-surface is not available, since this
can now happen with xdg-shell support.

Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
6 years agoivi-shell: rework goto labels to avoid memory leaks
Michael Teyfel [Tue, 26 Sep 2017 15:12:08 +0000 (17:12 +0200)]
ivi-shell: rework goto labels to avoid memory leaks

Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
6 years agolibweston: export weston_config API
Pekka Paalanen [Wed, 6 Feb 2019 14:42:09 +0000 (16:42 +0200)]
libweston: export weston_config API

Make it official that libweston will export the weston_config API, as requested
in https://gitlab.freedesktop.org/wayland/weston/merge_requests/29 .

There is no other way third party helper clients could access the API.

The autotools build has been accidentally exporting it all the time, but the
Meson build needed fixing.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agoclients: Add a mandelbrot set shader to simple-dmabuf-egl
Alexandros Frantzis [Tue, 29 Jan 2019 14:22:45 +0000 (16:22 +0200)]
clients: Add a mandelbrot set shader to simple-dmabuf-egl

Support drawing a mandelbrot set in the fragment shader, rendering it
with separate draw calls, one for each cell in a virtual 4x4 grid. This
more complex and heavy drawing will potentially help us to visually
discover any present or future explicit synchronization issues.

The mandelbrot set rendering is enabled with the -m/--mandelbrot
command-line switch.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
6 years agoclients: Support explicit synchronization in simple-dmabuf-egl
Alexandros Frantzis [Tue, 30 Oct 2018 12:26:47 +0000 (14:26 +0200)]
clients: Support explicit synchronization in simple-dmabuf-egl

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Changes in v7:
  - Merge acquire fence and release fence code blocks in redraw().
  - Use 1 << n to define option bitflags.
  - Remove redundant statement involving OPT_IMPLICIT_SYNC.

Changes in v6:
  - Add option for window size.
  - Add option for enabling/disabling explicit sync.

Changes in v5:
  - Meson support.

6 years agotests: Add tests for per commit zwp_buffer_release_v1 behavior
Alexandros Frantzis [Mon, 12 Nov 2018 16:33:54 +0000 (18:33 +0200)]
tests: Add tests for per commit zwp_buffer_release_v1 behavior

Add tests to check that the zwp_buffer_release_v1 events are emitted per
surface commit.

To be able to test this we need to use a renderer that holds the buffer
until the next buffer is committed, hence we use the pixman renderer.

Changes in v7:
  - Remove references to obsolete noop-hold renderer.

Changes in v5:
  - Meson support.

Changes in v4:
  - Use the pixman renderer instead of the (now gone) noop-hold
    renderer.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
6 years agolibweston: Support zwp_surface_synchronization_v1.get_release
Alexandros Frantzis [Fri, 19 Oct 2018 09:14:11 +0000 (12:14 +0300)]
libweston: Support zwp_surface_synchronization_v1.get_release

Implement the get_release request of the zwp_surface_synchronization_v1
interface.

This commit implements the zwp_buffer_release_v1 interface. It supports
the zwp_buffer_release_v1.fenced_release event for surfaces rendered by
the GL renderer, and the zwp_buffer_release_v1.immediate_release event
for other cases.

Note that the immediate_release event is safe to be used for surface
buffers used as planes in the DRM backend, since the backend releases
them only after the next page flip that doesn't use the buffers has
finished.

Changes in v7:
  - Remove "partial" from commit title and description.
  - Fix inverted check when clearing used_in_output_repaint flag.

Changes in v5:
  - Use the new, generic explicit sync server error reporting function.
  - Introduce and use weston_buffer_release_move.
  - Introduce internally and use weston_buffer_release_destroy.

Changes in v4:
  - Support the zwp_buffer_release_v1.fenced_release event.
  - Support release fences in the GL renderer.
  - Assert that pending state buffer_release is always NULL after a
    commit.
  - Simplify weston_buffer_release_reference.
  - Move removal of destroy listener before resource destruction to
    avoid concerns about use-after-free in
    weston_buffer_release_reference
  - Rename weston_buffer_release_reference.busy_count to ref_count.
  - Add documentation for weston_buffer_release and ..._reference.

Changes in v3:
  - Raise NO_BUFFER for get_release if no buffer has been committed,
    don't raise UNSUPPORTED_BUFFER for non-dmabuf buffers,
    so get_release works for all valid buffers.
  - Destroy the buffer_release object after sending an event.
  - Track lifetime of buffer_release objects per commit, independently
    of any buffers.
  - Use updated protocol interface names.
  - Use correct format specifier for resource ids.

Changes in v2:
  - Raise UNSUPPORTED_BUFFER at commit if client has requested a
    buffer_release, but the committed buffer is not a valid linux_dmabuf.
  - Remove tests that are not viable anymore due to our inability to
    create dmabuf buffers and fences in a unit-test environment.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
6 years agolibweston: Support zwp_surface_synchronization_v1.set_acquire_fence
Alexandros Frantzis [Fri, 19 Oct 2018 09:14:11 +0000 (12:14 +0300)]
libweston: Support zwp_surface_synchronization_v1.set_acquire_fence

Implement the set_acquire_fence request of the
zwp_surface_synchronization_v1 interface.

The implementation uses the acquire fence in two ways:

1. If the associated buffer is used as GL render source, an
   EGLSyncKHR is created from the fence and used to synchronize
   access.
2. If the associated buffer is used as a plane framebuffer,
   the acquire fence is treated as an in-fence for the atomic
   commit operation. If in-fences are not supported and the buffer
   has an acquire fence, we don't consider it for plane placement.

If the used compositor/renderer doesn't support explicit
synchronization, we don't advertise the protocol at all. Currently only
the DRM and X11 backends when using the GL renderer advertise the
protocol for production use.

Issues for discussion
---------------------

a. Currently, a server-side wait of EGLSyncKHR is performed before
   using the EGLImage/texture during rendering. Unfortunately, it's not clear
   from the specs whether this is generally safe to do, or we need to
   sync before glEGLImageTargetTexture2DOES. The exception is
   TEXTURE_EXTERNAL_OES where the spec mentions it's enough to sync
   and then glBindTexture for any changes to take effect.

Changes in v5:
  - Meson support.
  - Make explicit sync server error reporting more generic, supporting
    all explicit sync related interfaces not just
    wp_linux_surface_synchronization.
  - Fix typo in warning for missing EGL_KHR_wait_sync extension.
  - Support minor version 2 of the explicit sync protocol (i.e., support
    fences for opaque EGL buffers).

Changes in v4:
  - Introduce and use fd_clear and and fd_move helpers.
  - Don't check for a valid buffer when updating surface acquire fence fd
    from state.
  - Assert that pending state acquire fence fd is always clear
    after a commit.
  - Clarify that WESTON_CAP_EXPLICIT_SYNC applies to just the
    renderer.
  - Check for EGL_KHR_wait_sync before using eglWaitSyncKHR.
  - Dup the acquire fence before passing to EGL.

Changes in v3:
  - Keep acquire_fence_fd in surface instead of buffer.
  - Clarify that WESTON_CAP_EXPLICIT_SYNC applies to both backend and
    renderer.
  - Move comment about non-ownership of in_fence_fd to struct
    drm_plane_state definition.
  - Assert that we don't try to use planes with in-fences when using the
    legacy KMS API.
  - Remove unnecessary info from wayland error messages.
  - Handle acquire fence for subsurface commits.
  - Guard against self-update in fd_update.
  - Disconnect the client if acquire fence EGLSyncKHR creation or wait
    fails.
  - Use updated protocol interface names.
  - User correct format specifier for resource ids.
  - Advertise protocol for X11 backend with GL renderer.

Changes in v2:
  - Remove sync file wait fallbacks.
  - Raise UNSUPPORTED_BUFFER error at commit if we have an acquire
    fence, but the committed buffer is not a valid linux_dmabuf.
  - Don't put buffers with in-fences on planes that don't support
    in-fences.
  - Don't advertise explicit sync protocol if backend does not
    support explicit sync.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
6 years agolibweston: Introduce an internal linux sync file API
Alexandros Frantzis [Fri, 19 Oct 2018 09:14:11 +0000 (12:14 +0300)]
libweston: Introduce an internal linux sync file API

Introduce an internal API for dealing with linux sync files,
and use it in the codebase to replace ad-hoc sync file management.

The linux_sync_file_is_valid function is not currently used, but will be
utilized in upcoming commits to implement the
zwp_linux_explicit_synchronization_unstable_v1 protocol.

Changes in v5:
  - Meson support.

Changes in v3:
  - Use parameter name in function documentation.
  - Move kernel UAPI to separate header file.

Changes in v2:
  - Add function documentation
  - Remove linux_sync_file_wait()

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
6 years agolibweston: Introduce zwp_linux_explicit_synchronization_v1
Alexandros Frantzis [Fri, 19 Oct 2018 09:14:11 +0000 (12:14 +0300)]
libweston: Introduce zwp_linux_explicit_synchronization_v1

Introduce support for the zwp_linux_explicit_synchronization_unstable_v1
protocol with an implementation of the zwp_linux_explicit_synchronization_v1
interface.

Explicit synchronization provides a more versatile notification
mechanism for buffer readiness and availability, and can be used to
improve efficiency by integrating with related functionality in display
and graphics APIs.

In addition, the per-commit nature of the release events provided by
this protocol potentially offers a solution to a deficiency of the
wl_buffer.release event (see
https://gitlab.freedesktop.org/wayland/wayland/issues/46).

Support for this protocol depends on the capabilities of the backend, so
we don't register it by default but provide a function which each
backend will need to call. In this commit only the headless backend when
using the noop renderer supports this to enable testing.

Note that the zwp_surface_synchronization_v1 interface, which contains
the core functionality of the protocol, is not implemented in this
commit. Support for it will be added in future commits.

Changes in v7:
  - Added some information in the commit message about the benefits of
    the explicit sync protocol.

Changes in v6:
  - Fall back to advertising minor version 1 of the explicit sync protocol,
    although we support minor version 2 features, until the new
    wayland-protocols version is released.

Changes in v5:
  - Meson support.
  - Advertise minor version 2 of the explicit sync protocol.

Changes in v4:
  - Enable explicit sync support in the headless backend for all
    renderers.

Changes in v3:
  - Use wl_resource_get_version() instead of hardcoding version 1.
  - Use updated protocol interface names.
  - Use correct format specifier for resource id.
  - Change test name to 'linux-explicit-synchronization.weston'
    (s/_/-/g).

Changes in v2:
  - Move implementation to separate file so protocol can be registered
    on demand by backends.
  - Register protocol in headless+noop backend for testing purposes.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
6 years agotests: use weston_compositor_exit
Pekka Paalanen [Wed, 6 Feb 2019 08:53:35 +0000 (10:53 +0200)]
tests: use weston_compositor_exit

Use the proper function to exit instead of the libwayland one, to allow main
handle_exit() to be called.

This is just to unify the exit paths.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agoivi-shell: use weston_compositor_exit
Pekka Paalanen [Wed, 6 Feb 2019 08:48:51 +0000 (10:48 +0200)]
ivi-shell: use weston_compositor_exit

Use the proper function to exit instead of the libwayland one, to allow main
handle_exit() to be called.

This is just to unify the exit paths.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agodesktop-shell: use weston_compositor_exit
Pekka Paalanen [Wed, 6 Feb 2019 08:44:37 +0000 (10:44 +0200)]
desktop-shell: use weston_compositor_exit

Use the proper weston_compositor_exit API instead of wl_display_terminate() to
allow the compositor main to prepare for exit, and most importantly to set the
exit error code as appropriate.

I have some brokenness in my test suite running, and weston-desktop-shell was
crashing at start, yet the tests did not notice. With this patch, the tests
where the helper crashes are properly marked as failed.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agoweston: add more libinput config options
Eric Toombs [Fri, 1 Feb 2019 02:53:25 +0000 (21:53 -0500)]
weston: add more libinput config options

This is so that, for instance, people using weston as their main Wayland
compositor can invert the sense of two finger scrolling or change
pointer acceleration using weston.ini, rather than having to edit C
code.

All of the options that libinput itself exposes through its API are now
exposed in weston.ini.  The new options are called `tap-and-drag`,
`tap-and-drag-lock`, `disable-while-typing`, `middle-emulation`,
`left-handed`, `rotation`, `accel-profile`, `accel-speed`,
`scroll-method`, `natural-scroll`, and `scroll-button`. I have
successfully tested everything except for `rotation`, out of a lack of
hardware support.

weston now depends directly on libevdev for turning button name strings into
kernel input codes. This was needed for the `scroll-button` config
option. (weston already depends indirectly on libevdev through
libinput, so I figured people would be OK with this.) As a practical
matter for debian-style packagers, weston now has a build dependency on
libevdev-dev.

Right now, the code applies the same options to all attached devices
that a given option is relevant for. There are plans for multiple
[libinput] sections, each with different device filters, for users who
need more control here.

Signed-off-by: Eric Toombs <3672-ewtoombs@users.noreply.gitlab.freedesktop.org>
6 years agoweston: deprecate enable_tap in favour of enable-tap
Eric Toombs [Thu, 31 Jan 2019 23:24:04 +0000 (18:24 -0500)]
weston: deprecate enable_tap in favour of enable-tap

This is to increase consistency in config option naming in weston.ini.
(Prefer hyphens over underscores to separate words.)

If enable_tap is present in weston.ini, an obnoxious error message is
logged with weston_log(). In terms of configuration, if enable-tap is
present, enable_tap is ignored.

Signed-off-by: Eric Toombs <3672-ewtoombs@users.noreply.gitlab.freedesktop.org>
6 years agoman: fix small typo: directroy
Eric Toombs [Thu, 31 Jan 2019 22:43:17 +0000 (17:43 -0500)]
man: fix small typo: directroy

Signed-off-by: Eric Toombs <3672-ewtoombs@users.noreply.gitlab.freedesktop.org>
6 years agomeson: remind about weston-launch suid
Pekka Paalanen [Mon, 14 Jan 2019 17:44:45 +0000 (19:44 +0200)]
meson: remind about weston-launch suid

Since the Meson install step is not written to try to set the suid bit
automatically, remind the user that weston-launch needs to be
setuid-root to work.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
6 years agomeson: Fix deprecation warning for pkgconfig
Scott Anderson [Thu, 31 Jan 2019 23:11:31 +0000 (12:11 +1300)]
meson: Fix deprecation warning for pkgconfig

Meson 0.49 now issues a warning for libraries being passed into the
'libraries' keyword argument. Now they should be passed as a positional
argument.

See
https://mesonbuild.com/Release-notes-for-0-49-0.html#deprecation-warning-in-pkgconfig-generator

Signed-off-by: Scott Anderson <scott.anderson@collabora.com>
6 years agolibweston: fbdev: Force the Framebuffer devices to be activated.
n3rdopolis [Wed, 9 Jan 2019 01:59:58 +0000 (01:59 +0000)]
libweston: fbdev: Force the Framebuffer devices to be activated.

This attempts to wake up secondary framebuffer devices
(/dev/fb1 and up) as usually these devices start powered off, and
the FBIOPUT_VSCREENINFO ioctl turns it on. This was tested on qemu
with two virtual QXL cards. This is a more precise way to activate
framebuffer devices with the ioctl

6 years agogitlab-ci: Actually capture Meson logs
Daniel Stone [Thu, 31 Jan 2019 02:06:22 +0000 (02:06 +0000)]
gitlab-ci: Actually capture Meson logs

Correct the path to the build directory so we can capture Meson logs;
especially useful when tests fail like in #184.

An example of this change having been run with a deliberately-failing
test, capturing the Meson logs, can be found at:
https://gitlab.freedesktop.org/daniels/weston/-/jobs/94623

Signed-off-by: Daniel Stone <daniels@collabora.com>
6 years agoclients: sanitize XCURSOR_SIZE
emersion [Sun, 18 Nov 2018 20:42:10 +0000 (21:42 +0100)]
clients: sanitize XCURSOR_SIZE

Fixes https://gitlab.freedesktop.org/wayland/weston/issues/164

6 years agoweston: Add config option to enable pixman-based rendering
Thomas Zimmermann [Fri, 21 Sep 2018 09:50:32 +0000 (11:50 +0200)]
weston: Add config option to enable pixman-based rendering

Pixman can be used for rendering if the default GLESv2 rendering
is broken or cannot be used.

Pixman-based rendering is already available with the command-line
switch '--use-pixman'. This patch adds support for this option to
the configuration file. Putting

  [core]
  use-pixman=true

into 'weston.ini' enables pixman-based rendering for all backends
that support it. With this change, pixman has to be enabled only
once.

Fixes: https://gitlab.freedesktop.org/wayland/weston/issues/27
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
6 years agoweston: Store use_pixman as `bool` type
Thomas Zimmermann [Fri, 21 Sep 2018 12:44:57 +0000 (14:44 +0200)]
weston: Store use_pixman as `bool` type

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
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.