freedreno: annotate public functions

while read sym; do
	read f func line _ <<<$(cscope -d -L -1 $sym)
	if [ ! -z "$f" ]; then
		sed -i "${line}s/^/drm_public /" $f
	fi
done < /tmp/a.txt

In which /tmp/a.txt contains the public symbols from
freedreno-symbol-check. The idea here will be to switch the default
visibility to hidden so we don't export symbols we shouldn't.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
main
Lucas De Marchi 2018-09-13 15:49:18 -07:00
parent 3441a18c3a
commit 9a1470fb41
4 changed files with 49 additions and 49 deletions

View File

@ -103,7 +103,7 @@ bo_new(struct fd_device *dev, uint32_t size, uint32_t flags,
return bo; return bo;
} }
struct fd_bo * drm_public struct fd_bo *
fd_bo_new(struct fd_device *dev, uint32_t size, uint32_t flags) fd_bo_new(struct fd_device *dev, uint32_t size, uint32_t flags)
{ {
struct fd_bo *bo = bo_new(dev, size, flags, &dev->bo_cache); struct fd_bo *bo = bo_new(dev, size, flags, &dev->bo_cache);
@ -126,7 +126,7 @@ fd_bo_new_ring(struct fd_device *dev, uint32_t size, uint32_t flags)
return bo; return bo;
} }
struct fd_bo * drm_public struct fd_bo *
fd_bo_from_handle(struct fd_device *dev, uint32_t handle, uint32_t size) fd_bo_from_handle(struct fd_device *dev, uint32_t handle, uint32_t size)
{ {
struct fd_bo *bo = NULL; struct fd_bo *bo = NULL;
@ -147,7 +147,7 @@ out_unlock:
return bo; return bo;
} }
struct fd_bo * drm_public struct fd_bo *
fd_bo_from_dmabuf(struct fd_device *dev, int fd) fd_bo_from_dmabuf(struct fd_device *dev, int fd)
{ {
int ret, size; int ret, size;
@ -179,7 +179,7 @@ out_unlock:
return bo; return bo;
} }
struct fd_bo * fd_bo_from_name(struct fd_device *dev, uint32_t name) drm_public struct fd_bo * fd_bo_from_name(struct fd_device *dev, uint32_t name)
{ {
struct drm_gem_open req = { struct drm_gem_open req = {
.name = name, .name = name,
@ -214,23 +214,23 @@ out_unlock:
return bo; return bo;
} }
uint64_t fd_bo_get_iova(struct fd_bo *bo) drm_public uint64_t fd_bo_get_iova(struct fd_bo *bo)
{ {
return bo->funcs->iova(bo); return bo->funcs->iova(bo);
} }
void fd_bo_put_iova(struct fd_bo *bo) drm_public void fd_bo_put_iova(struct fd_bo *bo)
{ {
/* currently a no-op */ /* currently a no-op */
} }
struct fd_bo * fd_bo_ref(struct fd_bo *bo) drm_public struct fd_bo * fd_bo_ref(struct fd_bo *bo)
{ {
atomic_inc(&bo->refcnt); atomic_inc(&bo->refcnt);
return bo; return bo;
} }
void fd_bo_del(struct fd_bo *bo) drm_public void fd_bo_del(struct fd_bo *bo)
{ {
struct fd_device *dev = bo->dev; struct fd_device *dev = bo->dev;
@ -275,7 +275,7 @@ drm_private void bo_del(struct fd_bo *bo)
bo->funcs->destroy(bo); bo->funcs->destroy(bo);
} }
int fd_bo_get_name(struct fd_bo *bo, uint32_t *name) drm_public int fd_bo_get_name(struct fd_bo *bo, uint32_t *name)
{ {
if (!bo->name) { if (!bo->name) {
struct drm_gem_flink req = { struct drm_gem_flink req = {
@ -299,12 +299,12 @@ int fd_bo_get_name(struct fd_bo *bo, uint32_t *name)
return 0; return 0;
} }
uint32_t fd_bo_handle(struct fd_bo *bo) drm_public uint32_t fd_bo_handle(struct fd_bo *bo)
{ {
return bo->handle; return bo->handle;
} }
int fd_bo_dmabuf(struct fd_bo *bo) drm_public int fd_bo_dmabuf(struct fd_bo *bo)
{ {
int ret, prime_fd; int ret, prime_fd;
@ -320,12 +320,12 @@ int fd_bo_dmabuf(struct fd_bo *bo)
return prime_fd; return prime_fd;
} }
uint32_t fd_bo_size(struct fd_bo *bo) drm_public uint32_t fd_bo_size(struct fd_bo *bo)
{ {
return bo->size; return bo->size;
} }
void * fd_bo_map(struct fd_bo *bo) drm_public void * fd_bo_map(struct fd_bo *bo)
{ {
if (!bo->map) { if (!bo->map) {
uint64_t offset; uint64_t offset;
@ -347,18 +347,18 @@ void * fd_bo_map(struct fd_bo *bo)
} }
/* a bit odd to take the pipe as an arg, but it's a, umm, quirk of kgsl.. */ /* a bit odd to take the pipe as an arg, but it's a, umm, quirk of kgsl.. */
int fd_bo_cpu_prep(struct fd_bo *bo, struct fd_pipe *pipe, uint32_t op) drm_public int fd_bo_cpu_prep(struct fd_bo *bo, struct fd_pipe *pipe, uint32_t op)
{ {
return bo->funcs->cpu_prep(bo, pipe, op); return bo->funcs->cpu_prep(bo, pipe, op);
} }
void fd_bo_cpu_fini(struct fd_bo *bo) drm_public void fd_bo_cpu_fini(struct fd_bo *bo)
{ {
bo->funcs->cpu_fini(bo); bo->funcs->cpu_fini(bo);
} }
#if !HAVE_FREEDRENO_KGSL #if !HAVE_FREEDRENO_KGSL
struct fd_bo * fd_bo_from_fbdev(struct fd_pipe *pipe, int fbfd, uint32_t size) drm_public struct fd_bo * fd_bo_from_fbdev(struct fd_pipe *pipe, int fbfd, uint32_t size)
{ {
return NULL; return NULL;
} }

View File

@ -38,7 +38,7 @@ static pthread_mutex_t table_lock = PTHREAD_MUTEX_INITIALIZER;
struct fd_device * kgsl_device_new(int fd); struct fd_device * kgsl_device_new(int fd);
struct fd_device * msm_device_new(int fd); struct fd_device * msm_device_new(int fd);
struct fd_device * fd_device_new(int fd) drm_public struct fd_device * fd_device_new(int fd)
{ {
struct fd_device *dev; struct fd_device *dev;
drmVersionPtr version; drmVersionPtr version;
@ -90,7 +90,7 @@ out:
/* like fd_device_new() but creates it's own private dup() of the fd /* like fd_device_new() but creates it's own private dup() of the fd
* which is close()d when the device is finalized. * which is close()d when the device is finalized.
*/ */
struct fd_device * fd_device_new_dup(int fd) drm_public struct fd_device * fd_device_new_dup(int fd)
{ {
int dup_fd = dup(fd); int dup_fd = dup(fd);
struct fd_device *dev = fd_device_new(dup_fd); struct fd_device *dev = fd_device_new(dup_fd);
@ -101,7 +101,7 @@ struct fd_device * fd_device_new_dup(int fd)
return dev; return dev;
} }
struct fd_device * fd_device_ref(struct fd_device *dev) drm_public struct fd_device * fd_device_ref(struct fd_device *dev)
{ {
atomic_inc(&dev->refcnt); atomic_inc(&dev->refcnt);
return dev; return dev;
@ -125,7 +125,7 @@ drm_private void fd_device_del_locked(struct fd_device *dev)
fd_device_del_impl(dev); fd_device_del_impl(dev);
} }
void fd_device_del(struct fd_device *dev) drm_public void fd_device_del(struct fd_device *dev)
{ {
if (!atomic_dec_and_test(&dev->refcnt)) if (!atomic_dec_and_test(&dev->refcnt))
return; return;
@ -134,12 +134,12 @@ void fd_device_del(struct fd_device *dev)
pthread_mutex_unlock(&table_lock); pthread_mutex_unlock(&table_lock);
} }
int fd_device_fd(struct fd_device *dev) drm_public int fd_device_fd(struct fd_device *dev)
{ {
return dev->fd; return dev->fd;
} }
enum fd_version fd_device_version(struct fd_device *dev) drm_public enum fd_version fd_device_version(struct fd_device *dev)
{ {
return dev->version; return dev->version;
} }

View File

@ -33,7 +33,7 @@
* priority of zero is highest priority, and higher numeric values are * priority of zero is highest priority, and higher numeric values are
* lower priorities * lower priorities
*/ */
struct fd_pipe * drm_public struct fd_pipe *
fd_pipe_new2(struct fd_device *dev, enum fd_pipe_id id, uint32_t prio) fd_pipe_new2(struct fd_device *dev, enum fd_pipe_id id, uint32_t prio)
{ {
struct fd_pipe *pipe; struct fd_pipe *pipe;
@ -65,37 +65,37 @@ fd_pipe_new2(struct fd_device *dev, enum fd_pipe_id id, uint32_t prio)
return pipe; return pipe;
} }
struct fd_pipe * drm_public struct fd_pipe *
fd_pipe_new(struct fd_device *dev, enum fd_pipe_id id) fd_pipe_new(struct fd_device *dev, enum fd_pipe_id id)
{ {
return fd_pipe_new2(dev, id, 1); return fd_pipe_new2(dev, id, 1);
} }
struct fd_pipe * fd_pipe_ref(struct fd_pipe *pipe) drm_public struct fd_pipe * fd_pipe_ref(struct fd_pipe *pipe)
{ {
atomic_inc(&pipe->refcnt); atomic_inc(&pipe->refcnt);
return pipe; return pipe;
} }
void fd_pipe_del(struct fd_pipe *pipe) drm_public void fd_pipe_del(struct fd_pipe *pipe)
{ {
if (!atomic_dec_and_test(&pipe->refcnt)) if (!atomic_dec_and_test(&pipe->refcnt))
return; return;
pipe->funcs->destroy(pipe); pipe->funcs->destroy(pipe);
} }
int fd_pipe_get_param(struct fd_pipe *pipe, drm_public int fd_pipe_get_param(struct fd_pipe *pipe,
enum fd_param_id param, uint64_t *value) enum fd_param_id param, uint64_t *value)
{ {
return pipe->funcs->get_param(pipe, param, value); return pipe->funcs->get_param(pipe, param, value);
} }
int fd_pipe_wait(struct fd_pipe *pipe, uint32_t timestamp) drm_public int fd_pipe_wait(struct fd_pipe *pipe, uint32_t timestamp)
{ {
return fd_pipe_wait_timeout(pipe, timestamp, ~0); return fd_pipe_wait_timeout(pipe, timestamp, ~0);
} }
int fd_pipe_wait_timeout(struct fd_pipe *pipe, uint32_t timestamp, drm_public int fd_pipe_wait_timeout(struct fd_pipe *pipe, uint32_t timestamp,
uint64_t timeout) uint64_t timeout)
{ {
return pipe->funcs->wait(pipe, timestamp, timeout); return pipe->funcs->wait(pipe, timestamp, timeout);

View File

@ -52,13 +52,13 @@ ringbuffer_new(struct fd_pipe *pipe, uint32_t size,
return ring; return ring;
} }
struct fd_ringbuffer * drm_public struct fd_ringbuffer *
fd_ringbuffer_new(struct fd_pipe *pipe, uint32_t size) fd_ringbuffer_new(struct fd_pipe *pipe, uint32_t size)
{ {
return ringbuffer_new(pipe, size, 0); return ringbuffer_new(pipe, size, 0);
} }
struct fd_ringbuffer * drm_public struct fd_ringbuffer *
fd_ringbuffer_new_object(struct fd_pipe *pipe, uint32_t size) fd_ringbuffer_new_object(struct fd_pipe *pipe, uint32_t size)
{ {
/* we can't really support "growable" rb's in general for /* we can't really support "growable" rb's in general for
@ -69,7 +69,7 @@ fd_ringbuffer_new_object(struct fd_pipe *pipe, uint32_t size)
return ringbuffer_new(pipe, size, FD_RINGBUFFER_OBJECT); return ringbuffer_new(pipe, size, FD_RINGBUFFER_OBJECT);
} }
void fd_ringbuffer_del(struct fd_ringbuffer *ring) drm_public void fd_ringbuffer_del(struct fd_ringbuffer *ring)
{ {
if (!(ring->flags & FD_RINGBUFFER_OBJECT)) if (!(ring->flags & FD_RINGBUFFER_OBJECT))
fd_ringbuffer_reset(ring); fd_ringbuffer_reset(ring);
@ -80,7 +80,7 @@ void fd_ringbuffer_del(struct fd_ringbuffer *ring)
* the IB source) as it's parent before emitting reloc's, to ensure * the IB source) as it's parent before emitting reloc's, to ensure
* the bookkeeping works out properly. * the bookkeeping works out properly.
*/ */
void fd_ringbuffer_set_parent(struct fd_ringbuffer *ring, drm_public void fd_ringbuffer_set_parent(struct fd_ringbuffer *ring,
struct fd_ringbuffer *parent) struct fd_ringbuffer *parent)
{ {
/* state objects should not be parented! */ /* state objects should not be parented! */
@ -88,7 +88,7 @@ void fd_ringbuffer_set_parent(struct fd_ringbuffer *ring,
ring->parent = parent; ring->parent = parent;
} }
void fd_ringbuffer_reset(struct fd_ringbuffer *ring) drm_public void fd_ringbuffer_reset(struct fd_ringbuffer *ring)
{ {
uint32_t *start = ring->start; uint32_t *start = ring->start;
if (ring->pipe->id == FD_PIPE_2D) if (ring->pipe->id == FD_PIPE_2D)
@ -98,18 +98,18 @@ void fd_ringbuffer_reset(struct fd_ringbuffer *ring)
ring->funcs->reset(ring); ring->funcs->reset(ring);
} }
int fd_ringbuffer_flush(struct fd_ringbuffer *ring) drm_public int fd_ringbuffer_flush(struct fd_ringbuffer *ring)
{ {
return ring->funcs->flush(ring, ring->last_start, -1, NULL); return ring->funcs->flush(ring, ring->last_start, -1, NULL);
} }
int fd_ringbuffer_flush2(struct fd_ringbuffer *ring, int in_fence_fd, drm_public int fd_ringbuffer_flush2(struct fd_ringbuffer *ring, int in_fence_fd,
int *out_fence_fd) int *out_fence_fd)
{ {
return ring->funcs->flush(ring, ring->last_start, in_fence_fd, out_fence_fd); return ring->funcs->flush(ring, ring->last_start, in_fence_fd, out_fence_fd);
} }
void fd_ringbuffer_grow(struct fd_ringbuffer *ring, uint32_t ndwords) drm_public void fd_ringbuffer_grow(struct fd_ringbuffer *ring, uint32_t ndwords)
{ {
assert(ring->funcs->grow); /* unsupported on kgsl */ assert(ring->funcs->grow); /* unsupported on kgsl */
@ -125,25 +125,25 @@ void fd_ringbuffer_grow(struct fd_ringbuffer *ring, uint32_t ndwords)
ring->cur = ring->last_start = ring->start; ring->cur = ring->last_start = ring->start;
} }
uint32_t fd_ringbuffer_timestamp(struct fd_ringbuffer *ring) drm_public uint32_t fd_ringbuffer_timestamp(struct fd_ringbuffer *ring)
{ {
return ring->last_timestamp; return ring->last_timestamp;
} }
void fd_ringbuffer_reloc(struct fd_ringbuffer *ring, drm_public void fd_ringbuffer_reloc(struct fd_ringbuffer *ring,
const struct fd_reloc *reloc) const struct fd_reloc *reloc)
{ {
assert(ring->pipe->gpu_id < 500); assert(ring->pipe->gpu_id < 500);
ring->funcs->emit_reloc(ring, reloc); ring->funcs->emit_reloc(ring, reloc);
} }
void fd_ringbuffer_reloc2(struct fd_ringbuffer *ring, drm_public void fd_ringbuffer_reloc2(struct fd_ringbuffer *ring,
const struct fd_reloc *reloc) const struct fd_reloc *reloc)
{ {
ring->funcs->emit_reloc(ring, reloc); ring->funcs->emit_reloc(ring, reloc);
} }
void fd_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring, drm_public void fd_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring,
struct fd_ringmarker *target, struct fd_ringmarker *end) struct fd_ringmarker *target, struct fd_ringmarker *end)
{ {
uint32_t submit_offset, size; uint32_t submit_offset, size;
@ -158,14 +158,14 @@ void fd_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring,
ring->funcs->emit_reloc_ring(ring, target->ring, 0, submit_offset, size); ring->funcs->emit_reloc_ring(ring, target->ring, 0, submit_offset, size);
} }
uint32_t fd_ringbuffer_cmd_count(struct fd_ringbuffer *ring) drm_public uint32_t fd_ringbuffer_cmd_count(struct fd_ringbuffer *ring)
{ {
if (!ring->funcs->cmd_count) if (!ring->funcs->cmd_count)
return 1; return 1;
return ring->funcs->cmd_count(ring); return ring->funcs->cmd_count(ring);
} }
uint32_t drm_public uint32_t
fd_ringbuffer_emit_reloc_ring_full(struct fd_ringbuffer *ring, fd_ringbuffer_emit_reloc_ring_full(struct fd_ringbuffer *ring,
struct fd_ringbuffer *target, uint32_t cmd_idx) struct fd_ringbuffer *target, uint32_t cmd_idx)
{ {
@ -173,7 +173,7 @@ fd_ringbuffer_emit_reloc_ring_full(struct fd_ringbuffer *ring,
return ring->funcs->emit_reloc_ring(ring, target, cmd_idx, 0, size); return ring->funcs->emit_reloc_ring(ring, target, cmd_idx, 0, size);
} }
uint32_t drm_public uint32_t
fd_ringbuffer_size(struct fd_ringbuffer *ring) fd_ringbuffer_size(struct fd_ringbuffer *ring)
{ {
/* only really needed for stateobj ringbuffers, and won't really /* only really needed for stateobj ringbuffers, and won't really
@ -188,7 +188,7 @@ fd_ringbuffer_size(struct fd_ringbuffer *ring)
* Deprecated ringmarker API: * Deprecated ringmarker API:
*/ */
struct fd_ringmarker * fd_ringmarker_new(struct fd_ringbuffer *ring) drm_public struct fd_ringmarker * fd_ringmarker_new(struct fd_ringbuffer *ring)
{ {
struct fd_ringmarker *marker = NULL; struct fd_ringmarker *marker = NULL;
@ -205,23 +205,23 @@ struct fd_ringmarker * fd_ringmarker_new(struct fd_ringbuffer *ring)
return marker; return marker;
} }
void fd_ringmarker_del(struct fd_ringmarker *marker) drm_public void fd_ringmarker_del(struct fd_ringmarker *marker)
{ {
free(marker); free(marker);
} }
void fd_ringmarker_mark(struct fd_ringmarker *marker) drm_public void fd_ringmarker_mark(struct fd_ringmarker *marker)
{ {
marker->cur = marker->ring->cur; marker->cur = marker->ring->cur;
} }
uint32_t fd_ringmarker_dwords(struct fd_ringmarker *start, drm_public uint32_t fd_ringmarker_dwords(struct fd_ringmarker *start,
struct fd_ringmarker *end) struct fd_ringmarker *end)
{ {
return end->cur - start->cur; return end->cur - start->cur;
} }
int fd_ringmarker_flush(struct fd_ringmarker *marker) drm_public int fd_ringmarker_flush(struct fd_ringmarker *marker)
{ {
struct fd_ringbuffer *ring = marker->ring; struct fd_ringbuffer *ring = marker->ring;
return ring->funcs->flush(ring, marker->cur, -1, NULL); return ring->funcs->flush(ring, marker->cur, -1, NULL);