Toytoolkit sources don't actually use the presentation_timing client
protocol bindings for anything. Apparently they were there only because
that's how they end up in BUILT_SOURCES.
Move them from toytoolkit sources to BUILT_SOURCES where also other such
things are.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
This client opens a V4L2 device, usually exposed as /dev/videoN, and
retrieves its frames as dmabuf for later import into the compositor.
It supports both single- and multi-planar devices, and any format
exposed by the V4L2 device the Wayland compositor accepts.
This client never changes the v4l2 settings, use `v4l2-ctl -c` if you
want to change those.
Signed-off-by: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
Tested-by: Derek Foreman <derekf@osg.samsung.com>
Maniphest Tasks: T90
Differential Revision: https://phabricator.freedesktop.org/D339
This client was using an Intel-specific way to allocate a dmabuf, so it
makes sense to have that in its name.
Signed-off-by: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Differential Revision: https://phabricator.freedesktop.org/D342
It doesn't fill a useful function and is not intended to be continued.
If there is need for workspace manipulation from clients a protocol
based on those future needs need to be properly designed.
workspaces.xml is probably not very relevant since it did the bare
minimum.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Mariusz Ceier <mceier+wayland@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Due to the effort of moving a way from non-prefixed protocols, rename
the weston specific screenshooter protocol to weston_screenshooter.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Mariusz Ceier <mceier+wayland@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
In the effort of going away from generic names of protocols only
relevant for weston, rename the weston desktop shell
weston_desktop_shell.
This also resets the version to 1, as there will be no prior versions
to weston_desktop_shell.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Mariusz Ceier <mceier+wayland@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Mariusz Ceier <mceier+wayland@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Jasper St. Pierre <jstpierre@mecheye.net>
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Mariusz Ceier <mceier+wayland@gmail.com>
Reviewed-by: Jan Arne Petersen <janarne@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Mariusz Ceier <mceier+wayland@gmail.com>
Reviewed-by: Jan Arne Petersen <janarne@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Use the fullscreen-shell protocol XML from the wayland-protocols
installation, and remove the one we provide ourself.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Mariusz Ceier <mceier+wayland@gmail.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
glibc requires this prior to 2.17, and we already do it in a few other
places.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
IVI-Shell is designed to be used with other controller modules
than hmi-controller.These controller modules require
the ivi-layout-export header file to properly integrate
with the ivi-shell. The header file should be installed
when ivi-shell is enabled, because these controller modules
are not a part of the weston repository.
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Systemd notifications support was converted into loadable
module, so systemd-notify.h header is not needed.
Signed-off-by: Egor Starkov <egor.starkov@ge.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Add systemd status and watchdog notification support.
Feature is not compiled by default and can be enabled by
"--enable-systemd-notify" configuration flag. It compiles
into module "systemd-notify.so" and can be loaded by
adding it in weston.ini like any other module, i.e.
"modules=systemd-notify.so". Watchdog timeout equals to
half of timeout defined by "WATCHDOG_USEC" environment
variable, which is set by "WatchdogSec=" setting in
service file.
Signed-off-by: Egor Starkov <egor.starkov@ge.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
These routines provide test cases an ability to capture screen images
for rendering verification.
This commit is a no-change refactoring, except for making the routines
non-static. Makefile rules are also updated; most notably, this links
test clients against the cairo libraries now.
v2: Fix pointer code styling, suggested in review
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
We were missing launcher-impl.h in Makefile.am
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
We now have a launcher interface and distinct implementations for
logind, weston-launch, and direct DRM, each in their own files.
This helps up clean up the spaghetti code into something that's
hopefully a bit more understood. There should be no functional
changes here.
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
update: Dropped redundant free() in weston_launcher_destroy()
v2:
- adapted to protocol changes
- added TODO comments
- minor clean-up
- change y-invert from per-plane boolean to per-buffer flag
v3:
- fix a typo: 1 -> i (noticed by Carlos Olmedo Escobar)
Signed-off-by: George Kiagiadakis <george.kiagiadakis@collabora.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Import dmabuf as an EGLImage, and hold on to the EGLImage until we are
signalled a content change. On content change, destroy the EGLImage and
re-import to trigger GPU cache flushes.
We hold on to the EGLImage as long as possible just in case the client
does other imports that might later make re-importing fail.
As dmabuf protocol uses drm_fourcc codes, we need libdrm for
drm_fourcc.h. However, we are not doing any libdrm function calls, so
there is no new need to link to libdrm.
RFCv1 changes:
- fix error if dmabuf exposed unsupported
- always use GL_TEXTURE_EXTERNAL_OES with dmabuf
v2 changes:
- improve support check and error handling
- hold on to the imported EGLImage to avoid the dmabuf becoming
unimportable in the future
- send internal errors with linux_dmabuf_buffer_send_server_error()
- import EGL_EXT_image_dma_buf_import extension headers
- use heuristics to decide between GL_TEXTURE_2D and
GL_TEXTURE_EXTERNAL_OES
- add comment about Mesa requirements
- change y-invert from per-plane boolean to per-buffer flag
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
v2 changes:
- implement the revised protocol
- add basic sanity checks when creating buffer and check for support
- add way to attach user data to the dmabuf for renderer use
- bump max number of planes to 4 to follow DRM AddFb2 ioctl
- improve errors handling
- use separate linux_dmabuf_buffer fields for the different wl_resource
types
- as SERVER_ERROR code is no more, use a wl_display "generic" error for
emergency-disconneting a client we fail to process
- more documentation
- change y-invert from per-plane boolean to per-buffer flag
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
An experimental (hence the 'z' prefix) linux_dmabuf Wayland protocol
extension for creating dmabuf-based wl_buffers in a generic manner.
This does not include proper dmabuf metadata negotiation because
there is no way to communicate all dmabuf constraints from the
compositor to a client before-hand. The client has to create a
wl_buffer wrapping one or more dmabuf buffers and then listen at
the feedback object returned to know if the operation was successful.
RFCv1 changes (after a first draft without code):
- some renames of interfaces and argument, no semantic changes
- added destructor protocol to dmabuf_batch
- added feedback interface for buffer creation
v2 changes:
- use drm_fourcc.h as authoritative source for format codes
- add support for the 64-bit layout qualifier and y-inverted dmabufs
- simplify the 'add' request (no need to preserve fd numerical id)
- add explicit plane index in the 'add' request
- integrate the 'feedback' object events to the batch interface
- rename 'create_buffer' to 'create' and move it into the batch interface
- add requirements needed from the graphics stack and clients
- improve existing errors and add batch error codes
- removed error codes from the global interface
- improve documentation for arguments, enums, etc.
- rename dmabuf_batch to zlinux_buffer_params
- The y-inverted property makes more sense as a whole buffer property.
Y-flipping individual planes of the same buffer object is hardly useful.
The y-invert is also converted into a flag, so we may add more flags
later.
- add flags for interlaced buffer content
v3 changes:
- Apply Daniel Vetter's comments about wording on coherency.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
In parallel out-of-tree builds it is possible for e.g. ivi-shell/weston.ini to
be written before ivi-shell/ exists. Solve this by creating the target
directory first.
Signed-off-by: Ross Burton <ross.burton@intel.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Adds basic support for optionally outputting in the XML format
commonly used by JUnit compatible tools.
This format is supported by default by many tools, including
the Jenkins build system. It also is more detailed and
captures more information than the more simplistic TAP
format.
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
dist_wayland_session_DATA will distribute and install src/weston.desktop, so the
definition of wayland_session_DATA which also installs src/weston.desktop will
result in the file being installed twice and (rarely) cause install to fail.
Spotted and fix by Roy Li <rongqing.li@windriver.com>.
Signed-off-by: Ross Burton <ross.burton@intel.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
drm_output_start_repaint_loop() incurred a delay of
one refresh cycle by using a no-op page-flip to get
an accurate vblank timestamp as reference. This causes
unwanted lag whenever Weston exited its repaint loop, e.g.,
whenever an application wants to repaint with less than
full video refresh rate but still minimum lag.
Try to use the drmWaitVblank ioctl to get a proper
timestamp instantaneously without lag. If that does
not work, fall back to the old method of idle page-flip.
This optimization will work on any drm/kms driver
which supports high precision vblank timestamping.
As of Linux 4.0 these would be intel, radeon and
nouveau on all their supported gpu's.
On kms drivers without instant high precision timestamping
support, the kernel is supposed to return a timestamp
of zero when calling drmWaitVblank() to query the current
vblank count and time iff vblank irqs are currently
disabled, because the only way to get a valid timestamp
on such kms drivers is to enable vblank interrupts and
then wait a bit for the next vblank irq to take a new valid
timestamp. The caller is supposed to poll until at next
vblank irq it gets a valid non-zero timestamp if it needs
a timestamp.
This zero-timestamp signalling works up to Linux 3.17, but
got broken due to a regression in Linux 3.18 and later. On
Linux 3.18+ with kms drivers that don't have high precision
timestamping, the kernel erroneously returns a stale timestamp
from an earlier vblank, ie. the vblank count and timestamp are
mismatched. A patch is under way to fix this, but to deal with
broken kernels, we also check non-zero timestamps if they are
more than one refresh duration in the past, as this indicates
a stale/invalid timestamp, so we need to take the page-flip
fallback for restarting the repaint loop.
v2: Implement review suggestions by Pekka Paalanen, especially
extend the commit message to describe when and why the
instant restart won't work due to missing Linux kernel
functionality or a Linux kernel regression.
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
v3: Fix timespec_to_nsec() which was computing picoseconds,
use the new timespec-util.h helpers.
v4: Rebased to master, split long lines.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commits starts to separate the libweston code from the weston
specific code. As such, the main() is moved, together with signals
handling and configuration handling.
The definition of DEFAULT_REPAINT_WINDOW is left in compositor.c, so the
config loading of repaint_msec is slightly modified to account that.
Acked-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Added a simple C-based test framework and an example program
that uses it to run through some simple unit tests.
This is new code inspired primarily by the approaches of Google
Test, Boost Test, JUnit and TestNG. Factors of others were also
considered during design and implementation.
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
AM_CFLAGS is the default for any target that doesn't specify its
own cflags. We should use AM_CFLAGS in preference to GCC_CFLAGS
so we can change AM_CFLAGS and get all targets.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
[pekka: fixed patch conflicts]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This removes the weston-screensaver client.
Screensavers are not so useful, DPMS is much better. This example has
existed here for a good while, and things that we could learn from it
have been learnt.
Nowadays this is just dead weigth, which is usually not even compiled,
because it depends on both cairo-gl and GLU. Removing it removes the
only possible dependency to GLU and one user of cairo-gl. Now the last
user of cairo-gl is gears (clients/nested.c uses cairo-glesv2).
Support for screensavers is still left in desktop-shell, so external
projects can still have their screensavers if they want.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
We don't want to use installed binaries when running tests.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
To help reduce code duplication and also 'kitchen-sink' includes
the ARRAY_LENGTH macro was moved to a stand-alone file and
referenced from the sources consuming it. Other macros will be
added in subsequent passes.
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Add the output screenshot to CLEANFILES so it's properly removed on
distclean, and add the reference files and ini to EXTRA_DIST so
distcheck can find them.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Tested-by: Bryce Harrington <bryce@osg.samsung.com>
This also serves as a proof of concept of the screen capture
functionality and as a demo for snapshot-based rendering verification.
Implements screenshot saving clientside in the test itself.
This also demonstrates use of test-specific configuration files, in this
case to disable fadein animations and background images.
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Implements a simple mechanism to allow tests to customize the
configuration. For a given <name>-test.c just place a <name>.ini file
at the same location as the test itself. Alternately, you can generate
a <name>.ini in the same directory that the compiled test is placed
(i.e. the top builddir). If no configuration file is found, then no
configuration will be used (i.e. --no-config is specified.)
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
At least in some shells test needs 3 arguments for string comparison
if test $foo=yes ...
will always be true.
if test $foo = yes ...
will perform a string comparison.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-By: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Added build error message when 'make install' is run as non-root
and the --disable-setuid-install configuration option has not been
used.
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This is the ivi_layout stand-alone test controller module that does not
require any clients to run. Therefore it is much simpler than
ivi_layout-test-plugin.c and does not need a matching part in
ivi_layout-test.c.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Testing the ivi_layout API requires two things:
- the tests must be written as a controller module to access the API
- the tests need a helper client to create some objects that can then be
managed via the API
This patch adds all the infrastructure and two different kinds of
example tests.
Internal ivi-shell (ivi_layout) API tests are listed as ivi-*.la files
in TESTS in Makefile.am. Weston-tests-env detects these, and runs Weston
with ivi-shell, and loads the given module as a controller module, not
as a normal plugin.
The test controller module ivi-*.la will launch a helper client. For
ivi-layout-test.la the helper client is ivi-layout.ivi.
The helper client uses the weston-test-runner framework to fork and exec
each TEST with a fresh connection to the compositor.
The actual test is triggered by the weston_test_runner protocol
interface, a new addition to weston-test.xml. The helper client uses
weston_test_runner to trigger a test, and the server side of the
interface is implemented by the test controller module
(ivi-layout-test.la).
The server side of weston_test_runner uses the same trick as
weston-test-runner.h to gather a list of defined tests. A test is
defined with the RUNNER_TEST macro.
If a test defined by RUNNER_TEST succeeds, an event is sent to the
helper client that it can continue (or exit). If a test fails, a fatal
protocol error is sent to the helper client.
Once the helper client has iterated over all of its tests, it signals
the batch success/failure via process exit code. That is cought in the
test controller module, and forwarded as Weston's exit code.
In summary: each ivi_layout test is a combination of a client side
helper/setup and server side actual tests.
v2: Load weston-test.so, because create_client() needs it.
v3: add a comment about IVI_TEST_SURFACE_ID_BASE.
v4: Rebased to upstream weston-tests-env changes.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com> (v2)
This simply tests that Weston starts with ivi-shell, and ivi_application
is present.
Changes in v3:
- Rebased to upstream weston-tests-env changes.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com> (v2)
If you do an out-of-tree build, all the images will be left in the
srcdir. Fix their paths.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
The ivi-shell / hmi-controller cannot run without a properly populated
config file. Generate a config file especially for tests, which includes
paths to the build dirs.
The generated file will be used by following patches adding ivi-shell
tests.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>