The old info->fd_from_pixmap() driver hook, which is preferentially used in dri3_fd_from_pixmap(), can return error codes other than -1, e.g., -EINVAL (-22) on nouveau-ddx.
Not handling the error causes a broken/corrupted X-Connection resulting from a failed request. This fixes failure of sddm-greeter to start up under nouveau-ddx with DRI3 enabled and DRI3 protocol version properly clamped to 1.0 by the server (see followup patch). Fixes: 75bba3aedcb0 ("dri3: Use single-FD screen call for single-FD request") Signed-off-by: Mario Kleiner <mario.kleiner...@gmail.com> Cc: Daniel Stone <dani...@collabora.com> Cc: Adam Jackson <a...@redhat.com> --- dri3/dri3_request.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dri3/dri3_request.c b/dri3/dri3_request.c index 8b35036..61d3f9d 100644 --- a/dri3/dri3_request.c +++ b/dri3/dri3_request.c @@ -255,7 +255,7 @@ proc_dri3_buffer_from_pixmap(ClientPtr client) rep.bpp = pixmap->drawable.bitsPerPixel; fd = dri3_fd_from_pixmap(pixmap, &rep.stride, &rep.size); - if (fd == -1) + if (fd < 0) return BadPixmap; if (client->swapped) { -- 2.7.4 _______________________________________________ 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