[PATCH weston] libweston: Fix clear timing of output repainted flag

2018-07-09 Thread Tomohito Esaki
Since the repaint status of the flushed output may be reset if a output repaint is failed, it is necessary to clear the repainted flag immediately after output repaint flush/cancel. Signed-off-by: Tomohito Esaki --- libweston/compositor.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-

[PATCH weston v2] simple-dmabuf-drm: fix build with --disable-egl

2018-07-09 Thread Emilio Pozuelo Monfort
This code calls into EGL to see if the dmabuf import modifiers extension is available, and if not it assumes XRGB is supported. Rather than disabling this client doesn't get build if one disables EGL, we can just remove this and stop lying to ourselves. Signed-off-by: Emilio Pozuelo Monfort

[PATCH weston 1/2] shot: add test for sub-surface with unmapped parent

2018-07-09 Thread Emilio Pozuelo Monfort
This reproduces https://bugs.freedesktop.org/show_bug.cgi?id=94735. Signed-off-by: Emilio Pozuelo Monfort --- tests/reference/subsurface_mapped-00.png | Bin 0 -> 799 bytes tests/reference/subsurface_mapped-01.png | Bin 0 -> 841 bytes tests/subsurface-shot-test.c | 76 +

[PATCH weston 2/2] weston-test: don't map surfaces that have no content

2018-07-09 Thread Emilio Pozuelo Monfort
If a surface has no content (e.g. no buffer), then it shouldn't be mapped, so that its subsurfaces don't get mapped either. This works fine in the desktop-shell, but is currently broken on the weston-test module. https://bugs.freedesktop.org/show_bug.cgi?id Signed-off-by: Emilio Pozuelo Monfort

[PATCH weston 0/2 v3] sub-surface with unmapped parent

2018-07-09 Thread Emilio Pozuelo Monfort
I forgot to git add the test ref images. That's the only change here. Emilio Pozuelo Monfort (2): shot: add test for sub-surface with unmapped parent weston-test: don't map surfaces that have no content tests/reference/subsurface_mapped-00.png | Bin 0 -> 799 bytes tests/reference/subsurface

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

2018-07-09 Thread Daniel Stone
Hi Pekka, On Fri, 26 Jan 2018 at 12:45, Pekka Paalanen wrote: > On Wed, 20 Dec 2017 12:26:51 + Daniel Stone wrote: > > @@ -3116,9 +3136,16 @@ drm_output_propose_state(struct weston_output > > *output_base, > > if (next_plane == primary) > > pixman_region3

Re: [PATCH v17.1 01/14] helpers: Move static_assert definition to shared

2018-07-09 Thread Pekka Paalanen
On Mon, 9 Jul 2018 15:27:46 +0100 Daniel Stone wrote: > Collect the fallback definitions of static_assert() from desktop-shell > and the test shell, and move them to helpers.h. This allows code > throughout the tree to use static_assert() for build-time assertions, > where it is supported by the

[PATCH v17.1 01/14] helpers: Move static_assert definition to shared

2018-07-09 Thread Daniel Stone
Collect the fallback definitions of static_assert() from desktop-shell and the test shell, and move them to helpers.h. This allows code throughout the tree to use static_assert() for build-time assertions, where it is supported by the compiler. As GCC goes out of its way to only add static_assert(

Re: [PATCH wayland-protocols] xdg-output: add a transform example for the logical size

2018-07-09 Thread Olivier Fourdan
Hi, On Mon, 9 Jul 2018 at 11:09, Simon Ser wrote: > > Bump: this is the source of bugs in xwayland [1]. > > [1]: https://lists.x.org/archives/xorg-devel/2018-July/057285.html > > On May 18, 2018 9:40 PM, Simon Ser wrote: > > Signed-off-by: Simon Ser > > --- > > > > I believe it's easy to unders

Re: [PATCH v17 06/14] compositor-drm: Use GBM modifier API

2018-07-09 Thread Pekka Paalanen
On Mon, 9 Jul 2018 14:23:12 +0100 Daniel Stone wrote: > Now that we collect information about which modifiers are supported for > KMS display, and are able to create KMS framebuffers with modifiers, > begin using the modifier-aware GBM API. > > Client buffers from dmabuf already store multi-pla

Re: [PATCH v17 05/14] compositor-drm: Support plane IN_FORMATS

2018-07-09 Thread Pekka Paalanen
On Mon, 9 Jul 2018 14:23:11 +0100 Daniel Stone wrote: > From: Sergi Granell > > The per-plane IN_FORMATS KMS property describes the format/modifier > combinations supported for display on this plane. Read and parse this > format, storing the data in each plane, so we can know which > combinati

Re: [PATCH v17 04/14] compositor-drm: Add modifiers to GBM dmabuf import

2018-07-09 Thread Pekka Paalanen
On Mon, 9 Jul 2018 14:23:10 +0100 Daniel Stone wrote: > 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 > Tested-by: Emre Ucan > --- > configure.ac | 6 +- > libw

Re: [PATCH v17 03/14] compositor-drm: Don't set fb->size for non-dumb buffers

2018-07-09 Thread Pekka Paalanen
On Mon, 9 Jul 2018 14:23:09 +0100 Daniel Stone wrote: > When creating a drm_fb from client (wl_buffer/dmabuf), gbm_surface, or > client buffers, set fb->size to 0. The size member is only used for dumb > buffers, where we mmap the whole buffer, and need the size recorded to > later pass to munma

Re: [PATCH v17 02/14] compositor-drm: Avoid cast by using unsigned loop index

2018-07-09 Thread Pekka Paalanen
On Mon, 9 Jul 2018 14:23:08 +0100 Daniel Stone wrote: > ARRAY_LENGTH returns a size_t; rather than casting its result to > int so we can compare to our signed index variable, just declare the > index as a compatible type in the first place. > > Signed-off-by: Daniel Stone > --- > libweston/co

Re: [PATCH v17 01/14] helpers: Add BUILD_BUG_ON from Linux kernel

2018-07-09 Thread Pekka Paalanen
On Mon, 9 Jul 2018 14:23:07 +0100 Daniel Stone wrote: > Import the trivial definition of BUILD_BUG_ON() from the Linux kernel. > This evaluates an expression such that it will call sizeof() on a > negative-length array if the expression is false, generating a compiler > error. > > This will be

[PATCH v17 07/14] compositor-drm: Split drm_assign_planes in two

2018-07-09 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 Reviewed-by: Pekka Paalanen Tested

[PATCH v17 09/14] compositor-drm: Ignore occluded views

2018-07-09 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 Teste

[PATCH v17 12/14] compositor-drm: Add test-only mode to state application

2018-07-09 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 Tested-by: Emre Ucan --- libweston/compositor-drm.c | 176

[PATCH v17 14/14] compositor-drm: Enable planes for atomic

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

[PATCH v17 11/14] compositor-drm: Return plane state from plane preparation

2018-07-09 Thread Daniel Stone
Return a pointer to the plane state, rather than indirecting via a weston_plane. Signed-off-by: Daniel Stone Tested-by: Emre Ucan --- libweston/compositor-drm.c | 71 +- 1 file changed, 39 insertions(+), 32 deletions(-) diff --git a/libweston/compositor-drm.

[PATCH v17 03/14] compositor-drm: Don't set fb->size for non-dumb buffers

2018-07-09 Thread Daniel Stone
When creating a drm_fb from client (wl_buffer/dmabuf), gbm_surface, or client buffers, set fb->size to 0. The size member is only used for dumb buffers, where we mmap the whole buffer, and need the size recorded to later pass to munmap. Determining the full size of multi-planar buffers is difficul

[PATCH v17 10/14] compositor-drm: Add modes to drm_output_propose_state

2018-07-09 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 Tested-by: Emre Ucan --- libweston/compositor-drm.c |

[PATCH v17 04/14] compositor-drm: Add modifiers to GBM dmabuf import

2018-07-09 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 Tested-by: Emre Ucan --- configure.ac | 6 +- libweston/compositor-drm.c | 201 + 2 fil

[PATCH v17 06/14] compositor-drm: Use GBM modifier API

2018-07-09 Thread Daniel Stone
Now that we collect information about which modifiers are supported for KMS display, and are able to create KMS framebuffers with modifiers, begin using the modifier-aware GBM API. Client buffers from dmabuf already store multi-plane and modifier information into drm_fb. Extend this to drm_fb_get_

[PATCH v17 13/14] compositor-drm: Relax plane restrictions for atomic

2018-07-09 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 Tested-by: Emre Ucan --- libweston/compositor-drm.c | 21 + 1 file changed, 1

[PATCH v17 05/14] compositor-drm: Support plane IN_FORMATS

2018-07-09 Thread Daniel Stone
From: Sergi Granell The per-plane IN_FORMATS KMS property describes the format/modifier combinations supported for display on this plane. Read and parse this format, storing the data in each plane, so we can know which combinations might work, and which combinations definitely will not work. Sim

[PATCH v17 08/14] compositor-drm: Ignore views on other outputs

2018-07-09 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 Tested-by: Emre Ucan ---

[PATCH v17 00/14] DRM backend planes and modifiers

2018-07-09 Thread Daniel Stone
Hi, Another re-send after Pekka's comments on the modifiers patches. Patches 01-12 from the last series were merged after the last round. Patch 1 is new; patches 2 and 3 were extracted from patches 5 and 6. Patches 4-6 have otherwise seen changes after Pekka's review; all the comments were addres

[PATCH v17 02/14] compositor-drm: Avoid cast by using unsigned loop index

2018-07-09 Thread Daniel Stone
ARRAY_LENGTH returns a size_t; rather than casting its result to int so we can compare to our signed index variable, just declare the index as a compatible type in the first place. Signed-off-by: Daniel Stone --- libweston/compositor-drm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-

[PATCH v17 01/14] helpers: Add BUILD_BUG_ON from Linux kernel

2018-07-09 Thread Daniel Stone
Import the trivial definition of BUILD_BUG_ON() from the Linux kernel. This evaluates an expression such that it will call sizeof() on a negative-length array if the expression is false, generating a compiler error. This will be used in future patches to ensure two array lengths don't go out of sy

Re: [PATCH v16 14/23] compositor-drm: Support plane IN_FORMATS

2018-07-09 Thread Pekka Paalanen
On Mon, 9 Jul 2018 13:42:45 +0100 Daniel Stone wrote: > Hi, > On Mon, 9 Jul 2018 at 11:08, Pekka Paalanen wrote: > > On Thu, 5 Jul 2018 18:16:41 +0100 Daniel Stone > > wrote: > > > The per-plane IN_FORMATS property adds information about format > > > modifiers; we can use these to both feed

Re: [PATCH v16 13/23] compositor-drm: Add modifiers to GBM dmabuf import

2018-07-09 Thread Pekka Paalanen
On Mon, 9 Jul 2018 13:25:50 +0100 Daniel Stone wrote: > Hi Pekka, > > On Mon, 9 Jul 2018 at 11:22, Pekka Paalanen wrote: > > On Mon, 9 Jul 2018 12:39:30 +0300 Pekka Paalanen > > wrote: > > > On Thu, 5 Jul 2018 18:16:40 +0100 Daniel Stone > > > wrote: > > > > +static struct drm_fb * > >

Re: [PATCH v16 14/23] compositor-drm: Support plane IN_FORMATS

2018-07-09 Thread Daniel Stone
Hi, On Mon, 9 Jul 2018 at 11:08, Pekka Paalanen wrote: > On Thu, 5 Jul 2018 18:16:41 +0100 Daniel Stone wrote: > > 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

Re: [PATCH] compositor-drm: Define DPMS property as an enum

2018-07-09 Thread Pekka Paalanen
On Fri, 6 Jul 2018 11:36:49 +0100 Daniel Stone wrote: > The DPMS connector property is an enum property in KMS, which made our > property handling complain at startup as we weren't defining its enums. > Fix our definition so we parse the enum values. > > The only user of the property is the leg

Re: [PATCH v16 13/23] compositor-drm: Add modifiers to GBM dmabuf import

2018-07-09 Thread Daniel Stone
Hi Pekka, On Mon, 9 Jul 2018 at 11:22, Pekka Paalanen wrote: > On Mon, 9 Jul 2018 12:39:30 +0300 Pekka Paalanen wrote: > > On Thu, 5 Jul 2018 18:16:40 +0100 Daniel Stone > > wrote: > > > +static struct drm_fb * > > > +drm_fb_get_from_dmabuf(struct linux_dmabuf_buffer *dmabuf, > > > +

Re: [PATCH v16 13/23] compositor-drm: Add modifiers to GBM dmabuf import

2018-07-09 Thread Daniel Stone
Hi Pekka, On Mon, 9 Jul 2018 at 10:39, Pekka Paalanen wrote: > On Thu, 5 Jul 2018 18:16:40 +0100 > Daniel Stone wrote: > > +/* XXX: TODO: > > + * > > + * Currently the buffer is rejected if any dmabuf attribute > > + * flag is set. This keeps us from passing an i

Re: [PATCH] man: Remove description of DRM specific mode-options from weston.ini.man

2018-07-09 Thread Pekka Paalanen
On Fri, 6 Jul 2018 16:18:39 +0530 "Nautiyal, Ankit K" wrote: > From: Ankit Nautiyal > > The weston.ini.man describes the mode-formats that a user can specify > for selecting a video mode. The DRM specific examples are already > provided in weston-drm.man, so this inofrmation is redundant and c

Re: [PATCH v16 15/23] compositor-drm: Support modifiers with GBM

2018-07-09 Thread Pekka Paalanen
On Thu, 5 Jul 2018 18:16:42 +0100 Daniel Stone wrote: > Use the extended GBM allocator interface to support modifiers and > multi-planar BOs. > > Signed-off-by: Daniel Stone > Tested-by: Emre Ucan > --- > configure.ac | 3 ++ > libweston/compositor-drm.c | 61 +

Re: [PATCH v16 13/23] compositor-drm: Add modifiers to GBM dmabuf import

2018-07-09 Thread Pekka Paalanen
On Mon, 9 Jul 2018 12:39:30 +0300 Pekka Paalanen wrote: > On Thu, 5 Jul 2018 18:16:40 +0100 > Daniel Stone wrote: > > > 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 > >

Re: [PATCH v16 14/23] compositor-drm: Support plane IN_FORMATS

2018-07-09 Thread Pekka Paalanen
On Thu, 5 Jul 2018 18:16:41 +0100 Daniel Stone wrote: > 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 > tr

Re: [PATCH v16 13/23] compositor-drm: Add modifiers to GBM dmabuf import

2018-07-09 Thread Pekka Paalanen
On Thu, 5 Jul 2018 18:16:40 +0100 Daniel Stone wrote: > 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 > Tested-by: Emre Ucan > --- > configure.ac | 6 +- > libw

Re: [PATCH wayland-protocols] xdg-output: add a transform example for the logical size

2018-07-09 Thread Simon Ser
Bump: this is the source of bugs in xwayland [1]. [1]: https://lists.x.org/archives/xorg-devel/2018-July/057285.html On May 18, 2018 9:40 PM, Simon Ser wrote: > Signed-off-by: Simon Ser > --- > > I believe it's easy to understand that transformations are not applied to > the logical size. > >