Commit Graph

4910 Commits

Author SHA1 Message Date
Emmanuel Gil Peyrot 8c7287f5ba Partially revert "xwayland: Always free reply from xcb_get_property_reply()"
This reverts commit d3553c721c.

weston_wm_write_property() takes the ownership of the reply it gets as
a parameter, and will eventually free it later in writable_callback.

This change introduced a double-free when Xwayland programs triggered a
copy to the clipboard, leading to a Weston crash.

Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-07-15 13:55:58 -07:00
Christopher Michael a820b4d635 Documentation for the prepare_lock_surface event description, is incorrect
Documentation for the prepare_lock_surface event description is
incorrect. The summary says "Tell the client..." however the full-text
description says "tell the shell..."

Signed-off-by: Chris Michael <cp.michael@samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>

[This time include the actual changes.]
2015-07-14 01:23:28 -07:00
Bryce Harrington 35e7b10d44 zunitc: Fix minor typo
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-07-14 09:26:55 +03:00
Bryce Harrington 966cc4b5db zunitc: Fix some minor grammatical errors in dox
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-07-14 09:26:50 +03:00
Bryce Harrington 66f2a383c4 zunitc: wrap dox to 80 columns
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-07-14 09:26:08 +03:00
Christopher Michael 504c4c56fc Documentation for the prepare_lock_surface event description, is incorrect
Documentation for the prepare_lock_surface event description is
incorrect. The summary says "Tell the client..." however the full-text
description says "tell the shell..."

Signed-off-by: Chris Michael <cp.michael@samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-07-13 12:57:41 -07:00
Bryce Harrington 29f09fe876 screen-share: Use the correct list pointer when freeing shm buffers
The wl_list_for_each operation on the free_buffers list should use
free_link not link, which is a different list.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2015-07-13 12:47:45 -07:00
Giulio Camuffo 2f2a70cc85 compositor: make sure to reset views' pointers to destroyed output
When an output is being destroyed reassign the output of the views
that were in it, to be sure not to keep a dangling pointer which could
be used later on by calling weston_surface_assign_output() on the
view's surface.
Also make sure we send wl_surface.leave events to the surfaces that
were in that output.

Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2015-07-13 11:16:55 +01:00
Derek Foreman f53beb8fb9 compositor-wayland: Use the correct list pointer when freeing shm buffers
The wl_list_for_each operation on the free_buffers list should use
free_link not link, which is a different list.

This fixes a crash when entering fullscreen mode when using the pixman
renderer on the wayland back-end.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
2015-07-10 18:46:24 -07:00
Bryce Harrington da41b5739d xwayland: Allow dump_property when selection fails
dump_property allows reply to be NULL.  Calling it unconditionally will
ensure user knows where the selection failed.

Also refactor code a bit.

Suggested by Marek Chalupa
2015-07-10 18:13:48 -07:00
Bryce Harrington b2d79d504e xwayland: Check return of xcb_get_property_reply() before deref
The man pages indicate this routine can return NULL on certain error
conditions.

Suggested by Marek Chalupa

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
2015-07-10 18:08:26 -07:00
Derek Foreman cf7d95a688 desktop-shell: make client_initiated a bool
Make it a bool in both surface_move() and struct weston_move_grab

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2015-07-10 17:11:33 -07:00
Giulio Camuffo bab996e571 compositor: move the main() to a new main.c file
This commits starts to separate the libweston code from the weston
specific code. As such, the main() is moved, together with signals
handling and configuration handling.

The definition of DEFAULT_REPAINT_WINDOW is left in compositor.c, so the
config loading of repaint_msec is slightly modified to account that.

Acked-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-07-10 12:46:55 +03:00
Giulio Camuffo 459137bfe6 compositor: add API to manage compositor instances
This commit adds three new exported functions:
- weston_compositor_create() returns a new weston_compositor instance,
initializing it as the now removed weston_compositor_init() did.
- weston_compositor_exit(compositor) asks the compositor to tear
down by calling the compositor's exit vfunc which is set by the
libweston application.
- weston_compositor_destroy(compositor) is called by the libweston
application when tearing down the compositor. The compositor is destroyed
and the memory freed.

Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-07-10 11:59:08 +03:00
Bryce Harrington d3553c721c xwayland: Always free reply from xcb_get_property_reply()
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
2015-07-10 01:09:33 -07:00
Bryce Harrington da9d8fa3e4 clients: Simplify memory allocation with xzalloc()
It is redundant to check x*alloc's return value for null pointers, since
they are guaranteed to either return non-NULL or terminate the program.

In cases where we memset the malloc'd memory to 0, we can more
efficiently use the xzalloc() routine.  zalloc looks for opportunities
to return memory chunks that have already been zero'd out, so it can
provide better performance.

This patch addresses this warning, reported by Denis Denisov:

  [clients/window.c:1164] -> [clients/window.c:1166]: (warning) Possible
  null pointer dereference: surface - otherwise it is redundant to check
  it against null.

  [clients/window.c:4513] -> [clients/window.c:4514]: (warning) Possible
  null pointer dereference: surface - otherwise it is redundant to check
  it against null.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
2015-07-10 00:15:42 -07:00
Bryce Harrington 430aee1c23 weston-launch: Drop redundant exit()
error(1, ...) already will exit, per man page: "If status has a nonzero
value, then error() calls exit(3) to terminate the program using the
given value as the exit status."  So exit(EXIT_FAILURE) is never
reached.

The EXIT_FAILURE macro is guaranteed to be non-zero.  Typically it's
just 1, but on some systems (e.g. OpenVMS apparently) exit(1) means
success so EXIT_FAILURE there is defined to some other non-zero value.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
2015-07-10 00:08:58 -07:00
Giulio Camuffo 954f183e2f compositor: introduce struct weston_backend
This is a preliminary change for libweston, with no functional modifications.
Separate the backends and the core weston_compositor struct, by creating
the weston_compositor in the main(), and having the various backends extend
the weston_backend struct, an instance of which is returned by the backend
entry point.
This enable us to logically separate the compositor core from the backend,
allowing the core to be extended without messing with the backends.

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-07-09 16:17:52 +03:00
Jon A. Cruz 5a75a41d07 Added simple unit/integration test framework and corresponding test program.
Added a simple C-based test framework and an example program
that uses it to run through some simple unit tests.

This is new code inspired primarily by the approaches of Google
Test, Boost Test, JUnit and TestNG. Factors of others were also
considered during design and implementation.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-07-07 15:47:08 +03:00
Mario Kleiner 492c12fb8b desktop-shell: Allow fullscreen windows to mode-switch their output.
Fix desktop-shell's activate() method to only restore the output
mode on the single output on which a shell surface gets activated.

This way toplevel fullscreen surfaces can mode-switch their output
via method WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER and that
temporary mode properly persists until the surface loses its
fullscreen status, but effects like window switching and exposay
still work in the expected way.

v2: Split into a separate patch from original patch
    "Allow restore_output_mode() to work properly.",
    as suggested by Derek Foreman.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Cc: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-07-02 15:14:30 +03:00
Pekka Paalanen c8a1ff0ac1 compositor-drm: fix drm_waitvblank_pipe() decl style
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-07-02 15:06:08 +03:00
Bryce Harrington ada4f07bbb compositor-drm: Add comment for newly added drm_waitvblank_pipe() 2015-06-30 13:25:46 -07:00
Mario Kleiner 2ab4f4e384 compositor-drm: Handle more than two output crtcs per card
Allow proper handling of output->pipe > 1 to support
triple-head graphics cards etc. by using the "high-crtc"
support introduced in Linux 2.6.39 and libdrm 2.4.25
around May 2011.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
2015-06-30 12:24:01 -07:00
Mario Kleiner 808170452b compositor-drm: Allow weston_output_mode_switch_to_native() to work.
Initialize output->native_mode with the initially chosen
mode for an output, so weston_output_mode_switch_to_native()
has something to work with and can switch back from temporary
selected modes to the outputs native mode. Before, this was a
no-op.

This allows an output to switch back to its default mode if
a former toplevel fullscreen shell surface created via method
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER gets destroyed, or
it gets demoted to non-fullscreen, or if modesetting on the
output failed for some reason.

v2: Modified and split into a separate patch from original
    patch "Allow restore_output_mode() to work properly.",
    as suggested by Derek Foreman.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Cc: Derek Foreman <derekf@osg.samsung.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
2015-06-30 12:19:58 -07:00
Mario Kleiner 872797cdf5 compositor-drm: Fix refresh rate selection in drm_output_switch_mode
The matching logic in choose_mode() compared refresh rate
of a drm_mode candidate mode expressed in Hz against the
requested refresh rate of the target weston_mode expressed
in milliHz, so the match always failed and the logic always
ended up the mode with the highest refresh rate for a given
resolution, instead of the one matching the requested rate.

Match proper fields to fix this.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2015-06-30 12:16:41 -07:00
Mario Kleiner 9f4d655494 desktop-shell: Allow multiple active fullscreen windows on multi-display setup.
Desktop shell demoted all fullscreen shell surfaces on all active
outputs of a multi-display setup whenever any shell surface was
activated anywhere. This made it impossible to have multiple
fullscreen windows on separate outputs active at the same
time, as creating or activating any shell surface would disable
fullscreen status for all existing fullscreen surfaces.

Make lower_fullscreen_layer() more selective, so on request it
only demotes fullscreen surfaces on a specified weston_output.

The activate() method for a specific surface will now only request
demotion of fullscreen surfaces on the target output of the activated
surface, but leave fullscreen surfaces on unrelated outputs alone.

Desktop wide acting functions like the window switcher or exposay
will still demote all fullscreen surfaces on all outputs to
implement their effect as before.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
2015-06-30 12:12:53 -07:00
Jonas Ådahl 3559f892e4 xdg-shell: Further clarify xdg_surface.resize semantics
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-06-26 17:23:15 +08:00
Jonas Ådahl b317beb5e6 xdg-shell: Further clarify xdg_surface.move semantics
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-06-26 17:23:12 +08:00
Pekka Paalanen aa9536a992 text_backend: make destructor call explicit
We used to rely on the order in which the
weston_compositor::destroy_signal callbacks happened, to not access
freed memory. Don't know when, but this broke at least with ivi-shell,
which caused crashes in random places on compositor shutdown.

Valgrind found the following:

 Invalid write of size 8
    at 0xC2EDC69: unbind_input_panel (input-panel-ivi.c:340)
    by 0x4E3B6BB: destroy_resource (wayland-server.c:537)
    by 0x4E3E085: for_each_helper.isra.0 (wayland-util.c:359)
    by 0x4E3E60D: wl_map_for_each (wayland-util.c:365)
    by 0x4E3BEC7: wl_client_destroy (wayland-server.c:675)
    by 0x4182F2: text_backend_notifier_destroy (text-backend.c:1047)
    by 0x4084FB: wl_signal_emit (wayland-server-core.h:264)
    by 0x4084FB: main (compositor.c:5465)
  Address 0x67ea360 is 208 bytes inside a block of size 232 free'd
    at 0x4C2A6BC: free (vg_replace_malloc.c:473)
    by 0x4084FB: wl_signal_emit (wayland-server-core.h:264)
    by 0x4084FB: main (compositor.c:5465)

 Invalid write of size 8
    at 0x4E3E0D7: wl_list_remove (wayland-util.c:57)
    by 0xC2EDEE9: destroy_input_panel_surface (input-panel-ivi.c:191)
    by 0x4E3B6BB: destroy_resource (wayland-server.c:537)
    by 0x4E3BC7B: wl_resource_destroy (wayland-server.c:550)
    by 0x40DB8B: wl_signal_emit (wayland-server-core.h:264)
    by 0x40DB8B: weston_surface_destroy (compositor.c:1883)
    by 0x40DB8B: weston_surface_destroy (compositor.c:1873)
    by 0x4E3B6BB: destroy_resource (wayland-server.c:537)
    by 0x4E3E085: for_each_helper.isra.0 (wayland-util.c:359)
    by 0x4E3E60D: wl_map_for_each (wayland-util.c:365)
    by 0x4E3BEC7: wl_client_destroy (wayland-server.c:675)
    by 0x4182F2: text_backend_notifier_destroy (text-backend.c:1047)
    by 0x4084FB: wl_signal_emit (wayland-server-core.h:264)
    by 0x4084FB: main (compositor.c:5465)
  Address 0x67ea370 is 224 bytes inside a block of size 232 free'd
    at 0x4C2A6BC: free (vg_replace_malloc.c:473)
    by 0x4084FB: wl_signal_emit (wayland-server-core.h:264)
    by 0x4084FB: main (compositor.c:5465)

 Invalid write of size 8
    at 0x4E3E0E7: wl_list_remove (wayland-util.c:58)
    by 0xC2EDEE9: destroy_input_panel_surface (input-panel-ivi.c:191)
    by 0x4E3B6BB: destroy_resource (wayland-server.c:537)
    by 0x4E3BC7B: wl_resource_destroy (wayland-server.c:550)
    by 0x40DB8B: wl_signal_emit (wayland-server-core.h:264)
    by 0x40DB8B: weston_surface_destroy (compositor.c:1883)
    by 0x40DB8B: weston_surface_destroy (compositor.c:1873)
    by 0x4E3B6BB: destroy_resource (wayland-server.c:537)
    by 0x4E3E085: for_each_helper.isra.0 (wayland-util.c:359)
    by 0x4E3E60D: wl_map_for_each (wayland-util.c:365)
    by 0x4E3BEC7: wl_client_destroy (wayland-server.c:675)
    by 0x4182F2: text_backend_notifier_destroy (text-backend.c:1047)
    by 0x4084FB: wl_signal_emit (wayland-server-core.h:264)
    by 0x4084FB: main (compositor.c:5465)
  Address 0x67ea368 is 216 bytes inside a block of size 232 free'd
    at 0x4C2A6BC: free (vg_replace_malloc.c:473)
    by 0x4084FB: wl_signal_emit (wayland-server-core.h:264)
    by 0x4084FB: main (compositor.c:5465)

Looking at the first of these, unbind_input_panel() gets called when the
text-backend destroys its helper client which has bound to input_panel
interface. This happens after the shell's destroy_signal callback has
been called, so the shell has already been freed.

The other two errors come from
  wl_list_remove(&input_panel_surface->link);
which has gone stale when the shell was destroyed
(shell->input_panel.surfaces list).

Rather than creating even more destroy listeners and hooking them up in
spaghetti, modify text-backend to not hook up to the compositor destroy
signal. Instead, make it the text_backend_init() callers' responsibility
to also call text_backend_destroy() appropriately, before the shell goes
away.

This fixed all the above Valgrind errors, and avoid a crash with
ivi-shell when exiting Weston.

Also using desktop-shell exhibited similar Valgrind errors which are
fixed by this patch, but those didn't happen to cause any crashes AFAIK.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
2015-06-26 09:33:54 +03:00
Nobuhiko Tanibata ffcc452767 tests: test set for ivi-shell notification with bad condition in server side
These tests are implemented on test suite framework, which provides
internal method validation,
Following features are tested,
- add notification of ivi-layer with bad parameter
- add notification of ivi-surface configure with bad parameter
- add notification of creating ivi-layer with bad parameter
- add notification of creating ivi-surface with bad parameter
- add notification of removing ivi-layer with bad parameter
- add notification of removing ivi-surface with bad parameter

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:39:59 +03:00
Nobuhiko Tanibata 0af22d4d77 tests: test set for ivi-shell notification in bad condition with helper client
These tests are implemented on test suite framework, which provides
helper client.
Following features are tested,
- add notfication of ivi-surface with bad condition

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:39:54 +03:00
Nobuhiko Tanibata 495c6efb7f tests: test set for ivi-shell notification normal use case in server side
These tests are implemented on test suite framework, which provides
internal method validation.
Following features are tested,
- notification of adding ivi-layer
- notification of creating ivi-layer
- notification of removing ivi-layer

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:39:50 +03:00
Nobuhiko Tanibata 915303a275 tests: test set for ivi-shell notification normal use case with helper client
These tests are implemented on test suite framework, which provides
helper client.
Following features are tested,
  - notification of adding ivi-surface
  - notification of ivi-surface configure
  - notification of creating ivi-surface
  - notification of removing ivi-surface

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:39:45 +03:00
Nobuhiko Tanibata a10352e5c3 tests: make the test context persistent
The TESTs in ivi_layout-test.c may have several server-side parts
(RUNNER_TEST in ivi_layout-test-plugin.c) each. Sometimes we need to
carry state from one RUNNER_TEST to another within one TEST, but not
across multiple TESTs. The correct lifetime of that state would be the
lifetime (and identity) of the runner_resource, as one TEST creates and
uses at most one weston_test_runner during its lifetime.

However, tests are executed one by one. Take a shortcut, and use a static
global for storing that state. This turns the test_context into a
singleton. To ensure it is not confused between multiple TESTs, add
asserts to verify its identity.

Following patches will add tests for notification callbacks. These will
be using the carried state.

[Pekka: add serialization checks, rename the global, rewrite commit message.]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:39:10 +03:00
Nobuhiko Tanibata 83c20bcbd5 tests: test set for ivi-screen with bad condition in server side
These tests are implemented on test suite framework, which provides
internal method validation,
Following features are tested,
- ivi-screen operation with bad parameter
- render order with bad parameter
- destroy ivi-layer in the ivi-screen and call commit_changes

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:39:05 +03:00
Nobuhiko Tanibata e78a7afb60 tests: test set for ivi-screen normal use case in server side
These tests are implemented on test suite framework, which provides
internal method validation.
Following features are tested,
- ivi-screen id
- ivi-screen resolution
- render order of ivi-layers in ivi-screen

Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:38:59 +03:00
Nobuhiko Tanibata 17d4494224 tests: test set for ivi-layer with bad condition in server side
These tests are implemented on test suite framework, which provides
internal method validation.
Following features are tested for ivi-layer,
- create with bad parameter
- visibility with bad parameter
- opacity with bad parameter
- destination rectangle with bad parameter
- orientation with bad parameter
- dimension with bad parameter
- position with bad parameter
- source rectangle with bad parameter
- properties with bad parameter
- destroy ivi-layer and call set_visibility_commit_changes
- destroy ivi-layer, call set_opacity, and commit_changes
- destroy ivi-layer, call set_orientation, and commit_changes
- destroy ivi-layer, call set_dimension, and commit_changes
- call set_position, destroy ivi-layer, and commit_changes
- call set_source_rectangle, destroy ivi-layer, and commit_changes
- call set_destination_rectangle, destroy ivi-layer, and commit_changes
- create duplicate
- destroy ivi-layer and call get_layer

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:38:54 +03:00
Nobuhiko Tanibata 0671b4d930 tests: test set for ivi-layer bad condition with helper-client
These tests are implemented on test suite framework, which provides
helper client.
Following features are tested,
- bad render order of ivi-surface on ivi-layer
- call commitchanges after a ivi_surface in render order is destoryed

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:38:48 +03:00
Nobuhiko Tanibata 9e992d9aff tests: test set for ivi-layer normal use case in server side
These tests are implemented on test suite framework, which provides
internal method validation.
Following features are tested for ivi-layer,
- create
- visibility
- opacity
- orientation
- dimension
- position
- destination rectangle
- source rectangle

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:38:43 +03:00
Nobuhiko Tanibata d364393fca tests: test set for ivi-layer normal use case with helper client
These test are implemented on test suite framework, which provides
helper client.
Following features are tested,
- render order of ivi-surfaces on ivi-layer

Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:38:37 +03:00
Nobuhiko Tanibata 16ed543f87 tests: test set for ivi-surface with bad condition in server side
These tests are implemented on test suite framework, which provides
internal method validation.
Following features are tested for ivi-surface,
- destination_rectangle with bad parameter
- orientation with bad parameter
- dimension with bad parameter
- position with bad parameter
- source_rectangle with bad parameter
- properties with bad parameter

Signed-off-by: Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:38:31 +03:00
Nobuhiko Tanibata c74bafa0e9 tests: test set for ivi-surface bad condition with helper client
These tests are implemented on test suite framework, which provides
helper client.
Following features are tested,
- ivi_layout_runner with basic_test_names[]
 - surface with bad opacity
- destroy ivi/wl_surface and call get_surface
- commit_changes_after_properties_set_surface_destroy with
  surface_property_commit_changes_test_names[]
 - call set_visibility, destroy ivi-surface, and commit_changes
 - call set_opacity, destroy ivi-surface, and commit_changes
 - call set_orientation, destroy ivi-surface, and commit_changes
 - call set_dimension, destroy ivi-surface, and commit_changes
 - call set_position, destroy ivi-surface, and commit_changes
 - call set_source_rectangle, destroy ivi-surface, and commit_changes
 - call set_destination_rectangle, destroy ivi-surface, and
  commit_changes

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:38:25 +03:00
Nobuhiko Tanibata 23d95824a5 tests: test set for ivi-surface normal use case with helper client
These tests are implemented on test suite framework, which provides
helper client.
Following features are tested for ivi-surface
- orientation
- dimension
- position
- destination rectangle
- source rectangle

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-25 11:38:10 +03:00
Nobuhiko Tanibata 3aa8aedb47 ivi-shell: rename to ivi_layout_layer_destroy()
"remove" is not proper name beacause it destorys a layer. The name of
the api is changed from layer_remove to layer_destroy.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-06-23 15:57:16 +03:00
Nobuhiko Tanibata 5d4a323c36 ivi-shell: bugfix, update event_mask when new propertiy is not same as before.
In previous code, it sends notification whenever setter calls. This
patch fixs that notification will not happens if there is no change of
properties by setter.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-06-23 15:57:15 +03:00
Nobuhiko Tanibata 6ce3ef864d ivi-shell: bugfix, send notification when properties are changed according to event mask.
Previous code sends notification without event mask. So the notification

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-06-23 15:57:15 +03:00
Nobuhiko Tanibata 4d0116eb0d ivi-shell: add interface to get screen ID
This interface is required for user to manage screens per IDs.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-06-23 15:57:15 +03:00
Nobuhiko Tanibata db8efd1f26 ivi-shell: add new method to remove a callback to get notificaiton of ivi_layer property changes.
To get property changes of ivi_layer, callbacks can be registered.
However there was no API to remove a callback rather than removing all
callbacks by using layer_remove_notification.
layer_remove_notification_by_callback can do it.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-06-23 15:57:15 +03:00
Nobuhiko Tanibata 82051705b5 ivi-shell: add new method to remove a callback to get notification of ivi_surface property changes.
To get property changes of ivi_surface, callbacks can be registered.
However there was no API to remove a callback rather than remove all
callbacks by using surface_remove_notification.
surface_remove_notification_by_callback can do it.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-06-23 15:57:15 +03:00
Nobuhiko Tanibata 4b601e152e ivi-shell: bugfix, add ref_count to ivi_layout_layer
if a controller calls ivi_layout_layer_create_with_demenstion with a ID
which is already created before, the API returns exist ivi_layer.
However addtionally, it shall count up ref count to destroy ivi_layer
when ref count is 0. The previous code will destroy ivi_layer
immediately even if the other code still refers ivi_layer.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-06-23 15:57:15 +03:00