Commit graph

6709 commits

Author SHA1 Message Date
Daniel Stone 30f5863756 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>
2019-06-26 12:28:03 +01:00
Daniel Stone dad2f4046d 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>
2019-06-26 12:28:03 +01:00
Daniel Stone 55bcb93fef 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>
2019-06-26 12:28:03 +01:00
Daniel Stone a7722ee92a 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>
2019-06-26 12:28:03 +01:00
Daniel Stone 8e3c8c4b88 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>
2019-06-26 12:28:03 +01:00
Daniel Stone d83c1eca92 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>
2019-06-26 12:28:03 +01:00
Daniel Stone bc4ccc2085 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>
2019-06-26 12:27:14 +01:00
Daniel Stone 0f5bb51211 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>
2019-06-26 12:27:14 +01:00
Marius Vlad d0861f908a 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>
2019-06-25 17:21:00 +03:00
Marius Vlad 0a13641ff8 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>
2019-06-25 14:05:54 +00:00
Marius Vlad 08e1d42a36 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>
2019-06-25 14:05:54 +00:00
Marius Vlad 57e2cc22d2 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>
2019-06-25 14:05:54 +00:00
Marius Vlad 9fdda7f5eb 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>
2019-06-25 14:05:54 +00:00
Marius Vlad 55d8736ed1 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>
2019-06-25 14:05:54 +00:00
Marius Vlad 78984ee971 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>
2019-06-25 14:05:54 +00:00
Marius Vlad ae26341037 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>
2019-06-25 14:05:54 +00:00
Marius Vlad 3d620bc04d 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>
2019-06-25 14:05:54 +00:00
Marius Vlad 5baeaecad2 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>
2019-06-25 14:05:54 +00:00
Marius Vlad 48392643ec clients: Fix/resolved doxygen warnings
Missing/wrong parameters and '[out]' issues.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-06-25 14:05:54 +00:00
Marius Vlad eeabe17e7c 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>
2019-06-25 14:05:54 +00:00
Marius Vlad a2dace23ae 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>
2019-06-25 14:05:54 +00:00
Marius Vlad 1bc6ceba06 README: Add a few words about building weston documentation
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-06-25 14:05:54 +00:00
Marius Vlad bbf6ea0b4f 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>
2019-06-25 14:05:54 +00:00
Marius Vlad 71309894f3 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>
2019-06-25 14:05:54 +00:00
Daniel Stone 31838bf17e 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>
2019-06-25 14:00:57 +01:00
Daniel Stone 87fab1ca4e 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>
2019-06-25 14:00:57 +01:00
Stefan Agner b0e16d4c53 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>
2019-06-20 16:39:13 +02:00
Stefan Agner d93c0f7059 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>
2019-06-20 09:04:12 +02:00
Silva Alejandro Ismael 9eb974aaaf 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>
2019-06-17 11:35:54 -03:00
Robert Beckett 8d23ab78bd 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>
2019-06-13 18:40:56 +01:00
Tomohito Esaki 68d49d772c 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>
2019-06-13 10:13:59 +00:00
Daniel Stone e2f9c1b76c 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>
2019-06-11 14:00:39 +01:00
Daniel Stone 34473d703f 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>
2019-06-11 13:59:37 +01:00
Tomohito Esaki 5898cd32c5 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>
2019-06-11 11:08:48 +00:00
Daniel Stone 814335821e 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>
2019-06-11 10:36:55 +00:00
Daniel Stone a9278d28fc 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>
2019-06-11 11:31:04 +01:00
Daniel Stone 82c8ca1628 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>
2019-06-11 11:31:04 +01:00
Harish Krupo dc3edc04aa 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>
2019-06-11 10:11:35 +00:00
Harish Krupo 2dff4dd695 desktop-shell: Don't re-position views when output_list is empty
Signed-off-by: Harish Krupo <harishkrupo@gmail.com>
2019-06-11 10:11:35 +00:00
Fabrice Fontaine 137b811ecd Fix build with kernel < 4.4
weston includes input-event-codes.h since version 5.0.91 and
6e229ca263

input-event-codes.h is available only since kernel 4.4 and
f902dd8934

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>
2019-06-10 14:02:29 +02:00
Silva Alejandro Ismael 21a1f40760 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>
2019-05-31 16:39:43 -03:00
Scott Anderson 2edbcbd9cd 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>
2019-05-29 18:30:06 +12:00
Antonio Borneo e51478c134 Fix build-time warning with meson 0.50.1
Commit 6666dee52b ("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>
2019-05-24 15:51:53 +02:00
Manuel Stoeckl 6666dee52b 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>
2019-05-20 08:21:31 +00:00
Manuel Stoeckl cda278dd1d man: Update "See also" references for weston.1
Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
2019-05-20 08:21:31 +00:00
Pekka Paalanen c8acc5f23d backend-fbdev: more into new subdir
For consistency with other backends.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-05-16 13:32:34 +01:00
Pekka Paalanen 526b85401e backend-x11: move into new subdir
For consistency with other backends.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-05-16 13:32:34 +01:00
Pekka Paalanen 4f1573e48e backend-wayland: move into new subdir
For consistency with other backends.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-05-16 13:32:34 +01:00
Pekka Paalanen b70ee941b5 backend-rdp: move into new subdir
For consistency with other backends.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-05-16 13:32:34 +01:00
Pekka Paalanen 8059d317a5 backend-headless: move into new subdir
For consistency with other backends.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-05-16 13:32:34 +01:00