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

2017-12-14 Thread Pekka Paalanen
On Thu, 14 Dec 2017 10:11:32 -0500 Alex Deucher wrote: > On Thu, Dec 14, 2017 at 6:40 AM, Pekka Paalanen wrote: > > From: Pekka Paalanen > > > > Hi all, > > > > this is v5 (to match the numbering of my public branches) of the libweston > > user > > facing API and infrastructure for supporting

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

2017-12-14 Thread Alex Deucher
On Thu, Dec 14, 2017 at 6:40 AM, Pekka Paalanen wrote: > From: Pekka Paalanen > > Hi all, > > this is v5 (to match the numbering of my public branches) of the libweston > user > facing API and infrastructure for supporting shared-CRTC clone mode. > > Previous submission with rationale: > https:/

Re: Weston stuff: fractional HiDPI, FreeBSD, Rust

2017-12-14 Thread Pekka Paalanen
On Thu, 14 Dec 2017 14:20:30 +0300 Greg V wrote: > On Thu, 2017-12-14 at 10:21 +0200, Pekka Paalanen wrote: > > On Thu, 14 Dec 2017 03:05:59 +0300 > > Greg V wrote: > > > - FreeBSD support > > In theory I'd support this, but I'm sure we'll have some bikeshedding > > on how to actually deal w

[PATCH] rdp compositor: add a man page

2017-12-14 Thread David Fort
--- Makefile.am| 5 +++ man/weston-rdp.man | 92 ++ 2 files changed, 97 insertions(+) create mode 100644 man/weston-rdp.man diff --git a/Makefile.am b/Makefile.am index 7adc625..f67e693 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15

Providing shared buffer for applications within Smack environment

2017-12-14 Thread José Bollo
Hi all, While working for AGL [1], I want to allow applications to receive the buffers allocated by WESTON. The use of the surfaces/buffers allocated by Weston is difficult when Smack is activated. When these buffers are created, they are tagged with the smack security label that depends on the s

Re: [SMACK-discuss] Providing shared buffer for applications within Smack environment

2017-12-14 Thread José Bollo
On Tue, 12 Dec 2017 07:56:02 -0800 Casey Schaufler wrote: > On 12/12/2017 2:07 AM, José Bollo wrote: > > Hi all, > > > > While working for AGL [1], I want to allow applications to receive > > the buffers allocated by WESTON. The use of the surfaces/buffers > > allocated by Weston is difficult whe

Re: Providing shared buffer for applications within Smack environment

2017-12-14 Thread Rafał Krypa
Hi, On 2017-12-12 17:46, José Bollo wrote: On Tue, 12 Dec 2017 13:28:58 +0200 Pekka Paalanen wrote: On Tue, 12 Dec 2017 12:08:43 +0100 José Bollo wrote: On Tue, 12 Dec 2017 12:44:46 +0200 Pekka Paalanen wrote: On Tue, 12 Dec 2017 11:00:23 +0100 José Bollo wrote: Hi all, Whil

Providing shared buffer for applications within Smack environment

2017-12-14 Thread José Bollo
Hi all, While working for AGL [1], I want to allow applications to receive the buffers allocated by WESTON. The use of the surfaces/buffers allocated by Weston is difficult when Smack is activated. When these buffers are created, they are tagged with the smack security label that depends on the s

Re: [SMACK-discuss] Providing shared buffer for applications within Smack environment

2017-12-14 Thread Casey Schaufler
On 12/12/2017 2:07 AM, José Bollo wrote: > Hi all, > > While working for AGL [1], I want to allow applications to receive the > buffers allocated by WESTON. The use of the surfaces/buffers > allocated by Weston is difficult when Smack is activated. > > When these buffers are created, they are tagge

[PATCH weston v5 36/36] compositor-wayland: migrate to head-based output API

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen 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 ho

[PATCH weston v5 35/36] compositor-wayland: strict surface create/destroy

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen 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 --- libweston/compositor-wayland.c | 17 ++--

[PATCH weston v5 34/36] compositor-x11: migrate to head-based output API

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen 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 --- libweston/compositor-x11.c | 68 -- 1 file c

[PATCH weston v5 33/36] compositor-fbdev: migrate to head-based output API

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen 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

[PATCH weston v5 22/36] weston: migrate RDP to head-based output API

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen Migrate the RDP frontend to use the new head-based output configuration API: listen for heads_changed, and process all heads. Signed-off-by: Pekka Paalanen --- compositor/main.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/compositor/

[PATCH weston v5 21/36] weston: migrate fbdev to head-based output API

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen Migrate the fbdev frontend to use the new head-based output configuration API: listen for heads_changed, and process all heads. Signed-off-by: Pekka Paalanen --- compositor/main.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/compositor/ma

[PATCH weston v5 31/36] compositor-rdp: migrate to head-based output API

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen 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 --- libweston/compositor-rdp.c | 64 ++ 1 file changed, 53 in

[PATCH weston v5 24/36] libweston: change windowed_output_api output_create to create_head

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen 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

[PATCH weston v5 29/36] libweston: cancel idle_repaint on output destroy

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen 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 composito

[PATCH weston v5 32/36] compositor-fbdev: make re-enable less drastic

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen 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,

[PATCH weston v5 23/36] weston: migrate DRM to head-based output API

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen 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 b

[PATCH weston v5 25/36] libweston: remove output_pending_signal

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen 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

[PATCH weston v5 30/36] compositor-headless: migrate to head-based output API

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen Implement the head-based output API in this backend, and stop relying on the implicit weston_output::head. Signed-off-by: Pekka Paalanen --- libweston/compositor-headless.c | 75 ++--- 1 file changed, 63 insertions(+), 12 deletions(-) d

[PATCH weston v5 27/36] libweston: assert make/model in weston_output_enable()

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen 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 --- libweston/compositor.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/libweston/compositor.c b/libweston

[PATCH weston v5 28/36] libweston: assert current_mode in weston_output_enable()

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen 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 backe

[PATCH weston v5 26/36] libweston: stop auto-adding the implicit head

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen 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

[PATCH weston v5 18/36] weston: migrate headless to head-based output API

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen 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 l

[PATCH weston v5 17/36] weston: move weston_output_enable() into callers

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen 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 --- compositor/main.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/composit

[PATCH weston v5 12/36] libweston: add compositor list of heads

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen weston_compositor needs to maintain a list of all available heads, so that a compositor can pick and choose which heads to take into or out of use at arbitrary times. The heads may be on or off, and connected or disconnected. Signed-off-by: Pekka Paalanen --- libweston/com

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

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen Reacting to DRM hotplug events is racy. It is theoretically possible to get hotplug events for a quick swap from one monitor to another and process both only after the new monitor is connected. Hence it is possible for display device information to change without going throug

[PATCH weston v5 20/36] weston: migrate wayland to head-based output API

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen 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 --- compositor/main.c | 27 --- 1 file changed, 8 insertions(+), 19 deletions(-) diff --

[PATCH weston v5 19/36] weston: migrate x11 to head-based output API

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen 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 --- compositor/main.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/compositor/m

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

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen Introduce the API for users (compositors) to create an output from a head, attach and detach heads, and destroy outputs created this way. This also adds the backend-facing API to libweston. In the new API design, a backend creates heads, and the compositor chooses one or mor

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

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen Add a hook for compositors to get a callback when heads are added or their connection status changes, to which compositors likely want to react to by enabling or disabling outputs (API for that to be added later). As many head changes as possible should be coalesced into a s

[PATCH weston v5 15/36] libweston: add weston_head destroy signal

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen Add support for subscribing to weston_head destruction. The primary use case for heads being destroyed arbitrarily is the DRM-backend with MST connectors, which may disappear on unplug. It is not just the connector becoming disconnected, it is the connector actually disappea

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

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen Heads may be disconnected or connected and the compositor needs to be able to know the state to know which heads to take into use. Currently a single head is automatically created with an output, and outputs are only ever created as connected and destroyed on disconnection,

[PATCH weston v5 01/36] libweston: introduce weston_head

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen In order to support clone modes, libweston needs the concept of a head that is separate from weston_output. While weston_output manages buffers and the repaint state machine, weston_head will represent a single monitor. In the future it will be possible to have a single westo

[PATCH weston v5 07/36] libweston: properly orphan wl_output resources

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen Remove the wl_resource in the head's resource list when we are removing the wl_output global. We sent global removal events to clients, the resources should become dummies until clients reap them. Reset user data so that clients triying to use dummy objects don't hit e.g. a f

[PATCH weston v5 08/36] libweston: strdup head make, model, serial_number

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen Duplicate these strings to decouple their lifetime from whatever the backends used. This should prevent hard to catch use after frees and such problems in the future. Signed-off-by: Pekka Paalanen Reviewed-by: Quentin Glidic --- libweston/compositor.c | 14 +++---

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

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen The intention is that in the future backends will dynamically allocate weston_heads based on the resources they have. The lifetime of a weston_head will be independent of the lifetime of a weston_output it may be attached to. Backends allocate objects derived from weston_head

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

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen The 'head' member of 'struct weston_output' is going to go unused and then disappear, so stop using it and find a head from the proper list. However, this leaves a problem in cms-colord: if you have multiple monitors driver with the same CRTC, what do you say to the color ma

[PATCH weston v5 10/36] libweston: add name to weston_head

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen Heads need to be named, so they can be referenced in logs and configuration sources. When clone mode is implemented, output and head names may differ. Signed-off-by: Pekka Paalanen --- libweston/compositor.c | 10 -- libweston/compositor.h | 2 ++ 2 files changed

[PATCH weston v5 04/36] libweston: make wl_output point to weston_head

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen The user data of a wl_resource representing a wl_output protocol object used to be a pointer to weston_output. Now that weston_output is being split, wl_output more accurately refers to weston_head which is a single monitor. Change the wl_output user data to point to weston_

[PATCH weston v5 05/36] libweston: refactor weston_mode_switch_finish

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen Split out a new function. This is a pure refactoring, no change in behaviour. This helps a following patch that adds a loop over output->head_list. Signed-off-by: Pekka Paalanen Reviewed-by: Quentin Glidic --- libweston/compositor.c | 57 +++--

[PATCH weston v5 02/36] libweston: move wl_output to weston_head

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen The wl_output protocol interface exposes things like monitor make, model, sub-pixel layout and physical dimensions. Obviously wl_output is meant to represent a monitor. The abstraction of a monitor is weston_head. Therefore move the wl_output global and the bound resources l

[PATCH weston v5 03/36] libweston: use head in wl_output global

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen As a wl_output represents weston_head, use a weston_head pointer as the wl_output global's user data. Signed-off-by: Pekka Paalanen --- libweston/compositor.c | 11 +++ libweston/compositor.h | 2 ++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/l

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

2017-12-14 Thread Pekka Paalanen
From: Pekka Paalanen Hi all, this is v5 (to match the numbering of my public branches) of the libweston user facing API and infrastructure for supporting shared-CRTC clone mode. Previous submission with rationale: https://lists.freedesktop.org/archives/wayland-devel/2017-October/035604.html De

Re: Weston stuff: fractional HiDPI, FreeBSD, Rust

2017-12-14 Thread Greg V
On Thu, 2017-12-14 at 10:21 +0200, Pekka Paalanen wrote: > On Thu, 14 Dec 2017 03:05:59 +0300 > Greg V wrote: > > - FreeBSD support > In theory I'd support this, but I'm sure we'll have some bikeshedding > on how to actually deal with the alternative code. I would also be > worried about testing,

Re: [PATCH v4 wayland] client: Allow absolute paths in WAYLAND_DISPLAY

2017-12-14 Thread Pekka Paalanen
On Wed, 13 Dec 2017 08:19:46 -0600 Matt Hoosier wrote: > On Mon, Dec 11, 2017 at 2:03 AM, Pekka Paalanen wrote: > > On Mon, 27 Nov 2017 08:54:54 -0600 > > Matt Hoosier wrote: > > > >> From: Matt Hoosier > >> > >> In order to support system compositor instances, it is necessary to > >> allow

Re: Weston stuff: fractional HiDPI, FreeBSD, Rust

2017-12-14 Thread Pekka Paalanen
On Thu, 14 Dec 2017 03:05:59 +0300 Greg V wrote: > Hi everyone! > > I've been hacking around, trying to make Weston more usable for myself… Hi, nice work! Here are my initial thoughts of the ideas, but mind that I didn't look at the code at all, so some questions might sound lazy. > So far I