omap: Use symbol visibility.

No changes to exported symbols.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
main
Maarten Lankhorst 2014-08-04 11:22:33 +02:00 committed by Maarten Lankhorst
parent edbb4e545f
commit 2d1044cc47
2 changed files with 27 additions and 20 deletions

View File

@ -1,5 +1,6 @@
AM_CFLAGS = \ AM_CFLAGS = \
$(WARN_CFLAGS) \ $(WARN_CFLAGS) \
$(VISIBILITY_CFLAGS) \
-I$(top_srcdir) \ -I$(top_srcdir) \
-I$(top_srcdir)/omap \ -I$(top_srcdir)/omap \
$(PTHREADSTUBS_CFLAGS) \ $(PTHREADSTUBS_CFLAGS) \

View File

@ -39,6 +39,7 @@
#include <unistd.h> #include <unistd.h>
#include <pthread.h> #include <pthread.h>
#include <libdrm.h>
#include <xf86drm.h> #include <xf86drm.h>
#include <xf86atomic.h> #include <xf86atomic.h>
@ -91,7 +92,7 @@ static struct omap_device * omap_device_new_impl(int fd)
return dev; return dev;
} }
struct omap_device * omap_device_new(int fd) drm_public struct omap_device * omap_device_new(int fd)
{ {
struct omap_device *dev = NULL; struct omap_device *dev = NULL;
@ -114,13 +115,13 @@ struct omap_device * omap_device_new(int fd)
return dev; return dev;
} }
struct omap_device * omap_device_ref(struct omap_device *dev) drm_public struct omap_device * omap_device_ref(struct omap_device *dev)
{ {
atomic_inc(&dev->refcnt); atomic_inc(&dev->refcnt);
return dev; return dev;
} }
void omap_device_del(struct omap_device *dev) drm_public void omap_device_del(struct omap_device *dev)
{ {
if (!atomic_dec_and_test(&dev->refcnt)) if (!atomic_dec_and_test(&dev->refcnt))
return; return;
@ -131,7 +132,8 @@ void omap_device_del(struct omap_device *dev)
free(dev); free(dev);
} }
int omap_get_param(struct omap_device *dev, uint64_t param, uint64_t *value) drm_public int
omap_get_param(struct omap_device *dev, uint64_t param, uint64_t *value)
{ {
struct drm_omap_param req = { struct drm_omap_param req = {
.param = param, .param = param,
@ -148,7 +150,8 @@ int omap_get_param(struct omap_device *dev, uint64_t param, uint64_t *value)
return 0; return 0;
} }
int omap_set_param(struct omap_device *dev, uint64_t param, uint64_t value) drm_public int
omap_set_param(struct omap_device *dev, uint64_t param, uint64_t value)
{ {
struct drm_omap_param req = { struct drm_omap_param req = {
.param = param, .param = param,
@ -226,8 +229,8 @@ fail:
/* allocate a new (un-tiled) buffer object */ /* allocate a new (un-tiled) buffer object */
struct omap_bo * omap_bo_new(struct omap_device *dev, drm_public struct omap_bo *
uint32_t size, uint32_t flags) omap_bo_new(struct omap_device *dev, uint32_t size, uint32_t flags)
{ {
union omap_gem_size gsize = { union omap_gem_size gsize = {
.bytes = size, .bytes = size,
@ -239,8 +242,9 @@ struct omap_bo * omap_bo_new(struct omap_device *dev,
} }
/* allocate a new buffer object */ /* allocate a new buffer object */
struct omap_bo * omap_bo_new_tiled(struct omap_device *dev, drm_public struct omap_bo *
uint32_t width, uint32_t height, uint32_t flags) omap_bo_new_tiled(struct omap_device *dev, uint32_t width,
uint32_t height, uint32_t flags)
{ {
union omap_gem_size gsize = { union omap_gem_size gsize = {
.tiled = { .tiled = {
@ -254,7 +258,7 @@ struct omap_bo * omap_bo_new_tiled(struct omap_device *dev,
return omap_bo_new_impl(dev, gsize, flags); return omap_bo_new_impl(dev, gsize, flags);
} }
struct omap_bo * omap_bo_ref(struct omap_bo *bo) drm_public struct omap_bo *omap_bo_ref(struct omap_bo *bo)
{ {
atomic_inc(&bo->refcnt); atomic_inc(&bo->refcnt);
return bo; return bo;
@ -280,7 +284,8 @@ static int get_buffer_info(struct omap_bo *bo)
} }
/* import a buffer object from DRI2 name */ /* import a buffer object from DRI2 name */
struct omap_bo * omap_bo_from_name(struct omap_device *dev, uint32_t name) drm_public struct omap_bo *
omap_bo_from_name(struct omap_device *dev, uint32_t name)
{ {
struct omap_bo *bo = NULL; struct omap_bo *bo = NULL;
struct drm_gem_open req = { struct drm_gem_open req = {
@ -313,7 +318,8 @@ fail:
* fd so caller should close() the fd when it is otherwise done * fd so caller should close() the fd when it is otherwise done
* with it (even if it is still using the 'struct omap_bo *') * with it (even if it is still using the 'struct omap_bo *')
*/ */
struct omap_bo * omap_bo_from_dmabuf(struct omap_device *dev, int fd) drm_public struct omap_bo *
omap_bo_from_dmabuf(struct omap_device *dev, int fd)
{ {
struct omap_bo *bo = NULL; struct omap_bo *bo = NULL;
struct drm_prime_handle req = { struct drm_prime_handle req = {
@ -344,7 +350,7 @@ fail:
} }
/* destroy a buffer object */ /* destroy a buffer object */
void omap_bo_del(struct omap_bo *bo) drm_public void omap_bo_del(struct omap_bo *bo)
{ {
if (!bo) { if (!bo) {
return; return;
@ -377,7 +383,7 @@ void omap_bo_del(struct omap_bo *bo)
} }
/* get the global flink/DRI2 buffer name */ /* get the global flink/DRI2 buffer name */
int omap_bo_get_name(struct omap_bo *bo, uint32_t *name) drm_public int omap_bo_get_name(struct omap_bo *bo, uint32_t *name)
{ {
if (!bo->name) { if (!bo->name) {
struct drm_gem_flink req = { struct drm_gem_flink req = {
@ -398,7 +404,7 @@ int omap_bo_get_name(struct omap_bo *bo, uint32_t *name)
return 0; return 0;
} }
uint32_t omap_bo_handle(struct omap_bo *bo) drm_public uint32_t omap_bo_handle(struct omap_bo *bo)
{ {
return bo->handle; return bo->handle;
} }
@ -406,7 +412,7 @@ uint32_t omap_bo_handle(struct omap_bo *bo)
/* caller owns the dmabuf fd that is returned and is responsible /* caller owns the dmabuf fd that is returned and is responsible
* to close() it when done * to close() it when done
*/ */
int omap_bo_dmabuf(struct omap_bo *bo) drm_public int omap_bo_dmabuf(struct omap_bo *bo)
{ {
if (!bo->fd) { if (!bo->fd) {
struct drm_prime_handle req = { struct drm_prime_handle req = {
@ -425,7 +431,7 @@ int omap_bo_dmabuf(struct omap_bo *bo)
return dup(bo->fd); return dup(bo->fd);
} }
uint32_t omap_bo_size(struct omap_bo *bo) drm_public uint32_t omap_bo_size(struct omap_bo *bo)
{ {
if (!bo->size) { if (!bo->size) {
get_buffer_info(bo); get_buffer_info(bo);
@ -433,7 +439,7 @@ uint32_t omap_bo_size(struct omap_bo *bo)
return bo->size; return bo->size;
} }
void * omap_bo_map(struct omap_bo *bo) drm_public void *omap_bo_map(struct omap_bo *bo)
{ {
if (!bo->map) { if (!bo->map) {
if (!bo->offset) { if (!bo->offset) {
@ -449,7 +455,7 @@ void * omap_bo_map(struct omap_bo *bo)
return bo->map; return bo->map;
} }
int omap_bo_cpu_prep(struct omap_bo *bo, enum omap_gem_op op) drm_public int omap_bo_cpu_prep(struct omap_bo *bo, enum omap_gem_op op)
{ {
struct drm_omap_gem_cpu_prep req = { struct drm_omap_gem_cpu_prep req = {
.handle = bo->handle, .handle = bo->handle,
@ -459,7 +465,7 @@ int omap_bo_cpu_prep(struct omap_bo *bo, enum omap_gem_op op)
DRM_OMAP_GEM_CPU_PREP, &req, sizeof(req)); DRM_OMAP_GEM_CPU_PREP, &req, sizeof(req));
} }
int omap_bo_cpu_fini(struct omap_bo *bo, enum omap_gem_op op) drm_public int omap_bo_cpu_fini(struct omap_bo *bo, enum omap_gem_op op)
{ {
struct drm_omap_gem_cpu_fini req = { struct drm_omap_gem_cpu_fini req = {
.handle = bo->handle, .handle = bo->handle,