Merge branch 'glamor-nonnull' into 'master'

Draft: glamor: Add nonnull attributes to help calm gcc analyzer

See merge request xorg/xserver!2107
This commit is contained in:
Alan Coopersmith 2025-12-19 00:54:32 -08:00
commit aa3e4bacdd
27 changed files with 343 additions and 238 deletions

View file

@ -41,14 +41,14 @@ DevPrivateKeyRec glamor_screen_private_key;
DevPrivateKeyRec glamor_pixmap_private_key; DevPrivateKeyRec glamor_pixmap_private_key;
DevPrivateKeyRec glamor_gc_private_key; DevPrivateKeyRec glamor_gc_private_key;
glamor_screen_private * glamor_screen_private * GLAMOR_NONNULL_ARGS((1))
glamor_get_screen_private(ScreenPtr screen) glamor_get_screen_private(ScreenPtr screen)
{ {
return (glamor_screen_private *) return (glamor_screen_private *)
dixLookupPrivate(&screen->devPrivates, &glamor_screen_private_key); dixLookupPrivate(&screen->devPrivates, &glamor_screen_private_key);
} }
void void GLAMOR_NONNULL_ARGS((1))
glamor_set_screen_private(ScreenPtr screen, glamor_screen_private *priv) glamor_set_screen_private(ScreenPtr screen, glamor_screen_private *priv)
{ {
dixSetPrivate(&screen->devPrivates, &glamor_screen_private_key, priv); dixSetPrivate(&screen->devPrivates, &glamor_screen_private_key, priv);
@ -65,7 +65,7 @@ glamor_set_screen_private(ScreenPtr screen, glamor_screen_private *priv)
* redirected window, and the translation coordinates are provided by calling * redirected window, and the translation coordinates are provided by calling
* exaGetOffscreenPixmap() on the drawable. * exaGetOffscreenPixmap() on the drawable.
*/ */
PixmapPtr PixmapPtr GLAMOR_NONNULL_ARGS((1))
glamor_get_drawable_pixmap(DrawablePtr drawable) glamor_get_drawable_pixmap(DrawablePtr drawable)
{ {
if (drawable->type == DRAWABLE_WINDOW) if (drawable->type == DRAWABLE_WINDOW)
@ -74,7 +74,7 @@ glamor_get_drawable_pixmap(DrawablePtr drawable)
return (PixmapPtr) drawable; return (PixmapPtr) drawable;
} }
static void static void GLAMOR_NONNULL_ARGS((1, 2))
glamor_init_pixmap_private_small(PixmapPtr pixmap, glamor_pixmap_private *pixmap_priv) glamor_init_pixmap_private_small(PixmapPtr pixmap, glamor_pixmap_private *pixmap_priv)
{ {
pixmap_priv->box.x1 = 0; pixmap_priv->box.x1 = 0;
@ -89,7 +89,7 @@ glamor_init_pixmap_private_small(PixmapPtr pixmap, glamor_pixmap_private *pixmap
pixmap_priv->fbo_array = &pixmap_priv->fbo; pixmap_priv->fbo_array = &pixmap_priv->fbo;
} }
void void GLAMOR_NONNULL_ARGS((1))
glamor_set_pixmap_type(PixmapPtr pixmap, glamor_pixmap_type_t type) glamor_set_pixmap_type(PixmapPtr pixmap, glamor_pixmap_type_t type)
{ {
glamor_pixmap_private *pixmap_priv; glamor_pixmap_private *pixmap_priv;
@ -99,7 +99,7 @@ glamor_set_pixmap_type(PixmapPtr pixmap, glamor_pixmap_type_t type)
glamor_init_pixmap_private_small(pixmap, pixmap_priv); glamor_init_pixmap_private_small(pixmap, pixmap_priv);
} }
Bool Bool GLAMOR_NONNULL_ARGS((1))
glamor_set_pixmap_texture(PixmapPtr pixmap, unsigned int tex) glamor_set_pixmap_texture(PixmapPtr pixmap, unsigned int tex)
{ {
ScreenPtr screen = pixmap->drawable.pScreen; ScreenPtr screen = pixmap->drawable.pScreen;
@ -129,7 +129,7 @@ glamor_set_pixmap_texture(PixmapPtr pixmap, unsigned int tex)
return TRUE; return TRUE;
} }
void void GLAMOR_NONNULL_ARGS((1))
glamor_clear_pixmap(PixmapPtr pixmap) glamor_clear_pixmap(PixmapPtr pixmap)
{ {
ScreenPtr screen = pixmap->drawable.pScreen; ScreenPtr screen = pixmap->drawable.pScreen;
@ -198,7 +198,7 @@ glamor_bind_texture(glamor_screen_private *glamor_priv, GLenum texture,
} }
} }
PixmapPtr PixmapPtr GLAMOR_NONNULL_ARGS((1))
glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth, glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
unsigned int usage) unsigned int usage)
{ {
@ -262,7 +262,7 @@ glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
return pixmap; return pixmap;
} }
Bool Bool GLAMOR_NONNULL_ARGS((1))
glamor_destroy_pixmap(PixmapPtr pixmap) glamor_destroy_pixmap(PixmapPtr pixmap)
{ {
if (pixmap->refcnt == 1) { if (pixmap->refcnt == 1) {
@ -272,14 +272,14 @@ glamor_destroy_pixmap(PixmapPtr pixmap)
return fbDestroyPixmap(pixmap); return fbDestroyPixmap(pixmap);
} }
void void GLAMOR_NONNULL_ARGS((1))
glamor_block_handler(ScreenPtr screen) glamor_block_handler(ScreenPtr screen)
{ {
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
glamor_flush(glamor_priv); glamor_flush(glamor_priv);
} }
static void static void GLAMOR_NONNULL_ARGS((1))
_glamor_block_handler(ScreenPtr screen, void *timeout) _glamor_block_handler(ScreenPtr screen, void *timeout)
{ {
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
@ -423,7 +423,7 @@ glamor_setup_debug_output(ScreenPtr screen)
glEnable(GL_DEBUG_OUTPUT); glEnable(GL_DEBUG_OUTPUT);
} }
const struct glamor_format * const struct glamor_format * GLAMOR_NONNULL_ARGS((1)) GLAMOR_NONNULL_RETURN
glamor_format_for_pixmap(PixmapPtr pixmap) glamor_format_for_pixmap(PixmapPtr pixmap)
{ {
ScreenPtr pScreen = pixmap->drawable.pScreen; ScreenPtr pScreen = pixmap->drawable.pScreen;
@ -436,7 +436,7 @@ glamor_format_for_pixmap(PixmapPtr pixmap)
return &glamor_priv->formats[pixmap->drawable.depth]; return &glamor_priv->formats[pixmap->drawable.depth];
} }
static void static void GLAMOR_NONNULL_ARGS((1))
glamor_add_format(ScreenPtr screen, int depth, CARD32 render_format, glamor_add_format(ScreenPtr screen, int depth, CARD32 render_format,
GLenum internalformat, GLenum format, GLenum type, GLenum internalformat, GLenum format, GLenum type,
Bool rendering_supported) Bool rendering_supported)
@ -532,7 +532,7 @@ glamor_add_format(ScreenPtr screen, int depth, CARD32 render_format,
* here, or channels will end up swizzled around. Similarly, the * here, or channels will end up swizzled around. Similarly, the
* driver's visual masks also need to match what we're doing here. * driver's visual masks also need to match what we're doing here.
*/ */
static void static void GLAMOR_NONNULL_ARGS((1))
glamor_setup_formats(ScreenPtr screen) glamor_setup_formats(ScreenPtr screen)
{ {
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
@ -892,7 +892,7 @@ glamor_init(ScreenPtr screen, unsigned int flags)
return FALSE; return FALSE;
} }
static void static void GLAMOR_NONNULL_ARGS((1))
glamor_release_screen_priv(ScreenPtr screen) glamor_release_screen_priv(ScreenPtr screen)
{ {
glamor_screen_private *glamor_priv; glamor_screen_private *glamor_priv;
@ -905,7 +905,7 @@ glamor_release_screen_priv(ScreenPtr screen)
glamor_set_screen_private(screen, NULL); glamor_set_screen_private(screen, NULL);
} }
Bool Bool GLAMOR_NONNULL_ARGS((1))
glamor_close_screen(ScreenPtr screen) glamor_close_screen(ScreenPtr screen)
{ {
glamor_screen_private *glamor_priv; glamor_screen_private *glamor_priv;
@ -975,7 +975,7 @@ glamor_get_glvnd_vendor(ScreenPtr screen)
return glamor_priv->glvnd_vendor; return glamor_priv->glvnd_vendor;
} }
void void GLAMOR_NONNULL_ARGS((1))
glamor_enable_dri3(ScreenPtr screen) glamor_enable_dri3(ScreenPtr screen)
{ {
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
@ -983,7 +983,7 @@ glamor_enable_dri3(ScreenPtr screen)
glamor_priv->dri3_enabled = TRUE; glamor_priv->dri3_enabled = TRUE;
} }
Bool Bool GLAMOR_NONNULL_ARGS((1))
glamor_supports_pixmap_import_export(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);
@ -991,7 +991,7 @@ glamor_supports_pixmap_import_export(ScreenPtr screen)
return glamor_priv->dri3_enabled; return glamor_priv->dri3_enabled;
} }
void void GLAMOR_NONNULL_ARGS((1))
glamor_set_drawable_modifiers_func(ScreenPtr screen, glamor_set_drawable_modifiers_func(ScreenPtr screen,
GetDrawableModifiersFuncPtr func) GetDrawableModifiersFuncPtr func)
{ {
@ -1000,7 +1000,7 @@ glamor_set_drawable_modifiers_func(ScreenPtr screen,
glamor_priv->get_drawable_modifiers = func; glamor_priv->get_drawable_modifiers = func;
} }
Bool Bool GLAMOR_NONNULL_ARGS((1))
glamor_get_drawable_modifiers(DrawablePtr draw, uint32_t format, glamor_get_drawable_modifiers(DrawablePtr draw, uint32_t format,
uint32_t *num_modifiers, uint64_t **modifiers) uint32_t *num_modifiers, uint64_t **modifiers)
{ {
@ -1016,7 +1016,7 @@ glamor_get_drawable_modifiers(DrawablePtr draw, uint32_t format,
return TRUE; return TRUE;
} }
static int static int GLAMOR_NONNULL_ARGS((2))
_glamor_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds, _glamor_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds,
uint32_t *strides, uint32_t *offsets, uint32_t *strides, uint32_t *offsets,
CARD32 *size, uint64_t *modifier) CARD32 *size, uint64_t *modifier)
@ -1053,7 +1053,7 @@ _glamor_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds,
return 0; return 0;
} }
int int GLAMOR_NONNULL_ARGS((2))
glamor_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds, glamor_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds,
uint32_t *strides, uint32_t *offsets, uint32_t *strides, uint32_t *offsets,
uint64_t *modifier) uint64_t *modifier)
@ -1062,7 +1062,7 @@ glamor_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds,
NULL, modifier); NULL, modifier);
} }
int int GLAMOR_NONNULL_ARGS((2))
glamor_fd_from_pixmap(ScreenPtr screen, glamor_fd_from_pixmap(ScreenPtr screen,
PixmapPtr pixmap, CARD16 *stride, CARD32 *size) PixmapPtr pixmap, CARD16 *stride, CARD32 *size)
{ {
@ -1079,7 +1079,7 @@ glamor_fd_from_pixmap(ScreenPtr screen,
return fd; return fd;
} }
int int GLAMOR_NONNULL_ARGS((2))
glamor_shareable_fd_from_pixmap(ScreenPtr screen, glamor_shareable_fd_from_pixmap(ScreenPtr screen,
PixmapPtr pixmap, CARD16 *stride, CARD32 *size) PixmapPtr pixmap, CARD16 *stride, CARD32 *size)
{ {
@ -1100,7 +1100,7 @@ glamor_shareable_fd_from_pixmap(ScreenPtr screen,
return ret; return ret;
} }
int int GLAMOR_NONNULL_ARGS((1))
glamor_name_from_pixmap(PixmapPtr pixmap, CARD16 *stride, CARD32 *size) glamor_name_from_pixmap(PixmapPtr pixmap, CARD16 *stride, CARD32 *size)
{ {
glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
@ -1118,7 +1118,7 @@ glamor_name_from_pixmap(PixmapPtr pixmap, CARD16 *stride, CARD32 *size)
return -1; return -1;
} }
void void GLAMOR_NONNULL_ARGS((1))
glamor_finish(ScreenPtr screen) glamor_finish(ScreenPtr screen)
{ {
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);

View file

@ -39,6 +39,22 @@
#include <xf86xv.h> #include <xf86xv.h>
#endif #endif
#ifndef __has_attribute
# define __has_attribute(x) 0 /* Compatibility with older compilers. */
#endif
#if __has_attribute(__nonnull__)
#define GLAMOR_NONNULL_ARGS(x) __attribute__((__nonnull__ x))
#else
#define GLAMOR_NONNULL_ARGS(x) /* */
#endif
#if __has_attribute(__returns_nonnull__)
#define GLAMOR_NONNULL_RETURN __attribute__((__returns_nonnull__))
#else
#define GLAMOR_NONNULL_RETURN /* */
#endif
struct glamor_context; struct glamor_context;
struct gbm_bo; struct gbm_bo;
struct gbm_device; struct gbm_device;
@ -106,19 +122,24 @@ extern _X_EXPORT void glamor_fini(ScreenPtr screen);
* screen pixmap which must be a glamor pixmap and requires * screen pixmap which must be a glamor pixmap and requires
* the internal data structure still exist at that time. * the internal data structure still exist at that time.
* Otherwise, the glamor internal structure will not be freed.*/ * Otherwise, the glamor internal structure will not be freed.*/
extern _X_EXPORT Bool glamor_close_screen(ScreenPtr screen); extern _X_EXPORT Bool glamor_close_screen(ScreenPtr screen)
GLAMOR_NONNULL_ARGS((1));
extern _X_EXPORT uint32_t glamor_get_pixmap_texture(PixmapPtr pixmap); extern _X_EXPORT uint32_t glamor_get_pixmap_texture(PixmapPtr pixmap);
extern _X_EXPORT Bool glamor_set_pixmap_texture(PixmapPtr pixmap, extern _X_EXPORT Bool glamor_set_pixmap_texture(PixmapPtr pixmap,
unsigned int tex); unsigned int tex)
GLAMOR_NONNULL_ARGS((1));
extern _X_EXPORT void glamor_set_pixmap_type(PixmapPtr pixmap, extern _X_EXPORT void glamor_set_pixmap_type(PixmapPtr pixmap,
glamor_pixmap_type_t type); glamor_pixmap_type_t type)
GLAMOR_NONNULL_ARGS((1));
extern _X_EXPORT void glamor_clear_pixmap(PixmapPtr pixmap); extern _X_EXPORT void glamor_clear_pixmap(PixmapPtr pixmap)
GLAMOR_NONNULL_ARGS((1));
extern _X_EXPORT void glamor_block_handler(ScreenPtr screen); extern _X_EXPORT void glamor_block_handler(ScreenPtr screen)
GLAMOR_NONNULL_ARGS((1));
/* This function should be called after glamor_init, /* This function should be called after glamor_init,
* but before adding a glamor GLX provider */ * but before adding a glamor GLX provider */
@ -127,8 +148,10 @@ extern _X_EXPORT void glamor_set_glvnd_vendor(ScreenPtr screen,
extern _X_EXPORT const char *glamor_get_glvnd_vendor(ScreenPtr screen); extern _X_EXPORT const char *glamor_get_glvnd_vendor(ScreenPtr screen);
extern _X_EXPORT PixmapPtr glamor_create_pixmap(ScreenPtr screen, int w, int h, extern _X_EXPORT PixmapPtr glamor_create_pixmap(ScreenPtr screen, int w, int h,
int depth, unsigned int usage); int depth, unsigned int usage)
extern _X_EXPORT Bool glamor_destroy_pixmap(PixmapPtr pixmap); GLAMOR_NONNULL_ARGS((1));
extern _X_EXPORT Bool glamor_destroy_pixmap(PixmapPtr pixmap)
GLAMOR_NONNULL_ARGS((1));
#define GLAMOR_CREATE_PIXMAP_CPU 0x100 #define GLAMOR_CREATE_PIXMAP_CPU 0x100
#define GLAMOR_CREATE_PIXMAP_FIXUP 0x101 #define GLAMOR_CREATE_PIXMAP_FIXUP 0x101
@ -146,21 +169,29 @@ extern _X_EXPORT Bool glamor_destroy_pixmap(PixmapPtr pixmap);
* fbos of the two pixmaps. * fbos of the two pixmaps.
* */ * */
extern _X_EXPORT void glamor_egl_exchange_buffers(PixmapPtr front, extern _X_EXPORT void glamor_egl_exchange_buffers(PixmapPtr front,
PixmapPtr back); PixmapPtr back)
GLAMOR_NONNULL_ARGS((1, 2));
extern _X_EXPORT void glamor_pixmap_exchange_fbos(PixmapPtr front, extern _X_EXPORT void glamor_pixmap_exchange_fbos(PixmapPtr front,
PixmapPtr back); PixmapPtr back)
GLAMOR_NONNULL_ARGS((1, 2));
/* The DDX is not supposed to call these four functions */ /* The DDX is not supposed to call these four functions */
extern _X_EXPORT void glamor_enable_dri3(ScreenPtr screen); extern _X_EXPORT void glamor_enable_dri3(ScreenPtr screen)
GLAMOR_NONNULL_ARGS((1));
extern _X_EXPORT int glamor_egl_fds_from_pixmap(ScreenPtr, PixmapPtr, int *, extern _X_EXPORT int glamor_egl_fds_from_pixmap(ScreenPtr, PixmapPtr, int *,
uint32_t *, uint32_t *, uint32_t *, uint32_t *,
uint64_t *); uint64_t *)
GLAMOR_NONNULL_ARGS((1, 2));
extern _X_EXPORT int glamor_egl_fd_name_from_pixmap(ScreenPtr, PixmapPtr, extern _X_EXPORT int glamor_egl_fd_name_from_pixmap(ScreenPtr, PixmapPtr,
CARD16 *, CARD32 *); CARD16 *, CARD32 *)
GLAMOR_NONNULL_ARGS((1, 2));
extern _X_EXPORT struct gbm_device *glamor_egl_get_gbm_device(ScreenPtr screen); extern _X_EXPORT struct gbm_device *glamor_egl_get_gbm_device(ScreenPtr screen)
extern _X_EXPORT int glamor_egl_fd_from_pixmap(ScreenPtr, PixmapPtr, CARD16 *, CARD32 *); GLAMOR_NONNULL_ARGS((1));
extern _X_EXPORT int glamor_egl_fd_from_pixmap(ScreenPtr, PixmapPtr,
CARD16 *, CARD32 *)
GLAMOR_NONNULL_ARGS((1, 2));
/* @glamor_supports_pixmap_import_export: Returns whether /* @glamor_supports_pixmap_import_export: Returns whether
* glamor_fds_from_pixmap(), glamor_name_from_pixmap(), and * glamor_fds_from_pixmap(), glamor_name_from_pixmap(), and
@ -175,7 +206,8 @@ extern _X_EXPORT int glamor_egl_fd_from_pixmap(ScreenPtr, PixmapPtr, CARD16 *, C
* *
* .EGL_KHR_surfaceless_context * .EGL_KHR_surfaceless_context
* */ * */
extern _X_EXPORT Bool glamor_supports_pixmap_import_export(ScreenPtr screen); extern _X_EXPORT Bool glamor_supports_pixmap_import_export(ScreenPtr screen)
GLAMOR_NONNULL_ARGS((1));
/* @glamor_fds_from_pixmap: Get a dma-buf fd from a pixmap. /* @glamor_fds_from_pixmap: Get a dma-buf fd from a pixmap.
* *
@ -192,7 +224,8 @@ extern _X_EXPORT int glamor_fds_from_pixmap(ScreenPtr screen,
PixmapPtr pixmap, PixmapPtr pixmap,
int *fds, int *fds,
uint32_t *strides, uint32_t *offsets, uint32_t *strides, uint32_t *offsets,
uint64_t *modifier); uint64_t *modifier)
GLAMOR_NONNULL_ARGS((2));
/* @glamor_fd_from_pixmap: Get a dma-buf fd from a pixmap. /* @glamor_fd_from_pixmap: Get a dma-buf fd from a pixmap.
* *
@ -207,7 +240,8 @@ extern _X_EXPORT int glamor_fds_from_pixmap(ScreenPtr screen,
* */ * */
extern _X_EXPORT int glamor_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_NONNULL_ARGS((2));
/* @glamor_shareable_fd_from_pixmap: Get a dma-buf fd suitable for sharing /* @glamor_shareable_fd_from_pixmap: Get a dma-buf fd suitable for sharing
* with other GPUs from a pixmap. * with other GPUs from a pixmap.
@ -227,7 +261,8 @@ extern _X_EXPORT int glamor_fd_from_pixmap(ScreenPtr screen,
extern _X_EXPORT int glamor_shareable_fd_from_pixmap(ScreenPtr screen, extern _X_EXPORT int glamor_shareable_fd_from_pixmap(ScreenPtr screen,
PixmapPtr pixmap, PixmapPtr pixmap,
CARD16 *stride, CARD16 *stride,
CARD32 *size); CARD32 *size)
GLAMOR_NONNULL_ARGS((2));
/** /**
* @glamor_name_from_pixmap: Gets a gem name from a pixmap. * @glamor_name_from_pixmap: Gets a gem name from a pixmap.
@ -242,7 +277,8 @@ extern _X_EXPORT int glamor_shareable_fd_from_pixmap(ScreenPtr screen,
* Returns the name on success, -1 on error. * Returns the name on success, -1 on error.
* */ * */
extern _X_EXPORT int glamor_name_from_pixmap(PixmapPtr pixmap, extern _X_EXPORT int glamor_name_from_pixmap(PixmapPtr pixmap,
CARD16 *stride, CARD32 *size); CARD16 *stride, CARD32 *size)
GLAMOR_NONNULL_ARGS((1));
/* @glamor_gbm_bo_from_pixmap: Get a GBM bo from a pixmap. /* @glamor_gbm_bo_from_pixmap: Get a GBM bo from a pixmap.
* *
@ -257,7 +293,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 struct gbm_bo *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_NONNULL_ARGS((1, 2));
/* @glamor_pixmap_from_fds: Creates a pixmap to wrap a dma-buf fds. /* @glamor_pixmap_from_fds: Creates a pixmap to wrap a dma-buf fds.
* *
@ -282,7 +319,8 @@ extern _X_EXPORT PixmapPtr glamor_pixmap_from_fds(ScreenPtr screen,
const CARD32 *offsets, const CARD32 *offsets,
CARD8 depth, CARD8 depth,
CARD8 bpp, CARD8 bpp,
uint64_t modifier); uint64_t modifier)
GLAMOR_NONNULL_ARGS((1));
/* @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.
* *
@ -302,7 +340,8 @@ extern _X_EXPORT PixmapPtr glamor_pixmap_from_fd(ScreenPtr screen,
CARD16 height, CARD16 height,
CARD16 stride, CARD16 stride,
CARD8 depth, CARD8 depth,
CARD8 bpp); CARD8 bpp)
GLAMOR_NONNULL_ARGS((1));
/* @glamor_back_pixmap_from_fd: Backs an existing pixmap with a dma-buf fd. /* @glamor_back_pixmap_from_fd: Backs an existing pixmap with a dma-buf fd.
* *
@ -322,24 +361,29 @@ extern _X_EXPORT Bool glamor_back_pixmap_from_fd(PixmapPtr pixmap,
CARD16 height, CARD16 height,
CARD16 stride, CARD16 stride,
CARD8 depth, CARD8 depth,
CARD8 bpp); CARD8 bpp)
GLAMOR_NONNULL_ARGS((1));
extern _X_EXPORT Bool glamor_get_formats(ScreenPtr screen, extern _X_EXPORT Bool glamor_get_formats(ScreenPtr screen,
CARD32 *num_formats, CARD32 *num_formats,
CARD32 **formats); CARD32 **formats)
GLAMOR_NONNULL_ARGS((1, 2, 3));
extern _X_EXPORT Bool glamor_get_modifiers(ScreenPtr screen, extern _X_EXPORT Bool glamor_get_modifiers(ScreenPtr screen,
uint32_t format, uint32_t format,
uint32_t *num_modifiers, uint32_t *num_modifiers,
uint64_t **modifiers); uint64_t **modifiers)
GLAMOR_NONNULL_ARGS((1));
extern _X_EXPORT Bool glamor_get_drawable_modifiers(DrawablePtr draw, extern _X_EXPORT Bool glamor_get_drawable_modifiers(DrawablePtr draw,
uint32_t format, uint32_t format,
uint32_t *num_modifiers, uint32_t *num_modifiers,
uint64_t **modifiers); uint64_t **modifiers)
GLAMOR_NONNULL_ARGS((1));
extern _X_EXPORT void glamor_set_drawable_modifiers_func(ScreenPtr screen, extern _X_EXPORT void glamor_set_drawable_modifiers_func(ScreenPtr screen,
GetDrawableModifiersFuncPtr func); GetDrawableModifiersFuncPtr func)
GLAMOR_NONNULL_ARGS((1));
#ifdef GLAMOR_FOR_XORG #ifdef GLAMOR_FOR_XORG
@ -354,7 +398,8 @@ extern _X_EXPORT void glamor_set_drawable_modifiers_func(ScreenPtr screen,
* Should be called from DDX's preInit function. * Should be called from DDX's preInit function.
* Return TRUE if success, otherwise return FALSE. * Return TRUE if success, otherwise return FALSE.
* */ * */
extern _X_EXPORT Bool glamor_egl_init(ScrnInfoPtr scrn, int fd); extern _X_EXPORT Bool glamor_egl_init(ScrnInfoPtr scrn, int fd)
GLAMOR_NONNULL_ARGS((1));
extern _X_EXPORT Bool glamor_egl_init_textured_pixmap(ScreenPtr screen); extern _X_EXPORT Bool glamor_egl_init_textured_pixmap(ScreenPtr screen);
@ -368,7 +413,8 @@ extern _X_EXPORT Bool glamor_egl_init_textured_pixmap(ScreenPtr screen);
* screen pixmap is a special, we handle it separately in this function. * screen pixmap is a special, we handle it separately in this function.
*/ */
extern _X_EXPORT Bool glamor_egl_create_textured_screen(ScreenPtr screen, extern _X_EXPORT Bool glamor_egl_create_textured_screen(ScreenPtr screen,
int handle, int stride); int handle, int stride)
GLAMOR_NONNULL_ARGS((1));
/* Obsolete entrypoint, temporarily left here for API compatibility /* Obsolete entrypoint, temporarily left here for API compatibility
* for xf86-video-ati. * for xf86-video-ati.
@ -389,7 +435,8 @@ extern _X_EXPORT Bool glamor_egl_create_textured_screen(ScreenPtr screen,
* as well. Return true if successful, otherwise return FALSE. * as well. Return true if successful, otherwise return FALSE.
*/ */
extern _X_EXPORT Bool glamor_egl_create_textured_pixmap(PixmapPtr pixmap, extern _X_EXPORT Bool glamor_egl_create_textured_pixmap(PixmapPtr pixmap,
int handle, int stride); int handle, int stride)
GLAMOR_NONNULL_ARGS((1));
/* /*
* @glamor_egl_create_textured_pixmap_from_bo: Try to create a textured pixmap * @glamor_egl_create_textured_pixmap_from_bo: Try to create a textured pixmap
@ -403,14 +450,17 @@ extern _X_EXPORT Bool glamor_egl_create_textured_pixmap(PixmapPtr pixmap,
extern _X_EXPORT Bool extern _X_EXPORT Bool
glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap,
struct gbm_bo *bo, struct gbm_bo *bo,
Bool used_modifiers); Bool used_modifiers)
GLAMOR_NONNULL_ARGS((1));
extern _X_EXPORT const char *glamor_egl_get_driver_name(ScreenPtr screen); extern _X_EXPORT const char *glamor_egl_get_driver_name(ScreenPtr screen)
GLAMOR_NONNULL_ARGS((1));
#endif #endif
extern _X_EXPORT void glamor_egl_screen_init(ScreenPtr screen, extern _X_EXPORT void glamor_egl_screen_init(ScreenPtr screen,
struct glamor_context *glamor_ctx); struct glamor_context *glamor_ctx)
GLAMOR_NONNULL_ARGS((1, 2));
extern _X_EXPORT int glamor_create_gc(GCPtr gc); extern _X_EXPORT int glamor_create_gc(GCPtr gc);
@ -424,7 +474,7 @@ extern _X_EXPORT void glamor_destroy_gc(GCPtr gc);
extern Bool _X_EXPORT glamor_change_window_attributes(WindowPtr pWin, unsigned long mask); extern Bool _X_EXPORT glamor_change_window_attributes(WindowPtr pWin, unsigned long mask);
extern void _X_EXPORT glamor_copy_window(WindowPtr window, DDXPointRec old_origin, RegionPtr src_region); extern void _X_EXPORT glamor_copy_window(WindowPtr window, DDXPointRec old_origin, RegionPtr src_region);
extern _X_EXPORT void glamor_finish(ScreenPtr screen); extern _X_EXPORT void glamor_finish(ScreenPtr screen) GLAMOR_NONNULL_ARGS((1));
#define HAS_GLAMOR_TEXT 1 #define HAS_GLAMOR_TEXT 1
#ifdef GLAMOR_FOR_XORG #ifdef GLAMOR_FOR_XORG

View file

@ -267,6 +267,7 @@ glamor_glyphs_flush(CARD8 op, PicturePtr src, PicturePtr dst,
DrawablePtr drawable = dst->pDrawable; DrawablePtr drawable = dst->pDrawable;
glamor_screen_private *glamor_priv = glamor_get_screen_private(drawable->pScreen); glamor_screen_private *glamor_priv = glamor_get_screen_private(drawable->pScreen);
PixmapPtr atlas_pixmap = atlas->atlas; PixmapPtr atlas_pixmap = atlas->atlas;
assert(atlas_pixmap != NULL);
glamor_pixmap_private *atlas_priv = glamor_get_pixmap_private(atlas_pixmap); glamor_pixmap_private *atlas_priv = glamor_get_pixmap_private(atlas_pixmap);
glamor_pixmap_fbo *atlas_fbo = glamor_pixmap_fbo_at(atlas_priv, 0); glamor_pixmap_fbo *atlas_fbo = glamor_pixmap_fbo_at(atlas_priv, 0);
PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable);
@ -361,7 +362,7 @@ glamor_glyph_start(ScreenPtr screen, int count)
return v; return v;
} }
static inline struct glamor_glyph_atlas * static inline struct glamor_glyph_atlas * GLAMOR_NONNULL_RETURN
glamor_atlas_for_glyph(glamor_screen_private *glamor_priv, DrawablePtr drawable) glamor_atlas_for_glyph(glamor_screen_private *glamor_priv, DrawablePtr drawable)
{ {
if (drawable->depth == 32) if (drawable->depth == 32)
@ -444,6 +445,7 @@ glamor_composite_glyphs(CARD8 op,
} }
glyph_atlas = next_atlas; glyph_atlas = next_atlas;
} }
assert(glyph_atlas != NULL);
/* Glyph not cached in current atlas? /* Glyph not cached in current atlas?
*/ */

View file

@ -35,7 +35,7 @@
#include "glamor_priv.h" #include "glamor_priv.h"
Bool Bool GLAMOR_NONNULL_ARGS((1))
glamor_get_drawable_location(const DrawablePtr drawable) glamor_get_drawable_location(const DrawablePtr drawable)
{ {
PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable);

View file

@ -74,7 +74,7 @@ static const glamor_facet glamor_facet_double_dash_lines = {
glamor_program_location_bg), glamor_program_location_bg),
}; };
static PixmapPtr static PixmapPtr GLAMOR_NONNULL_ARGS((1))
glamor_get_dash_pixmap(GCPtr gc) glamor_get_dash_pixmap(GCPtr gc)
{ {
glamor_gc_private *gc_priv = glamor_get_gc_private(gc); glamor_gc_private *gc_priv = glamor_get_gc_private(gc);
@ -129,7 +129,7 @@ bail:
return NULL; return NULL;
} }
static glamor_program * static glamor_program * GLAMOR_NONNULL_ARGS((1, 2))
glamor_dash_setup(DrawablePtr drawable, GCPtr gc) glamor_dash_setup(DrawablePtr drawable, GCPtr gc)
{ {
ScreenPtr screen = drawable->pScreen; ScreenPtr screen = drawable->pScreen;
@ -199,7 +199,7 @@ bail:
return NULL; return NULL;
} }
static void static void GLAMOR_NONNULL_ARGS((1, 2, 3))
glamor_dash_loop(DrawablePtr drawable, GCPtr gc, glamor_program *prog, glamor_dash_loop(DrawablePtr drawable, GCPtr gc, glamor_program *prog,
int n, GLenum mode) int n, GLenum mode)
{ {
@ -237,7 +237,7 @@ glamor_line_length(short x1, short y1, short x2, short y2)
return max(abs(x2 - x1), abs(y2 - y1)); return max(abs(x2 - x1), abs(y2 - y1));
} }
Bool Bool GLAMOR_NONNULL_ARGS((1, 2))
glamor_poly_lines_dash_gl(DrawablePtr drawable, GCPtr gc, glamor_poly_lines_dash_gl(DrawablePtr drawable, GCPtr gc,
int mode, int n, DDXPointPtr points) int mode, int n, DDXPointPtr points)
{ {
@ -302,7 +302,7 @@ glamor_poly_lines_dash_gl(DrawablePtr drawable, GCPtr gc,
return TRUE; return TRUE;
} }
static short * static short * GLAMOR_NONNULL_ARGS((1))
glamor_add_segment(short *v, short x1, short y1, short x2, short y2, glamor_add_segment(short *v, short x1, short y1, short x2, short y2,
int dash_start, int dash_end) int dash_start, int dash_end)
{ {
@ -316,7 +316,7 @@ glamor_add_segment(short *v, short x1, short y1, short x2, short y2,
return v + 6; return v + 6;
} }
Bool Bool GLAMOR_NONNULL_ARGS((1, 2))
glamor_poly_segment_dash_gl(DrawablePtr drawable, GCPtr gc, glamor_poly_segment_dash_gl(DrawablePtr drawable, GCPtr gc,
int nseg, xSegment *segs) int nseg, xSegment *segs)
{ {

View file

@ -69,14 +69,14 @@ struct glamor_egl_screen_private {
int xf86GlamorEGLPrivateIndex = -1; int xf86GlamorEGLPrivateIndex = -1;
static struct glamor_egl_screen_private * static struct glamor_egl_screen_private * GLAMOR_NONNULL_ARGS((1))
glamor_egl_get_screen_private(ScrnInfoPtr scrn) glamor_egl_get_screen_private(ScrnInfoPtr scrn)
{ {
return (struct glamor_egl_screen_private *) return (struct glamor_egl_screen_private *)
scrn->privates[xf86GlamorEGLPrivateIndex].ptr; scrn->privates[xf86GlamorEGLPrivateIndex].ptr;
} }
static void static void GLAMOR_NONNULL_ARGS((1))
glamor_egl_make_current(struct glamor_context *glamor_ctx) glamor_egl_make_current(struct glamor_context *glamor_ctx)
{ {
/* There's only a single global dispatch table in Mesa. EGL, GLX, /* There's only a single global dispatch table in Mesa. EGL, GLX,
@ -95,7 +95,7 @@ glamor_egl_make_current(struct glamor_context *glamor_ctx)
} }
} }
static int static int GLAMOR_NONNULL_ARGS((3))
glamor_get_flink_name(int fd, int handle, int *name) glamor_get_flink_name(int fd, int handle, int *name)
{ {
struct drm_gem_flink flink; struct drm_gem_flink flink;
@ -117,7 +117,7 @@ glamor_get_flink_name(int fd, int handle, int *name)
return TRUE; return TRUE;
} }
static Bool static Bool GLAMOR_NONNULL_ARGS((1, 2, 3))
glamor_create_texture_from_image(ScreenPtr screen, glamor_create_texture_from_image(ScreenPtr screen,
EGLImageKHR image, GLuint * texture) EGLImageKHR image, GLuint * texture)
{ {
@ -137,7 +137,7 @@ glamor_create_texture_from_image(ScreenPtr screen,
return TRUE; return TRUE;
} }
struct gbm_device * struct gbm_device * GLAMOR_NONNULL_ARGS((1))
glamor_egl_get_gbm_device(ScreenPtr screen) glamor_egl_get_gbm_device(ScreenPtr screen)
{ {
struct glamor_egl_screen_private *glamor_egl = struct glamor_egl_screen_private *glamor_egl =
@ -145,7 +145,7 @@ glamor_egl_get_gbm_device(ScreenPtr screen)
return glamor_egl->gbm; return glamor_egl->gbm;
} }
Bool Bool GLAMOR_NONNULL_ARGS((1))
glamor_egl_create_textured_screen(ScreenPtr screen, int handle, int stride) glamor_egl_create_textured_screen(ScreenPtr screen, int handle, int stride)
{ {
ScrnInfoPtr scrn = xf86ScreenToScrn(screen); ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
@ -161,7 +161,7 @@ glamor_egl_create_textured_screen(ScreenPtr screen, int handle, int stride)
return TRUE; return TRUE;
} }
static void static void GLAMOR_NONNULL_ARGS((1))
glamor_egl_set_pixmap_image(PixmapPtr pixmap, EGLImageKHR image, glamor_egl_set_pixmap_image(PixmapPtr pixmap, EGLImageKHR image,
Bool used_modifiers) Bool used_modifiers)
{ {
@ -181,7 +181,7 @@ glamor_egl_set_pixmap_image(PixmapPtr pixmap, EGLImageKHR image,
pixmap_priv->used_modifiers = used_modifiers; pixmap_priv->used_modifiers = used_modifiers;
} }
Bool Bool GLAMOR_NONNULL_ARGS((1))
glamor_egl_create_textured_pixmap(PixmapPtr pixmap, int handle, int stride) glamor_egl_create_textured_pixmap(PixmapPtr pixmap, int handle, int stride)
{ {
ScreenPtr screen = pixmap->drawable.pScreen; ScreenPtr screen = pixmap->drawable.pScreen;
@ -216,7 +216,7 @@ glamor_egl_create_textured_pixmap(PixmapPtr pixmap, int handle, int stride)
return TRUE; return TRUE;
} }
Bool Bool GLAMOR_NONNULL_ARGS((1))
glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap,
struct gbm_bo *bo, struct gbm_bo *bo,
Bool used_modifiers) Bool used_modifiers)
@ -251,7 +251,7 @@ glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap,
return ret; return ret;
} }
static void static void GLAMOR_NONNULL_ARGS((3))
glamor_get_name_from_bo(int gbm_fd, struct gbm_bo *bo, int *name) glamor_get_name_from_bo(int gbm_fd, struct gbm_bo *bo, int *name)
{ {
union gbm_bo_handle handle; union gbm_bo_handle handle;
@ -261,7 +261,7 @@ glamor_get_name_from_bo(int gbm_fd, struct gbm_bo *bo, int *name)
*name = -1; *name = -1;
} }
static Bool static Bool GLAMOR_NONNULL_ARGS((1))
glamor_make_pixmap_exportable(PixmapPtr pixmap, Bool modifiers_ok) glamor_make_pixmap_exportable(PixmapPtr pixmap, Bool modifiers_ok)
{ {
ScreenPtr screen = pixmap->drawable.pScreen; ScreenPtr screen = pixmap->drawable.pScreen;
@ -372,7 +372,7 @@ glamor_make_pixmap_exportable(PixmapPtr pixmap, Bool modifiers_ok)
return TRUE; return TRUE;
} }
static struct gbm_bo * static struct gbm_bo * GLAMOR_NONNULL_ARGS((1, 2))
glamor_gbm_bo_from_pixmap_internal(ScreenPtr screen, PixmapPtr pixmap) glamor_gbm_bo_from_pixmap_internal(ScreenPtr screen, PixmapPtr pixmap)
{ {
struct glamor_egl_screen_private *glamor_egl = struct glamor_egl_screen_private *glamor_egl =
@ -387,7 +387,7 @@ glamor_gbm_bo_from_pixmap_internal(ScreenPtr screen, PixmapPtr pixmap)
pixmap_priv->image, 0); pixmap_priv->image, 0);
} }
struct gbm_bo * struct gbm_bo * GLAMOR_NONNULL_ARGS((1, 2))
glamor_gbm_bo_from_pixmap(ScreenPtr screen, PixmapPtr pixmap) glamor_gbm_bo_from_pixmap(ScreenPtr screen, PixmapPtr pixmap)
{ {
if (!glamor_make_pixmap_exportable(pixmap, TRUE)) if (!glamor_make_pixmap_exportable(pixmap, TRUE))
@ -396,7 +396,7 @@ glamor_gbm_bo_from_pixmap(ScreenPtr screen, PixmapPtr pixmap)
return glamor_gbm_bo_from_pixmap_internal(screen, pixmap); return glamor_gbm_bo_from_pixmap_internal(screen, pixmap);
} }
int int GLAMOR_NONNULL_ARGS((1, 2))
glamor_egl_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds, glamor_egl_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds,
uint32_t *strides, uint32_t *offsets, uint32_t *strides, uint32_t *offsets,
uint64_t *modifier) uint64_t *modifier)
@ -465,7 +465,7 @@ glamor_egl_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds,
#endif #endif
} }
int int GLAMOR_NONNULL_ARGS((1, 2))
glamor_egl_fd_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, glamor_egl_fd_from_pixmap(ScreenPtr screen, PixmapPtr pixmap,
CARD16 *stride, CARD32 *size) CARD16 *stride, CARD32 *size)
{ {
@ -491,7 +491,7 @@ glamor_egl_fd_from_pixmap(ScreenPtr screen, PixmapPtr pixmap,
#endif #endif
} }
int int GLAMOR_NONNULL_ARGS((1, 2))
glamor_egl_fd_name_from_pixmap(ScreenPtr screen, glamor_egl_fd_name_from_pixmap(ScreenPtr screen,
PixmapPtr pixmap, PixmapPtr pixmap,
CARD16 *stride, CARD32 *size) CARD16 *stride, CARD32 *size)
@ -520,7 +520,7 @@ glamor_egl_fd_name_from_pixmap(ScreenPtr screen,
return fd; return fd;
} }
static bool static bool GLAMOR_NONNULL_ARGS((2))
gbm_format_for_depth(CARD8 depth, uint32_t *format) gbm_format_for_depth(CARD8 depth, uint32_t *format)
{ {
switch (depth) { switch (depth) {
@ -545,7 +545,7 @@ gbm_format_for_depth(CARD8 depth, uint32_t *format)
} }
} }
Bool Bool GLAMOR_NONNULL_ARGS((1))
glamor_back_pixmap_from_fd(PixmapPtr pixmap, glamor_back_pixmap_from_fd(PixmapPtr pixmap,
int fd, int fd,
CARD16 width, CARD16 width,
@ -580,7 +580,7 @@ glamor_back_pixmap_from_fd(PixmapPtr pixmap,
return ret; return ret;
} }
PixmapPtr PixmapPtr GLAMOR_NONNULL_ARGS((1))
glamor_pixmap_from_fds(ScreenPtr screen, glamor_pixmap_from_fds(ScreenPtr screen,
CARD8 num_fds, const int *fds, CARD8 num_fds, const int *fds,
CARD16 width, CARD16 height, CARD16 width, CARD16 height,
@ -638,7 +638,7 @@ error:
return pixmap; return pixmap;
} }
PixmapPtr PixmapPtr GLAMOR_NONNULL_ARGS((1))
glamor_pixmap_from_fd(ScreenPtr screen, glamor_pixmap_from_fd(ScreenPtr screen,
int fd, int fd,
CARD16 width, CARD16 width,
@ -660,7 +660,7 @@ glamor_pixmap_from_fd(ScreenPtr screen,
return pixmap; return pixmap;
} }
Bool Bool GLAMOR_NONNULL_ARGS((1, 2, 3))
glamor_get_formats(ScreenPtr screen, glamor_get_formats(ScreenPtr screen,
CARD32 *num_formats, CARD32 **formats) CARD32 *num_formats, CARD32 **formats)
{ {
@ -700,7 +700,7 @@ glamor_get_formats(ScreenPtr screen,
#endif #endif
} }
Bool Bool GLAMOR_NONNULL_ARGS((1))
glamor_get_modifiers(ScreenPtr screen, uint32_t format, glamor_get_modifiers(ScreenPtr screen, uint32_t format,
uint32_t *num_modifiers, uint64_t **modifiers) uint32_t *num_modifiers, uint64_t **modifiers)
{ {
@ -742,7 +742,7 @@ glamor_get_modifiers(ScreenPtr screen, uint32_t format,
#endif #endif
} }
const char * const char * GLAMOR_NONNULL_ARGS((1))
glamor_egl_get_driver_name(ScreenPtr screen) glamor_egl_get_driver_name(ScreenPtr screen)
{ {
#ifdef GLAMOR_HAS_EGL_QUERY_DRIVER #ifdef GLAMOR_HAS_EGL_QUERY_DRIVER
@ -758,7 +758,7 @@ glamor_egl_get_driver_name(ScreenPtr screen)
} }
static Bool static Bool GLAMOR_NONNULL_ARGS((1))
glamor_egl_destroy_pixmap(PixmapPtr pixmap) glamor_egl_destroy_pixmap(PixmapPtr pixmap)
{ {
ScreenPtr screen = pixmap->drawable.pScreen; ScreenPtr screen = pixmap->drawable.pScreen;
@ -784,7 +784,7 @@ glamor_egl_destroy_pixmap(PixmapPtr pixmap)
return ret; return ret;
} }
void void GLAMOR_NONNULL_ARGS((1, 2))
glamor_egl_exchange_buffers(PixmapPtr front, PixmapPtr back) glamor_egl_exchange_buffers(PixmapPtr front, PixmapPtr back)
{ {
EGLImageKHR temp_img; EGLImageKHR temp_img;
@ -807,7 +807,7 @@ glamor_egl_exchange_buffers(PixmapPtr front, PixmapPtr back)
glamor_set_pixmap_type(back, GLAMOR_TEXTURE_DRM); glamor_set_pixmap_type(back, GLAMOR_TEXTURE_DRM);
} }
static Bool static Bool GLAMOR_NONNULL_ARGS((1))
glamor_egl_close_screen(ScreenPtr screen) glamor_egl_close_screen(ScreenPtr screen)
{ {
ScrnInfoPtr scrn; ScrnInfoPtr scrn;
@ -819,6 +819,7 @@ glamor_egl_close_screen(ScreenPtr screen)
glamor_egl = glamor_egl_get_screen_private(scrn); glamor_egl = glamor_egl_get_screen_private(scrn);
screen_pixmap = screen->GetScreenPixmap(screen); screen_pixmap = screen->GetScreenPixmap(screen);
pixmap_priv = glamor_get_pixmap_private(screen_pixmap); pixmap_priv = glamor_get_pixmap_private(screen_pixmap);
assert(pixmap_priv != NULL);
eglDestroyImageKHR(glamor_egl->display, pixmap_priv->image); eglDestroyImageKHR(glamor_egl->display, pixmap_priv->image);
pixmap_priv->image = NULL; pixmap_priv->image = NULL;
@ -829,7 +830,7 @@ glamor_egl_close_screen(ScreenPtr screen)
} }
#ifdef DRI3 #ifdef DRI3
static int static int GLAMOR_NONNULL_ARGS((2))
glamor_dri3_open_client(ClientPtr client, glamor_dri3_open_client(ClientPtr client,
ScreenPtr screen, ScreenPtr screen,
RRProviderPtr provider, RRProviderPtr provider,
@ -891,7 +892,7 @@ static const dri3_screen_info_rec glamor_dri3_info = {
}; };
#endif /* DRI3 */ #endif /* DRI3 */
void void GLAMOR_NONNULL_ARGS((1, 2))
glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx) glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx)
{ {
ScrnInfoPtr scrn = xf86ScreenToScrn(screen); ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
@ -959,7 +960,8 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx)
#endif #endif
} }
static void glamor_egl_cleanup(struct glamor_egl_screen_private *glamor_egl) static void GLAMOR_NONNULL_ARGS((1))
glamor_egl_cleanup(struct glamor_egl_screen_private *glamor_egl)
{ {
if (glamor_egl->display != EGL_NO_DISPLAY) { if (glamor_egl->display != EGL_NO_DISPLAY) {
eglMakeCurrent(glamor_egl->display, eglMakeCurrent(glamor_egl->display,
@ -978,7 +980,7 @@ static void glamor_egl_cleanup(struct glamor_egl_screen_private *glamor_egl)
free(glamor_egl); free(glamor_egl);
} }
static void static void GLAMOR_NONNULL_ARGS((1))
glamor_egl_free_screen(ScrnInfoPtr scrn) glamor_egl_free_screen(ScrnInfoPtr scrn)
{ {
struct glamor_egl_screen_private *glamor_egl; struct glamor_egl_screen_private *glamor_egl;
@ -991,7 +993,7 @@ glamor_egl_free_screen(ScrnInfoPtr scrn)
} }
} }
static Bool static Bool GLAMOR_NONNULL_ARGS((1))
glamor_egl_try_big_gl_api(ScrnInfoPtr scrn) glamor_egl_try_big_gl_api(ScrnInfoPtr scrn)
{ {
struct glamor_egl_screen_private *glamor_egl = struct glamor_egl_screen_private *glamor_egl =
@ -1044,7 +1046,7 @@ glamor_egl_try_big_gl_api(ScrnInfoPtr scrn)
return TRUE; return TRUE;
} }
static Bool static Bool GLAMOR_NONNULL_ARGS((1))
glamor_egl_try_gles_api(ScrnInfoPtr scrn) glamor_egl_try_gles_api(ScrnInfoPtr scrn)
{ {
struct glamor_egl_screen_private *glamor_egl = struct glamor_egl_screen_private *glamor_egl =
@ -1090,7 +1092,7 @@ static const OptionInfoRec GlamorEGLOptions[] = {
{ -1, NULL, OPTV_NONE, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE },
}; };
Bool Bool GLAMOR_NONNULL_ARGS((1))
glamor_egl_init(ScrnInfoPtr scrn, int fd) glamor_egl_init(ScrnInfoPtr scrn, int fd)
{ {
struct glamor_egl_screen_private *glamor_egl; struct glamor_egl_screen_private *glamor_egl;

View file

@ -277,7 +277,7 @@ glamor_pixmap_detach_fbo(glamor_pixmap_private *pixmap_priv)
} }
/* The pixmap must not be attached to another fbo. */ /* The pixmap must not be attached to another fbo. */
void void GLAMOR_NONNULL_ARGS((1))
glamor_pixmap_attach_fbo(PixmapPtr pixmap, glamor_pixmap_fbo *fbo) glamor_pixmap_attach_fbo(PixmapPtr pixmap, glamor_pixmap_fbo *fbo)
{ {
glamor_pixmap_private *pixmap_priv; glamor_pixmap_private *pixmap_priv;
@ -355,7 +355,7 @@ glamor_pixmap_ensure_fbo(PixmapPtr pixmap, int flag)
return TRUE; return TRUE;
} }
void void GLAMOR_NONNULL_ARGS((1, 2))
glamor_pixmap_exchange_fbos(PixmapPtr front, PixmapPtr back) glamor_pixmap_exchange_fbos(PixmapPtr front, PixmapPtr back)
{ {
glamor_pixmap_private *front_priv, *back_priv; glamor_pixmap_private *front_priv, *back_priv;

View file

@ -38,7 +38,7 @@ static const glamor_facet glamor_facet_poly_glyph_blt = {
GLAMOR_POS(gl_Position, primitive)), GLAMOR_POS(gl_Position, primitive)),
}; };
static Bool static Bool GLAMOR_NONNULL_ARGS((1, 2))
glamor_poly_glyph_blt_gl(DrawablePtr drawable, GCPtr gc, glamor_poly_glyph_blt_gl(DrawablePtr drawable, GCPtr gc,
int start_x, int y, unsigned int nglyph, int start_x, int y, unsigned int nglyph,
CharInfoPtr *ppci, void *pglyph_base) CharInfoPtr *ppci, void *pglyph_base)
@ -153,7 +153,7 @@ bail:
return ret; return ret;
} }
void void GLAMOR_NONNULL_ARGS((1, 2))
glamor_poly_glyph_blt(DrawablePtr drawable, GCPtr gc, glamor_poly_glyph_blt(DrawablePtr drawable, GCPtr gc,
int start_x, int y, unsigned int nglyph, int start_x, int y, unsigned int nglyph,
CharInfoPtr *ppci, void *pglyph_base) CharInfoPtr *ppci, void *pglyph_base)
@ -165,7 +165,7 @@ glamor_poly_glyph_blt(DrawablePtr drawable, GCPtr gc,
ppci, pglyph_base); ppci, pglyph_base);
} }
static Bool static Bool GLAMOR_NONNULL_ARGS((1, 2, 3))
glamor_push_pixels_gl(GCPtr gc, PixmapPtr bitmap, glamor_push_pixels_gl(GCPtr gc, PixmapPtr bitmap,
DrawablePtr drawable, int w, int h, int x, int y) DrawablePtr drawable, int w, int h, int x, int y)
{ {
@ -249,7 +249,7 @@ bail:
return ret; return ret;
} }
void void GLAMOR_NONNULL_ARGS((1, 2, 3))
glamor_push_pixels(GCPtr pGC, PixmapPtr pBitmap, glamor_push_pixels(GCPtr pGC, PixmapPtr pBitmap,
DrawablePtr pDrawable, int w, int h, int x, int y) DrawablePtr pDrawable, int w, int h, int x, int y)
{ {

View file

@ -559,7 +559,7 @@ _glamor_create_linear_gradient_program(ScreenPtr screen, int stops_count,
return TRUE; return TRUE;
} }
Bool Bool GLAMOR_NONNULL_ARGS((1))
glamor_init_gradient_shader(ScreenPtr screen) glamor_init_gradient_shader(ScreenPtr screen)
{ {
glamor_screen_private *glamor_priv; glamor_screen_private *glamor_priv;
@ -652,7 +652,7 @@ _glamor_gradient_convert_trans_matrix(PictTransform *from, float to[3][3],
to[1][0], to[1][1], to[1][2], to[2][0], to[2][1], to[2][2]); to[1][0], to[1][1], to[1][2], to[2][0], to[2][1], to[2][2]);
} }
static int static int GLAMOR_NONNULL_ARGS((1, 2, 3))
_glamor_gradient_set_pixmap_destination(ScreenPtr screen, _glamor_gradient_set_pixmap_destination(ScreenPtr screen,
glamor_screen_private *glamor_priv, glamor_screen_private *glamor_priv,
PicturePtr dst_picture, PicturePtr dst_picture,
@ -814,7 +814,7 @@ _glamor_gradient_set_stops(PicturePtr src_picture, PictGradient *pgradient,
return count; return count;
} }
PicturePtr PicturePtr GLAMOR_NONNULL_ARGS((1, 2))
glamor_generate_radial_gradient_picture(ScreenPtr screen, glamor_generate_radial_gradient_picture(ScreenPtr screen,
PicturePtr src_picture, PicturePtr src_picture,
int x_source, int y_source, int x_source, int y_source,
@ -1119,7 +1119,7 @@ glamor_generate_radial_gradient_picture(ScreenPtr screen,
return NULL; return NULL;
} }
PicturePtr PicturePtr GLAMOR_NONNULL_ARGS((1, 2))
glamor_generate_linear_gradient_picture(ScreenPtr screen, glamor_generate_linear_gradient_picture(ScreenPtr screen,
PicturePtr src_picture, PicturePtr src_picture,
int x_source, int y_source, int x_source, int y_source,

View file

@ -28,7 +28,7 @@
* PutImage. Only does ZPixmap right now as other formats are quite a bit harder * PutImage. Only does ZPixmap right now as other formats are quite a bit harder
*/ */
static Bool static Bool GLAMOR_NONNULL_ARGS((1, 2, 10))
glamor_put_image_gl(DrawablePtr drawable, GCPtr gc, int depth, int x, int y, glamor_put_image_gl(DrawablePtr drawable, GCPtr gc, int depth, int x, int y,
int w, int h, int leftPad, int format, char *bits) int w, int h, int leftPad, int format, char *bits)
{ {
@ -93,7 +93,7 @@ glamor_put_image_bail(DrawablePtr drawable, GCPtr gc, int depth, int x, int y,
glamor_finish_access(drawable); glamor_finish_access(drawable);
} }
void void GLAMOR_NONNULL_ARGS((1, 2, 10))
glamor_put_image(DrawablePtr drawable, GCPtr gc, int depth, int x, int y, glamor_put_image(DrawablePtr drawable, GCPtr gc, int depth, int x, int y,
int w, int h, int leftPad, int format, char *bits) int w, int h, int leftPad, int format, char *bits)
{ {
@ -102,7 +102,7 @@ glamor_put_image(DrawablePtr drawable, GCPtr gc, int depth, int x, int y,
glamor_put_image_bail(drawable, gc, depth, x, y, w, h, leftPad, format, bits); glamor_put_image_bail(drawable, gc, depth, x, y, w, h, leftPad, format, bits);
} }
static Bool static Bool GLAMOR_NONNULL_ARGS((1, 8))
glamor_get_image_gl(DrawablePtr drawable, int x, int y, int w, int h, glamor_get_image_gl(DrawablePtr drawable, int x, int y, int w, int h,
unsigned int format, unsigned long plane_mask, char *d) unsigned int format, unsigned long plane_mask, char *d)
{ {
@ -143,7 +143,7 @@ bail:
return FALSE; return FALSE;
} }
static void static void GLAMOR_NONNULL_ARGS((1, 8))
glamor_get_image_bail(DrawablePtr drawable, int x, int y, int w, int h, glamor_get_image_bail(DrawablePtr drawable, int x, int y, int w, int h,
unsigned int format, unsigned long plane_mask, char *d) unsigned int format, unsigned long plane_mask, char *d)
{ {
@ -152,7 +152,7 @@ glamor_get_image_bail(DrawablePtr drawable, int x, int y, int w, int h,
glamor_finish_access(drawable); glamor_finish_access(drawable);
} }
void void GLAMOR_NONNULL_ARGS((1, 8))
glamor_get_image(DrawablePtr drawable, int x, int y, int w, int h, glamor_get_image(DrawablePtr drawable, int x, int y, int w, int h,
unsigned int format, unsigned long plane_mask, char *d) unsigned int format, unsigned long plane_mask, char *d)
{ {

View file

@ -158,7 +158,7 @@ __glamor_compute_clipped_regions(int block_w,
* compositing. * compositing.
*/ */
glamor_pixmap_clipped_regions * glamor_pixmap_clipped_regions * GLAMOR_NONNULL_ARGS((1, 2, 3))
glamor_compute_clipped_regions_ext(PixmapPtr pixmap, glamor_compute_clipped_regions_ext(PixmapPtr pixmap,
RegionPtr region, RegionPtr region,
int *n_region, int *n_region,

View file

@ -32,7 +32,7 @@ static const glamor_facet glamor_facet_poly_lines = {
GLAMOR_POS(gl_Position, primitive.xy)), GLAMOR_POS(gl_Position, primitive.xy)),
}; };
static Bool static Bool GLAMOR_NONNULL_ARGS((1, 2))
glamor_poly_lines_solid_gl(DrawablePtr drawable, GCPtr gc, glamor_poly_lines_solid_gl(DrawablePtr drawable, GCPtr gc,
int mode, int n, DDXPointPtr points) int mode, int n, DDXPointPtr points)
{ {
@ -128,7 +128,7 @@ bail:
return ret; return ret;
} }
static Bool static Bool GLAMOR_NONNULL_ARGS((1, 2))
glamor_poly_lines_gl(DrawablePtr drawable, GCPtr gc, glamor_poly_lines_gl(DrawablePtr drawable, GCPtr gc,
int mode, int n, DDXPointPtr points) int mode, int n, DDXPointPtr points)
{ {
@ -150,7 +150,7 @@ glamor_poly_lines_gl(DrawablePtr drawable, GCPtr gc,
} }
} }
static void static void GLAMOR_NONNULL_ARGS((1, 2))
glamor_poly_lines_bail(DrawablePtr drawable, GCPtr gc, glamor_poly_lines_bail(DrawablePtr drawable, GCPtr gc,
int mode, int n, DDXPointPtr points) int mode, int n, DDXPointPtr points)
{ {
@ -160,7 +160,7 @@ glamor_poly_lines_bail(DrawablePtr drawable, GCPtr gc,
miPolylines(drawable, gc, mode, n, points); miPolylines(drawable, gc, mode, n, points);
} }
void void GLAMOR_NONNULL_ARGS((1, 2))
glamor_poly_lines(DrawablePtr drawable, GCPtr gc, glamor_poly_lines(DrawablePtr drawable, GCPtr gc,
int mode, int n, DDXPointPtr points) int mode, int n, DDXPointPtr points)
{ {

View file

@ -35,7 +35,7 @@
* the backing drawable. These coordinates are nonzero only for redirected * the backing drawable. These coordinates are nonzero only for redirected
* windows. * windows.
*/ */
void void GLAMOR_NONNULL_ARGS((1, 2, 3, 4))
glamor_get_drawable_deltas(DrawablePtr drawable, PixmapPtr pixmap, glamor_get_drawable_deltas(DrawablePtr drawable, PixmapPtr pixmap,
int *x, int *y) int *x, int *y)
{ {
@ -62,7 +62,7 @@ glamor_pixmap_fini(ScreenPtr screen)
{ {
} }
void void GLAMOR_NONNULL_ARGS((1, 2))
glamor_set_destination_pixmap_fbo(glamor_screen_private *glamor_priv, glamor_set_destination_pixmap_fbo(glamor_screen_private *glamor_priv,
glamor_pixmap_fbo *fbo, int x0, int y0, glamor_pixmap_fbo *fbo, int x0, int y0,
int width, int height) int width, int height)
@ -73,7 +73,7 @@ glamor_set_destination_pixmap_fbo(glamor_screen_private *glamor_priv,
glViewport(x0, y0, width, height); glViewport(x0, y0, width, height);
} }
void void GLAMOR_NONNULL_ARGS((1, 2, 3))
glamor_set_destination_pixmap_priv_nc(glamor_screen_private *glamor_priv, glamor_set_destination_pixmap_priv_nc(glamor_screen_private *glamor_priv,
PixmapPtr pixmap, PixmapPtr pixmap,
glamor_pixmap_private *pixmap_priv) glamor_pixmap_private *pixmap_priv)
@ -84,7 +84,7 @@ glamor_set_destination_pixmap_priv_nc(glamor_screen_private *glamor_priv,
glamor_set_destination_pixmap_fbo(glamor_priv, pixmap_priv->fbo, 0, 0, w, h); glamor_set_destination_pixmap_fbo(glamor_priv, pixmap_priv->fbo, 0, 0, w, h);
} }
int int GLAMOR_NONNULL_ARGS((1, 2, 3))
glamor_set_destination_pixmap_priv(glamor_screen_private *glamor_priv, glamor_set_destination_pixmap_priv(glamor_screen_private *glamor_priv,
PixmapPtr pixmap, PixmapPtr pixmap,
glamor_pixmap_private *pixmap_priv) glamor_pixmap_private *pixmap_priv)
@ -96,7 +96,7 @@ glamor_set_destination_pixmap_priv(glamor_screen_private *glamor_priv,
return 0; return 0;
} }
int int GLAMOR_NONNULL_ARGS((1))
glamor_set_destination_pixmap(PixmapPtr pixmap) glamor_set_destination_pixmap(PixmapPtr pixmap)
{ {
int err; int err;
@ -119,7 +119,7 @@ glamor_set_planemask(int depth, unsigned long planemask)
return GL_FALSE; return GL_FALSE;
} }
Bool Bool GLAMOR_NONNULL_ARGS((1))
glamor_set_alu(DrawablePtr drawable, unsigned char alu) glamor_set_alu(DrawablePtr drawable, unsigned char alu)
{ {
ScreenPtr screen = drawable->pScreen; ScreenPtr screen = drawable->pScreen;

View file

@ -36,7 +36,7 @@ static const glamor_facet glamor_facet_point = {
GLAMOR_POS(gl_Position, primitive)), GLAMOR_POS(gl_Position, primitive)),
}; };
static Bool static Bool GLAMOR_NONNULL_ARGS((1, 2))
glamor_poly_point_gl(DrawablePtr drawable, GCPtr gc, int mode, int npt, DDXPointPtr ppt) glamor_poly_point_gl(DrawablePtr drawable, GCPtr gc, int mode, int npt, DDXPointPtr ppt)
{ {
ScreenPtr screen = drawable->pScreen; ScreenPtr screen = drawable->pScreen;
@ -115,7 +115,7 @@ bail:
return ret; return ret;
} }
void void GLAMOR_NONNULL_ARGS((1, 2))
glamor_poly_point(DrawablePtr drawable, GCPtr gc, int mode, int npt, glamor_poly_point(DrawablePtr drawable, GCPtr gc, int mode, int npt,
DDXPointPtr ppt) DDXPointPtr ppt)
{ {

View file

@ -30,7 +30,7 @@
* and downloading all of the FBOs into it. * and downloading all of the FBOs into it.
*/ */
static Bool static Bool GLAMOR_NONNULL_ARGS((1))
glamor_prep_drawable_box(DrawablePtr drawable, glamor_access_t access, BoxPtr box) glamor_prep_drawable_box(DrawablePtr drawable, glamor_access_t access, BoxPtr box)
{ {
ScreenPtr screen = drawable->pScreen; ScreenPtr screen = drawable->pScreen;
@ -150,7 +150,7 @@ glamor_prep_drawable_box(DrawablePtr drawable, glamor_access_t access, BoxPtr bo
* if we were writing to it and then unbind it to release the memory * if we were writing to it and then unbind it to release the memory
*/ */
void void GLAMOR_NONNULL_ARGS((1))
glamor_finish_access(DrawablePtr drawable) glamor_finish_access(DrawablePtr drawable)
{ {
PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable);
@ -194,7 +194,7 @@ glamor_finish_access(DrawablePtr drawable)
priv->prepared = FALSE; priv->prepared = FALSE;
} }
Bool Bool GLAMOR_NONNULL_ARGS((1))
glamor_prepare_access(DrawablePtr drawable, glamor_access_t access) glamor_prepare_access(DrawablePtr drawable, glamor_access_t access)
{ {
BoxRec box; BoxRec box;
@ -206,7 +206,7 @@ glamor_prepare_access(DrawablePtr drawable, glamor_access_t access)
return glamor_prep_drawable_box(drawable, access, &box); return glamor_prep_drawable_box(drawable, access, &box);
} }
Bool Bool GLAMOR_NONNULL_ARGS((1))
glamor_prepare_access_box(DrawablePtr drawable, glamor_access_t access, glamor_prepare_access_box(DrawablePtr drawable, glamor_access_t access,
int x, int y, int w, int h) int x, int y, int w, int h)
{ {
@ -271,7 +271,7 @@ glamor_finish_access_picture(PicturePtr picture)
* in CPU memory again * in CPU memory again
*/ */
Bool Bool GLAMOR_NONNULL_ARGS((1))
glamor_prepare_access_gc(GCPtr gc) glamor_prepare_access_gc(GCPtr gc)
{ {
switch (gc->fillStyle) { switch (gc->fillStyle) {
@ -288,7 +288,7 @@ glamor_prepare_access_gc(GCPtr gc)
/* /*
* Free any temporary CPU pixmaps for the GC * Free any temporary CPU pixmaps for the GC
*/ */
void void GLAMOR_NONNULL_ARGS((1))
glamor_finish_access_gc(GCPtr gc) glamor_finish_access_gc(GCPtr gc)
{ {
switch (gc->fillStyle) { switch (gc->fillStyle) {

View file

@ -23,14 +23,14 @@
#ifndef _GLAMOR_PREPARE_H_ #ifndef _GLAMOR_PREPARE_H_
#define _GLAMOR_PREPARE_H_ #define _GLAMOR_PREPARE_H_
Bool Bool GLAMOR_NONNULL_ARGS((1))
glamor_prepare_access(DrawablePtr drawable, glamor_access_t access); glamor_prepare_access(DrawablePtr drawable, glamor_access_t access);
Bool Bool GLAMOR_NONNULL_ARGS((1))
glamor_prepare_access_box(DrawablePtr drawable, glamor_access_t access, glamor_prepare_access_box(DrawablePtr drawable, glamor_access_t access,
int x, int y, int w, int h); int x, int y, int w, int h);
void void GLAMOR_NONNULL_ARGS((1))
glamor_finish_access(DrawablePtr drawable); glamor_finish_access(DrawablePtr drawable);
Bool Bool
@ -43,10 +43,10 @@ glamor_prepare_access_picture_box(PicturePtr picture, glamor_access_t access,
void void
glamor_finish_access_picture(PicturePtr picture); glamor_finish_access_picture(PicturePtr picture);
Bool Bool GLAMOR_NONNULL_ARGS((1))
glamor_prepare_access_gc(GCPtr gc); glamor_prepare_access_gc(GCPtr gc);
void void GLAMOR_NONNULL_ARGS((1))
glamor_finish_access_gc(GCPtr gc); glamor_finish_access_gc(GCPtr gc);
#endif /* _GLAMOR_PREPARE_H_ */ #endif /* _GLAMOR_PREPARE_H_ */

View file

@ -452,7 +452,7 @@ glamor_get_pixmap_private(PixmapPtr pixmap)
/* /*
* Returns TRUE if pixmap has no image object * Returns TRUE if pixmap has no image object
*/ */
static inline Bool static inline Bool GLAMOR_NONNULL_ARGS((1))
glamor_pixmap_drm_only(PixmapPtr pixmap) glamor_pixmap_drm_only(PixmapPtr pixmap)
{ {
glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap); glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap);
@ -463,7 +463,7 @@ glamor_pixmap_drm_only(PixmapPtr pixmap)
/* /*
* Returns TRUE if pixmap is plain memory (not a GL object at all) * Returns TRUE if pixmap is plain memory (not a GL object at all)
*/ */
static inline Bool static inline Bool GLAMOR_NONNULL_ARGS((1))
glamor_pixmap_is_memory(PixmapPtr pixmap) glamor_pixmap_is_memory(PixmapPtr pixmap)
{ {
glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap); glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap);
@ -474,19 +474,19 @@ glamor_pixmap_is_memory(PixmapPtr pixmap)
/* /*
* Returns TRUE if pixmap requires multiple textures to hold it * Returns TRUE if pixmap requires multiple textures to hold it
*/ */
static inline Bool static inline Bool GLAMOR_NONNULL_ARGS((1))
glamor_pixmap_priv_is_large(glamor_pixmap_private *priv) glamor_pixmap_priv_is_large(glamor_pixmap_private *priv)
{ {
return priv->block_wcnt > 1 || priv->block_hcnt > 1; return priv->block_wcnt > 1 || priv->block_hcnt > 1;
} }
static inline Bool static inline Bool GLAMOR_NONNULL_ARGS((1))
glamor_pixmap_priv_is_small(glamor_pixmap_private *priv) glamor_pixmap_priv_is_small(glamor_pixmap_private *priv)
{ {
return priv->block_wcnt <= 1 && priv->block_hcnt <= 1; return priv->block_wcnt <= 1 && priv->block_hcnt <= 1;
} }
static inline Bool static inline Bool GLAMOR_NONNULL_ARGS((1))
glamor_pixmap_is_large(PixmapPtr pixmap) glamor_pixmap_is_large(PixmapPtr pixmap)
{ {
glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap); glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap);
@ -496,7 +496,7 @@ glamor_pixmap_is_large(PixmapPtr pixmap)
/* /*
* Returns TRUE if pixmap has an FBO * Returns TRUE if pixmap has an FBO
*/ */
static inline Bool static inline Bool GLAMOR_NONNULL_ARGS((1))
glamor_pixmap_has_fbo(PixmapPtr pixmap) glamor_pixmap_has_fbo(PixmapPtr pixmap)
{ {
glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap); glamor_pixmap_private *priv = glamor_get_pixmap_private(pixmap);
@ -504,7 +504,7 @@ glamor_pixmap_has_fbo(PixmapPtr pixmap)
return priv->gl_fbo == GLAMOR_FBO_NORMAL; return priv->gl_fbo == GLAMOR_FBO_NORMAL;
} }
static inline void static inline void GLAMOR_NONNULL_ARGS((1))
glamor_set_pixmap_fbo_current(glamor_pixmap_private *priv, int idx) glamor_set_pixmap_fbo_current(glamor_pixmap_private *priv, int idx)
{ {
if (glamor_pixmap_priv_is_large(priv)) { if (glamor_pixmap_priv_is_large(priv)) {
@ -513,27 +513,27 @@ glamor_set_pixmap_fbo_current(glamor_pixmap_private *priv, int idx)
} }
} }
static inline glamor_pixmap_fbo * static inline glamor_pixmap_fbo * GLAMOR_NONNULL_ARGS((1))
glamor_pixmap_fbo_at(glamor_pixmap_private *priv, int box) glamor_pixmap_fbo_at(glamor_pixmap_private *priv, int box)
{ {
assert(box < priv->block_wcnt * priv->block_hcnt); assert(box < priv->block_wcnt * priv->block_hcnt);
return priv->fbo_array[box]; return priv->fbo_array[box];
} }
static inline BoxPtr static inline BoxPtr GLAMOR_NONNULL_ARGS((1))
glamor_pixmap_box_at(glamor_pixmap_private *priv, int box) glamor_pixmap_box_at(glamor_pixmap_private *priv, int box)
{ {
assert(box < priv->block_wcnt * priv->block_hcnt); assert(box < priv->block_wcnt * priv->block_hcnt);
return &priv->box_array[box]; return &priv->box_array[box];
} }
static inline int static inline int GLAMOR_NONNULL_ARGS((1))
glamor_pixmap_wcnt(glamor_pixmap_private *priv) glamor_pixmap_wcnt(glamor_pixmap_private *priv)
{ {
return priv->block_wcnt; return priv->block_wcnt;
} }
static inline int static inline int GLAMOR_NONNULL_ARGS((1))
glamor_pixmap_hcnt(glamor_pixmap_private *priv) glamor_pixmap_hcnt(glamor_pixmap_private *priv)
{ {
return priv->block_hcnt; return priv->block_hcnt;
@ -543,7 +543,7 @@ glamor_pixmap_hcnt(glamor_pixmap_private *priv)
for (box_index = 0; box_index < glamor_pixmap_hcnt(priv) * \ for (box_index = 0; box_index < glamor_pixmap_hcnt(priv) * \
glamor_pixmap_wcnt(priv); box_index++) \ glamor_pixmap_wcnt(priv); box_index++) \
static inline int static inline int GLAMOR_NONNULL_ARGS((1))
glamor_drawable_effective_depth(DrawablePtr drawable) glamor_drawable_effective_depth(DrawablePtr drawable)
{ {
WindowPtr window; WindowPtr window;
@ -579,10 +579,11 @@ extern DevPrivateKeyRec glamor_gc_private_key;
extern DevPrivateKeyRec glamor_screen_private_key; extern DevPrivateKeyRec glamor_screen_private_key;
extern glamor_screen_private * extern glamor_screen_private *
glamor_get_screen_private(ScreenPtr screen); glamor_get_screen_private(ScreenPtr screen) GLAMOR_NONNULL_ARGS((1));
extern void extern void
glamor_set_screen_private(ScreenPtr screen, glamor_screen_private *priv); glamor_set_screen_private(ScreenPtr screen, glamor_screen_private *priv)
GLAMOR_NONNULL_ARGS((1));
static inline glamor_gc_private * static inline glamor_gc_private *
glamor_get_gc_private(GCPtr gc) glamor_get_gc_private(GCPtr gc)
@ -604,11 +605,13 @@ glamor_pm_is_solid(int depth, unsigned long planemask)
extern int glamor_debug_level; extern int glamor_debug_level;
/* glamor.c */ /* glamor.c */
PixmapPtr glamor_get_drawable_pixmap(DrawablePtr drawable); PixmapPtr glamor_get_drawable_pixmap(DrawablePtr drawable)
GLAMOR_NONNULL_ARGS((1)) GLAMOR_NONNULL_RETURN;
glamor_pixmap_fbo *glamor_pixmap_detach_fbo(glamor_pixmap_private * glamor_pixmap_fbo *glamor_pixmap_detach_fbo(glamor_pixmap_private *
pixmap_priv); pixmap_priv);
void glamor_pixmap_attach_fbo(PixmapPtr pixmap, glamor_pixmap_fbo *fbo); void glamor_pixmap_attach_fbo(PixmapPtr pixmap, glamor_pixmap_fbo *fbo)
GLAMOR_NONNULL_ARGS((1));
glamor_pixmap_fbo *glamor_create_fbo_from_tex(glamor_screen_private * glamor_pixmap_fbo *glamor_create_fbo_from_tex(glamor_screen_private *
glamor_priv, PixmapPtr pixmap, glamor_priv, PixmapPtr pixmap,
int w, int h, GLint tex, int w, int h, GLint tex,
@ -622,7 +625,8 @@ Bool glamor_pixmap_fbo_fixup(ScreenPtr screen, PixmapPtr pixmap);
void glamor_pixmap_clear_fbo(glamor_screen_private *glamor_priv, glamor_pixmap_fbo *fbo, void glamor_pixmap_clear_fbo(glamor_screen_private *glamor_priv, glamor_pixmap_fbo *fbo,
const struct glamor_format *pixmap_format); const struct glamor_format *pixmap_format);
const struct glamor_format *glamor_format_for_pixmap(PixmapPtr pixmap); const struct glamor_format *glamor_format_for_pixmap(PixmapPtr pixmap)
GLAMOR_NONNULL_ARGS((1)) GLAMOR_NONNULL_RETURN;
/* Return whether 'picture' is alpha-only */ /* Return whether 'picture' is alpha-only */
static inline Bool glamor_picture_is_alpha(PicturePtr picture) static inline Bool glamor_picture_is_alpha(PicturePtr picture)
@ -653,25 +657,37 @@ void glamor_gldrawarrays_quads_using_indices(glamor_screen_private *glamor_priv,
unsigned count); unsigned count);
/* glamor_core.c */ /* glamor_core.c */
Bool glamor_get_drawable_location(const DrawablePtr drawable); Bool glamor_get_drawable_location(const DrawablePtr drawable)
GLAMOR_NONNULL_ARGS((1));
void glamor_get_drawable_deltas(DrawablePtr drawable, PixmapPtr pixmap, void glamor_get_drawable_deltas(DrawablePtr drawable, PixmapPtr pixmap,
int *x, int *y); int *x, int *y)
GLAMOR_NONNULL_ARGS((1, 2, 3, 4));
GLint glamor_compile_glsl_prog(GLenum type, const char *source); GLint glamor_compile_glsl_prog(GLenum type, const char *source);
Bool glamor_link_glsl_prog(ScreenPtr screen, GLint prog, Bool glamor_link_glsl_prog(ScreenPtr screen, GLint prog,
const char *format, ...) _X_ATTRIBUTE_PRINTF(3,4); const char *format, ...) _X_ATTRIBUTE_PRINTF(3,4);
void glamor_get_color_4f_from_pixel(PixmapPtr pixmap, void glamor_get_color_4f_from_pixel(PixmapPtr pixmap,
unsigned long fg_pixel, GLfloat *color); unsigned long fg_pixel, GLfloat *color);
int glamor_set_destination_pixmap(PixmapPtr pixmap); int glamor_set_destination_pixmap(PixmapPtr pixmap)
int glamor_set_destination_pixmap_priv(glamor_screen_private *glamor_priv, PixmapPtr pixmap, glamor_pixmap_private *pixmap_priv); GLAMOR_NONNULL_ARGS((1));
void glamor_set_destination_pixmap_fbo(glamor_screen_private *glamor_priv, glamor_pixmap_fbo *, int, int, int, int); int glamor_set_destination_pixmap_priv(glamor_screen_private *glamor_priv,
PixmapPtr pixmap,
glamor_pixmap_private *pixmap_priv)
GLAMOR_NONNULL_ARGS((1, 2, 3));
void glamor_set_destination_pixmap_fbo(glamor_screen_private *glamor_priv,
glamor_pixmap_fbo *, int, int, int, int)
GLAMOR_NONNULL_ARGS((1, 2));
/* nc means no check. caller must ensure this pixmap has valid fbo. /* nc means no check. caller must ensure this pixmap has valid fbo.
* usually use the GLAMOR_PIXMAP_PRIV_HAS_FBO firstly. * usually use the GLAMOR_PIXMAP_PRIV_HAS_FBO firstly.
* */ * */
void glamor_set_destination_pixmap_priv_nc(glamor_screen_private *glamor_priv, PixmapPtr pixmap, glamor_pixmap_private *pixmap_priv); void glamor_set_destination_pixmap_priv_nc(glamor_screen_private *glamor_priv,
PixmapPtr pixmap,
glamor_pixmap_private *pixmap_priv)
GLAMOR_NONNULL_ARGS((1, 2, 3));
Bool glamor_set_alu(DrawablePtr drawable, unsigned char alu); Bool glamor_set_alu(DrawablePtr drawable, unsigned char alu)
GLAMOR_NONNULL_ARGS((1));
Bool glamor_set_planemask(int depth, unsigned long planemask); Bool glamor_set_planemask(int depth, unsigned long planemask);
RegionPtr glamor_bitmap_to_region(PixmapPtr pixmap); RegionPtr glamor_bitmap_to_region(PixmapPtr pixmap);
@ -690,7 +706,8 @@ Bool glamor_composite_clipped_region(CARD8 op,
int x_source, int x_source,
int y_source, int y_source,
int x_mask, int y_mask, int x_mask, int y_mask,
int x_dest, int y_dest); int x_dest, int y_dest)
GLAMOR_NONNULL_ARGS((8));
void glamor_composite(CARD8 op, void glamor_composite(CARD8 op,
PicturePtr pSrc, PicturePtr pSrc,
@ -713,17 +730,20 @@ void glamor_trapezoids(CARD8 op,
int ntrap, xTrapezoid *traps); int ntrap, xTrapezoid *traps);
/* glamor_gradient.c */ /* glamor_gradient.c */
Bool glamor_init_gradient_shader(ScreenPtr screen); Bool glamor_init_gradient_shader(ScreenPtr screen)
GLAMOR_NONNULL_ARGS((1));
PicturePtr glamor_generate_linear_gradient_picture(ScreenPtr screen, PicturePtr glamor_generate_linear_gradient_picture(ScreenPtr screen,
PicturePtr src_picture, PicturePtr src_picture,
int x_source, int y_source, int x_source, int y_source,
int width, int height, int width, int height,
PictFormatShort format); PictFormatShort format)
GLAMOR_NONNULL_ARGS((1, 2));
PicturePtr glamor_generate_radial_gradient_picture(ScreenPtr screen, PicturePtr glamor_generate_radial_gradient_picture(ScreenPtr screen,
PicturePtr src_picture, PicturePtr src_picture,
int x_source, int y_source, int x_source, int y_source,
int width, int height, int width, int height,
PictFormatShort format); PictFormatShort format)
GLAMOR_NONNULL_ARGS((1, 2));
/* glamor_triangles.c */ /* glamor_triangles.c */
void glamor_triangles(CARD8 op, void glamor_triangles(CARD8 op,
@ -761,13 +781,15 @@ glamor_pixmap_clipped_regions *
glamor_compute_clipped_regions(PixmapPtr pixmap, glamor_compute_clipped_regions(PixmapPtr pixmap,
RegionPtr region, int *clipped_nbox, RegionPtr region, int *clipped_nbox,
int repeat_type, int reverse, int repeat_type, int reverse,
int upsidedown); int upsidedown)
GLAMOR_NONNULL_ARGS((1, 2, 3));
glamor_pixmap_clipped_regions * glamor_pixmap_clipped_regions *
glamor_compute_clipped_regions_ext(PixmapPtr pixmap, glamor_compute_clipped_regions_ext(PixmapPtr pixmap,
RegionPtr region, int *n_region, RegionPtr region, int *n_region,
int inner_block_w, int inner_block_h, int inner_block_w, int inner_block_h,
int reverse, int upsidedown); int reverse, int upsidedown)
GLAMOR_NONNULL_ARGS((1, 2, 3));
Bool glamor_composite_largepixmap_region(CARD8 op, Bool glamor_composite_largepixmap_region(CARD8 op,
PicturePtr source, PicturePtr source,
@ -795,63 +817,77 @@ void glamor_add_traps(PicturePtr pPicture,
/* glamor_text.c */ /* glamor_text.c */
int glamor_poly_text8(DrawablePtr pDrawable, GCPtr pGC, int glamor_poly_text8(DrawablePtr pDrawable, GCPtr pGC,
int x, int y, int count, char *chars); int x, int y, int count, char *chars)
GLAMOR_NONNULL_ARGS((1, 2));
int glamor_poly_text16(DrawablePtr pDrawable, GCPtr pGC, int glamor_poly_text16(DrawablePtr pDrawable, GCPtr pGC,
int x, int y, int count, unsigned short *chars); int x, int y, int count, unsigned short *chars)
GLAMOR_NONNULL_ARGS((1, 2));
void glamor_image_text8(DrawablePtr pDrawable, GCPtr pGC, void glamor_image_text8(DrawablePtr pDrawable, GCPtr pGC,
int x, int y, int count, char *chars); int x, int y, int count, char *chars)
GLAMOR_NONNULL_ARGS((1, 2));
void glamor_image_text16(DrawablePtr pDrawable, GCPtr pGC, void glamor_image_text16(DrawablePtr pDrawable, GCPtr pGC,
int x, int y, int count, unsigned short *chars); int x, int y, int count, unsigned short *chars)
GLAMOR_NONNULL_ARGS((1, 2));
/* glamor_spans.c */ /* glamor_spans.c */
void void
glamor_fill_spans(DrawablePtr drawable, glamor_fill_spans(DrawablePtr drawable,
GCPtr gc, GCPtr gc,
int n, DDXPointPtr points, int *widths, int sorted); int n, DDXPointPtr points, int *widths, int sorted)
GLAMOR_NONNULL_ARGS((1, 2));
void void
glamor_get_spans(DrawablePtr drawable, int wmax, glamor_get_spans(DrawablePtr drawable, int wmax,
DDXPointPtr points, int *widths, int count, char *dst); DDXPointPtr points, int *widths, int count, char *dst)
GLAMOR_NONNULL_ARGS((1));
void void
glamor_set_spans(DrawablePtr drawable, GCPtr gc, char *src, glamor_set_spans(DrawablePtr drawable, GCPtr gc, char *src,
DDXPointPtr points, int *widths, int numPoints, int sorted); DDXPointPtr points, int *widths, int numPoints, int sorted)
GLAMOR_NONNULL_ARGS((1, 2));
/* glamor_rects.c */ /* glamor_rects.c */
void void
glamor_poly_fill_rect(DrawablePtr drawable, glamor_poly_fill_rect(DrawablePtr drawable,
GCPtr gc, int nrect, xRectangle *prect); GCPtr gc, int nrect, xRectangle *prect)
GLAMOR_NONNULL_ARGS((1, 2));
/* glamor_image.c */ /* glamor_image.c */
void void
glamor_put_image(DrawablePtr drawable, GCPtr gc, int depth, int x, int y, glamor_put_image(DrawablePtr drawable, GCPtr gc, int depth, int x, int y,
int w, int h, int leftPad, int format, char *bits); int w, int h, int leftPad, int format, char *bits)
GLAMOR_NONNULL_ARGS((1, 2, 10));
void void
glamor_get_image(DrawablePtr pDrawable, int x, int y, int w, int h, glamor_get_image(DrawablePtr pDrawable, int x, int y, int w, int h,
unsigned int format, unsigned long planeMask, char *d); unsigned int format, unsigned long planeMask, char *d)
GLAMOR_NONNULL_ARGS((1, 8));
/* glamor_dash.c */ /* glamor_dash.c */
Bool Bool
glamor_poly_lines_dash_gl(DrawablePtr drawable, GCPtr gc, glamor_poly_lines_dash_gl(DrawablePtr drawable, GCPtr gc,
int mode, int n, DDXPointPtr points); int mode, int n, DDXPointPtr points)
GLAMOR_NONNULL_ARGS((1, 2));
Bool Bool
glamor_poly_segment_dash_gl(DrawablePtr drawable, GCPtr gc, glamor_poly_segment_dash_gl(DrawablePtr drawable, GCPtr gc,
int nseg, xSegment *segs); int nseg, xSegment *segs)
GLAMOR_NONNULL_ARGS((1, 2));
/* glamor_lines.c */ /* glamor_lines.c */
void void
glamor_poly_lines(DrawablePtr drawable, GCPtr gc, glamor_poly_lines(DrawablePtr drawable, GCPtr gc,
int mode, int n, DDXPointPtr points); int mode, int n, DDXPointPtr points)
GLAMOR_NONNULL_ARGS((1, 2));
/* glamor_segs.c */ /* glamor_segs.c */
void void
glamor_poly_segment(DrawablePtr drawable, GCPtr gc, glamor_poly_segment(DrawablePtr drawable, GCPtr gc,
int nseg, xSegment *segs); int nseg, xSegment *segs)
GLAMOR_NONNULL_ARGS((1, 2));
/* glamor_copy.c */ /* glamor_copy.c */
void void
@ -883,13 +919,16 @@ void glamor_image_glyph_blt(DrawablePtr pDrawable, GCPtr pGC,
void glamor_poly_glyph_blt(DrawablePtr pDrawable, GCPtr pGC, void glamor_poly_glyph_blt(DrawablePtr pDrawable, GCPtr pGC,
int x, int y, unsigned int nglyph, int x, int y, unsigned int nglyph,
CharInfoPtr *ppci, void *pglyphBase); CharInfoPtr *ppci, void *pglyphBase)
GLAMOR_NONNULL_ARGS((1, 2));
void glamor_push_pixels(GCPtr pGC, PixmapPtr pBitmap, void glamor_push_pixels(GCPtr pGC, PixmapPtr pBitmap,
DrawablePtr pDrawable, int w, int h, int x, int y); DrawablePtr pDrawable, int w, int h, int x, int y)
GLAMOR_NONNULL_ARGS((1, 2, 3));
void glamor_poly_point(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, void glamor_poly_point(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
DDXPointPtr ppt); DDXPointPtr ppt)
GLAMOR_NONNULL_ARGS((1, 2));
void glamor_composite_rectangles(CARD8 op, void glamor_composite_rectangles(CARD8 op,
PicturePtr dst, PicturePtr dst,
@ -980,7 +1019,8 @@ int glamor_xv_put_image(glamor_port_private *port_priv,
Bool sync, Bool sync,
RegionPtr clipBoxes); RegionPtr clipBoxes);
void glamor_xv_core_init(ScreenPtr screen); void glamor_xv_core_init(ScreenPtr screen);
void glamor_xv_render(glamor_port_private *port_priv, int id); void glamor_xv_render(glamor_port_private *port_priv, int id)
GLAMOR_NONNULL_ARGS((1));
#include "glamor_utils.h" #include "glamor_utils.h"

View file

@ -41,7 +41,7 @@ static const glamor_facet glamor_facet_polyfillrect_120 = {
GLAMOR_POS(gl_Position, primitive.xy)), GLAMOR_POS(gl_Position, primitive.xy)),
}; };
static Bool static Bool GLAMOR_NONNULL_ARGS((1, 2))
glamor_poly_fill_rect_gl(DrawablePtr drawable, glamor_poly_fill_rect_gl(DrawablePtr drawable,
GCPtr gc, int nrect, xRectangle *prect) GCPtr gc, int nrect, xRectangle *prect)
{ {
@ -173,7 +173,7 @@ bail:
return ret; return ret;
} }
static void static void GLAMOR_NONNULL_ARGS((1, 2))
glamor_poly_fill_rect_bail(DrawablePtr drawable, glamor_poly_fill_rect_bail(DrawablePtr drawable,
GCPtr gc, int nrect, xRectangle *prect) GCPtr gc, int nrect, xRectangle *prect)
{ {
@ -187,7 +187,7 @@ glamor_poly_fill_rect_bail(DrawablePtr drawable,
glamor_finish_access(drawable); glamor_finish_access(drawable);
} }
void void GLAMOR_NONNULL_ARGS((1, 2))
glamor_poly_fill_rect(DrawablePtr drawable, glamor_poly_fill_rect(DrawablePtr drawable,
GCPtr gc, int nrect, xRectangle *prect) GCPtr gc, int nrect, xRectangle *prect)
{ {

View file

@ -573,7 +573,7 @@ glamor_set_composite_op(ScreenPtr screen,
return TRUE; return TRUE;
} }
static void static void GLAMOR_NONNULL_ARGS((1, 3, 4, 7))
glamor_set_composite_texture(glamor_screen_private *glamor_priv, int unit, glamor_set_composite_texture(glamor_screen_private *glamor_priv, int unit,
PicturePtr picture, PicturePtr picture,
PixmapPtr pixmap, PixmapPtr pixmap,
@ -1486,7 +1486,7 @@ glamor_convert_gradient_picture(ScreenPtr screen,
return dst; return dst;
} }
Bool Bool GLAMOR_NONNULL_ARGS((8))
glamor_composite_clipped_region(CARD8 op, glamor_composite_clipped_region(CARD8 op,
PicturePtr source, PicturePtr source,
PicturePtr mask, PicturePtr mask,

View file

@ -32,7 +32,7 @@ static const glamor_facet glamor_facet_poly_segment = {
GLAMOR_POS(gl_Position, primitive.xy)), GLAMOR_POS(gl_Position, primitive.xy)),
}; };
static Bool static Bool GLAMOR_NONNULL_ARGS((1, 2))
glamor_poly_segment_solid_gl(DrawablePtr drawable, GCPtr gc, glamor_poly_segment_solid_gl(DrawablePtr drawable, GCPtr gc,
int nseg, xSegment *segs) int nseg, xSegment *segs)
{ {
@ -119,7 +119,7 @@ bail:
return ret; return ret;
} }
static Bool static Bool GLAMOR_NONNULL_ARGS((1, 2))
glamor_poly_segment_gl(DrawablePtr drawable, GCPtr gc, glamor_poly_segment_gl(DrawablePtr drawable, GCPtr gc,
int nseg, xSegment *segs) int nseg, xSegment *segs)
{ {
@ -141,7 +141,7 @@ glamor_poly_segment_gl(DrawablePtr drawable, GCPtr gc,
} }
} }
static void static void GLAMOR_NONNULL_ARGS((1, 2))
glamor_poly_segment_bail(DrawablePtr drawable, GCPtr gc, glamor_poly_segment_bail(DrawablePtr drawable, GCPtr gc,
int nseg, xSegment *segs) int nseg, xSegment *segs)
{ {
@ -159,7 +159,7 @@ glamor_poly_segment_bail(DrawablePtr drawable, GCPtr gc,
miPolySegment(drawable, gc, nseg, segs); miPolySegment(drawable, gc, nseg, segs);
} }
void void GLAMOR_NONNULL_ARGS((1, 2))
glamor_poly_segment(DrawablePtr drawable, GCPtr gc, glamor_poly_segment(DrawablePtr drawable, GCPtr gc,
int nseg, xSegment *segs) int nseg, xSegment *segs)
{ {

View file

@ -41,7 +41,7 @@ static const glamor_facet glamor_facet_fillspans_120 = {
GLAMOR_POS(gl_Position, primitive.xy)), GLAMOR_POS(gl_Position, primitive.xy)),
}; };
static Bool static Bool GLAMOR_NONNULL_ARGS((1, 2))
glamor_fill_spans_gl(DrawablePtr drawable, glamor_fill_spans_gl(DrawablePtr drawable,
GCPtr gc, GCPtr gc,
int n, DDXPointPtr points, int *widths, int sorted) int n, DDXPointPtr points, int *widths, int sorted)
@ -153,7 +153,7 @@ bail:
return ret; return ret;
} }
static void static void GLAMOR_NONNULL_ARGS((1, 2))
glamor_fill_spans_bail(DrawablePtr drawable, glamor_fill_spans_bail(DrawablePtr drawable,
GCPtr gc, GCPtr gc,
int n, DDXPointPtr points, int *widths, int sorted) int n, DDXPointPtr points, int *widths, int sorted)
@ -166,7 +166,7 @@ glamor_fill_spans_bail(DrawablePtr drawable,
glamor_finish_access(drawable); glamor_finish_access(drawable);
} }
void void GLAMOR_NONNULL_ARGS((1, 2))
glamor_fill_spans(DrawablePtr drawable, glamor_fill_spans(DrawablePtr drawable,
GCPtr gc, GCPtr gc,
int n, DDXPointPtr points, int *widths, int sorted) int n, DDXPointPtr points, int *widths, int sorted)
@ -176,7 +176,7 @@ glamor_fill_spans(DrawablePtr drawable,
glamor_fill_spans_bail(drawable, gc, n, points, widths, sorted); glamor_fill_spans_bail(drawable, gc, n, points, widths, sorted);
} }
static Bool static Bool GLAMOR_NONNULL_ARGS((1))
glamor_get_spans_gl(DrawablePtr drawable, int wmax, glamor_get_spans_gl(DrawablePtr drawable, int wmax,
DDXPointPtr points, int *widths, int count, char *dst) DDXPointPtr points, int *widths, int count, char *dst)
{ {
@ -241,7 +241,7 @@ bail:
return FALSE; return FALSE;
} }
static void static void GLAMOR_NONNULL_ARGS((1))
glamor_get_spans_bail(DrawablePtr drawable, int wmax, glamor_get_spans_bail(DrawablePtr drawable, int wmax,
DDXPointPtr points, int *widths, int count, char *dst) DDXPointPtr points, int *widths, int count, char *dst)
{ {
@ -250,7 +250,7 @@ glamor_get_spans_bail(DrawablePtr drawable, int wmax,
glamor_finish_access(drawable); glamor_finish_access(drawable);
} }
void void GLAMOR_NONNULL_ARGS((1))
glamor_get_spans(DrawablePtr drawable, int wmax, glamor_get_spans(DrawablePtr drawable, int wmax,
DDXPointPtr points, int *widths, int count, char *dst) DDXPointPtr points, int *widths, int count, char *dst)
{ {
@ -259,7 +259,7 @@ glamor_get_spans(DrawablePtr drawable, int wmax,
glamor_get_spans_bail(drawable, wmax, points, widths, count, dst); glamor_get_spans_bail(drawable, wmax, points, widths, count, dst);
} }
static Bool static Bool GLAMOR_NONNULL_ARGS((1, 2))
glamor_set_spans_gl(DrawablePtr drawable, GCPtr gc, char *src, glamor_set_spans_gl(DrawablePtr drawable, GCPtr gc, char *src,
DDXPointPtr points, int *widths, int numPoints, int sorted) DDXPointPtr points, int *widths, int numPoints, int sorted)
{ {
@ -367,7 +367,7 @@ glamor_set_spans_bail(DrawablePtr drawable, GCPtr gc, char *src,
glamor_finish_access(drawable); glamor_finish_access(drawable);
} }
void void GLAMOR_NONNULL_ARGS((1, 2))
glamor_set_spans(DrawablePtr drawable, GCPtr gc, char *src, glamor_set_spans(DrawablePtr drawable, GCPtr gc, char *src,
DDXPointPtr points, int *widths, int numPoints, int sorted) DDXPointPtr points, int *widths, int numPoints, int sorted)
{ {

View file

@ -30,7 +30,7 @@
* aligns exactly with chars * aligns exactly with chars
*/ */
static void static void GLAMOR_NONNULL_ARGS((1, 2))
glamor_get_glyphs(FontPtr font, glamor_font_t *glamor_font, glamor_get_glyphs(FontPtr font, glamor_font_t *glamor_font,
int count, char *chars, Bool sixteen, CharInfoPtr *charinfo) int count, char *chars, Bool sixteen, CharInfoPtr *charinfo)
{ {
@ -87,7 +87,7 @@ glamor_get_glyphs(FontPtr font, glamor_font_t *glamor_font,
* Construct quads for the provided list of characters and draw them * Construct quads for the provided list of characters and draw them
*/ */
static int static int GLAMOR_NONNULL_ARGS((1, 2, 3, 4))
glamor_text(DrawablePtr drawable, GCPtr gc, glamor_text(DrawablePtr drawable, GCPtr gc,
glamor_font_t *glamor_font, glamor_font_t *glamor_font,
glamor_program *prog, glamor_program *prog,
@ -272,7 +272,7 @@ static const glamor_facet glamor_facet_poly_text = {
.locations = glamor_program_location_font, .locations = glamor_program_location_font,
}; };
static Bool static Bool GLAMOR_NONNULL_ARGS((1, 2))
glamor_poly_text(DrawablePtr drawable, GCPtr gc, glamor_poly_text(DrawablePtr drawable, GCPtr gc,
int x, int y, int count, char *chars, Bool sixteen, int *final_pos) int x, int y, int count, char *chars, Bool sixteen, int *final_pos)
{ {
@ -311,7 +311,7 @@ bail:
return FALSE; return FALSE;
} }
int int GLAMOR_NONNULL_ARGS((1, 2))
glamor_poly_text8(DrawablePtr drawable, GCPtr gc, glamor_poly_text8(DrawablePtr drawable, GCPtr gc,
int x, int y, int count, char *chars) int x, int y, int count, char *chars)
{ {
@ -322,7 +322,7 @@ glamor_poly_text8(DrawablePtr drawable, GCPtr gc,
return miPolyText8(drawable, gc, x, y, count, chars); return miPolyText8(drawable, gc, x, y, count, chars);
} }
int int GLAMOR_NONNULL_ARGS((1, 2))
glamor_poly_text16(DrawablePtr drawable, GCPtr gc, glamor_poly_text16(DrawablePtr drawable, GCPtr gc,
int x, int y, int count, unsigned short *chars) int x, int y, int count, unsigned short *chars)
{ {
@ -353,7 +353,7 @@ static const glamor_facet glamor_facet_image_text = {
.locations = glamor_program_location_font, .locations = glamor_program_location_font,
}; };
static Bool static Bool GLAMOR_NONNULL_ARGS((1, 2))
use_image_solid(DrawablePtr drawable, GCPtr gc, glamor_program *prog, void *arg) use_image_solid(DrawablePtr drawable, GCPtr gc, glamor_program *prog, void *arg)
{ {
return glamor_set_solid(drawable, gc, FALSE, prog->fg_uniform); return glamor_set_solid(drawable, gc, FALSE, prog->fg_uniform);
@ -366,7 +366,7 @@ static const glamor_facet glamor_facet_image_fill = {
.use = use_image_solid, .use = use_image_solid,
}; };
static Bool static Bool GLAMOR_NONNULL_ARGS((1, 2))
glamor_te_text_use(DrawablePtr drawable, GCPtr gc, glamor_program *prog, void *arg) glamor_te_text_use(DrawablePtr drawable, GCPtr gc, glamor_program *prog, void *arg)
{ {
if (!glamor_set_solid(drawable, gc, FALSE, prog->fg_uniform)) if (!glamor_set_solid(drawable, gc, FALSE, prog->fg_uniform))
@ -387,7 +387,7 @@ static const glamor_facet glamor_facet_te_text = {
.use = glamor_te_text_use, .use = glamor_te_text_use,
}; };
static Bool static Bool GLAMOR_NONNULL_ARGS((1, 2))
glamor_image_text(DrawablePtr drawable, GCPtr gc, glamor_image_text(DrawablePtr drawable, GCPtr gc,
int x, int y, int count, char *chars, int x, int y, int count, char *chars,
Bool sixteen) Bool sixteen)
@ -478,7 +478,7 @@ bail:
return FALSE; return FALSE;
} }
void void GLAMOR_NONNULL_ARGS((1, 2))
glamor_image_text8(DrawablePtr drawable, GCPtr gc, glamor_image_text8(DrawablePtr drawable, GCPtr gc,
int x, int y, int count, char *chars) int x, int y, int count, char *chars)
{ {
@ -486,7 +486,7 @@ glamor_image_text8(DrawablePtr drawable, GCPtr gc,
miImageText8(drawable, gc, x, y, count, chars); miImageText8(drawable, gc, x, y, count, chars);
} }
void void GLAMOR_NONNULL_ARGS((1, 2))
glamor_image_text16(DrawablePtr drawable, GCPtr gc, glamor_image_text16(DrawablePtr drawable, GCPtr gc,
int x, int y, int count, unsigned short *chars) int x, int y, int count, unsigned short *chars)
{ {

View file

@ -26,7 +26,7 @@
/* /*
* Write a region of bits into a drawable's backing pixmap * Write a region of bits into a drawable's backing pixmap
*/ */
void void GLAMOR_NONNULL_ARGS((1, 2, 8))
glamor_upload_boxes(DrawablePtr drawable, BoxPtr in_boxes, int in_nbox, glamor_upload_boxes(DrawablePtr drawable, BoxPtr in_boxes, int in_nbox,
int dx_src, int dy_src, int dx_src, int dy_src,
int dx_dst, int dy_dst, int dx_dst, int dy_dst,
@ -120,7 +120,7 @@ glamor_upload_boxes(DrawablePtr drawable, BoxPtr in_boxes, int in_nbox,
* Upload a region of data * Upload a region of data
*/ */
void void GLAMOR_NONNULL_ARGS((1, 2, 5))
glamor_upload_region(DrawablePtr drawable, RegionPtr region, glamor_upload_region(DrawablePtr drawable, RegionPtr region,
int region_x, int region_y, int region_x, int region_y,
uint8_t *bits, uint32_t byte_stride) uint8_t *bits, uint32_t byte_stride)
@ -134,7 +134,7 @@ glamor_upload_region(DrawablePtr drawable, RegionPtr region,
/* /*
* Read stuff from the drawable's backing pixmap FBOs and write to memory * Read stuff from the drawable's backing pixmap FBOs and write to memory
*/ */
void void GLAMOR_NONNULL_ARGS((1, 2, 8))
glamor_download_boxes(DrawablePtr drawable, BoxPtr in_boxes, int in_nbox, glamor_download_boxes(DrawablePtr drawable, BoxPtr in_boxes, int in_nbox,
int dx_src, int dy_src, int dx_src, int dy_src,
int dx_dst, int dy_dst, int dx_dst, int dy_dst,

View file

@ -27,17 +27,20 @@ void
glamor_upload_boxes(DrawablePtr drawable, BoxPtr in_boxes, int in_nbox, glamor_upload_boxes(DrawablePtr drawable, BoxPtr in_boxes, int in_nbox,
int dx_src, int dy_src, int dx_src, int dy_src,
int dx_dst, int dy_dst, int dx_dst, int dy_dst,
uint8_t *bits, uint32_t byte_stride); uint8_t *bits, uint32_t byte_stride)
GLAMOR_NONNULL_ARGS((1, 2, 8));
void void
glamor_upload_region(DrawablePtr drawable, RegionPtr region, glamor_upload_region(DrawablePtr drawable, RegionPtr region,
int region_x, int region_y, int region_x, int region_y,
uint8_t *bits, uint32_t byte_stride); uint8_t *bits, uint32_t byte_stride)
GLAMOR_NONNULL_ARGS((1, 2, 5));
void void
glamor_download_boxes(DrawablePtr drawable, BoxPtr in_boxes, int in_nbox, glamor_download_boxes(DrawablePtr drawable, BoxPtr in_boxes, int in_nbox,
int dx_src, int dy_src, int dx_src, int dy_src,
int dx_dst, int dy_dst, int dx_dst, int dy_dst,
uint8_t *bits, uint32_t byte_stride); uint8_t *bits, uint32_t byte_stride)
GLAMOR_NONNULL_ARGS((1, 2, 8));
#endif /* _GLAMOR_TRANSFER_H_ */ #endif /* _GLAMOR_TRANSFER_H_ */

View file

@ -33,7 +33,7 @@
* clipping computations can be adjusted as appropriate * clipping computations can be adjusted as appropriate
*/ */
Bool Bool GLAMOR_NONNULL_ARGS((1))
glamor_set_destination_drawable(DrawablePtr drawable, glamor_set_destination_drawable(DrawablePtr drawable,
int box_index, int box_index,
Bool do_drawable_translate, Bool do_drawable_translate,
@ -110,7 +110,7 @@ glamor_set_destination_drawable(DrawablePtr drawable,
* from the specified GC. Load the target color into the specified uniform * from the specified GC. Load the target color into the specified uniform
*/ */
void void GLAMOR_NONNULL_ARGS((1))
glamor_set_color_depth(ScreenPtr pScreen, glamor_set_color_depth(ScreenPtr pScreen,
int depth, int depth,
CARD32 pixel, CARD32 pixel,
@ -129,7 +129,7 @@ glamor_set_color_depth(ScreenPtr pScreen,
glUniform4fv(uniform, 1, color); glUniform4fv(uniform, 1, color);
} }
Bool Bool GLAMOR_NONNULL_ARGS((1, 2))
glamor_set_solid(DrawablePtr drawable, glamor_set_solid(DrawablePtr drawable,
GCPtr gc, GCPtr gc,
Bool use_alu, Bool use_alu,
@ -163,7 +163,7 @@ glamor_set_solid(DrawablePtr drawable,
return TRUE; return TRUE;
} }
Bool Bool GLAMOR_NONNULL_ARGS((1))
glamor_set_texture_pixmap(PixmapPtr texture, Bool destination_red) glamor_set_texture_pixmap(PixmapPtr texture, Bool destination_red)
{ {
glamor_pixmap_private *texture_priv; glamor_pixmap_private *texture_priv;
@ -187,7 +187,7 @@ glamor_set_texture_pixmap(PixmapPtr texture, Bool destination_red)
return TRUE; return TRUE;
} }
Bool Bool GLAMOR_NONNULL_ARGS((1))
glamor_set_texture(PixmapPtr texture, glamor_set_texture(PixmapPtr texture,
Bool destination_red, Bool destination_red,
int off_x, int off_x,
@ -203,7 +203,7 @@ glamor_set_texture(PixmapPtr texture,
return TRUE; return TRUE;
} }
Bool Bool GLAMOR_NONNULL_ARGS((1, 2))
glamor_set_tiled(DrawablePtr drawable, glamor_set_tiled(DrawablePtr drawable,
GCPtr gc, GCPtr gc,
GLint offset_uniform, GLint offset_uniform,
@ -223,7 +223,7 @@ glamor_set_tiled(DrawablePtr drawable,
size_inv_uniform); size_inv_uniform);
} }
static PixmapPtr static PixmapPtr GLAMOR_NONNULL_ARGS((1))
glamor_get_stipple_pixmap(GCPtr gc) glamor_get_stipple_pixmap(GCPtr gc)
{ {
glamor_gc_private *gc_priv = glamor_get_gc_private(gc); glamor_gc_private *gc_priv = glamor_get_gc_private(gc);
@ -281,7 +281,7 @@ bail:
return NULL; return NULL;
} }
Bool Bool GLAMOR_NONNULL_ARGS((1, 2))
glamor_set_stippled(DrawablePtr drawable, glamor_set_stippled(DrawablePtr drawable,
GCPtr gc, GCPtr gc,
GLint fg_uniform, GLint fg_uniform,

View file

@ -30,15 +30,17 @@ glamor_set_destination_drawable(DrawablePtr drawable,
Bool center_offset, Bool center_offset,
GLint matrix_uniform_location, GLint matrix_uniform_location,
int *p_off_x, int *p_off_x,
int *p_off_y); int *p_off_y)
GLAMOR_NONNULL_ARGS((1));
void void
glamor_set_color_depth(ScreenPtr pScreen, glamor_set_color_depth(ScreenPtr pScreen,
int depth, int depth,
CARD32 pixel, CARD32 pixel,
GLint uniform); GLint uniform)
GLAMOR_NONNULL_ARGS((1));
static inline void static inline void GLAMOR_NONNULL_ARGS((1))
glamor_set_color(DrawablePtr drawable, glamor_set_color(DrawablePtr drawable,
CARD32 pixel, CARD32 pixel,
GLint uniform) GLint uniform)
@ -50,7 +52,8 @@ glamor_set_color(DrawablePtr drawable,
Bool Bool
glamor_set_texture_pixmap(PixmapPtr texture, glamor_set_texture_pixmap(PixmapPtr texture,
Bool destination_red); Bool destination_red)
GLAMOR_NONNULL_ARGS((1));
Bool Bool
glamor_set_texture(PixmapPtr texture, glamor_set_texture(PixmapPtr texture,
@ -58,26 +61,30 @@ glamor_set_texture(PixmapPtr texture,
int off_x, int off_x,
int off_y, int off_y,
GLint offset_uniform, GLint offset_uniform,
GLint size_uniform); GLint size_uniform)
GLAMOR_NONNULL_ARGS((1));
Bool Bool
glamor_set_solid(DrawablePtr drawable, glamor_set_solid(DrawablePtr drawable,
GCPtr gc, GCPtr gc,
Bool use_alu, Bool use_alu,
GLint uniform); GLint uniform)
GLAMOR_NONNULL_ARGS((1, 2));
Bool Bool
glamor_set_tiled(DrawablePtr drawable, glamor_set_tiled(DrawablePtr drawable,
GCPtr gc, GCPtr gc,
GLint offset_uniform, GLint offset_uniform,
GLint size_uniform); GLint size_uniform)
GLAMOR_NONNULL_ARGS((1, 2));
Bool Bool
glamor_set_stippled(DrawablePtr drawable, glamor_set_stippled(DrawablePtr drawable,
GCPtr gc, GCPtr gc,
GLint fg_uniform, GLint fg_uniform,
GLint offset_uniform, GLint offset_uniform,
GLint size_uniform); GLint size_uniform)
GLAMOR_NONNULL_ARGS((1, 2));
/* /*
* Vertex shader bits that transform X coordinates to pixmap * Vertex shader bits that transform X coordinates to pixmap

View file

@ -404,12 +404,13 @@ static REF_TRANSFORM trans[2] = {
{1.1643, 0.0, 1.7927, -0.2132, -0.5329, 2.1124, 0.0} /* BT.709 */ {1.1643, 0.0, 1.7927, -0.2132, -0.5329, 2.1124, 0.0} /* BT.709 */
}; };
void void GLAMOR_NONNULL_ARGS((1))
glamor_xv_render(glamor_port_private *port_priv, int id) glamor_xv_render(glamor_port_private *port_priv, int id)
{ {
ScreenPtr screen = port_priv->pPixmap->drawable.pScreen; ScreenPtr screen = port_priv->pPixmap->drawable.pScreen;
glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
PixmapPtr pixmap = port_priv->pPixmap; PixmapPtr pixmap = port_priv->pPixmap;
assert(pixmap != NULL);
glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap);
glamor_pixmap_private *src_pixmap_priv[3]; glamor_pixmap_private *src_pixmap_priv[3];
BoxPtr box = REGION_RECTS(&port_priv->clip); BoxPtr box = REGION_RECTS(&port_priv->clip);