platform/upstream/weston.git
9 years agotests: add ivi_layout stand-alone test module
Pekka Paalanen [Fri, 27 Mar 2015 09:55:21 +0000 (11:55 +0200)]
tests: add ivi_layout stand-alone test module

This is the ivi_layout stand-alone test controller module that does not
require any clients to run. Therefore it is much simpler than
ivi_layout-test-plugin.c and does not need a matching part in
ivi_layout-test.c.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
9 years agotests: ivi_layout test infrastructure
Pekka Paalanen [Wed, 25 Mar 2015 10:50:31 +0000 (12:50 +0200)]
tests: ivi_layout test infrastructure

Testing the ivi_layout API requires two things:
- the tests must be written as a controller module to access the API
- the tests need a helper client to create some objects that can then be
  managed via the API

This patch adds all the infrastructure and two different kinds of
example tests.

Internal ivi-shell (ivi_layout) API tests are listed as ivi-*.la files
in TESTS in Makefile.am. Weston-tests-env detects these, and runs Weston
with ivi-shell, and loads the given module as a controller module, not
as a normal plugin.

The test controller module ivi-*.la will launch a helper client. For
ivi-layout-test.la the helper client is ivi-layout.ivi.

The helper client uses the weston-test-runner framework to fork and exec
each TEST with a fresh connection to the compositor.

The actual test is triggered by the weston_test_runner protocol
interface, a new addition to weston-test.xml. The helper client uses
weston_test_runner to trigger a test, and the server side of the
interface is implemented by the test controller module
(ivi-layout-test.la).

The server side of weston_test_runner uses the same trick as
weston-test-runner.h to gather a list of defined tests. A test is
defined with the RUNNER_TEST macro.

If a test defined by RUNNER_TEST succeeds, an event is sent to the
helper client that it can continue (or exit). If a test fails, a fatal
protocol error is sent to the helper client.

Once the helper client has iterated over all of its tests, it signals
the batch success/failure via process exit code. That is cought in the
test controller module, and forwarded as Weston's exit code.

In summary: each ivi_layout test is a combination of a client side
helper/setup and server side actual tests.

v2: Load weston-test.so, because create_client() needs it.

v3: add a comment about IVI_TEST_SURFACE_ID_BASE.

v4: Rebased to upstream weston-tests-env changes.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com> (v2)
9 years agotests: add a basic ivi-shell test
Pekka Paalanen [Mon, 23 Mar 2015 11:55:06 +0000 (13:55 +0200)]
tests: add a basic ivi-shell test

This simply tests that Weston starts with ivi-shell, and ivi_application
is present.

Changes in v3:
- Rebased to upstream weston-tests-env changes.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com> (v2)
9 years agogl-renderer: fix configless_context check
Pekka Paalanen [Wed, 8 Apr 2015 14:02:22 +0000 (17:02 +0300)]
gl-renderer: fix configless_context check

EGL_MESA_configless_context is a display extension. The query for client
extensions was overwriting the pointer, so it was being searched from
the client extensions instead.

Fix any confusion here by moving all client extension checks into
another function. Drop a useless cast.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agogl-renderer: check EGL_EXT_platform_base in supports()
Pekka Paalanen [Wed, 8 Apr 2015 14:02:21 +0000 (17:02 +0300)]
gl-renderer: check EGL_EXT_platform_base in supports()

An EGL implementation may support client extensions without supporting
EGL_EXT_platform_base. In such a case, we should return 0 to fall back
to the old eglGetDisplay() way.

Cc: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agogl-renderer: fix EGL initialization steps
Manuel Bachmann [Wed, 8 Apr 2015 14:02:20 +0000 (17:02 +0300)]
gl-renderer: fix EGL initialization steps

Some DRI drivers, including VMware vmwgfx, do not support
calling eglQueryString() with a EGL_NO_DISPLAY parameter.
Just as we do in gl_renderer_supports(), which returns 0
but does not fail in this case, do not fail in
gl_renderer_setup_egl_extensions().

Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
[Pekka: split the patch]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agoxwm: fix extra break
Derek Foreman [Tue, 7 Apr 2015 17:12:13 +0000 (12:12 -0500)]
xwm: fix extra break

The first break in TYPE_WM_PROTOCOLS was almost certainly intended to be
nested within the if statement.

Even if it wasn't, it makes sense there.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoivi-shell/weston.ini: fix paths
Pekka Paalanen [Tue, 24 Mar 2015 12:09:57 +0000 (14:09 +0200)]
ivi-shell/weston.ini: fix paths

If you do an out-of-tree build, all the images will be left in the
srcdir. Fix their paths.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
9 years agobuild: generate weston-ivi.ini for tests
Pekka Paalanen [Tue, 24 Mar 2015 11:51:05 +0000 (13:51 +0200)]
build: generate weston-ivi.ini for tests

The ivi-shell / hmi-controller cannot run without a properly populated
config file. Generate a config file especially for tests, which includes
paths to the build dirs.

The generated file will be used by following patches adding ivi-shell
tests.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
9 years agotests: Prefer bracket form of test command for consistency
Bryce Harrington [Fri, 3 Apr 2015 02:16:56 +0000 (19:16 -0700)]
tests: Prefer bracket form of test command for consistency

Also use variable default assignment to eliminate an if clause

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agotests: Cleanup test log filenames
Bryce Harrington [Fri, 3 Apr 2015 02:16:53 +0000 (19:16 -0700)]
tests: Cleanup test log filenames

The log files were being named like:

surface-global-test.la-log.txt
surface-global-test.la-serverlog.txt
surface-test.la-log.txt
surface-test.la-serverlog.txt
text.weston-log.txt
text.weston-serverlog.txt

For consistency, omit the test filename's extension (.la/.so).

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agotests: Keep track of basename
Bryce Harrington [Fri, 3 Apr 2015 02:16:52 +0000 (19:16 -0700)]
tests: Keep track of basename

basename returns the filename without path information (but with
the file extension).  We can get this more efficiently via shell
variables.

Also, for the socket name, use the test's name without the file
extension.

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
[Pekka: rebased without "tests: Support --config to enable tests to
override config defaults".]

9 years agocompositor: Help text for --config
Bryce Harrington [Fri, 3 Apr 2015 02:16:50 +0000 (19:16 -0700)]
compositor: Help text for --config

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agocompositor-wayland: ignore frame callback's time
Pekka Paalanen [Thu, 2 Apr 2015 13:26:06 +0000 (16:26 +0300)]
compositor-wayland: ignore frame callback's time

Weston running the Wayland backend is nested. The parent compositor uses
an unknown clock for the frame callback timestamps. This is quite likely
a different clock from what the nested Weston chose as its presentation
clock.

This means we cannot reasonably read the presentation clock and assume
it has any relation to the timestamp got from the frame callback. In
fact, this was seen to cause absurd repaint delays, trigger the insanity
check, reduce fraterate, etc. problems, because we assume we can read
the clock and compute the remaining repaint delay.

As we can't use the timestamp, ignore it, and read our own presentation
clock instead.

The X11 backend does not suffer from this, because there the parent
window system never provides us any timestamps, so we always read our
own clock.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Acked-by: Giulio Camuffo <giuliocamuffo@gmail.com>
9 years agoxwayland: Stack windows on top when activating them
Jasper St. Pierre [Sun, 22 Mar 2015 17:14:49 +0000 (10:14 -0700)]
xwayland: Stack windows on top when activating them

Now that we've removed the XYToWindow handler in Xwayland, we actually
have to stack windows properly. This stacks windows on top when
activating them.

Note that for a fully robust Xwayland implementation, we'll need a
complete stack tracker implementation, unfortunately.

Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agoivi-layout: abort without controller_module_init
Pekka Paalanen [Thu, 26 Mar 2015 13:47:29 +0000 (15:47 +0200)]
ivi-layout: abort without controller_module_init

When loading a controller module, if we do not find a
controller_module_init symbol, return failure to the caller instead of
ignoring the failure.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
9 years agoivi-shell: add cmdline option for controller module
Pekka Paalanen [Fri, 20 Mar 2015 13:53:53 +0000 (15:53 +0200)]
ivi-shell: add cmdline option for controller module

This will be useful for tests, where we use --no-config, but ivi-shell
needs load the controller module from somewhere.

We are not making hmi-controller.so the default, because this patch
should allow running the tests also with another controller.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
9 years agotests: rename client_create to create_client_and_test_surface
Pekka Paalanen [Thu, 26 Mar 2015 10:56:10 +0000 (12:56 +0200)]
tests: rename client_create to create_client_and_test_surface

A more descriptive name to not be confused with create_client().

v2: Rebased: fix also devices-test.c.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
9 years agotests: introduce create_client()
Pekka Paalanen [Thu, 26 Mar 2015 10:49:35 +0000 (12:49 +0200)]
tests: introduce create_client()

Introduce a new helper create_client(), which creates and initializes
the client struct, but does not create a wl_surface.

This will be useful for ivi-shell tests.

v2: Rebased, and restored the dependency to weston-test.so, since seat
handling requires it.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
9 years agotests: add tests for devices handling
Marek Chalupa [Mon, 30 Mar 2015 13:21:29 +0000 (09:21 -0400)]
tests: add tests for devices handling

Test misc races when adding/releasing devices

v2.: use one roundtrip after releasing devices
     add touch support

v3.: remove useless checks
     add few comments
     repeat tests 30 times instead of 100 times
     (it took too long, 30 is enough)

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agotests: implement touch in test-helpers
Marek Chalupa [Mon, 30 Mar 2015 13:20:07 +0000 (09:20 -0400)]
tests: implement touch in test-helpers

Let the client bind to wl_touch. Since we have our own seat,
we know that the compositor will have wl_touch capability.

v2: rebased due to changes in previous commit

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agotests: use special seat
Marek Chalupa [Mon, 30 Mar 2015 13:17:40 +0000 (09:17 -0400)]
tests: use special seat

When running on different backends, we don't know what devices
the backend provides. Create new seat for tests that contains
everything what we need. This is also first step in adding
touch support for tests.

v2: do not add devices in wl_seat.name event. Collect first
    all wl_seats and then pick the one that we need and
    destroy the rest. The effect is the same, but this code
    is better understandable.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agotests: fix handling globals
Marek Chalupa [Mon, 30 Mar 2015 10:37:56 +0000 (06:37 -0400)]
tests: fix handling globals

We used hard-coded version 1 for all globals. For testing
newer methods and events we need use the current version
of global. This patch fixes this and adds missing
event handlers (for the events that were added in
versions > 1)

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoweston-test: add device_{release/add} into protocol
Marek Chalupa [Mon, 30 Mar 2015 10:37:55 +0000 (06:37 -0400)]
weston-test: add device_{release/add} into protocol

This request simulates device creation/destruction from evdev (libinput)

v2: added support for touch. Touch is not supported yet,
    but better be prepared

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoxwm: tell the shell the pid of the X clients
Giulio Camuffo [Tue, 27 Jan 2015 17:10:37 +0000 (19:10 +0200)]
xwm: tell the shell the pid of the X clients

All the surfaces from all the X clients share the same wl_client so
wl_client_get_credentials can't be used to get the pid of the X
clients.
The shell may need to know the pid to be able to associate a surface
with e.g. a DBus service.

[Pekka: fixed trivial merge conflicts.]
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agotoytoolkit: fix EGL surface creation for lazy drivers
Manuel Bachmann [Sun, 29 Mar 2015 06:17:01 +0000 (08:17 +0200)]
toytoolkit: fix EGL surface creation for lazy drivers

Some DRI drivers, including VMware vmwgfx, do not support
calling eglQueryString() with a EGL_NO_DISPLAY parameter.

Allow toytoolkit to create EGL surfaces with them, by
falling back to the old creation method.

Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agonested-client: fix typo
Manuel Bachmann [Sat, 28 Mar 2015 06:06:40 +0000 (07:06 +0100)]
nested-client: fix typo

Should be "client" instead of "nclient".

Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agotoytoolkit: fix new EGL extensions fallback typedefs
Manuel Bachmann [Sat, 28 Mar 2015 06:05:48 +0000 (07:05 +0100)]
toytoolkit: fix new EGL extensions fallback typedefs

The dummy typedefs for "get_platform_display()" and
"create_platform_window()" were badly defined, which
prevented building Weston on older systems.

Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoterminal: add "Minimize" to context menu
Pekka Paalanen [Fri, 27 Mar 2015 13:48:54 +0000 (15:48 +0200)]
terminal: add "Minimize" to context menu

Terminal is a nice app that support fullscreening. To be able to test
minimizing of a fullscreen app, add an entry to the context menu. That
is the only way to minimize, as window frame is not there when
fullscreen.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agodesktop-shell: remove dead unminimization code
Manuel Bachmann [Mon, 16 Feb 2015 10:52:13 +0000 (11:52 +0100)]
desktop-shell: remove dead unminimization code

The "set_minimized(surface, 0)" function call was never
used anywhere, and not really respecting naming
conventions.

Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agocompositor: add option to specify a weston.ini
Pekka Paalanen [Tue, 24 Mar 2015 13:56:20 +0000 (15:56 +0200)]
compositor: add option to specify a weston.ini

Add a command line option to specify a file to be read instead of
weston.ini.

IVI-shell testing will at least temporarily need to specify a config
file, because it cannot run without. That is why this is being added,
but should be convenient for everybody, too.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agoPass config file from compositor to everything
Pekka Paalanen [Tue, 24 Mar 2015 13:56:19 +0000 (15:56 +0200)]
Pass config file from compositor to everything

We have the Weston command line option '--no-config' which is meant to
prevent loading weston.ini at all. It works for Weston itself, but it
does not work for any clients that also want to read weston.ini.

To fix that, introduce a new environment variable WESTON_CONFIG_FILE.
Weston will set it to the absolute path of the config file it loads.
Clients will load the config file pointed to by WESTON_CONFIG_FILE. If
the environment variable is set but empty, no config file will be
loaded. If the variable is unset, things fall back to the default
"weston.ini".

Note, that Weston will only set WESTON_CONFIG_FILE, it never reads it.
The ability to specify a custom config file to load will be another patch.

All programs that loaded "weston.ini" are modified to honour
WESTON_CONFIG_FILE.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agocompositor: move code into load_configuration()
Pekka Paalanen [Tue, 24 Mar 2015 13:56:18 +0000 (15:56 +0200)]
compositor: move code into load_configuration()

Move the config file loading code from main() to its own function.

No functional changes.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agoshared: fail reading a directory as a config file
Pekka Paalanen [Tue, 24 Mar 2015 13:56:17 +0000 (15:56 +0200)]
shared: fail reading a directory as a config file

open() will happily open directories and other non-normal files.
Attempting to parse them as config files makes no sense, so check that
the opened file is indeed a regular file.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agotests: use MODDIR in weston-tests-env
Pekka Paalanen [Tue, 24 Mar 2015 13:56:16 +0000 (15:56 +0200)]
tests: use MODDIR in weston-tests-env

Make a little short-hand for the module directory.

This also cleans up the redefinition of BACKEND in the script.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agocompositor: postpone unhandled option check
Pekka Paalanen [Tue, 24 Mar 2015 13:56:15 +0000 (15:56 +0200)]
compositor: postpone unhandled option check

Move the code that checks for unhandled command line options only after
all the module loading. We pass argc, argv to all module loaders, so
modules might want to have command line options, but you cannot use them
if the check is too early.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agopixman-renderer: use pre-computed inverse output matrix
Derek Foreman [Tue, 24 Mar 2015 16:36:16 +0000 (11:36 -0500)]
pixman-renderer: use pre-computed inverse output matrix

We've already computer the inverse of the output matrix, so we
don't need to calculate it again here.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agozoom: fix zoom
Derek Foreman [Tue, 24 Mar 2015 16:36:15 +0000 (11:36 -0500)]
zoom: fix zoom

Right now zoom only works on the output at 0, 0 because it's adding
the output corner co-ordinates to global co-ordinates that already
include the output offset.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agocompositor: fix weston_output_transform_coordinate
Derek Foreman [Tue, 24 Mar 2015 16:36:14 +0000 (11:36 -0500)]
compositor: fix weston_output_transform_coordinate

weston_output_transform_coordinate() was supposed to convert from device
co-ordinates to global co-ordinates.

Commit 0f67941c broke that by converting from global to device instead,
which just magically works ok for single untransformed outputs (where the
transformation is identity)

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agocompositor: Create the inverse of the output matrix
Derek Foreman [Tue, 24 Mar 2015 16:36:13 +0000 (11:36 -0500)]
compositor: Create the inverse of the output matrix

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoxwayland: Correct input for undecorated clients
Jasper St. Pierre [Sun, 22 Mar 2015 04:24:43 +0000 (21:24 -0700)]
xwayland: Correct input for undecorated clients

We were correctly handling decorated and fullscreen clients, but left
uninitialized values in the input region for undecorated clients. Fix
this behavi-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoinput: Don't recreate the cursor sprite when only the hotspot changes
Derek Foreman [Mon, 23 Mar 2015 15:55:32 +0000 (10:55 -0500)]
input: Don't recreate the cursor sprite when only the hotspot changes

Currently we unmap and re-map the cursor when the hotspot changes which
causes spurious enter/leave events.

This changes the pointer_set_cursor() logic to avoid this.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jonas Ã…dahl <jadahl@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoplatform: rename create_egl_window to create_egl_surface
Jonny Lamb [Tue, 24 Mar 2015 12:12:09 +0000 (13:12 +0100)]
platform: rename create_egl_window to create_egl_surface

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoplatform: remove global variables
Jonny Lamb [Tue, 24 Mar 2015 12:12:08 +0000 (13:12 +0100)]
platform: remove global variables

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoplatform: provide platform_base fallbacks and remove ifdefs
Jonny Lamb [Tue, 24 Mar 2015 12:12:07 +0000 (13:12 +0100)]
platform: provide platform_base fallbacks and remove ifdefs

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agonested-client: include platform.h
Jonny Lamb [Tue, 24 Mar 2015 12:12:06 +0000 (13:12 +0100)]
nested-client: include platform.h

Missed because buliding nested clients requires cairo-glesv2.

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agogl-renderer: provide platform_base fallbacks and remove ifdefs
Jonny Lamb [Tue, 24 Mar 2015 12:12:05 +0000 (13:12 +0100)]
gl-renderer: provide platform_base fallbacks and remove ifdefs

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agogl-renderer: call supports() automatically in create()
Jonny Lamb [Tue, 24 Mar 2015 12:12:04 +0000 (13:12 +0100)]
gl-renderer: call supports() automatically in create()

This means compositors don't need to call supports() manually and
create() will just return -1 in the failure case as before. This also
means we can deal with the case of eglGetProcAddress returning
non-NULL but not actually being available at runtime.

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agocompositor-{drm, wayland, x11}: remove useless tests for ->supports
Jonny Lamb [Tue, 24 Mar 2015 12:12:03 +0000 (13:12 +0100)]
compositor-{drm, wayland, x11}: remove useless tests for ->supports

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agogl-renderer: move all EGL_PLATFORM_* defines here
Jonny Lamb [Tue, 24 Mar 2015 12:12:02 +0000 (13:12 +0100)]
gl-renderer: move all EGL_PLATFORM_* defines here

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agogl-renderer: fix build with --disable-egl
Jonny Lamb [Tue, 24 Mar 2015 12:12:01 +0000 (13:12 +0100)]
gl-renderer: fix build with --disable-egl

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agocompositor-{drm, x11, wayland}: stop including EGL headers here
Jonny Lamb [Tue, 24 Mar 2015 12:12:00 +0000 (13:12 +0100)]
compositor-{drm, x11, wayland}: stop including EGL headers here

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoman: update weston's shells
Pekka Paalanen [Fri, 20 Mar 2015 13:59:01 +0000 (15:59 +0200)]
man: update weston's shells

Tablet shell is long gone. Might as well list what we have now.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
9 years agoclients & tests: use eglCreatePlatformWindowSurfaceEXT when supported
Jonny Lamb [Fri, 20 Mar 2015 14:26:53 +0000 (15:26 +0100)]
clients & tests: use eglCreatePlatformWindowSurfaceEXT when supported

Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agogl-renderer: use eglCreatePlatformWindowSurfaceEXT to get EGLSurfaces
Jonny Lamb [Fri, 20 Mar 2015 14:26:52 +0000 (15:26 +0100)]
gl-renderer: use eglCreatePlatformWindowSurfaceEXT to get EGLSurfaces

Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agoclients & tests: use eglGetPlatformDisplayEXT when supported
Jonny Lamb [Fri, 20 Mar 2015 14:26:51 +0000 (15:26 +0100)]
clients & tests: use eglGetPlatformDisplayEXT when supported

Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agogl-renderer: use eglGetPlatformDisplayEXT to get an EGLDisplay
Jonny Lamb [Fri, 20 Mar 2015 14:26:50 +0000 (15:26 +0100)]
gl-renderer: use eglGetPlatformDisplayEXT to get an EGLDisplay

Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agocompositor: fix return code from main()
Pekka Paalanen [Fri, 20 Mar 2015 12:35:58 +0000 (14:35 +0200)]
compositor: fix return code from main()

There were a few cases of 'goto out' in main() that did not set ret to
EXIT_FAILURE. Shell failing to init is the one I hit when writing tests
for ivi-shell.

Rather than adding a few more 'ret = EXIT_FAILURE', make that the
default and remove the redundant assignments. When Weston exits
properly ec->exit_code will take care of the exit code.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
9 years agocompositor: warn about insane repaint delay
Pekka Paalanen [Thu, 19 Mar 2015 10:27:29 +0000 (12:27 +0200)]
compositor: warn about insane repaint delay

Make the sanity check more explicit and log a warning if it happens.

Small negative values are ok because it just means the compositor is
lagging behind, or more likely the user specified a too long repaint
window.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
9 years agocompositor: add repaint delay timer
Pekka Paalanen [Wed, 21 May 2014 13:17:27 +0000 (16:17 +0300)]
compositor: add repaint delay timer

This timer delays the output_repaint towards the end of the refresh
period, reducing the time from repaint to present.

The length of the repaint window can be set in weston.ini.

The call to weston_output_schedule_repaint_reset() is delayed by one
more period.  If we exit the continuous repaint loop (set
output->repaint_scheduled to false) in finish_frame, we may call
start_repaint_loop() unnecessarily.  The problem case was actually
observed with two outputs on the DRM backend at 60 Hz, and 7 ms
repaint-window. During a window move, one output was constantly falling
off the continuous repaint loop and introducing additional one frame
latency, leading to jerky window motion. This code now avoids the
problem.

Changes in v2:

- Rename repaint_delay_timer to repaint_timer and
output_repaint_delay_handler to output_repaint_timer_handler.

- When computing the delay, take the current time into account. The timer
uses a relative timeout, so we have to subtract any time already gone.

Note, that 'gone' may also be negative. DRM has a habit of predicting
the page flip timestamp so it may be still in the future when we get the
completion event.

- Do also a sanity check 'msec > 1000'. In the unlikely case that
something fails to provide a good timestamp, never delay for more than
one second.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agocompositor, backends: weston_compositor_read_presentation_clock
Pekka Paalanen [Wed, 18 Mar 2015 10:17:26 +0000 (12:17 +0200)]
compositor, backends: weston_compositor_read_presentation_clock

Create a new function weston_compositor_read_presentation_clock() to
wrap the clock_gettime() call for the Presentation clock.

Reading the presentation clock is never supposed to fail, but if it
does, this will notify about it. I have not seen it fail yet, though.

This prepares for new testing features in the future that might allow
controlling the presentation clock. Right now it is just a convenience
function for clock_gettime().

All presentation clock readers are converted to call this new function
except rpi-backend's rpi_flippipe_update_complete(), because it gets its
clock id via a thread-safe mechanism. There shouldn't be anything really
thread-unsafe in weston_compositor_read_presentation_clock() at the
moment, but might be in the future, and weston core is not expected to
need to be thread-safe.

This is based on the original patch by
Cc: Derek Foreman <derekf@osg.samsung.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agoinput: Make setting the same pointer cursor state again a no-op
Jonas Ã…dahl [Wed, 18 Mar 2015 07:08:03 +0000 (15:08 +0800)]
input: Make setting the same pointer cursor state again a no-op

If the client calls wl_pointer.set_cursor with the same surface and hot
spot coordinate that is already set, don't do anything as no state was
changed.

This avoids an issue where a client setting the same cursor surface
multiple times would receive wl_surface.leave/enter on that surface
every time.

Signed-off-by: Jonas Ã…dahl <jadahl@gmail.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
9 years agoSpellcheck fixes
Bryce Harrington [Thu, 19 Mar 2015 01:42:00 +0000 (18:42 -0700)]
Spellcheck fixes

./ivi-shell/README:19: protocal  ==> protocol
./src/compositor.h:596: seperate  ==> separate
./src/version.h.in:33: actualy  ==> actually
./src/cms-helper.h:44: embeded  ==> embedded
./protocol/fullscreen-shell.xml:65: seperate  ==> separate
./protocol/xdg-shell.xml:150: auxilliary  ==> auxiliary
./clients/window.c:1035: preferrably  ==> preferably

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agotests: use two roundtrips for global events
Marek Chalupa [Thu, 19 Mar 2015 07:35:40 +0000 (03:35 -0400)]
tests: use two roundtrips for global events

first is for getting and binding to globals and the other one is for
getting wl_shm.formats that are emitted after binding
to wl_shm

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agodesktop-shell: don't allow negative values in drag resize
Derek Foreman [Wed, 18 Mar 2015 16:16:33 +0000 (11:16 -0500)]
desktop-shell: don't allow negative values in drag resize

Now clamping width and height to a minimum of 1, 1 when drag resizing.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agocompositor-fbdev: fix output transformations
Derek Foreman [Tue, 17 Mar 2015 18:22:38 +0000 (13:22 -0500)]
compositor-fbdev: fix output transformations

The pixman-renderer is already performing transformations when compositing
into the shadow buffer, we just need to get the damage co-ordinates right
when copying from shadow to front.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Thilo Cestonaro <thilo@cestona.ro>
9 years agocompositor-fbdev: allow configuring transform in the ini file
Derek Foreman [Tue, 17 Mar 2015 18:22:37 +0000 (13:22 -0500)]
compositor-fbdev: allow configuring transform in the ini file

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Thilo Cestonaro <thilo@cestona.ro>
9 years agocompositor-rpi: give the output a name
Derek Foreman [Tue, 17 Mar 2015 18:22:36 +0000 (13:22 -0500)]
compositor-rpi: give the output a name

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoinput: don't assume outputs have names
Derek Foreman [Tue, 17 Mar 2015 18:22:35 +0000 (13:22 -0500)]
input: don't assume outputs have names

If an output is unnamed and devices are in seats, the strcmp will crash.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agocompositor-fbdev: give the output a name
Derek Foreman [Tue, 17 Mar 2015 18:22:34 +0000 (13:22 -0500)]
compositor-fbdev: give the output a name

If you have devices configured in seats with udev then the output names
are tested with string compare.  This fixes a potential crash on startup and
device insertion.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agopixman-renderer: implement view scissor
Pekka Paalanen [Fri, 6 Mar 2015 08:33:50 +0000 (10:33 +0200)]
pixman-renderer: implement view scissor

Only needed in the source-clipped case, otherwise the boundingbox is
already doing the necessary clipping.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
9 years agopixman-renderer: implement source clipping
Pekka Paalanen [Thu, 5 Mar 2015 11:25:19 +0000 (13:25 +0200)]
pixman-renderer: implement source clipping

Implement a way to do composition clipping with a region32 given in
source image space.

Pixman does not directly support this kind of operation at all. If you
pixman_image_set_clip_region32() on a source image, it will be ignored
unless you also
pixman_image_set_source_clipping(image, 1);
pixman_image_set_has_client_clip(image, 1);
but then it takes the region from source image and still uses it in the
destination coordinate space. For reference:
http://lists.freedesktop.org/archives/pixman/2015-March/003501.html
That is actually the intended behaviour in Pixman.

This patch implements source clipping by taking each rectangle of the
source clip region, wrapping that sub-rect of the source image in a new
pixman_image_t, and compositing it separately. This might be very heavy as
we are painting the whole damage the number of rectangles times, but
practically always the number of rectangles is one.

An alternative solution would be to use mask images of type PIXMAN_a1,
render the source clip region in it, and set the transformation. You'd
probably also want to cache those images. And because we use the mask to
apply view->alpha, you'd have to use PIXMAN_a8 in those cases.

v2: Fix a comment.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
9 years agopixman-renderer: move code to draw_view_translated()
Pekka Paalanen [Thu, 5 Mar 2015 10:57:35 +0000 (12:57 +0200)]
pixman-renderer: move code to draw_view_translated()

Move code from draw_view() into a new function draw_view_translated().
This new function is correct only if
view_transformation_is_translation().

The test for view->alpha is moved into draw_view_translated() too, so we
don't need to pass the pixman_op from draw_view(). The non-translation
path is already using PIXMAN_OP_OVER, so it does not care about the
alpha.

v2: Fixed commit message.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
9 years agopixman-renderer: change repaint_region() arguments
Pekka Paalanen [Thu, 5 Mar 2015 09:56:29 +0000 (11:56 +0200)]
pixman-renderer: change repaint_region() arguments

Change the region argument types in repaint_region(), moving the
final_region computation to the caller. The caller is in a better
position deciding if source clipping is needed or if it can be intersected
into the final_region via a simple translation. This avoids
surf_region or source clip implying that the transformation is only a
translation.

The region_global_to_output() call is also moved into the callers so
that repaint_region() would not modify caller-provided data. Modifying
caller provided data could be surprising.

This patch does not change the rendering output.

v2: Remove unused source_clip argument.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
9 years agopixman-renderer: refactor into region_intersect_only_translation()
Pekka Paalanen [Wed, 4 Mar 2015 14:12:04 +0000 (16:12 +0200)]
pixman-renderer: refactor into region_intersect_only_translation()

Move code into a new helper function. No changes.

v3: Add assert, and reorder this patch with adding
view_transformation_is_translation().

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
9 years agopixman-renderer: add view_transformation_is_translation()
Pekka Paalanen [Wed, 4 Mar 2015 14:18:26 +0000 (16:18 +0200)]
pixman-renderer: add view_transformation_is_translation()

A simple refactoring just to help readability.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
9 years agopixman-renderer: refactor transformation computation
Pekka Paalanen [Wed, 4 Mar 2015 12:18:39 +0000 (14:18 +0200)]
pixman-renderer: refactor transformation computation

Move the code computing the end-to-end transformation from
repaint_region() into a new function
pixman_renderer_compute_transform().

The code itself is not modified.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
9 years agocompositor: add weston_surface_to_buffer_region()
Pekka Paalanen [Wed, 4 Mar 2015 12:23:28 +0000 (14:23 +0200)]
compositor: add weston_surface_to_buffer_region()

This will be used by pixman-renderer.

v2: Fix doc typo.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
9 years agopixman-renderer: simplify the output-to-buffer matrix computation
Jason Ekstrand [Tue, 20 May 2014 20:53:19 +0000 (15:53 -0500)]
pixman-renderer: simplify the output-to-buffer matrix computation

Now that we have a buffer-to-surface matrix and the global-to-output matrix
is in pixels, we can remove a large chunk of confusing code from the pixman
renderer.  Hopefully, having this stuff in weston core will keep the pixman
renderer from gettin broken quite as often.

This patch makes attempting zoom on the pixman-renderer render funny
stuff. We didn't support zoom before, now it renders wrong instead of
not zooming at all.

[Pekka: adjust commit message]
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
9 years agocompositor: Add surface-to-buffer and buffer-to-surface matrices
Jason Ekstrand [Thu, 16 Oct 2014 15:55:19 +0000 (10:55 -0500)]
compositor: Add surface-to-buffer and buffer-to-surface matrices

Add matrix representations of these two transformations. Future patches
will leverage these to simplify the coordinate transformation code.

[Pekka: commit message]
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
9 years agocompositor: use weston_matrix_transform for weston_output_transform_coordinate
Derek Foreman [Thu, 2 Oct 2014 18:41:17 +0000 (13:41 -0500)]
compositor: use weston_matrix_transform for weston_output_transform_coordinate

We can greatly simplify weston_output_transform_coordinate now by simply
multiplying by the output matrix and converting the result to fixed point.

This patch fixes zoomed input behaviour on the nested backends (x11,
wayland) which use absolute input coordinates. And probably also
absolute input devices. The patch that broke this was "zoom: Use pixels
instead of GL coordinates".

Signed-off-By: Derek Foreman <derekf@osg.samsung.com>
[Pekka: adjusted coding style and message]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
9 years agorpi-renderer: minimal fix to zoom coordinates
Pekka Paalanen [Tue, 10 Mar 2015 10:52:14 +0000 (12:52 +0200)]
rpi-renderer: minimal fix to zoom coordinates

The patch "zoom: Use pixels instead of GL coordinates" changed the
meaning of weston_output_zoom::trans_x,trans_y from GL coordinate system
to global coordinates.

This patch is a minimal untested change to the rpi-renderer to try and
follow up on that change.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
9 years agozoom: Use pixels instead of GL coordinates
Jason Ekstrand [Wed, 21 May 2014 03:45:02 +0000 (22:45 -0500)]
zoom: Use pixels instead of GL coordinates

Previously, the zoom functions used GL coordinates natively which doesn't
work with the new output matrix calculations.  This changes zoom to work in
pixel coordinates to match the new output matrix format.  This also cleans
up the math in the zoom code substantially.

This patch changes the meaning of weston_output_zoom::trans_x,trans_y,
and doing so probably breaks zoom on the rpi-renderer and all absolute
input devices. These problems are fixed by the following patches:

rpi-renderer: minimal fix to zoom coordinates
compositor: use weston_matrix_transform for
weston_output_transform_coordinate

[Pekka: added a comment]
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
9 years agoUse pixel coordinates for weston_output.matrix
Jason Ekstrand [Thu, 16 Oct 2014 15:55:21 +0000 (10:55 -0500)]
Use pixel coordinates for weston_output.matrix

Previously, weston_output.matrix was in GL coordinates and therefore only
really useful for the GL backend.

This breaks zoom, which will be fixed by the following patch:
zoom: Use pixels instead of GL coordinates

[Pekka: added a comment to compositor.h, message]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
9 years agozoom: remove unused args from weston_zoom_transition
Pekka Paalanen [Tue, 10 Mar 2015 10:05:44 +0000 (12:05 +0200)]
zoom: remove unused args from weston_zoom_transition

Also remove the now dead code from weston_output_update_zoom().

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
9 years agozoom: remove animation_xy as unused
Pekka Paalanen [Tue, 10 Mar 2015 09:13:14 +0000 (11:13 +0200)]
zoom: remove animation_xy as unused

Remove several fields from struct weston_output_zoom as a consequence of
removing animation_xy from it. Animation_xy was always empty, unused.

Animation_xy was likely used by text_cursor_position implementation, but
that was removed in commit a7af70436b7dccfacd736626d6719b3e751fd985.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Rviewed-By: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
9 years agoxwayland: wm: fix an invalid read
Ryo Munakata [Wed, 11 Mar 2015 08:36:30 +0000 (17:36 +0900)]
xwayland: wm: fix an invalid read

This `for` statement needs corresponding braces.

Signed-off-by: Ryo Munakata <ryomnktml@gmail.com>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agogl-renderer: Call glViewport after the context is made current
Jason Ekstrand [Thu, 16 Oct 2014 15:55:20 +0000 (10:55 -0500)]
gl-renderer: Call glViewport after the context is made current

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoshell,compositor-x11: Fix trivial memory leaks
Ryo Munakata [Sun, 8 Mar 2015 10:17:06 +0000 (19:17 +0900)]
shell,compositor-x11: Fix trivial memory leaks

Signed-off-by: Ryo Munakata <ryomnktml@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agowindow: Fix crash in input_set_pointer_image when cursor is special
Derek Foreman [Wed, 4 Mar 2015 22:26:25 +0000 (16:26 -0600)]
window: Fix crash in input_set_pointer_image when cursor is special

Certain circumstances may lead to the "force" clause in
input_set_pointer_image() being reached when the current cursor
is blank or unset.  These are special cursors that don't have
images, and they need to be handled differently than image cursors.

This patch puts the special cursor handling in its own function and calls
it from both places that need it.  Previously only the frame callback
handler did this correctly.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agogl-renderer: implement view scissor
Pekka Paalanen [Wed, 18 Feb 2015 07:48:59 +0000 (09:48 +0200)]
gl-renderer: implement view scissor

Implement support for weston_view_set_mask().

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
9 years agocompositor-drm: avoid scissor in assign_planes
Pekka Paalanen [Tue, 17 Feb 2015 14:33:18 +0000 (16:33 +0200)]
compositor-drm: avoid scissor in assign_planes

Support for scissor not implemented yet on cursor overlay or for direct
scanout. Overlays OTOH use the boundingbox to compute their coordinates,
so that should probably work.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
9 years agocompositor: add weston_view_set_mask() API and state
Pekka Paalanen [Mon, 16 Feb 2015 12:39:11 +0000 (14:39 +0200)]
compositor: add weston_view_set_mask() API and state

Add API for setting a clip ('scissor' in the code) rectangle per view,
in surface coordinates. Ivi-shell requires this feature to be able to
implement the IVI Layer Manager API, which includes clipping of
surfaces.

The names weston_view_set_mask() and weston_view_set_mask_infinite()
mirror the existing weston_layer_set_mask*() functions.

This view clipping complements the weston_layer clipping, because view
clipping is defined in surface local coordinates, while layer
mask/clipping is defined in global coordinates.

View clipping requires explicit support from the renderers. Therefore a
new Weston capability bit is added: WESTON_CAP_VIEW_CLIP_MASK. Shells
(and all users) of this new API are required to check the capability bit
is set before using the API. Otherwise the rendering will not be what
they expect.

View clips are inherited through the transformation inheritance
mechanism. However, there are restrictions. The clip rectangle can be
set only on the root view of a transformation inheritance tree. The
additional transformations in child views must not rotate the coordinate
axes. These restrictions avoid corner cases in clip inheritance, and
keep the renderer implementations as simple as they are right now.
Renderers only need to do an additional intersection with the clip
rectangle which is always aligned to the surface coordinate system.

For more details, see the API documentation in the patch.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
9 years agocompositor: restructure weston_compositor_pick_view()
Pekka Paalanen [Wed, 18 Feb 2015 13:08:29 +0000 (15:08 +0200)]
compositor: restructure weston_compositor_pick_view()

Expand weston_compositor_pick_view() so it is easier to read. Use
short-hand variables, that make it easier to add one more test in the
future.

Write the output coordinate pointers only when returning non-NULL.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
9 years agoivi-shell: add exit binding
Pekka Paalanen [Thu, 19 Feb 2015 15:12:19 +0000 (17:12 +0200)]
ivi-shell: add exit binding

Let's me easily exit ivi-shell when testing with the DRM-backend.
Only available in ivi-shell developer mode.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agoivi-shell: developer mode debug key bindings
Pekka Paalanen [Thu, 19 Feb 2015 15:08:44 +0000 (17:08 +0200)]
ivi-shell: developer mode debug key bindings

Add a weston.ini option for ivi-shell to enable "developer mode".

When developer mode is enabled, hook up the debug key bindings.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agocompositor,shell: move debug key code to core
Pekka Paalanen [Thu, 19 Feb 2015 15:02:13 +0000 (17:02 +0200)]
compositor,shell: move debug key code to core

The code for the key binding that triggers debug key bindings, that is,
the code that makes mod+SHIFT+SPACE work, used to live in shell.c. I
want to make the debug key bindings available in ivi-shell too, so this
code should be shared. Move it to core.

The code was originally introduced in
commit c509d2b1523364d38da3038eec7b46cd71acd3f5
so update the copyright in binding.c to reflect that.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agoivi-layout: separate declarations from code
Carlos Olmedo Escobar [Mon, 2 Mar 2015 12:24:36 +0000 (13:24 +0100)]
ivi-layout: separate declarations from code

Thanks Pekka for pointing that out.

Signed-off-by: Carlos Olmedo Escobar <carlos.olmedo.e@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoxdg-shell: Bump unstable version
Jasper St. Pierre [Fri, 13 Feb 2015 06:02:02 +0000 (14:02 +0800)]
xdg-shell: Bump unstable version

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoxdg-shell: Rewrite documentation
Jasper St. Pierre [Fri, 13 Feb 2015 06:02:01 +0000 (14:02 +0800)]
xdg-shell: Rewrite documentation

This rewrites basically all of the text inside xdg-shell to be up to
date, clearer, and rid of wl_shell and X11 terminology.

[jadahl: Added paragraph about popup surface mapping order.]
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>