platform/upstream/weston.git
6 years agoinput: do not forward unmatched touch-ups
Pekka Paalanen [Fri, 2 Mar 2018 12:20:59 +0000 (14:20 +0200)]
input: do not forward unmatched touch-ups

Commit a30e29af2e4d0ad6fc476ae7cc13c4cad5119217 introduced the code to
deal with a touchscreen with touches already down when Weston starts
using it. It fixed the touchpoint counting problem.

However, Weston still should not forward or process the unmatched
touch-ups either. Code inspection says it would confuse the
idle-inhibit counting, and it could probably confuse clients as well.
Hence, just drop unmatched touch-ups.

Enhance the warning message to allow identifying where the event came
from.

v2:
- use syspath instead of devpath

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v1 Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
v1 Tested-by: Matt Hoosier <matt.hoosier@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoinput: move touchpoint counting up
Louis-Francis Ratté-Boulianne [Wed, 29 Nov 2017 01:42:47 +0000 (20:42 -0500)]
input: move touchpoint counting up

The touchpoint counting is needed regardless of what we do with the
touch events, so move it out of process_touch_normal() into the caller
notify_touch_normalized().

This is pure refactoring.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v1 Tested-by: Matt Hoosier <matt.hoosier@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibweston: introduce notify_touch_normalized() and doc
Pekka Paalanen [Mon, 26 Feb 2018 14:18:29 +0000 (16:18 +0200)]
libweston: introduce notify_touch_normalized() and doc

notify_touch_normalized() is an extended form of notify_touch(), adding
normalized touch coordinates which are necessary for calibrating a
touchscreen.

It would be possible to invert the transformation and convert from
global coordinates to normalized device coordinates in input.c without
adding this API, but this way it is more robust against code changes.

Recovering normalized device coordinates is necessary because libinput
calibration matrix must be given in normalized units, and it would be
difficult to compute otherwise. Libinput API does not offer normalized
coordinates directly either, but those can be fetched by pretending the
output resolution is 1x1.

Anticipating touch calibration mode, the old notify_touch() is renamed
into a private process_touch_normal(), and the new
notify_touch_normalized() delegates to it.

Co-developed by Louis-Francis and Pekka.

v2:
- introduce struct weston_point2d_device_normalized
- rename notify_touch_cal() to notify_touch_normalized()
- remove WESTON_INVALID_TOUCH_COORDINATE

Cc: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v1 Tested-by: Matt Hoosier <matt.hoosier@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibweston: notify_touch API to use weston_touch_device
Pekka Paalanen [Mon, 26 Feb 2018 12:43:00 +0000 (14:43 +0200)]
libweston: notify_touch API to use weston_touch_device

Relay touch input events into libweston core through the
weston_touch_device, so that the core can tell which individual physical
device they come from.

This is necessary for supporting touchscreen calibration, where one
needs to process a single physical device at a time instead of the
aggregate of all touch devices on the weston_seat.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v1 Tested-by: Matt Hoosier <matt.hoosier@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput: move calibration printing into do_set_calibration()
Pekka Paalanen [Tue, 18 Apr 2017 09:11:53 +0000 (12:11 +0300)]
libinput: move calibration printing into do_set_calibration()

Move calibration printing here and call do_set_calibration() from
evdev_device_set_calibration() so that all matrix setting paths print
the same way.

Print the matrix values in a matrix style to help readability, and
mention the input device.

v2:
- use 'cal' instead of 'calb' as variable name

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v1 Tested-by: Matt Hoosier <matt.hoosier@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoinput: introduce weston_touch_device
Louis-Francis Ratté-Boulianne [Wed, 29 Nov 2017 01:42:47 +0000 (20:42 -0500)]
input: introduce weston_touch_device

Introduce weston_touch_device for libweston core to track individual
touchscreen input devices. A weston_seat/weston_touch may be an
aggregation of several physical touchscreen input devices. Separating
the physical devices will be required for implementing touchscreen
calibration. One can only calibrate one device at a time, and we want to
make sure to handle the right one.

Both backends that support touch devices are updated to create
weston_touch_devices. Wayland-backend provides touch devices that cannot
be calibrated, because we have no access to raw touch coordinates from
the device - calibration is the responsibility of the parent display
server. Libinput backend provides touch devices that can be calibrated,
hence implementing the set and get calibration hooks.

Backends need to maintain an output pointer in any case, so we have a
get_output() hook instead of having to maintain an identical field in
weston_touch_device. The same justification applies to
get_calibration_head_name.

Also update the test plugin to manage weston_touch_device objects.

Co-developed by Louis-Francis and Pekka.

v2:
- Consistently use 'cal' instead of 'calb' or 'matrix'.
- change devpath into syspath
- update copyrights

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v1 Tested-by: Matt Hoosier <matt.hoosier@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoweston-info: destroy wl_keyboard
Markus Ongyerth [Mon, 30 Apr 2018 09:35:50 +0000 (11:35 +0200)]
weston-info: destroy wl_keyboard

Fixes a memory leak by calling wl_keyboard_destroy on any keyboard
that was used to listen for events.

Signed-off-by: Markus Ongyerth <wl@ongy.net>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoweston-info: Add support for tablet-unstable-v2
Markus Ongyerth [Mon, 30 Apr 2018 09:35:49 +0000 (11:35 +0200)]
weston-info: Add support for tablet-unstable-v2

This now prints each tablet seat with at least one tablet/pad/tool
attached.
For each tablet seat, each tablet, pad and tool is printed with as much
detail about the device as the protocol provides.
Seat info is stored to be referenced, because the protocol requires to
request a tablet_seat for each wl_seat and it's not guaranteed that the
tablet_v2_manager is available when seats are advertised.

Signed-off-by: Markus Ongyerth <wl@ongy.net>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoFix a crash when unlocking or unconfining a pointer
Dima Ryazanov [Thu, 10 May 2018 07:53:38 +0000 (00:53 -0700)]
Fix a crash when unlocking or unconfining a pointer

In GNOME (but not in Weston), if a window loses focus, the client first receives
the focus event, then the unlock/unconfine event. This causes toytoolkit to
dereference a NULL window when unlocking or unconfining the pointer.

To repro:
- Run weston-confine
- Click the window
- Alt-Tab away from it

Result:

[1606837.869] wl_keyboard@19.modifiers(63944, 524352, 0, 0, 0)
[1606837.926] wl_keyboard@19.leave(63945, wl_surface@15)
[1606837.945] wl_pointer@18.leave(63946, wl_surface@15)
[1606837.956] wl_pointer@18.frame()
[1606837.961] zwp_confined_pointer_v1@26.unconfined()
Segmentation fault (core dumped)

To fix this, get the input from the window instead of the other way around.

Signed-off-by: Dima Ryazanov <dima@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
6 years agosimple-dmabuf-drm: support DRM_FORMAT_LINEAR for NV12 as well
Guido Günther [Mon, 28 May 2018 15:41:57 +0000 (17:41 +0200)]
simple-dmabuf-drm: support DRM_FORMAT_LINEAR for NV12 as well

This makes --import-format=NV12 testable on e.g. intel

We only set nv12_format_found to true if we found that format and at
least one understood modifier. Store modifier verbatim instead of using
a boolean flag. Last advertised and supported modifier currently wins.

The NV12 DRM_FORMAT_LINEAR image should be green in the upper left
corner and white in the lower right.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
6 years agolog: improve handling of use-before-init
Matt Hoosier [Fri, 4 May 2018 14:26:34 +0000 (09:26 -0500)]
log: improve handling of use-before-init

Rather than segfaulting by attempting to traverse an initially
null log handler pointer, explicitly print a message and abort.

Signed-off-by: Matt Hoosier <matt.hoosier@gmail.com>
Reviewed-by: Ian Ray <ian.ray@ge.com>
[Pekka: coding style fix]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
6 years agosimple-dmabuf-drm: don't exit from create_display
Guido Günther [Tue, 20 Mar 2018 10:36:37 +0000 (11:36 +0100)]
simple-dmabuf-drm: don't exit from create_display

Only exit from main so control flow is in one place.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
6 years agosimple-dmabuf-drm: drop superfluous declaration
Guido Günther [Tue, 20 Mar 2018 10:36:36 +0000 (11:36 +0100)]
simple-dmabuf-drm: drop superfluous declaration

variable is defined in simple-dmabuf-drm.h

Signed-off-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
6 years agosimple-dmabuf-drm: support etnaviv drm as well
Guido Günther [Tue, 20 Mar 2018 08:42:00 +0000 (09:42 +0100)]
simple-dmabuf-drm: support etnaviv drm as well

Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Signed-off-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
6 years agosimple-dmabuf-drm: simplify fd_map_bo
Guido Günther [Tue, 20 Mar 2018 08:41:59 +0000 (09:41 +0100)]
simple-dmabuf-drm: simplify fd_map_bo

Signed-off-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
6 years agosimple-dmabuf-drm: 0 is a valid fd (freedreno)
Guido Günther [Tue, 20 Mar 2018 08:41:58 +0000 (09:41 +0100)]
simple-dmabuf-drm: 0 is a valid fd (freedreno)

Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Signed-off-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
6 years agordp-compositor: fix compilation against FreeRDP 2.0.0 rc2
David Fort [Sun, 27 May 2018 21:56:43 +0000 (23:56 +0200)]
rdp-compositor: fix compilation against FreeRDP 2.0.0 rc2

The SURFACE_BITS_COMMAND struct has changed and some members have been moved in the
bmp field.

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
6 years agoxwm: dump properties of type WINDOW
Pekka Paalanen [Fri, 4 May 2018 10:53:55 +0000 (12:53 +0200)]
xwm: dump properties of type WINDOW

Very useful for TRANSIENT_FOR property debugging.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Reviewed-by: Ian Ray <ian.ray@ge.com>
6 years agoxwm: dump properties of type CARDINAL
Pekka Paalanen [Fri, 4 May 2018 10:53:54 +0000 (12:53 +0200)]
xwm: dump properties of type CARDINAL

Add code to dump CARDINAL arrays from properties. Useful for debugging.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Reviewed-by: Ian Ray <ian.ray@ge.com>
6 years agodesktop-shell: survive NULL output in shell_configure_fullscreen()
Pekka Paalanen [Wed, 2 May 2018 08:21:58 +0000 (10:21 +0200)]
desktop-shell: survive NULL output in shell_configure_fullscreen()

Running 'weston-simple-egl -f -b' (fullscreen, unthrottled) caused a
crash in shell_ensure_fullscreen_black_view() due to
shsurf->fullscreen_output being NULL. Also shell_configure_fullscreen()
could crash on that condition.

Fix shell_configure_fullscreen() to bail out with minimal work if there
is no fullscreen_output.

It is unclear if anything will cause a reconfiguration when an output is
plugged in.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Reviewed-by: Ian Ray <ian.ray@ge.com>
6 years agodesktop-shell: do not lower_fullscreen_layer(s, NULL)
Pekka Paalanen [Wed, 2 May 2018 08:21:57 +0000 (10:21 +0200)]
desktop-shell: do not lower_fullscreen_layer(s, NULL)

In activate, do not call lower_fullscreen_layer() at all if the output
is NULL. It should not do anything in that case, per the existing
comment.

This is a tentative crash fix for a case where there are no enabled
weston_outputs at all.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Reviewed-by: Ian Ray <ian.ray@ge.com>
6 years agodesktop-shell: handle NULL output in center_on_output()
Pekka Paalanen [Wed, 2 May 2018 08:21:56 +0000 (10:21 +0200)]
desktop-shell: handle NULL output in center_on_output()

This is a tentative crash fix for a case where there are no enabled
weston_outputs at all.

If no output is given, just put the surface at 0,0. At least it should
become mostly visible if an output is plugged in, if not centered.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Reviewed-by: Ian Ray <ian.ray@ge.com>
6 years agodesktop-shell: handle NULL output in get_output_work_area()
Pekka Paalanen [Wed, 2 May 2018 08:21:55 +0000 (10:21 +0200)]
desktop-shell: handle NULL output in get_output_work_area()

This is a tentative crash fix for a case where there are no
enabled weston_outputs at all.

Let get_output_work_area() return a zero area if the given output is
NULL. If there is no output, there is no area. Unfortunately we cannot
return "no position" but have to use 0,0 instead.

In send_configure_for_surface(), this causes a maximized surface to
receive width=0 and height=0 in the configure event, which means the
client is free to choose the size. There is no correct size to send for
maximizing for no output.

In constrain_position(), this has no effect. The interactive move of a
surface is restricted to not go below the panel, so even if a user
managed to move a surface without an output, it just prevents the
surface moving beyond y=0.

In weston_view_set_initial_position(), get_output_work_area() will not
be called with NULL output anyway.

In set_maximized_position(), this makes it behave as if the output was
at 0,0 which is the default position of the first output.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Reviewed-by: Ian Ray <ian.ray@ge.com>
6 years agomain: add setting for DRM/pixman shadow framebuffer
Pekka Paalanen [Mon, 23 Apr 2018 09:44:59 +0000 (11:44 +0200)]
main: add setting for DRM/pixman shadow framebuffer

Allows to control the Pixman-renderer shadow framebuffer usage from
weston.ini. It defaults to enabled, and whether it is a good idea to
disable or not depends on the platform and the workload.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Reviewed-by: Ian Ray <ian.ray@ge.com>
6 years agocompositor-drm: expose global shadow flag for pixman
Pekka Paalanen [Mon, 23 Apr 2018 09:44:58 +0000 (11:44 +0200)]
compositor-drm: expose global shadow flag for pixman

Allow global control of the pixman shadow buffers. The compositor can
choose whether all output use or do not use a shadow buffer with the
pixman renderer.

The option is added to the end of struct weston_drm_backend_config to
avoid bumping WESTON_DRM_BACKEND_CONFIG_VERSION.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Reviewed-by: Ian Ray <ian.ray@ge.com>
6 years agopixman: make shadow buffer optional
Pekka Paalanen [Mon, 23 Apr 2018 09:44:57 +0000 (11:44 +0200)]
pixman: make shadow buffer optional

Add a flag to pixman-renderer for initializing the output with a shadow
framebuffer. All backends were getting the shadow implcitly, so all
backends are modified to ask for the shadow explicitly.

Using a shadow buffer is usually beneficial, because read-modify-write
cycles (blending) into a scanout-capable buffer may be very slow. The
scanout framebuffer may also have reduced color depth, making blending
and read-back produce inferior results.

In some use cases though the shadow buffer might be just an extra copy
hurting more than it helps. Whether it helps or hurts depends on the
platform and the workload. Therefore let the backends control whether
pixman-renderer uses a shadow buffer for an output or not.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Reviewed-by: Ian Ray <ian.ray@ge.com>
6 years agopixman,drm: do not composite previous damage
Pekka Paalanen [Mon, 23 Apr 2018 09:44:56 +0000 (11:44 +0200)]
pixman,drm: do not composite previous damage

Pixman-renderer uses a single internal shadow buffer. It is enough to
composite the current damage into shadow, but the copy to hw buffer
needs to include the previous damage because of double-buffering in
DRM-backend.

This patch lets pixman-renderer do exactly that without compositing also
the previous damage on DRM-renderer.

Arguably weston_output should not have field previous_damage to begin
with, because it implies double-buffering, which e.g. EGL does not
guarantee. It would be better for each backend explicitly always provide
any extra damage that should be copied to hw.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Reviewed-by: Ian Ray <ian.ray@ge.com>
6 years agolibweston: fix output destroy signal list corruption
Pekka Paalanen [Tue, 22 May 2018 10:15:58 +0000 (13:15 +0300)]
libweston: fix output destroy signal list corruption

This issue was likely introduced by "libweston: add
weston_view_set_output()" which forgot to ensure the output destroy
listener is removed when weston_view is destroyed, leading to freed
memory being left into the list.

This was quite easy to trigger by opening and closing an application
window a few times, leading various memory corruption symptoms.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
6 years agodesktop-shell: fix output destroy signal list corruption
Pekka Paalanen [Tue, 22 May 2018 09:48:35 +0000 (12:48 +0300)]
desktop-shell: fix output destroy signal list corruption

This issue was introduced by "desktop-shell: detect stale shell surface
outputs" which forgot to remove the output destroy listener when
shell_surface is destroyed, leading to memory corruption.

This was fairly easy to trigger by opening and closing an application
window a few times.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
6 years agodesktop-shell: detect stale shell surface outputs
Semi Malinen [Wed, 2 May 2018 09:10:32 +0000 (11:10 +0200)]
desktop-shell: detect stale shell surface outputs

When displays are hot (un)plugged, it may happen that
a shell surface is left with a stale pointer to an output
that has already been freed. Add an output destroy listener
to catch such situations and set the output pointer to NULL.

Signed-off-by: Semi Malinen <semi.malinen@ge.com>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
6 years agolibweston: add weston_view_set_output()
Semi Malinen [Thu, 26 Apr 2018 09:08:10 +0000 (11:08 +0200)]
libweston: add weston_view_set_output()

Instead of desktop shell assigning view outputs directly,
use a new method, weston_view_set_output(). The method can
set up an output destroy listener to make sure that views
do not have stale output pointers.

Without this patch it is possible to end up in a scenario
where, e.g. configure_static_view() accesses memory that
has already been freed. The scenario can be provoked by
repeatedly plugging and unplugging a display. The faulty
memory accesses are reported by valgrind.

Signed-off-by: Semi Malinen <semi.malinen@ge.com>
Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
6 years agoweston: use wet.compositor consistently in main()
Pekka Paalanen [Thu, 2 Nov 2017 13:42:51 +0000 (15:42 +0200)]
weston: use wet.compositor consistently in main()

Rename user_data to wet, because it is called wet everywhere else.

Drop the local variable ec, because that is available as wet.compositor.

This models a little better that wet_compositor owns weston_compositor,
and not the other way around.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
6 years agoweston: store weston_compositor in wet_compositor
Pekka Paalanen [Thu, 2 Nov 2017 13:38:24 +0000 (15:38 +0200)]
weston: store weston_compositor in wet_compositor

This makes it easier to just pass wet_compositor around and take the
weston_compositor from it.

It feels weird to go from weston_compositor to wet_compositor all the
time in internal functions. It's necessary in callbacks that cannot
carry wet_compositor, but otherwise it is awkward.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
6 years agocompositor-drm: allow shared-CRTC cloning
Pekka Paalanen [Mon, 20 Nov 2017 12:04:38 +0000 (14:04 +0200)]
compositor-drm: allow shared-CRTC cloning

Allow cloning up to 4 connectors from the same CRTC. All the
implementation bits support more than one head per output already.

Four is just an arbitary number, small but unlikely to ever be the
limiting factor in cloning since hardware is usually very restricted.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
6 years agocompositor-drm: head attach requires a modeset
Pekka Paalanen [Fri, 8 Dec 2017 12:45:00 +0000 (14:45 +0200)]
compositor-drm: head attach requires a modeset

For the attach on an enabled output to have an effect, we need to go
through drmModeSetCrtc or ATOMIC_ALLOW_MODESET.

v9:
- Add another XXX comment.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
6 years agocompositor-drm: head detach requires a modeset
Pekka Paalanen [Wed, 29 Nov 2017 12:33:33 +0000 (14:33 +0200)]
compositor-drm: head detach requires a modeset

When a head is detached from an enabled output, that output needs to go
through a modeset (drmModeSetCrtc() / ATOMIC_ALLOW_MODESET) so that the
connector is actually removed from the CRTC.

This has not yet been a problem, because an output could only have one
head at a time, and would be automatically disabled on detach. It would
be a problem with clone mode.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
6 years agocompositor-drm: preserve CRTC routing harder
Pekka Paalanen [Tue, 28 Nov 2017 14:11:00 +0000 (16:11 +0200)]
compositor-drm: preserve CRTC routing harder

If we are processing a connector that does not have an existing routing,
it is possible we pick a CRTC that was previously routed to a connector
we have not enabled yet. If that happens, the latter connector cannot
preserve its routing.

Check that no other connector we might enable later had this CRTC
before.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
6 years agocompositor-drm: rewrite crtc picking for clone mode
Pekka Paalanen [Mon, 20 Nov 2017 11:31:06 +0000 (13:31 +0200)]
compositor-drm: rewrite crtc picking for clone mode

To support shared-CRTC clone mode, the chosen CRTC needs to support
driving all the attached connectors. Replace the old algorithm with a
new one that takes into account all associated connectors.

Ideally it should use possible_clones mask to check which encoders (and
therefore connectors) actually can be in a cloned set. However, the DRM
documentation says about possible_clones and possible_crtcs masks both:
"In reality almost every driver gets this wrong."
- https://01.org/linuxgraphics/gfx-docs/drm/gpu/drm-kms.html#c.drm_encoder

Looking at a target device and its kernel where clone mode is desired,
possible_clones is indeed self-conflicting and would not allow cloning
at all. Therefore the implemented algorithm replaces the checking of
possible_clones with luck. It even goes out of its way to find any CRTC
for a configuration, even if not advertised by the kernel as not
supported.

Libweston would need infrastructure to allow trial-and-error CRTC
allocation: rather than picking one CRTC in advance and do or die, it
should try all available CRTCs one by one. Unfortunately that is not yet
possible, so this patch implements what it can. It is also the DRM
upstream opinion that trial-and-error with ATOMIC_TEST would be the way
to go.

Unlike the old algorithm, the new algorithm prefers routings that were
in place when Weston started instead of when enabling an output. When
you never temporarily disable an output, this makes no difference.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
6 years agolibweston: fix weston_touch_start_grab() arg name
Louis-Francis Ratté-Boulianne [Wed, 29 Nov 2017 01:42:47 +0000 (20:42 -0500)]
libweston: fix weston_touch_start_grab() arg name

compositor.c has 'touch', so use 'touch' here as well. It is not a
device to begin with.

Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
v1 Tested-by: Matt Hoosier <matt.hoosier@gmail.com>

6 years agolibweston: unexport weston_{pointer,keyboard,touch}_{create,destroy}()
Pekka Paalanen [Mon, 26 Feb 2018 12:55:32 +0000 (14:55 +0200)]
libweston: unexport weston_{pointer,keyboard,touch}_{create,destroy}()

We have weston_seat_{init,release}_{pointer,keyboard,touch}() as the
backend-facing API. There is no need to expose the create/destroy
functions which have been for internal use only for quite a long time.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
v1 Tested-by: Matt Hoosier <matt.hoosier@gmail.com>

6 years agoUpdate copyrights for Collabora and General Electric Company
Pekka Paalanen [Thu, 19 Apr 2018 11:20:01 +0000 (14:20 +0300)]
Update copyrights for Collabora and General Electric Company

Looking at the diff statistics of the changes authored by me and landed
since 4.0.0 release points out these files as having major changes.
Update the copyright holders accordingly, as both clone mode and
touchscreen calibration related patches are copyright both Collabora and
GE.

I have kept the redundant "Copyright ©" form only to keep things
consistent, even when either the word or the mark would be enough.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Ian Ray <ian.ray@ge.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
6 years agotests: add test_seat_release() for symmetry
Pekka Paalanen [Mon, 26 Feb 2018 12:14:14 +0000 (14:14 +0200)]
tests: add test_seat_release() for symmetry

Add test_seat_release() as the counterpart of test_seat_init() instead
of open-coding it. This helps adding more code to test_seat_release()
later.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agoman: document WESTON_LIBINPUT_LOG_PRIORITY env
Pekka Paalanen [Mon, 5 Feb 2018 14:20:51 +0000 (16:20 +0200)]
man: document WESTON_LIBINPUT_LOG_PRIORITY env

Commit c81c4241d9c9fc5f60c08177dd8a33ae4e4ddca1 added this environment
variable. Document it.

It applies also to the fbdev-backend but that has no man page.

v2:
- Rewording by Peter Hutterer.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput: do not switch output associations on disable
Pekka Paalanen [Tue, 20 Mar 2018 12:45:36 +0000 (14:45 +0200)]
libinput: do not switch output associations on disable

If an input device is associated to an output that then gets disabled,
there is no case where associating to a different output would be
correct.

The output association is used for absolute positioned input devices,
and an input device like a touchscreen cannot ever be automatically
valid for more than one possible output - the touchscreen display
device.

Therefore do not automatically reassing implicitly associated input
devices to another output. This removes some log spam on shutdown.

In fact, if there can be more than one output at any time, absolute
input devices must be explicitly configured to associate with the
correct output, or the results are essentially undefined in any case.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibweston: require connected heads for input devices
Pekka Paalanen [Tue, 20 Mar 2018 11:29:40 +0000 (13:29 +0200)]
libweston: require connected heads for input devices

The use case driving this change is a clone mode setup, where the user
is hotplugging or unplugging a cloned touchscreen. Even if the output
and head are force-enabled, the touch device should still follow the
connector connection status. If there is no video signal for the
touchscreen (disconnected connector), then the touch input should be
ignored as well.

When the output is force-enabled, we need to trigger
output_heads_changed from connector status changes. If the head or
output are not force-enabled, the compositor will likely attach and
detach the head as appropriate. In clone mode, the attach or detach
needs to trigger output_heads_changed directly. In other cases, it may
be handled through the output getting enabled or disabled which are
different signals.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput: use head names for output matching
Pekka Paalanen [Mon, 19 Mar 2018 12:55:41 +0000 (14:55 +0200)]
libinput: use head names for output matching

Associating input devices with weston_outputs by the output name fails
when one output has several heads. We need to match against head names
instead of output names to be able to find all names.

This fixes touchscreen output association in shared-CRTC clone mode when
outputs or input devices appear or disappear.

Even though notify_output_create() is called only when new outputs
appear, the implementation is prepared to also remove output
associations. This will be handy in the future when this function will
handle also head detaching from an output that remains enabled.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput: allow evdev_device_set_output(dev, NULL)
Pekka Paalanen [Thu, 20 Apr 2017 08:38:06 +0000 (11:38 +0300)]
libinput: allow evdev_device_set_output(dev, NULL)

Removing the output association from an evdev_device is more than just
setting the pointer to NULL, one also needs to remove the destroy
listener and flag the destroy listener as unused (notify == NULL).

evdev_device_set_output() can already remove associations, so let it
also handle an assignment to NULL output.

Fix notify_output_destroy() to handle removing an association correctly.
Previously, the listener was left "used", which would mean the next call
to evdev_device_set_output() would have wl_list_remove()'d, accessing
freed memory. This could be triggered by having a touchscreen with a
specified output association, and unplugging then re-plugging the
corresponding output.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput: make setting the same output a no-op
Pekka Paalanen [Tue, 18 Apr 2017 09:22:12 +0000 (12:22 +0300)]
libinput: make setting the same output a no-op

In the future evdev_device_set_output() will start getting called more
often, redundantly. Short-circuit the setting if the chosen output is
already set for an input device. This reduces churn in the logs.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput: log input device to output associations
Pekka Paalanen [Tue, 18 Apr 2017 09:22:12 +0000 (12:22 +0300)]
libinput: log input device to output associations

Helps admins ensure the configuration is correct.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput: deprecate WL_CALIBRATION
Pekka Paalanen [Wed, 21 Mar 2018 12:30:04 +0000 (14:30 +0200)]
libinput: deprecate WL_CALIBRATION

The udev property WL_CALIBRATION is an old way of giving Weston a
touchscreen calibration matrix. It is Weston-specific.

The recommended way of setting up a calibration is to use the udev
property LIBINPUT_CALIBRATION_MATRIX, which libinput will load
automatically and therefore applies to all libinput using display
servers and applications.

The syntax of WL_CALIBRATION and LIBINPUT_CALIBRATION_MATRIX is
different as well: WL_CALIBRATION uses pixels as the translation part
units, which makes the values depend on the output resolution.
LIBINPUT_CALIBRATION_MATRIX on the other hand uses normalized units.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput: note if calibrating without an output
Pekka Paalanen [Tue, 18 Apr 2017 09:14:32 +0000 (12:14 +0300)]
libinput: note if calibrating without an output

Print a note that calibration got skipped if the input device supports a
calibration matrix but there is no associated output to compute it from.
Helps with debugging touchscreen calibration issues.

The code is reorganized and commented a bit, but this does not change
the behaviour.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agolibinput: remove evdev_device::devnode
Pekka Paalanen [Tue, 18 Apr 2017 11:43:08 +0000 (14:43 +0300)]
libinput: remove evdev_device::devnode

Struct 'evdev_device' has field 'devnode' which is initialized to NULL,
never assigned, and finally free()'d. Therefore it is useless.

Remove the dead field.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
6 years agocompositor-drm: no need to clear inherited_mode
Pekka Paalanen [Tue, 28 Nov 2017 12:33:52 +0000 (14:33 +0200)]
compositor-drm: no need to clear inherited_mode

The head was just zalloc()'d, there is no need to memset it to zero.

If a function fails, it is preferable it leaves the output arguments
untouched.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-drm: introduce drm_head_read_current_setup()
Pekka Paalanen [Tue, 28 Nov 2017 12:30:10 +0000 (14:30 +0200)]
compositor-drm: introduce drm_head_read_current_setup()

Rename connector_get_current_mode() because it will be useful for
storing not just the current mode on creating a head.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-drm: update video mode printing
Pekka Paalanen [Wed, 15 Nov 2017 11:37:18 +0000 (13:37 +0200)]
compositor-drm: update video mode printing

Stop using a head for printing the mode list, because there could be
multiple heads. We already gather the mode list from all heads.

No need to print the connector id here, because it is logged with DRM
heads, and core prints the head names on output enable.

The "built-in" flag seemed dead, because it could only be printed if the
kernel provided no modes. If we want more detailed info on where modes
come from, we would need to inspect mode_info or add new flags to
drm_mode or weston_mode.

Add printing the pixel clock, because that is used by the video mode
duplicate removal code.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-drm: backlight control for all heads
Pekka Paalanen [Wed, 15 Nov 2017 10:51:01 +0000 (12:51 +0200)]
compositor-drm: backlight control for all heads

If an output has multiple (cloned) heads, it should be enough for any
head to support backlight control for DRM-backend to expose it.

Inspect all attached heads for backlight control and improve the
logging.

Pick the initial backlight level from whatever happens to be the "first"
head, because it's simple.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-drm: combine mode list from heads
Pekka Paalanen [Fri, 10 Nov 2017 14:34:39 +0000 (16:34 +0200)]
compositor-drm: combine mode list from heads

A single list of modes needs to be combined from the mode lists in each
attached head. We could just concatenate the lists, but that might
introduce duplicates. Try to avoid duplicates instead by using partially
fuzzy matching.

When a duplicate is found, try to figure out which is more suitable to
use in place of both. If one has the preferred flag and the other
doesn't, take the preferred one. Otherwise use the one already in the
list.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-drm: unify head status logging
Pekka Paalanen [Thu, 9 Nov 2017 13:10:11 +0000 (15:10 +0200)]
compositor-drm: unify head status logging

Previously the log contained one line for EDID data and another line for
the head, and you just had to know they belong together. Make it more
obvious to read by putting both head and EDID info on the same line.

We no longer print EDID data every time it is parsed (on every hotplug
event), but only if it changes. I did take a shortcut here and use
weston_head::device_changed as the print condition which relies on the
compositor clearing it, but a failure to do so just means we print stuff
even if it didn't change.

Head info updates also print the head info and not just the EDID data.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-drm: drm_set_backlight heads
Pekka Paalanen [Tue, 12 Sep 2017 13:14:31 +0000 (16:14 +0300)]
compositor-drm: drm_set_backlight heads

Fix this function to support more than one head per output.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-drm: drm_output_apply_state_atomic heads
Pekka Paalanen [Tue, 12 Sep 2017 13:07:32 +0000 (16:07 +0300)]
compositor-drm: drm_output_apply_state_atomic heads

Fix this function to support more than one head per output.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-drm: drm_output_apply_state_legacy heads
Pekka Paalanen [Tue, 12 Sep 2017 13:02:01 +0000 (16:02 +0300)]
compositor-drm: drm_output_apply_state_legacy heads

Fix this function to support more than one head per output.

v9:
- Change { connectors, 0 } to { NULL, 0 } in drmModeSetCrtc() args.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-drm: remove unused_connectors array
Pekka Paalanen [Tue, 12 Sep 2017 10:43:51 +0000 (13:43 +0300)]
compositor-drm: remove unused_connectors array

Replace the unused_connectors array by iterating through the head list
instead. A head that is not enabled (attached to an enabled output) is
basically an unused connector.

All connectors regardless of their status have a drm_head. This has the
nice effect that drm_pending_state_apply_atomic() does not need to
re-query the connector properties every time, they can be simply looked
up in the drm_head.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-drm: create heads for all connectors
Pekka Paalanen [Fri, 8 Sep 2017 12:48:07 +0000 (15:48 +0300)]
compositor-drm: create heads for all connectors

In previous patches, all the appropriate fields from drm_output have
been moved into drm_head, and resource allocation has been moved away
from drm_output creation. It is time to throw the switch: this patch
disconnects the drm_output and drm_head lifetimes.

Previously a drm_output was created for a connected connector and
destroyed on disconnection. A drm_head was tied to the drm_output
lifetime just to accommodate the head-based output configuration API
temporarily.

Now all connectors will get a head created regardless of their
connection status. Heads are created and destroyed as connectors appear
and disappear (MST), not when they get connected or disconnected. This
should allow the compositor to force-enable a disconnected connector.

An "empty" drm_output is created with weston_backend::create_output()
hook. This now follows the intent of the head-based output configuration
API.

On hotplug events, all connectors' information is updated regardless of
their connection status changes. It is theoretically possible for a
monitor to change without going through a disconnected state in between.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-drm: move mode list to set_mode()
Pekka Paalanen [Mon, 11 Sep 2017 12:01:12 +0000 (15:01 +0300)]
compositor-drm: move mode list to set_mode()

Move the initialization of the drm_output mode list to
drm_output_set_mode() time.

Once we stop creating the drm_head with the drm_output, there will not
be a head to get the mode list from at drm_output creation time.

Furthermore, once DRM-backend starts supporting more than one head per
output, the combined mode list to be exposed to clients (and the
compositor?) must be constructed with all heads attached.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-drm: get current mode on head discovery
Pekka Paalanen [Mon, 11 Sep 2017 11:06:11 +0000 (14:06 +0300)]
compositor-drm: get current mode on head discovery

The inherited mode is the video mode on the connector when we have not
yet reconfigured the connector, if set.

Get the inherited mode the moment we create a drm_head, not when we
determine the mode for a drm_output. This way we are sure to read all
inherited modes before we reconfigure a single CRTC. Enabling one output
may grab the CRTC from another connector, overwriting whatever mode that
connector might have had.

The inherited mode is stored in drm_head, where we can keep it for the
lifetime of the head, rather than relying on re-loading it from the
kernel at set_mode() time.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-drm: simplify drm_output_find_special_plane()
Pekka Paalanen [Fri, 27 Oct 2017 11:06:51 +0000 (14:06 +0300)]
compositor-drm: simplify drm_output_find_special_plane()

As these planes are allocated on output enable and freed on output
disable, there cannot be a match in the pending_output_list.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-drm: simplify drm_output_find_by_crtc()
Pekka Paalanen [Fri, 27 Oct 2017 10:52:12 +0000 (13:52 +0300)]
compositor-drm: simplify drm_output_find_by_crtc()

As CRTC is allocated on output enable and deallocated on output disable,
there cannot be any matches in find-by-crtc from the
pending_output_list.

Remove the loop over pending_output_list as never finding anything by
definition.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-drm: allocate CRTC on enable()
Pekka Paalanen [Fri, 8 Sep 2017 10:32:40 +0000 (13:32 +0300)]
compositor-drm: allocate CRTC on enable()

A drm_output needs a CRTC only when it is in use. Allocating a CRTC on
creation of drm_output will reserve the CRTC regardless of whether the
output is actually used or not. This may cause creating other
drm_outputs to fail if there are not enough CRTCs.

Instead, allocate the CRTC on drm_output enable() time. A drm_output
will have a valid CRTC only while it is enabled.

This allows us to create drm_output objects arbitrarily and without a
head assignment, which is required by the head-based output API for the
backends. The assigned heads will be known only at enable() time.

Now drm_output_enable() has to call drmModeGetResources() to be able to
find a suitable CRTC. We might want to cache the resources somewhere,
but that is it topic for another patch.

v4: Force resetting unused CRTCs on fini.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-drm: move connector fields into drm_head
Pekka Paalanen [Thu, 31 Aug 2017 13:18:48 +0000 (16:18 +0300)]
compositor-drm: move connector fields into drm_head

Move the connector related fields from drm_output to the drm_head. A
drm_head represents a connector for now.

The code in drm_head_create() to update connector data, monitor
information, etc. is moved into a new function. This will be useful when
DRM-backend starts creating heads for all connectors regardless of their
connection status and will need to update them on hotplug events.

While incurring the churn to move several fields into struct drm_head,
also refactor out drm_head_assign_connector_info(). This function is
needed later when drm_heads will exist regardless of connected status,
as every hotplug event will need to update the state of all connectors.
At that point we will also start handling connector changes that do not
go through an intermediate disconnected state. This refactoring is
trivial enough to be in this patch to reduce the total amount of changes
to be reviewed.

v6:
- adapt to the new places of updating unused_connectors
- free connector in create_output_for_connector() error path

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-drm: move backlight into drm_head
Pekka Paalanen [Mon, 4 Sep 2017 09:21:24 +0000 (12:21 +0300)]
compositor-drm: move backlight into drm_head

Backlight is driven per connector, hence it belongs in struct drm_head.

weston_output::set_backlight() API is remains per output so far. There
is no UI to control backlights per head and adding one would be
difficult for an output that has multiple cloned heads.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-drm: find disconnects from head_list
Pekka Paalanen [Thu, 31 Aug 2017 12:41:57 +0000 (15:41 +0300)]
compositor-drm: find disconnects from head_list

Instead of iterating output_list and pending_output_list, iterate
head_list to find outputs whose connectors have been disconnected.

This helps a following patch to move connector fields from drm_output to
drm_head.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-drm: use head_find_by_connector in update_unused_outputs
Pekka Paalanen [Tue, 13 Feb 2018 13:02:44 +0000 (15:02 +0200)]
compositor-drm: use head_find_by_connector in update_unused_outputs

Making this function not depend on drm_head::output field through
drm_output_find_by_connector() will later allow to remove the
drm_head::output field before removing the unused_connectors array. This
helps keeping the commit more fine-grained.

drm_backend_update_unused_outputs() was only interested in enabled
outputs. The new code is 100% equivalent to the old code. The
difference is that weston_head::output is only set for attached heads. A
connector cannot be in use if it is not attached to an output.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-drm: drm_output_find_by_connector from head_list
Pekka Paalanen [Thu, 31 Aug 2017 08:58:41 +0000 (11:58 +0300)]
compositor-drm: drm_output_find_by_connector from head_list

Switch drm_output_find_by_connector() to search for the output by
iterating the compositor's head_list. drm_head_find_by_connector() will
be useful later on its own.

As of "compositor-drm: start migration to head-based output API" the
head list is guaranteed to contain all created drm_outputs through the
automatically created drm_head.

This simplifies the code a little, introduces
drm_head_find_by_connector(), and works towards the eventual removal of
drm_output_find_by_connector().

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agolibweston: log head detach on enabled output
Pekka Paalanen [Fri, 8 Dec 2017 14:11:17 +0000 (16:11 +0200)]
libweston: log head detach on enabled output

Helps debugging.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agolibweston: allow attaching heads to enabled outputs
Pekka Paalanen [Fri, 8 Dec 2017 12:13:34 +0000 (14:13 +0200)]
libweston: allow attaching heads to enabled outputs

Move the responsibility of ensuring the head will work in the enabled
output to the backends.

A compositor cannot enable an output without heads, and removing the
last head from an output automatically disables the output, so attaching
a new head to an enabled output is only possible for clone mode.

Backends headless, rdp, and x11 forbid clone mode by not having an
attach_head hook implemented; fbdev and wayland explicitly deny clone
mode. Only the DRM backend is affected by this change and even that not
yet because MAX_CLONED_CONNECTORS is 1 in the DRM backend.

Also ensure a global is created for the head when attached to an enabled
output, and log it.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agolibweston: support user data on weston_output
Pekka Paalanen [Tue, 7 Nov 2017 08:15:01 +0000 (10:15 +0200)]
libweston: support user data on weston_output

Support attaching custom data to a weston_output by the traditional
destroy listener / wl_signal_get approach.

Needs a new destroy signal, because user data lifetime should be the
lifetime of the weston_output regradless of its enabled status. The old
destroy signal is for output consumers that only care about enabled
outputs in the system and gets emitted on disable, not on destroy.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agolibweston: create/find output by name
Pekka Paalanen [Thu, 2 Nov 2017 12:11:53 +0000 (14:11 +0200)]
libweston: create/find output by name

To let users pick an arbitrary name for an output, to be used as e.g. a
configuration key, add API to create an output with a given name. For
the same configuration purpose, add a search function as well.

For the search function to be predictable, forbid creating multiple
outputs with the same name. Previously, creating multiple outputs with
the same name would have needed detatching to create outputs from the
same head, now that is forbidden.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agolibweston: print head names on output enable
Pekka Paalanen [Thu, 2 Nov 2017 12:03:11 +0000 (14:03 +0200)]
libweston: print head names on output enable

This will be interesting to see when testing clone mode.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agolibweston: remove weston_output::head
Pekka Paalanen [Fri, 27 Oct 2017 09:07:49 +0000 (12:07 +0300)]
libweston: remove weston_output::head

Remove the scaffolding that allowed backends to be converted one by one
to the head-based API. Nothing is using these members anymore.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-drm: start migration to head-based output API
Pekka Paalanen [Mon, 28 Aug 2017 13:27:20 +0000 (16:27 +0300)]
compositor-drm: start migration to head-based output API

Hook up the libweston facing head-based output API by introducing struct
drm_head, but leave it as a fake so that members can be migrated in
pieces in follow-up patches.

The DRM backend continues to create an output for each connected
connector only, and during output creation it also creates a drm_head
for it. This allows it to pretend it supports the head-based output API
as long as there is only one head per output ever attached.

create_output callback is fake, it will only look up the existing
drm_output by the head name.

Clones are not yet supported, hence max is defined to 1.

This unfortunately introduces some temporary code that will be revomed
later, but seems to be necessary to avoid a single big patch.

v6:
- add missing drm_head_destroy() call

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-wayland: migrate to head-based output API
Pekka Paalanen [Wed, 25 Oct 2017 12:51:37 +0000 (15:51 +0300)]
compositor-wayland: migrate to head-based output API

Follow the standard pattern used in the headless and x11 backend
migration, but also cater for the two other backend modes: --sprawl or
fullscreen-shell, and --fullscreen.

Stops relying on the implicit weston_output::head.

Unlike other backends, this uses the attach_head hook to do the
required head setup that is not possible to do without an output, but
must be done before weston_output_enable(). This also requires the
detach_head hook for the one case where the user attaches a --fullscreen
head and then detaches it without enabling the output.

It is a little awkward to fully initialize heads as late as attach, but
aside from the --sprawl/fullscreen-shell case, there is not really a way
to know the head properties without creating the parent wl_surface and
configuring it.

Heads/outputs created for parent outputs now have distinct names instead
of all being called "wlparent".

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-wayland: strict surface create/destroy
Pekka Paalanen [Thu, 26 Oct 2017 09:56:00 +0000 (12:56 +0300)]
compositor-wayland: strict surface create/destroy

Add safeguards to make it painfully obvious if we ever get the pairing
of wayland_backend_create_output_surface() and
wayland_backend_destroy_output_surface() wrong. Helps catching bugs.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-x11: migrate to head-based output API
Pekka Paalanen [Thu, 12 Oct 2017 12:58:10 +0000 (15:58 +0300)]
compositor-x11: migrate to head-based output API

Follow the standard pattern set by the headless backend which also uses
the the window output API.

Stops relying on the implicit weston_output::head.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-fbdev: migrate to head-based output API
Pekka Paalanen [Thu, 14 Sep 2017 13:50:44 +0000 (16:50 +0300)]
compositor-fbdev: migrate to head-based output API

Implement the head-based output API in this backend, and stop relying on
the implicit weston_output::head.

The split between fbdev_head and fbdev_output is somewhat arbitrary.
There is no hotplug or unplug, and there is always 1:1 relationship.
Struct fbdev_screeninfo could have been split as well, but it would not
have made much difference.

I chose fbdev_output to carry the mmap details (buffer_length is now
duplicated here), and fbdev_head to carry the display parameters and
device node path. The device node identifies the head, similar to a
connector.

The backend init creates a head. The compositor uses it to create an
output. Libweston core attaches the head automatically after creating
the output. The attach hook is a suitable place to set up the video
modes on the output as they are dictated by the head, it would be too
late at enable() time.

v7:
- use name argument instead of hardcoded "fbdev" in
  fbdev_output_create()

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-fbdev: make re-enable less drastic
Pekka Paalanen [Wed, 13 Sep 2017 13:19:02 +0000 (16:19 +0300)]
compositor-fbdev: make re-enable less drastic

Destroying the whole output in reenable would cause list walk
corruption: the loop over output_list in session_notify() is not using
wl_list_for_each_safe so output removal would break it.

Creating a new output is also problematic as it needs the compositor to
configure it, but that probably saved us from another list walk failure:
adding the new output to be list while walking the list, possibly
causing it to be destroyed and re-created ad infinitum.

Instead of a complete destroy/create cycle, just do our internal
disable/enable cycle. That will re-open the fbdev, re-read the
parameters, re-create hw_surface, and reinitialize the renderer output.

A problem with this is if fbdev_set_screen_info() fails. We do read the
new parameters, but we don't communicate them to libweston core or old
clients.

However, it is hard to care: to trigger this path, one needs to
VT-switch to another fbdev app which changes the fbdev parameters. That
is quite difficult as VT-switching has been broken for a good while for
fbdev-backend, at least with logind. Also fbdev_set_screen_info() would
have to fail before one should be able to tell something is wrong.

The real reason behind this patch, though, is the migration to the
head-based output API. Destroying and re-creating an output really does
not fit that design. Destroying and re-creating a head would be better,
but again not testable in the current state.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-rdp: migrate to head-based output API
Pekka Paalanen [Thu, 12 Oct 2017 13:21:26 +0000 (16:21 +0300)]
compositor-rdp: migrate to head-based output API

Follow the starndard patttern as the other backends, headless and x11 in
particular, to stop relying on the implicit weston_output::head.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agocompositor-headless: migrate to head-based output API
Pekka Paalanen [Thu, 24 Aug 2017 13:40:17 +0000 (16:40 +0300)]
compositor-headless: migrate to head-based output API

Implement the head-based output API in this backend, and stop relying on
the implicit weston_output::head.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agolibweston: cancel idle_repaint on output destroy
Pekka Paalanen [Thu, 26 Oct 2017 11:33:59 +0000 (14:33 +0300)]
libweston: cancel idle_repaint on output destroy

If the idle_repaint() callback has been scheduled when a weston_output
gets destroyed, the callback will hit use-after-free. I have encountered
this when migrating the wayland backend to the head-based API, using
--sprawl, and closing/disconnecting one of the parent compositor
outputs.

Store the idle_repaint callback source, and destroy it in
weston_output_release(), ensuring we don't get a stale call to
start_repaint_loop later.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agolibweston: assert current_mode in weston_output_enable()
Pekka Paalanen [Thu, 14 Sep 2017 13:17:59 +0000 (16:17 +0300)]
libweston: assert current_mode in weston_output_enable()

The functions called here, particularly
weston_output_transform_scale_init(), rely on current mode being set.
The current mode must also be found in the mode list, though we don't
explicitly check it here.

current_mode not being set is a programmer error. It could be a backend
bug, but it could also be a libweston user bug not calling a set size
function.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agolibweston: assert make/model in weston_output_enable()
Pekka Paalanen [Thu, 24 Aug 2017 13:08:49 +0000 (16:08 +0300)]
libweston: assert make/model in weston_output_enable()

Output make and model are not allowed to be NULL in the protocol, so
ensure they are not forgotten when enabling an output.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agolibweston: stop auto-adding the implicit head
Pekka Paalanen [Wed, 23 Aug 2017 13:00:21 +0000 (16:00 +0300)]
libweston: stop auto-adding the implicit head

All frontends have been converted to the new head-based output
management API, which means that
weston_compositor_create_output_with_head() is calling
weston_output_attach_head(). We will never hit the implicit attach
anymore.

Therefore we can now require that an output has at least one head when
calling weston_output_enable(). An output without heads is useless.

The auto-add code is removed as dead.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agolibweston: remove output_pending_signal
Pekka Paalanen [Thu, 17 Aug 2017 14:29:36 +0000 (17:29 +0300)]
libweston: remove output_pending_signal

The signal has been replaced with the heads_changed hook and is no
longer useful.

weston_pending_output_coldplug() is renamed to
weston_compositor_flush_heads_changed() for two reasons: it better
describes what it does now, and it serves as an obvious flag that
libweston ABI has been broken.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agolibweston: change windowed_output_api output_create to create_head
Pekka Paalanen [Thu, 12 Oct 2017 12:03:42 +0000 (15:03 +0300)]
libweston: change windowed_output_api output_create to create_head

Rename the function pointer to create_head() because that is what it
does on backends that are converted to the head-based API. Update the
documentation to match.

Surprisingly this is not an ABI break, as the function behaviour and
signature remain intact. Hence API_NAME is not bumped.

This is only an API break, and main.c is fixed accordingly.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agoweston: migrate DRM to head-based output API
Pekka Paalanen [Thu, 17 Aug 2017 14:13:08 +0000 (17:13 +0300)]
weston: migrate DRM to head-based output API

Migrate the DRM frontend to use the simple head-based output
configurator, maintaining the exact same features and semantics as
before.

This is an intermediate step. It is unoptimal to create a weston_output
just to turn it off, but the libweston implementation and the DRM
backend require it for now. In the future, the DRM frontend will get its
own configurator that does not create useless weston_outputs and
supports clone mode by attaching multiple heads to the same
weston_output. Clone mode is not yet supported by libweston/DRM.

Until we remove the need to create a weston_output just to turn it
"off", that is, disable it, we will hit simple_head_enable() for heads
we have already disabled. As long as the DRM-backend conversion to the
head-based API is not complete, attempting to create an output for a
head again would lead to a crash. This problem does not exist right now,
but it will after the patch "compositor-drm: start migration to
head-based output API". Therefore, check if the head we are about to
process is already attached, and do nothing if so. DRM outputs set to
"off" are the only ones legitimately hitting this condition.

This is the last frontend migrated, wet_set_pending_output_handler() is
deleted as dead code.

v9:
- Add the workaround in simple_head_enable().

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v6 Reviewed-by: Ian Ray <ian.ray@ge.com>
v7 Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agoweston: migrate RDP to head-based output API
Pekka Paalanen [Thu, 17 Aug 2017 14:09:01 +0000 (17:09 +0300)]
weston: migrate RDP to head-based output API

Migrate the RDP frontend to use the new head-based output configuration
API: listen for heads_changed, and process all heads.

v7:
- remove unnecessary 'goto out' in load_rdp_backend()

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agoweston: migrate fbdev to head-based output API
Pekka Paalanen [Thu, 17 Aug 2017 14:05:29 +0000 (17:05 +0300)]
weston: migrate fbdev to head-based output API

Migrate the fbdev frontend to use the new head-based output
configuration API: listen for heads_changed, and process all heads.

v7:
- remove unnecessary 'goto out' in load_fbdev_backend()

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agoweston: migrate wayland to head-based output API
Pekka Paalanen [Thu, 17 Aug 2017 13:59:53 +0000 (16:59 +0300)]
weston: migrate wayland to head-based output API

Migrate the Wayland frontend to use the new head-based output
configuration API: listen for heads_changed, and process all heads.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agoweston: migrate x11 to head-based output API
Pekka Paalanen [Thu, 17 Aug 2017 13:54:58 +0000 (16:54 +0300)]
weston: migrate x11 to head-based output API

Migrate the x11 frontend to use the new head-based output configuration
API: listen for heads_changed, and process all heads.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agoweston: migrate headless to head-based output API
Pekka Paalanen [Thu, 17 Aug 2017 10:10:28 +0000 (13:10 +0300)]
weston: migrate headless to head-based output API

Migrate the headless frontend to use the new head-based output
configuration API: listen for heads_changed, and process all heads.

The simple_heads_changed() function is written to be able to cater for
all backends. The rest will be migrated individually.

The head destroy listeners are not exactly necessary, for headless
anyway, but this is an example excercising the API. Also
is_device_changed() check is mostly useful with DRM.

v8:
- replace weston_compositor_set_heads_changed_cb() with
  weston_compositor_add_heads_changed_listener()
- fix comment on wet_head_tracker_create()

v3: Print "Detected a monitor change" only for enabled heads.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v6 Reviewed-by: Ian Ray <ian.ray@ge.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
6 years agoweston: move weston_output_enable() into callers
Pekka Paalanen [Thu, 17 Aug 2017 13:39:48 +0000 (16:39 +0300)]
weston: move weston_output_enable() into callers

Move the call out of wet_configure_windowed_output_from_config() and
into its callers.

This allows to migrate each frontend one by one.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>