<html><head></head><body>Hi,<br><br>The only thing that moves into the crititcal section is the sending of the acknowledgement to the shell. Every thing else was under that lock already.<br><br><div class="gmail_quote">Le 10 février 2021 08:45:28 GMT+02:00, Steve Lhomme <robux4@ycbcr.xyz> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">On 2021-02-09 18:04, remi@remlab.net wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">From: Rémi Denis-Courmont <remi@remlab.net><hr> modules/video_output/wayland/xdg-shell.c | 32 ++++++++++++++++--------<br> 1 file changed, 22 insertions(+), 10 deletions(-)<br><br>diff --git a/modules/video_output/wayland/xdg-shell.c b/modules/video_output/wayland/xdg-shell.c<br>index 0b0eba0be0..3a91114caf 100644<br>--- a/modules/video_output/wayland/xdg-shell.c<br>+++ b/modules/video_output/wayland/xdg-shell.c<br>@@ -157,7 +157,20 @@ static void *Thread(void *data)<br> //return NULL;<br> }<br> <br>-static void ReportSize(vout_window_t *wnd)<br>+static void ResizeAck(vout_window_t *wnd, void *data)<br>+{<br>+#ifdef XDG_SHELL<br>+ vout_window_sys_t *sys = wnd->sys;<br>+ uint32_t *serial = data;<br>+<br>+ if (serial != NULL)<br>+ xdg_surface_ack_configure(sys->surface, *serial);<br>+#else<br>+ (void) wnd; (void) data;<br>+#endif<br>+}<br>+<br>+static void ReportSize(vout_window_t *wnd, void *data)<br> {<br> vout_window_sys_t *sys = wnd->sys;<br> /* Zero wm.width or zero wm.height means the client should choose.<br>@@ -165,7 +178,7 @@ static void ReportSize(vout_window_t *wnd)<br> unsigned width = sys->wm.width ? sys->wm.width : sys->set.width;<br> unsigned height = sys->wm.height ? sys->wm.height : sys->set.height;<br> <br>- vout_window_ReportSize(wnd, width, height);<br>+ wnd->owner.cbs->resized(wnd, width, height, ResizeAck, data);<br> xdg_surface_set_window_geometry(sys->surface, 0, 0, width, height);<br> }<br> <br>@@ -184,7 +197,7 @@ static void Resize(vout_window_t *wnd, unsigned width, unsigned height)<br> vlc_mutex_lock(&sys->lock);<br> sys->set.width = width;<br> sys->set.height = height;<br>- ReportSize(wnd);<br>+ ReportSize(wnd, NULL);<br> vlc_mutex_unlock(&sys->lock);<br> wl_display_flush(wnd->display.wl);<br> }<br>@@ -330,23 +343,22 @@ static void xdg_surface_configure_cb(void *data, struct xdg_surface *surface,<br> vout_window_t *wnd = data;<br> vout_window_sys_t *sys = wnd->sys;<br> <br>- vlc_mutex_lock(&sys->lock);<br>- sys->wm.width = sys->wm.latch.width;<br>- sys->wm.height = sys->wm.latch.height;<br>- ReportSize(wnd);<br>- vlc_mutex_unlock(&sys->lock);<br>-<br> if (sys->wm.latch.fullscreen)<br> vout_window_ReportFullscreen(wnd, NULL);<br> else<br> vout_window_ReportWindowed(wnd);<br> <br>- xdg_surface_ack_configure(surface, serial);<br>+ vlc_mutex_lock(&sys->lock);<br>+ sys->wm.width = sys->wm.latch.width;<br>+ sys->wm.height = sys->wm.latch.height;<br>+ ReportSize(wnd, &serial);<br>+ vlc_mutex_unlock(&sys->lock);<br></blockquote><br>Now there is code that is under sys->lock that will be called under <br>vout::display_lock (ResizeAck). Could this lead to deadlocks, for <br>instance if the order of locking is different ?<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> vlc_mutex_lock(&sys->lock);<br> sys->wm.configured = true;<br> vlc_cond_signal(&sys->cond_configured);<br> vlc_mutex_unlock(&sys->lock);<br>+ (void) surface;<br> }<br> <br> static const struct xdg_surface_listener xdg_surface_cbs =<br>-- <br>2.30.0<hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br><br></blockquote><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>