platform/upstream/weston.git
8 years agotests: check for NULL surface in keyboard and pointer handlers
Pekka Paalanen [Thu, 21 Apr 2016 13:47:20 +0000 (16:47 +0300)]
tests: check for NULL surface in keyboard and pointer handlers

When a test destroys a wl_surface, it is still possible to get events
referring to the destroyed surface. The surface in such cases will be
NULL.

Handle NULL surface gracefully in keyboard and pointer enter/leave
handlers. Touch-down handler is already NULL-safe.

This fixes a SEGV in a test I am writing for wp_viewport.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agoweston-info: look for the right wp_presentation
Pekka Paalanen [Tue, 19 Apr 2016 13:16:29 +0000 (16:16 +0300)]
weston-info: look for the right wp_presentation

Patch b00c79b587a4903df576008a64a49f851fed234c forgot to update the
global interface name to look for. Fix it.

This makes weston-info report the presentation clock again.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agoinput: Don't try to send axis_source when there are no resources
Jonas Ådahl [Thu, 21 Apr 2016 02:21:48 +0000 (10:21 +0800)]
input: Don't try to send axis_source when there are no resources

The focus_client pointer may be NULL here if the focused client has no
pointer resources. To avoid a crash, NULL check focus client before
proceeding to send the events.

https://bugs.freedesktop.org/show_bug.cgi?id=94899

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Mike Blumenkrantz <zmike@osg.samsung.com>
8 years agodata-device: Update current action even if source version is old
Jonas Ådahl [Tue, 15 Mar 2016 07:23:50 +0000 (15:23 +0800)]
data-device: Update current action even if source version is old

If the version of the source object is old enough to not have
wl_data_source.set_actions() the current action would never be updated
since source->set_actions would never be set.

To fix this, instead of checking whether source->set_actions before
proceeding with updating the current action, just always update the
action when we know all parts are valid dnd data device objects.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Mike Blumenkrantz <zmike@osg.samsung.com>
Reviewed-by: Carlos Garnacho <carlosg@gnome.org>
8 years agodesktop-shell: Get rid of some unused fields
Jonas Ådahl [Tue, 15 Mar 2016 06:06:26 +0000 (14:06 +0800)]
desktop-shell: Get rid of some unused fields

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Mike Blumenkrantz <zmike@osg.samsung.com>
8 years agodesktop-shell: Unset the shell surface owner when it goes away
Jonas Ådahl [Fri, 26 Feb 2016 06:02:06 +0000 (14:02 +0800)]
desktop-shell: Unset the shell surface owner when it goes away

On client destruction, the shell object may be destroyed before the
shell surface objects. If this happens to two surfaces of the same
client, and one surface being destroyed results in the focus being
switched to the other, this would trigger a ping event.

The ping event sending function relies on having a valid owner, and if
the shell would be destoryed prior to the shell surface, we'd crash in
this function.

Solve this by unsetting the owner pointer when the shell client goes
away and early out in the ping event sending function if the owner is
gone.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Mike Blumenkrantz <zmike@osg.samsung.com>
8 years agoheadless: port the headless backend to the new init api
Benoit Gschwind [Sat, 16 Apr 2016 03:28:32 +0000 (20:28 -0700)]
headless: port the headless backend to the new init api

refactor configuration API of headless-backend

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v6:
  - Define version number in the header
  - Don't use leading underscores in header guards
  - Add stub config_init_to_defaults()
  - Allocate config on stack
  - Drop unused display_name parameter
  - Add error message when config is invalid
  - Install compositor-headless.h and list it in headless-backend sources
v5:
  - Update to current trunk
  - Fixed typo 'struct weston_wayland_backend_config'
  - Dropped unused variables
  - Dropped weston_headless_backend_config_create() in favor of
    directly zalloc'ing the object
  - Dropped weston_headless_backend_load() in favor of the more
    generalized load_backend_new().
  - Dropped typedef from header
  - Restored use of 'backend_init' entry point
  - Backend_init() takes a base weston_backend_config object
  - Renamed 'param' to 'config' in a few places for consistency
  - Renamed 'headless_options' variable to 'options for consistency
  - Version the base struct
  - Free config on error
  - Don't free config during backend_init normal operations
  - Adjust header ordering
  - Make header guard naming consistent with other headers
  - Light reformatting for code style and consistency with other
    backend config patches

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
[Pekka: rebased to apply before drm and x11 backends]
[Pekka: squashed in the headless part of "Enforce destruction of all
backend config objects after initialization"]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agomain: document load_backend_new()
Bryce Harrington [Sat, 16 Apr 2016 03:28:36 +0000 (20:28 -0700)]
main: document load_backend_new()

Split from the patch "Enforce destruction of all backend config objects
after initialization".

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoRevert 'main: Remove unused function load_backend_new()'
Bryce Harrington [Sat, 16 Apr 2016 03:28:27 +0000 (20:28 -0700)]
Revert 'main: Remove unused function load_backend_new()'

This reverts commit 5ffbfffaf7758c33791978516d0a1100773b85e2.

Restore load_backend_new() for use with libweston backend configuration.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agocompositor: Version the backend configuration structures
Bryce Harrington [Sat, 16 Apr 2016 03:28:29 +0000 (20:28 -0700)]
compositor: Version the backend configuration structures

With this struct versioning, it is possible to add new options without
breaking the ABI, as long as all additions are made to the end of a
struct and nothing existing is modified or removed.  When things are
added, the structure's size will increase, and we'll use this size as
our minor version number.  If existing things need to be changed, then
the major version, struct_version, is incremented to indicate the ABI
break.

From our call sites in main these major and minor version will be
recorded as struct_version and struct_size.  Each backend will then
verify these against its own assumptions.  So long as the backend's
struct is equal or larger than what was passed in and the major versions
are equal, we're good; but if it is larger, then this is a fatal error.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
v6:
 - Document refs for alternatives/assumptions for backend configs
v5:
 - Move the header changes to a pre-requisite patch from the drm backend

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
[Pekka: bring back the archive links Bryce looked up.]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agocompositor: Drop unneeded create_output callback
Bryce Harrington [Sat, 16 Apr 2016 03:28:28 +0000 (20:28 -0700)]
compositor: Drop unneeded create_output callback

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agodrm: Spelling fix in comment
Bryce Harrington [Sat, 16 Apr 2016 03:28:26 +0000 (20:28 -0700)]
drm: Spelling fix in comment

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
8 years agoMakefile: fix systemd-notify plugin CFLAGS
Pekka Paalanen [Tue, 5 Apr 2016 11:08:11 +0000 (14:08 +0300)]
Makefile: fix systemd-notify plugin CFLAGS

SYSTEMD_DAEMON_LIBS does not belong in CFLAGS, but SYSTEMD_DAEMON_CFLAGS
does. Fix that.

Add the missing COMPOSITOR_CFLAGS. Otherwise compiling the plugin will
use the system wayland-server.h when it should be using the one pointed
to by pkg-config.

The latter fixes the build for me, as my system libwayland-server is
older than what Weston and this plugin require, and the correct version
is only found in my install $prefix.

Cc: Egor Starkov <egor.starkov@ge.com>
Cc: Eugen Friedrich <efriedrich@de.adit-jv.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoivi-layout: clear on_layer when layer_destroy
Wataru Natsume [Mon, 11 Apr 2016 12:34:52 +0000 (21:34 +0900)]
ivi-layout: clear on_layer when layer_destroy

On_layer of ivi_layout_surface should be NULL in the layer_destroy.
Previous code might access to removed ivilayer and cause SEGV.

Signed-off-by: Wataru Natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoweston-info: do not round refresh rates
Pekka Paalanen [Tue, 12 Apr 2016 08:05:23 +0000 (11:05 +0300)]
weston-info: do not round refresh rates

Weston-info was accidentally rounding refresh rates to integer Hz.

Fix it to print 3 decimals, as the protocol carries exactly that.

Reported-by: Michel Dänzer <michel@daenzer.net>
Cc: John Galt <johngaltfirstrun@gmail.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
8 years agosystemd: take over sockets created by systemd
Friedrich, Eugen (ADITG/SW1) [Tue, 5 Apr 2016 20:43:29 +0000 (20:43 +0000)]
systemd: take over sockets created by systemd

Systemd provides a feature of socket-based activation, details in [1]
This commit adds an implementation to check if sockets were provided by
systemd and adds this as an additional socket to wayland display.
before adding sockets are checked for the correctness:
only AF_UNIX of type SOCK_STREAM are accepted

This is usefull for early rendering use-cases where weston and
early-rendering-application can be started parallel.

[1] https://www.freedesktop.org/software/systemd/man/systemd.socket.html

Signed-off-by: Eugen Friedrich <efriedrich@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoclient: fix spelling mistake
Eric Engestrom [Sat, 2 Apr 2016 16:03:15 +0000 (17:03 +0100)]
client: fix spelling mistake

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agoxwayland: fix spelling mistake
Eric Engestrom [Sat, 2 Apr 2016 16:03:14 +0000 (17:03 +0100)]
xwayland: fix spelling mistake

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agozunitc: fix spelling mistake
Eric Engestrom [Sat, 2 Apr 2016 16:03:13 +0000 (17:03 +0100)]
zunitc: fix spelling mistake

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agozunitc: remove `break` after `return`
Eric Engestrom [Sat, 2 Apr 2016 16:02:41 +0000 (17:02 +0100)]
zunitc: remove `break` after `return`

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
8 years agoivi-shell: rework configure_surface notification
Ucan, Emre (ADITG/SW1) [Mon, 4 Apr 2016 08:05:20 +0000 (08:05 +0000)]
ivi-shell: rework configure_surface notification

The add_notification_configure_surface API accepts a simple
wl_listener instead of a ivi-shell specific notification
function. Therefore, the API is renamed to
add_listener_configure_surface.

This change has several advantages:
1. Code cleanup
2. No dynamic memory allocation. Listeners are allocated
   by controller plugins
3. Remove API is not needed. Controller plugins can easily
   remove the listener link.

The remove API is removed too:
- ivi_layout_remove_notification_configure_surface

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoivi-shell: rework remove_surface notification
Ucan, Emre (ADITG/SW1) [Mon, 4 Apr 2016 08:05:18 +0000 (08:05 +0000)]
ivi-shell: rework remove_surface notification

The add_notification_remove_surface API accepts a simple
wl_listener instead of a ivi-shell specific notification
function. Therefore, the API is renamed to add_listener_remove_surface.

This change has several advantages:
1. Code cleanup
2. No dynamic memory allocation. Listeners are allocated
   by controller plugins
3. Remove API is not needed. Controller plugins can easily
   remove the listener link.

The remove API is removed too:
- ivi_layout_remove_notification_remove_surface

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoivi-shell: rework remove_layer notification
Ucan, Emre (ADITG/SW1) [Mon, 4 Apr 2016 08:05:15 +0000 (08:05 +0000)]
ivi-shell: rework remove_layer notification

The add_notification_remove_layer API accepts a simple
wl_listener instead of a ivi-shell specific notification
function. Therefore, the API is renamed to add_listener_remove_layer.

This change has several advantages:
1. Code cleanup
2. No dynamic memory allocation. Listeners are allocated
   by controller plugins
3. Remove API is not needed. Controller plugins can easily
   remove the listener link.

The remove API is removed too:
- ivi_layout_remove_notification_remove_layer

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoivi-shell: rework create_layer_notification
Ucan, Emre (ADITG/SW1) [Mon, 4 Apr 2016 08:05:12 +0000 (08:05 +0000)]
ivi-shell: rework create_layer_notification

The add_notification_layer_surface API accepts a simple
wl_listener instead of a ivi-shell specific notification
function. Therefore, the API is renamed to add_listener_layer_surface.

This change has several advantages:
1. Code cleanup
2. No dynamic memory allocation. Listeners are allocated
   by controller plugins
3. Remove API is not needed. Controller plugins can easily
   remove the listener link.

The remove API is removed too:
- ivi_layout_remove_notification_create_layer

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoivi-shell: rework create_surface notification
Ucan, Emre (ADITG/SW1) [Mon, 4 Apr 2016 08:05:09 +0000 (08:05 +0000)]
ivi-shell: rework create_surface notification

The add_notification_create_surface API accepts a simple
wl_listener instead of a ivi-shell specific notification
function. Therefore, the API is renamed to
add_listener_create_surface.

This change has several advantages:
1. Code cleanup
2. No dynamic memory allocation. Listeners are allocated
   by controller plugins
3. Remove API is not needed. Controller plugins can easily
   remove the listener link.

The remove API is removed too:
- ivi_layout_remove_notification_create_surface

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoivi-shell: rework layer_add_notification API
Ucan, Emre (ADITG/SW1) [Mon, 4 Apr 2016 08:05:05 +0000 (08:05 +0000)]
ivi-shell: rework layer_add_notification API

The layer_add_notification API accepts a simple
wl_listener instead of a ivi-shell specific notification
function. Therefore, the API is renamed to layer_add_listener.

This change has several advantages:
1. Code cleanup
2. No dynamic memory allocation. Listeners are allocated
   by controller plugins
3. Remove API is not needed. Controller plugins can easily
   remove the listener link.

This patch also remove two APIs which are not needed:
- ivi_layout_layer_remove_notification
- ivi_layout_layer_remove_notification_by_callback

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoivi-shell: rework surface_add_notification API
Ucan, Emre (ADITG/SW1) [Mon, 4 Apr 2016 08:05:03 +0000 (08:05 +0000)]
ivi-shell: rework surface_add_notification API

The surface_add_notification API accepts a simple
wl_listener instead of a ivi-shell specific notification
function. Therefore, the API is renamed to surface_add_listener.

This change has several advantages:
1. Code cleanup
2. No dynamic memory allocation. Listeners are allocated
   by controller plugins
3. Remove API is not needed. Controller plugins can easily
   remove the listener link.

This patch also remove two APIs which are not needed:
- ivi_layout_surface_remove_notification
- ivi_layout_surface_remove_notification_by_callback

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoivi-shell: move event_mask to properties struct
Ucan, Emre (ADITG/SW1) [Thu, 31 Mar 2016 11:08:52 +0000 (11:08 +0000)]
ivi-shell: move event_mask to properties struct

I moved the event_mask to ivi_layout_*_properties struct,
so that it is easily accessible with get_properties_of_*
APIs.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoivi-shell: remove content_observer leftover
Ucan, Emre (ADITG/SW1) [Thu, 31 Mar 2016 11:10:22 +0000 (11:10 +0000)]
ivi-shell: remove content_observer leftover

content_observer_notification is removed by the commit:
193e301c740b582f20307e3e08f8373d26ea968f.

Therefore, this callback function is unused.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agocompositor: remove input_loop
Pekka Paalanen [Thu, 24 Mar 2016 14:51:20 +0000 (16:51 +0200)]
compositor: remove input_loop

Remove the input event loop.

After "compositor-x11: stop using input_loop", the input event loop is
completely unused.

The code was also broken because it did not account for multiple outputs
with independent repaint cycles.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
8 years agocompositor-x11: stop using input_loop
Pekka Paalanen [Thu, 24 Mar 2016 13:43:44 +0000 (15:43 +0200)]
compositor-x11: stop using input_loop

X11 is the only backend that still used the input event loop.

This patch is an identical rewrite of
6deb09ef8a72164947cdfa5f2414e292c7672c9c which was then reverted in
3bebe6461a9de5d8c5c7da0261c70cd250fa1fde for reasons unrecorded. This
patch is also the revert of 22ba60e514e074e4bdee1529aa8d22600712f001.

Originally input devices were moved into their own event loop in
7ea10864c2fc7370f5ada88a3fc91ab5f188da00 and the reason for that is
explained in 7dbf5e2ea744bde56b65ba45b935b77df4a783e1.

The idea behind the input event loop was that it would be beneficial to
process and relay input events to clients just once during an output
repaint cycle, because clients cannot update the image on screen any
faster anyway. All input events also carry a timestamp, so we didn't
lose any timing information. This was supposed to save power by reducing
the process wake-ups and context switches. There was also a mention of
reducing lag.

However, the concept of an output repaint loop does not really work out
when you have several outputs, but the input devices are not exclusive
to a certain output.

The logic for driving the input event loop in Weston core was written to
assume a single output. When you have multiple outputs with independent
repaint cycles, the input event loop handling becomes fairly random, one
output freezes input while another output thaws it, etc.

The DRM backend stopped using the input event loop when it started using
the libinput input backend, which became the default in
3f5e906268448f2d84b115c5f3d22165ce0021b1, and the old code was finally
ripped out in 823ad33ef34fa32b14b300d987fb9d2e2a42e9c4.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
8 years agoivi-shell: harden get_ivi_shell_surface()
Pekka Paalanen [Wed, 16 Mar 2016 12:54:12 +0000 (14:54 +0200)]
ivi-shell: harden get_ivi_shell_surface()

Add more sanity checks to get_ivi_shell_surface() just in case.

If the configure hook is set, we must always have non-NULL
configure_private.

Check the ivi_shell_surface matches the surface.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Eugen Friedrich <friedrix@gmail.com>
8 years agoivi-shell: add sanity check in ivi_shell_surface_configure
Pekka Paalanen [Wed, 16 Mar 2016 13:05:03 +0000 (15:05 +0200)]
ivi-shell: add sanity check in ivi_shell_surface_configure

This should not get called unless there is an ivi_shell_surface.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Eugen Friedrich <friedrix@gmail.com>
8 years agoivi-shell: add input panel label func
Pekka Paalanen [Mon, 7 Mar 2016 14:25:33 +0000 (16:25 +0200)]
ivi-shell: add input panel label func

Copied from desktop-shell/input-panel.c, add a label function for the
input panel.

This patch strictly reduces the difference between input-panel.c and
input-panel-ivi.c.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Eugen Friedrich <friedrix@gmail.com>
8 years agoivi-shell: add shell surface labels
Pekka Paalanen [Mon, 7 Mar 2016 14:19:37 +0000 (16:19 +0200)]
ivi-shell: add shell surface labels

To be used by the Weston timeline feature for identifying surfaces in a
trace. The 'get_label' functionality can also be used by any debugging
code, too.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Eugen Friedrich <friedrix@gmail.com>
8 years agoivi-shell: remove ivi_layout_get_screen_output API
Ucan, Emre (ADITG/SW1) [Thu, 17 Mar 2016 15:30:50 +0000 (15:30 +0000)]
ivi-shell: remove ivi_layout_get_screen_output API

The controller plugins use IVI Layout API with weston outputs.
Therefore, this API is not required.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
8 years agoivi-shell: remove ivi_layout_get_screen_from_id API
Ucan, Emre (ADITG/SW1) [Thu, 17 Mar 2016 15:30:49 +0000 (15:30 +0000)]
ivi-shell: remove ivi_layout_get_screen_from_id API

The controller plugins does not use ivi screens for IVI layout APIs.
They use weston outputs directly. Therefore, this API is unnecessary.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
8 years agoivi-shell: implement get_screen_from_output
Ucan, Emre (ADITG/SW1) [Thu, 17 Mar 2016 15:30:46 +0000 (15:30 +0000)]
ivi-shell: implement get_screen_from_output

It is an internal API, which returns ivi_layout_screen
for a pregiven weston_output.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
8 years agoivi-shell: use weston_output in public APIs
Ucan, Emre (ADITG/SW1) [Thu, 17 Mar 2016 15:30:42 +0000 (15:30 +0000)]
ivi-shell: use weston_output in public APIs

IVI layout APIs now are called with weston_output pointers,
instead of ivi_layout_screen pointers.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
8 years agoivi-shell: remove ivi_layout_get_screens API
Ucan, Emre (ADITG/SW1) [Thu, 17 Mar 2016 15:30:39 +0000 (15:30 +0000)]
ivi-shell: remove ivi_layout_get_screens API

The compositor data struct already has a list of weston outputs.
Therefore, this API is not required.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
8 years agoivi-shell: remove ivi_layout_get_screen_resolution API
Ucan, Emre (ADITG/SW1) [Thu, 17 Mar 2016 15:30:35 +0000 (15:30 +0000)]
ivi-shell: remove ivi_layout_get_screen_resolution API

The controller plugins can get the screen resolution directly from
weston output. Therefore, this API is not required.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
8 years agoivi-shell: remove ivi_layout_get_id_of_screen API
Ucan, Emre (ADITG/SW1) [Thu, 17 Mar 2016 15:30:32 +0000 (15:30 +0000)]
ivi-shell: remove ivi_layout_get_id_of_screen API

ivi-screen does not have an id. IVI layout implementation is using
id of weston output. Therefore, this API is unnecessary.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
8 years agoivi-shell: remove id_screen
Ucan, Emre (ADITG/SW1) [Thu, 17 Mar 2016 15:30:27 +0000 (15:30 +0000)]
ivi-shell: remove id_screen

use output id instead

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
8 years agoinput: use doubles in the interfaces to notify of input events
Giulio Camuffo [Tue, 22 Mar 2016 15:44:54 +0000 (17:44 +0200)]
input: use doubles in the interfaces to notify of input events

This patch is a further step in the wl_fixed_t internal sanitization.
It changes the notify_* functions to take doubles instead of wl_fixed_t
but does not change how these are stored in the various input structs
yet, except for weston_pointer_axis_event.
However this already allows to remove all wl_fixed_t usage in places
like the libinput or the x11 backend.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agocompositor-drm: Renaming of gbm fields
Miguel A. Vico [Mon, 21 Mar 2016 16:41:03 +0000 (17:41 +0100)]
compositor-drm: Renaming of gbm fields

In preparation for follow-on changes to support frame presentation
through EGLDevice+EGLOutput, this change includes the following:
  - Rename drm_backend::format   to gbm_format
  - Rename drm_output::format    to gbm_format
  - Rename drm_output::surface   to gbm_surface
  - Rename drm_output::cursor_bo to gbm_cursor_bo

Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com>
Reviewed-by: Andy Ritger <aritger@nvidia.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
[Pekka: trivial rebase out of the series]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agogl-renderer: Implement & use check_extension
Miguel A. Vico [Mon, 21 Mar 2016 16:37:33 +0000 (17:37 +0100)]
gl-renderer: Implement & use check_extension

Using strstr(3) for checking for extensions is an error-prone mechanism
as extension names can be prefixes of other extension names (see
https://www.opengl.org/registry/doc/rules.html#using).

This change implements the check_extension() function to properly check
for an extension and replaces all usages of strstr(3).

Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com>
Reviewed-by: Andy Ritger <aritger@nvidia.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
[Pekka: move 'bool' to the same line with 'static']
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agohmi-controller: fix wrong panel width
Ucan, Emre (ADITG/SW1) [Thu, 17 Mar 2016 14:36:52 +0000 (14:36 +0000)]
hmi-controller: fix wrong panel width

The width of the first base layer is used for all panels.
Every display has a base layer which is as big as the
display. Therefore, it is wrong to use the width of the
first base layer for all panels, because every display
could have a different resolution.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agohmi-controller: fix wrong background surface size
Ucan, Emre (ADITG/SW1) [Thu, 17 Mar 2016 14:36:51 +0000 (14:36 +0000)]
hmi-controller: fix wrong background surface size

In current implementation, the size of the first application
layer is used for the background image of a display.

This is wrong because:
1. The background surface should be fullscreen.
2. Each display could have different resolution.

We should use the size of the base layer of each display
for the background image.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoinput: Implement wl_seat.release
Quentin Glidic [Sun, 13 Mar 2016 16:49:08 +0000 (17:49 +0100)]
input: Implement wl_seat.release

Avoid a crash because listener is NULL.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-By: David Fort <contact@hardening-consulting.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agocompositor-drm: fix memcmp using a bad pointer in drm_outout_choose_initial_mode
comic fans [Thu, 17 Mar 2016 12:29:27 +0000 (14:29 +0200)]
compositor-drm: fix memcmp using a bad pointer in drm_outout_choose_initial_mode

current_mode is already the pointer, taking the address of it is wrong.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94562
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
[Pekka: rewrote the patch]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoivi: Switch from MEM_ALLOC to the now equivalent xzalloc
Bryce Harrington [Wed, 16 Mar 2016 21:15:20 +0000 (14:15 -0700)]
ivi: Switch from MEM_ALLOC to the now equivalent xzalloc

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agoshared: Print .c file/line number in x* routines
Bryce Harrington [Wed, 16 Mar 2016 21:15:19 +0000 (14:15 -0700)]
shared: Print .c file/line number in x* routines

Switches from inline to pre-processor definitions in order to utilize
__FILE__ and __LINE__ from the .c file in order to display the location
of memory allocation failures when failing.

Now xmalloc, et al calls will produce:

    [weston-info] clients/weston-info.c:714: out of memory (1024)

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoclients & tests: Unify multiple definitions of x*alloc and related functions
Bryce Harrington [Wed, 16 Mar 2016 21:15:18 +0000 (14:15 -0700)]
clients & tests: Unify multiple definitions of x*alloc and related functions

Direct fail_on_null calls now produce output like:

    [weston-info] clients/weston-info.c:714: out of memory

xmalloc, et al produce output on failure like:

    [weston-info] out of memory (-1)

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoivi-shell: simplify ivi_layout_screen_set_render_order
Ucan, Emre (ADITG/SW1) [Wed, 16 Mar 2016 13:37:08 +0000 (13:37 +0000)]
ivi-shell: simplify ivi_layout_screen_set_render_order

It is not necessary check the ivi-id of pregiven objects (layer or
surface). Traversing the list of all objects is sure to find the exact
same pointer we start with, bugs aside.

The controller modules are responsible for providing valid pointers. We
cannot protect from invalid pointers anyway.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: fix subject, add commit message]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoivi-shell: simplify ivi_layout_screen_add_layer
Ucan, Emre (ADITG/SW1) [Wed, 16 Mar 2016 13:37:07 +0000 (13:37 +0000)]
ivi-shell: simplify ivi_layout_screen_add_layer

It is not necessary check the ivi-id of pregiven objects (layer or
surface). Traversing the list of all objects is sure to find the exact
same pointer we start with, bugs aside.

The controller modules are responsible for providing valid pointers. We
cannot protect from invalid pointers anyway.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: commit message]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoivi-shell: simplify ivi_layout_set_render_order
Ucan, Emre (ADITG/SW1) [Wed, 16 Mar 2016 13:37:05 +0000 (13:37 +0000)]
ivi-shell: simplify ivi_layout_set_render_order

It is not necessary check the ivi-id of pregiven objects (layer or
surface). Traversing the list of all objects is sure to find the exact
same pointer we start with, bugs aside.

The controller modules are responsible for providing valid pointers. We
cannot protect from invalid pointers anyway.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: commit message]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoivi-shell: simplify ivi_layout_layer_add_surface
Ucan, Emre (ADITG/SW1) [Wed, 16 Mar 2016 13:37:02 +0000 (13:37 +0000)]
ivi-shell: simplify ivi_layout_layer_add_surface

It is not necessary check the ivi-id of pregiven objects (layer or
surface). Traversing the list of all objects is sure to find the exact
same pointer we start with, bugs aside.

The controller modules are responsible for providing valid pointers. We
cannot protect from invalid pointers anyway.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: commit message]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoivi-shell: simplify ivi_layout_remove_surface
Ucan, Emre (ADITG/SW1) [Wed, 16 Mar 2016 13:36:59 +0000 (13:36 +0000)]
ivi-shell: simplify ivi_layout_remove_surface

It is not necessary check the ivi-id of pregiven objects (layer or
surface). Traversing the list of all objects is sure to find the exact
same pointer we start with, bugs aside.

The controller modules are responsible for providing valid pointers. We
cannot protect from invalid pointers anyway.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: commit message]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoivi-shell: remove add_configured_listener left-over
Pekka Paalanen [Wed, 16 Mar 2016 13:51:35 +0000 (15:51 +0200)]
ivi-shell: remove add_configured_listener left-over

In all my rebases, this got accidentally left behind. The implementation
was removed in 4a7503976b5d300a4474b149d877cf579c2a8c05 but
32ca791df8f855898e007512f3b996a66ffcb09c reintroduced it.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoivi-shell: introduce ivi-layout-shell.h
Pekka Paalanen [Tue, 15 Mar 2016 15:21:00 +0000 (17:21 +0200)]
ivi-shell: introduce ivi-layout-shell.h

This new header encapsulates the API that ivi-layout offers to
ivi-shell.c to call.

ivi-shell.c no longer uses ivi-layout-private.h. This limits the
ivi-layout internal structures to just ivi-layout code.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
8 years agoivi-shell: remove configured signal from ivi-layout
Pekka Paalanen [Tue, 15 Mar 2016 15:16:47 +0000 (17:16 +0200)]
ivi-shell: remove configured signal from ivi-layout

Now that ivi-layout calls directly into ivi-shell.c, this signal is no
longer used. Remove it.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
8 years agoivi-shell: call shell_surface_send_configure() directly
Pekka Paalanen [Tue, 15 Mar 2016 14:57:51 +0000 (16:57 +0200)]
ivi-shell: call shell_surface_send_configure() directly

For some reason, it seems that ivi-layout.c has tried hard to avoid
calling directly into ivi-shell.c. This means there is a jump through
hoops just to get the configure event sent to the clients. Ivi-shell
registers a listener for a ivi-layout signal for sending the event.

Instead, let ivi-layout.c call directly into ivi-shell.c, and expose a
function to send out the configure events. This reduces some confusion
on who calls what.

The main idea though is that this makes ivi-shell.c not depend on struct
ivi_layout_surface fields directly anymore. In following patches,
ivi_layout_surface can be made opaque for ivi-shell.c.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
8 years agoclients: fix incorrect format handling in simple-shm
Murray Calavera [Tue, 15 Mar 2016 21:41:14 +0000 (21:41 +0000)]
clients: fix incorrect format handling in simple-shm

the `shm_format` function seems to assume the `wl_shm_format`
enum has bit-exclusive enumerations which is not true.

Signed-off-by: Murray Calavera <murray.calavera@gmail.com>
[Pekka: fix whitespace with an 'if'.]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoivi-shell: add include guards on ivi-shell.h
Pekka Paalanen [Tue, 15 Mar 2016 15:39:22 +0000 (17:39 +0200)]
ivi-shell: add include guards on ivi-shell.h

It's our standard practice. This file will get used a bit more in the
future.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agoivi-shell: include config.h in ivi-layout-transition.c
Pekka Paalanen [Tue, 15 Mar 2016 15:39:21 +0000 (17:39 +0200)]
ivi-shell: include config.h in ivi-layout-transition.c

Every .c file must include config.h as the first thing.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agosimple-egl: use roundtrip after get_registry request
Marek Chalupa [Mon, 14 Mar 2016 10:40:38 +0000 (11:40 +0100)]
simple-egl: use roundtrip after get_registry request

Sometimes weston-simple-egl aborts in create_surface
under some conditions. It is because wl_display_dispatch()
may not be enough to make sure we have all requried objects.
Can be modeled by wldbg:

  $ wldbg -i weston-simple-egl
  (wldbg) b re get_registry
  (wldbg) c
  (wldbg) c

After these steps the weston-simple-egl aborts, because
it has not got shell neither ivi-shell objects

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoivi-shell: remove content_observer notification
Ucan, Emre (ADITG/SW1) [Mon, 14 Mar 2016 15:42:29 +0000 (15:42 +0000)]
ivi-shell: remove content_observer notification

The content observer notification struct and its
set API (ivi_layout_surface_set_content_observer)
are removed. Because they are unused.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoivi-shell: Remove all surface transitions when it is being removed.
Mateusz Polrola [Wed, 9 Mar 2016 09:13:26 +0000 (09:13 +0000)]
ivi-shell: Remove all surface transitions when it is being removed.

If surface transitions are not removed when surface is being removed, it
can lead to crash later when transition will finish, as it will try to
reference already freed memory.
This change exposes function that can remove all existing transitions
for given surface and it is being called during surface cleanup.

Signed-off-by: Mateusz Polrola <mateuszx.potrola@intel.com>
Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agodesktop-shell: make panel clock configurable
Armin Krezović [Thu, 10 Mar 2016 17:02:34 +0000 (18:02 +0100)]
desktop-shell: make panel clock configurable

This patch enhances the panel clock by adding a config file
option which can be used to either disable the clock or make
it also show seconds in the current clock format.

v2: Implement suggestions from Pekka:
    - Include Signed-off-by
    - Coding style fixes
    - Implement clock widget allocation by using
      width from cairo_text_extents
    - Highlight config option values in man page
v3: Implement suggestions from Pekka and Bryce:
    - Use CLOCK_FORMAT_* instead of FORMAT_* in the enum
    - Switch to using fixed clock widget size instead
      of one returned from cairo_text_extents
    - Fixes to config option highlighting in the man page
v4: Implement more suggestions from Pekka and Bryce:
    - Improve patch changelog
    - Move the check for CLOCK_FORMAT_NONE into the
      caller function
    - Fix a memory leak in panel_create introduced by
      previous revision of this patch

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57583
Signed-off-by: Armin Krezović <armin.krezovic@fet.ba>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoclients: Use zalloc
Bryce Harrington [Fri, 12 Feb 2016 00:42:49 +0000 (16:42 -0800)]
clients: Use zalloc

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agoplatform: explicitly cast the return value of weston_platform_get_egl_proc_address
Matthias Treydte [Fri, 29 Jan 2016 16:02:15 +0000 (17:02 +0100)]
platform: explicitly cast the return value of weston_platform_get_egl_proc_address

This allows the header to be consumed by C++ compilers, because C++ does
away with C's implicit cast from (void*).
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agooption-parser: Handle short double-arg options
Bryce Harrington [Thu, 11 Feb 2016 23:25:56 +0000 (15:25 -0800)]
option-parser: Handle short double-arg options

weston allows both short and long style options to take arguments.  In
the case of short options, allow an optional space between the option
name and value.  E.g., previously you could launch weston this way:

  weston -i2 -cmyconfig.ini

now you can also launch it like this:

  weston -i 2 -c myconfig.ini

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agoconfigure: Make jpeglib an optional dependency.
Emmanuel Gil Peyrot [Tue, 16 Feb 2016 01:57:52 +0000 (01:57 +0000)]
configure: Make jpeglib an optional dependency.

It doesn’t make sense to fail the entire build when jpeglib isn’t
present, so this commit makes it optional just like libwebp in the
previous one, disabled with --without-jpeg and forced with --with-jpeg.

Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agoprotocol: migrate to stable presentation-time.xml
Pekka Paalanen [Thu, 18 Feb 2016 14:53:27 +0000 (16:53 +0200)]
protocol: migrate to stable presentation-time.xml

Remove the unstable presentation_timing.xml file, and use
presentation-time.xml from wayland-protocols instead to generate all the
Presentation extension bindings.

The following renames are done according to the XML changes:
- generated header includes
- enum constants and macros prefixed with WP_
- interface symbol names prefixed with wp_
- protocol API calls prefixed with wp_

Clients use wp_presentation_interface.name rather than hardcoding the
global interface name: presentation-shm, weston-info, presentation-test.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
[Pekka: updated wayland-protocols dependency to 1.2]

8 years agoivi-shell: remove ivi_layout_layer_set_dimension API
Ucan, Emre \(ADITG/SW1\) [Fri, 4 Mar 2016 12:50:52 +0000 (12:50 +0000)]
ivi-shell: remove ivi_layout_layer_set_dimension API

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agoivi-shell: remove ivi_layout_surface_set_dimension API
Ucan, Emre \(ADITG/SW1\) [Fri, 4 Mar 2016 12:50:50 +0000 (12:50 +0000)]
ivi-shell: remove ivi_layout_surface_set_dimension API

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agoivi-shell: remove ivi_layout_layer_set_position API
Ucan, Emre \(ADITG/SW1\) [Fri, 4 Mar 2016 12:50:46 +0000 (12:50 +0000)]
ivi-shell: remove ivi_layout_layer_set_position API

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agoivi-shell: remove ivi_layout_surface_set_position API
Ucan, Emre \(ADITG/SW1\) [Fri, 4 Mar 2016 12:50:43 +0000 (12:50 +0000)]
ivi-shell: remove ivi_layout_surface_set_position API

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agoivi-shell: remove ivi_layout_layer_get_orientation API
Ucan, Emre \(ADITG/SW1\) [Fri, 4 Mar 2016 12:50:39 +0000 (12:50 +0000)]
ivi-shell: remove ivi_layout_layer_get_orientation API

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agoivi-shell: remove ivi_layout_surface_get_orientation API
Ucan, Emre \(ADITG/SW1\) [Fri, 4 Mar 2016 12:50:35 +0000 (12:50 +0000)]
ivi-shell: remove ivi_layout_surface_get_orientation API

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agoivi-shell: remove ivi_layout_layer_get_dimension API
Ucan, Emre \(ADITG/SW1\) [Fri, 4 Mar 2016 12:50:32 +0000 (12:50 +0000)]
ivi-shell: remove ivi_layout_layer_get_dimension API

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agoivi-shell: remove ivi_layout_surface_get_dimension API
Ucan, Emre \(ADITG/SW1\) [Fri, 4 Mar 2016 12:50:28 +0000 (12:50 +0000)]
ivi-shell: remove ivi_layout_surface_get_dimension API

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agoivi-shell: remove ivi_layout_layer_get_position API
Ucan, Emre \(ADITG/SW1\) [Fri, 4 Mar 2016 12:50:24 +0000 (12:50 +0000)]
ivi-shell: remove ivi_layout_layer_get_position API

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agoivi-shell: remove ivi_layout_surface_get_position API
Ucan, Emre \(ADITG/SW1\) [Fri, 4 Mar 2016 12:50:20 +0000 (12:50 +0000)]
ivi-shell: remove ivi_layout_surface_get_position API

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agoivi-shell: remove ivi_layout_layer_get_opacity API
Ucan, Emre \(ADITG/SW1\) [Fri, 4 Mar 2016 12:50:16 +0000 (12:50 +0000)]
ivi-shell: remove ivi_layout_layer_get_opacity API

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agoivi-shell: remove ivi_layout_surface_get_opacity API
Ucan, Emre \(ADITG/SW1\) [Fri, 4 Mar 2016 12:50:12 +0000 (12:50 +0000)]
ivi-shell: remove ivi_layout_surface_get_opacity API

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agoivi-shell: remove ivi_layout_layer_get_visibility API
Ucan, Emre \(ADITG/SW1\) [Fri, 4 Mar 2016 12:50:07 +0000 (12:50 +0000)]
ivi-shell: remove ivi_layout_layer_get_visibility API

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agoivi-shell: remove ivi_layout_surface_get_visibility API
Ucan, Emre \(ADITG/SW1\) [Fri, 4 Mar 2016 12:50:06 +0000 (12:50 +0000)]
ivi-shell: remove ivi_layout_surface_get_visibility API

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Acked-by: wataru_natsume <wataru_natsume@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agohmi-controller: fix leak of ivi surface list
Wataru Natsume [Thu, 3 Mar 2016 10:56:52 +0000 (19:56 +0900)]
hmi-controller: fix leak of ivi surface list

get_surfaces_on_layer() allocates memory and stores the pointer to
'ivisurfs'. But it was not freed.

Signed-off-by: Wataru Natsume <WATARU_NATSUME@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoremove warning of ivisurface reassign on the ivilayer
Wataru Natsume [Thu, 3 Mar 2016 10:56:09 +0000 (19:56 +0900)]
remove warning of ivisurface reassign on the ivilayer

The warning of ivisurface reassign can be removed. It is ok to reassign
a surface to a layer it is already on.

The warning started to show up during normal operations since patch
"hmi-controller: remove duplicate commit_changes in random mode".

Signed-off-by: Wataru Natsume <WATARU_NATSUME@xddp.denso.co.jp>
[Pekka: rewrote commit message, removed unneeded comments.]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agohmi-controller: remove duplicate commit_changes in random mode
Wataru Natsume [Wed, 17 Feb 2016 23:48:40 +0000 (08:48 +0900)]
hmi-controller: remove duplicate commit_changes in random mode

Previous code cleaned up surfaces in layer once and then added
surfaces to a layer in random. In this flow, two commitchanges are
required.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
[WATARU_NATSUME@xddp.denso.co.jp: Removes unnecessary check]
Signed-off-by: Wataru Natsume <WATARU_NATSUME@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agolibinput-device: Remove unnecessary function call
Chris Michael [Mon, 22 Feb 2016 13:47:24 +0000 (08:47 -0500)]
libinput-device: Remove unnecessary function call

When we handle keyboard key events, we already retrieve the key state
at the top of this function, so there is no real need to call the same
libinput function again as we can just reuse the 'key_state' variable
that we have above.

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agotests: cleanup test runner script.
Jon A. Cruz [Mon, 21 Dec 2015 21:38:51 +0000 (13:38 -0800)]
tests: cleanup test runner script.

Cleaned up test runner script to unify sections launching weston.
This makes the sections more legible and differences easier to spot.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoMakefile: handle also stable wayland-protocols
Pekka Paalanen [Thu, 18 Feb 2016 14:56:13 +0000 (16:56 +0200)]
Makefile: handle also stable wayland-protocols

Fix the protostability function to handle stable protocol files
correctly. Stable protocol XML file names do not have 'stable' in their
name, nor do we want to write that in the prerequisite lists in the
Makefile.

Function 'protoname' does not need fixing, because for stable protocol
prerequisites, the sed pattern will not match, and it passes stem
through as is, which is correct.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agoMakefile: move presentation_timing source out of toytoolkit
Pekka Paalanen [Thu, 18 Feb 2016 13:21:58 +0000 (15:21 +0200)]
Makefile: move presentation_timing source out of toytoolkit

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>
8 years agoconfig-parser: Check malloc and strdup returns
Bryce Harrington [Thu, 18 Feb 2016 04:46:01 +0000 (20:46 -0800)]
config-parser: Check malloc and strdup returns

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
8 years agoconfigure: Make WebP support togglable, and improve its error message.
Emmanuel Gil Peyrot [Tue, 16 Feb 2016 01:57:51 +0000 (01:57 +0000)]
configure: Make WebP support togglable, and improve its error message.

The current way was enabling WebP support whenever libwebp was found,
giving no way to the user to disable it if they had the library
installed but didn’t want to link against it.  This adds a
--without-webp configure option to never link against it, and a
--with-webp one to fail the build if it isn’t found, the default being
to use it if it is present.

Additionally, we now tell the user when WebP support has been disabled
and they try to load a WebP file.

Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agolibinput-device: Remove unnecessary function call
Christopher Michael [Fri, 19 Feb 2016 16:07:00 +0000 (11:07 -0500)]
libinput-device: Remove unnecessary function call

When we handle pointer button events, we already retrieve the button
state at the top of this function, so there is no real need to call
the same function again as we can just reuse the 'button_state'
variable that we have above.

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agobuild: Require dbus for systemd-login
Manuel Bachmann [Wed, 4 Nov 2015 11:13:08 +0000 (12:13 +0100)]
build: Require dbus for systemd-login

systemd-login support requires dbus (see "dbus.h" header in
"launcher-logind.c") but the configure script was only
checking libsystemd-login availability to define the
HAVE_SYSTEMD_LOGIN macro, which results in undefined
symbols in launcher-unit.

Put the systemd-login checks after the dbus ones, and only
run the checks if it is present. Also mention dbus in the
error message if "--enable-systemd-login" was forced.

Signed-off-by: Manuel Bachmann <manuel.bachmann@iot.bzh>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agoshell: Don't send extra configure events on click
Derek Foreman [Thu, 10 Dec 2015 19:08:01 +0000 (13:08 -0600)]
shell: Don't send extra configure events on click

The click_to_activate handler fires on every mouse click for a surface
so let's be a little quicker to early return if you're clicking on the
surface that already has activation.

This prevents (among other side effects) the sending of two xdg_configure
events for every mouse click.

This should also make having two seats with keyboards behave in the same
way as a single seat.  Previously the second seat could have a keyboard
focus on the surface and prevent some of the extra processing (including
the extra configure events) from taking place.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>