diff --git a/glamor/glamor.c b/glamor/glamor.c index 10b5fdec6..d998f2938 100644 --- a/glamor/glamor.c +++ b/glamor/glamor.c @@ -41,14 +41,14 @@ DevPrivateKeyRec glamor_screen_private_key; DevPrivateKeyRec glamor_pixmap_private_key; DevPrivateKeyRec glamor_gc_private_key; -glamor_screen_private * +glamor_screen_private * GLAMOR_NONNULL_ARGS((1)) glamor_get_screen_private(ScreenPtr screen) { return (glamor_screen_private *) dixLookupPrivate(&screen->devPrivates, &glamor_screen_private_key); } -void +void GLAMOR_NONNULL_ARGS((1)) glamor_set_screen_private(ScreenPtr screen, glamor_screen_private *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 * exaGetOffscreenPixmap() on the drawable. */ -PixmapPtr +PixmapPtr GLAMOR_NONNULL_ARGS((1)) glamor_get_drawable_pixmap(DrawablePtr drawable) { if (drawable->type == DRAWABLE_WINDOW) @@ -74,7 +74,7 @@ glamor_get_drawable_pixmap(DrawablePtr 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) { 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; } -void +void GLAMOR_NONNULL_ARGS((1)) glamor_set_pixmap_type(PixmapPtr pixmap, glamor_pixmap_type_t type) { 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); } -Bool +Bool GLAMOR_NONNULL_ARGS((1)) glamor_set_pixmap_texture(PixmapPtr pixmap, unsigned int tex) { ScreenPtr screen = pixmap->drawable.pScreen; @@ -129,7 +129,7 @@ glamor_set_pixmap_texture(PixmapPtr pixmap, unsigned int tex) return TRUE; } -void +void GLAMOR_NONNULL_ARGS((1)) glamor_clear_pixmap(PixmapPtr pixmap) { 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, unsigned int usage) { @@ -262,7 +262,7 @@ glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth, return pixmap; } -Bool +Bool GLAMOR_NONNULL_ARGS((1)) glamor_destroy_pixmap(PixmapPtr pixmap) { if (pixmap->refcnt == 1) { @@ -272,14 +272,14 @@ glamor_destroy_pixmap(PixmapPtr pixmap) return fbDestroyPixmap(pixmap); } -void +void GLAMOR_NONNULL_ARGS((1)) glamor_block_handler(ScreenPtr screen) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); glamor_flush(glamor_priv); } -static void +static void GLAMOR_NONNULL_ARGS((1)) _glamor_block_handler(ScreenPtr screen, void *timeout) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); @@ -423,7 +423,7 @@ glamor_setup_debug_output(ScreenPtr screen) 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) { ScreenPtr pScreen = pixmap->drawable.pScreen; @@ -436,7 +436,7 @@ glamor_format_for_pixmap(PixmapPtr pixmap) 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, GLenum internalformat, GLenum format, GLenum type, 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 * 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_screen_private *glamor_priv = glamor_get_screen_private(screen); @@ -892,7 +892,7 @@ glamor_init(ScreenPtr screen, unsigned int flags) return FALSE; } -static void +static void GLAMOR_NONNULL_ARGS((1)) glamor_release_screen_priv(ScreenPtr screen) { glamor_screen_private *glamor_priv; @@ -905,7 +905,7 @@ glamor_release_screen_priv(ScreenPtr screen) glamor_set_screen_private(screen, NULL); } -Bool +Bool GLAMOR_NONNULL_ARGS((1)) glamor_close_screen(ScreenPtr screen) { glamor_screen_private *glamor_priv; @@ -975,7 +975,7 @@ glamor_get_glvnd_vendor(ScreenPtr screen) return glamor_priv->glvnd_vendor; } -void +void GLAMOR_NONNULL_ARGS((1)) glamor_enable_dri3(ScreenPtr 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; } -Bool +Bool GLAMOR_NONNULL_ARGS((1)) glamor_supports_pixmap_import_export(ScreenPtr 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; } -void +void GLAMOR_NONNULL_ARGS((1)) glamor_set_drawable_modifiers_func(ScreenPtr screen, GetDrawableModifiersFuncPtr func) { @@ -1000,7 +1000,7 @@ glamor_set_drawable_modifiers_func(ScreenPtr screen, glamor_priv->get_drawable_modifiers = func; } -Bool +Bool GLAMOR_NONNULL_ARGS((1)) glamor_get_drawable_modifiers(DrawablePtr draw, uint32_t format, uint32_t *num_modifiers, uint64_t **modifiers) { @@ -1016,7 +1016,7 @@ glamor_get_drawable_modifiers(DrawablePtr draw, uint32_t format, return TRUE; } -static int +static int GLAMOR_NONNULL_ARGS((2)) _glamor_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds, uint32_t *strides, uint32_t *offsets, CARD32 *size, uint64_t *modifier) @@ -1053,7 +1053,7 @@ _glamor_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds, return 0; } -int +int GLAMOR_NONNULL_ARGS((2)) glamor_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds, uint32_t *strides, uint32_t *offsets, uint64_t *modifier) @@ -1062,7 +1062,7 @@ glamor_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds, NULL, modifier); } -int +int GLAMOR_NONNULL_ARGS((2)) glamor_fd_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, CARD16 *stride, CARD32 *size) { @@ -1079,7 +1079,7 @@ glamor_fd_from_pixmap(ScreenPtr screen, return fd; } -int +int GLAMOR_NONNULL_ARGS((2)) glamor_shareable_fd_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, CARD16 *stride, CARD32 *size) { @@ -1100,7 +1100,7 @@ glamor_shareable_fd_from_pixmap(ScreenPtr screen, return ret; } -int +int GLAMOR_NONNULL_ARGS((1)) glamor_name_from_pixmap(PixmapPtr pixmap, CARD16 *stride, CARD32 *size) { 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; } -void +void GLAMOR_NONNULL_ARGS((1)) glamor_finish(ScreenPtr screen) { glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); diff --git a/glamor/glamor.h b/glamor/glamor.h index f5634b7e7..403c32100 100644 --- a/glamor/glamor.h +++ b/glamor/glamor.h @@ -39,6 +39,22 @@ #include #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 gbm_bo; 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 * the internal data structure still exist at that time. * 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 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, - 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, * 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 PixmapPtr glamor_create_pixmap(ScreenPtr screen, int w, int h, - int depth, unsigned int usage); -extern _X_EXPORT Bool glamor_destroy_pixmap(PixmapPtr pixmap); + int depth, unsigned int usage) + 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_FIXUP 0x101 @@ -146,21 +169,29 @@ extern _X_EXPORT Bool glamor_destroy_pixmap(PixmapPtr pixmap); * fbos of the two pixmaps. * */ 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, - PixmapPtr back); + PixmapPtr back) + GLAMOR_NONNULL_ARGS((1, 2)); /* 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 *, 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, - 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 int glamor_egl_fd_from_pixmap(ScreenPtr, PixmapPtr, CARD16 *, CARD32 *); +extern _X_EXPORT struct gbm_device *glamor_egl_get_gbm_device(ScreenPtr screen) + 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_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 * */ -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. * @@ -192,7 +224,8 @@ extern _X_EXPORT int glamor_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds, 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. * @@ -207,7 +240,8 @@ extern _X_EXPORT int glamor_fds_from_pixmap(ScreenPtr screen, * */ extern _X_EXPORT int glamor_fd_from_pixmap(ScreenPtr screen, 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 * 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, PixmapPtr pixmap, CARD16 *stride, - CARD32 *size); + CARD32 *size) + GLAMOR_NONNULL_ARGS((2)); /** * @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. * */ 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. * @@ -257,7 +293,8 @@ extern _X_EXPORT int glamor_name_from_pixmap(PixmapPtr pixmap, * Returns the gbm_bo on success, NULL on error. * */ 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. * @@ -282,7 +319,8 @@ extern _X_EXPORT PixmapPtr glamor_pixmap_from_fds(ScreenPtr screen, const CARD32 *offsets, CARD8 depth, 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. * @@ -302,7 +340,8 @@ extern _X_EXPORT PixmapPtr glamor_pixmap_from_fd(ScreenPtr screen, CARD16 height, CARD16 stride, CARD8 depth, - CARD8 bpp); + CARD8 bpp) + GLAMOR_NONNULL_ARGS((1)); /* @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 stride, CARD8 depth, - CARD8 bpp); + CARD8 bpp) + GLAMOR_NONNULL_ARGS((1)); extern _X_EXPORT Bool glamor_get_formats(ScreenPtr screen, CARD32 *num_formats, - CARD32 **formats); + CARD32 **formats) + GLAMOR_NONNULL_ARGS((1, 2, 3)); extern _X_EXPORT Bool glamor_get_modifiers(ScreenPtr screen, uint32_t format, uint32_t *num_modifiers, - uint64_t **modifiers); + uint64_t **modifiers) + GLAMOR_NONNULL_ARGS((1)); extern _X_EXPORT Bool glamor_get_drawable_modifiers(DrawablePtr draw, uint32_t format, 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, - GetDrawableModifiersFuncPtr func); + GetDrawableModifiersFuncPtr func) + GLAMOR_NONNULL_ARGS((1)); #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. * 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); @@ -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. */ 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 * 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. */ 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 @@ -403,14 +450,17 @@ extern _X_EXPORT Bool glamor_egl_create_textured_pixmap(PixmapPtr pixmap, extern _X_EXPORT Bool glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, 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 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); @@ -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 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 #ifdef GLAMOR_FOR_XORG diff --git a/glamor/glamor_composite_glyphs.c b/glamor/glamor_composite_glyphs.c index 13af727ff..10237c210 100644 --- a/glamor/glamor_composite_glyphs.c +++ b/glamor/glamor_composite_glyphs.c @@ -267,6 +267,7 @@ glamor_glyphs_flush(CARD8 op, PicturePtr src, PicturePtr dst, DrawablePtr drawable = dst->pDrawable; glamor_screen_private *glamor_priv = glamor_get_screen_private(drawable->pScreen); PixmapPtr atlas_pixmap = atlas->atlas; + assert(atlas_pixmap != NULL); glamor_pixmap_private *atlas_priv = glamor_get_pixmap_private(atlas_pixmap); glamor_pixmap_fbo *atlas_fbo = glamor_pixmap_fbo_at(atlas_priv, 0); PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); @@ -361,7 +362,7 @@ glamor_glyph_start(ScreenPtr screen, int count) 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) { if (drawable->depth == 32) @@ -444,6 +445,7 @@ glamor_composite_glyphs(CARD8 op, } glyph_atlas = next_atlas; } + assert(glyph_atlas != NULL); /* Glyph not cached in current atlas? */ diff --git a/glamor/glamor_core.c b/glamor/glamor_core.c index 8a601d086..0d88239e9 100644 --- a/glamor/glamor_core.c +++ b/glamor/glamor_core.c @@ -35,7 +35,7 @@ #include "glamor_priv.h" -Bool +Bool GLAMOR_NONNULL_ARGS((1)) glamor_get_drawable_location(const DrawablePtr drawable) { PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); diff --git a/glamor/glamor_dash.c b/glamor/glamor_dash.c index 74252de33..7607d38a4 100644 --- a/glamor/glamor_dash.c +++ b/glamor/glamor_dash.c @@ -74,7 +74,7 @@ static const glamor_facet glamor_facet_double_dash_lines = { glamor_program_location_bg), }; -static PixmapPtr +static PixmapPtr GLAMOR_NONNULL_ARGS((1)) glamor_get_dash_pixmap(GCPtr gc) { glamor_gc_private *gc_priv = glamor_get_gc_private(gc); @@ -129,7 +129,7 @@ bail: return NULL; } -static glamor_program * +static glamor_program * GLAMOR_NONNULL_ARGS((1, 2)) glamor_dash_setup(DrawablePtr drawable, GCPtr gc) { ScreenPtr screen = drawable->pScreen; @@ -199,7 +199,7 @@ bail: return NULL; } -static void +static void GLAMOR_NONNULL_ARGS((1, 2, 3)) glamor_dash_loop(DrawablePtr drawable, GCPtr gc, glamor_program *prog, 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)); } -Bool +Bool GLAMOR_NONNULL_ARGS((1, 2)) glamor_poly_lines_dash_gl(DrawablePtr drawable, GCPtr gc, int mode, int n, DDXPointPtr points) { @@ -302,7 +302,7 @@ glamor_poly_lines_dash_gl(DrawablePtr drawable, GCPtr gc, return TRUE; } -static short * +static short * GLAMOR_NONNULL_ARGS((1)) glamor_add_segment(short *v, short x1, short y1, short x2, short y2, 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; } -Bool +Bool GLAMOR_NONNULL_ARGS((1, 2)) glamor_poly_segment_dash_gl(DrawablePtr drawable, GCPtr gc, int nseg, xSegment *segs) { diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c index 88b1e8e93..ae2479961 100644 --- a/glamor/glamor_egl.c +++ b/glamor/glamor_egl.c @@ -69,14 +69,14 @@ struct glamor_egl_screen_private { 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) { return (struct glamor_egl_screen_private *) scrn->privates[xf86GlamorEGLPrivateIndex].ptr; } -static void +static void GLAMOR_NONNULL_ARGS((1)) glamor_egl_make_current(struct glamor_context *glamor_ctx) { /* 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) { struct drm_gem_flink flink; @@ -117,7 +117,7 @@ glamor_get_flink_name(int fd, int handle, int *name) return TRUE; } -static Bool +static Bool GLAMOR_NONNULL_ARGS((1, 2, 3)) glamor_create_texture_from_image(ScreenPtr screen, EGLImageKHR image, GLuint * texture) { @@ -137,7 +137,7 @@ glamor_create_texture_from_image(ScreenPtr screen, return TRUE; } -struct gbm_device * +struct gbm_device * GLAMOR_NONNULL_ARGS((1)) glamor_egl_get_gbm_device(ScreenPtr screen) { struct glamor_egl_screen_private *glamor_egl = @@ -145,7 +145,7 @@ glamor_egl_get_gbm_device(ScreenPtr screen) return glamor_egl->gbm; } -Bool +Bool GLAMOR_NONNULL_ARGS((1)) glamor_egl_create_textured_screen(ScreenPtr screen, int handle, int stride) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); @@ -161,7 +161,7 @@ glamor_egl_create_textured_screen(ScreenPtr screen, int handle, int stride) return TRUE; } -static void +static void GLAMOR_NONNULL_ARGS((1)) glamor_egl_set_pixmap_image(PixmapPtr pixmap, EGLImageKHR image, Bool used_modifiers) { @@ -181,7 +181,7 @@ glamor_egl_set_pixmap_image(PixmapPtr pixmap, EGLImageKHR image, pixmap_priv->used_modifiers = used_modifiers; } -Bool +Bool GLAMOR_NONNULL_ARGS((1)) glamor_egl_create_textured_pixmap(PixmapPtr pixmap, int handle, int stride) { ScreenPtr screen = pixmap->drawable.pScreen; @@ -216,7 +216,7 @@ glamor_egl_create_textured_pixmap(PixmapPtr pixmap, int handle, int stride) return TRUE; } -Bool +Bool GLAMOR_NONNULL_ARGS((1)) glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, struct gbm_bo *bo, Bool used_modifiers) @@ -251,7 +251,7 @@ glamor_egl_create_textured_pixmap_from_gbm_bo(PixmapPtr pixmap, return ret; } -static void +static void GLAMOR_NONNULL_ARGS((3)) glamor_get_name_from_bo(int gbm_fd, struct gbm_bo *bo, int *name) { 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; } -static Bool +static Bool GLAMOR_NONNULL_ARGS((1)) glamor_make_pixmap_exportable(PixmapPtr pixmap, Bool modifiers_ok) { ScreenPtr screen = pixmap->drawable.pScreen; @@ -372,7 +372,7 @@ glamor_make_pixmap_exportable(PixmapPtr pixmap, Bool modifiers_ok) 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) { 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); } -struct gbm_bo * +struct gbm_bo * GLAMOR_NONNULL_ARGS((1, 2)) glamor_gbm_bo_from_pixmap(ScreenPtr screen, PixmapPtr pixmap) { 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); } -int +int GLAMOR_NONNULL_ARGS((1, 2)) glamor_egl_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds, uint32_t *strides, uint32_t *offsets, uint64_t *modifier) @@ -465,7 +465,7 @@ glamor_egl_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds, #endif } -int +int GLAMOR_NONNULL_ARGS((1, 2)) glamor_egl_fd_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, CARD16 *stride, CARD32 *size) { @@ -491,7 +491,7 @@ glamor_egl_fd_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, #endif } -int +int GLAMOR_NONNULL_ARGS((1, 2)) glamor_egl_fd_name_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, CARD16 *stride, CARD32 *size) @@ -520,7 +520,7 @@ glamor_egl_fd_name_from_pixmap(ScreenPtr screen, return fd; } -static bool +static bool GLAMOR_NONNULL_ARGS((2)) gbm_format_for_depth(CARD8 depth, uint32_t *format) { 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, int fd, CARD16 width, @@ -580,7 +580,7 @@ glamor_back_pixmap_from_fd(PixmapPtr pixmap, return ret; } -PixmapPtr +PixmapPtr GLAMOR_NONNULL_ARGS((1)) glamor_pixmap_from_fds(ScreenPtr screen, CARD8 num_fds, const int *fds, CARD16 width, CARD16 height, @@ -638,7 +638,7 @@ error: return pixmap; } -PixmapPtr +PixmapPtr GLAMOR_NONNULL_ARGS((1)) glamor_pixmap_from_fd(ScreenPtr screen, int fd, CARD16 width, @@ -660,7 +660,7 @@ glamor_pixmap_from_fd(ScreenPtr screen, return pixmap; } -Bool +Bool GLAMOR_NONNULL_ARGS((1, 2, 3)) glamor_get_formats(ScreenPtr screen, CARD32 *num_formats, CARD32 **formats) { @@ -700,7 +700,7 @@ glamor_get_formats(ScreenPtr screen, #endif } -Bool +Bool GLAMOR_NONNULL_ARGS((1)) glamor_get_modifiers(ScreenPtr screen, uint32_t format, uint32_t *num_modifiers, uint64_t **modifiers) { @@ -742,7 +742,7 @@ glamor_get_modifiers(ScreenPtr screen, uint32_t format, #endif } -const char * +const char * GLAMOR_NONNULL_ARGS((1)) glamor_egl_get_driver_name(ScreenPtr screen) { #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) { ScreenPtr screen = pixmap->drawable.pScreen; @@ -784,7 +784,7 @@ glamor_egl_destroy_pixmap(PixmapPtr pixmap) return ret; } -void +void GLAMOR_NONNULL_ARGS((1, 2)) glamor_egl_exchange_buffers(PixmapPtr front, PixmapPtr back) { EGLImageKHR temp_img; @@ -807,7 +807,7 @@ glamor_egl_exchange_buffers(PixmapPtr front, PixmapPtr back) glamor_set_pixmap_type(back, GLAMOR_TEXTURE_DRM); } -static Bool +static Bool GLAMOR_NONNULL_ARGS((1)) glamor_egl_close_screen(ScreenPtr screen) { ScrnInfoPtr scrn; @@ -819,6 +819,7 @@ glamor_egl_close_screen(ScreenPtr screen) glamor_egl = glamor_egl_get_screen_private(scrn); screen_pixmap = screen->GetScreenPixmap(screen); pixmap_priv = glamor_get_pixmap_private(screen_pixmap); + assert(pixmap_priv != NULL); eglDestroyImageKHR(glamor_egl->display, pixmap_priv->image); pixmap_priv->image = NULL; @@ -829,7 +830,7 @@ glamor_egl_close_screen(ScreenPtr screen) } #ifdef DRI3 -static int +static int GLAMOR_NONNULL_ARGS((2)) glamor_dri3_open_client(ClientPtr client, ScreenPtr screen, RRProviderPtr provider, @@ -891,7 +892,7 @@ static const dri3_screen_info_rec glamor_dri3_info = { }; #endif /* DRI3 */ -void +void GLAMOR_NONNULL_ARGS((1, 2)) glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); @@ -959,7 +960,8 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx) #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) { eglMakeCurrent(glamor_egl->display, @@ -978,7 +980,7 @@ static void glamor_egl_cleanup(struct glamor_egl_screen_private *glamor_egl) free(glamor_egl); } -static void +static void GLAMOR_NONNULL_ARGS((1)) glamor_egl_free_screen(ScrnInfoPtr scrn) { 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) { struct glamor_egl_screen_private *glamor_egl = @@ -1044,7 +1046,7 @@ glamor_egl_try_big_gl_api(ScrnInfoPtr scrn) return TRUE; } -static Bool +static Bool GLAMOR_NONNULL_ARGS((1)) glamor_egl_try_gles_api(ScrnInfoPtr scrn) { struct glamor_egl_screen_private *glamor_egl = @@ -1090,7 +1092,7 @@ static const OptionInfoRec GlamorEGLOptions[] = { { -1, NULL, OPTV_NONE, {0}, FALSE }, }; -Bool +Bool GLAMOR_NONNULL_ARGS((1)) glamor_egl_init(ScrnInfoPtr scrn, int fd) { struct glamor_egl_screen_private *glamor_egl; diff --git a/glamor/glamor_fbo.c b/glamor/glamor_fbo.c index 0db9d6858..facf062c9 100644 --- a/glamor/glamor_fbo.c +++ b/glamor/glamor_fbo.c @@ -277,7 +277,7 @@ glamor_pixmap_detach_fbo(glamor_pixmap_private *pixmap_priv) } /* 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_private *pixmap_priv; @@ -355,7 +355,7 @@ glamor_pixmap_ensure_fbo(PixmapPtr pixmap, int flag) return TRUE; } -void +void GLAMOR_NONNULL_ARGS((1, 2)) glamor_pixmap_exchange_fbos(PixmapPtr front, PixmapPtr back) { glamor_pixmap_private *front_priv, *back_priv; diff --git a/glamor/glamor_glyphblt.c b/glamor/glamor_glyphblt.c index 4ab23b333..60812a029 100644 --- a/glamor/glamor_glyphblt.c +++ b/glamor/glamor_glyphblt.c @@ -38,7 +38,7 @@ static const glamor_facet glamor_facet_poly_glyph_blt = { GLAMOR_POS(gl_Position, primitive)), }; -static Bool +static Bool GLAMOR_NONNULL_ARGS((1, 2)) glamor_poly_glyph_blt_gl(DrawablePtr drawable, GCPtr gc, int start_x, int y, unsigned int nglyph, CharInfoPtr *ppci, void *pglyph_base) @@ -153,7 +153,7 @@ bail: return ret; } -void +void GLAMOR_NONNULL_ARGS((1, 2)) glamor_poly_glyph_blt(DrawablePtr drawable, GCPtr gc, int start_x, int y, unsigned int nglyph, CharInfoPtr *ppci, void *pglyph_base) @@ -165,7 +165,7 @@ glamor_poly_glyph_blt(DrawablePtr drawable, GCPtr gc, ppci, pglyph_base); } -static Bool +static Bool GLAMOR_NONNULL_ARGS((1, 2, 3)) glamor_push_pixels_gl(GCPtr gc, PixmapPtr bitmap, DrawablePtr drawable, int w, int h, int x, int y) { @@ -249,7 +249,7 @@ bail: return ret; } -void +void GLAMOR_NONNULL_ARGS((1, 2, 3)) glamor_push_pixels(GCPtr pGC, PixmapPtr pBitmap, DrawablePtr pDrawable, int w, int h, int x, int y) { diff --git a/glamor/glamor_gradient.c b/glamor/glamor_gradient.c index 7c22ccdb2..1952ecce9 100644 --- a/glamor/glamor_gradient.c +++ b/glamor/glamor_gradient.c @@ -559,7 +559,7 @@ _glamor_create_linear_gradient_program(ScreenPtr screen, int stops_count, return TRUE; } -Bool +Bool GLAMOR_NONNULL_ARGS((1)) glamor_init_gradient_shader(ScreenPtr screen) { 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]); } -static int +static int GLAMOR_NONNULL_ARGS((1, 2, 3)) _glamor_gradient_set_pixmap_destination(ScreenPtr screen, glamor_screen_private *glamor_priv, PicturePtr dst_picture, @@ -814,7 +814,7 @@ _glamor_gradient_set_stops(PicturePtr src_picture, PictGradient *pgradient, return count; } -PicturePtr +PicturePtr GLAMOR_NONNULL_ARGS((1, 2)) glamor_generate_radial_gradient_picture(ScreenPtr screen, PicturePtr src_picture, int x_source, int y_source, @@ -1119,7 +1119,7 @@ glamor_generate_radial_gradient_picture(ScreenPtr screen, return NULL; } -PicturePtr +PicturePtr GLAMOR_NONNULL_ARGS((1, 2)) glamor_generate_linear_gradient_picture(ScreenPtr screen, PicturePtr src_picture, int x_source, int y_source, diff --git a/glamor/glamor_image.c b/glamor/glamor_image.c index 28bdc159f..7da4a706e 100644 --- a/glamor/glamor_image.c +++ b/glamor/glamor_image.c @@ -28,7 +28,7 @@ * 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, 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); } -void +void GLAMOR_NONNULL_ARGS((1, 2, 10)) glamor_put_image(DrawablePtr drawable, GCPtr gc, int depth, int x, int y, 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); } -static Bool +static Bool GLAMOR_NONNULL_ARGS((1, 8)) glamor_get_image_gl(DrawablePtr drawable, int x, int y, int w, int h, unsigned int format, unsigned long plane_mask, char *d) { @@ -143,7 +143,7 @@ bail: 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, 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); } -void +void GLAMOR_NONNULL_ARGS((1, 8)) glamor_get_image(DrawablePtr drawable, int x, int y, int w, int h, unsigned int format, unsigned long plane_mask, char *d) { diff --git a/glamor/glamor_largepixmap.c b/glamor/glamor_largepixmap.c index 334a20cb1..4a57669ce 100644 --- a/glamor/glamor_largepixmap.c +++ b/glamor/glamor_largepixmap.c @@ -158,7 +158,7 @@ __glamor_compute_clipped_regions(int block_w, * compositing. */ -glamor_pixmap_clipped_regions * +glamor_pixmap_clipped_regions * GLAMOR_NONNULL_ARGS((1, 2, 3)) glamor_compute_clipped_regions_ext(PixmapPtr pixmap, RegionPtr region, int *n_region, diff --git a/glamor/glamor_lines.c b/glamor/glamor_lines.c index 8d6db3e4c..47d76c026 100644 --- a/glamor/glamor_lines.c +++ b/glamor/glamor_lines.c @@ -32,7 +32,7 @@ static const glamor_facet glamor_facet_poly_lines = { GLAMOR_POS(gl_Position, primitive.xy)), }; -static Bool +static Bool GLAMOR_NONNULL_ARGS((1, 2)) glamor_poly_lines_solid_gl(DrawablePtr drawable, GCPtr gc, int mode, int n, DDXPointPtr points) { @@ -128,7 +128,7 @@ bail: return ret; } -static Bool +static Bool GLAMOR_NONNULL_ARGS((1, 2)) glamor_poly_lines_gl(DrawablePtr drawable, GCPtr gc, 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, int mode, int n, DDXPointPtr points) { @@ -160,7 +160,7 @@ glamor_poly_lines_bail(DrawablePtr drawable, GCPtr gc, miPolylines(drawable, gc, mode, n, points); } -void +void GLAMOR_NONNULL_ARGS((1, 2)) glamor_poly_lines(DrawablePtr drawable, GCPtr gc, int mode, int n, DDXPointPtr points) { diff --git a/glamor/glamor_pixmap.c b/glamor/glamor_pixmap.c index c573e7982..47673dfff 100644 --- a/glamor/glamor_pixmap.c +++ b/glamor/glamor_pixmap.c @@ -35,7 +35,7 @@ * the backing drawable. These coordinates are nonzero only for redirected * windows. */ -void +void GLAMOR_NONNULL_ARGS((1, 2, 3, 4)) glamor_get_drawable_deltas(DrawablePtr drawable, PixmapPtr pixmap, 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_pixmap_fbo *fbo, int x0, int y0, int width, int height) @@ -73,7 +73,7 @@ glamor_set_destination_pixmap_fbo(glamor_screen_private *glamor_priv, glViewport(x0, y0, width, height); } -void +void GLAMOR_NONNULL_ARGS((1, 2, 3)) glamor_set_destination_pixmap_priv_nc(glamor_screen_private *glamor_priv, PixmapPtr pixmap, 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); } -int +int GLAMOR_NONNULL_ARGS((1, 2, 3)) glamor_set_destination_pixmap_priv(glamor_screen_private *glamor_priv, PixmapPtr pixmap, glamor_pixmap_private *pixmap_priv) @@ -96,7 +96,7 @@ glamor_set_destination_pixmap_priv(glamor_screen_private *glamor_priv, return 0; } -int +int GLAMOR_NONNULL_ARGS((1)) glamor_set_destination_pixmap(PixmapPtr pixmap) { int err; @@ -119,7 +119,7 @@ glamor_set_planemask(int depth, unsigned long planemask) return GL_FALSE; } -Bool +Bool GLAMOR_NONNULL_ARGS((1)) glamor_set_alu(DrawablePtr drawable, unsigned char alu) { ScreenPtr screen = drawable->pScreen; diff --git a/glamor/glamor_points.c b/glamor/glamor_points.c index 91b5e4789..3351e4af6 100644 --- a/glamor/glamor_points.c +++ b/glamor/glamor_points.c @@ -36,7 +36,7 @@ static const glamor_facet glamor_facet_point = { 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) { ScreenPtr screen = drawable->pScreen; @@ -115,7 +115,7 @@ bail: return ret; } -void +void GLAMOR_NONNULL_ARGS((1, 2)) glamor_poly_point(DrawablePtr drawable, GCPtr gc, int mode, int npt, DDXPointPtr ppt) { diff --git a/glamor/glamor_prepare.c b/glamor/glamor_prepare.c index fba875e28..59201f0b5 100644 --- a/glamor/glamor_prepare.c +++ b/glamor/glamor_prepare.c @@ -30,7 +30,7 @@ * 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) { 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 */ -void +void GLAMOR_NONNULL_ARGS((1)) glamor_finish_access(DrawablePtr drawable) { PixmapPtr pixmap = glamor_get_drawable_pixmap(drawable); @@ -194,7 +194,7 @@ glamor_finish_access(DrawablePtr drawable) priv->prepared = FALSE; } -Bool +Bool GLAMOR_NONNULL_ARGS((1)) glamor_prepare_access(DrawablePtr drawable, glamor_access_t access) { BoxRec box; @@ -206,7 +206,7 @@ glamor_prepare_access(DrawablePtr drawable, glamor_access_t access) return glamor_prep_drawable_box(drawable, access, &box); } -Bool +Bool GLAMOR_NONNULL_ARGS((1)) glamor_prepare_access_box(DrawablePtr drawable, glamor_access_t access, int x, int y, int w, int h) { @@ -271,7 +271,7 @@ glamor_finish_access_picture(PicturePtr picture) * in CPU memory again */ -Bool +Bool GLAMOR_NONNULL_ARGS((1)) glamor_prepare_access_gc(GCPtr gc) { switch (gc->fillStyle) { @@ -288,7 +288,7 @@ glamor_prepare_access_gc(GCPtr gc) /* * Free any temporary CPU pixmaps for the GC */ -void +void GLAMOR_NONNULL_ARGS((1)) glamor_finish_access_gc(GCPtr gc) { switch (gc->fillStyle) { diff --git a/glamor/glamor_prepare.h b/glamor/glamor_prepare.h index 85fa79574..2248d0d22 100644 --- a/glamor/glamor_prepare.h +++ b/glamor/glamor_prepare.h @@ -23,14 +23,14 @@ #ifndef _GLAMOR_PREPARE_H_ #define _GLAMOR_PREPARE_H_ -Bool +Bool GLAMOR_NONNULL_ARGS((1)) 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, int x, int y, int w, int h); -void +void GLAMOR_NONNULL_ARGS((1)) glamor_finish_access(DrawablePtr drawable); Bool @@ -43,10 +43,10 @@ glamor_prepare_access_picture_box(PicturePtr picture, glamor_access_t access, void glamor_finish_access_picture(PicturePtr picture); -Bool +Bool GLAMOR_NONNULL_ARGS((1)) glamor_prepare_access_gc(GCPtr gc); -void +void GLAMOR_NONNULL_ARGS((1)) glamor_finish_access_gc(GCPtr gc); #endif /* _GLAMOR_PREPARE_H_ */ diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h index f80aab74b..3910f7eb9 100644 --- a/glamor/glamor_priv.h +++ b/glamor/glamor_priv.h @@ -452,7 +452,7 @@ glamor_get_pixmap_private(PixmapPtr pixmap) /* * 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_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) */ -static inline Bool +static inline Bool GLAMOR_NONNULL_ARGS((1)) glamor_pixmap_is_memory(PixmapPtr 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 */ -static inline Bool +static inline Bool GLAMOR_NONNULL_ARGS((1)) glamor_pixmap_priv_is_large(glamor_pixmap_private *priv) { 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) { 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_private *priv = glamor_get_pixmap_private(pixmap); @@ -496,7 +496,7 @@ glamor_pixmap_is_large(PixmapPtr pixmap) /* * 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_private *priv = glamor_get_pixmap_private(pixmap); @@ -504,7 +504,7 @@ glamor_pixmap_has_fbo(PixmapPtr pixmap) 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) { 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) { assert(box < priv->block_wcnt * priv->block_hcnt); 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) { assert(box < priv->block_wcnt * priv->block_hcnt); return &priv->box_array[box]; } -static inline int +static inline int GLAMOR_NONNULL_ARGS((1)) glamor_pixmap_wcnt(glamor_pixmap_private *priv) { return priv->block_wcnt; } -static inline int +static inline int GLAMOR_NONNULL_ARGS((1)) glamor_pixmap_hcnt(glamor_pixmap_private *priv) { 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) * \ glamor_pixmap_wcnt(priv); box_index++) \ -static inline int +static inline int GLAMOR_NONNULL_ARGS((1)) glamor_drawable_effective_depth(DrawablePtr drawable) { WindowPtr window; @@ -579,10 +579,11 @@ extern DevPrivateKeyRec glamor_gc_private_key; extern DevPrivateKeyRec glamor_screen_private_key; extern glamor_screen_private * -glamor_get_screen_private(ScreenPtr screen); +glamor_get_screen_private(ScreenPtr screen) GLAMOR_NONNULL_ARGS((1)); 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 * glamor_get_gc_private(GCPtr gc) @@ -604,11 +605,13 @@ glamor_pm_is_solid(int depth, unsigned long planemask) extern int glamor_debug_level; /* 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 * 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_priv, PixmapPtr pixmap, 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, 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 */ 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); /* 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, - 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); Bool glamor_link_glsl_prog(ScreenPtr screen, GLint prog, const char *format, ...) _X_ATTRIBUTE_PRINTF(3,4); void glamor_get_color_4f_from_pixel(PixmapPtr pixmap, unsigned long fg_pixel, GLfloat *color); -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); -void glamor_set_destination_pixmap_fbo(glamor_screen_private *glamor_priv, glamor_pixmap_fbo *, int, int, int, int); +int glamor_set_destination_pixmap(PixmapPtr pixmap) + GLAMOR_NONNULL_ARGS((1)); +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. * 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); RegionPtr glamor_bitmap_to_region(PixmapPtr pixmap); @@ -690,7 +706,8 @@ Bool glamor_composite_clipped_region(CARD8 op, int x_source, int y_source, 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, PicturePtr pSrc, @@ -713,17 +730,20 @@ void glamor_trapezoids(CARD8 op, int ntrap, xTrapezoid *traps); /* 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 src_picture, int x_source, int y_source, int width, int height, - PictFormatShort format); + PictFormatShort format) + GLAMOR_NONNULL_ARGS((1, 2)); PicturePtr glamor_generate_radial_gradient_picture(ScreenPtr screen, PicturePtr src_picture, int x_source, int y_source, int width, int height, - PictFormatShort format); + PictFormatShort format) + GLAMOR_NONNULL_ARGS((1, 2)); /* glamor_triangles.c */ void glamor_triangles(CARD8 op, @@ -761,13 +781,15 @@ glamor_pixmap_clipped_regions * glamor_compute_clipped_regions(PixmapPtr pixmap, RegionPtr region, int *clipped_nbox, int repeat_type, int reverse, - int upsidedown); + int upsidedown) + GLAMOR_NONNULL_ARGS((1, 2, 3)); glamor_pixmap_clipped_regions * glamor_compute_clipped_regions_ext(PixmapPtr pixmap, RegionPtr region, int *n_region, 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, PicturePtr source, @@ -795,63 +817,77 @@ void glamor_add_traps(PicturePtr pPicture, /* glamor_text.c */ 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 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, - 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, - 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 */ void glamor_fill_spans(DrawablePtr drawable, GCPtr gc, - int n, DDXPointPtr points, int *widths, int sorted); + int n, DDXPointPtr points, int *widths, int sorted) + GLAMOR_NONNULL_ARGS((1, 2)); void 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 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 */ void 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 */ void 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 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 */ Bool 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 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 */ void 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 */ void glamor_poly_segment(DrawablePtr drawable, GCPtr gc, - int nseg, xSegment *segs); + int nseg, xSegment *segs) + GLAMOR_NONNULL_ARGS((1, 2)); /* glamor_copy.c */ void @@ -883,13 +919,16 @@ void glamor_image_glyph_blt(DrawablePtr pDrawable, GCPtr pGC, void glamor_poly_glyph_blt(DrawablePtr pDrawable, GCPtr pGC, 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, - 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, - DDXPointPtr ppt); + DDXPointPtr ppt) + GLAMOR_NONNULL_ARGS((1, 2)); void glamor_composite_rectangles(CARD8 op, PicturePtr dst, @@ -980,7 +1019,8 @@ int glamor_xv_put_image(glamor_port_private *port_priv, Bool sync, RegionPtr clipBoxes); 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" diff --git a/glamor/glamor_rects.c b/glamor/glamor_rects.c index aa05b8cef..b25cfd0e8 100644 --- a/glamor/glamor_rects.c +++ b/glamor/glamor_rects.c @@ -41,7 +41,7 @@ static const glamor_facet glamor_facet_polyfillrect_120 = { GLAMOR_POS(gl_Position, primitive.xy)), }; -static Bool +static Bool GLAMOR_NONNULL_ARGS((1, 2)) glamor_poly_fill_rect_gl(DrawablePtr drawable, GCPtr gc, int nrect, xRectangle *prect) { @@ -173,7 +173,7 @@ bail: return ret; } -static void +static void GLAMOR_NONNULL_ARGS((1, 2)) glamor_poly_fill_rect_bail(DrawablePtr drawable, GCPtr gc, int nrect, xRectangle *prect) { @@ -187,7 +187,7 @@ glamor_poly_fill_rect_bail(DrawablePtr drawable, glamor_finish_access(drawable); } -void +void GLAMOR_NONNULL_ARGS((1, 2)) glamor_poly_fill_rect(DrawablePtr drawable, GCPtr gc, int nrect, xRectangle *prect) { diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c index 1208b49a7..1355a2d4d 100644 --- a/glamor/glamor_render.c +++ b/glamor/glamor_render.c @@ -573,7 +573,7 @@ glamor_set_composite_op(ScreenPtr screen, return TRUE; } -static void +static void GLAMOR_NONNULL_ARGS((1, 3, 4, 7)) glamor_set_composite_texture(glamor_screen_private *glamor_priv, int unit, PicturePtr picture, PixmapPtr pixmap, @@ -1486,7 +1486,7 @@ glamor_convert_gradient_picture(ScreenPtr screen, return dst; } -Bool +Bool GLAMOR_NONNULL_ARGS((8)) glamor_composite_clipped_region(CARD8 op, PicturePtr source, PicturePtr mask, diff --git a/glamor/glamor_segs.c b/glamor/glamor_segs.c index 7b0108f83..74ff09cc3 100644 --- a/glamor/glamor_segs.c +++ b/glamor/glamor_segs.c @@ -32,7 +32,7 @@ static const glamor_facet glamor_facet_poly_segment = { GLAMOR_POS(gl_Position, primitive.xy)), }; -static Bool +static Bool GLAMOR_NONNULL_ARGS((1, 2)) glamor_poly_segment_solid_gl(DrawablePtr drawable, GCPtr gc, int nseg, xSegment *segs) { @@ -119,7 +119,7 @@ bail: return ret; } -static Bool +static Bool GLAMOR_NONNULL_ARGS((1, 2)) glamor_poly_segment_gl(DrawablePtr drawable, GCPtr gc, 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, int nseg, xSegment *segs) { @@ -159,7 +159,7 @@ glamor_poly_segment_bail(DrawablePtr drawable, GCPtr gc, miPolySegment(drawable, gc, nseg, segs); } -void +void GLAMOR_NONNULL_ARGS((1, 2)) glamor_poly_segment(DrawablePtr drawable, GCPtr gc, int nseg, xSegment *segs) { diff --git a/glamor/glamor_spans.c b/glamor/glamor_spans.c index 93beb61d5..8b2a78912 100644 --- a/glamor/glamor_spans.c +++ b/glamor/glamor_spans.c @@ -41,7 +41,7 @@ static const glamor_facet glamor_facet_fillspans_120 = { GLAMOR_POS(gl_Position, primitive.xy)), }; -static Bool +static Bool GLAMOR_NONNULL_ARGS((1, 2)) glamor_fill_spans_gl(DrawablePtr drawable, GCPtr gc, int n, DDXPointPtr points, int *widths, int sorted) @@ -153,7 +153,7 @@ bail: return ret; } -static void +static void GLAMOR_NONNULL_ARGS((1, 2)) glamor_fill_spans_bail(DrawablePtr drawable, GCPtr gc, int n, DDXPointPtr points, int *widths, int sorted) @@ -166,7 +166,7 @@ glamor_fill_spans_bail(DrawablePtr drawable, glamor_finish_access(drawable); } -void +void GLAMOR_NONNULL_ARGS((1, 2)) glamor_fill_spans(DrawablePtr drawable, GCPtr gc, 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); } -static Bool +static Bool GLAMOR_NONNULL_ARGS((1)) glamor_get_spans_gl(DrawablePtr drawable, int wmax, DDXPointPtr points, int *widths, int count, char *dst) { @@ -241,7 +241,7 @@ bail: return FALSE; } -static void +static void GLAMOR_NONNULL_ARGS((1)) glamor_get_spans_bail(DrawablePtr drawable, int wmax, DDXPointPtr points, int *widths, int count, char *dst) { @@ -250,7 +250,7 @@ glamor_get_spans_bail(DrawablePtr drawable, int wmax, glamor_finish_access(drawable); } -void +void GLAMOR_NONNULL_ARGS((1)) glamor_get_spans(DrawablePtr drawable, int wmax, 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); } -static Bool +static Bool GLAMOR_NONNULL_ARGS((1, 2)) glamor_set_spans_gl(DrawablePtr drawable, GCPtr gc, char *src, 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); } -void +void GLAMOR_NONNULL_ARGS((1, 2)) glamor_set_spans(DrawablePtr drawable, GCPtr gc, char *src, DDXPointPtr points, int *widths, int numPoints, int sorted) { diff --git a/glamor/glamor_text.c b/glamor/glamor_text.c index 0cabecbd5..f0e57eefb 100644 --- a/glamor/glamor_text.c +++ b/glamor/glamor_text.c @@ -30,7 +30,7 @@ * aligns exactly with chars */ -static void +static void GLAMOR_NONNULL_ARGS((1, 2)) glamor_get_glyphs(FontPtr font, glamor_font_t *glamor_font, 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 */ -static int +static int GLAMOR_NONNULL_ARGS((1, 2, 3, 4)) glamor_text(DrawablePtr drawable, GCPtr gc, glamor_font_t *glamor_font, glamor_program *prog, @@ -272,7 +272,7 @@ static const glamor_facet glamor_facet_poly_text = { .locations = glamor_program_location_font, }; -static Bool +static Bool GLAMOR_NONNULL_ARGS((1, 2)) glamor_poly_text(DrawablePtr drawable, GCPtr gc, int x, int y, int count, char *chars, Bool sixteen, int *final_pos) { @@ -311,7 +311,7 @@ bail: return FALSE; } -int +int GLAMOR_NONNULL_ARGS((1, 2)) glamor_poly_text8(DrawablePtr drawable, GCPtr gc, 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); } -int +int GLAMOR_NONNULL_ARGS((1, 2)) glamor_poly_text16(DrawablePtr drawable, GCPtr gc, 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, }; -static Bool +static Bool GLAMOR_NONNULL_ARGS((1, 2)) use_image_solid(DrawablePtr drawable, GCPtr gc, glamor_program *prog, void *arg) { 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, }; -static Bool +static Bool GLAMOR_NONNULL_ARGS((1, 2)) glamor_te_text_use(DrawablePtr drawable, GCPtr gc, glamor_program *prog, void *arg) { 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, }; -static Bool +static Bool GLAMOR_NONNULL_ARGS((1, 2)) glamor_image_text(DrawablePtr drawable, GCPtr gc, int x, int y, int count, char *chars, Bool sixteen) @@ -478,7 +478,7 @@ bail: return FALSE; } -void +void GLAMOR_NONNULL_ARGS((1, 2)) glamor_image_text8(DrawablePtr drawable, GCPtr gc, 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); } -void +void GLAMOR_NONNULL_ARGS((1, 2)) glamor_image_text16(DrawablePtr drawable, GCPtr gc, int x, int y, int count, unsigned short *chars) { diff --git a/glamor/glamor_transfer.c b/glamor/glamor_transfer.c index 9efb505f0..e012145ba 100644 --- a/glamor/glamor_transfer.c +++ b/glamor/glamor_transfer.c @@ -26,7 +26,7 @@ /* * 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, int dx_src, int dy_src, 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 */ -void +void GLAMOR_NONNULL_ARGS((1, 2, 5)) glamor_upload_region(DrawablePtr drawable, RegionPtr region, int region_x, int region_y, 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 */ -void +void GLAMOR_NONNULL_ARGS((1, 2, 8)) glamor_download_boxes(DrawablePtr drawable, BoxPtr in_boxes, int in_nbox, int dx_src, int dy_src, int dx_dst, int dy_dst, diff --git a/glamor/glamor_transfer.h b/glamor/glamor_transfer.h index 17d80a2e9..a4401f424 100644 --- a/glamor/glamor_transfer.h +++ b/glamor/glamor_transfer.h @@ -27,17 +27,20 @@ void glamor_upload_boxes(DrawablePtr drawable, BoxPtr in_boxes, int in_nbox, int dx_src, int dy_src, 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 glamor_upload_region(DrawablePtr drawable, RegionPtr region, 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 glamor_download_boxes(DrawablePtr drawable, BoxPtr in_boxes, int in_nbox, int dx_src, int dy_src, 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_ */ diff --git a/glamor/glamor_transform.c b/glamor/glamor_transform.c index 891f7ee51..fbda975a2 100644 --- a/glamor/glamor_transform.c +++ b/glamor/glamor_transform.c @@ -33,7 +33,7 @@ * clipping computations can be adjusted as appropriate */ -Bool +Bool GLAMOR_NONNULL_ARGS((1)) glamor_set_destination_drawable(DrawablePtr drawable, int box_index, 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 */ -void +void GLAMOR_NONNULL_ARGS((1)) glamor_set_color_depth(ScreenPtr pScreen, int depth, CARD32 pixel, @@ -129,7 +129,7 @@ glamor_set_color_depth(ScreenPtr pScreen, glUniform4fv(uniform, 1, color); } -Bool +Bool GLAMOR_NONNULL_ARGS((1, 2)) glamor_set_solid(DrawablePtr drawable, GCPtr gc, Bool use_alu, @@ -163,7 +163,7 @@ glamor_set_solid(DrawablePtr drawable, return TRUE; } -Bool +Bool GLAMOR_NONNULL_ARGS((1)) glamor_set_texture_pixmap(PixmapPtr texture, Bool destination_red) { glamor_pixmap_private *texture_priv; @@ -187,7 +187,7 @@ glamor_set_texture_pixmap(PixmapPtr texture, Bool destination_red) return TRUE; } -Bool +Bool GLAMOR_NONNULL_ARGS((1)) glamor_set_texture(PixmapPtr texture, Bool destination_red, int off_x, @@ -203,7 +203,7 @@ glamor_set_texture(PixmapPtr texture, return TRUE; } -Bool +Bool GLAMOR_NONNULL_ARGS((1, 2)) glamor_set_tiled(DrawablePtr drawable, GCPtr gc, GLint offset_uniform, @@ -223,7 +223,7 @@ glamor_set_tiled(DrawablePtr drawable, size_inv_uniform); } -static PixmapPtr +static PixmapPtr GLAMOR_NONNULL_ARGS((1)) glamor_get_stipple_pixmap(GCPtr gc) { glamor_gc_private *gc_priv = glamor_get_gc_private(gc); @@ -281,7 +281,7 @@ bail: return NULL; } -Bool +Bool GLAMOR_NONNULL_ARGS((1, 2)) glamor_set_stippled(DrawablePtr drawable, GCPtr gc, GLint fg_uniform, diff --git a/glamor/glamor_transform.h b/glamor/glamor_transform.h index 6eef2fc7a..6841bab7d 100644 --- a/glamor/glamor_transform.h +++ b/glamor/glamor_transform.h @@ -30,15 +30,17 @@ glamor_set_destination_drawable(DrawablePtr drawable, Bool center_offset, GLint matrix_uniform_location, int *p_off_x, - int *p_off_y); + int *p_off_y) + GLAMOR_NONNULL_ARGS((1)); void glamor_set_color_depth(ScreenPtr pScreen, int depth, 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, CARD32 pixel, GLint uniform) @@ -50,7 +52,8 @@ glamor_set_color(DrawablePtr drawable, Bool glamor_set_texture_pixmap(PixmapPtr texture, - Bool destination_red); + Bool destination_red) + GLAMOR_NONNULL_ARGS((1)); Bool glamor_set_texture(PixmapPtr texture, @@ -58,26 +61,30 @@ glamor_set_texture(PixmapPtr texture, int off_x, int off_y, GLint offset_uniform, - GLint size_uniform); + GLint size_uniform) + GLAMOR_NONNULL_ARGS((1)); Bool glamor_set_solid(DrawablePtr drawable, GCPtr gc, Bool use_alu, - GLint uniform); + GLint uniform) + GLAMOR_NONNULL_ARGS((1, 2)); Bool glamor_set_tiled(DrawablePtr drawable, GCPtr gc, GLint offset_uniform, - GLint size_uniform); + GLint size_uniform) + GLAMOR_NONNULL_ARGS((1, 2)); Bool glamor_set_stippled(DrawablePtr drawable, GCPtr gc, GLint fg_uniform, GLint offset_uniform, - GLint size_uniform); + GLint size_uniform) + GLAMOR_NONNULL_ARGS((1, 2)); /* * Vertex shader bits that transform X coordinates to pixmap diff --git a/glamor/glamor_xv.c b/glamor/glamor_xv.c index a5b4b6802..31e147c39 100644 --- a/glamor/glamor_xv.c +++ b/glamor/glamor_xv.c @@ -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 */ }; -void +void GLAMOR_NONNULL_ARGS((1)) glamor_xv_render(glamor_port_private *port_priv, int id) { ScreenPtr screen = port_priv->pPixmap->drawable.pScreen; glamor_screen_private *glamor_priv = glamor_get_screen_private(screen); PixmapPtr pixmap = port_priv->pPixmap; + assert(pixmap != NULL); glamor_pixmap_private *pixmap_priv = glamor_get_pixmap_private(pixmap); glamor_pixmap_private *src_pixmap_priv[3]; BoxPtr box = REGION_RECTS(&port_priv->clip);