[PATCH v2] glamor: Make glamor_name_from_pixmap work without DRI3

Mark Kettenis kettenis at openbsd.org
Tue Nov 17 13:21:08 PST 2015


This function is used by the modesetting driver to implement DRI2 and
shouldn't fail on systems that don't support DRI3.  Remove the check
for DRI3 and rename glamor_egl_dri3_fd_name_from_tex to
glamor_egl_fd_name_from_tex.

Signed-off-by: Mark Kettenis <kettenis at openbsd.org>
---
 glamor/glamor.c     | 2 --
 glamor/glamor.h     | 6 +++---
 glamor/glamor_egl.c | 8 ++++----
 3 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/glamor/glamor.c b/glamor/glamor.c
index d4a0236..110bdb8 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -776,8 +776,6 @@ glamor_name_from_pixmap(PixmapPtr pixmap, CARD16 *stride, CARD32 *size)
     glamor_screen_private *glamor_priv =
         glamor_get_screen_private(pixmap->drawable.pScreen);
 
-    if (!glamor_priv->dri3_enabled)
-        return -1;
     switch (pixmap_priv->type) {
     case GLAMOR_TEXTURE_DRM:
     case GLAMOR_TEXTURE_ONLY:
diff --git a/glamor/glamor.h b/glamor/glamor.h
index 4be8800..01b6e4c 100644
--- a/glamor/glamor.h
+++ b/glamor/glamor.h
@@ -144,9 +144,9 @@ extern _X_EXPORT unsigned int glamor_egl_create_argb8888_based_texture(ScreenPtr
                                                                        int w,
                                                                        int h,
                                                                        Bool linear);
-extern _X_EXPORT int glamor_egl_dri3_fd_name_from_tex(ScreenPtr, PixmapPtr,
-                                                      unsigned int, Bool,
-                                                      CARD16 *, CARD32 *);
+extern _X_EXPORT int glamor_egl_fd_name_from_tex(ScreenPtr, PixmapPtr,
+						 unsigned int, Bool,
+						 CARD16 *, CARD32 *);
 
 extern void glamor_egl_destroy_pixmap_image(PixmapPtr pixmap);
 
diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index 2e6c7bd..9b91147 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -471,10 +471,10 @@ glamor_gbm_bo_from_pixmap(ScreenPtr screen, PixmapPtr pixmap)
 }
 
 int
-glamor_egl_dri3_fd_name_from_tex(ScreenPtr screen,
-                                 PixmapPtr pixmap,
-                                 unsigned int tex,
-                                 Bool want_name, CARD16 *stride, CARD32 *size)
+glamor_egl_fd_name_from_tex(ScreenPtr screen,
+			    PixmapPtr pixmap,
+			    unsigned int tex,
+			    Bool want_name, CARD16 *stride, CARD32 *size)
 {
 #ifdef GLAMOR_HAS_GBM
     struct glamor_egl_screen_private *glamor_egl;
-- 
2.6.3



More information about the xorg-devel mailing list