platform/upstream/weston.git
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>
9 years agoxdg-shell: Add a simple destructor request
Jasper St. Pierre [Fri, 13 Feb 2015 06:02:00 +0000 (14:02 +0800)]
xdg-shell: Add a simple destructor request

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoxdg-shell: Add invalid_parent error to xdg_popup
Jonas Ådahl [Fri, 27 Feb 2015 10:37:41 +0000 (18:37 +0800)]
xdg-shell: Add invalid_parent error to xdg_popup

Send an invalid_parent error when the client tries to create a popup
with a paren that is neither a xdg_surface nor a xdg_popup.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoxdg-shell: Send an error when the client uses the not-topmost popup
Jasper St. Pierre [Fri, 27 Feb 2015 10:35:45 +0000 (18:35 +0800)]
xdg-shell: Send an error when the client uses the not-topmost popup

Either in destroy or get_xdg_popup.

[jadahl: Verify that the new popup is the top most when mapping instead
of creating. Some renaming.]

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

There haven't been any ideas for flags, so we don't need a useless,
unused parameter hanging around. Any future ideas should be done with a
new request entirely.

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

It doesn't serve any purpose, as it's a serial that the client gave to
the server when starting the popup, which the client already has.

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoxdg-shell: Take a xdg_surface as the parent surface
Jasper St. Pierre [Fri, 13 Feb 2015 06:01:55 +0000 (14:01 +0800)]
xdg-shell: Take a xdg_surface as the parent surface

There is no other valid surface that we should be using here.

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agocompositor: fix plane coords in view_accumulate_damage()
Pekka Paalanen [Mon, 23 Feb 2015 12:08:25 +0000 (14:08 +0200)]
compositor: fix plane coords in view_accumulate_damage()

All things everywhere, except this one case, assume weston_plane::damage
is in global coordinates. Document it.

view_accumulate_damage() is wrong in converting damage to plane
coordinates (similar to global coordinate except translated). Fix this
by removing the unwanted translation, and use only global coordinates.

We have not seen this bug manifest in real life because we get lucky:
the origin of the primary plane is always at 0, 0. We do not use
non-primary planes, except cursor plane on DRM backend where the actual
damage coordinates are ignored.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agocompositor: let view_compute_bbox() take a box32_t
Pekka Paalanen [Mon, 23 Feb 2015 10:27:00 +0000 (12:27 +0200)]
compositor: let view_compute_bbox() take a box32_t

There are two call sites, one is already having a pixman_box32_t it
needs to call view_compute_bbox() with. The other call site will have a
box32_t when view clipping gets implemented.

Change view_compute_bbox() to take a pixman_box32_t as the input
argument, and convert call sites.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agocompositor: weston_output::region is in global coords
Pekka Paalanen [Mon, 23 Feb 2015 11:54:49 +0000 (13:54 +0200)]
compositor: weston_output::region is in global coords

Add a comment saying it is. I'm not aware of misuses of it.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agocompositor: remove dead code from weston_output_move()
Pekka Paalanen [Mon, 23 Feb 2015 11:44:10 +0000 (13:44 +0200)]
compositor: remove dead code from weston_output_move()

Also fixes a theoretical memory leak as the region was never fini'd.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agocompositor: note, weston_surface_damage does it wrong
Pekka Paalanen [Thu, 19 Feb 2015 11:59:55 +0000 (13:59 +0200)]
compositor: note, weston_surface_damage does it wrong

The fix is not trivial, so I want to document the problem before I
forget about it again.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agocompositor: document view->transform.* regions
Pekka Paalanen [Thu, 19 Feb 2015 09:49:18 +0000 (11:49 +0200)]
compositor: document view->transform.* regions

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agopixman-renderer: implement surface_copy_content
Pekka Paalanen [Wed, 11 Feb 2015 10:29:56 +0000 (12:29 +0200)]
pixman-renderer: implement surface_copy_content

Changes in v2:
- remove stride and format arguments from the API

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v1 Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agogl-renderer: implement surface_copy_content
Pekka Paalanen [Mon, 9 Feb 2015 11:37:27 +0000 (13:37 +0200)]
gl-renderer: implement surface_copy_content

Taking the easy way, always do a rendering pass when copying any real
buffer or texture. Will handle YUV formats, and makes it easy to always
return data the right y-direction up.

All the FBO GL state is created and torn down on every invocation, so this
is a pretty naive implementation.

If there was a wl_shm buffer giving the content to the surface, and the
stride of the buffer was greater than width * bytes_per_pixel, then this
implementation will return stride long rows, not width.

Changes in v2:
- simplify pack_color()
- remove stride and format from the API

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v1 Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agogl-renderer: add BUFFER_TYPE_SOLID
Pekka Paalanen [Mon, 9 Feb 2015 11:56:56 +0000 (13:56 +0200)]
gl-renderer: add BUFFER_TYPE_SOLID

Add a new buffer type identifying the solid color contents which do not
have a real buffer.

Solid color surfaces now pretend to have 1x1 pixel content data.

This helps the future surface_get_data_size() implementation.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agosurface-screenshot: a new manual test module
Pekka Paalanen [Mon, 9 Feb 2015 09:23:48 +0000 (11:23 +0200)]
surface-screenshot: a new manual test module

Add a new Weston plugin under tests/ for manual testing of the
surface-shooting API.

The debug key binding 'h' triggers a surface shot from the surface that
currently has the pointer focus. The shot is written in PAM format into
a file. PAM format was chosen because it is dead-simple to write from
scratch and can carry an RGBA format.

Changes in v2:
- check fprintf calls, fix a malloc without free
- remove stride and format arguments from the API

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v1 Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agotimeline: use file_create_dated() helper
Pekka Paalanen [Thu, 12 Feb 2015 11:11:25 +0000 (13:11 +0200)]
timeline: use file_create_dated() helper

Use shared code for this kind of stuff.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agoshared: add file_create_dated() helper
Pekka Paalanen [Thu, 12 Feb 2015 10:52:21 +0000 (12:52 +0200)]
shared: add file_create_dated() helper

For easy creation of unique new files. I'm looking at you,
screenshooter.

This code is based on timeline.c weston_timeline_do_open().

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agocompositor: add surface-shooting API
Pekka Paalanen [Mon, 9 Feb 2015 11:16:57 +0000 (13:16 +0200)]
compositor: add surface-shooting API

This is an optional API that will be implemented by the renderers. It
allows to fetch the current contents of a surface, essentially the
buffer contents from a client buffer, converted to an RGBA format.

This is meant as a debugging API. The implementations may be heavy and
cause a stall, so they are not intended to be used often during normal
operations.

Renderers are expected to convert whatever data a surface has to a
single RGBA format.

Changes in v2:
- remove stride and format arguments from the API

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v1 Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agotests: Rename wayland-test to weston-test
Derek Foreman [Tue, 24 Feb 2015 15:32:14 +0000 (09:32 -0600)]
tests: Rename wayland-test to weston-test

wayland-test isn't and will never be wayland protocol, it's weston internal.

Renamed wayland-test to weston-test, and wl_test to weston_test.

Also added a Big Fat Warning to the description of weston_test to try to
keep people from thinking it's a good idea to use some of these functions
outside of testing.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Acked-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agocompositor: turn weston_view boundingbox into masked
Pekka Paalanen [Thu, 19 Feb 2015 09:15:33 +0000 (11:15 +0200)]
compositor: turn weston_view boundingbox into masked

weston_view::transform.boundingbox is made to include the layer mask,
which removes the need for masked_boundingbox.

The following were using boundingbox when they should have used
masked_boundingbox:
- drm_output_prepare_overlay_view() uses boundingbox to compute overlay
  position, source and destination coordinates.
- drm_assign_planes() uses boundingbox for view overlap checks.
- is_view_not_visible() uses boundingbox, but nothing will show outside
  the layer mask.
- weston_surface_assign_output() intersects boundingbox with output
  region to choose the primary output for a surface.
- weston_view_assign_output() intersects boundingbox with output region
  to pick the outputs the view is on.

This patch essentially changes all those cases to use the masked
boundingbox.

Therefore there are no cases which would need the boundingbox without
the layer mask, and we can convert boundingbox into masked and remove
the left-over member.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
[v2: don't move the decl of 'mask' in weston_view_update_transform]
Reviewed-By: Giulio Camuffo <giuliocamuffo@gmail.com>
9 years agocompositor: turn weston_view::transform.opaque into masked
Pekka Paalanen [Wed, 18 Feb 2015 14:30:47 +0000 (16:30 +0200)]
compositor: turn weston_view::transform.opaque into masked

Turns out there were no users of weston_view::transform.opaque,
everything was already using transform.masked_opaque. Therefore
repurpose transform.opaque as masked_opaque, and remove masked_opaque
member.

Now this opaque region in global coordinates is clipped by the layer
mask, if set. There are no cases where you would need the opaque region
without the effect of layer mask.

Also add a note in compositor.h, that changing view's layer counts as
changing geometry, which requires calling weston_view_geometry_dirty()
to let all derived state update.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-By: Giulio Camuffo <giuliocamuffo@gmail.com>
9 years agocompositor: add a doc note for weston_view::parent_view
Pekka Paalanen [Wed, 18 Feb 2015 14:06:46 +0000 (16:06 +0200)]
compositor: add a doc note for weston_view::parent_view

It is used by sub-surfaces only, for fetching the root view's
weston_layer.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-By: Giulio Camuffo <giuliocamuffo@gmail.com>
9 years agoconfigure.ac: make use of wayland-scanner.pc
Emil Velikov [Tue, 17 Feb 2015 15:13:32 +0000 (15:13 +0000)]
configure.ac: make use of wayland-scanner.pc

Currently we use the wayland-scanner executable as found with
AC_PATH_PROG, and then check the presence of wayland-scanner.pc

Currently the latter is unused even if AC_PATH_PROG fails to find the
binary. Rework things to use the pkg-config variable as a fall-back.

Cc: Andrew Oakley <aoakley@espial.com>
Cc: Bill Spitzak <spitzak@gmail.com>
Cc: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Andrew Oakley <aoakley@espial.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Quentin Glidic <sardemff7+wayland@sardemff7.net>
9 years agodesktop-shell: Fix coding style of add_popup_grab
Jonas Ådahl [Fri, 13 Feb 2015 06:01:54 +0000 (14:01 +0800)]
desktop-shell: Fix coding style of add_popup_grab

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agodesktop-shell: Simplify popup_end_grab popup_done sending loop
Jonas Ådahl [Fri, 13 Feb 2015 06:01:53 +0000 (14:01 +0800)]
desktop-shell: Simplify popup_end_grab popup_done sending loop

Can just use wl_list_for_each_safe instead of dealing with pointers
ourself.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agobuild: do not install ivi-shell png files with "--disable-ivi-shell"
Manuel Bachmann [Mon, 16 Feb 2015 10:00:36 +0000 (11:00 +0100)]
build: do not install ivi-shell png files with "--disable-ivi-shell"

Some of the .png files are specific to ivi-shell. Avoid installing
them to "$prefix/share/weston" if ivi-shell has explicitly been
disabled at configure time.

Signed-off-by: Manuel Bachmann <manuel.bachmann@open.eurogiciel.org>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agocompositor: refactor to weston_output_schedule_repaint_reset()
Pekka Paalanen [Wed, 21 May 2014 10:51:49 +0000 (13:51 +0300)]
compositor: refactor to weston_output_schedule_repaint_reset()

No functional changes.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agopresentation-shm: put run mode in window title
Pekka Paalanen [Fri, 6 Feb 2015 11:50:37 +0000 (13:50 +0200)]
presentation-shm: put run mode in window title

This way JSON timeline logs will contain the information about in which
mode the program runs.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agoheadless: fix the output refresh rate
Pekka Paalanen [Fri, 23 May 2014 09:48:45 +0000 (12:48 +0300)]
headless: fix the output refresh rate

60 millihertz is a bit low, let's make it 60 Hz as it was supposed to
be.

When the new repaint scheduling algorithm gets implemented, this
fixes 'make check' taking almost 3 minutes instead of the normal 3
seconds, when running with 7 millisecond repaint window.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agocompositor: document weston_view_damage_below()
Pekka Paalanen [Tue, 17 Feb 2015 11:10:01 +0000 (13:10 +0200)]
compositor: document weston_view_damage_below()

Explains what weston_view::clip is.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
9 years agoconfigure.ac: bump version to 1.7.90
Bryce Harrington [Wed, 18 Feb 2015 02:33:16 +0000 (18:33 -0800)]
configure.ac: bump version to 1.7.90

Master is open for new features again

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agoconfigure.ac: bump to version 1.7.0 for release 1.7.0
Bryce Harrington [Sat, 14 Feb 2015 04:47:09 +0000 (20:47 -0800)]
configure.ac: bump to version 1.7.0 for release

9 years agoreleasing: Note that Xwayland installation required only for Weston releases
Bryce Harrington [Sat, 14 Feb 2015 04:46:41 +0000 (20:46 -0800)]
releasing: Note that Xwayland installation required only for Weston releases

9 years agoweston-egl-ext: Define EGL tokens harder for old Mesa
Daniel Stone [Wed, 11 Feb 2015 18:15:18 +0000 (18:15 +0000)]
weston-egl-ext: Define EGL tokens harder for old Mesa

Older versions of Mesa provided header definitions for the
EGL_WL_bind_wayland_display extension, but an earlier version of the
extension which only provided the (un)bind entrypoints, and not
QueryWaylandBuffer. Detect this half-provision and make sure we export
the QueryWaylandBuffer definitions as well.

Fixes build failure with EGL on Ubuntu 12.04.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
9 years agotests: Include weston-egl-ext from weston-test
Daniel Stone [Wed, 11 Feb 2015 18:15:17 +0000 (18:15 +0000)]
tests: Include weston-egl-ext from weston-test

weston-test uses eglBindWaylandDisplayWL and friends, which are defined
either by the EGL implementation, or weston-egl-ext.h as a fallback.
Include weston-egl-ext.h from weston-test, so we can build on systems
whose native EGL implementation doesn't give us the needed defines.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
9 years agoreleasing: Revert fix and just document work-around of Xwayland path
Bryce Harrington [Fri, 13 Feb 2015 00:49:15 +0000 (16:49 -0800)]
releasing:  Revert fix and just document work-around of Xwayland path

If Xwayland is not in /usr/bin, distcheck will fail without patch
023b265b, which propagates @XSERVER_PATH@ to distcheck but blocks other
use of the DISTCHECK_CONFIGURE_FLAGS env var.  Instead, revert the fix
and merely document the need for setting DISTCHECK_CONFIGURE_FLAGS
manually.

Revert "build:  Pass along any user-specified xserver path to distcheck"

This reverts commit 023b265b44a8ffc9dd303abc50f8b060a2115e55.

9 years agoinput: store the grab serial of the keyboard
Giulio Camuffo [Fri, 6 Feb 2015 17:06:54 +0000 (19:06 +0200)]
input: store the grab serial of the keyboard

The serial can be checked against the one passed to wl_shell.set_popup
or equivalent.
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agobuild: Pass along any user-specified xserver path to distcheck
Bryce Harrington [Tue, 10 Feb 2015 02:13:15 +0000 (18:13 -0800)]
build:  Pass along any user-specified xserver path to distcheck

9 years agobuild: Enable xwayland-test during distcheck
Derek Foreman [Mon, 9 Feb 2015 15:57:29 +0000 (09:57 -0600)]
build: Enable xwayland-test during distcheck

The replacement xwayland-test should succeed, so we should run it
from distcheck again.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agoconfigure.ac: Don't look for Xwayland in the weston install destination
Derek Foreman [Mon, 9 Feb 2015 15:57:28 +0000 (09:57 -0600)]
configure.ac: Don't look for Xwayland in the weston install destination

Xwayland isn't part of this distribution so looking for Xwayland in
weston's install dir will cause distcheck to fail.  Let's set the
default to /usr/bin where it's likely to live.

It can still be overriden during configure exactly as before.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agoconfigure.ac bump to version 1.6.93 for the rc2 release. 1.6.93
Bryce Harrington [Sat, 7 Feb 2015 02:03:43 +0000 (18:03 -0800)]
configure.ac bump to version 1.6.93 for the rc2 release.

9 years agoreleasing: Tweak docs to better match actual workflow
Bryce Harrington [Sat, 7 Feb 2015 02:01:33 +0000 (18:01 -0800)]
releasing: Tweak docs to better match actual workflow

9 years agodesktop-shell: Fail if get_xdg_surface is called on an xdg_surface
Jonas Ådahl [Fri, 6 Feb 2015 02:15:28 +0000 (10:15 +0800)]
desktop-shell: Fail if get_xdg_surface is called on an xdg_surface

If a client calls xdg_shell.get_xdg_surface on a surface that is already
an xdg_surface would, prior to this patch, succeed, but cause weston to
crash later when trying to configure. This patch instead sends a role
error to the client complaining that it already is an xdg_surface.

Note that .._set_role() only fails when changing roles, not when setting
the same role twice.

The same is done for xdg_popup.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agoxwm: remove the create surface listener in weston_wm_destroy
Derek Foreman [Tue, 3 Feb 2015 17:05:10 +0000 (11:05 -0600)]
xwm: remove the create surface listener in weston_wm_destroy

Failing to remove this can result in a crash when the signal is sent
after the window manager is destroyed.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-By: Giulio Camuffo <giuliocamuffo@gmail.com>
9 years agoivi-shell: SEGV occurs when multi touch happens in transition
Nobuhiko Tanibata [Fri, 6 Feb 2015 07:08:52 +0000 (16:08 +0900)]
ivi-shell: SEGV occurs when multi touch happens in transition

of application launching. This is because cancel callback is mistakenly
set to weston_touch_grab_interface. To fix this issue, add a
callback, touch_move_workspace_grab_frame and set it to the
weston_touch_grab_interface like desktop-shell.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agoUpdate .gitignore
Daniel Stone [Thu, 5 Feb 2015 15:31:10 +0000 (15:31 +0000)]
Update .gitignore

Add autotools remnants, as well as more comprehensive vim swapfiles,
Sublime Text configuration, and git format-patch output.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
9 years agocompositor-x11: Move the x11 window close to an idle handler
Derek Foreman [Tue, 27 Jan 2015 22:26:49 +0000 (16:26 -0600)]
compositor-x11: Move the x11 window close to an idle handler

The input loop is actually dispatched in the middle of the frame repaint.
When the X11 event results in closing the compositor, this can cause the
current output to be destroyed just prior to trying to process animations
on it.

We fix this by handling the window close event in an idle callback.

NOTE: this requires a patch for wayland that moves the idle handler
dispatch to after epoll_wait in the event loop processing.

Closes bug: https://bugs.freedesktop.org/show_bug.cgi?id=81314

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agoFix "Back", "Forward", and other special mouse buttons in the X11 compositor.
Dima Ryazanov [Wed, 4 Feb 2015 09:51:57 +0000 (01:51 -0800)]
Fix "Back", "Forward", and other special mouse buttons in the X11 compositor.

They're off by 4 because of the scroll buttons.

Signed-off-by: Dima Ryazanov <dima@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agolibinput: Only forward first and last press and release for a key
Jonas Ådahl [Fri, 30 Jan 2015 04:23:00 +0000 (12:23 +0800)]
libinput: Only forward first and last press and release for a key

Keyboard key events will be received from a device where a key has
been pressed, even though an equivalent key has been pressed (same
key code) on a device connected to the same seat. notify_key()
expects to only be called as if there was only one keyboard device
associated with the given seat, so to achieve this, ignore every event
where forwarding it would result in multiple 'pressed' or 'released'
notifications.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
9 years agolibinput: Only forward first and last press and release for a button
Jonas Ådahl [Fri, 30 Jan 2015 04:22:59 +0000 (12:22 +0800)]
libinput: Only forward first and last press and release for a button

Pointer button events will be received from a device where a button has
been pressed, even though an equivalent button has been pressed (same
button code) on a device connected to the same seat. notify_button()
expects to only be called as if there was only one pointer device
associated with the given seat, so to achieve this, ignore every event
where forwarding it would result in multiple 'pressed' or 'released'
notifications.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agoxwm: support maximizing xwayland windows
Giulio Camuffo [Thu, 29 Jan 2015 17:06:49 +0000 (19:06 +0200)]
xwm: support maximizing xwayland windows

This patch adds the maximize button to the window frame for the windows
which set the MWM_DECOR_MAXIMIZE hint, and it wires it with the shell
via a new method in weston_shell_interface.
Additionally, it also listens for the wm hints coming from the client,
but it doesn't support maximizing a window only vertically or horizontally.
The window will be maximized only when both directions are maximized.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agodesktop-shell: Remove unnecessary type casts
Derek Foreman [Fri, 30 Jan 2015 19:24:36 +0000 (13:24 -0600)]
desktop-shell: Remove unnecessary type casts

Remove a few instances of casting weston_seat to weston_seat.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
9 years agoscreenshooter: remove useless cast
Derek Foreman [Mon, 2 Feb 2015 19:03:23 +0000 (13:03 -0600)]
screenshooter: remove useless cast

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
9 years agoconfigure.ac: bump to version 1.6.92 for the rc1 release 1.6.92
Bryce Harrington [Sat, 31 Jan 2015 03:12:47 +0000 (19:12 -0800)]
configure.ac: bump to version 1.6.92 for the rc1 release

9 years agoreleasing: Directions for updating the website
Bryce Harrington [Sat, 31 Jan 2015 03:10:12 +0000 (19:10 -0800)]
releasing:  Directions for updating the website

9 years agodesktop-shell: Don't crash on zoom without a pointer in the seat
Derek Foreman [Tue, 6 Jan 2015 20:28:13 +0000 (14:28 -0600)]
desktop-shell: Don't crash on zoom without a pointer in the seat

The zoom effect zooms at the seat's current pointer location.  When no
pointer is present the zoom key bindings cause a crash.

Instead, check for the absence of a pointer and log a warning.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agoxwayland-test: Replace the xwayland-test
Derek Foreman [Thu, 29 Jan 2015 22:44:55 +0000 (16:44 -0600)]
xwayland-test: Replace the xwayland-test

The old xwayland-test hasn't worked in a while...

This new test checks that the wayland specific WL_SURFACE_ID atom exists,
checks that the window manager name is "Weston WM" and then maps a window
and waits for an exposure event.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Tested-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agoxwm: fix use after free
Giulio Camuffo [Fri, 26 Dec 2014 16:10:35 +0000 (18:10 +0200)]
xwm: fix use after free

Calling wl_event_source_remove() will free the event source later, so
reset the pointer to avoid calling it two times on the same pointer.
Fix a compositor crash when copying some text from weston terminal,
pasting it in the same terminal and hitting ctrl-u, while a X client
is running.
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agoivi-shell-transition: check create_layout_transition() return value.
Carlos Olmedo Escobar [Sat, 17 Jan 2015 18:43:02 +0000 (19:43 +0100)]
ivi-shell-transition: check create_layout_transition() return value.

Signed-off-by: Carlos Olmedo Escobar <carlos.olmedo.e@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: ntanibata@jp.adit-jv.com
9 years agoshell: fix positioning of maximized surfaces with a custom geometry
Giulio Camuffo [Fri, 9 Jan 2015 18:10:45 +0000 (20:10 +0200)]
shell: fix positioning of maximized surfaces with a custom geometry

9 years agoeditor: Make editor multi-seat aware
Derek Foreman [Wed, 17 Dec 2014 15:43:58 +0000 (09:43 -0600)]
editor: Make editor multi-seat aware

With multi-seat, multiple entries can occur on the text inputs in the
editor.  Also, the panel shouldn't be hidden by the editor if either
text entry is still active.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jan Arne Petersen <janarne@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agoRevert "compositor-x11: Move the x11 event handler to the display loop"
Bryce Harrington [Tue, 27 Jan 2015 22:12:56 +0000 (14:12 -0800)]
Revert "compositor-x11: Move the x11 event handler to the display loop"

This reverts commit 6deb09ef8a72164947cdfa5f2414e292c7672c9c.

(Derek says he has an improved version in the works.)

9 years agoxwm: set the _NET_WM_DESKTOP property of the windows
Giulio Camuffo [Sat, 13 Dec 2014 16:06:34 +0000 (18:06 +0200)]
xwm: set the _NET_WM_DESKTOP property of the windows

Some X clients use the _NET_WM_DESKTOP property to tell if the window
is mapped or not. If set, it should say the virtual desktop the window
is currently in, if unset it means the window is unmapped.
The xwm currently has no way to know how many virtual desktops
the shell plugin has, or if it even implements the metaphor. For now
just set the property to 0, meaning the first desktop, if the window is
mapped, and delete the property when unmapped.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agocompositor-x11: Move the x11 event handler to the display loop
Derek Foreman [Fri, 12 Dec 2014 20:12:28 +0000 (14:12 -0600)]
compositor-x11: Move the x11 event handler to the display loop

While it conceptually makes sense to put the x11 event handler
in the compositor "input" loop, the input loop is actually
dispatched in the middle of the frame repaint.  When the
X11 event results in closing the compositor, this can cause
the current output to be destroyed just prior to trying to
process animations on it.

Closes bug: https://bugs.freedesktop.org/show_bug.cgi?id=81314

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
9 years agoreleasing: Mention dual release announcements
Bryce Harrington [Tue, 27 Jan 2015 02:23:37 +0000 (18:23 -0800)]
releasing:  Mention dual release announcements

9 years agoclients: Remove stray new-line
Jonas Ådahl [Mon, 26 Jan 2015 10:19:07 +0000 (18:19 +0800)]
clients: Remove stray new-line

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
9 years agoxwm: don't set inactive surfaces as top level
Giulio Camuffo [Sat, 24 Jan 2015 15:54:21 +0000 (17:54 +0200)]
xwm: don't set inactive surfaces as top level

Some X clients create popup or tooltips windows as top level, without
setting them as override redirect or as transient. Since we don't want
to take the focus away from a surface when one of its popup is opened,
check the _NET_WM_WINDOW_TYPE of the X surfaces being mapped and set
them as inactive if it is one of some types.

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agotests: Skip buffer count test if wl_drm isn't present
Derek Foreman [Fri, 23 Jan 2015 18:12:36 +0000 (12:12 -0600)]
tests: Skip buffer count test if wl_drm isn't present

This skips the test when running on the headless backend.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
(Presumably) Reviewed-by: Daniel Stone <daniel@fooishbar.org>

9 years agoMakefile: fix assigning to dist_wayland_session_DATA
Marek Chalupa [Thu, 22 Jan 2015 09:03:03 +0000 (10:03 +0100)]
Makefile: fix assigning to dist_wayland_session_DATA

dist_wayland_session_DATA is not set anywhere before, so using +=
results in:

error: dist_wayland_session_DATA must be set with '=' before using '+='

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agoMakefile.am: Use fine-grained dist control for desktop file
Bryce Harrington [Thu, 22 Jan 2015 01:17:07 +0000 (17:17 -0800)]
Makefile.am: Use fine-grained dist control for desktop file

9 years agoFix mutex hang in colord on output removal
Olivier Fourdan [Thu, 8 Jan 2015 14:40:29 +0000 (15:40 +0100)]
Fix mutex hang in colord on output removal

Using the x11 output (maybe with others as well), weston would hang
when closing the output if the colord plugin is enabled.

The hang occurs in mutex lock in the output notifier handler because
the given GMutex value is incorrect.

This is because of a cast error, the type of container should be
"cms_output" and not "cms_colord".

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Richard Hughes <richard@hughsie.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agoreleasing: Add example commands to release directions
Bryce Harrington [Sat, 10 Jan 2015 02:09:21 +0000 (18:09 -0800)]
releasing: Add example commands to release directions

Note that for weston, configure.ac needs version numbers updated in
several places.  `make distcheck` for weston no longer triggers the test
suite to run, so update the directions to run a `make check`
pre-release.  Switch to using the X.org release.sh script in place of
some of the manual steps.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agobuild: install a login manager session entry
Lubomir Rintel [Sun, 28 Dec 2014 13:20:49 +0000 (14:20 +0100)]
build: install a login manager session entry

This makes it possible to run Weston session from GDM (and possibly
other login managers).

9 years agozoom: Check the value of level before using it.
Carlos Olmedo Escobar [Sat, 17 Jan 2015 19:31:53 +0000 (20:31 +0100)]
zoom: Check the value of level before using it.

Check the value of level before dividing 1 by it.

Signed-off-by: Carlos Olmedo Escobar <carlos.olmedo.e@gmail.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agotext: Fix typo
Derek Foreman [Fri, 16 Jan 2015 23:47:10 +0000 (17:47 -0600)]
text: Fix typo

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agoreleasing: Typo
Bryce Harrington [Sat, 10 Jan 2015 02:09:20 +0000 (18:09 -0800)]
releasing: Typo

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
9 years agoRevert "simple-egl: HACK to report presentation flags"
Bryce Harrington [Wed, 21 Jan 2015 01:22:16 +0000 (17:22 -0800)]
Revert "simple-egl: HACK to report presentation flags"

This reverts commit b77acf592fdc625a09e4d1ea1672dba2db128238.

Change is listed as "not for upstream"

9 years agosimple-egl: HACK to report presentation flags
Pekka Paalanen [Wed, 17 Dec 2014 14:20:43 +0000 (16:20 +0200)]
simple-egl: HACK to report presentation flags

So that we can test the per-surface ZERO_COPY flag:
- start Weston on DRM backend
- run ./weston-simple-egl -o (need to be opaque to end up on overlay)
- hit debug key 'V' to enable the (broken) hw overlays

The debug key is used by first hitting Mod+Shift+space, then hitting 'v'.

Enabling overlays should change the flags from 0x7 to 0xe. To verify the
window is really on an overlay, use debug key 'S' to tint all
GL-composited things green.

This patch is not intended for upstream.

Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
9 years agotests, clients: add Presentation feedback flags
Pekka Paalanen [Wed, 17 Dec 2014 14:20:42 +0000 (16:20 +0200)]
tests, clients: add Presentation feedback flags

Decode the new feedback flags.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
9 years agocompositor, drm: set per-surface Presentation feedback flags
Pekka Paalanen [Wed, 17 Dec 2014 14:20:41 +0000 (16:20 +0200)]
compositor, drm: set per-surface Presentation feedback flags

PRESENTATION_FEEDBACK_KIND_ZERO_COPY is a flag that needs to be set for
each surface separately. Some surfaces may be zero-copy (as defined by
Presentation feedback) while some are not.

A complication with Weston is that a surface may have multiple views on
screen. All copies (views) of the surface are required to be zero-copy
for the ZERO_COPY flag to be set.

Backends set per-view feedback flags during the assing_planes hook, and
then Weston core collects the flags from all views of a surface.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
9 years agocompositor: set presentation.presented flags
Pekka Paalanen [Wed, 17 Dec 2014 14:20:40 +0000 (16:20 +0200)]
compositor: set presentation.presented flags

Change weston_output_finish_frame() signature so that backends are
required to set the flags, that will be reported on the Presentation
'presented' event. This is meant for output-wide feedback flags. Flags
that vary per wl_surface are subject for the following patch.

All start_repaint_loop functions use the special private flag
PRESENTATION_FEEDBACK_INVALID to mark, that this call of
weston_output_finish_frame() cannot trigger the 'presented' event. If it
does, we now hit an assert, and should then investigate why a fake update
triggered Presentation feedback.

DRM:

Page flip is always vsync'd, and always gets the completion timestamp
from the kernel which should correspond well to hardware. Completion is
triggered by the kernel/hardware.

Vblank handler is only used with the broken planes path, therefore do
not report VSYNC, because we cannot guarantee all the planes updated at
the same time. We cannot set the INVALID, because it would abort the
compositor if the broken planes path was ever used.  This is a hack that
will get fixed with nuclear pageflip support in the future.

fbdev:

No vsync, update done by copy, no completion event from hardware, and
completion time is totally fake.

headless:

No real output to update.

RDP:

Guessing that maybe no vsync, fake time, and copy make sense (pixels
sent over network). Also no event that the pixels have been shown?

RPI:

Presumably Dispmanx updates are vsync'd. We get a completion event from
the driver, but need to read the clock ourselves, so the completion time
is somewhat unreliable. Zero-copy flag not implemented though it would
be theoretically possible with EGL clients (zero-copy is a per-surface
flag anyway, so in this patch).

Wayland:

No information how the host compositor is doing updates, so make a safe
guess without assuming vsync or hardware completion event. While we do
get some timestamp from the host compositor, it is not the completion
time. Would need to hook to the Presentation extension of the host
compositor to get more accurate flags.

X11:

No idea about vsync, completion event, or copying. Also the timestamp is
a fake.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Acked-by: Mario Kleiner <mario.kleiner.de@gmail.com>
9 years agoprotocol: add Presentation feedback flags
Pekka Paalanen [Wed, 17 Dec 2014 14:20:39 +0000 (16:20 +0200)]
protocol: add Presentation feedback flags

Add the missing feedback flags to the Presentation extension protocol
specification.

These flags are slightly different from the previous RFCv3.1 definition:
http://lists.freedesktop.org/archives/wayland-devel/2014-March/013598.html

Now, all compositors are safe to use 0 as the flags if they don't bother
setting them properly. 0 is the "worst case" with the least guarantees.

The meaning of ZERO_COPY is not exactly the opposite of the old COPY
flag. ZERO_COPY is more strict, but applies only to that one surface.
Therefore it can be used to verify a zero-copy video playback pipeline,
also to a hardware overlay.

There is no longer a flag to clearly indicate if the final presentation
was done by a copy or a page flip. ZERO_COPY forbids the copy, but VSYNC
alone does allow copy in case it cannot tear.  It is possible to have
first a compositing pass, and then another copy into the frontbuffer,
and still set VSYNC if it cannot tear.  Usually "cannot tear" is too
hard to guarantee with a copy, so it often implies a page flip.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
9 years agocompositor-drm: use drm_output in drm_output_*() func args
Pekka Paalanen [Wed, 17 Dec 2014 14:20:38 +0000 (16:20 +0200)]
compositor-drm: use drm_output in drm_output_*() func args

When a function is named drm_output_FOO(), you'd expect it to take a
struct drm_output * as an argument. Convert
drm_output_prepare_scanout_view(), drm_output_prepare_overlay_view(),
drm_output_prepare_cursor_view() from weston_output to drm_output.

Additionally convert drm_sprite_crtc_supported() from weston_output to
drm_output.

This change makes drm_assign_planes() to operate on drm_output terms,
which makes further changes a tiny bit easier.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
9 years agoconfigure.ac: bump to version 1.6.91 for the alpha release 1.6.91
Bryce Harrington [Sat, 17 Jan 2015 11:45:34 +0000 (03:45 -0800)]
configure.ac: bump to version 1.6.91 for the alpha release

9 years agologind: fix PropertiesChanged parser
David Herrmann [Tue, 30 Dec 2014 13:33:23 +0000 (14:33 +0100)]
logind: fix PropertiesChanged parser

The current parser directly reads a BOOLEAN on the PropertiesChanged
signal for 'Active' properties. However, all property-values are packed in
a VARIANT, otherwise, we wouldn't know the type. Fix the parser to recurse
into the variant before reading the boolean.

To avoid such bugs in the future, we extract the 'Active' parser into a
helper function parse_active(), which is then shared between the
PropertiesChanged and Get handlers.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Tested-by: nerdopolis <bluescreen_avenger@verizon.net>
9 years agologind: forward Active=true changes for non-DRM backends
David Herrmann [Tue, 30 Dec 2014 13:33:22 +0000 (14:33 +0100)]
logind: forward Active=true changes for non-DRM backends

Logind sends us a notification whenever the Active attribute of our session
changes. However, due to the way compositor-drm.c relies on the master DRM
device to be synced with the session, we used to delay Active=true
handling until the DRM device was up, too. See:

    commit aedc7732ebd9bc7b4f51ee247ea857ffec6260a7
    Author: David Herrmann <dh.herrmann@gmail.com>
    Date:   Sat Nov 30 11:25:45 2013 +0100

        logind: delay wakeup until DRM-device is resumed

However, the other compositor backends do not use DRM, so logind-util will
never get notified about any DRM device. Therefore, we have to forward the
Active=true change immediately.

This commit fixes logind-util to take sync_drm as argument. If it is true,
we do DRM-device synchronisation, otherwise we don't.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=86889
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Tested-by: nerdopolis <bluescreen_avenger@verizon.net>
9 years agolauncher: use SIGRTMIN to not conflict with xwayland
David Herrmann [Tue, 30 Dec 2014 13:33:21 +0000 (14:33 +0100)]
launcher: use SIGRTMIN to not conflict with xwayland

xwayland uses SIGUSR1 as startup notification. Make sure to use SIGRTMIN
for VT handling to avoid conflicts.

A bonus is SIGRT* signals can be queued multiple times, so we will be able
to correctly track them and will no longer lose signals (which wouldn't
really matter, but is confusing in logs).

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Tested-by: nerdopolis <bluescreen_avenger@verizon.net>