platform/upstream/weston.git
5 years agodoc/sphinx: No need for doxygen custom target
Marius Vlad [Mon, 1 Jul 2019 08:16:17 +0000 (11:16 +0300)]
doc/sphinx: No need for doxygen custom target

Unfortunate left over which was not removed once we had the script in
place to regenerate the documentation. A side-effect was the fact that
we still ran the script even if 'docs' target was called, effectively
nullifying the fact that 'docs' target was ran at all. For instance,
'install' would've been executing the script even if 'docs' target
was called before.

This removes the doxygen_target entirely and the depends of sphinx
target on it, makes building and installing docs a bit faster.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agocompositor: Support xdg_output_unstable_v1
Roman Gilg [Fri, 29 Mar 2019 12:01:06 +0000 (13:01 +0100)]
compositor: Support xdg_output_unstable_v1

The xdg-output resources are listed in each head struct. They become idle when
the respective weston_output has been removed again. The client is supposed to
destroy them explicitly afterwards.

After starting an XWayland client xrandr displays the logical size as expected.

Signed-off-by: Roman Gilg <subdiff@gmail.com>
5 years agobackend-drm: make linear modifier to default
Tomohito Esaki [Mon, 24 Jun 2019 08:23:44 +0000 (17:23 +0900)]
backend-drm: make linear modifier to default

Make the linear modifier to the default of DRM format modifiers if
supported modifiers isn't get from kernel driver.

5 years agodoc/sphinx: Force sphinx to re-build everything as to avoid stale docs
Marius Vlad [Fri, 28 Jun 2019 10:16:12 +0000 (13:16 +0300)]
doc/sphinx: Force sphinx to re-build everything as to avoid stale docs

With the introduction of the 'docs' target we make sure that we always
build the documentation, but currently breathe is unaware of the fact
that the doxygen XML database was changed in between runs. It is obvious
when changing only source code not rST bits.

This patch makes sphinx ignore the saved environment and always
rebuild the docs.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agoclients/presentation-shm: use xdg_shell instead of wl_shell
random human [Sat, 15 Jun 2019 17:32:05 +0000 (17:32 +0000)]
clients/presentation-shm: use xdg_shell instead of wl_shell

wl_shell is deprecated, and using xdg_shell allows the client to run on
compositors which do not implement the old protocol. Functionality
should be identical.

Signed-off-by: Astatos Aner <random.bored.human@gmail.com>
5 years agocompositor-drm: Split assign_planes() into separate file
Daniel Stone [Sat, 22 Jun 2019 17:40:31 +0000 (18:40 +0100)]
compositor-drm: Split assign_planes() into separate file

drm_assign_planes() is called to separate views out and decide what will
be taken out for plane composition and what will be left for the
renderer to compose.

It calls drm_output_propose_state() in order to find a good
configuration, which itself has a number of helpers that it calls. Break
these out into a separate file.

Signed-off-by: Daniel Stone <daniels@collabora.com>
5 years agocompositor-drm: Move state helpers to separate file
Daniel Stone [Tue, 18 Jun 2019 10:30:54 +0000 (11:30 +0100)]
compositor-drm: Move state helpers to separate file

Most of the state helpers (create, destroy, duplicate, etc) state, are
relatively straightforward and can live in a separate file.

Signed-off-by: Daniel Stone <daniels@collabora.com>
5 years agocompositor-drm: Move FB handling to a separate file
Daniel Stone [Tue, 18 Jun 2019 10:16:53 +0000 (11:16 +0100)]
compositor-drm: Move FB handling to a separate file

Move everything to do with creation, destruction, and reference handling
of drm_fbs to a new file.

Signed-off-by: Daniel Stone <daniels@collabora.com>
5 years agocompositor-drm: Move KMS API use to separate file
Daniel Stone [Tue, 18 Jun 2019 10:12:07 +0000 (11:12 +0100)]
compositor-drm: Move KMS API use to separate file

Create a new file which handles most of the actual KMS API use. This
covers the property handling (in which we map between KMS properties and
our internal representations), as well as actually applying state
through atomic modesetting or the legacy SetCrtc/PageFlip/DPMS APIs.

Signed-off-by: Daniel Stone <daniels@collabora.com>
5 years agocompositor-drm: Move mode handling to separate file
Daniel Stone [Mon, 17 Jun 2019 15:04:26 +0000 (16:04 +0100)]
compositor-drm: Move mode handling to separate file

Create a new file for the DRM backend's handling of output modes, e.g.
resolution, aspect ratio, preferred mode selection, EDID parsing.

Signed-off-by: Daniel Stone <daniels@collabora.com>
5 years agocompositor-drm: Pull EDID extraction into helper
Daniel Stone [Wed, 26 Jun 2019 21:56:39 +0000 (22:56 +0100)]
compositor-drm: Pull EDID extraction into helper

Create a helper function which populates a drm_head with the information
extracted from its connector's EDID and any other properties we can
find, such as physical size and connection status.

This is currently quite small, but may become more complex in future as
we parse EDID better. It also prepares to move this function into
another file in the next commit.

Signed-off-by: Daniel Stone <daniels@collabora.com>
5 years agocompositor-drm: Create header for backend internals
Daniel Stone [Mon, 17 Jun 2019 11:13:46 +0000 (12:13 +0100)]
compositor-drm: Create header for backend internals

Create a new header called drm-internal.h, and move many of drm.c's
declarations and helpers to it.

This will allow us to split the DRM backend into multiple files.

Signed-off-by: Daniel Stone <daniels@collabora.com>
5 years agodesktop-shell: Click top left and align clock
- [Wed, 26 Jun 2019 21:00:43 +0000 (21:00 +0000)]
desktop-shell: Click top left and align clock

Pads launchers with the empty space that used to be around them. Moving
pointer to 0,0 and clicking launches the preferred app. First launcher
has more padding at its start to look nice.

Moves the clock to the right edge with same padding. Keeps one of the
two values for text extents that the code was already retrieving but
never read. Horizontal panel position centers the clock.

Sets text in the panel, meaning tooltips and the clock, to consistent 14
units of the default system font at 85% of the max brightness, so it's
less tiring on eyes.

5 years agogl-renderer: Support EGL_KHR_partial_update
Daniel Stone [Fri, 8 Feb 2019 05:29:05 +0000 (05:29 +0000)]
gl-renderer: Support EGL_KHR_partial_update

partial_update is an EGL extension which allows us to inform the driver
ahead of time the limits of the areas we'll be writing to. This helps
performance for GPU hardware which renders into a local tile buffer:
informing the driver of the rendering extents means it can avoid
fetching unchanged tiles into the tile buffer and subsequently writing
them out.

The extension complements rather than replaces EGL_EXT_buffer_age (used
before partial_update to know which areas we need to update) and
EGL_KHR_swap_buffers_with_damage (used after partial_update to inform
the winsys of the changed region).

Note however that partial_update deals in buffer-damage regions ('what
has changed since the last time I used _this_ buffer?'), whereas
swap_buffers_with_damage deals in surface-damage regions ('what has
changed since the last time I rendered?'). An explanatory diagram can be
found in the specification:
https://www.khronos.org/registry/EGL/extensions/KHR/EGL_KHR_partial_update.txt

Fixes: #134
Signed-off-by: Daniel Stone <daniels@collabora.com>
5 years agogl-renderer: Add EGL_EXT_partial_update query
Daniel Stone [Fri, 8 Feb 2019 05:00:52 +0000 (05:00 +0000)]
gl-renderer: Add EGL_EXT_partial_update query

Query for the extension itself and the core entrypoint.

Signed-off-by: Daniel Stone <daniels@collabora.com>
5 years agogl-renderer: Demystify output repaint slightly
Daniel Stone [Tue, 25 Jun 2019 19:50:26 +0000 (20:50 +0100)]
gl-renderer: Demystify output repaint slightly

Add some comments in the function to make it clear what's going on,
especially as we twist and turn between a lot of things called 'damage'
meaning different things in different co-ordinate spaces.

Signed-off-by: Daniel Stone <daniels@collabora.com>
5 years agogl-renderer: Rename buffer_damage variable
Daniel Stone [Tue, 25 Jun 2019 19:30:59 +0000 (20:30 +0100)]
gl-renderer: Rename buffer_damage variable

The buffer_damage variable stores accumulated damage from previous
frames. This is the area that, before considering our current repaint
request, we need to repaint in order to bring the older buffer up to
date with the last buffer we rendered into.

Rename to previous_damage so it's a bit more clear what this refers to.

Signed-off-by: Daniel Stone <daniels@collabora.com>
5 years agogl-renderer: Rename border_damage variable
Daniel Stone [Tue, 25 Jun 2019 19:29:04 +0000 (20:29 +0100)]
gl-renderer: Rename border_damage variable

Technically it is storing which areas of the border are damaged.
However, we already have damage-region variables which need to be
translated by the border region. Rename the variable to not contain the
word 'damage' to reduce confusion.

Signed-off-by: Daniel Stone <daniels@collabora.com>
5 years agogl-renderer: Use helper for conversion to EGL rects
Daniel Stone [Fri, 8 Feb 2019 13:20:51 +0000 (13:20 +0000)]
gl-renderer: Use helper for conversion to EGL rects

eglSwapBuffersWithDamage has to convert a damage region from Weston's
global co-ordinate space, into the co-ordinate space for EGL rendering
into a buffer for that output.

The conversion from the global co-ordinate space in logical pixels to
the output space in buffer pixels is slightly long and error-prone,
involving translating by the output's offset within the global
co-ordinate space, multiplying by output scale, and also translating to
allow for any borders we paint around the output.

After this is done, we need to flip the co-ordinates in the Y axis to
account for the lower-left-origin co-ordinate space used by EGL.

Since we want to reuse this for partial_update, but using a different
source region, extract this conversion into a well-commented helper we
can reuse.

Signed-off-by: Daniel Stone <daniels@collabora.com>
5 years agogl-renderer: Don't use swap_buffers_with_damage with fan debug
Daniel Stone [Fri, 8 Feb 2019 05:26:54 +0000 (05:26 +0000)]
gl-renderer: Don't use swap_buffers_with_damage with fan debug

Fan debug mode repaints the whole surface in order to clear any 'trails'
left over from previous fan paints. If this happens, fall back to using
regular eglSwapBuffers rather than eglSwapBuffersWithDamageEXT, since
the damage region we would pass will be too small.

Signed-off-by: Daniel Stone <daniels@collabora.com>
5 years agogl-renderer: Convert remaining pseudo-bools to real bool
Daniel Stone [Fri, 8 Feb 2019 04:54:26 +0000 (04:54 +0000)]
gl-renderer: Convert remaining pseudo-bools to real bool

Use the actual boolean type instead of an integer for variables which
only hold true or false.

Signed-off-by: Daniel Stone <daniels@collabora.com>
5 years agogl-renderer: Convert extension pseudo-bools to real bool
Daniel Stone [Fri, 8 Feb 2019 04:54:26 +0000 (04:54 +0000)]
gl-renderer: Convert extension pseudo-bools to real bool

Use the actual boolean type instead of an integer for variables which
only hold true or false.

Signed-off-by: Daniel Stone <daniels@collabora.com>
5 years agopixel-formats: Remove duplicate doc string
Daniel Stone [Wed, 26 Jun 2019 11:26:28 +0000 (12:26 +0100)]
pixel-formats: Remove duplicate doc string

pixel_format_get_info() is already documented in the headers; no need to
also document it next to the code.

Signed-off-by: Daniel Stone <daniels@collabora.com>
5 years agodoc: Remove clang-parsing definitions
Daniel Stone [Wed, 26 Jun 2019 11:25:44 +0000 (12:25 +0100)]
doc: Remove clang-parsing definitions

These definitions were just set to the default (off), but their presence
causes Fedora's Doxygen to emit a warning as it is not compiled with
Clang support.

Remove them as they are no-ops anyway.

Signed-off-by: Daniel Stone <daniels@collabora.com>
5 years agogitlab-ci: Fix pages generation for the documentation
Marius Vlad [Tue, 25 Jun 2019 14:17:08 +0000 (17:17 +0300)]
gitlab-ci: Fix pages generation for the documentation

Fixes 0a13641ff: "gitlab-ci: Enable gitlab page for publishing documentation",
to point to correct sphinx documentation.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agogitlab-ci: Enable gitlab page for publishing documentation
Marius Vlad [Fri, 14 Jun 2019 13:00:07 +0000 (16:00 +0300)]
gitlab-ci: Enable gitlab page for publishing documentation

While adding pages, remove CI_JOB_ID and CI_JOB_SHA from PREFIX, as this
apparently is not needed. Make build-native-meson a dependency for the
pages stage.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agogitlab-ci: Install doxygen/sphinx/breathe and enable building documentation
Marius Vlad [Tue, 11 Jun 2019 08:57:40 +0000 (11:57 +0300)]
gitlab-ci: Install doxygen/sphinx/breathe and enable building documentation

Pinned down sphinx to 2.1.0 and breathe to 4.13.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agodoc/sphinx: Add 'weston_compositor', 'weston_output' and 'weston_head' API
Marius Vlad [Fri, 14 Jun 2019 10:25:40 +0000 (13:25 +0300)]
doc/sphinx: Add 'weston_compositor', 'weston_output' and 'weston_head' API

Demonstrates how to call/use the 'doxygen*' breathe directives. Make
use of previous patches that tag symbols using 'ingroup' doxygen
command.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agolibweston: Add ingroup tag for weston_compositor
Marius Vlad [Tue, 11 Jun 2019 13:08:55 +0000 (16:08 +0300)]
libweston: Add ingroup tag for weston_compositor

This is a continuation of "e2cc7aa40fd: libweston: Define head, output and
compositor group".

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agolibweston: Add ingroup tag for weston_output
Marius Vlad [Mon, 10 Jun 2019 22:15:35 +0000 (01:15 +0300)]
libweston: Add ingroup tag for weston_output

This is a continuation of "e2cc7aa40fd: libweston: Define head, output and
compositor group".

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agolibweston: Define head, output and compositor group
Marius Vlad [Mon, 10 Jun 2019 21:05:08 +0000 (00:05 +0300)]
libweston: Define head, output and compositor group

Also, add tag symbols related to 'weston_head'.

The bridge between sphinx and doxygen (breathe) has a useful directive:
doxygengroup. By using it we can scoop out symbols we'd like to display
documentation from/of.

At the same time some bits of the code has been using '\memberof' (a
doxygen command useful in C code to establish class like
relationship between objects and functions) but this seems not to be
recognized by the sphinx bridge.

Until we find a better solution, we replace '\memberof' command with
'\ingroup' one as to tag the symbols with an "object". This patch does
that for 'weston_head' object.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agodoc/sphinx: Add doxygen aliases for easier rst embedding
Marius Vlad [Thu, 6 Jun 2019 20:10:49 +0000 (23:10 +0300)]
doc/sphinx: Add doxygen aliases for easier rst embedding

With these aliases we can use rST directives inside comment blocks. This
adds also a doxygen command '\rststar' where ignores the asterisk --
typical to multi-line comment blocks.

While at it, add a simple example on how to use them.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agodoc/sphinx: Further configure doxygen
Marius Vlad [Fri, 14 Jun 2019 10:14:00 +0000 (13:14 +0300)]
doc/sphinx: Further configure doxygen

Turn warnings into errors so we can spot them immediately.

While at it: no need to generate class graphs as we're not using it and
make doxygen run quieter.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agoREADME/CONTRIBUTING: Markdown fixes
Marius Vlad [Fri, 14 Jun 2019 10:10:12 +0000 (13:10 +0300)]
README/CONTRIBUTING: Markdown fixes

Found while being parsed by doxygen (when used recursively), this fixes
the markdown bits as to be displayed properly.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agoclients: Fix/resolved doxygen warnings
Marius Vlad [Fri, 14 Jun 2019 10:04:52 +0000 (13:04 +0300)]
clients: Fix/resolved doxygen warnings

Missing/wrong parameters and '[out]' issues.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agopixel-formats: Fix doxygen warnings about missing format
Marius Vlad [Wed, 12 Jun 2019 13:25:07 +0000 (16:25 +0300)]
pixel-formats: Fix doxygen warnings about missing format

We already have documentation in header which conflicts with the one
the source code. Remove it entirely as it confuses user as well.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agolibweston: Fix/clean-up doxygen warnings
Marius Vlad [Wed, 12 Jun 2019 13:05:44 +0000 (16:05 +0300)]
libweston: Fix/clean-up doxygen warnings

This fixes warnings for weston-debug, input, compositor, log and
linux-explicit-sync. Warnings range from swapping '[in]', '[out]' with
the function arguments to wrong parameter names.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agoREADME: Add a few words about building weston documentation
Marius Vlad [Wed, 5 Jun 2019 10:29:16 +0000 (13:29 +0300)]
README: Add a few words about building weston documentation

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
5 years agobuild: Add sphinx/breathe support for generating documentation
Marius Vlad [Fri, 14 Jun 2019 09:41:02 +0000 (12:41 +0300)]
build: Add sphinx/breathe support for generating documentation

This is adds basic configuration files for doxygen and for breathe,
which is a doxygen-to-sphinx bridge that can document C symbols.

Breathe is configured with default project 'weston' and implicitly adds
:members: and :undoc-members: to breathe configuration options.
This allows a shorter way to call breathe directives without the need
specify the project and also to display implicitly all the members,
documented or not.

A 'docs' run_target to force the docs to be re-built has been added.
Initially (the first time the build system is ran) the documentation
will automatically be built, but later re-builds will require the use of
the 'docs' target. This avoid further delays in building weston but in
the same time allows the possiblity to update/improve the documentation
bits to those who want that.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
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.

5 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>
5 years agoci: run with werror
Simon Ser [Mon, 22 Apr 2019 17:02:19 +0000 (20:02 +0300)]
ci: run with werror

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