[PATCH xserver 3/5] xwayland: process Wayland events after adding screen

2018-06-05 Thread Olivier Fourdan
When we're done adding a new screen, we need to process any pending
Wayland events again.

Hence we don't end up processing xdg_output events unexpectedly when
glamor is disabled. Be that because "-shm" was passed or "-eglstream"
has failed.

Failing to do that could lead to a crash at startup:

Xwayland: dixGetPrivateAddr: Assertion `key->initialized' failed.
(EE)
(EE) Backtrace:
(EE) 0: Xwayland (OsSigHandler)
(EE) 1: libpthread.so.0 (funlockfile)
(EE) 2: libc.so.6 (gsignal)
(EE) 3: libc.so.6 (abort)
(EE) 4: libc.so.6 (?+0x0)
(EE) 5: libc.so.6 (__assert_fail)
(EE) 6: Xwayland (dixGetPrivateAddr)
(EE) 7: Xwayland (_fbGetWindowPixmap)
(EE) 8: Xwayland (getDrawableDamageRef)
(EE) 9: Xwayland (damageRegionProcessPending)
(EE) 10: Xwayland (damagePolyFillRect)
(EE) 11: Xwayland (miPaintWindow)
(EE) 12: Xwayland (miWindowExposures)
(EE) 13: Xwayland (miHandleValidateExposures)
(EE) 14: Xwayland (SetRootClip)
(EE) 15: Xwayland (update_screen_size)
(EE) 16: Xwayland (apply_output_change)
(EE) 17: libffi.so.6 (ffi_call_unix64)
(EE) 18: libffi.so.6 (ffi_call)
(EE) 19: libwayland-client.so.0 (wl_log_set_handler_client)
(EE) 20: libwayland-client.so.0 (_init)
(EE) 21: libwayland-client.so.0 (wl_display_dispatch_queue_pending)
(EE) 22: libwayland-client.so.0 (wl_display_roundtrip_queue)
(EE) 23: Xwayland (InitInput)
(EE) 24: Xwayland (dix_main)
(EE) 25: libc.so.6 (__libc_start_main)
(EE) 26: Xwayland (_start)
(EE)
(EE)
Fatal server error:
(EE) Caught signal 6 (Aborted). Server aborting
(EE)
Aborted (core dumped)

Signed-off-by: Olivier Fourdan 
Reviewed-by: Lyude Paul 
Reviewed-by: Emil Velikov 
---
 hw/xwayland/xwayland.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index d9548a874..9121ef666 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -1132,6 +1132,10 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
 
 AddCallback(, xwl_property_callback, pScreen);
 
+wl_display_roundtrip(xwl_screen->display);
+while (xwl_screen->expecting_event)
+wl_display_roundtrip(xwl_screen->display);
+
 return ret;
 }
 
-- 
2.17.1

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver 3/5] xwayland: process Wayland events after adding screen

2018-06-04 Thread Emil Velikov
On 24 May 2018 at 15:11, Olivier Fourdan  wrote:
> When we're done adding a new screen, we need to process pending Wayland
> events again so that we don't end up processing xdg_output events when
> unexpected if glamor is disabled (either becauase "-shm" was passed or
> because "-eglstream" failed):
>
Please add some punctuation here. Something like below takes 1/3 the
time to parse.

When we're done adding a new screen, we need to process any pending
Wayland events again.
Hence we don't end up processing xdg_output events unexpectedly when
glamor is disabled. Be that because "-shm" was passed or "-eglstream"
has failed.

-Emil
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver 3/5] xwayland: process Wayland events after adding screen

2018-05-25 Thread Lyude Paul
Reviewed-by: Lyude Paul 

On Thu, 2018-05-24 at 16:11 +0200, Olivier Fourdan wrote:
> When we're done adding a new screen, we need to process pending Wayland
> events again so that we don't end up processing xdg_output events when
> unexpected if glamor is disabled (either becauase "-shm" was passed or
> because "-eglstream" failed):
> 
> Xwayland: dixGetPrivateAddr: Assertion `key->initialized' failed.
> (EE)
> (EE) Backtrace:
> (EE) 0: Xwayland (OsSigHandler)
> (EE) 1: libpthread.so.0 (funlockfile)
> (EE) 2: libc.so.6 (gsignal)
> (EE) 3: libc.so.6 (abort)
> (EE) 4: libc.so.6 (?+0x0)
> (EE) 5: libc.so.6 (__assert_fail)
> (EE) 6: Xwayland (dixGetPrivateAddr)
> (EE) 7: Xwayland (_fbGetWindowPixmap)
> (EE) 8: Xwayland (getDrawableDamageRef)
> (EE) 9: Xwayland (damageRegionProcessPending)
> (EE) 10: Xwayland (damagePolyFillRect)
> (EE) 11: Xwayland (miPaintWindow)
> (EE) 12: Xwayland (miWindowExposures)
> (EE) 13: Xwayland (miHandleValidateExposures)
> (EE) 14: Xwayland (SetRootClip)
> (EE) 15: Xwayland (update_screen_size)
> (EE) 16: Xwayland (apply_output_change)
> (EE) 17: libffi.so.6 (ffi_call_unix64)
> (EE) 18: libffi.so.6 (ffi_call)
> (EE) 19: libwayland-client.so.0 (wl_log_set_handler_client)
> (EE) 20: libwayland-client.so.0 (_init)
> (EE) 21: libwayland-client.so.0 (wl_display_dispatch_queue_pending)
> (EE) 22: libwayland-client.so.0 (wl_display_roundtrip_queue)
> (EE) 23: Xwayland (InitInput)
> (EE) 24: Xwayland (dix_main)
> (EE) 25: libc.so.6 (__libc_start_main)
> (EE) 26: Xwayland (_start)
> (EE)
> (EE)
> Fatal server error:
> (EE) Caught signal 6 (Aborted). Server aborting
> (EE)
> Aborted (core dumped)
> 
> Signed-off-by: Olivier Fourdan 
> ---
>  hw/xwayland/xwayland.c | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
> index b4049d2cc..cc16edf27 100644
> --- a/hw/xwayland/xwayland.c
> +++ b/hw/xwayland/xwayland.c
> @@ -1132,6 +1132,10 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char
> **argv)
>  
>  AddCallback(, xwl_property_callback, pScreen);
>  
> +wl_display_roundtrip(xwl_screen->display);
> +while (xwl_screen->expecting_event)
> +wl_display_roundtrip(xwl_screen->display);
> +
>  return ret;
>  }
>  
-- 
Cheers,
Lyude Paul
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver 3/5] xwayland: process Wayland events after adding screen

2018-05-24 Thread Olivier Fourdan
When we're done adding a new screen, we need to process pending Wayland
events again so that we don't end up processing xdg_output events when
unexpected if glamor is disabled (either becauase "-shm" was passed or
because "-eglstream" failed):

Xwayland: dixGetPrivateAddr: Assertion `key->initialized' failed.
(EE)
(EE) Backtrace:
(EE) 0: Xwayland (OsSigHandler)
(EE) 1: libpthread.so.0 (funlockfile)
(EE) 2: libc.so.6 (gsignal)
(EE) 3: libc.so.6 (abort)
(EE) 4: libc.so.6 (?+0x0)
(EE) 5: libc.so.6 (__assert_fail)
(EE) 6: Xwayland (dixGetPrivateAddr)
(EE) 7: Xwayland (_fbGetWindowPixmap)
(EE) 8: Xwayland (getDrawableDamageRef)
(EE) 9: Xwayland (damageRegionProcessPending)
(EE) 10: Xwayland (damagePolyFillRect)
(EE) 11: Xwayland (miPaintWindow)
(EE) 12: Xwayland (miWindowExposures)
(EE) 13: Xwayland (miHandleValidateExposures)
(EE) 14: Xwayland (SetRootClip)
(EE) 15: Xwayland (update_screen_size)
(EE) 16: Xwayland (apply_output_change)
(EE) 17: libffi.so.6 (ffi_call_unix64)
(EE) 18: libffi.so.6 (ffi_call)
(EE) 19: libwayland-client.so.0 (wl_log_set_handler_client)
(EE) 20: libwayland-client.so.0 (_init)
(EE) 21: libwayland-client.so.0 (wl_display_dispatch_queue_pending)
(EE) 22: libwayland-client.so.0 (wl_display_roundtrip_queue)
(EE) 23: Xwayland (InitInput)
(EE) 24: Xwayland (dix_main)
(EE) 25: libc.so.6 (__libc_start_main)
(EE) 26: Xwayland (_start)
(EE)
(EE)
Fatal server error:
(EE) Caught signal 6 (Aborted). Server aborting
(EE)
Aborted (core dumped)

Signed-off-by: Olivier Fourdan 
---
 hw/xwayland/xwayland.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index b4049d2cc..cc16edf27 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -1132,6 +1132,10 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
 
 AddCallback(, xwl_property_callback, pScreen);
 
+wl_display_roundtrip(xwl_screen->display);
+while (xwl_screen->expecting_event)
+wl_display_roundtrip(xwl_screen->display);
+
 return ret;
 }
 
-- 
2.17.0

___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel