[PATCH xserver 07/11] glamor: Use real types for glamor_egl's public gbm functions.
Eric Anholt
eric at anholt.net
Fri Nov 6 12:52:01 PST 2015
I think void * was just used to avoid needing to #include gbm.h, but
we can just forward-declare the structs and be fine.
Signed-off-by: Eric Anholt <eric at anholt.net>
---
glamor/glamor.h | 11 +++++++----
glamor/glamor_egl.c | 7 ++++---
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/glamor/glamor.h b/glamor/glamor.h
index 4459fa4..12dff8e 100644
--- a/glamor/glamor.h
+++ b/glamor/glamor.h
@@ -40,6 +40,8 @@
#endif
struct glamor_context;
+struct gbm_bo;
+struct gbm_device;
/*
* glamor_pixmap_type : glamor pixmap's type.
@@ -147,7 +149,7 @@ extern _X_EXPORT int glamor_egl_dri3_fd_name_from_tex(ScreenPtr, PixmapPtr,
unsigned int, Bool,
CARD16 *, CARD32 *);
-extern _X_EXPORT void *glamor_egl_get_gbm_device(ScreenPtr screen);
+extern _X_EXPORT struct gbm_device *glamor_egl_get_gbm_device(ScreenPtr screen);
/* @glamor_supports_pixmap_import_export: Returns whether
* glamor_fd_from_pixmap(), glamor_name_from_pixmap(), and
@@ -207,8 +209,8 @@ extern _X_EXPORT int glamor_name_from_pixmap(PixmapPtr pixmap,
*
* Returns the gbm_bo on success, NULL on error.
* */
-extern _X_EXPORT void *glamor_gbm_bo_from_pixmap(ScreenPtr screen,
- PixmapPtr pixmap);
+extern _X_EXPORT struct gbm_bo *glamor_gbm_bo_from_pixmap(ScreenPtr screen,
+ PixmapPtr pixmap);
/* @glamor_pixmap_from_fd: Creates a pixmap to wrap a dma-buf fd.
*
@@ -315,7 +317,8 @@ extern _X_EXPORT Bool glamor_egl_create_textured_pixmap(PixmapPtr pixmap,
* This function is similar to glamor_egl_create_textured_pixmap.
*/
extern _X_EXPORT Bool
- glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, void *bo);
+ glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap,
+ struct gbm_bo *bo);
#endif
diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
index 6580141..f3650b7 100644
--- a/glamor/glamor_egl.c
+++ b/glamor/glamor_egl.c
@@ -175,7 +175,7 @@ glamor_create_texture_from_image(ScreenPtr screen,
return TRUE;
}
-void *
+struct gbm_device *
glamor_egl_get_gbm_device(ScreenPtr screen)
{
#ifdef GLAMOR_HAS_GBM
@@ -335,7 +335,8 @@ glamor_egl_create_textured_pixmap(PixmapPtr pixmap, int handle, int stride)
}
Bool
-glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, void *bo)
+glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap,
+ struct gbm_bo *bo)
{
ScreenPtr screen = pixmap->drawable.pScreen;
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
@@ -428,7 +429,7 @@ _get_gbm_bo_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, unsigned int tex)
}
#endif
-void *
+struct gbm_bo *
glamor_gbm_bo_from_pixmap(ScreenPtr screen, PixmapPtr pixmap)
{
#ifdef GLAMOR_HAS_GBM
--
2.6.2
More information about the xorg-devel
mailing list