platform/upstream/weston.git
7 years agocompositor: allow using nested parent as a subsurface sibling
Arnaud Vrac [Wed, 8 Jun 2016 16:37:57 +0000 (18:37 +0200)]
compositor: allow using nested parent as a subsurface sibling

The parent of a subsurface can be used as a sibling in the place_below
and place_above calls. However this did not work when the parent is
nested, so fix the sibling check and add a test to check this case.

Signed-off-by: Daniel Stone <daniels@collabora.com>
7 years agoxwayland: Create the drag-and-drop window in weston_wm_dnd_init
Carlos Garnacho [Mon, 22 Feb 2016 18:42:23 +0000 (19:42 +0100)]
xwayland: Create the drag-and-drop window in weston_wm_dnd_init

Just to keep it hidden so far... A lot of the plumbing necessary to
handle x11->wayland drag and drop is missing, and the current
partial handling gets in the middle for X11 drag-and-drop itself
to work.

The approach is well directed, but needs some further work, till
then, just keep our fake drag-and-drop target hidden. This allows
drag-and-drop to work between X11 clients in Xwayland, and avoids
a crash with (currently unhandled) wl_resource-less data sources.

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

Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agolibweston: Add move (without scale) animation
Quentin Glidic [Wed, 10 Aug 2016 13:53:33 +0000 (15:53 +0200)]
libweston: Add move (without scale) animation

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agodesktop-shell/client: Add left/right panel position (basic) support
Quentin Glidic [Thu, 23 Jun 2016 16:55:24 +0000 (18:55 +0200)]
desktop-shell/client: Add left/right panel position (basic) support

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agodesktop-shell/client: Introduce helper variables
Quentin Glidic [Thu, 23 Jun 2016 16:55:23 +0000 (18:55 +0200)]
desktop-shell/client: Introduce helper variables

These variables will be much more useful in the following commit.
The indentation is off to avoid future diff noise.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agodesktop-shell/client: Parse the clock format once
Quentin Glidic [Thu, 23 Jun 2016 16:55:22 +0000 (18:55 +0200)]
desktop-shell/client: Parse the clock format once

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agodesktop-shell/client: Use a proper enum for clock format
Quentin Glidic [Thu, 23 Jun 2016 16:55:21 +0000 (18:55 +0200)]
desktop-shell/client: Use a proper enum for clock format

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agodesktop-shell: Properly position the panel surface
Quentin Glidic [Thu, 23 Jun 2016 16:55:20 +0000 (18:55 +0200)]
desktop-shell: Properly position the panel surface

Now weston actually supports putting the panel at the bottom of the
screen.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agodesktop-shell: Compute panel size without using output
Quentin Glidic [Thu, 23 Jun 2016 16:55:19 +0000 (18:55 +0200)]
desktop-shell: Compute panel size without using output

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agodesktop-shell/client: Add bottom panel support
Quentin Glidic [Thu, 23 Jun 2016 16:55:18 +0000 (18:55 +0200)]
desktop-shell/client: Add bottom panel support

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agogl: Don't declare variables in for loop
Bryce Harrington [Mon, 21 Nov 2016 18:02:42 +0000 (10:02 -0800)]
gl: Don't declare variables in for loop

Fixes compilation error introduced by 43cea54c:

  libweston/gl-renderer.c:2862:2: error: ‘for’ loop initial declarations
  are only allowed in C99 mode
    for (unsigned i = 0; i < ARRAY_LENGTH(swap_damage_ext_to_entrypoint);
    i++) {
    ^

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agocompositor-wayland: Port to xdg-shell-v6
Armin Krezović [Mon, 21 Nov 2016 17:42:42 +0000 (18:42 +0100)]
compositor-wayland: Port to xdg-shell-v6

v2:

 - Keep wl_shell code around until xdg_shell is declared stable.

Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agogl-renderer: add support of WL_SHM_FORMAT_YUYV
Vincent ABRIOU [Thu, 20 Oct 2016 14:20:11 +0000 (16:20 +0200)]
gl-renderer: add support of WL_SHM_FORMAT_YUYV

This patch allow gl-renderer to accept WL_SHM_FORMAT_YUYV buffers.
This is the pixel format supported by most of the USB webcams.

v2:
 - fix hsub Vs vsub inversion

Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agocompositor-x11: Move vfunc setting from set_size to enable
Armin Krezović [Fri, 28 Oct 2016 22:26:45 +0000 (00:26 +0200)]
compositor-x11: Move vfunc setting from set_size to enable

Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agocompositor-wayland: Destroy shm buffers on output disable
Armin Krezović [Sun, 9 Oct 2016 15:30:29 +0000 (17:30 +0200)]
compositor-wayland: Destroy shm buffers on output disable

Reviewed-by: Armin Krezović <krezovic.armin@gmail.com>
7 years agocompositor-wayland: Properly clean up on backend destroy
Armin Krezović [Sun, 9 Oct 2016 15:30:28 +0000 (17:30 +0200)]
compositor-wayland: Properly clean up on backend destroy

Also remove a wrong XXX comment.

Reviewed-by: Armin Krezović <krezovic.armin@gmail.com>
7 years agocompositor-wayland: Simplify fullscreen output surface handling
Armin Krezović [Sun, 9 Oct 2016 15:30:27 +0000 (17:30 +0200)]
compositor-wayland: Simplify fullscreen output surface handling

Reviewed-by: Armin Krezović <krezovic.armin@gmail.com>
7 years agocompositor-wayland: Move vfunc setting from set_size to enable
Armin Krezović [Sun, 9 Oct 2016 15:30:26 +0000 (17:30 +0200)]
compositor-wayland: Move vfunc setting from set_size to enable

Reviewed-by: Armin Krezović <krezovic.armin@gmail.com>
7 years agoweston-editor: Free preferred_language in text_entry_destroy
Silvan Jegen [Thu, 17 Nov 2016 20:43:06 +0000 (21:43 +0100)]
weston-editor: Free preferred_language in text_entry_destroy

Signed-off-by: Silvan Jegen <s.jegen@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Signed-off-by: Daniel Stone <daniels@collabora.com>
7 years agoclients/nested-client: call eglTerminate/eglReleaseThread at exit
Emil Velikov [Mon, 14 Nov 2016 17:08:19 +0000 (17:08 +0000)]
clients/nested-client: call eglTerminate/eglReleaseThread at exit

Do a minimalistic teardown at program exist.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agotests/buffer-count-test: teardown after the test
Emil Velikov [Mon, 14 Nov 2016 17:08:18 +0000 (17:08 +0000)]
tests/buffer-count-test: teardown after the test

Might be a bit of an overkill, but still. One should cleanup after
themselves.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agogl-renderer: use weston_platform_destroy_egl_surface wrapper
Emil Velikov [Mon, 14 Nov 2016 17:08:17 +0000 (17:08 +0000)]
gl-renderer: use weston_platform_destroy_egl_surface wrapper

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agoclients/window: use weston_platform_destroy_egl_surface wrapper
Emil Velikov [Fri, 18 Nov 2016 19:12:58 +0000 (19:12 +0000)]
clients/window: use weston_platform_destroy_egl_surface wrapper

v2: Use correct (destroy) API (Dan)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agoclients/subsurfaces: use weston_platform_destroy_egl_surface wrapper
Emil Velikov [Mon, 14 Nov 2016 17:08:15 +0000 (17:08 +0000)]
clients/subsurfaces: use weston_platform_destroy_egl_surface wrapper

... over a direct eglDestroySurface call. Provides symmetry in the
create/destroy paths.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agoclients/simple-egl: use weston_platform_destroy_egl_surface wrapper
Emil Velikov [Mon, 14 Nov 2016 17:08:14 +0000 (17:08 +0000)]
clients/simple-egl: use weston_platform_destroy_egl_surface wrapper

... over a direct eglDestroySurface call. Provides symmetry in the
create/destroy paths.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agoclients/nested-client: destroy the EGL surface during teardown
Emil Velikov [Mon, 14 Nov 2016 17:08:13 +0000 (17:08 +0000)]
clients/nested-client: destroy the EGL surface during teardown

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agoshared/platform.h: introduce weston_platform_destroy_egl_surface()
Emil Velikov [Mon, 14 Nov 2016 17:08:12 +0000 (17:08 +0000)]
shared/platform.h: introduce weston_platform_destroy_egl_surface()

Introduce the weston_platform_destroy_egl_surface() wrapper to
complement the weston_platform_create_egl_surface() one.

We'll use the former with the next patches trhoughout weston to
consistently destroy the surface as needed.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agogl-renderer: add support for EGL_KHR_swap_buffers_with_damage
Emil Velikov [Mon, 14 Nov 2016 16:03:45 +0000 (16:03 +0000)]
gl-renderer: add support for EGL_KHR_swap_buffers_with_damage

Extension is identical to the EXT one, yet we need to check for the KHR
abbreviated extension name + entry-point.

v2: s/foo/swap_damage_ext_to_entrypoint/ (Eric, Daniel)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (v1)
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agosimple-egl: add support for EGL_KHR_swap_buffers_with_damage
Emil Velikov [Mon, 14 Nov 2016 17:27:14 +0000 (17:27 +0000)]
simple-egl: add support for EGL_KHR_swap_buffers_with_damage

Functionally identical to the EXT version of the extension.

v2: s/foo/swap_damage_ext_to_entrypoint/ (Eric, Daniel)
v3: do the above sed for real (Frank)

[daniels: Fixed signed vs. unsigned warning.]

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (v1)
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agolibweston: Move text_backend_* to weston.h
Quentin Glidic [Thu, 18 Aug 2016 09:15:44 +0000 (11:15 +0200)]
libweston: Move text_backend_* to weston.h

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agoIgnore the OSC code for desktop notifications
Dima Ryazanov [Fri, 4 Nov 2016 06:46:02 +0000 (23:46 -0700)]
Ignore the OSC code for desktop notifications

In Fedora, bash is configured to display a desktop notification when a command
finishes (and the terminal is not focused). weston-terminal complains about it;
let's silence it.

Signed-off-by: Dima Ryazanov <dima@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
7 years agolibweston: remove unused function declaration of weston_compositor_top
Ryo Munakata [Fri, 18 Nov 2016 12:17:41 +0000 (21:17 +0900)]
libweston: remove unused function declaration of weston_compositor_top

Signed-off-by: Ryo Munakata <ryomnktml@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agoxwayland: Fix X11 lock file size confusion
Daniel Stone [Wed, 16 Nov 2016 16:37:05 +0000 (16:37 +0000)]
xwayland: Fix X11 lock file size confusion

The X11 lock file was somewhat opaque. Into a sized array of 16
characters, we previously read 11 bytes. 61beda653b fixed the parsing of
this input to ensure that we only considered the first 10 bytes: this
has the effect of culling a LF byte at the end of the string.

This commit more explicitly NULLs the entire string before reading, and
trims trailing LF characters only.

It also adds some documentation by way of resizing pid, an explicit size
check on snprintf's return, and comments.

Verified manually that it emits lock files with a trailing \n, as Xorg
does. Also verified manually that it ignores misformatted lock files,
but accepts either \n or \0 in the trailing position.

Related Mutter issue: https://bugzilla.gnome.org/show_bug.cgi?id=774613

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
7 years agotext-input: Clear out context->input pointer
Daniel Stone [Thu, 10 Nov 2016 15:47:56 +0000 (15:47 +0000)]
text-input: Clear out context->input pointer

If we destroy the text_input (e.g. due to surface deactivation) whilst
the IM manager (the client holding the input_method_context resource,
usually weston-keyboard) sends an event, we can hit a segfault in
text-backend. This is because we free the text_input structure, but
don't actually clear the context->input structure even when we send the
deactivate event.

This is clearly intended to be catered for, since context->input is
always checked for NULL before we relay any events.

This is enough to fix one cause of text-test failing, but it's
ultimately error-prone until we have a no-op test-shell; there is still
a race where weston-desktop-shell can launch weston-keyboard before
text-test manages to bind zwp_text_input_manager.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Maniphest Tasks: https://phabricator.freedesktop.org/T7615
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoxwayland: Fix crash when run with no input device
Tom Hochstein [Tue, 1 Nov 2016 19:14:00 +0000 (14:14 -0500)]
xwayland: Fix crash when run with no input device

Starting an xterm with no input device led to a crash
because weston_wm_pick_seat() was returning garbage and
weston_wm_selection_init() was trying to use the garbage.

Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
7 years agoxwayland: fix lock file parsing
Pekka Paalanen [Mon, 14 Nov 2016 13:05:28 +0000 (15:05 +0200)]
xwayland: fix lock file parsing

Patch 139fcabe7cdb1f2296bf02ef917aaab84e00cd4e "xwayland: Improve error
checking for strtol call" caused a regression in the X11 unix socket
lock file parsing. Before that patch, only the first 10 characters were
considered for parsing. After the patch, the newline as the 11th
character caused strtol() to stop parsing at the 10th character which
was then considered an error as not the whole input was consumed.

The effect of the regression was that no X11 lock files were ever deemed
stale, hence stale lock files were never removed. Up till now, I have
accumulated 37 lock files, and Weston complaining for each of them on
every start it cannot parse them.

Fix this by terminating the string at the expected newline character.

Also, it looks like 'pid' was being used uninitialized, risking strtol()
reading past the end of the array. This patch fixes that too.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agoGet rid of the window_create_menu function
Dima Ryazanov [Mon, 14 Nov 2016 07:44:52 +0000 (23:44 -0800)]
Get rid of the window_create_menu function

It's currently unused, and there's actually no way to use it correctly.

The caller cannot free the menu that was created:
- the function only returns the window, not the menu
- there's no public API to destroy a menu object

Signed-off-by: Dima Ryazanov <dima@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agoterminal: Silence maybe-uninitialized warning
Quentin Glidic [Sun, 10 Jul 2016 09:00:57 +0000 (11:00 +0200)]
terminal: Silence maybe-uninitialized warning

clients/terminal.c: In function 'redraw_handler':
clients/terminal.c:213:28: warning: 'machine.unicode' may be used
uninitialized in this function [-Wmaybe-uninitialized]
  struct utf8_state_machine machine;
                            ^~~~~~~

clients/terminal.c: In function 'handle_char':
clients/terminal.c:213:28: warning: 'machine.unicode' may be used
uninitialized in this function [-Wmaybe-uninitialized]

Warning produced by GCC 5.3 and 6.1, with -O3.

'I found it weird that the compiler wouldn’t see that, so I re-checked
the code.

I think with -O3, this specific "for" is compile-time unlooped, and
utf8_next_char inlined.  And there is *one* path that can keep
machine.state to utf8state_start, thus triggering the warning.

Without -O3, the function is globally tagged as “changing unicode”, so
no warning is produced.

[...]

Side note: I picked 0 as the default value, but maybe in this case
0xfffd would be better?'

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Acked-by: Emil Velikov <emil.l.velikov@gmail.com>
7 years agoinput: Update keyboard serial on press and release
Olivier Fourdan [Thu, 30 Jun 2016 14:01:56 +0000 (16:01 +0200)]
input: Update keyboard serial on press and release

Other compositors such as mutter update the keyboard serial for both key
press and key release, unlike weston which updates it only on key press.

When dealing with popup windows which require a match in serials, if the
event that caused the popup to be shown is a key release, then the popup
would be dismissed.

This occurs when navigating gtk+ sub-menus using the keyboard.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=768017

7 years agogl-renderer: Use EGL_KHR_no_config_context
Armin Krezović [Fri, 30 Sep 2016 12:27:38 +0000 (14:27 +0200)]
gl-renderer: Use EGL_KHR_no_config_context

This patch makes use of recently implemented
EGL_KHR_no_config_context extension in Mesa,
which superseeds EGL_MESA_configless_context.

See also (and the follow-up patch):

https://lists.freedesktop.org/archives/mesa-dev/2016-September/128510.html

v2:

 - Extend existing infrastructure for EGL_MESA_configless_context
   per suggestion from Emmanuel Gil Peyrot.

Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agoclients: Fix weston-scaler source-only mode to use integer width and height
Derek Foreman [Fri, 30 Sep 2016 16:13:23 +0000 (11:13 -0500)]
clients: Fix weston-scaler source-only mode to use integer width and height

If only the source of a viewport is set, the width and height must
be integer or the protocol mandates that the compositor generate an
error.  This is because using only the source is a crop, and the
width and height become the surface size - all surface sizes must
be integer.

Weston was fixed to generate this error in bb32ccc0, however the
test app continued to use fractional co-ordinates when run as
weston-scaler -s  (which only sets the viewport source)

This leaves fractional width/height for the other cases, but uses
integer for the crop-only mode.  The descriptions in the help text
are still accurate with this change, but weston-scaler -s no longer
exits with an error.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agoxdg-shell: validate positioner object
Sjoerd Simons [Fri, 23 Sep 2016 07:31:23 +0000 (09:31 +0200)]
xdg-shell: validate positioner object

According to the xdg-shell v6 protocol a positioner object is only
complete if both the size and its anchor rectangle are set. Ensure the
weston clients do this and let weston be more strict on checking if a
client has done so.

This also fixes weston-terminal popups not showing up on gnome-shell
3.22.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
7 years agoivi-shell: describe members of type wl_list
Ucan, Emre (ADITG/SW1) [Fri, 1 Jul 2016 09:34:50 +0000 (09:34 +0000)]
ivi-shell: describe members of type wl_list

I wrote comments on which list they are used with

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: fix surface_list to layer_list, add ivi_layout_transition_set::transition_list]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoivi-shell: clear unused struct members
Ucan, Emre (ADITG/SW1) [Fri, 1 Jul 2016 09:34:44 +0000 (09:34 +0000)]
ivi-shell: clear unused struct members

I removed unused members of ivi_layout* data
structs.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agogl-renderer: Refactor gl_renderer_output_window_create()
Miguel A. Vico [Wed, 18 May 2016 15:50:54 +0000 (17:50 +0200)]
gl-renderer: Refactor gl_renderer_output_window_create()

This change refactors gl_renderer_output_window_create() to separate out
window surface creation code from output common creation code.

Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com>
Reviewed-by: Andy Ritger <aritger@nvidia.com>
Reviewed-by: James Jones <jajones@nvidia.com>
[Pekka: rebased and removed unused 'gr' and 'ec']
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agogl-renderer: Add <platform_attribs> param to gl_renderer_display_create
Miguel A. Vico [Wed, 18 May 2016 15:47:59 +0000 (17:47 +0200)]
gl-renderer: Add <platform_attribs> param to gl_renderer_display_create

This change adds <platform_attribs> parameter to
gl_renderer_display_create() in case we ever want to pass non-NULL.

Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com>
Reviewed-by: Andy Ritger <aritger@nvidia.com>
Reviewed-by: James Jones <jajones@nvidia.com>
[Pekka: removed notes about EGLOutput]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agogl-renderer: Accept non-NULL empty <visual_id> arrays
Miguel A. Vico [Wed, 18 May 2016 15:48:47 +0000 (17:48 +0200)]
gl-renderer: Accept non-NULL empty <visual_id> arrays

This change modifies egl_choose_config() to accept a non-NULL but empty
<visual_id> array (i.e. n_ids == 0)

Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com>
Reviewed-by: Andy Ritger <aritger@nvidia.com>
Reviewed-by: James Jones <jajones@nvidia.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agogl-renderer: Rename <attribs> param of gl_renderer to <config_attribs>
Miguel A. Vico [Wed, 18 May 2016 15:44:22 +0000 (17:44 +0200)]
gl-renderer: Rename <attribs> param of gl_renderer to <config_attribs>

This change renames <attribs> parameter of gl_renderer_display_create()
and gl_renderer_output_window_create() to <config_attribs> to explain
which attribs it is.

Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com>
Reviewed-by: Andy Ritger <aritger@nvidia.com>
Reviewed-by: James Jones <jajones@nvidia.com>
[Pekka: remove notes about EGLOutput]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agogl-renderer: Rename gl_renderer::output_create to output_window_create
Miguel A. Vico [Wed, 18 May 2016 15:43:00 +0000 (17:43 +0200)]
gl-renderer: Rename gl_renderer::output_create to output_window_create

No functional change. This patch renames gl_renderer_output_create() to
gl_renderer_output_window_create(), which is something more descriptive
of what the function does.

Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com>
Reviewed-by: Andy Ritger <aritger@nvidia.com>
Reviewed-by: James Jones <jajones@nvidia.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agogl-renderer: Rename gl_renderer_create to gl_renderer_display_create
Miguel A. Vico [Wed, 18 May 2016 15:41:07 +0000 (17:41 +0200)]
gl-renderer: Rename gl_renderer_create to gl_renderer_display_create

No functional change. This patch only renames gl_renderer_create() to
gl_renderer_display_create(), which is something more descriptive of
what the function does.

Signed-off-by: Miguel A Vico Moya <mvicomoya@nvidia.com>
Reviewed-by: James Jones <jajones@nvidia.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agogl-renderer: conditionally call query_buffer while gl_renderer_attach
Vincent Abriou [Thu, 3 Nov 2016 10:15:32 +0000 (11:15 +0100)]
gl-renderer: conditionally call query_buffer while gl_renderer_attach

While gl_renderer_attach, query_buffer should be call only if the
query_buffer function exists ie when has_bind_display is true.

v2:
 - Take into account Giulio's remark. Use has_bind_display viariable to test if
   EGL_WL_bind_wayland_display extension is supported.

Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agolibweston: fix building issue when EGL support is not enabled
Vincent Abriou [Tue, 11 Oct 2016 11:47:03 +0000 (13:47 +0200)]
libweston: fix building issue when EGL support is not enabled

weston-egl-ext.h has been include in compositor-xx.c file in order to
define EGL_PLATFORM_xxx_KHR extensions used by the compositors.
But in case EGL support is not enabled, all EGL related definition must
be skipped except EGL_PLATFORM_xxx_KHR that must be still defined to
allow compositor-xx.c to build.

Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
7 years agoxwayland: Move includes to avoid deprecation warnings
Daniel Stone [Mon, 31 Oct 2016 14:51:18 +0000 (14:51 +0000)]
xwayland: Move includes to avoid deprecation warnings

compositor.h already helpfully defines WL_HIDE_DEPRECATED for us, so we
don't get warnings about wl_buffer (in particular) being deprecated when
we have wayland-server headers defining it as deprecated, and then
wayland-client headers using the type.

Move it to be before all our other includes, so we actually make use of
it.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Tested-by: Yong Bakos <ybakos@humanoriented.com>
7 years agoclients: Make XKB compose support conditional
Daniel Stone [Thu, 20 Oct 2016 13:45:58 +0000 (14:45 +0100)]
clients: Make XKB compose support conditional

Debian Jessie's version of libxkbcommon is too old for compose support,
so rather than force people to upgrade, let's make it conditional.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Daniel Díaz <daniel.diaz@linaro.org>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
7 years agoAdd configuration option for no input device.
Daniel Díaz [Fri, 21 Oct 2016 19:03:13 +0000 (14:03 -0500)]
Add configuration option for no input device.

As it has been discussed in the past [1], running Weston
without any input device at launch might be beneficial for
some use cases.

Certainly, it's best for the vast majority of users (and
the project) to require an input device to be present, as
to avoid frustration and hassle, but for those brave souls
that so prefer, this patch lets them run without any input
device at all.

This introduces a simple configuration in weston.ini:
  [core]
  require-input=true

True is the default, so no behavioral change is introduced.

[1] https://lists.freedesktop.org/archives/wayland-devel/2015-November/025193.html

Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agolibweston-desktop: destroy wl_shell_surface after the wl_surface is destroyed
Giulio Camuffo [Wed, 28 Sep 2016 19:32:11 +0000 (21:32 +0200)]
libweston-desktop: destroy wl_shell_surface after the wl_surface is destroyed

The wl_shell_surface spec says that it is destroyed automatically by the
server when the wl_surface is destroyed, and indeed it does not have a
destroy request. So, do that.

Signed-off-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
7 years agocompositor-wayland: Convert fullscreen flag to bool
Armin Krezović [Thu, 13 Oct 2016 10:01:43 +0000 (12:01 +0200)]
compositor-wayland: Convert fullscreen flag to bool

Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
7 years agosimple-im: Rename source file to be consistent with other client tools
Bryce Harrington [Tue, 11 Oct 2016 23:24:05 +0000 (16:24 -0700)]
simple-im: Rename source file to be consistent with other client tools

Except for weston-info, client source files are not prefixed "weston-".

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Jan Arne Petersen <janarne@gmail.com>
7 years agosimple-im: Use the appropriate enum names to xkb calls
Bryce Harrington [Tue, 11 Oct 2016 23:17:39 +0000 (16:17 -0700)]
simple-im: Use the appropriate enum names to xkb calls

XKB_KEYMAP_COMPILE_NO_FLAGS and XKB_CONTEXT_NO_FLAGS are both defined as
0 so no functional change here, just improved code clarity.

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Jan Arne Petersen <janarne@gmail.com>
7 years agosimple-im: Use returns from main() consistently
Bryce Harrington [Tue, 11 Oct 2016 23:08:10 +0000 (16:08 -0700)]
simple-im: Use returns from main() consistently

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Jan Arne Petersen <janarne@gmail.com>
7 years agowindow: Fix 'devlivery' misspelling
Bryce Harrington [Tue, 11 Oct 2016 23:06:44 +0000 (16:06 -0700)]
window: Fix 'devlivery' misspelling

7 years agoclients: Add XKB compose key support
Bryce Harrington [Mon, 10 Oct 2016 22:31:47 +0000 (15:31 -0700)]
clients: Add XKB compose key support

This adds single-symbol compose support using libxkbcommon's compose
functionality.  E.g., assuming you have the right alt key defined as
your compose key, typing <RAlt>+i+' will produce í, and <RAlt>+y+= will
produce ¥.  This makes compose key work for weston-editor,
weston-terminal, weston-eventdemo, and any other clients that use
Weston's window.* routines for accepting and managing keyboard input.

Compose sequences are loaded from the system's standard tables.  As
well, libxkbcommon will transparently load custom sequences from the
user's ~/.XCompose file.

Note that due to limitations in toytoolkit's key handler interface, only
compose sequences resulting in single symbols are supported.  While
libxkbcommon supports multi-symbol compose strings, support for passing
text buffers to Weston clients is left as future work.

This largely obviates the need for the weston-simple-im input method
client, which had provided a very limited compose functionality that was
only available in clients implementing the zwp_input_method protocol,
and with no mechanism to load system or user-specified compose keys.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=53648
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
7 years agocompositor-wayland: Convert draw_initial_frame to boolean
Armin Krezović [Sun, 9 Oct 2016 15:30:25 +0000 (17:30 +0200)]
compositor-wayland: Convert draw_initial_frame to boolean

Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
7 years agocompositor-wayland: Convert sprawl flag to boolean
Armin Krezović [Sun, 9 Oct 2016 15:30:23 +0000 (17:30 +0200)]
compositor-wayland: Convert sprawl flag to boolean

Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
7 years agocompositor-wayland: Convert use-pixman flag to boolean
Armin Krezović [Sun, 9 Oct 2016 15:30:22 +0000 (17:30 +0200)]
compositor-wayland: Convert use-pixman flag to boolean

Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
7 years agogl-renderer: add support of WL_SHM_FORMAT_NV12
Vincent Abriou [Wed, 5 Oct 2016 12:54:35 +0000 (14:54 +0200)]
gl-renderer: add support of WL_SHM_FORMAT_NV12

This patch allow gl-renderer to accept WL_SHM_FORMAT_NV12 buffers.

Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agogl-renderer: add support of WL_SHM_FORMAT_YUV420
Vincent Abriou [Wed, 5 Oct 2016 12:54:34 +0000 (14:54 +0200)]
gl-renderer: add support of WL_SHM_FORMAT_YUV420

This patch allow gl-renderer to accept WL_SHM_FORMAT_YUV420 buffers.

In a gstreamer pipeline, the support of the WL_SHM_FORMAT_YUV420 by
weston avoid pixel conversion between software decoders and waylandsink.
Indeed, software decoders output I420 (YUV420 planar) that will
match with WL_SHM_FORMAT_YUV420.

Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agolibweston: include weston-egl-ext.h in drm, x11 and wayland compositor
Vincent Abriou [Wed, 5 Oct 2016 14:14:07 +0000 (16:14 +0200)]
libweston: include weston-egl-ext.h in drm, x11 and wayland compositor

As to what is done for gl-renderer.c, weston-egl-ext.h should be
include in compositor-drm.c, compositor-x11.c and compositor-wayland.c.
This fix building issue with GPU that does not have EGL_PLATFORM_xxx_KHR
in their extension header file eglext.h.

Signed-off-by: Vincent Abriou <vincent.abriou@st.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
7 years agocompositor-rdp: Properly destroy the renderer and pixman image
Armin Krezović [Fri, 30 Sep 2016 12:11:15 +0000 (14:11 +0200)]
compositor-rdp: Properly destroy the renderer and pixman image

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
7 years agolibweston: Drop requirement of setting mm_width/mm_height in backends
Armin Krezović [Fri, 30 Sep 2016 12:11:14 +0000 (14:11 +0200)]
libweston: Drop requirement of setting mm_width/mm_height in backends

They were required for transitional phase in order not to
break previous weston_output_init(). Now, they can even
be initialized on enable, or left with defaults if backend
doesn't support them.

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
7 years agolibweston: Remove weston_backend_output_config structure
Armin Krezović [Fri, 30 Sep 2016 12:11:13 +0000 (14:11 +0200)]
libweston: Remove weston_backend_output_config structure

Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
7 years agoweston: Rename weston_output_init_pending() to weston_output_init()
Armin Krezović [Fri, 30 Sep 2016 12:11:12 +0000 (14:11 +0200)]
weston: Rename weston_output_init_pending() to weston_output_init()

v2:

 - Rebased for latest changes.

v3:

 - Rebased for changes in wayland backend.

Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
7 years agolibweston: Merge weston_output_init() into weston_output_enable()
Armin Krezović [Fri, 30 Sep 2016 12:11:11 +0000 (14:11 +0200)]
libweston: Merge weston_output_init() into weston_output_enable()

Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
7 years agoweston: Port X11 backend to new output handling API
Armin Krezović [Fri, 30 Sep 2016 12:11:10 +0000 (14:11 +0200)]
weston: Port X11 backend to new output handling API

This is a complete port of the X11 backend that
uses recently added output handling API for output
configuration.

- Output can be configured at runtime by passing the
  necessary configuration parameters, which can be
  filled in manually, obtained from the configuration
  file or obtained from the command line using
  previously added functionality. It is required that
  the scale and transform values are set using the
  previously added functionality.

- Output can be created at runtime using the output
  API. The output creation only creates a pending
  output, which needs to be configured the same way as
  mentioned above.

Same as before, a single output is created at runtime
using the default configuration or a configuration
parsed from the command line. The output-count
functionality is also preserved, which means more than
one output can be created initially, and more outputs can
be added at runtime using the output API.

v2:

 - Fix wet_configure_windowed_output_from_config() usage.
 - Call x11_output_disable() explicitly from
   x11_output_destroy().

v3:

 - Remove unneeded free().
 - Disallow calling x11_output_configure more than once.
 - Remove unneeded checks for output->name == NULL as that
   has been disallowed.
 - Use weston_compositor_add_pending_output().
 - Bump weston_x11_backend_config version to 2.

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
7 years agoweston: Port Wayland backend to new output handling API
Armin Krezović [Fri, 30 Sep 2016 12:11:09 +0000 (14:11 +0200)]
weston: Port Wayland backend to new output handling API

This is a complete port of the Wayland backend that
uses the recently added output handling API for output
configuration.

- Output can be configured at runtime by passing the
  necessary configuration parameters, which can be
  filled in manually, obtained from the configuration
  file or obtained from the command line using
  previously added functionality. It is required that
  the scale and transform values are set using the
  previously added functionality.

- Output can be created at runtime using the output
  API. The output creation only creates a pending
  output, which needs to be configured the same way as
  mentioned above.

However, the backend can behave both as windowed backend
and as a backend that issues "hotplug" events, when
running under fullscreen shell or with --sprawl command
line option. The first case was covered by reusing
previously added functionality. The second case required
another API to be introduced and implemented into both
the backend and compositor for handling output setup.

After everything has been set, output needs to be
enabled manually using weston_output_enable().

v2:

 - Fix wet_configure_windowed_output_from_config() usage.
 - Call wayland_output_disable() explicitly from
   wayland_output_destroy().

v3:

 - Get rid of weston_wayland_output_api and rework output
   creation and configuration in case wayland backend is
   started with --sprawl or on fullscreen-shell.
 - Remove unneeded free().
 - Disallow calling wayland_output_configure more than once.
 - Remove unneeded checks for output->name == NULL as that
   has been disallowed.
 - Use weston_compositor_add_pending_output().

v4:

 - Drop unused fields from weston_wayland_backend_config
   and bump WESTON_WAYLAND_BACKEND_CONFIG_VERSION to 2.
 - Move output creation to backend itself when
   --fullscreen is used.
 - Prevent possible duplicated output names by assigning
   a different name to outputs created without any
   configuration specified.

Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agoweston: Port RDP backend to new output handling API
Armin Krezović [Fri, 30 Sep 2016 12:11:08 +0000 (14:11 +0200)]
weston: Port RDP backend to new output handling API

This is a complete port of the RDP backend that uses
the recently added output handling API for output
configuration.

Output can be configured at runtime by passing the
necessary configuration parameters, which can be
filled in manually or obtained from the command line
using previously added functionality. It is required
that the scale and transform values are set using
the previously added functionality.

After everything has been set, output needs to be
enabled manually using weston_output_enable().

v2:

 - Rename output_configure() to output_set_size()
   in plugin API and describe it.
 - Manually fetch parsed_options from wet_compositor.
 - Call rdp_output_disable() explicitly from
   rdp_output_destroy().

v3:

 - Disallow calling rdp_output_set_size more than once.
 - Manually assign a hardcoded name to an output as that's
   now mandatory.
 - Use weston_compositor_add_pending_output().
 - Bump weston_rdp_backend_config version to 2.

Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
7 years agoweston: Port headless backend to new output handling API
Armin Krezović [Fri, 30 Sep 2016 12:11:07 +0000 (14:11 +0200)]
weston: Port headless backend to new output handling API

This is a complete port of the headless backend that
uses the recently added output handling API for output
configuration.

- Output can be configured at runtime by passing the
  necessary configuration parameters, which can be
  filled in manually, obtained from the configuration
  file or obtained from the command line using
  previously added functionality. It is required that
  the scale and transform values are set using the
  previously added functionality.

- Output can be created at runtime using the output
  API. The output creation only creates a pending
  output, which needs to be configured the same way as
  mentioned above.

After everything has been set, output needs to be
enabled manually using weston_output_enable().

Same as before, a single output is created at runtime
using the default configuration or a configuration
parsed from the command line. The no-outputs
functionality is also preserved, which means that no
output will be created initially, but more outputs can
be added at runtime using the output API.

New feature:

This patch also adds, as a bonus of using shared
functionality, support for setting options for outputs
created by this backend in the weston config file in
addition to setting them from the command line.

v2:

 - Fix wet_configure_windowed_output_from_config() usage.
 - Call headless_output_disable() explicitly from
   headless_output_destroy().

v3:

 - Add scale support to output width and height.
 - Use scaled values in calls to various functions which
   require width and height.
 - Disallow calling headless_output_configure more than once.
 - Remove unneeded checks for output->name == NULL as that
   has been disallowed.
 - Use weston_compositor_add_pending_output().
 - Bump weston_headless_backend_config version to 2.

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
7 years agoweston: Port fbdev backend to new output handling API
Armin Krezović [Fri, 30 Sep 2016 12:11:06 +0000 (14:11 +0200)]
weston: Port fbdev backend to new output handling API

This is a complete port of the fbdev backend that uses
the recently added output handling API for output
configuration.

It is required that the scale and transform values are
set using the previously added functionality.

After everything has been set, output needs to be
enabled manually using weston_output_enable().

v2:

 - Use weston_compositor_add_pending_output().
 - Bump weston_fbdev_backend_config version to 2.

Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
7 years agoweston: Port DRM backend to new output handling API
Armin Krezović [Fri, 30 Sep 2016 12:11:05 +0000 (14:11 +0200)]
weston: Port DRM backend to new output handling API

This is a complete port of the DRM backend that uses
the recently added output handling API for output
configuration.

Output can be configured at runtime by passing the
necessary configuration parameters, which can be
filled in manually or obtained from the configuration
file using previously added functionality. It is
required that the scale and transform values are set
using the previously added functionality.

After everything has been set, output needs to be
enabled manually using weston_output_enable().

v2:

 - Added missing drmModeFreeCrtc() to drm_output_enable()
   cleanup list in case of failure.
 - Split drm_backend_disable() into drm_backend_deinit()
   to accomodate for changes in the first patch in the
   series. Moved restoring original crtc to
   drm_output_destroy().

v3:

 - Moved origcrtc allocation to drm_output_set_mode().
 - Swapped connector_get_current_mode() and
   drm_output_add_mode() calls in drm_output_set_mode()
   to match current weston.
 - Moved crtc_allocator and connector_allocator update
   from drm_output_enable() to create_output_for_connector()
   to avoid problems when more than one monitor is connected
   at startup and crtc allocator wasn't updated before
   create_output_for_connector() was called second time,
   resulting in one screen being turned off.
 - Moved crtc_allocator and connector_allocator update from
   drm_output_deinit() to drm_output_destroy(), as it
   should not be called on drm_output_disable().
 - Use weston_compositor_add_pending_output().
 - Bump weston_drm_backend_config version to 2.

v4:

 - Reset output->original_crtc to NULL if drm_output_set_mode()
   fails.
 - Remove unneeded log message when disabling an output when a
   pageflip is pending.
 - Document that create_output_for_connector() takes ownership
   of the connector.
 - Free the connector if create output conditionals are not met
   in create_outputs() and update_outputs().

Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agocompositor: Implement output configuration using windowed_output_api
Armin Krezović [Fri, 30 Sep 2016 12:11:04 +0000 (14:11 +0200)]
compositor: Implement output configuration using windowed_output_api

This implements output configuration for outputs which use
previously added weston_windowed_output_api. The function
takes an output that's to be configured, default configuration
that's to be set in case no configuration is specified in
the config file or on command line and optional third argument,
parsed_options, which will override defaults and options for
configuration if they are present.

This also introduces new compositor specific functions for
setting output's scale and transform from either hardcoded
default, config file option or command line option.

Pending output handling helpers have also been introduced.

v2:

 - Adapt to changes in previous patch.
 - Fix potential double free().
 - Remove redundant variables for scale and transform setting.
 - Drop parsed_options helper and parameter and use it directly
   in wet_configure_windowed_output_from_config().

v3:

 - Remove unneeded checks for output->name == NULL as that
   has been disallowed.
 - Stop printing mode if it's invalid, as it can be NULL.

Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
7 years agolibweston: Add initial output API for windowed outputs configuration
Armin Krezović [Fri, 30 Sep 2016 12:11:03 +0000 (14:11 +0200)]
libweston: Add initial output API for windowed outputs configuration

This adds new plugin-specific API for configuring outputs
on "windowed" backends, such as X11, wayland/non-fullscreen
and even headless (although, it doesn't have any windows,
its configuration is very similar). It can be used from
compositors to configure pending outputs and should be used
with previously added weston_output_set_{scale,transform}
to properly configure an output before enabling it.

It also supports creating additional outputs on the mentioned
backends.

v2:

 - Rename output-api.h to windowed-output-api.h.
 - Rename output_configure() to output_set_size().
 - Document return values.

v3:

 - Fixed copyright.
 - Noted that output name can't be NULL in
   output_create().

Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
7 years agolibweston: Add more functionality for handling weston_output objects
Armin Krezović [Fri, 30 Sep 2016 12:11:02 +0000 (14:11 +0200)]
libweston: Add more functionality for handling weston_output objects

This patch implements additional functionality that will be used
for configuring, enabling and disabling weston's outputs. Its
indended use is by the compositors or user programs that want to
be able to configure, enable or disable an output at any time. An
output can only be configured while it's disabled.

The compositor and backend specific functionality is required
for these functions to be useful, and those will come later in
this series.

All the new functions have been documented, so I'll avoid
describing them here.

v2:

 - Minor documentation improvements.
 - Rename output-initialized to output->enabled.
 - Split weston_output_disable() further into
   weston_compositor_remove_output().
 - Rename weston_output_deinit() to weston_output_enable_undo().

 - Make weston_output_disable() call two functions mentioned
   above instead of calling weston_output_disable() directly.
   This means that backend needs to take care of doing backend
   specific disable in backend specific destroy function.

v3:

 - Require output->name to be set before calling
   weston_output_init_pending().
 - Require output->destroying to be set before
   calling weston_compositor_remove_output().
 - Split weston_output_init_pending() into
   weston_compositor_add_pending_output() so pending outputs
   can be announced separately.
 - Require output->disable() to be set in order for
   weston_output_disable() to be usable.
 - Fix output removing regression that happened when
   weston_output_disable() was split.
 - Minor documentation fix.

v4:

 - Bump libweston version to 2 as this patch breaks the ABI.

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
7 years agogl-renderer: Add support for DRM_FORMAT_YUV444 buffers
Matthias Treydte [Mon, 25 Jul 2016 10:15:41 +0000 (12:15 +0200)]
gl-renderer: Add support for DRM_FORMAT_YUV444 buffers

This uses the existing infrastructure for dealing with planar YUV buffers and only adds the
relevant yuv_format_descriptor to the table.
Reviewed-by: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com>
7 years agoclients/stacking: Silence a compiler warning
Armin Krezović [Wed, 28 Sep 2016 22:18:10 +0000 (00:18 +0200)]
clients/stacking: Silence a compiler warning

This patch fixes a compiler warning when building with
clang, since it doesn't support gnu_printf attribute.

v2:

 - Switch to WL_PRINTF per suggestion from Eric Engestrom.

v3:

 - Explicitly include wayland-util.h

Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
7 years agolibweston-desktop: fix sending the configure event with wl_shell
Giulio Camuffo [Wed, 28 Sep 2016 19:29:14 +0000 (21:29 +0200)]
libweston-desktop: fix sending the configure event with wl_shell

Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
7 years agoconfigure: remove double equal test bashism
Murray Calavera [Thu, 29 Sep 2016 20:24:30 +0000 (21:24 +0100)]
configure: remove double equal test bashism

Signed-off-by: Murray Calavera <murray.calavera@gmail.com>
Reviewed-by: Armin Krezović <krezovic.armin@gmail.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
7 years agoshared/platform: include weston-egl-ext.h only if ENABLE_EGL is defined
Krzysztof Konopko [Thu, 15 Sep 2016 11:01:49 +0000 (13:01 +0200)]
shared/platform: include weston-egl-ext.h only if ENABLE_EGL is defined

Including `weston-egl-ext.h` causes compilation failure for configurations
with EGL disabled.

Verified with `--disable-egl`, `--disable-x11-compositor`
and `--disable-drm-compositor`.

Signed-off-by: Krzysztof Konopko <kris@youview.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
7 years agolibweston-desktop: Fix some clang warnings
Armin Krezović [Sat, 10 Sep 2016 17:11:21 +0000 (19:11 +0200)]
libweston-desktop: Fix some clang warnings

Fixes:

implicit conversion from enumeration type '...' to different
enumeration type '...' [-Wenum-conversion]

Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
7 years agostring-helpers.h: Fix usage on musl libc
Kylie McClain [Sat, 24 Sep 2016 03:40:14 +0000 (23:40 -0400)]
string-helpers.h: Fix usage on musl libc

On musl, int32_t is defined in stdint.h.

Signed-off-by: Kylie McClain <kylie@somasis.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
7 years agoshare/cairo-util: Use wl_pointer_button_state enum directly
Quentin Glidic [Sun, 10 Jul 2016 09:00:55 +0000 (11:00 +0200)]
share/cairo-util: Use wl_pointer_button_state enum directly

This silences two warnings:

clients/window.c:2450:20: warning: implicit conversion from enumeration
type 'enum wl_pointer_button_state' to different enumeration type 'enum
frame_button_state' [-Wenum-conversion]
                                              button, state);
                                                      ^~~~~

clients/window.c:2453:15: warning: implicit conversion from enumeration
type 'enum wl_pointer_button_state' to different enumeration type 'enum
frame_button_state' [-Wenum-conversion]
                                                button, state);
                                                        ^~~~~

Warning produced by Clang 3.8.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
7 years agozunitc/junit-reporter: Silence pointer-sign warning
Quentin Glidic [Sun, 10 Jul 2016 09:00:56 +0000 (11:00 +0200)]
zunitc/junit-reporter: Silence pointer-sign warning

/usr/x86_64-pc-linux-gnu/include/libxml2/libxml/xmlstring.h:35:18:
warning: pointer targets in passing argument 3 of 'xmlStrPrintf' differ
in signedness [-Wpointer-sign]
 #define BAD_CAST (xmlChar *)
                  ^
tools/zunitc/src/zuc_junit_reporter.c:77:41: note: in expansion of macro
'BAD_CAST'
  xmlStrPrintf(scratch, sizeof(scratch), BAD_CAST %d, value);
                                         ^~~~~~~~
/usr/x86_64-pc-linux-gnu/include/libxml2/libxml/xmlstring.h:98:17: note:
expected 'const char *' but argument is of type 'xmlChar * {aka unsigned
char *}'
                 xmlStrPrintf             (xmlChar *buf,

Warning produced by GCC 5.3, 6.1 and Clang 3.8.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Armin Krezović <krezovic.armin@gmail.com>
Tested-by: Armin Krezović <krezovic.armin@gmail.com>
7 years agocompositor: set the opaque region for some views with transform
Giulio Camuffo [Sun, 4 Sep 2016 15:50:46 +0000 (18:50 +0300)]
compositor: set the opaque region for some views with transform

If the transform on a view is only a translation we can trivially
set the opaque region for it so to optimize the rendering.
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
7 years agoconfigure: Also update libweston version to match weston
Bryce Harrington [Fri, 23 Sep 2016 00:38:39 +0000 (17:38 -0700)]
configure: Also update libweston version to match weston

7 years agoconfigure.ac: bump version to 1.12.90 for open development
Bryce Harrington [Thu, 22 Sep 2016 17:33:46 +0000 (10:33 -0700)]
configure.ac: bump version to 1.12.90 for open development

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
7 years agoconfigure.ac: bump to version 1.12.0 for the official release
Bryce Harrington [Tue, 20 Sep 2016 19:22:46 +0000 (12:22 -0700)]
configure.ac: bump to version 1.12.0 for the official release

7 years agolibweston-desktop: Fix configure event for already well-sized surfaces
Quentin Glidic [Tue, 13 Sep 2016 08:05:58 +0000 (10:05 +0200)]
libweston-desktop: Fix configure event for already well-sized surfaces

Even if the surface size is already correct, we need to store the
configured size in case some other state change triggers a configure
event.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Arnaud Vrac <avrac@freebox.fr>
7 years agoconfigure.ac: bump to version 1.11.94 for the RC2 release
Bryce Harrington [Tue, 13 Sep 2016 19:18:23 +0000 (12:18 -0700)]
configure.ac: bump to version 1.11.94 for the RC2 release

7 years agolibweston-desktop/xdg_shell_v6: Raise errors on not-yet-possible requests
Quentin Glidic [Sun, 11 Sep 2016 09:34:47 +0000 (11:34 +0200)]
libweston-desktop/xdg_shell_v6: Raise errors on not-yet-possible requests

These requests need a mapped surface, which can only happen after the
initial configure event.

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
7 years agolibweston-desktop/xdg_shell_v6: Add surface as needed
Quentin Glidic [Sun, 11 Sep 2016 09:29:23 +0000 (11:29 +0200)]
libweston-desktop/xdg_shell_v6: Add surface as needed

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
7 years agoRevert "terminal: Fix crash due to race condition in init"
Quentin Glidic [Fri, 9 Sep 2016 17:53:38 +0000 (19:53 +0200)]
Revert "terminal: Fix crash due to race condition in init"

This reverts commit 5c611d933f60f720db98331c9c1c6ed4420f9782.