[Mesa-dev] [PATCH 1/6] egl/x11: bail out if we cannot fetch the xcb connection

Alex Deucher alexdeucher at gmail.com
Wed Jul 29 09:25:12 PDT 2015


On Wed, Jul 29, 2015 at 12:19 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> Strictly speaking the xcb_connection_has_error() might be sufficient,
> yet the documentation does not mention what will happen if NULL is fed
> to the function.
>
> Keep things explicit, which will allow us to remove the dri2_dpy->conn
> checking with the next commit.
>
> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>

I'm not really an expert when it comes to the egl code, but the series
looks like a nice improvement.  For the series:

Acked-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>  src/egl/drivers/dri2/platform_x11.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c
> index fecd36b..7a28318 100644
> --- a/src/egl/drivers/dri2/platform_x11.c
> +++ b/src/egl/drivers/dri2/platform_x11.c
> @@ -1222,7 +1222,7 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp)
>        dri2_dpy->screen = DefaultScreen(dpy);
>     }
>
> -   if (xcb_connection_has_error(dri2_dpy->conn)) {
> +   if (!dri2_dpy->conn || xcb_connection_has_error(dri2_dpy->conn)) {
>        _eglLog(_EGL_WARNING, "DRI2: xcb_connect failed");
>        goto cleanup_dpy;
>     }
> --
> 2.4.5
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list