glamor: Use real types for glamor_egl's public gbm functions.

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@anholt.net>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
Eric Anholt 2015-06-18 11:21:10 -07:00
parent f80758f32a
commit 1b8f16d8e6
2 changed files with 11 additions and 7 deletions

View File

@ -40,6 +40,8 @@
#endif #endif
struct glamor_context; struct glamor_context;
struct gbm_bo;
struct gbm_device;
/* /*
* glamor_pixmap_type : glamor pixmap's type. * 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, unsigned int, Bool,
CARD16 *, CARD32 *); 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_supports_pixmap_import_export: Returns whether
* glamor_fd_from_pixmap(), glamor_name_from_pixmap(), and * 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. * Returns the gbm_bo on success, NULL on error.
* */ * */
extern _X_EXPORT void *glamor_gbm_bo_from_pixmap(ScreenPtr screen, extern _X_EXPORT struct gbm_bo *glamor_gbm_bo_from_pixmap(ScreenPtr screen,
PixmapPtr pixmap); PixmapPtr pixmap);
/* @glamor_pixmap_from_fd: Creates a pixmap to wrap a dma-buf fd. /* @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. * This function is similar to glamor_egl_create_textured_pixmap.
*/ */
extern _X_EXPORT Bool 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 #endif

View File

@ -175,7 +175,7 @@ glamor_create_texture_from_image(ScreenPtr screen,
return TRUE; return TRUE;
} }
void * struct gbm_device *
glamor_egl_get_gbm_device(ScreenPtr screen) glamor_egl_get_gbm_device(ScreenPtr screen)
{ {
#ifdef GLAMOR_HAS_GBM #ifdef GLAMOR_HAS_GBM
@ -335,7 +335,8 @@ glamor_egl_create_textured_pixmap(PixmapPtr pixmap, int handle, int stride)
} }
Bool 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; ScreenPtr screen = pixmap->drawable.pScreen;
ScrnInfoPtr scrn = xf86ScreenToScrn(screen); ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
@ -428,7 +429,7 @@ _get_gbm_bo_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, unsigned int tex)
} }
#endif #endif
void * struct gbm_bo *
glamor_gbm_bo_from_pixmap(ScreenPtr screen, PixmapPtr pixmap) glamor_gbm_bo_from_pixmap(ScreenPtr screen, PixmapPtr pixmap)
{ {
#ifdef GLAMOR_HAS_GBM #ifdef GLAMOR_HAS_GBM