xserver: Branch 'master' - 2 commits

Michel Dänzer daenzer at kemper.freedesktop.org
Mon May 28 15:26:05 UTC 2018


 glamor/glamor.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 4d5950ce14676f970d9de97380929a93948b98f2
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Wed May 23 11:18:02 2018 +0200

    glamor: Propagate glamor_fds_from_pixmap error in glamor_fd_from_pixmap
    
    glamor_fds_from_pixmap returns 0 on error, but we were treating that as
    success, continuing with uninitialized stride and fd values.
    
    Also bail if the offset isn't 0, same as in dri3_fd_from_pixmap.
    
    v2:
    * Reduce to a simple one-liner fix (Emil Velikov)
    
    Fixes: c8c276c9569b "glamor: Implement PixmapFromBuffers and
                         BuffersFromPixmap"
    Reviewed-by: Emil Velikov <emil.l.velikov at gmail.com>

diff --git a/glamor/glamor.c b/glamor/glamor.c
index e2c74d17a..54ca0db35 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -865,7 +865,7 @@ glamor_fd_from_pixmap(ScreenPtr screen,
                                  &modifier);
 
     /* Pixmaps with multi-planes/modifier are not supported in this interface */
-    if (ret > 1) {
+    if (ret != 1 || offsets[0] != 0) {
         while (ret > 0)
             close(fds[--ret]);
         return -1;
commit 3da999a0390407d512bf784e4faf01482bfff9ea
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Wed May 23 11:38:13 2018 +0200

    glamor: Always return 0 from glamor_fds_from_pixmap on error
    
    This matches what glamor_egl_fds_from_pixmap and dri3_fds_from_pixmap do
    and what proc_dri3_buffers_from_pixmap expects.
    
    Fixes: c8c276c9569b "glamor: Implement PixmapFromBuffers and
                         BuffersFromPixmap"
    Reviewed-by: Emil Velikov <emil.l.velikov at gmail.com>

diff --git a/glamor/glamor.c b/glamor/glamor.c
index d984d20f3..e2c74d17a 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -836,20 +836,20 @@ glamor_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds,
         glamor_get_screen_private(pixmap->drawable.pScreen);
 
     if (!glamor_priv->dri3_enabled)
-        return -1;
+        return 0;
     switch (pixmap_priv->type) {
     case GLAMOR_TEXTURE_DRM:
     case GLAMOR_TEXTURE_ONLY:
         if (!glamor_pixmap_ensure_fbo(pixmap, pixmap->drawable.depth == 30 ?
                                       GL_RGB10_A2 : GL_RGBA, 0))
-            return -1;
+            return 0;
         return glamor_egl_fds_from_pixmap(screen, pixmap, fds,
                                           strides, offsets,
                                           modifier);
     default:
         break;
     }
-    return -1;
+    return 0;
 }
 
 _X_EXPORT int


More information about the xorg-commit mailing list