Re: [PATCH weston v5 00/36] Head-based output configuration API a.k.a clone mode infrastructure

2017-12-20 Thread Alex Deucher
On Mon, Dec 18, 2017 at 2:38 AM, Pekka Paalanen wrote: > On Fri, 15 Dec 2017 15:35:53 -0500 > Alex Deucher wrote: > >> On Fri, Dec 15, 2017 at 2:27 AM, Pekka Paalanen wrote: >> > On Thu, 14 Dec 2017 10:11:32 -0500 >> > Alex Deucher wrote: >> > >> >> On Thu, Dec 14, 2017 at 6:40 AM, Pekka Paalan

Re: [PATCH weston v3 00/17] Tablet device support for weston

2017-12-20 Thread Jason Gerecke
On Tue, Dec 19, 2017 at 12:33 AM, Maniraj Devadoss wrote: > Hi Jason, > > I found the root cause for the backtrace you shared > https://lists.freedesktop.org/archives/wayland-devel/2017-November/035964.html > > The issue is that the tablet tool's surface and view is not > set as mapped in tablet_t

Re: [PATCH wayland-protocols v2] unstable: Add input-timestamps protocol

2017-12-20 Thread Alexandros Frantzis
On Tue, Dec 19, 2017 at 01:06:11PM +0200, Alexandros Frantzis wrote: > On Tue, Dec 19, 2017 at 10:15:06AM +0200, Pekka Paalanen wrote: > > On Mon, 18 Dec 2017 14:55:00 +0200 > > Alexandros Frantzis wrote: > > > > > wl_pointer, wl_keyboard and wl_touch events currently use a 32-bit > > > timestamp

[PATCH weston 4/6] libweston: Implement keyboard timestamps for input_timestamps_unstable_v1

2017-12-20 Thread Alexandros Frantzis
Implement the zwp_input_timestamps_v1.get_keyboard_timestamps request to subscribe to timestamp events for wl_keyboard resources. Signed-off-by: Alexandros Frantzis --- libweston/compositor.h | 2 ++ libweston/input.c | 38 +++--- tests/keyboard-test.c | 45

[PATCH weston 6/6] libweston: Implement touch timestamps for input_timestamps_unstable_v1

2017-12-20 Thread Alexandros Frantzis
Implement the zwp_input_timestamps_v1.get_touch_timestamps request to subscribe to timestamp events for wl_touch resources. Signed-off-by: Alexandros Frantzis --- libweston/compositor.h | 2 ++ libweston/input.c | 53 +++--- tests/touch-test.c

[PATCH weston 2/6] tests: Introduce input timestamps helper

2017-12-20 Thread Alexandros Frantzis
Introduce helper test code to implement the client side of the input_timestamps_unstable_v1 protocol. This helper will be used in upcoming commits to test the server side implementation of the protocol in libweston. Signed-off-by: Alexandros Frantzis --- Makefile.am | 16 +

[PATCH weston 1/6] shared: Add timespec_eq helper function

2017-12-20 Thread Alexandros Frantzis
Add a helper function to check if two struct timespec values are equal. This helper function will be used in upcoming commits that implement the input_timestamps_unstable_v1 protocol. Signed-off-by: Alexandros Frantzis --- shared/timespec-util.h | 13 + tests/timespec-test.c | 12 ++

[PATCH weston 5/6] libweston: Implement pointer timestamps for input_timestamps_unstable_v1

2017-12-20 Thread Alexandros Frantzis
Implement the zwp_input_timestamps_v1.get_pointer_timestamps request to subscribe to timestamp events for wl_pointer resources. Signed-off-by: Alexandros Frantzis --- libweston/compositor.h | 2 ++ libweston/input.c | 50 +- tests/pointer-test.c | 66 +

[PATCH weston 3/6] libweston: Introduce input-timestamps support code

2017-12-20 Thread Alexandros Frantzis
Introduce code to support the implementation of the input_timestamps_unstable_v1 protocol in libweston. This commit does not implement the actual timestamp subscriptions, but lays the foundation so timestamp subscriptions for keyboard/pointer/touch can be added cleanly in upcoming commits. Signed-

[PATCH weston 0/6] libweston: Support input_timestamps_unstable_v1

2017-12-20 Thread Alexandros Frantzis
The input_timestamps_unstable_v1 protocol allows clients to subscribe to high-resolution timestamp events for input events (see [1]). This patchset implements the input_timestamps_unstable_v1 protocol in libweston and also adds tests for the implementation in the weston test suite. Note that, as e

Re: [PATCH v14 00/41] Atomic modesetting

2017-12-20 Thread Daniel Stone
Hi, On 20 December 2017 at 12:26, Daniel Stone wrote: > Please find attached another iteration of the atomic series. This round > has mostly seen cleanups and correctness fixes through 03-11. In the festive rush, I forgot to mention that it can also be found here: https://gitlab.collabora.com/da

[PATCH v14 20/41] compositor-drm: Fully account for buffer transformation

2017-12-20 Thread Daniel Stone
In our new and improved helper to determine the src/dest values for a buffer on a given plane, make sure we account for all buffer transformations, including viewport clipping. Rather than badly open-coding it ourselves, just use the helper which does exactly this. Signed-off-by: Daniel Stone Re

[PATCH v14 28/41] compositor-drm: Support modifiers for drm_fb

2017-12-20 Thread Daniel Stone
Use the new drmModeAddFB2WithModifiers interface to import buffers with modifiers. Signed-off-by: Daniel Stone --- configure.ac | 3 +++ libweston/compositor-drm.c | 26 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/configure.ac b/config

[PATCH v14 23/41] compositor-drm: Use plane_coords_for_view for cursor

2017-12-20 Thread Daniel Stone
Use the new helper to populate the cursor state as well, with some special-case handling to account for how we always upload a full-size BO. Signed-off-by: Daniel Stone Reported-by: Derek Foreman --- libweston/compositor-drm.c | 48 +++--- 1 file changed,

[PATCH v14 38/41] compositor-drm: Relax plane restrictions for atomic

2017-12-20 Thread Daniel Stone
Since we now incrementally test atomic state as we build it, we can loosen restrictions on what we can do with planes, and let the kernel tell us whether or not it's OK. Signed-off-by: Daniel Stone --- libweston/compositor-drm.c | 18 +- 1 file changed, 9 insertions(+), 9 deletio

[PATCH v14 30/41] compositor-drm: Don't need safe view-list traversal

2017-12-20 Thread Daniel Stone
Nothing in this loop reorders views within the compositor's view_list. Signed-off-by: Daniel Stone --- libweston/compositor-drm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c index b030234e4..19aeb5326 100644 ---

[PATCH v14 35/41] compositor-drm: Add modes to drm_output_propose_state

2017-12-20 Thread Daniel Stone
Add support for multiple modes: toggling whether or not the renderer and/or planes are acceptable. This will be used to implement a smarter plane-placement heuristic when we have support for testing output states. Signed-off-by: Daniel Stone --- libweston/compositor-drm.c | 39 ++

[PATCH v14 10/41] compositor-drm: Disable unused CRTCs/connectors

2017-12-20 Thread Daniel Stone
If we have an unused CRTC or connector, explicitly disable it during the end of the repaint cycle, or when we get VT-switched back in. This commit moves state_invalid from an output property to a backend property, as the unused CRTCs or connectors are likely not tracked by drm_outputs. This matche

[PATCH v14 26/41] compositor-drm: Remove no_addfb2 handling

2017-12-20 Thread Daniel Stone
If AddFB2 ever fails for any reason, we fall back to legacy AddFB, which doesn't support the same swathe of formats, or multi-planar formats, or modifiers. This can happen with arbitrary client buffers, condemning us to the fallback forever more. Remove this, at the cost of an unnecessary ioctl fo

[PATCH v14 34/41] compositor-drm: Ignore occluded views

2017-12-20 Thread Daniel Stone
When trying to assign planes, keep track of the areas which are already occluded, and ignore views which are completely occluded. This allows us to build a state using planes only, when there are occluded views which cannot go into a plane behind views which can. Signed-off-by: Daniel Stone ---

[PATCH v14 31/41] compositor-drm: Rename region variable

2017-12-20 Thread Daniel Stone
Make it a bit more clear what the purpose of the variable is. Signed-off-by: Daniel Stone --- libweston/compositor-drm.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c index 19aeb5326..3ff06c01c 100644 --- a

[PATCH v14 29/41] compositor-drm: Add modifiers to GBM dmabuf import

2017-12-20 Thread Daniel Stone
Add support for the GBM_BO_IMPORT_FD_MODIFIER path, which allows us to import multi-plane dmabufs, as well as format modifiers. Signed-off-by: Daniel Stone --- configure.ac | 6 +- libweston/compositor-drm.c | 181 + 2 files changed, 13

[PATCH v14 24/41] compositor-drm: Extract overlay FB import to helper

2017-12-20 Thread Daniel Stone
... in order to be able to use it from scanout as well. Signed-off-by: Daniel Stone --- libweston/compositor-drm.c | 221 - 1 file changed, 119 insertions(+), 102 deletions(-) diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c index

[PATCH v14 19/41] compositor-drm: Extract buffer->plane co-ord translation

2017-12-20 Thread Daniel Stone
Pull this into a helper function, so we can use it everywhere. Signed-off-by: Daniel Stone --- libweston/compositor-drm.c | 157 + 1 file changed, 88 insertions(+), 69 deletions(-) diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c i

[PATCH v14 11/41] compositor-drm: Move repaint state application to flush

2017-12-20 Thread Daniel Stone
Split repaint into two stages, as implied by the grouped-repaint interface: drm_output_repaint generates the repaint state only, and drm_repaint_flush applies it. This also moves DPMS into output state. Previously, the usual way to DPMS off was that repaint would be called and apply its state, fol

[PATCH v14 33/41] compositor-drm: Ignore views on other outputs

2017-12-20 Thread Daniel Stone
When we come to assign_planes, try very hard to ignore views which are only visible on other outputs, rather than forcibly moving them to the primary plane, which causes damage all round and unnecessary repaints. Signed-off-by: Daniel Stone --- libweston/compositor-drm.c | 23 +++

[PATCH v14 22/41] compositor-drm: Use plane_state_coords_for_view for scanout

2017-12-20 Thread Daniel Stone
Use the shiny new helper we have for working through scanout as well. Signed-off-by: Daniel Stone --- libweston/compositor-drm.c | 81 ++ 1 file changed, 25 insertions(+), 56 deletions(-) diff --git a/libweston/compositor-drm.c b/libweston/compositor-

[PATCH v14 40/41] compositor-drm: Support plane IN_FORMATS

2017-12-20 Thread Daniel Stone
From: Sergi Granell The per-plane IN_FORMATS property adds information about format modifiers; we can use these to both feed GBM with the set of modifiers we want to use for rendering, and also as an early-out test when we're trying to see if a FB will go on a particular plane. Signed-off-by: Se

[PATCH v14 06/41] compositor-drm: Use drm_plane for scanout plane

2017-12-20 Thread Daniel Stone
Use a real drm_plane to back the scanout plane, displacing output->fb_{last,cur,pending} to their plane-tracked equivalents. Signed-off-by: Daniel Stone --- libweston/compositor-drm.c | 222 ++--- 1 file changed, 149 insertions(+), 73 deletions(-) diff --

[PATCH v14 09/41] compositor-drm: Track unused connectors and CRTCs

2017-12-20 Thread Daniel Stone
Rather than a more piecemeal approach at backend creation, explicitly track connectors and CRTCs we do not intend to use, so we can ensure they are disabled where appropriate. Signed-off-by: Daniel Stone --- libweston/compositor-drm.c | 86 ++ 1 file c

[PATCH v14 36/41] compositor-drm: Return plane state from plane preparation

2017-12-20 Thread Daniel Stone
Return a pointer to the plane state, rather than indirecting via a weston_plane. Signed-off-by: Daniel Stone --- libweston/compositor-drm.c | 68 ++ 1 file changed, 38 insertions(+), 30 deletions(-) diff --git a/libweston/compositor-drm.c b/libweston/

[PATCH v14 32/41] compositor-drm: Split drm_assign_planes in two

2017-12-20 Thread Daniel Stone
Move drm_assign_planes into two functions: one which proposes a plane configuration, and another which applies that state to the Weston internal structures. This will be used to try multiple configurations and see which is supported. Signed-off-by: Daniel Stone --- libweston/compositor-drm.c | 1

[PATCH v14 17/41] compositor-drm: Atomic modesetting support

2017-12-20 Thread Daniel Stone
Add support for using the atomic-modesetting API to apply output state. Unlike previous series, this commit does not unflip sprites_are_broken, until further work has been done with assign_planes to make it reliable. Signed-off-by: Daniel Stone Co-authored-by: Pekka Paalanen Co-authored-by: Loui

[PATCH v14 41/41] compositor-drm: Support modifiers with GBM

2017-12-20 Thread Daniel Stone
Use the extended GBM allocator interface to support modifiers and multi-planar BOs. Signed-off-by: Daniel Stone --- configure.ac | 3 +++ libweston/compositor-drm.c | 57 ++ 2 files changed, 51 insertions(+), 9 deletions(-) diff --git a

[PATCH v14 08/41] compositor-drm: Don't repaint if no damage

2017-12-20 Thread Daniel Stone
If we don't have any damage for the primary plane, then don't force a repaint; simply reuse the old buffer we already have. Signed-off-by: Daniel Stone Reviewed-by: Pekka Paalanen --- libweston/compositor-drm.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a

[PATCH v14 25/41] compositor-drm: Use plane FB-import helper for scanout

2017-12-20 Thread Daniel Stone
Use the same codepath, which has the added advantage of being able to import dmabufs. Signed-off-by: Daniel Stone --- libweston/compositor-drm.c | 48 +- 1 file changed, 9 insertions(+), 39 deletions(-) diff --git a/libweston/compositor-drm.c b/libwes

[PATCH v14 04/41] compositor-drm: Introduce drm_plane_is_available

2017-12-20 Thread Daniel Stone
Helper for the pattern of checking whether or not a plane can be used on an output during the current repaint cycle. Signed-off-by: Daniel Stone --- libweston/compositor-drm.c | 27 +++ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/libweston/compositor-dr

[PATCH v14 12/41] compositor-drm: Use apply_state for starting repaint

2017-12-20 Thread Daniel Stone
Rather than open-coding it ourselves, use the new apply_state helper in drm_output_start_repaint. Signed-off-by: Daniel Stone Reported-by: Fabien DESSENNE Reviewed-by: Pekka Paalanen --- libweston/compositor-drm.c | 36 ++-- 1 file changed, 6 insertions(+), 30 d

[PATCH v14 39/41] compositor-drm: Enable planes for atomic

2017-12-20 Thread Daniel Stone
Now that we can sensibly test proposed plane configurations with atomic, sprites are not broken. Signed-off-by: Daniel Stone --- libweston/compositor-drm.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/libweston/compositor-drm.c b/libweston/composit

[PATCH v14 05/41] compositor-drm: Use drm_plane for cursor plane

2017-12-20 Thread Daniel Stone
Change the type of cursor_plane from a weston_plane (base tracking structure) to a drm_plane (wrapper containing additional DRM-specific details), and make it a dynamically-allocated pointer. Using the standard drm_plane allows us to reuse code which already deals with drm_planes, e.g. a common cl

[PATCH v14 37/41] compositor-drm: Add test-only mode to state application

2017-12-20 Thread Daniel Stone
The atomic API can allow us to test state before we apply it, to see if it will be valid. Add support for this, which we will later use in assign_planes to ensure our plane configuration is valid. Signed-off-by: Daniel Stone --- libweston/compositor-drm.c | 176 ++

[PATCH v14 13/41] compositor-drm: Don't restore original CRTC mode

2017-12-20 Thread Daniel Stone
When leaving Weston, don't attempt to restore the previous CRTC settings. The framebuffer may well have disappeared, and in every likelihood, whoever gets the KMS device afterwards will be repainting anyway. Signed-off-by: Daniel Stone Reviewed-by: Pekka Paalanen --- libweston/compositor-drm.c

[PATCH v14 27/41] compositor-drm: Extract drm_fb_addfb into a helper

2017-12-20 Thread Daniel Stone
We currently do the same thing in two places, and will soon have a third. Signed-off-by: Daniel Stone --- libweston/compositor-drm.c | 93 -- 1 file changed, 48 insertions(+), 45 deletions(-) diff --git a/libweston/compositor-drm.c b/libweston/composi

[PATCH v14 21/41] [XXX] compositor-drm: Only disallow scaling for overlay planes

2017-12-20 Thread Daniel Stone
Now we have a more comprehensive overview of the transform we're going to apply, use this to explicitly disallow scaling and rotation. XXX: This does not actually disallow rotation for square surfaces. We would have to build up a full buffer->view->output transform matrix, and then analy

[PATCH v14 15/41] compositor-drm: Add blob_id member to drm_mode

2017-12-20 Thread Daniel Stone
For atomic modesetting support, the mode is identified by a blob property ID, rather than being passed inline. Add a blob_id member to drm_mode to handle this, including refactoring mode destruction into a helper function. Signed-off-by: Daniel Stone Reviewed-by: Pekka Paalanen --- libweston/co

[PATCH v14 16/41] compositor-drm: Add to_drm_mode helper

2017-12-20 Thread Daniel Stone
Much like we already have to_drm_output and to_drm_backend. Signed-off-by: Daniel Stone Reviewed-by: Pekka Paalanen --- libweston/compositor-drm.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c index 2a5bc2d

[PATCH v14 18/41] compositor-drm: Make alpha-to-opaque handling common

2017-12-20 Thread Daniel Stone
Rather than a hardcoded ARGB -> XRGB translation inside a GBM-specific helper, just determine whether or not the view is opaque, and use the generic helpers to implement the format translation. Signed-off-by: Daniel Stone --- libweston/compositor-drm.c | 111 +

[PATCH v14 00/41] Atomic modesetting

2017-12-20 Thread Daniel Stone
Hi, Please find attached another iteration of the atomic series. This round has mostly seen cleanups and correctness fixes through 03-11. The biggest change is around output disables, which necessitated the introduction of patch 1, and now ensures a relatively complicated disable/destroy/shutdown

[PATCH v14 01/41] compositor-drm: Add shutting_down flag

2017-12-20 Thread Daniel Stone
Does what it says on the box: is true when the compositor is shutting down. Signed-off-by: Daniel Stone --- libweston/compositor-drm.c | 4 1 file changed, 4 insertions(+) diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c index 3eda70f30..6ac9626d9 100644 --- a/libweston

[PATCH v14 07/41] compositor-drm: Remove NULL checks in switch_mode

2017-12-20 Thread Daniel Stone
Calling switch_mode with no output or mode never makes any sense. Drop the NULL checks. Signed-off-by: Daniel Stone --- libweston/compositor-drm.c | 23 +-- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c

[PATCH v14 02/41] compositor-drm: Introduce drm_output_state structure

2017-12-20 Thread Daniel Stone
Currently this doesn't actually really do anything, but will be used in the future to track the state for both modeset and repaint requests. Completion of the request gives us a single request-completion path for both pageflip and vblank events. This merges the timing paths for scanout and plane-b

[PATCH v14 03/41] compositor-drm: Introduce drm_plane_state structure

2017-12-20 Thread Daniel Stone
Track dynamic plane state (CRTC, FB, position) in separate structures, rather than as part of the plane. This will make it easier to handle state management later, and much more closely tracks what the kernel does with atomic modesets. The fb_last pointer previously used in drm_plane now becomes p

[PATCH v14 14/41] compositor-drm: Discover atomic properties

2017-12-20 Thread Daniel Stone
From: Pekka Paalanen Set the atomic client cap, where it exists, and use this to discover the plane/CRTC/connector properties we require for atomic modesetting. Signed-off-by: Daniel Stone Co-authored-by: Pekka Paalanen Reviewed-by: Pekka Paalanen --- configure.ac | 3 +++ lib

Re: [PATCH weston 1/1] xwayland - input size calculation correction

2017-12-20 Thread Daniel Stone
Hi Ian and Nandor, On 20 December 2017 at 10:09, Ian Ray wrote: > The input area for an undecorated non-fullscreen window is based on the > window size itself. > > Fixes a case where mouse events in the `invisible' window margin failed > to reach the window behind. Scott sent some patches to fix

[PATCH weston 1/1] xwayland - input size calculation correction

2017-12-20 Thread Ian Ray
From: Nandor Han The input area for an undecorated non-fullscreen window is based on the window size itself. Fixes a case where mouse events in the `invisible' window margin failed to reach the window behind. Signed-off-by: Nandor Han Signed-off-by: Ian Ray --- xwayland/window-manager.c | 5