Re: [PATCH weston v5 06/36] libweston: introduce weston_output::head_list

2018-02-05 Thread Pekka Paalanen
On Fri, 2 Feb 2018 12:35:42 -0600 Derek Foreman wrote: > On 2018-02-02 02:32 AM, Pekka Paalanen wrote: > > On Thu, 1 Feb 2018 15:36:55 -0600 > > Derek Foreman wrote: > > > >> On 2017-12-14 05:40 AM, Pekka Paalanen wrote: > >>> From: Pekka

Re: [PATCH weston v5 09/36] cms-colord: find a good head

2018-02-05 Thread Pekka Paalanen
On Fri, 2 Feb 2018 13:40:49 -0600 Derek Foreman wrote: > On 2018-02-02 03:45 AM, Pekka Paalanen wrote: > > On Thu, 1 Feb 2018 22:10:33 + > > Daniel Stone wrote: > > > >> Hi, > >> > >> On 1 February 2018 at 22:00, Derek Foreman

Re: [PATCH weston v5 11/36] libweston: add weston_head::connected

2018-02-05 Thread Pekka Paalanen
On Fri, 2 Feb 2018 13:52:37 -0600 Derek Foreman wrote: > On 2017-12-14 05:40 AM, Pekka Paalanen wrote: > > From: Pekka Paalanen > > > > Heads may be disconnected or connected and the compositor needs to be > > able to know the state to

Re: [PATCH weston v5 09/36] cms-colord: find a good head

2018-02-05 Thread Daniel Stone
Hi, On 5 February 2018 at 10:26, Pekka Paalanen wrote: > On Fri, 2 Feb 2018 13:40:49 -0600 > Derek Foreman wrote: >> At this point, I think whoever the first person to need clone+cms-colord >> simultaneously is going to have to step up and do some

Re: [PATCH weston v5 13/36] libweston: add heads_changed hook

2018-02-05 Thread Pekka Paalanen
On Fri, 2 Feb 2018 14:31:59 -0600 Derek Foreman wrote: > On 2017-12-14 05:40 AM, Pekka Paalanen wrote: > > From: Pekka Paalanen > > > > Add a hook for compositors to get a callback when heads are added or > > their connection status

Re: [PATCH weston v5 16/36] libweston: add weston_head_is_device_changed() API

2018-02-05 Thread Pekka Paalanen
On Fri, 2 Feb 2018 16:25:56 -0600 Derek Foreman wrote: > On 2017-12-14 05:40 AM, Pekka Paalanen wrote: > > From: Pekka Paalanen > > > > Reacting to DRM hotplug events is racy. It is theoretically possible to > > get hotplug events for a

Re: [PATCH weston v5 14/36] libweston: new head-based output management API

2018-02-05 Thread Pekka Paalanen
On Fri, 2 Feb 2018 15:00:09 -0600 Derek Foreman wrote: > On 2017-12-14 05:40 AM, Pekka Paalanen wrote: > > From: Pekka Paalanen > > > > Introduce the API for users (compositors) to create an output from a > > head, attach and detach

Frame synchronisation

2018-02-05 Thread Andrzej Korwin-Mikke
Greetings, there is virtually no documentation on frame synchronisation on the Internet, it's mentioned on four blogs with no explanation whatsoever. How do I know when to draw? If frame callback is the only sensible way, when should I fetch it and attach a listener? What does that actually do? Do

Re: Frame synchronisation

2018-02-05 Thread Daniel Stone
Hi Andrzej, On 3 February 2018 at 20:52, Andrzej Korwin-Mikke wrote: > Greetings, there is virtually no documentation on frame synchronisation on > the Internet, it's mentioned on four blogs with no explanation whatsoever. > How do I know when to draw? If frame callback

Re: Frame synchronisation

2018-02-05 Thread Pekka Paalanen
On Sat, 3 Feb 2018 21:52:54 +0100 Andrzej Korwin-Mikke wrote: > Greetings, there is virtually no documentation on frame synchronisation on > the Internet, it's mentioned on four blogs with no explanation whatsoever. > How do I know when to draw? When you have both of:

[PATCH] shm: provide actual error on mmap failed

2018-02-05 Thread Olivier Fourdan
When an mmap() fails, a WL_SHM_ERROR_INVALID_FD is raised and the client is killed. However, there is no indication of the actual system error that caused mmap() to fail, which makes such error harder to investigate. Provide the actual error message that caused mmap() to fail. Signed-off-by:

Re: [PATCH weston v5 14/36] libweston: new head-based output management API

2018-02-05 Thread Derek Foreman
On 2018-02-05 05:23 AM, Pekka Paalanen wrote: On Fri, 2 Feb 2018 15:00:09 -0600 Derek Foreman wrote: On 2017-12-14 05:40 AM, Pekka Paalanen wrote: From: Pekka Paalanen Introduce the API for users (compositors) to create an output from

Re: [PATCH weston v5 16/36] libweston: add weston_head_is_device_changed() API

2018-02-05 Thread Derek Foreman
On 2018-02-05 05:34 AM, Pekka Paalanen wrote: On Fri, 2 Feb 2018 16:25:56 -0600 Derek Foreman wrote: On 2017-12-14 05:40 AM, Pekka Paalanen wrote: From: Pekka Paalanen Reacting to DRM hotplug events is racy. It is theoretically

[PATCH libinput] tablet: don't set rotation on a tool if we don't have ABS_Z

2018-02-05 Thread Peter Hutterer
Rotation on a tool can either ABS_Z or in the case of the mouse/lens tools a combination of ABS_TILT_X/Y. The code assumes that if the rotation on a stylus (not mouse/lense) changes, we need to fetch it from ABS_Z. This happens on the very first event from the tablet, proximity in invalidates all

[PATCH v15 23/34] compositor-drm: Rename region variable

2018-02-05 Thread Daniel Stone
Make it a bit more clear what the purpose of the variable is. Signed-off-by: Daniel Stone Reviewed-by: Pekka Paalanen --- libweston/compositor-drm.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git

[PATCH v15 34/34] drm debug

2018-02-05 Thread Daniel Stone
Signed-off-by: Daniel Stone --- libweston/compositor-drm.c | 59 ++ 1 file changed, 55 insertions(+), 4 deletions(-) diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c index 48ce19c09..db9dc3cbe 100644 ---

[PATCH v15 27/34] compositor-drm: Add modes to drm_output_propose_state

2018-02-05 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

[PATCH v15 29/34] compositor-drm: Add test-only mode to state application

2018-02-05 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 v15 26/34] compositor-drm: Ignore occluded views

2018-02-05 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 v15 14/34] compositor-drm: Use plane_state_coords_for_view for scanout

2018-02-05 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

[PATCH v15 31/34] compositor-drm: Enable planes for atomic

2018-02-05 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

[PATCH v15 33/34] compositor-drm: Support modifiers with GBM

2018-02-05 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

[PATCH v15 30/34] compositor-drm: Relax plane restrictions for atomic

2018-02-05 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

[PATCH v15 19/34] compositor-drm: Extract drm_fb_addfb into a helper

2018-02-05 Thread Daniel Stone
We currently do the same thing in two places, and will soon have a third. Signed-off-by: Daniel Stone Reviewed-by: Pekka Paalanen --- libweston/compositor-drm.c | 93 -- 1 file changed, 48

[PATCH v15 24/34] compositor-drm: Split drm_assign_planes in two

2018-02-05 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

[PATCH v15 18/34] compositor-drm: Remove no_addfb2 handling

2018-02-05 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

[PATCH v15 32/34] compositor-drm: Support plane IN_FORMATS

2018-02-05 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

[PATCH v15 28/34] compositor-drm: Return plane state from plane preparation

2018-02-05 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

[PATCH v15 03/34] compositor-drm: Move repaint state application to flush

2018-02-05 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,

[PATCH v15 00/34] Atomic modesetting

2018-02-05 Thread Daniel Stone
Hi, Thanks a lot to Pekka and Philipp in particular for their really thorough review; things seem to be looking quite positive now! I am _mostly_ sending this for the part up until the patch which actually enables use of the atomic API. I believe I've handled the review comments on all the

[PATCH weston] xwayland: Fix crash on weston shutdown

2018-02-05 Thread Derek Foreman
commit e7fff215ada3fd3d1b2af664888f960c082f9065 made initializing the selection_listener conditional, but didn't make its clean-up conditional at shutdown. To see this, run weston -Bheadless-backend.so and then connect to it with an X client. When killing weston it will attempt shutdown but die

Re: [PATCH weston] xwayland: Fix crash on weston shutdown

2018-02-05 Thread Daniel Stone
Hi, On 5 February 2018 at 22:02, Derek Foreman wrote: > commit e7fff215ada3fd3d1b2af664888f960c082f9065 made initializing the > selection_listener conditional, but didn't make its clean-up > conditional at shutdown. > > To see this, run weston -Bheadless-backend.so and

RE: [PATCH v15 34/34] drm debug

2018-02-05 Thread Ucan, Emre (ADITG/ESB)
Hi, Did you send this patch erroneously ? Weston will print out lots of logs after this patch. Best regards Emre Ucan Engineering Software Base (ADITG/ESB) Tel. +49 5121 49 6937 > -Original Message- > From: wayland-devel [mailto:wayland-devel- > boun...@lists.freedesktop.org] On

Re: [PATCH libinput] evdev: log all evdev_msg_* on one line

2018-02-05 Thread Pekka Paalanen
On Tue, 6 Feb 2018 12:04:30 +1000 Peter Hutterer wrote: > So we don't have to have newline handling in the callers. This effectively > reverts 6ab2999be90331 "test: detect linebreaks in log messages". > > https://bugs.freedesktop.org/show_bug.cgi?id=104957 > >

[PATCH v15 22/34] compositor-drm: Don't need safe view-list traversal

2018-02-05 Thread Daniel Stone
Nothing in this loop reorders views within the compositor's view_list. Signed-off-by: Daniel Stone Reviewed-by: Pekka Paalanen --- libweston/compositor-drm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH v15 21/34] compositor-drm: Add modifiers to GBM dmabuf import

2018-02-05 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

[PATCH v15 20/34] compositor-drm: Support modifiers for drm_fb

2018-02-05 Thread Daniel Stone
Use the new drmModeAddFB2WithModifiers interface to import buffers with modifiers. Signed-off-by: Daniel Stone Reviewed-by: Pekka Paalanen --- configure.ac | 3 +++ libweston/compositor-drm.c | 26 +-

[PATCH v15 17/34] compositor-drm: Use plane FB-import helper for scanout

2018-02-05 Thread Daniel Stone
Use the same codepath, which has the added advantage of being able to import dmabufs. Signed-off-by: Daniel Stone Reviewed-by: Pekka Paalanen --- libweston/compositor-drm.c | 48 +- 1 file

[PATCH v15 15/34] compositor-drm: Use plane_coords_for_view for cursor

2018-02-05 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

[PATCH v15 25/34] compositor-drm: Ignore views on other outputs

2018-02-05 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 Reviewed-by: Pekka Paalanen

[PATCH v15 12/34] compositor-drm: Fully account for buffer transformation

2018-02-05 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 weston v4] xwm: Add icon support to the frame

2018-02-05 Thread Derek Foreman
On 2017-12-01 02:47 PM, Quentin Glidic wrote: On 12/1/17 7:20 PM, Emmanuel Gil Peyrot wrote: This fetches the _NET_WM_ICON property of the X11 window, and use the first image found as the frame icon. This has been tested with various X11 programs, and improves usability and user-friendliness a

[PATCH v15 16/34] compositor-drm: Extract overlay FB import to helper

2018-02-05 Thread Daniel Stone
... in order to be able to use it from scanout as well. Signed-off-by: Daniel Stone Reviewed-by: Pekka Paalanen --- libweston/compositor-drm.c | 221 - 1 file changed, 119 insertions(+), 102

[PATCH v15 10/34] compositor-drm: Make alpha-to-opaque handling common

2018-02-05 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 v15 09/34] compositor-drm: Atomic modesetting support

2018-02-05 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

[PATCH v15 04/34] compositor-drm: Use apply_state for starting repaint

2018-02-05 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

[PATCH v15 06/34] compositor-drm: Don't restore original CRTC mode

2018-02-05 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

[PATCH v15 05/34] compositor-drm: Consistent failure paths for output creation

2018-02-05 Thread Daniel Stone
Rather than a smattering of error handlers, use consistent jump labels for error paths in create_output_for_connector(). Signed-off-by: Daniel Stone Reported-by: Pekka Paalanen --- libweston/compositor-drm.c | 21 - 1

[PATCH v15 08/34] compositor-drm: Add blob_id member to drm_mode

2018-02-05 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

[PATCH v15 13/34] [XXX] compositor-drm: Only disallow scaling for overlay planes

2018-02-05 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

[PATCH v15 07/34] compositor-drm: Discover atomic properties

2018-02-05 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

[PATCH v15 11/34] compositor-drm: Extract buffer->plane co-ord translation

2018-02-05 Thread Daniel Stone
Pull this into a helper function, so we can use it everywhere. Signed-off-by: Daniel Stone Reviewed-by: Pekka Paalanen --- libweston/compositor-drm.c | 157 + 1 file changed, 88 insertions(+), 69