Commit graph

25 commits

Author SHA1 Message Date
Pekka Paalanen c22f357464 doc: overview of the test suite
This should lower the barrier to entry for writing more tests.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-01-30 10:10:34 +00:00
Leandro Ribeiro ca640d5120 libweston: fold weston_compositor_tear_down() into weston_compositor_destroy()
The only reason why we have both weston_compositor_tear_down() and
weston_compositor_destroy() is that the only we had to destroy
the log context was keeping weston_compositor alive and calling
weston_log_ctx_compositor_destroy().

After commit "weston-log: replace weston_log_ctx_compositor_destroy()
by weston_log_ctx_destroy()", it's not necessary to keep a zombie
weston_compositor just to be able to call
weston_log_ctx_compositor_destroy().

Fold weston_compositor_tear_down() into weston_compositor_destroy(),
as this split is useless now.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-01-29 12:15:16 -03:00
Leandro Ribeiro 4ec38d18b3 weston-log: replace weston_log_ctx_compositor_destroy() by weston_log_ctx_destroy()
The function weston_log_ctx_compositor_destroy(), which destroys struct
weston_log_context, takes weston_compositor as argument. We may have a
weston_log_context unlinked from a weston_compositor and currently there
is no way to destroy it.

Add function weston_log_ctx_destroy(), what makes the destruction of
weston_log_context independent of weston_compositor.

With this change, one could destroy a weston_compositor and keep the
related weston_log_context (since now weston_log_context can be destroyed
without the need of a weston_compositor). But if weston_compositor gets
destroyed it's also necessary to destroy weston_log_context::global,
as the debug protocol depends on the compositor. So a listener has been
added to the destroy signal of weston_compositor.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-01-29 12:08:54 -03:00
Leandro Ribeiro 4f13595aa7 weston-log: rename weston_log_ctx_compositor_create() to weston_log_ctx_create()
Since weston_log_ctx_compositor_create() does not have any relation
with weston_compositor, rename it to weston_log_ctx_create().

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-01-29 12:08:54 -03:00
Leandro Ribeiro f66685d9db weston-log: add function to avoid direct access to compositor members in non-core code
If we use the function weston_log_context_add_log_scope()
in non-core code, it's necessary to access
weston_compositor::weston_log_ctx.

This is not ideal, since the goal is to make core structs
(weston_compositor, weston_surface, weston_output, etc)
opaque.

Add function weston_compositor_add_log_scope(), so non-core
users are able to pass weston_compositor as argument instead
of weston_compositor::weston_log_ctx.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-01-29 09:55:24 +00:00
Leandro Ribeiro f014964f6f weston-log: rename the confusing function name weston_compositor_log_scope_destroy()
There's a function named weston_compositor_log_scope_destroy()
but it doesn't take a struct weston_compositor argument.

Rename it to weston_log_scope_destroy(), as the argument is a
struct weston_log_scope.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-01-27 13:43:24 -03:00
Leandro Ribeiro 5976dbbbb5 weston-log: rename the confusing function name weston_compositor_add_log_scope()
There's a function named weston_compositor_add_log_scope()
but it doesn't take a struct weston_compositor argument.

Rename it to weston_log_ctx_add_log_scope(), as
the log_scope is being added to a log_context.

Also, bump libweston_major to 9.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
2020-01-27 13:42:42 -03:00
Pekka Paalanen 9dccfd1ef3 doc: output management sequence diagrams
When we were designing the libweston output API, I wrote a design document
as a Phabricator wiki page. Phabricator is no longer accessible so that
information needs to be migrated to a new place. Here I am converting most of
it into libweston Sphinx documentation, particularly pulling in the sequence
diagrams I drew. This should help people understand how libweston output
configuration works.

The diagrams are committed as both MSC source files and rendered PNG files. I
did not bother tinkering with the build to run mscgen automatically and then
with the CI images to install the tool.

The Sphinx configuration need numref explicitly enabled so that figures are
automatically numbered and can be referenced by their number rather than their
whole caption text(!).

The document structure is changed a little better flowing with Output
Management being the overview page and the Heads and Outputs being the API
pages.

First I wrote the struct weston_output and weston_head descriptions in Doxygen
comments in libweston.h, but then in the API page that text would have been
buried somewhere towards the end of the page. So I put that text in ReST
instead where it comes as first on the pages as it should. The doc for the
structs only contain a link to the top of the page. Yes, the comment style in
libweston.h is a little broken. If I left the asterisk there it would show up
as a bullet point in Sphinx. OTOH putting everything from \rst in a single line
did not produce anything.

Because Sphinx cannot look in two places, the images need to be copied into the
build dir too.

mscgen: http://www.mcternan.me.uk/mscgen/

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

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-01-27 12:14:14 +00:00
Marius Vlad 36453951fb doc/scripts/gdb: Added gdb script to dump contents of the flight recorder
Mimics the C version that displays the contents of the flight recorder.
With a core-dump in place source the python file then call
'display_flight_rec' to dump the data.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-11-25 20:29:49 +00:00
Marius Vlad 23d01c67a3 doc/sphinx: Add some documentation about timeline points
Use doxygen ingroup command as to show the symbols in the sphinx
documentation.

Include some basic comments and document the exported functions from
timeline.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-10-17 21:42:25 +03:00
Marius Vlad 8110e8de61 doc/sphinx: Add documentation for the logging/debugging framework
This details the logging/debugging framework with the latest changes,
making use of the groups added by "weston-log: Start adding
documentation" and "libweston/log: Add 'wlog' group".

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-07-18 13:34:04 +03:00
Marius Vlad 284d5345ad compositor: Destroy the compositor before the log scope
Destroying the compositor after destroying the log scope will not print
out the messages in the tear down/clean-up phase of the compositor, so
add a new tear_down function which allows keeping a valid reference to
the compositor. This way we can destroy the compositor before destroying
the scope and keep the debug messages.

While at it remove the log context destroy part from the clean-up
of the compositor and make it stand on its own.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2019-07-18 13:34:04 +03:00
Marius Vlad 64a92265e8 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>
2019-07-01 12:20:30 +00:00
Marius Vlad 5d7877adfd 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>
2019-06-28 13:39:11 +03: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 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 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 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
Tomohito Esaki f709d22038 Add remoting plugin for output streaming
Remoting plugin support streaming image of virtual output on drm-backend
to remote output. By appending remote-output section in weston.ini,
weston loads remoting plugin module and creates virtual outputs via
remoting plugin. The mode, host, and port properties are configurable in
remote-output section.

This plugin send motion jpeg images to client via RTP using gstreamer.
Client can receive by using following pipeline of gst-launch.

gst-launch-1.0 rtpbin name=rtpbin \
   udpsrc caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,
		encoding-name=JPEG,payload=26" port=[PORTNUMBER] !
          rtpbin.recv_rtp_sink_0 \
   rtpbin. ! rtpjpegdepay ! jpegdec ! autovideosink \
   udpsrc port=[PORTNUMBER+1] ! rtpbin.recv_rtcp_sink_0 \
   rtpbin.send_rtcp_src_0 !
          udpsink port=[PORTNUMBER+2] sync=false async=false

where, PORTNUMBER is specified in weston.ini.

Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
2018-10-30 17:09:01 +09:00
Daniel Stone f987cb98ef README: Move to Markdown, rewrite introduction
Move the README file to Markdown, and update it to attempt to explain
the current status and use of Weston.

The first sections are user-facing, so they can quickly understand what
Weston is, what it does, what it doesn't do, and how to go about using
it. The following sections on libweston and for distribution packagers
are left intact, but should probably be moved to separate documents.

This includes a screenshot of Weston running weston-terminal, Chrome and
simple-egl, which was taken by myself and subject to the same licensing
terms as the rest of the tree.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-08-07 14:38:24 +01:00
Pekka Paalanen bfaaedc914 doc: add example calibration-helper script
This is not to be installed, except maybe as a doc. It is just an
example of what one might do.  It also has not been tested, it's just
for giving an idea of what it should do.

It also contains untested speculation.

v2:
- use syspath instead of devpath
- add license blurb

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-05-30 14:46:24 +03:00
Jon Cruz a151975347 doc: Correct absolute path in doxygen graphs.
Adds a config item to prevent doxygen from using absolute paths in
generated diagrams. This trims off the base directory during config to
leave just relative paths.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-10-07 17:09:09 -07:00
Jon A. Cruz 179c186e19 Adding doxygen setup and info for the testing framework.
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-07-17 13:28:02 +03:00