Blob Blame Raw
From patchwork Wed May 23 09:43:32 2018
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: [xserver,
 1/2] glamor: Always return 0 from glamor_fds_from_pixmap on error
From: =?utf-8?q?Michel_D=C3=A4nzer?= <michel@daenzer.net>
X-Patchwork-Id: 224909
Message-Id: <20180523094333.11076-1-michel@daenzer.net>
To: =?UTF-8?q?Louis-Francis=20Ratt=C3=A9-Boulianne?= <lfrb@collabora.com>,
 Daniel Stone <daniels@collabora.com>
Cc: xorg-devel@lists.x.org
Date: Wed, 23 May 2018 11:43:32 +0200

From: Michel Dänzer <michel.daenzer@amd.com>

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"
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
 glamor/glamor.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

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