diff --git a/glamor/glamor.c b/glamor/glamor.c index e2c74d17a..63f0947fa 100644 --- a/glamor/glamor.c +++ b/glamor/glamor.c @@ -865,17 +865,15 @@ glamor_fd_from_pixmap(ScreenPtr screen, &modifier); /* Pixmaps with multi-planes/modifier are not supported in this interface */ - if (ret > 1) { - while (ret > 0) - close(fds[--ret]); - return -1; + if (ret == 1 && offsets[0] == 0) { + *stride = strides[0]; + *size = pixmap->drawable.height * *stride; + return fds[0]; } - ret = fds[0]; - *stride = strides[0]; - *size = pixmap->drawable.height * *stride; - - return ret; + while (ret > 0) + close(fds[--ret]); + return -1; } _X_EXPORT int