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