[Mesa-stable] [Mesa-dev] [PATCH mesa 2/2] wsi/wayland: only finish() a successfully init()ed display

Eric Engestrom eric.engestrom at intel.com
Tue Nov 6 14:54:00 UTC 2018


On Tuesday, 2018-11-06 15:15:41 +0100, Juan A. Suarez Romero wrote:
> On Mon, 2018-11-05 at 10:00 +0000, Eric Engestrom wrote:
> > Cc: Dave Airlie <airlied at gmail.com>
> > Cc: Philipp Zabel <p.zabel at pengutronix.de>
> > Signed-off-by: Eric Engestrom <eric.engestrom at intel.com>
> > ---
> >  src/vulkan/wsi/wsi_common_wayland.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c
> > index a799b427621d72b2927c..5d79d377f12df81b06ba 100644
> > --- a/src/vulkan/wsi/wsi_common_wayland.c
> > +++ b/src/
> > @@ -456,7 +456,8 @@ wsi_wl_get_presentation_support(struct wsi_device *wsi_device,
> >  
> >     struct wsi_wl_display display;
> >     VkResult ret = wsi_wl_display_init(wsi, &display, wl_display, false);
> > -   wsi_wl_display_finish(&display);
> > +   if (ret == VK_SUCCESS)
> > +      wsi_wl_display_finish(&display);
> >  
> >     return ret == VK_SUCCESS;
> >  }
> 
> As this patch fixes 43691024 ("vulkan/wsi/wayland: Stop caching Wayland
> displays"), which is part of 18.2 releases, I've added it to the queue for next
> 18.2 release.
> 
> Nevertheless, the patch didn't apply cleanly, and I've resolved the trivial
> conflicts.
> 
> You can find the fixed version at 
> https://gitlab.freedesktop.org/mesa/mesa/commit/934abf9e6ab38e32134b10123d9db376981580e2

Double-checked, it looks all good to me. The comparison of an `int` with
an `enum VkResult` might cause a warning with some compilers though, but
it can safely be ignored.

> 
> 
> 
> PS: I've noticed that maybe we want also to nominate dcee22afed9 ("wsi/wayland:
> use proper VkResult type"), the missing of this patch caused the conflict, and I
> think it makes sense to nominate this too. WDYT?

Sure; I didn't nominate it because it isn't really needed, but it can't
hurt to have it and it helps the code make more sense, so yes, feel free
to include it as well :)

Thanks!

> 
> 
> 
> 	J.A.
> 
> 


More information about the mesa-stable mailing list