tic bool
> +wsi_x11_check_dri3_compatible(xcb_connection_t *conn, int local_fd)
> +{
> +   xcb_screen_iterator_t screen_iter =
> +      xcb_setup_roots_iterator(xcb_get_setup(conn));
> +   xcb_screen_t *screen = screen_iter.data;
> +
> +   int dri3_fd = wsi_dri3_open(conn, screen->root, None);
> +   if (dri3_fd != -1) {
> +      char *local_dev = drmGetRenderDeviceNameFromFd(local_fd);
> +      char *dri3_dev = drmGetRenderDeviceNameFromFd(dri3_fd);
>
>
> Pardon me for being pedantic about error checking but what if one of these
> returns NULL?

The impossible has happened and you'll duly crash in strcmp, I'm not sure
how it would happen the fd you get didn't come from opening a dri device.

Dave.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to