Re: [PATCH weston 08/14 v3] weston: Port Wayland backend to new output handling API

2016-09-29 Thread Pekka Paalanen
On Wed, 28 Sep 2016 22:03:45 +0200
Armin Krezović  wrote:

> On 27.09.2016 16:04, Pekka Paalanen wrote:
> > On Thu, 18 Aug 2016 18:42:36 +0200
> > Armin Krezović  wrote:
> >   
> >> This is a complete port of the Wayland backend that
> >> uses recently added output handling API for output
> >> configuration.
> >>
> >> - Output can be configured at runtime by passing the
> >>   necessary configuration parameters, which can be
> >>   filled in manually, obtained from the configuration
> >>   file or obtained from the command line using
> >>   previously added functionality. It is required that
> >>   the scale and transform values are set using the
> >>   previously added functionality.
> >>
> >> - Output can be created at runtime using the output
> >>   API. The output creation only creates a pending
> >>   output, which needs to be configured the same way as
> >>   mentioned above.
> >>
> >> However, the backend can behave both as windowed backend
> >> and as a backend that issues "hotplug" events, when
> >> running under fullscreen shell or with --sprawl command
> >> line option. The first case was covered by reusing
> >> previously added functionality. The second case required
> >> another API to be introduced and implemented into both
> >> the backend and compositor for handling output setup.
> >>
> >> After everything has been set, output needs to be
> >> enabled manually using weston_output_enable().
> >>
> >> v2:
> >>
> >>  - Fix wet_configure_windowed_output_from_config() usage.
> >>  - Call wayland_output_disable() explicitly from
> >>wayland_output_destroy().
> >>
> >> v3:
> >>
> >>  - Get rid of weston_wayland_output_api and rework output
> >>creation and configuration in case wayland backend is
> >>started with --sprawl or on fullscreen-shell.
> >>  - Remove unneeded free().
> >>  - Disallow calling wayland_output_configure more than once.
> >>  - Remove unneeded checks for output->name == NULL as that
> >>has been disallowed.
> >>  - Use weston_compositor_add_pending_output().
> >>
> >> Signed-off-by: Armin Krezović 
> >> ---
> >>  compositor/main.c  | 257 
> >>  libweston/compositor-wayland.c | 324 
> >> +++--
> >>  libweston/compositor-wayland.h |   8 -
> >>  3 files changed, 279 insertions(+), 310 deletions(-)  
> > 
> > Hi,
> >   
> 
> Salut,
> 
> > I tested this quickly, hosted on weston/x11 with desktop-shell since
> > fullscreen-shell does not manage to show anything either before or
> > after these patches.
> > 
> > While --sprawl works fine (tried with parent output-count=2),
> > --fullscreen is getting a wrong size. More comments on that inline.
> >   
> 
> Thanks for the review and testing! I couldn't catch all the cases it seems!

> >> diff --git a/libweston/compositor-wayland.c 
> >> b/libweston/compositor-wayland.c
> >> index 7c12b4c..5fa6cfd 100644
> >> --- a/libweston/compositor-wayland.c
> >> +++ b/libweston/compositor-wayland.c  
> >   
> >> @@ -1038,92 +1042,167 @@ wayland_output_create(struct wayland_backend *b, 
> >> int x, int y,
> >>   output->parent.surface);
> >>if (!output->parent.shell_surface)
> >>goto err_surface;
> >> +
> >>wl_shell_surface_add_listener(output->parent.shell_surface,
> >>  &shell_surface_listener, output);
> >>}
> >>  
> >> -  if (fullscreen && b->parent.shell) {
> >> -  wl_shell_surface_set_fullscreen(output->parent.shell_surface,
> >> -  0, 0, NULL);
> >> -  wl_display_roundtrip(b->parent.wl_display);
> >> -  if (!width)
> >> -  output_width = output->parent.configure_width;
> >> -  if (!height)
> >> -  output_height = output->parent.configure_height;
> >> -  }
> >> -
> >> -  output->mode.flags =
> >> -  WL_OUTPUT_MODE_CURRENT | WL_OUTPUT_MODE_PREFERRED;
> >> -  output->mode.width = output_width;
> >> -  output->mode.height = output_height;
> >> -  output->mode.refresh = 6;
> >> -  output->scale = scale;
> >> -  wl_list_init(&output->base.mode_list);
> >> -  wl_list_insert(&output->base.mode_list, &output->mode.link);
> >> -  output->base.current_mode = &output->mode;
> >> -
> >>wl_list_init(&output->shm.buffers);
> >>wl_list_init(&output->shm.free_buffers);
> >>  
> >> -  weston_output_init(&output->base, b->compositor, x, y, width, height,
> >> - transform, scale);
> >> -
> >>if (b->use_pixman) {
> >>if (wayland_output_init_pixman_renderer(output) < 0)
> >>goto err_output;
> >> -  output->base.repaint = wayland_output_repaint_pixman;
> >>} else {
> >>if (wayland_output_init_gl_renderer(output) < 0)
> >>goto err_output;
> >> -  output->base.repaint = wayland_output_repaint_gl;
> >>}
> >>  
>

Re: [PATCH weston 09/14 v3] weston: Port X11 backend to new output handling API

2016-09-29 Thread Pekka Paalanen
On Thu, 18 Aug 2016 18:42:37 +0200
Armin Krezović  wrote:

> This is a complete port of the X11 backend that
> uses recently added output handling API for output
> configuration.
> 
> - Output can be configured at runtime by passing the
>   necessary configuration parameters, which can be
>   filled in manually, obtained from the configuration
>   file or obtained from the command line using
>   previously added functionality. It is required that
>   the scale and transform values are set using the
>   previously added functionality.
> 
> - Output can be created at runtime using the output
>   API. The output creation only creates a pending
>   output, which needs to be configured the same way as
>   mentioned above.
> 
> Same as before, a single output is created at runtime
> using the default configuration or a configuration
> parsed from the command line. The output-count
> functionality is also preserved, which means more than
> one output can be created initially, and more outputs can
> be added at runtime using the output API.
> 
> v2:
> 
>  - Fix wet_configure_windowed_output_from_config() usage.
>  - Call x11_output_disable() explicitly from
>x11_output_destroy().
> 
> v3:
> 
>  - Remove unneeded free().
>  - Disallow calling x11_output_configure more than once.
>  - Remove unneeded checks for output->name == NULL as that
>has been disallowed.
>  - Use weston_compositor_add_pending_output().
>  - Bump weston_x11_backend_config version to 2.
> 
> Signed-off-by: Armin Krezović 
> ---
>  compositor/main.c  | 151 +-
>  libweston/compositor-x11.c | 312 
> +
>  libweston/compositor-x11.h |  13 +-
>  3 files changed, 235 insertions(+), 241 deletions(-)

Hi,

nice work!
Reviewed-by: Pekka Paalanen 


> --- a/libweston/compositor-x11.c
> +++ b/libweston/compositor-x11.c
> @@ -59,6 +59,7 @@
>  #include "pixman-renderer.h"
>  #include "presentation-time-server-protocol.h"
>  #include "linux-dmabuf.h"
> +#include "windowed-output-api.h"
>  
>  #define DEFAULT_AXIS_STEP_DISTANCE 10
>  
> @@ -75,6 +76,8 @@ struct x11_backend {
>   struct xkb_keymap   *xkb_keymap;
>   unsigned int has_xkb;
>   uint8_t  xkb_event_base;
> + int  fullscreen;
> + int  no_input;
>   int  use_pixman;
>  
>   int  has_net_wm_state_fullscreen;

Insignificant nitpicks:
- boolean flags should usually be 'bool'
- negative flags often lead to double-negatives in conditions
  (!no_input) so for readability would prefer positive flags instead


Thanks,
pq


pgp1qS4tDP337.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH wayland v2 2/4] wl_array: Set data to invalid address after free

2016-09-29 Thread Eric Engestrom
On Thu, Sep 29, 2016 at 07:17:37AM -0700, Yong Bakos wrote:
> Thanks Eric. Would you mind cc'ing the wayland-devel list, so that Patchwork 
> catches your RB?

Sorry, on MLs I usually just hit reply-all without looking at the list
of recipients.

So, for patchwork:

The series is:
Reviewed-by: Eric Engestrom 

(BTW patchwork doesn't understand "the series is", does it? Or does it
have to be a specific keyword?)

Cheers,
  Eric
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston 09/14 v3] weston: Port X11 backend to new output handling API

2016-09-29 Thread Armin Krezović
On 29.09.2016 12:17, Pekka Paalanen wrote:
> On Thu, 18 Aug 2016 18:42:37 +0200
> Armin Krezović  wrote:
> 
>> This is a complete port of the X11 backend that
>> uses recently added output handling API for output
>> configuration.
>>
>> - Output can be configured at runtime by passing the
>>   necessary configuration parameters, which can be
>>   filled in manually, obtained from the configuration
>>   file or obtained from the command line using
>>   previously added functionality. It is required that
>>   the scale and transform values are set using the
>>   previously added functionality.
>>
>> - Output can be created at runtime using the output
>>   API. The output creation only creates a pending
>>   output, which needs to be configured the same way as
>>   mentioned above.
>>
>> Same as before, a single output is created at runtime
>> using the default configuration or a configuration
>> parsed from the command line. The output-count
>> functionality is also preserved, which means more than
>> one output can be created initially, and more outputs can
>> be added at runtime using the output API.
>>
>> v2:
>>
>>  - Fix wet_configure_windowed_output_from_config() usage.
>>  - Call x11_output_disable() explicitly from
>>x11_output_destroy().
>>
>> v3:
>>
>>  - Remove unneeded free().
>>  - Disallow calling x11_output_configure more than once.
>>  - Remove unneeded checks for output->name == NULL as that
>>has been disallowed.
>>  - Use weston_compositor_add_pending_output().
>>  - Bump weston_x11_backend_config version to 2.
>>
>> Signed-off-by: Armin Krezović 
>> ---
>>  compositor/main.c  | 151 +-
>>  libweston/compositor-x11.c | 312 
>> +
>>  libweston/compositor-x11.h |  13 +-
>>  3 files changed, 235 insertions(+), 241 deletions(-)
> 
> Hi,
> 
> nice work!
> Reviewed-by: Pekka Paalanen 
> 
> 

Hi, thanks!

>> --- a/libweston/compositor-x11.c
>> +++ b/libweston/compositor-x11.c
>> @@ -59,6 +59,7 @@
>>  #include "pixman-renderer.h"
>>  #include "presentation-time-server-protocol.h"
>>  #include "linux-dmabuf.h"
>> +#include "windowed-output-api.h"
>>  
>>  #define DEFAULT_AXIS_STEP_DISTANCE 10
>>  
>> @@ -75,6 +76,8 @@ struct x11_backend {
>>  struct xkb_keymap   *xkb_keymap;
>>  unsigned int has_xkb;
>>  uint8_t  xkb_event_base;
>> +int  fullscreen;
>> +int  no_input;
>>  int  use_pixman;
>>  
>>  int  has_net_wm_state_fullscreen;
> 
> Insignificant nitpicks:
> - boolean flags should usually be 'bool'
> - negative flags often lead to double-negatives in conditions
>   (!no_input) so for readability would prefer positive flags instead
> 

Makes sense. But there are a lot of flags which use int instead of
bool and I'd rather avoid mixup. We can fix them all at some point
later on (use_pixman above is just one of them that was int since
its introduction).

> 
> Thanks,
> pq
> 




signature.asc
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston] configure: remove double equal test bashism

2016-09-29 Thread Murray Calavera
Signed-off-by: Murray Calavera 
---
 configure.ac | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index f35e887..72715a6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -440,10 +440,10 @@ AS_IF([test "x$enable_resize_optimization" = "xyes"],
   [AC_DEFINE([USE_RESIZE_POOL], [1], [Use resize memory pool as a 
performance optimization])])
 
 AC_ARG_ENABLE(weston-launch, [  --enable-weston-launch],, 
enable_weston_launch=yes)
-AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch == xyes)
-if test x$enable_weston_launch == xyes; then
+AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch = xyes)
+if test x$enable_weston_launch = xyes; then
   WESTON_SEARCH_LIBS([PAM], [pam], [pam_open_session], [have_pam=yes], 
[have_pam=no])
-  if test x$have_pam == xno; then
+  if test x$have_pam = xno; then
 AC_ERROR([weston-launch requires pam])
   fi
 fi
-- 
2.10.0

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston] weston-launch: use custom error function

2016-09-29 Thread Murray Calavera
error.h is a gnu extension and not available in other
popular libcs like musl. This patch provides a replacement.

Signed-off-by: Murray Calavera 
---
 libweston/weston-launch.c | 20 +++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c
index 140fde1..84f7d60 100644
--- a/libweston/weston-launch.c
+++ b/libweston/weston-launch.c
@@ -33,7 +33,6 @@
 #include 
 #include 
 
-#include 
 #include 
 
 #include 
@@ -112,6 +111,25 @@ struct weston_launch {
 
 union cmsg_data { unsigned char b[4]; int fd; };
 
+static void
+error(int status, int errnum, const char *msg, ...)
+{
+   va_list args;
+
+   fputs("weston-launch: ", stderr);
+   va_start(args, msg);
+   vfprintf(stderr, msg, args);
+   va_end(args);
+
+   if (errnum)
+   fprintf(stderr, ": %s\n", strerror(errnum));
+   else
+   fputc('\n', stderr);
+
+   if (status)
+   exit(status);
+}
+
 static gid_t *
 read_groups(void)
 {
-- 
2.10.0

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel