platform/upstream/weston.git
5 years agodoc: Move helper scripts to doc/scripts
Marius Vlad [Fri, 14 Jun 2019 07:43:40 +0000 (10:43 +0300)]
doc: Move helper scripts to doc/scripts

No functional change, just re-arrange bits in doc/.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agocompositor-drm: Remove legacy plane and vblank usage
Daniel Stone [Mon, 17 Jun 2019 10:23:25 +0000 (11:23 +0100)]
compositor-drm: Remove legacy plane and vblank usage

As of the previous commit, we never create state which uses overlay
planes on non-atomic drivers. We can thus remove the calls to
drmModeSetPlane.

The only time we ever waited for vblank events was when we had called
drmModeSetPlane and needed to make sure we waited until it was active.
We can thus also remove all the vblank event machinery.

Signed-off-by: Daniel Stone <daniels@collabora.com>
5 years agocompositor-drm: Only assign planes with atomic
Daniel Stone [Mon, 17 Jun 2019 10:13:20 +0000 (11:13 +0100)]
compositor-drm: Only assign planes with atomic

Without atomic modesetting, we have no way to know whether or not our
desired configuration is usable. It might fail for a number of reasons:
scaling limits, bandwidth limits, global resource (e.g. decompression)
unit contention, or really just anything.

Not only this, but there is no good way to ensure that our configuration
actually lands together in the same refresh cycle - hence the 'atomic'
in atomic modesetting. Some drivers implement a synchronously blocking
drmModeSetPlane, whereas others return immediately. Using overlay planes
can thus decimate your framerate.

The pre-atomic API is not extensible either, so we need numerous out
clauses: fail if we're cropping or scaling (sometimes), or changing
formats, or fencing, or ...

Now we've had atomic support stable for a couple of releases, just
remove support for doing anything more fancy than displaying our
composited output and a cursor with drivers which don't support atomic
modesetting.

Support for using overlay planes was already disabled by default when
using the legacy API, and required a debug key combination to toggle it
on by flipping the sprites_are_broken variable. We can ensure that we
never try to use it on legacy by simply ignoring the hotkey when in
legacy mode.

Signed-off-by: Daniel Stone <daniels@collabora.com>
5 years agobackend-rdp: allow to force compression off
Stefan Agner [Thu, 20 Jun 2019 14:27:27 +0000 (16:27 +0200)]
backend-rdp: allow to force compression off

By default the client communicates its preference with regards to
compression to the server. However, some clients always use
compression, which is not ideal for certain environments (e.g.
low performance embedded devices in a local network with plenty
of bandwidth). Allow to disable compression server-side which will
override the clients request for compression.

Signed-off-by: Stefan Agner <stefan@agner.ch>
5 years agobackend-rdp: fix memory leak
Stefan Agner [Mon, 17 Jun 2019 10:33:35 +0000 (12:33 +0200)]
backend-rdp: fix memory leak

Free command data after all rects have been updated. This fixes a
rather huge memory leak when using the RDP backend.

Signed-off-by: Stefan Agner <stefan@agner.ch>
5 years agobuild: Fix hint to disable remoting
Silva Alejandro Ismael [Mon, 17 Jun 2019 14:35:54 +0000 (11:35 -0300)]
build: Fix hint to disable remoting

If a dependency is missing, the error message should tell the build option to disable it.

Show the correct build option in the error message of the remoting plugin.

Signed-off-by: Silva Alejandro Ismael <silva.alejandro.ismael@gmail.com>
5 years agobackend-drm: handle multiple drm nodes with logind
Robert Beckett [Thu, 13 Jun 2019 15:55:44 +0000 (16:55 +0100)]
backend-drm: handle multiple drm nodes with logind

When using logind launcher, we receive a PauseDevice "gone" message
from logind session management for each device we close while looking
for KMS devices.

Make logind notify the backend of the device add/remove so that the
backend can decide what to do, instead of assuming that if it is a
DRM_MAJOR device the session should be (de)activated. The backend can
then react to its specific device.

Fixes #251

Signed-off-by: Robert Beckett <bob.beckett@collabora.com>
5 years agocompositor-drm: run finish_frame when dpms is turned off in update_complete
Tomohito Esaki [Wed, 27 Mar 2019 06:45:33 +0000 (15:45 +0900)]
compositor-drm: run finish_frame when dpms is turned off in update_complete

A output repaint loop isn't scheduled beacuse the output repaint_status
is AWAITING_COMPLETION when dmps is turned off in update_complete().
Therefore, the display attached to the output is remain inactive even if
weston wakes up. By going through finish_frame, the output
repaint_status is fixed to correct status.

Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
5 years agoDefault build to warning_level=3
Daniel Stone [Tue, 11 Jun 2019 10:41:41 +0000 (11:41 +0100)]
Default build to warning_level=3

After suppressing the pedantic errors, we can now enable a higher
warning_level by default, so developers can catch warnings earlier.

Signed-off-by: Daniel Stone <daniels@collabora.com>
5 years agobuild: Suppress 'pedantic' GCC warnings
Daniel Stone [Tue, 11 Jun 2019 10:40:13 +0000 (11:40 +0100)]
build: Suppress 'pedantic' GCC warnings

GCC's 'pedantic' warnings warn about a bunch of things which are true of
ISO C but not the toolchains we care about (GCC, Clang). Suppress those
warnings to allow us to build with Meson's warning_level=3.

Signed-off-by: Daniel Stone <daniels@collabora.com>
5 years agodesktop-shell: unmap a view which was faded out
Tomohito Esaki [Mon, 1 Apr 2019 08:50:14 +0000 (17:50 +0900)]
desktop-shell: unmap a view which was faded out

When Fading out a destroyed surface view finishes, the view is rendered
with very little alpha. After that, since the output isn't updated
unless a event on the output doesn't occurs, the view is still on the
output. By unmapping the view, the output repaint scheduled without the
surface.

Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
5 years agoweston: Properly test for output-creation failure
Daniel Stone [Tue, 11 Jun 2019 10:32:14 +0000 (11:32 +0100)]
weston: Properly test for output-creation failure

We were testing the wrong variable to see if output creation had failed:
instead of testing the return of the function we'd just called, we were
testing something we'd already checked earlier.

Signed-off-by: Daniel Stone <daniels@collabora.com>
5 years agotimespec: Don't return value from void function
Daniel Stone [Mon, 22 Apr 2019 17:09:27 +0000 (18:09 +0100)]
timespec: Don't return value from void function

timespec_add_msec() doesn't return any values, so don't try to return
any.

Signed-off-by: Daniel Stone <daniels@collabora.com>
5 years agodbus: Don't return value from void function
Daniel Stone [Mon, 22 Apr 2019 17:05:56 +0000 (18:05 +0100)]
dbus: Don't return value from void function

Just discard the value, rather than trying to return a value from a void
function.

Signed-off-by: Daniel Stone <daniels@collabora.com>
5 years agodesktop-shell: Re-position views when outputs change
Harish Krupo [Sat, 20 Apr 2019 12:20:18 +0000 (17:50 +0530)]
desktop-shell: Re-position views when outputs change

When the last output is destroyed or when a new output is created after
the last output is destroyed, we need to re-position the views to ensure
that all the views are displayed on the output.

Fixes: https://gitlab.freedesktop.org/wayland/weston/issues/210
Signed-off-by: Harish Krupo <harishkrupo@gmail.com>
5 years agodesktop-shell: Don't re-position views when output_list is empty
Harish Krupo [Sat, 20 Apr 2019 12:40:56 +0000 (18:10 +0530)]
desktop-shell: Don't re-position views when output_list is empty

Signed-off-by: Harish Krupo <harishkrupo@gmail.com>
5 years agoFix build with kernel < 4.4
Fabrice Fontaine [Mon, 10 Jun 2019 10:02:03 +0000 (12:02 +0200)]
Fix build with kernel < 4.4

weston includes input-event-codes.h since version 5.0.91 and
https://github.com/wayland-project/weston/commit/6e229ca26381bc8191fd9af1e439c311da709aff

input-event-codes.h is available only since kernel 4.4 and
https://github.com/torvalds/linux/commit/f902dd893427eade90f7eaf858e5ff8b150a5a12

To fix this build failure, replace include on linux/input-event-codes.h
by linux/input.h

Fixes:
 - http://autobuild.buildroot.org/results/210c2759900f15ea0030d088f6f45cd8bb199b29

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
5 years agocompositor: fix segfaults if wl_display_create fails
Silva Alejandro Ismael [Fri, 31 May 2019 19:39:43 +0000 (16:39 -0300)]
compositor: fix segfaults if wl_display_create fails

Added check to log the error if wl_display_create return NULL.

Fixes: #101
Signed-off-by: Silva Alejandro Ismael <silva.alejandro.ismael@gmail.com>
5 years agocompositor: Fix incorrect use of bool options
Scott Anderson [Wed, 29 May 2019 06:27:30 +0000 (18:27 +1200)]
compositor: Fix incorrect use of bool options

WESTON_OPTION_BOOLEAN takes a pointer to an int as an argument, but
there were several cases of being passed a pointer to a bool instead.
This changes it to use a local int instead, and then write that value to
the bool.

Signed-off-by: Scott Anderson <scott.anderson@collabora.com>
5 years agoFix build-time warning with meson 0.50.1
Antonio Borneo [Fri, 24 May 2019 10:53:39 +0000 (12:53 +0200)]
Fix build-time warning with meson 0.50.1

Commit 6666dee52b1e ("man: Add weston-bindings(7) describing
desktop shell shortcuts") adds in file "man/meson.build" the line
        install: true,
This line triggers a warning with meson 0.50.1:
        WARNING: Project targetting '>= 0.47' but tried to use
        feature introduced in '0.50.0': install arg in configure_file

Accordingly with
        https://github.com/mesonbuild/meson/issues/5048
the line was silently ignored by meson before 0.50.0

One possible fix for this warning would require updating the
minumum version of meson required by weston, but then forcing every
builder to update meson.
Instead, since all the other instances in "man/meson.build" of
configure_file don't use the feature "install:", it seams safe to
simply remove the feature for the instal of "weston-bindings.man".

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
5 years agoman: Add weston-bindings(7) describing desktop shell shortcuts
Manuel Stoeckl [Wed, 27 Mar 2019 01:00:55 +0000 (21:00 -0400)]
man: Add weston-bindings(7) describing desktop shell shortcuts

The desktop-shell-specific bindings were identified from
shell_add_bindings in desktop-shell/shell.c. Various general shortcuts
(like Ctrl+Alt+F) are provided by files in libweston/ and compositor/ .

Also introduce references to the new manual in weston(1) and weston.ini(5).

Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
5 years agoman: Update "See also" references for weston.1
Manuel Stoeckl [Sat, 23 Mar 2019 23:03:59 +0000 (19:03 -0400)]
man: Update "See also" references for weston.1

Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
5 years agobackend-fbdev: more into new subdir
Pekka Paalanen [Fri, 5 Apr 2019 10:23:53 +0000 (13:23 +0300)]
backend-fbdev: more into new subdir

For consistency with other backends.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
5 years agobackend-x11: move into new subdir
Pekka Paalanen [Fri, 5 Apr 2019 10:20:53 +0000 (13:20 +0300)]
backend-x11: move into new subdir

For consistency with other backends.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
5 years agobackend-wayland: move into new subdir
Pekka Paalanen [Fri, 5 Apr 2019 10:17:22 +0000 (13:17 +0300)]
backend-wayland: move into new subdir

For consistency with other backends.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
5 years agobackend-rdp: move into new subdir
Pekka Paalanen [Fri, 5 Apr 2019 10:14:15 +0000 (13:14 +0300)]
backend-rdp: move into new subdir

For consistency with other backends.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
5 years agobackend-headless: move into new subdir
Pekka Paalanen [Fri, 5 Apr 2019 10:11:01 +0000 (13:11 +0300)]
backend-headless: move into new subdir

For consistency with other backends.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
5 years agobackend-drm: move into new subdir
Pekka Paalanen [Fri, 5 Apr 2019 09:58:27 +0000 (12:58 +0300)]
backend-drm: move into new subdir

Move the DRM-backend into a new sub-directory to make it stand out from
libweston core. This facilitates splitting drm.c into more files later.

vaapi-recorder is used only by DRM-backend, move that too.

libbacklight is used only by DRM-backend and a manual test program, and is
moved as well.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
5 years agotests: build setbacklight
Pekka Paalanen [Fri, 5 Apr 2019 09:45:46 +0000 (12:45 +0300)]
tests: build setbacklight

Was missed in the Meson migration.

This is built only if DRM-backend is built, because it exercises a sub-feature
of the DRM-backend.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
5 years agobuild: make backlight a helper lib
Pekka Paalanen [Fri, 5 Apr 2019 09:28:14 +0000 (12:28 +0300)]
build: make backlight a helper lib

Right now only used by the DRM-backend, but there is a test program that should
use this as well.

This helps with building the test program and moving DRM-backend into a
subdirectory.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
5 years agobuild: make libinput-backend a helper lib
Pekka Paalanen [Fri, 5 Apr 2019 09:04:58 +0000 (12:04 +0300)]
build: make libinput-backend a helper lib

Rather than having fbdev and drm backends include the libinput files ad hoc,
wrap them in a static library. Using the dependency object for that helper
library will then automatically pull in any necerray include dirs for the
users.

This helps with moving the backends into subdirectories.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
5 years agobuild: libweston doesn't need -export-dynamic
Marius Vlad [Tue, 30 Apr 2019 17:26:32 +0000 (20:26 +0300)]
build: libweston doesn't need -export-dynamic

According to https://gitlab.freedesktop.org/wayland/weston/merge_requests/159#note_148104
it doesn't make sense to use export-dynamic on libraries.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Reported-by: Pekka Paalanen <pekka.paalanen@collabora.com>
5 years agoinclude: Install weston-debug header
Marius Vlad [Mon, 29 Apr 2019 10:33:54 +0000 (13:33 +0300)]
include: Install weston-debug header

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agolibweston: Add weston-debug header to libweston
Marius Vlad [Mon, 29 Apr 2019 10:27:47 +0000 (13:27 +0300)]
libweston: Add weston-debug header to libweston

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agoweston-debug: Remove weston_compositor from weston_log_context
Marius Vlad [Wed, 17 Apr 2019 10:50:28 +0000 (13:50 +0300)]
weston-debug: Remove weston_compositor from weston_log_context

This is no longer needed. Also assert if the context passed is NULL and
compositor log context is already set.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agolibweston: Rename weston_debug_scope_ to weston_log_scope_
Marius Vlad [Wed, 17 Apr 2019 10:47:06 +0000 (13:47 +0300)]
libweston: Rename weston_debug_scope_ to weston_log_scope_

Rename also the functions which work on weston_log_scope.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agolibweston: Rename weston_debug_scope to weston_log_scope
Marius Vlad [Wed, 17 Apr 2019 10:05:38 +0000 (13:05 +0300)]
libweston: Rename weston_debug_scope to weston_log_scope

This is a continuation of the previous patch to align more closely to
the weston log framework.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agolibweston: Rename weston_debug_compositor to weston_log_context
Marius Vlad [Wed, 17 Apr 2019 09:35:38 +0000 (12:35 +0300)]
libweston: Rename weston_debug_compositor to weston_log_context

As we transition towards a more generic API for weston loggging
framework rename weston_debug_compositor to weston_log_context to show
the fact that this is not really debug but a logging context.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agocompositor: Convert weston-debug framework to use weston_debug_compositor
Marius Vlad [Sun, 7 Apr 2019 16:07:16 +0000 (19:07 +0300)]
compositor: Convert weston-debug framework to use weston_debug_compositor

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agolibweston: Decouple weston_debug_compositor from weston_compositor
Marius Vlad [Sun, 7 Apr 2019 14:07:58 +0000 (17:07 +0300)]
libweston: Decouple weston_debug_compositor from weston_compositor

This patch allows initialization of weston-debug/log framework much earlier
than weston_compositor, which in turn will provide the option start
logging before weston_compositor has been created.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agogitlab-ci: Use gitlab.fdo URL for wayland-protocols
Harish Krupo [Thu, 9 May 2019 09:56:04 +0000 (15:26 +0530)]
gitlab-ci: Use gitlab.fdo URL for wayland-protocols

Signed-off-by: Harish Krupo <harishkrupo@gmail.com>
5 years agolibweston: Remove functions with no implementation/definition
Marius Vlad [Mon, 6 May 2019 17:15:06 +0000 (20:15 +0300)]
libweston: Remove functions with no implementation/definition

Seems that these functions: weston_compositor_fade()/weston_compositor_unlock()
lost their implementation a while ago.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agolog: remove "%m" from format strings by using strerror(errno)
Antonio Borneo [Fri, 26 Apr 2019 21:57:31 +0000 (23:57 +0200)]
log: remove "%m" from format strings by using strerror(errno)

The printf() format specifier "%m" is a glibc extension to print
the string returned by strerror(errno). While supported by other
libraries (e.g. uClibc and musl), it is not widely portable.

In Weston code the format string is often passed to a logging
function that calls other syscalls before the conversion of "%m"
takes place. If one of such syscall modifies the value in errno,
the conversion of "%m" will incorrectly report the error string
corresponding to the new value of errno.

Remove all the occurrences of the specifier "%m" in Weston code
by using directly the string returned by strerror(errno).
While there, fix some minor indentation issue.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
5 years agozunitc: Fix undeclared identifier 'NULL'
- [Thu, 2 May 2019 17:35:29 +0000 (17:35 +0000)]
zunitc: Fix undeclared identifier 'NULL'

Since v6 release, -Dtest-junit-xml=false build regressed because its
ifdef branch no longer includes stddef.h and thus NULL, either directly
or through another header. Using musl-1.1.22 and llvm-8.0.0.

6 years agoclients: close unused keymap fd
Antonio Borneo [Mon, 29 Apr 2019 15:54:10 +0000 (17:54 +0200)]
clients: close unused keymap fd

In the simple examples in which keymap is not handled, the open
descriptor has to be properly closed.

After each suspend/resume sequence the keymap is send again to
every client. On client weston-simple-egl the leak causes a
segfault when no more file descriptors can be opened.

Close the file descriptor and lazily copy/paste the comment
already available in simple-dmabuf-v4l.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
6 years agoci: run with werror
Simon Ser [Mon, 22 Apr 2019 17:02:19 +0000 (20:02 +0300)]
ci: run with werror

6 years agoweston-launch: Fix warning on error() not being avaiable due to removal of header
Marius Vlad [Mon, 22 Apr 2019 14:22:57 +0000 (17:22 +0300)]
weston-launch: Fix warning on error() not being avaiable due to removal of header

Commit a1450a8a7 removed errno header but forgot to remove all error()
calls.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
6 years agomake error() portable
Randy Li [Thu, 18 Apr 2019 03:37:12 +0000 (11:37 +0800)]
make error() portable

error() is not posix but gnu extension so may not be available on all
kind of systemsi e.g. musl.

Signed-off-by: Randy 'ayaka' Li <ayaka@soulik.info>
Signed-off-by: Randy Li <randy.li@rock-chips.com>
6 years agoweston-terminal: Fix weston-terminal crash on mutter
Sebastian Wick [Tue, 9 Apr 2019 10:18:25 +0000 (12:18 +0200)]
weston-terminal: Fix weston-terminal crash on mutter

Set up handlers for wl_data_source v3 events

Signed-off-by: Sebastian Wick <sebastian@sebastianwick.net>
6 years agoFix: clients/window: Premature finish request when copy-pasting
Harish Krupo [Fri, 19 Apr 2019 16:36:44 +0000 (22:06 +0530)]
Fix: clients/window: Premature finish request when copy-pasting

As per the wl_data_offer::finish documentation, the request is only
valid for drag n drop operations and signifies that a dnd is completed.
Send finish request only when we have a dnd operation active.

Signed-off-by: Harish Krupo <harishkrupo@gmail.com>
6 years agodata-device: send INVALID_FINISH when operation != dnd
Harish Krupo [Fri, 19 Apr 2019 16:36:37 +0000 (22:06 +0530)]
data-device: send INVALID_FINISH when operation != dnd

The documentation of wl_data_offer::finish states that it should be
used to signify that a drag and drop operation is completed. So send
WL_DATA_OFFER_ERROR_INVALID_FINISH when the client calls the finish
request but the operation isn't dnd.

Signed-off-by: Harish Krupo <harishkrupo@gmail.com>
6 years agowindow.c: Don't assume registry advertisement order
Harish Krupo [Thu, 18 Apr 2019 20:23:27 +0000 (01:53 +0530)]
window.c: Don't assume registry advertisement order

The toytoolkit assumes that wl_seats are advertised after
wl_data_device_manager and creates a data_device during wl_seat
registry binding. This patch removes this assumption by creating
data_devices for all the wl_seats created up until then.

Fixes: https://gitlab.freedesktop.org/wayland/weston/issues/201
Signed-off-by: Harish Krupo <harishkrupo@gmail.com>
6 years agolibweston: move gl-renderer into a subdir
Pekka Paalanen [Thu, 4 Apr 2019 14:29:27 +0000 (17:29 +0300)]
libweston: move gl-renderer into a subdir

GL-renderer is expected to grow more files, both by addition and by splitting.
Moving them into a new subdirectory helps people to understand which files are
relevant.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agogl-renderer: does not need matrix.c
Pekka Paalanen [Thu, 4 Apr 2019 14:19:54 +0000 (17:19 +0300)]
gl-renderer: does not need matrix.c

The symbols of matrix.c are already exported by libweston, no need to build
them again.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agolibweston: export weston_linux_sync_file_read_timestamp()
Pekka Paalanen [Thu, 4 Apr 2019 14:11:53 +0000 (17:11 +0300)]
libweston: export weston_linux_sync_file_read_timestamp()

This is an internal export for GL-renderer, so that it does not need to build
linux-sync-file.c a second time. This follows the example of
linux-explicit-synchronization.c which is also used by GL-renderer.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agobuild: turn vertex-clipping.c into a dependency
Pekka Paalanen [Thu, 4 Apr 2019 13:53:11 +0000 (16:53 +0300)]
build: turn vertex-clipping.c into a dependency

Making this into a dependency object not only carries the .c files with it, but
it also brings the include directories as well, which means the users can
simply use the object without guessing the paths.

This should help with moving GL-renderer into a new subdirectory.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agoMove libweston-desktop.h
Pekka Paalanen [Thu, 4 Apr 2019 13:02:14 +0000 (16:02 +0300)]
Move libweston-desktop.h

This too is a public installed header.

The public headers are moved under a new top-level directory include/ to make
them clearly stand out as special (public API).

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agoxwayland: do not include weston.h
Pekka Paalanen [Thu, 4 Apr 2019 12:54:07 +0000 (15:54 +0300)]
xwayland: do not include weston.h

weston.h is a Weston frontend header, while this is a libweston plugin. A
libweston plugin cannot depend on Weston. Luckily the header is not actually
needed.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agoRename version.h to libweston/version.h
Pekka Paalanen [Thu, 4 Apr 2019 12:41:02 +0000 (15:41 +0300)]
Rename version.h to libweston/version.h

This is an installed public header, and without the subdir would surely
conflict with something else.

include/libweston/meson.build is necessary for putting the generated header in
the right subdirectory so that '#include <libweston/version.h>' can work.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agoRename xwayland-api.h to libweston/xwayland-api.h
Pekka Paalanen [Thu, 4 Apr 2019 12:52:47 +0000 (15:52 +0300)]
Rename xwayland-api.h to libweston/xwayland-api.h

See "Rename compositor.h to libweston/libweston.h" for rationale.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agoRename zalloc.h to libweston/zalloc.h
Pekka Paalanen [Thu, 4 Apr 2019 11:46:00 +0000 (14:46 +0300)]
Rename zalloc.h to libweston/zalloc.h

It is a public installed header used by libweston.h.

See "Rename compositor.h to libweston/libweston.h" for rationale.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agoRename config-parser.h to libweston/config-parser.h
Pekka Paalanen [Thu, 4 Apr 2019 11:27:31 +0000 (14:27 +0300)]
Rename config-parser.h to libweston/config-parser.h

It is a public installed header used by libweston.h.

See "Rename compositor.h to libweston/libweston.h" for rationale.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agoRename matrix.h to libweston/matrix.h
Pekka Paalanen [Thu, 4 Apr 2019 10:47:40 +0000 (13:47 +0300)]
Rename matrix.h to libweston/matrix.h

matrix.h is a public installed header and even used by libweston.h.

See "Rename compositor.h to libweston/libweston.h" for rationale.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agoRename windowed-output-api.h to libweston/windowed-output-api.h
Pekka Paalanen [Fri, 29 Mar 2019 15:14:29 +0000 (17:14 +0200)]
Rename windowed-output-api.h to libweston/windowed-output-api.h

See "Rename compositor.h to libweston/libweston.h" for rationale.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agoRename plugin-registry.h to libweston/plugin-registry.h
Pekka Paalanen [Fri, 29 Mar 2019 15:07:34 +0000 (17:07 +0200)]
Rename plugin-registry.h to libweston/plugin-registry.h

See "Rename compositor.h to libweston/libweston.h" for rationale.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agoRename public backend headers
Pekka Paalanen [Fri, 29 Mar 2019 14:39:12 +0000 (16:39 +0200)]
Rename public backend headers

The backend headers are renamed from compositor-foo.h to backend-foo.h to
better describe their purpose. These headers are public libweston API for each
specific backend.

The headers will also be used like

 #include <libweston/backend-drm.h>

instead of

 #include <compositor-drm.h>

to give them a more explicit namespace.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agoRename compositor.h to libweston/libweston.h
Pekka Paalanen [Thu, 28 Mar 2019 14:28:47 +0000 (16:28 +0200)]
Rename compositor.h to libweston/libweston.h

The main idea is to make libweston users use the form

 #include <libweston/libweston.h>

instead of the plain

 #include <compositor.h>

which is prone to name conflicts. This is reflected both in the installed
files, and the internal header search paths so that Weston would use the exact
same form as an external project using libweston would.

The public headers are moved under a new top-level directory include/ to make
them clearly stand out as special (public API).

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agoRename timeline-object.h to libweston/timeline-object.h
Pekka Paalanen [Thu, 28 Mar 2019 14:35:56 +0000 (16:35 +0200)]
Rename timeline-object.h to libweston/timeline-object.h

This patch sets up the stage for similarly renaming compositor.h which will
justify this. That patch will be big, so moving timeline-object.h first makes
it easy to see the changes to the build and install directives.

This and all the following moves essentially break the API, so libweston major
is bumped.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 years agobuild: declare separate dependency for compositor.h
Pekka Paalanen [Fri, 29 Mar 2019 11:35:15 +0000 (13:35 +0200)]
build: declare separate dependency for compositor.h

These are not specific to the launchers but to compositor.h, so name them that
way.

Once we can rely on the mentioned Meson PR, we can simplify this further.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
6 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>
6 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>
6 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>
6 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>
6 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>
  ^~~~~~~

6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 years agoOptimize PNGs with zopflipng
Riku Viitanen [Thu, 28 Mar 2019 10:09:52 +0000 (10:09 +0000)]
Optimize PNGs with zopflipng

6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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>
6 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

6 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>
6 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

6 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>