summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Kleiner <mario.kleiner.de@gmail.com>2018-04-30 09:06:07 +0200
committerAdam Jackson <ajax@redhat.com>2018-04-30 13:47:44 -0400
commitfbc5c5cd532962d2df96a04e5c8cc0d21b47b08a (patch)
tree59394da53044de3e172dbaeb0209b517c0179fba
parent19d006ee3db4b4635ef9ef5c92562f3ffeddb305 (diff)
dri3: Fix error handling in dri3_buffer_from_pixmap request.
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.de@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Cc: Daniel Stone <daniels@collabora.com>
-rw-r--r--dri3/dri3_request.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dri3/dri3_request.c b/dri3/dri3_request.c
index 8b3503611..61d3f9d05 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) {