platform/upstream/weston.git
8 years agocompositor: surface and view output comment fixes
Pekka Paalanen [Wed, 30 Mar 2016 11:33:33 +0000 (14:33 +0300)]
compositor: surface and view output comment fixes

weston_surface::output and weston_view::output as used for different
purposes. Only the surface output is used for frame callbacks.

The uses of the view output are much more vague and hard to describe.

Also fix a comment mistake in weston_surface_assign_output().

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Armin Krezović <krezovic.armin@gmail.com>
[Pekka: more verbose on the compositor.h comments]

8 years agocompositor: fix comments about weston_compositor::surface_list
Pekka Paalanen [Wed, 30 Mar 2016 11:08:24 +0000 (14:08 +0300)]
compositor: fix comments about weston_compositor::surface_list

a7af70436b7dccfacd736626d6719b3e751fd985 converted the surface list into
a view list. There is no weston_compositor::surface_list anymore.

It looks like weston_surface::output's comment about surface list does
not apply to view list. Still, many places assume weston_surface::output
is not NULL when processing "visible" surfaces, e.g. those reachable via
the view list.

The comment on weston_view::output is updated. It seems there is no
longer any requirement for it to be NULL if the view is not in
view_list.

weston_view::link is documented to be in weston_compositor::view_list,
and weston_compositor::view_list is documented to contain weston_views.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Armin Krezović <krezovic.armin@gmail.com>
[Pekka: removed also the other "Must be NULL" comment.]

8 years agoeventdemo: use %u for uint32_t printing
Pekka Paalanen [Fri, 13 May 2016 11:07:20 +0000 (14:07 +0300)]
eventdemo: use %u for uint32_t printing

I was confused why timestamp was printed negative. This fixes it, and
others while at it.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Benoit Gschwind <gschwind@gnu-log.net>
8 years agoeventdemo: do not print axis events if not requested
Pekka Paalanen [Tue, 12 Apr 2016 10:53:55 +0000 (13:53 +0300)]
eventdemo: do not print axis events if not requested

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Tested-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Benoit Gschwind <gschwind@gnu-log.net>
Tested-by: Benoit Gschwind <gschwind@gnu-log.net>
8 years agoeventdemo: use zalloc
Pekka Paalanen [Tue, 12 Apr 2016 10:49:53 +0000 (13:49 +0300)]
eventdemo: use zalloc

Zero-initialize the struct, just in case.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Tested-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Benoit Gschwind <gschwind@gnu-log.net>
Tested-by: Benoit Gschwind <gschwind@gnu-log.net>
8 years agoeventdemo: do not print pointer frames alone
Pekka Paalanen [Tue, 12 Apr 2016 10:33:09 +0000 (13:33 +0300)]
eventdemo: do not print pointer frames alone

Print pointer frames only if any pointer related events are printed
first.

This avoids flooding the output with "pointer frame" just because of
motion. You can test this with e.g.
  $ ./weston-eventdemo --log-button

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Tested-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Benoit Gschwind <gschwind@gnu-log.net>
Tested-by: Benoit Gschwind <gschwind@gnu-log.net>
8 years agodata: Some client icons
Bryce Harrington [Fri, 25 Mar 2016 00:57:39 +0000 (17:57 -0700)]
data: Some client icons

This adds an alternate weston terminal icon and icons for the flower and
editor clients.  The original Inkscape SVG file is included.

Example screenshot:
  http://www.bryceharrington.org/Files/weston-icons.png

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
8 years agoivi-layout: clarify get_layers_under_surface doc
Pekka Paalanen [Tue, 12 Apr 2016 14:16:26 +0000 (17:16 +0300)]
ivi-layout: clarify get_layers_under_surface doc

This is derived from the implementation. I was not sure whether "under"
referred to object relationships or region intersections.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
8 years agoivi-shell-user-interface: ignore all but first seat
Pekka Paalanen [Mon, 9 May 2016 14:13:50 +0000 (17:13 +0300)]
ivi-shell-user-interface: ignore all but first seat

This client should support binding to multiple seats, but as it does
not, make a quick and dirty fix to ignore all seats beyond the first
one.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Emre Ucan <eucan@de.adit-jv.com>
8 years agomain: let load_wayland_backend() clean up on error
Benoit Gschwind [Tue, 10 May 2016 20:47:57 +0000 (22:47 +0200)]
main: let load_wayland_backend() clean up on error

weston_wayland_backend_config_release() does not bother reinitializing
the structure, it simply frees what is there. This leads to a structure
containing garbage, which might be a surprise.

Require, that if load_wayland_backend_config() fails, the caller must
call weston_wayland_backend_config_release() regardless.

Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
[Pekka: rewrote commit message]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agomain: rename new_config arg of weston_wayland_backend_config_add_new_output
Benoit Gschwind [Tue, 10 May 2016 20:47:56 +0000 (22:47 +0200)]
main: rename new_config arg of weston_wayland_backend_config_add_new_output

Rename new_config to config to follow legacy naming scheme.

Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agomain: rename new_config arg of weston_wayland_backend_config_release
Benoit Gschwind [Tue, 10 May 2016 20:47:55 +0000 (22:47 +0200)]
main: rename new_config arg of weston_wayland_backend_config_release

Rename new_config to config to follow legacy naming scheme.

Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agomain: rename wayland_backend_config_release function
Benoit Gschwind [Tue, 10 May 2016 20:47:53 +0000 (22:47 +0200)]
main: rename wayland_backend_config_release function

Rename the wayland_backend_config_release function to
weston_wayland_backend_config_release to follow legacy naming scheme.

Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
[Pekka: rebased]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agomain: rename wayland_backend_config_add_new_output function
Benoit Gschwind [Tue, 10 May 2016 20:47:52 +0000 (22:47 +0200)]
main: rename wayland_backend_config_add_new_output function

Rename wayland_backend_config_add_new_output to
weston_wayland_backend_config_add_new_output to follow the legacy naming
scheme.

Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
[Pekka: rebased]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agomain: replace and remove new_config in load_wayland_backend_config
Benoit Gschwind [Tue, 10 May 2016 20:47:51 +0000 (22:47 +0200)]
main: replace and remove new_config in load_wayland_backend_config

Remove the unseless intermediate variable new_config in the function
load_wayland_backend_config, replacing it by the renamed parameter
'config'.

Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
[Pekka: Squashed in "compositor-wayland: rename out_config arg of load_wayland_backend_config".]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agomain: rename load_wayland_backend_config arg "config" to wc
Benoit Gschwind [Tue, 10 May 2016 20:47:50 +0000 (22:47 +0200)]
main: rename load_wayland_backend_config arg "config" to wc

Rename the load_wayland_backend_config arg "config" to use this name for
another variable in the following patch. It also follow the legacy
naming scheme.

Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agocompositor-wayland: move configuration parsing to weston main.c
Benoit Gschwind [Tue, 10 May 2016 20:47:49 +0000 (22:47 +0200)]
compositor-wayland: move configuration parsing to weston main.c

Move function load_wayland_backend_config,
wayland_backend_config_add_new_output, wayland_backend_config_release,
weston_wayland_output_config_init from compositor-wayland.c to main.c.
Not a single character is changed in those functions.

Create a glue function load_wayland_backend to use moved functions and
following the new load_*_backend style.

Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
Acked-by: Quentin Glidic <sardemff7+git@sardemff7.net>
[Pekka: removed left-over entry from load_backend().]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agocompositor-wayland: add versionning to config structure
Benoit Gschwind [Tue, 10 May 2016 20:47:48 +0000 (22:47 +0200)]
compositor-wayland: add versionning to config structure

The patch use temporary code that prepare the patch:
"compositor-wayland: move configuration parsing to weston main.c"

Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
8 years agocompositor-wayland: rename misleading output arg of weston_wayland_output_config_init
Benoit Gschwind [Tue, 10 May 2016 20:47:47 +0000 (22:47 +0200)]
compositor-wayland: rename misleading output arg of weston_wayland_output_config_init

Rename the misleading output argument to output_config in the
weston_wayland_output_config_init function.

Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
8 years agocompositor-wayland: rename wayland_output_init_from_config
Benoit Gschwind [Tue, 10 May 2016 20:47:46 +0000 (22:47 +0200)]
compositor-wayland: rename wayland_output_init_from_config

Rename wayland_output_init_from_config to weston_wayland_output_config_init
to prepare the following patch :
"compositor-wayland: move configuration parsing to weston"

Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
[Pekka: drop a useless comment]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agocompositor-wayland: fix spacing and lines wraping
Benoit Gschwind [Tue, 10 May 2016 20:47:44 +0000 (22:47 +0200)]
compositor-wayland: fix spacing and lines wraping

Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
[Pekka: squashed with "compositor-wayland: fix too long lines".]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
8 years agodrm: port the drm backend to the new init api
Giulio Camuffo [Fri, 29 Apr 2016 22:40:34 +0000 (15:40 -0700)]
drm: port the drm backend to the new init api

Preparing for libweston and for the separation of the code base into
libweston vs. weston the compositor, we must remove all uses
weston_config structures from the backends. We have decided that all
option and config input happens in the compositor (main.c), and
configuration is passed in for the backends as structs.

Most other backends have already converted, and this patch converts the
DRM-backend to the libweston-style init API.

The libweston-style init API includes a header for each backend (here
compositor-drm.h) defining the configuration interface. The compositor
(main.c) prepares a configuration struct to be passed through libweston
core to the backend during initialization.

A complication with the DRM-backend is that outputs can be hotplugged,
and their configuration needs to be fetched from the compositor
(main.c). For this, the config struct contains a callback member. The
output configuration API is subject to change later, this is just a
temporary API to get libweston forward.

As weston_compositor's user_data was not previously used for anything,
and the output configuration callback needs data, the user_data is set
to the 'config' pointer. This pointer is only used in
drm_configure_output() in main.c.

[Bryce: lots of stuff and rebasing]
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Benoit Gschwind <gschwind@gnu-log.net>
[Pekka: write commit message]
[Pekka: squash in "drm: Don't hang onto the backend config object
post-backend_init" from Bryce Harrington]
[Pekka: drop the compositor.h hunk]
[Pekka: do not #include inside extern "C"]
[Pekka: remove incorrect comment about weston_drm_backend_config
ownership.]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agocompositor: refactor into convert_size_by_transform_scale()
Pekka Paalanen [Tue, 26 Apr 2016 12:50:59 +0000 (15:50 +0300)]
compositor: refactor into convert_size_by_transform_scale()

There were two copies of code applying transform and scale to size.
Refactor the code to use just one copy in a new function.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agocompositor: constify weston_surface_build_buffer_matrix()
Pekka Paalanen [Tue, 26 Apr 2016 12:50:58 +0000 (15:50 +0300)]
compositor: constify weston_surface_build_buffer_matrix()

Makes it easier to see that it does not change weston_surface state
implicitly.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agoreleasing: Correct documentation for script name
Bryce Harrington [Wed, 4 May 2016 21:58:24 +0000 (14:58 -0700)]
releasing: Correct documentation for script name

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agocompositor-wayland: put configuration structure in separate header
Benoit Gschwind [Thu, 28 Apr 2016 18:33:15 +0000 (20:33 +0200)]
compositor-wayland: put configuration structure in separate header

Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
[Pekka: moved #include out of extern "C".]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agocompositor-wayland: split backend_init
Benoit Gschwind [Thu, 28 Apr 2016 18:33:14 +0000 (20:33 +0200)]
compositor-wayland: split backend_init

Extract configuration parsing from init_backend function. The new
init_backend start by generating the configuration structure from
configuration file with separated function and then use this structure
to load the backend.

Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
[Pekka: rebased]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agocompositor-wayland: split wayland_output_create_for_config
Benoit Gschwind [Thu, 28 Apr 2016 18:33:12 +0000 (20:33 +0200)]
compositor-wayland: split wayland_output_create_for_config

The splitting intend to separate configuration parsing from output
setup.

Introduces struct weston_wayland_backend_output_config.

Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
[Pekka: squashed "wayland-backend: define output configuration
structure" into this.]
[Pekka: fix fullscreen output scale back to 1.]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agocompositor-wayland: move config parsing in create_cursor
Benoit Gschwind [Thu, 28 Apr 2016 18:33:11 +0000 (20:33 +0200)]
compositor-wayland: move config parsing in create_cursor

Move configuration parsing from create_cursor to backend_init. Use newer
configuration structure to initialize the cursor in create_cursor.

Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agocompositor-wayland: use new config struture to create backend
Benoit Gschwind [Thu, 28 Apr 2016 18:33:10 +0000 (20:33 +0200)]
compositor-wayland: use new config struture to create backend

Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agocompositor-wayland: fix memory leak of display_name
Benoit Gschwind [Thu, 28 Apr 2016 18:33:09 +0000 (20:33 +0200)]
compositor-wayland: fix memory leak of display_name

Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agocompositor-wayland: create a basic config structure to use in new init API
Benoit Gschwind [Thu, 28 Apr 2016 18:33:08 +0000 (20:33 +0200)]
compositor-wayland: create a basic config structure to use in new init API

Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agolibinput: Remove unused static values
Daniel Stone [Wed, 4 May 2016 09:04:33 +0000 (10:04 +0100)]
libinput: Remove unused static values

default_seat and default_seat_name are not used anywhere in this file.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
8 years agoweston.pc: Properly specify Requires.private
Quentin Glidic [Tue, 5 Apr 2016 08:11:32 +0000 (10:11 +0200)]
weston.pc: Properly specify Requires.private

We include wayland-server.h, pixman.h and xkbcommon.h in compositor.h,
but they are not required for linking if the plugin doesn’t use them.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Daniel Stone <daniels@collabora.com>
8 years agoconfigure.ac: bump to version 1.10.91 for the alpha release
Bryce Harrington [Wed, 4 May 2016 01:35:32 +0000 (18:35 -0700)]
configure.ac: bump to version 1.10.91 for the alpha release

8 years agocompositor.h: Add shell_interface.get_output_work_area
Quentin Glidic [Wed, 23 Mar 2016 12:50:49 +0000 (13:50 +0100)]
compositor.h: Add shell_interface.get_output_work_area

This will allow plugins to be aware of e.g. panels, to avoid covering
them with other surfaces.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agox11: Fix incorrect output counting logic
Bryce Harrington [Tue, 3 May 2016 08:34:23 +0000 (01:34 -0700)]
x11: Fix incorrect output counting logic

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agox11: port the x11 backend to the new init api
Benoit Gschwind [Sat, 16 Apr 2016 03:28:31 +0000 (20:28 -0700)]
x11: port the x11 backend to the new init api

Use a "well" defined structure to configure x11-backend and move configuration
file parsing inside the weston compositor code.

Enforce destruction of all backend config objects after initialization.
Since the backend config struct versioning implies that there we expect
potential future descrepancy between main's definition of the config
object and the backend's, don't allow the backend to hang onto the
config object outside the initialization scope.

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>
Reviewed-by: Benoit Gschwind <gschwind@gnu-log.net>
Tested-by: Benoit Gschwind <gschwind@gnu-log.net>
8 years agoheadless-backend: fix leak of transform configuration
Benoit Gschwind [Fri, 29 Apr 2016 13:21:54 +0000 (15:21 +0200)]
headless-backend: fix leak of transform configuration

Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
[Pekka: fixed the mispelling in subject]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agocompositor: Hyphenate compound adjective surface-local
Yong Bakos [Thu, 28 Apr 2016 16:59:10 +0000 (11:59 -0500)]
compositor: Hyphenate compound adjective surface-local

See https://lists.freedesktop.org/archives/wayland-devel/2016-April/028249.html.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agoivi-application: Hyphenate compound adjective surface-local
Yong Bakos [Thu, 28 Apr 2016 16:59:09 +0000 (11:59 -0500)]
ivi-application: Hyphenate compound adjective surface-local

See https://lists.freedesktop.org/archives/wayland-devel/2016-April/028249.html.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agoivi-layout: Correct coordinate adjective grammar, misspellings
Yong Bakos [Thu, 28 Apr 2016 16:59:08 +0000 (11:59 -0500)]
ivi-layout: Correct coordinate adjective grammar, misspellings

Hyphenate 'multi screen' coordinates, and correct misspellings and
grammar within changed lines.

See https://lists.freedesktop.org/archives/wayland-devel/2016-April/028249.html.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agofullscreen-shell: Use 'surface-local' to correct grammar
Yong Bakos [Thu, 28 Apr 2016 16:59:07 +0000 (11:59 -0500)]
fullscreen-shell: Use 'surface-local' to correct grammar

Correct the pluralization by simplifying with 'surface-local'.

See https://lists.freedesktop.org/archives/wayland-devel/2016-April/028249.html.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agodesktop-shell: Use 'surface-local' to correct grammar
Yong Bakos [Thu, 28 Apr 2016 16:59:06 +0000 (11:59 -0500)]
desktop-shell: Use 'surface-local' to correct grammar

Correct the pluralization by simplifying with 'surface-local'.

See https://lists.freedesktop.org/archives/wayland-devel/2016-April/028249.html.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
8 years agofbdev-backend: refactor configuration API
Benoit Gschwind [Wed, 27 Apr 2016 21:56:42 +0000 (23:56 +0200)]
fbdev-backend: refactor configuration API

Implement a "well" defined API to configure the fbdev backend.
Following and according to discussion about libweston API

The output transform configuration is moved into weston and added to the
fbdev configuration structure.

Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
[Pekka: squashed two patches and rebased.]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agocompositor-fbdev: make copy of the device string
Pekka Paalanen [Thu, 28 Apr 2016 12:12:25 +0000 (15:12 +0300)]
compositor-fbdev: make copy of the device string

Ensuring that the pointer to the device path stays valid gets harder and
harder with migrating to the libweston-style config handling. Therefore,
make a copy of the string, private to struct fbdev_output.

Now the pointer passed in to fbdev_output_create() could be freed right
after the call returns.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Benoit Gschwind <gschwind@gnu-log.net>
8 years agolinux-dmabuf: Keep checking planes even if the first doesn't support lseek
Derek Foreman [Mon, 25 Apr 2016 14:23:24 +0000 (09:23 -0500)]
linux-dmabuf: Keep checking planes even if the first doesn't support lseek

If we break; when lseek fails we can fail to do some legitimate tests
on remaining planes in a multi-plane buffer.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
8 years agoman: Clarify weston.ini scale option
Yong Bakos [Mon, 25 Apr 2016 12:04:32 +0000 (07:04 -0500)]
man: Clarify weston.ini scale option

Add explanations of scaling that are a bit more approachable for users.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=94824
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agocompositor-rdp: refactor configuration API
Benoit Gschwind [Fri, 22 Apr 2016 15:05:26 +0000 (17:05 +0200)]
compositor-rdp: refactor configuration API

Implement a "well" defined API to configure the rdp backend.
Following according to discution about libweston API.

Signed-off-by: Benoit Gschwind <gschwind@gnu-log.net>
Reviewed-by: David FORT <rdp.effort@gmail.com>
[Pekka: added missing headers to Makefile.am]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agoclients/nested: fix undefined reference to xzalloc
U. Artie Eoff [Fri, 22 Apr 2016 20:11:12 +0000 (13:11 -0700)]
clients/nested: fix undefined reference to xzalloc

Include shared/xalloc.h in clients/nested.c to fix
compilation error: undefined reference to `xzalloc'

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agobuild: Add (and use) an AC_SEARCH_LIBS wrapper
Quentin Glidic [Sat, 23 Apr 2016 10:02:58 +0000 (12:02 +0200)]
build: Add (and use) an AC_SEARCH_LIBS wrapper

AC_SEARCH_LIBS is the recommended macro for these checks, unfortunately,
we use AC_CHECK_LIB instead, and even AC_CHECK_FUNC, when only one
AC_SEARCH_LIBS would be enough.

This wrapper macro is used much like PKG_CHECK_MODULES, as it defines
(and AC_SUBST) the PREFIX_LIBS variable itself.

It also avoids adding unnecessary stuff to LIBS.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Tested-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agobuild: actually use CLOCK_GETTIME_LIBS for libzunitc
Gustavo Zacarias [Fri, 22 Apr 2016 13:54:35 +0000 (10:54 -0300)]
build: actually use CLOCK_GETTIME_LIBS for libzunitc

The fix/check in 34d59859 is incomplete.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 years agobuild: add check for clock_gettime() in librt
Gustavo Zacarias [Thu, 21 Apr 2016 14:18:48 +0000 (11:18 -0300)]
build: add check for clock_gettime() in librt

zuctest is another clock_gettime() user that fails to link against librt when
necessary.

Instead of adding another -lrt LDADD entry i've opted for the saner way and
converted the check to a configure test that will set CLOCK_GETTIME_LIBS
appropiately and replaced all instances of -lrt with it.
Built-tested against old and new glibc.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
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>