st/xa, xa/vmwgfx: Use XA_EXPORT attribute to indicate global visibility
authorThomas Hellstrom <thellstrom@vmware.com>
Thu, 24 Nov 2011 20:59:06 +0000 (21:59 +0100)
committerThomas Hellstrom <thellstrom@vmware.com>
Fri, 25 Nov 2011 15:38:16 +0000 (16:38 +0100)
Also fix up Makefiles to use the default mesa compilation flags.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrants <jakob@vmware.com>
src/gallium/state_trackers/xa/Makefile
src/gallium/state_trackers/xa/xa_composite.c
src/gallium/state_trackers/xa/xa_context.c
src/gallium/state_trackers/xa/xa_priv.h
src/gallium/state_trackers/xa/xa_tracker.c
src/gallium/state_trackers/xa/xa_yuv.c
src/gallium/targets/xa-vmwgfx/Makefile

index 9ac6351..b42e619 100644 (file)
@@ -3,7 +3,7 @@ include $(TOP)/configs/current
 
 ##### MACROS #####
 
-XA_CFLAGS = -g -fPIC -Wall
+XA_CFLAGS = -Wall -pedantic
 
 XA_INCLUDES= -I$(TOP)/src/gallium/ \
        -I$(TOP)/src/gallium/auxiliary \
@@ -29,7 +29,7 @@ OBJECTS = $(SOURCES:.c=.o)
 ##### RULES #####
 
 .c.o:
-       $(CC) -c $(XA_CFLAGS) $(XA_INCLUDES) $<
+       $(CC) -c $(XA_CFLAGS) $(CFLAGS) $(XA_INCLUDES) $<
 
 
 ##### TARGETS #####
index 1a35d09..f66eebd 100644 (file)
@@ -213,7 +213,7 @@ xa_is_filter_accelerated(struct xa_picture *pic)
     return 1;
 }
 
-int
+XA_EXPORT int
 xa_composite_check_accelerated(const struct xa_composite *comp)
 {
     struct xa_composite_blend blend;
@@ -448,7 +448,7 @@ bind_samplers(struct xa_context *ctx,
                                   ctx->bound_sampler_views);
 }
 
-int
+XA_EXPORT int
 xa_composite_prepare(struct xa_context *ctx,
                     const struct xa_composite *comp)
 {
@@ -482,9 +482,10 @@ xa_composite_prepare(struct xa_context *ctx,
     return XA_ERR_NONE;
 }
 
-void xa_composite_rect(struct xa_context *ctx,
-                      int srcX, int srcY, int maskX, int maskY,
-                      int dstX, int dstY, int width, int height)
+XA_EXPORT void
+xa_composite_rect(struct xa_context *ctx,
+                 int srcX, int srcY, int maskX, int maskY,
+                 int dstX, int dstY, int width, int height)
 {
     if (ctx->num_bound_samplers == 0 ) { /* solid fill */
        renderer_solid(ctx, dstX, dstY, dstX + width, dstY + height,
@@ -505,7 +506,7 @@ void xa_composite_rect(struct xa_context *ctx,
     }
 }
 
-void
+XA_EXPORT void
 xa_composite_done(struct xa_context *ctx)
 {
     renderer_draw_flush(ctx);
@@ -522,7 +523,7 @@ static const struct xa_composite_allocation a = {
     .xa_source_pict_size = sizeof(union xa_source_pict),
 };
 
-const struct xa_composite_allocation *
+XA_EXPORT const struct xa_composite_allocation *
 xa_composite_allocation(void)
 {
     return &a;
index b52ee27..8290e0f 100644 (file)
 #include "pipe/p_context.h"
 
 
-struct xa_context *
+XA_EXPORT struct xa_context *
 xa_context_default(struct xa_tracker *xa)
 {
     return xa->default_ctx;
 }
 
-struct xa_context *
+XA_EXPORT struct xa_context *
 xa_context_create(struct xa_tracker *xa)
 {
     struct xa_context *ctx = calloc(1, sizeof(*ctx));
@@ -55,7 +55,7 @@ xa_context_create(struct xa_tracker *xa)
     return ctx;
 }
 
-void
+XA_EXPORT void
 xa_context_destroy(struct xa_context *r)
 {
     struct pipe_resource **vsbuf = &r->vs_const_buffer;
@@ -83,7 +83,7 @@ xa_context_destroy(struct xa_context *r)
     r->pipe->destroy(r->pipe);
 }
 
-int
+XA_EXPORT int
 xa_surface_dma(struct xa_context *ctx,
               struct xa_surface *srf,
               void *data,
@@ -132,7 +132,7 @@ xa_surface_dma(struct xa_context *ctx,
     return -XA_ERR_NORES;
 }
 
-void *
+XA_EXPORT void *
 xa_surface_map(struct xa_context *ctx,
               struct xa_surface *srf, unsigned int usage)
 {
@@ -168,7 +168,7 @@ xa_surface_map(struct xa_context *ctx,
     return map;
 }
 
-void
+XA_EXPORT void
 xa_surface_unmap(struct xa_surface *srf)
 {
     if (srf->transfer) {
@@ -209,7 +209,7 @@ xa_ctx_srf_destroy(struct xa_context *ctx)
     pipe_surface_reference(&ctx->srf, NULL);
 }
 
-int
+XA_EXPORT int
 xa_copy_prepare(struct xa_context *ctx,
                struct xa_surface *dst, struct xa_surface *src)
 {
@@ -232,7 +232,7 @@ xa_copy_prepare(struct xa_context *ctx,
     return 0;
 }
 
-void
+XA_EXPORT void
 xa_copy(struct xa_context *ctx,
        int dx, int dy, int sx, int sy, int width, int height)
 {
@@ -250,7 +250,7 @@ xa_copy(struct xa_context *ctx,
                      (float) ctx->src->tex->height0);
 }
 
-void
+XA_EXPORT void
 xa_copy_done(struct xa_context *ctx)
 {
     if (!ctx->simple_copy) {
@@ -277,7 +277,7 @@ bind_solid_blend_state(struct xa_context *ctx)
     cso_set_blend(ctx->cso, &blend);
 }
 
-int
+XA_EXPORT int
 xa_solid_prepare(struct xa_context *ctx, struct xa_surface *dst,
                 uint32_t fg)
 {
@@ -326,13 +326,13 @@ xa_solid_prepare(struct xa_context *ctx, struct xa_surface *dst,
     return XA_ERR_NONE;
 }
 
-void
+XA_EXPORT void
 xa_solid(struct xa_context *ctx, int x, int y, int width, int height)
 {
     renderer_solid(ctx, x, y, x + width, y + height, ctx->solid_color);
 }
 
-void
+XA_EXPORT void
 xa_solid_done(struct xa_context *ctx)
 {
     renderer_draw_flush(ctx);
@@ -343,7 +343,7 @@ xa_solid_done(struct xa_context *ctx)
     ctx->num_bound_samplers = 0;
 }
 
-struct xa_fence *
+XA_EXPORT struct xa_fence *
 xa_fence_get(struct xa_context *ctx)
 {
     struct xa_fence *fence = calloc(1, sizeof(*fence));
@@ -362,7 +362,7 @@ xa_fence_get(struct xa_context *ctx)
     return fence;
 }
 
-int
+XA_EXPORT int
 xa_fence_wait(struct xa_fence *fence, uint64_t timeout)
 {
     if (!fence)
@@ -381,7 +381,7 @@ xa_fence_wait(struct xa_fence *fence, uint64_t timeout)
     return XA_ERR_NONE;
 }
 
-void
+XA_EXPORT void
 xa_fence_destroy(struct xa_fence *fence)
 {
     if (!fence)
index a281c90..d00114f 100644 (file)
 #include "pipe/p_context.h"
 #include "pipe/p_state.h"
 
+#if defined(__GNUC__) && __GNUC__ >= 4
+#define XA_EXPORT __attribute__ ((visibility("default")))
+#else
+#define XA_EXPORT
+#endif
+
 #define XA_VB_SIZE (100 * 4 * 3 * 4)
 #define XA_LAST_SURFACE_TYPE (xa_type_yuv_component + 1)
 #define XA_MAX_SAMPLERS 3
index 529279a..8bd40dd 100644 (file)
@@ -133,7 +133,7 @@ xa_get_pipe_format(enum xa_formats xa_format)
     return fdesc;
 }
 
-struct xa_tracker *
+XA_EXPORT struct xa_tracker *
 xa_tracker_create(int drm_fd)
 {
     struct xa_tracker *xa = calloc(1, sizeof(struct xa_tracker));
@@ -194,7 +194,7 @@ xa_tracker_create(int drm_fd)
     return NULL;
 }
 
-void
+XA_EXPORT void
 xa_tracker_destroy(struct xa_tracker *xa)
 {
     free(xa->supported_formats);
@@ -254,7 +254,7 @@ xa_get_format_stype_depth(struct xa_tracker *xa,
     return fdesc;
 }
 
-int
+XA_EXPORT int
 xa_format_check_supported(struct xa_tracker *xa,
                          enum xa_formats xa_format, unsigned int flags)
 {
@@ -279,7 +279,7 @@ xa_format_check_supported(struct xa_tracker *xa,
     return XA_ERR_NONE;
 }
 
-struct xa_surface *
+XA_EXPORT struct xa_surface *
 xa_surface_create(struct xa_tracker *xa,
                  int width,
                  int height,
@@ -334,7 +334,7 @@ xa_surface_create(struct xa_tracker *xa,
     return NULL;
 }
 
-int
+XA_EXPORT int
 xa_surface_redefine(struct xa_surface *srf,
                    int width,
                    int height,
@@ -418,14 +418,14 @@ xa_surface_redefine(struct xa_surface *srf,
     return XA_ERR_NONE;
 }
 
-void
+XA_EXPORT void
 xa_surface_destroy(struct xa_surface *srf)
 {
     pipe_resource_reference(&srf->tex, NULL);
     free(srf);
 }
 
-extern void
+XA_EXPORT void
 xa_tracker_version(int *major, int *minor, int *patch)
 {
     *major = XA_TRACKER_VERSION_MAJOR;
@@ -433,7 +433,7 @@ xa_tracker_version(int *major, int *minor, int *patch)
     *patch = XA_TRACKER_VERSION_PATCH;
 }
 
-extern int
+XA_EXPORT int
 xa_surface_handle(struct xa_surface *srf,
                  uint32_t * handle, unsigned int *stride)
 {
@@ -454,7 +454,7 @@ xa_surface_handle(struct xa_surface *srf,
     return XA_ERR_NONE;
 }
 
-enum xa_formats
+XA_EXPORT enum xa_formats
 xa_surface_format(const struct xa_surface *srf)
 {
     return srf->fdesc.xa_format;
index a5a4010..da00b11 100644 (file)
@@ -105,7 +105,7 @@ xa_yuv_fs_constants(struct xa_context *r, const float conversion_matrix[])
                           conversion_matrix, param_bytes);
 }
 
-extern int
+XA_EXPORT int
 xa_yuv_planar_blit(struct xa_context *r,
                   int src_x,
                   int src_y,
index 1f839d2..a4c02d1 100644 (file)
@@ -6,7 +6,7 @@ include $(TOP)/configs/current
 XA_MAJOR = 0
 XA_MINOR = 5
 XA_TINY = 0
-XA_CFLAGS = -g -fPIC
+XA_CFLAGS = -Wall -pedantic
 
 XA_INCLUDES= -I$(TOP)/src/gallium/ \
        -I$(TOP)/src/gallium/auxiliary \
@@ -45,7 +45,7 @@ endif
 ##### RULES #####
 
 .c.o:
-       $(CC) -c $(XA_CFLAGS) $(XA_INCLUDES) $<
+       $(CC) -c $(XA_CFLAGS) $(CFLAGS) $(XA_INCLUDES) $<
 
 
 ##### TARGETS #####