glamor: Rename the DRI-related pixmap functions.

There was confusion over whether they should have egl in the name, and
they had DRI3 in the name even though they're useful to have without
DRI3.

v2: Just rename glamor_name_from_pixmap for now -- I'd accidentally
    conflict-resolved in adding new parameters from a later commit.

Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Eric Anholt 2013-12-30 18:49:46 -08:00
parent 2d20f75b60
commit fb4a1e6ef6
3 changed files with 40 additions and 35 deletions

View File

@ -567,15 +567,15 @@ glamor_enable_dri3(ScreenPtr screen)
} }
Bool Bool
glamor_is_dri3_support_enabled(ScreenPtr screen) glamor_supports_pixmap_import_export(ScreenPtr screen)
{ {
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
return glamor_priv->dri3_enabled; return glamor_priv->dri3_enabled;
} }
int _X_EXPORT int
glamor_dri3_fd_from_pixmap(ScreenPtr screen, glamor_fd_from_pixmap(ScreenPtr screen,
PixmapPtr pixmap, CARD16 *stride, CARD32 *size) PixmapPtr pixmap, CARD16 *stride, CARD32 *size)
{ {
glamor_pixmap_private *pixmap_priv; glamor_pixmap_private *pixmap_priv;
@ -600,7 +600,7 @@ glamor_dri3_fd_from_pixmap(ScreenPtr screen,
} }
int int
glamor_dri3_name_from_pixmap(PixmapPtr pixmap) glamor_name_from_pixmap(PixmapPtr pixmap)
{ {
glamor_pixmap_private *pixmap_priv; glamor_pixmap_private *pixmap_priv;
glamor_screen_private *glamor_priv = glamor_screen_private *glamor_priv =

View File

@ -173,21 +173,23 @@ extern _X_EXPORT int glamor_egl_dri3_fd_name_from_tex(ScreenPtr, PixmapPtr,
unsigned int, Bool, unsigned int, Bool,
CARD16 *, CARD32 *); CARD16 *, CARD32 *);
/* @glamor_is_dri3_support_enabled: Returns if DRI3 support is enabled. /* @glamor_supports_pixmap_import_export: Returns whether
* glamor_fd_from_pixmap(), glamor_name_from_pixmap(), and
* glamor_pixmap_from_fd() are supported.
* *
* @screen: Current screen pointer. * @screen: Current screen pointer.
* *
* To have DRI3 support enabled, glamor and glamor_egl need to be initialized, * To have DRI3 support enabled, glamor and glamor_egl need to be
* and glamor_egl_init_textured_pixmap need to be called. glamor also * initialized. glamor also has to be compiled with gbm support.
* has to be compiled with gbm support. *
* The EGL layer need to have the following extensions working: * The EGL layer needs to have the following extensions working:
*
* .EGL_KHR_gl_texture_2D_image * .EGL_KHR_gl_texture_2D_image
* .EGL_EXT_image_dma_buf_import * .EGL_EXT_image_dma_buf_import
* If DRI3 support is not enabled, the following helpers will return an error.
* */ * */
extern _X_EXPORT Bool glamor_is_dri3_support_enabled(ScreenPtr screen); extern _X_EXPORT Bool glamor_supports_pixmap_import_export(ScreenPtr screen);
/* @glamor_dri3_fd_from_pixmap: DRI3 helper to get a dma-buf fd from a pixmap. /* @glamor_fd_from_pixmap: Get a dma-buf fd from a pixmap.
* *
* @screen: Current screen pointer. * @screen: Current screen pointer.
* @pixmap: The pixmap from which we want the fd. * @pixmap: The pixmap from which we want the fd.
@ -198,22 +200,25 @@ extern _X_EXPORT Bool glamor_is_dri3_support_enabled(ScreenPtr screen);
* content. * content.
* Returns the fd on success, -1 on error. * Returns the fd on success, -1 on error.
* */ * */
extern _X_EXPORT int glamor_dri3_fd_from_pixmap(ScreenPtr screen, extern _X_EXPORT int glamor_fd_from_pixmap(ScreenPtr screen,
PixmapPtr pixmap, PixmapPtr pixmap,
CARD16 *stride, CARD32 *size); CARD16 *stride, CARD32 *size);
/* @glamor_dri3_name_from_pixmap: helper to get an gem name from a pixmap. /**
* @glamor_name_from_pixmap: Gets a gem name from a pixmap.
* *
* @pixmap: The pixmap from which we want the gem name. * @pixmap: The pixmap from which we want the gem name.
* *
* the pixmap and the buffer associated by the gem name will share the same * the pixmap and the buffer associated by the gem name will share the
* content. This function can be used by the DDX to support DRI2, but needs * same content. This function can be used by the DDX to support DRI2,
* glamor DRI3 support to be activated. * and needs the same set of buffer export GL extensions as DRI3
* support.
*
* Returns the name on success, -1 on error. * Returns the name on success, -1 on error.
* */ * */
extern _X_EXPORT int glamor_dri3_name_from_pixmap(PixmapPtr pixmap); extern _X_EXPORT int glamor_name_from_pixmap(PixmapPtr pixmap);
/* @glamor_egl_dri3_pixmap_from_fd: DRI3 helper to get a pixmap from a dma-buf fd. /* @glamor_pixmap_from_fd: Creates a pixmap to wrap a dma-buf fd.
* *
* @screen: Current screen pointer. * @screen: Current screen pointer.
* @fd: The dma-buf fd to import. * @fd: The dma-buf fd to import.
@ -225,7 +230,7 @@ extern _X_EXPORT int glamor_dri3_name_from_pixmap(PixmapPtr pixmap);
* *
* Returns a valid pixmap if the import succeeded, else NULL. * Returns a valid pixmap if the import succeeded, else NULL.
* */ * */
extern _X_EXPORT PixmapPtr glamor_egl_dri3_pixmap_from_fd(ScreenPtr screen, extern _X_EXPORT PixmapPtr glamor_pixmap_from_fd(ScreenPtr screen,
int fd, int fd,
CARD16 width, CARD16 width,
CARD16 height, CARD16 height,

View File

@ -453,8 +453,8 @@ glamor_egl_dri3_fd_name_from_tex(ScreenPtr screen,
#endif #endif
} }
PixmapPtr _X_EXPORT PixmapPtr
glamor_egl_dri3_pixmap_from_fd(ScreenPtr screen, glamor_pixmap_from_fd(ScreenPtr screen,
int fd, int fd,
CARD16 width, CARD16 width,
CARD16 height, CARD16 height,