Commit graph

6435 commits

Author SHA1 Message Date
Pekka Paalanen 4cf7db6d88 meson: drop indent level from xwayland
Use the pattern to avoid identing everything, when everything in the
file is under the one conditional.

Helps readability.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
2018-12-31 15:16:53 +02:00
Pekka Paalanen b423edecbb meson: better error for wcap dep cairo
Add human-friendly error message.

Cairo is a hard dependency on the whole at least because tests seem to
require it, but this will help if someone adds an option to disable
building tests to get rid of Cairo.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
2018-12-31 15:16:53 +02:00
Pekka Paalanen 182d3771dd meson: fix pangocairo being optional
Cannot use dependency() directly in the structure, because it will
execute regardless of the option. Instead, let's store the dependency
name in the structure and use the same logic as with simple_clients to
conditionally look for the dependencies.

As a bonus, this brings friendly error messages to demo-clients
dependencies.

subsurfaces' dependencies are also converted to maintain consistency
with simple_clients.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
2018-12-31 11:16:16 +02:00
Pekka Paalanen a23ce29506 build: replace IN_WESTON with UNIT_TEST
Remove IN_WESTON in favour of the already defined UNIT_TEST which is
used to modify a compilation unit to expose more functions for unit
tests to prod at.

Originally IN_WESTON meant that compilation unit was being compiled for
use in the Weston compositor, but it probably never really did anything
more than change what WL_EXPORT means in matrix.c.

This patch not only simplifies the logic, but it fixes the Meson build
of test-matrix: IN_WESTON was defined there even when matrix.c was being
built outside of Weston, which caused it to depend on libwayland
headers, which were not included in the Meson build of test-matrix.
Test-matrix has no reason to depend in libwayland in any way, so this
patch fixes that.

Reported-by: Greg V <greg@unrelenting.technology>
Signed-off-by: Pekka Paalanen <pq@iki.fi>
2018-12-20 23:53:54 +00:00
Greg V 0f0409835d build: add missing wayland-client dep in meson
Tests library requires Wayland headers to build.

Signed-off-by: Greg V <greg@unrelenting.technology>
2018-12-20 18:37:34 +00:00
Greg V 8a8558dd59 build: use '-Wl,' wrapper for the -export-dynamic linker flag
Meson links with the C compiler, not the raw linker.
With clang+LLD, the bare flag would be ignored.

Signed-off-by: Greg V <greg@unrelenting.technology>
2018-12-20 18:37:34 +00:00
Greg V 3eaa57a73d build: use pkg-config to find libjpeg in meson
Signed-off-by: Greg V <greg@unrelenting.technology>
2018-12-20 18:37:34 +00:00
Pablo Castellano f0ba93c194 compositor-fbdev: add support for ABGR
Make fbdev work with some Android downstream kernels, like the
asus-grouper (Google Nexus 7 2012).

Signed-off-by: Oliver Smith <ollieparanoid@bitmessage.ch>
2018-12-20 07:58:20 +00:00
Alexandros Frantzis b100668426 clients: Add simple-dmabuf-egl
Add a client that uses EGL/GLESv2 to draw to dmabuf buffers, utilizing
EGLImages and FBOs. The client uses GBM to create the dmabufs buffers.

The simple-dmabuf-egl client is partly based on patch [1] that changes
dmabuf clients to use GBM instead of libdrm code, but has been greatly
simplified since in this case we don't require direct pixel access or
non-RGBA formats.

[1] https://patchwork.freedesktop.org/patch/239796/

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2018-12-18 17:25:09 +02:00
Marius Vlad a0d9cc64f6 libweston/screnshooter: Fix weston screenshot event done if there's no client running
The 'done' event sent back to client with the weston screenshot interface
is not being sent if there is no damage on the plane. This patch (re-uses just
like recording part) weston_output_damage() to achieve that.

Otherwise the client will have to wait (and be blocked) until some
damage on the plane is being done.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
2018-12-18 15:37:34 +02:00
Marius Vlad d85fe29c1f compositor: Install weston-screenshooter in BINDIR
Previously weston-screenshooter was installed in LIBEXECDIR, but given
that now it can be invoked by the user whenever debug protocol is
enabled, let's intall it into BINDIR. This way, it can be invoked
without the need to modify PATH.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
2018-12-18 15:37:34 +02:00
Marius Vlad 64fbd0f41f compositor: Add some handy wrappers for wet_get_binary_path()
This allows to possibility to specify where to look for the executable
but also simplifies the need of having to pass either BINDIR/LIBEXECDIR
for retrieving full-path of the executable.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
2018-12-18 15:37:34 +02:00
Marius Vlad 6bc37259e6 ivi-shell/hmi-controller: Include config.h as to not break ivi-shell build on meson
We're going to eventually pass bindir to weston-screenshooter and we
will need config.h info.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
2018-12-18 15:37:34 +02:00
Marius Vlad 4e1d9bc72f libweston: Allow taking screenshots when debug protocol is enabled
Screenshots of the outputs can only be taken by having a keyboard
plug-ed in, as to avoid potential malicious intent. On the other hand,
this is problematic as there are cases where a keyboard cannot
be used as a input device. A particular use-case is that for
multiple devices it can be cumbersome to connect a keyboard such
that using ssh can be much easier and can be further automated.

This patch allows taking screenshots without the need of having a
keyboard connected when debug protocol is enabled.

Add also a few words about the fact that this is a serious issue
and can lead to silently leaking the output contents.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
2018-12-18 15:37:34 +02:00
Marius Vlad d9bcc0b171 libweston/weston-debug: Add a easy way to determine if the debug protocol has been enabled
This allows additional debug features to depend on the debug protocol being enabled

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
2018-12-18 15:37:34 +02:00
Marius Vlad f7843a50ab clients/screenshot: Allow weston-screenshooter to be called directly
As is stands now, libexec/weston-screenshooter can only be called from
within weston server. This will allow weston-screenshooter to be called
on the command line. The final scope here is to allow taking screenshots
without the need of a keyboard.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
2018-12-18 15:37:34 +02:00
Marius Vlad 3c7cfbbf62 clients/screenshot: Avoid using global variables to pass down data between functions
This is just cosmetic and doesn't fixes anything.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
2018-12-18 15:37:34 +02:00
Marius Vlad 748f09efe5 libweston/compositor-drm: Add missing debug message for scanout_view
Print debug message when the fb coudn't be retrieved for the primary
plane.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
2018-12-18 11:28:12 +02:00
Marius Vlad 94698d2a83 libweston/compositor-drm: No need to test for invalid alpha for the view
This is redundant and is already being checked drm_fb_get_from_view()

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
2018-12-18 11:28:12 +02:00
Marius Vlad 5d767416c1 libweston/compositor-drm: Print composition mode in weston-debug
This fixes the situation when using only plane-state mode for
compositing there's no obvious debug message stating that. This patch
makes it slightly better/easier to dermine what mode the compositor is
using currently.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
2018-12-18 11:28:07 +02:00
Marius Vlad 0161802aa0 Fix compiler warning: unused variable when building with DEBUG
clients/keyboard.c: In function 'dbg':
clients/keyboard.c:276:6: warning: variable 'l' set but not used [-Wunused-but-set-variable]
  int l;

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
2018-12-15 18:37:57 +02:00
Marius Vlad acec383be0 Fix compiler warnings: invalid type format
This patch fixes the following warnings:

clients/weston-info.c: In function 'print_tablet_tool_info':
clients/weston-info.c:569:3: warning: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'uint64_t' [-Wformat=]
   printf("\t\t\thardware serial: %lx\n", info->hardware_serial);
   ^
clients/weston-info.c:572:3: warning: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'uint64_t' [-Wformat=]
   printf("\t\t\thardware wacom: %lx\n", info->hardware_id_wacom);

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
2018-12-15 18:37:57 +02:00
Marius Vlad 7a8a3a3547 Fix compiler warnings: clobber variables
This patchs fixes warnings generated by older toolchains:

shared/image-loader.c: In function 'load_png':
shared/image-loader.c:211:12: warning: variable 'data' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
  png_byte *data = NULL;

See https://linux.die.net/man/3/longjmp why is this needed.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
2018-12-15 18:37:57 +02:00
Marius Vlad 7d070ca0ba Fix compiler warnings generated by older toolchains/compiler
This fixes warnings like ``may be used uninitialized''

libweston/compositor-drm.c: In function 'drm_device_is_kms':
libweston/compositor-drm.c:6374:12: warning: 'id' may be used uninitialized in this function [-Wmaybe-uninitialized]
  b->drm.id = id;

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
2018-12-15 18:37:53 +02:00
Eric Engestrom bc315aa288 meson: fix -Wno-foo argument testing
gcc and clang ignore `-Wno-foo` arguments nowadays, so we need to
test the positive variant instead.
2018-12-13 17:05:31 +00:00
Daniel Stone 0f9f86f4a4 CI: Add Meson build
This uses pip to install Meson in order to get a sufficiently new
version.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2018-12-09 15:00:30 +02:00
Pekka Paalanen dfac945c23 CI: build rdp-backend
Extends CI build coverage to catch more issues.

freerdp2-dev needs stretch-backports.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
2018-12-09 14:59:57 +02:00
Pekka Paalanen 54705d752b CI: build remoting-plugin
Extends CI build coverage to catch more issues.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
2018-12-09 14:50:54 +02:00
Pekka Paalanen 577683f09b build: add meson to autotools dist tar-ball
This should let people using the dist tarballs to build with meson.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
2018-12-09 14:50:54 +02:00
Daniel Stone 8011b0fa03 Add Meson build system
Meson is a build system, currently implemented in Python, with multiple
output backends, including Ninja and Make. The build file syntax is
clean and easy to read unlike autotools. In practise, configuring and
building with Meson and Ninja has been observed to be much faster than
with autotools. Also cross-building support is excellent.

More information at http://mesonbuild.com

Since moving to Meson requires some changes from users in any case, we
took this opportunity to revamp build options. Most of the build options
still exist, some have changed names or more, and a few have been
dropped. The option to choose the Cairo flavour is not implemented since
for the longest time the Cairo image backend has been the only
recommended one.

This Meson build should be fully functional and it installs everything
an all-enabled autotools build does. Installed pkg-config files have
some minor differences that should be insignificant. Building of some
developer documentation that was never installed with autotools is
missing.

It is expected that the autotools build system will be removed soon
after the next Weston release.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Co-authored-by: Pekka Paalanen <pq@iki.fi>
Signed-off-by: Pekka Paalanen <pq@iki.fi>
2018-12-09 14:50:54 +02:00
Daniel Stone ed75c89fd5 tests: fix include in input-timestamps-helper.c
No need to use the protocol directory prefix. This may even be necessary
for the Meson build.

Signed-off-by: Daniel Stone <daniels@collabora.com>

Extracted from the patch adding the Meson build system.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
2018-12-09 14:49:07 +02:00
Pekka Paalanen 67a97f2bc0 shared: remove fallback definition of backtrace()
The user of backtrace() was removed in
bb707dc0fe and has been unused since.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
2018-12-09 12:13:36 +02:00
Pekka Paalanen 9d771fc506 clients/simple-egl: include weston-egl-ext.h correctly
weston-egl-ext.h was moved to shared/ in
ffff92d592

Use the correct include path, so that Meson build does not need to add
../shared to the include path just for this.

Signed-off-by: Pekka Paalanen <pq@iki.fi>
2018-12-09 12:13:36 +02:00
Daniel Stone 51c9b0e2c4 tests: Rename surface-screenshot
Give it a more regular name, matching all the other test plugins.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2018-12-09 12:13:36 +02:00
David Fort 7b7d9d316a rdp-compositor: fix compilation with FreeRDP 2.0-rc4
Some members have been removed from FreeRDP structs, so let's use local
variables.
2018-12-04 23:42:27 +01:00
Marius Vlad 00a6e01d53 compositor: Make pixel format printing in human-friendly form
This would make weston-debug much more readable when looking at
the pixel format of the buffer.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
2018-11-20 18:00:25 +02:00
Marius Vlad a9a630401f pixel-formats: Added pixel_format_get_info_shm() helper for printing SHM buffers
In current form SHM buffers pixel format can only be printed as 0 and 1.
With the help of this helper we align with DRM_FORMAT_ pixel format.

Signed-off-by: Marius Vlad <marius.vlad0@gmail.com>
2018-11-20 18:00:09 +02:00
Pekka Paalanen 62a9436417 compositor-drm: parse all DRM format names
Use the pixel format table to parse format names. This makes the parser
recognize almost all DRM format names.

Not all formats are usable, but we rely on the use to fail
appropriately. What we can use depends on the drivers anyway.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-11-20 12:05:11 +02:00
Pekka Paalanen f5ed7431e5 pixel-formats: search by name
Add a function to find a format description by the DRM format name. This
will be useful when parsing configuration strings.

While at it, fix the two function formattings in pixel-formats.h to
match everything else in the file.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-11-20 12:05:11 +02:00
Pekka Paalanen e7c91b61c7 pixel-formats: add name string
There is often a need to print the name of a pixel format. Printing the
raw numeric value is hard to decipher, printing the four ASCII
characters is slightly more human-friendly but still needs a decoder
table. Add a name that can be printed easily.

The bulk of this patch was done with:
sed -i -e 's/\.format = DRM_FORMAT_\(.\+\),/DRM_FORMAT(\1),/' libweston/pixel-formats.c

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-11-20 12:05:11 +02:00
Dima Ryazanov ad0d83bd6f Don't look for weston.ini in the current working directory
It's a bit surprising that Weston looks different when launched from the root
of the git repo vs from elsewhere.

But it's also technically a security vulnerability: if I launch it from
a directory like /tmp, it might pick up a weston.ini created by another user,
which could then load modules with arbitrary code. Basically, it's the same
problem as including "." in $PATH.

Signed-off-by: Dima Ryazanov <dima@gmail.com>
2018-11-15 13:04:11 -08:00
Emre Ucan 61eb170b73 ivi-shell: remove input-method section from config
input_method protocol is no longer supported.
Therefore, we should remove it from the example config

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
2018-11-05 08:37:07 +00:00
Emre Ucan 27839fe913 ivi-shell: remove unused functions and members
input panel related members of ivi_shell struct are
not required anymore. Also get_default_view(),
input_panel_setup() and input_panel_destroy() are not used.
Therefore, we can remove them.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
2018-11-05 08:37:07 +00:00
Emre Ucan eefb8b9ac5 ivi-shell: remove input panel implementation
it is unused now

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
2018-11-05 08:37:07 +00:00
Emre Ucan 71f9ee1d22 ivi-shell: don't use input panel implementation
input panel implementation puts contents of an
application, which uses input_method protocol,
on top of all other surfaces. It is not controllable
with ivi-layout interface.

This is not acceptable for an In-Vehicle Infotainment
platform. Because we have to ensure configured scenegraph
cannot be hijacked by any rogue application.

Therefore, I am removing input panel implementation

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
2018-11-05 08:37:07 +00:00
Arkadiusz Hiler 5a5cbc0245 compositor-drm: Log atomic commits and flips
Add a couple log points for tracking atomic commits and flip processing.

Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-11-03 09:13:09 +00:00
Michael Olbrich 399a224a18 libweston-desktop/xdg-shell: update view transforms for xdg popup surfaces
For toplevel surfaces, the shell will do the same thing. Without this, the
commit does not trigger repaints, because the output mask for the surface
is not set.

Without this the popup is not shown unless something else triggers a
repaint. This is usually not seen because the mouse cursor triggers a
repaint at the same time.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
2018-11-02 16:44:31 +00:00
Vasilis Liaskovitis 486b463a18 gl-renderer, pixman: disconnect the client on unhandled buffer type.
Introduce a helper function to disconnect the client on unhandled
buffer types, and use it in the gl and pixman renderers. The function
is modeled after linux_dmabuf_buffer_send_server_error.

Also print the egl error state in the gl renderer, in case the
unrecognized buffer error happens when querying an egl buffer.

https://gitlab.freedesktop.org/wayland/weston/issues/148
2018-11-02 14:28:05 +00:00
emersion 807cd2e589 clients: configure cursor theme from XCURSOR_* env
If XCURSOR_THEME or XCURSOR_SIZE is set, use it as the cursor theme
or cursor size.

This is similar to what Qt and some X11 apps do.
2018-11-02 13:45:37 +00:00
orbitcowboy 1f3fae2f1a Fixed potential memory leaks in simple-dmabuf-drm.c found by Cppcheck. 2018-11-02 13:34:35 +00:00