Commit graph

6413 commits

Author SHA1 Message Date
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
Deepak Rawat a864f58f44 compositor-drm: Read FB2_MODIFIERS capability
Not all drivers support fb2 modifiers so read the capability before
using drmModeAddFB2WithModifiers.

Signed-off-by: Deepak Rawat <drawat@vmware.com>
2018-11-02 13:28:34 +00:00
Emre Ucan d93a52a6f9 ivi-shell: check ivi_view mappedness in commit_changes()
If the view is not mapped, we do not need to update its
properties. We can use ivi_view_is_mapped() function to
check it.

Also we don't need to call weston_view_damage_below()
for weston_views, which were in the scenegraph. Because
we are calling weston_view_unmap for views of unmapped
ivi_views in build_view_list() function

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
2018-11-02 11:28:32 +01:00
Emre Ucan f6638a7f0f ivi-shell: unmap views which are not in scenegraph
From Michael Olbrich:
"Both the core in weston_compositor_build_view_list() with view.link
and the ivi-shell in commit_screen_list() with view.layer_link
don't remove the old views from the list.

As a result, all views that are not currently in the list have
old broken links. Destroying such a view tries to remove
the view from these lists and will access the old, invalid pointers."

Therefore, we have to unmap weston_views which are not in current
scenegraph of ivi-shell. I implemented ivi_view_is_mapped() function
to check mappedness of ivi_views. The functions checks:
   - the view is on a layer's order list
   - the layer is on a screen
   - the layer and view's ivi_surface are visible

If ivi_view is not mapped but weston_view is still mapped,
we have to unmap the weston_view with weston_view_unmap() call.

Reported-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
2018-11-02 11:28:32 +01:00
Emre Ucan e1e7ebdbea ivi-shell: Add build_view_list function
Move the implementation from commit_screen_list to
build_view_list function

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
2018-11-02 11:28:31 +01: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
Tomohito Esaki f59dc1112b weston: Add set up SIGUSR1 blocking early using pthread_sigmask()
Xwayland block SIGUSR1 signal for handling this signal. However, if some
weston plugins creates additional threads before xwayland is loaded,
this signal get delivered these threads and causes weston quit.
Therefore, we should set up SIGUSR1 blocking early so that these threads
can inherit the setting when created.

Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
2018-10-30 17:09:01 +09:00
Tomohito Esaki b1fb00dbcd compositor-drm: Add Support virtual output
Add support virtual output for streaming image to remote output by
remoting-plugin which will be added by the patch:
"Add remoting plugin for output streaming."
The gbm bo of virtual output is the linear format.

Virtual output is implemented based on a patch by Grigory Kletsko
<grigory.kletsko@cogentembedded.com>.

Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
2018-10-30 17:09:01 +09:00
Tomohito Esaki 718a40b49c compositor-drm: store gbm bo flags in drm_output
Store usage flags of gbm bo in drm_output in order to specify the bo
format for each output. A following patch will add a new type of
drm_output which requires different gbm_bo_flags.

Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
2018-10-30 17:09:01 +09:00
Tomohito Esaki 1506e99fd3 gl-renderer: provide fence sync fd for synchronizing with GPU rendering
Add new API to gl-renderer interface for providing fence sync fd. the
backend can wait for GPU rendering by this API.

Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
2018-10-30 17:09:01 +09:00
Tomohito Esaki 4976b09a7e compositor-drm: add num_planes to drm_fb structure
Add new member to store number of planes to drm_fb structure.

Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
2018-10-30 17:09:01 +09:00
Emil Velikov da4f185faa libweston: print EGL information as early as possible
In the case where CreateContext/MakeCurrent fails, we still want to
know what the EGL driver is capable of.

Move the EGL info printing, just after the eglInitialize() call to
ensure that.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-10-18 16:14:05 +01:00
Emil Velikov 3bb047b605 libweston: split EGL and GL info logging
Split the two into separate functions. Former requires an initialized
EGL display, while the latter a current context.

We will use that distinction with the next patch.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-10-18 16:14:03 +01:00
Alexandros Frantzis 7e2d4beb08 xwayland: Silence format-truncation compilation warnings
We are currently formatting 32-bit signed integers into 8 byte buffers,
which are too small, causing the compiler to complain. Update the buffer
size to the minimum required value of 12 bytes: 1 for the sign, 10 for
the number, and 1 for the null byte terminator.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2018-10-12 13:00:08 +03:00
Daniel Stone bff27cb835 compositor-drm: Don't warn about missing backlight control
Not every output will have a backlight control, and even if it does we
may just not be able to find it. Not having backlight control isn't an
error, so don't spam the log with it, as doing so can confuse users into
thinking this is an actual error which is responsible for their real
problems.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2018-09-23 11:21:40 +02:00
Daniel Stone a65d55e133 gl-renderer: Remove warning on missing extensions
Not having swap_buffers_with_damage could cause a performance impact on
some backends, but at least on GBM it causes no issues. It also seems to
confuse users into thinking it's a legitimate error which could explain
session slowness.

Similarly with buffer_age, whilst we do lose a little bit of performance
by not being able to do partial renders, it is not a great deal, and the
user is unlikely to be able to do anything about it in any event.

Remove the warning; we print the full extension list at startup, so we
already have enough information from the logs to easily diagnose any
real errors.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2018-09-23 11:21:40 +02:00
Philipp Zabel b9454fde9f weston: keep non-desktop displays turned off by default
Keep non-desktop heads representing e.g. head mounted displays turned off by
default. When using the DRM backend they can still be enabled by setting an
explicit [output] mode (or "mode=preferred") in weston.ini.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
2018-09-23 09:18:00 +00:00
Philipp Zabel 61dc4ca92e compositor-drm: check connector non-desktop property and mark head accordingly
Use the DRM connector "non-desktop" property to mark weston_heads that
represent head mounted displays and other non-standard displays that the
desktop should not be extended to.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
2018-09-23 09:18:00 +00:00
Philipp Zabel c18ffd3939 libweston: add weston_head_{is,set}_non_desktop()
Add non-desktop property for weston_heads representing displays that the
desktop should not be extended to by default, e.g. head mounted displays.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
2018-09-23 09:18:00 +00:00
Philipp Zabel fff2797c88 compositor-drm: use weston_view_is_opaque()
Implement drm_view_is_opaque() using weston_view_is_opaque(). Also, use
weston_view_is_opaque() directly in drm_output_propose_state(), with the
clipped_view.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
2018-09-18 19:22:20 +02:00
Philipp Zabel 70decd5b2b libweston: add weston_view_is_opaque()
Use the weston_surface is_opaque property, the opaque region, and the view
alpha value to determine whether the weston_view is opaque in a specific
region.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
2018-09-18 19:21:46 +02:00
Philipp Zabel 195dadeb2a libweston: add weston_surface is_opaque property
Add an is_opaque property that is set to true if the attached buffer does not
have an alpha component, or if the solid color is non-transparent.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
2018-09-18 19:21:46 +02:00
Changwoo Cho f97d250847 libweston: fix typo in comment 2018-09-18 09:58:35 +00:00