From patchwork Mon Aug 4 09:23:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 4668861 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9B8A29F373 for ; Mon, 4 Aug 2014 09:23:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 012512022A for ; Mon, 4 Aug 2014 09:23:27 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 4C93E20218 for ; Mon, 4 Aug 2014 09:23:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9FF4C6E386; Mon, 4 Aug 2014 02:23:22 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by gabe.freedesktop.org (Postfix) with ESMTP id 1DF536E386 for ; Mon, 4 Aug 2014 02:23:21 -0700 (PDT) Received: from 5ed49945.cm-7-5c.dynamic.ziggo.nl ([94.212.153.69] helo=[192.168.1.128]) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1XEEUC-0007Sh-Hb for dri-devel@lists.freedesktop.org; Mon, 04 Aug 2014 09:23:20 +0000 Message-ID: <53DF5108.3040001@canonical.com> Date: Mon, 04 Aug 2014 11:23:20 +0200 From: Maarten Lankhorst User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: "dri-devel@lists.freedesktop.org" Subject: [LIBDRM PATCH 2/3] freedreno: Use symbol visibility. References: <53DF50D9.3020307@canonical.com> In-Reply-To: <53DF50D9.3020307@canonical.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hiding fd_device_del_locked, and fd_cleanup_bo_cache. Signed-off-by: Maarten Lankhorst --- freedreno/Makefile.am | 1 + freedreno/freedreno_bo.c | 26 +++++++++++++------------- freedreno/freedreno_device.c | 8 ++++---- freedreno/freedreno_pipe.c | 11 ++++++----- freedreno/freedreno_priv.h | 5 +++++ freedreno/freedreno_ringbuffer.c | 38 ++++++++++++++++++++------------------ freedreno/kgsl/kgsl_bo.c | 4 ++-- 7 files changed, 51 insertions(+), 42 deletions(-) diff --git a/freedreno/Makefile.am b/freedreno/Makefile.am index 7903e5b..49471e9 100644 --- a/freedreno/Makefile.am +++ b/freedreno/Makefile.am @@ -2,6 +2,7 @@ AUTOMAKE_OPTIONS=subdir-objects AM_CFLAGS = \ $(WARN_CFLAGS) \ + $(VISIBILITY_CFLAGS) \ -I$(top_srcdir) \ -I$(top_srcdir)/freedreno \ $(PTHREADSTUBS_CFLAGS) \ diff --git a/freedreno/freedreno_bo.c b/freedreno/freedreno_bo.c index 8cea4de..3a2e464 100644 --- a/freedreno/freedreno_bo.c +++ b/freedreno/freedreno_bo.c @@ -163,8 +163,8 @@ static struct fd_bo *find_in_bucket(struct fd_device *dev, } -struct fd_bo * fd_bo_new(struct fd_device *dev, - uint32_t size, uint32_t flags) +drm_public struct fd_bo * +fd_bo_new(struct fd_device *dev, uint32_t size, uint32_t flags) { struct fd_bo *bo = NULL; struct fd_bo_bucket *bucket; @@ -197,8 +197,8 @@ struct fd_bo * fd_bo_new(struct fd_device *dev, return bo; } -struct fd_bo *fd_bo_from_handle(struct fd_device *dev, - uint32_t handle, uint32_t size) +drm_public struct fd_bo * +fd_bo_from_handle(struct fd_device *dev, uint32_t handle, uint32_t size) { struct fd_bo *bo = NULL; @@ -209,7 +209,7 @@ struct fd_bo *fd_bo_from_handle(struct fd_device *dev, 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 = { .name = name, @@ -242,13 +242,13 @@ out_unlock: return bo; } -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); 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; @@ -307,7 +307,7 @@ static void bo_del(struct fd_bo *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) { struct drm_gem_flink req = { @@ -330,17 +330,17 @@ int fd_bo_get_name(struct fd_bo *bo, uint32_t *name) 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; } -uint32_t fd_bo_size(struct fd_bo *bo) +drm_public uint32_t fd_bo_size(struct fd_bo *bo) { return bo->size; } -void * fd_bo_map(struct fd_bo *bo) +drm_public void * fd_bo_map(struct fd_bo *bo) { if (!bo->map) { uint64_t offset; @@ -362,12 +362,12 @@ 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.. */ -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); } -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); } diff --git a/freedreno/freedreno_device.c b/freedreno/freedreno_device.c index c34963c..2d3aa33 100644 --- a/freedreno/freedreno_device.c +++ b/freedreno/freedreno_device.c @@ -76,7 +76,7 @@ init_cache_buckets(struct fd_device *dev) } } -struct fd_device * fd_device_new(int fd) +drm_public struct fd_device * fd_device_new(int fd) { struct fd_device *dev; drmVersionPtr version; @@ -115,7 +115,7 @@ struct fd_device * fd_device_new(int fd) /* like fd_device_new() but creates it's own private dup() of the fd * 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) { struct fd_device *dev = fd_device_new(dup(fd)); if (dev) @@ -123,7 +123,7 @@ struct fd_device * fd_device_new_dup(int fd) 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); return dev; @@ -146,7 +146,7 @@ void fd_device_del_locked(struct fd_device *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)) return; diff --git a/freedreno/freedreno_pipe.c b/freedreno/freedreno_pipe.c index 805bf00..f55aaa4 100644 --- a/freedreno/freedreno_pipe.c +++ b/freedreno/freedreno_pipe.c @@ -29,7 +29,8 @@ #include "freedreno_drmif.h" #include "freedreno_priv.h" -struct fd_pipe * fd_pipe_new(struct fd_device *dev, enum fd_pipe_id id) +drm_public struct fd_pipe * +fd_pipe_new(struct fd_device *dev, enum fd_pipe_id id) { struct fd_pipe *pipe = NULL; @@ -54,18 +55,18 @@ fail: return NULL; } -void fd_pipe_del(struct fd_pipe *pipe) +drm_public void fd_pipe_del(struct fd_pipe *pipe) { pipe->funcs->destroy(pipe); } -int fd_pipe_get_param(struct fd_pipe *pipe, enum fd_param_id param, - uint64_t *value) +drm_public int fd_pipe_get_param(struct fd_pipe *pipe, + enum fd_param_id param, uint64_t *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 pipe->funcs->wait(pipe, timestamp); } diff --git a/freedreno/freedreno_priv.h b/freedreno/freedreno_priv.h index 7438485..6bd1dec 100644 --- a/freedreno/freedreno_priv.h +++ b/freedreno/freedreno_priv.h @@ -29,6 +29,10 @@ #ifndef FREEDRENO_PRIV_H_ #define FREEDRENO_PRIV_H_ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include @@ -41,6 +45,7 @@ #include #include +#include "libdrm.h" #include "xf86drm.h" #include "xf86atomic.h" diff --git a/freedreno/freedreno_ringbuffer.c b/freedreno/freedreno_ringbuffer.c index b9849c5..def869f 100644 --- a/freedreno/freedreno_ringbuffer.c +++ b/freedreno/freedreno_ringbuffer.c @@ -32,8 +32,8 @@ #include "freedreno_priv.h" #include "freedreno_ringbuffer.h" -struct fd_ringbuffer * fd_ringbuffer_new(struct fd_pipe *pipe, - uint32_t size) +drm_public struct fd_ringbuffer * +fd_ringbuffer_new(struct fd_pipe *pipe, uint32_t size) { struct fd_ringbuffer *ring; @@ -51,7 +51,7 @@ struct fd_ringbuffer * fd_ringbuffer_new(struct fd_pipe *pipe, return ring; } -void fd_ringbuffer_del(struct fd_ringbuffer *ring) +drm_public void fd_ringbuffer_del(struct fd_ringbuffer *ring) { ring->funcs->destroy(ring); } @@ -60,13 +60,13 @@ void fd_ringbuffer_del(struct fd_ringbuffer *ring) * the IB source) as it's parent before emitting reloc's, to ensure * the bookkeeping works out properly. */ -void fd_ringbuffer_set_parent(struct fd_ringbuffer *ring, - struct fd_ringbuffer *parent) +drm_public void fd_ringbuffer_set_parent(struct fd_ringbuffer *ring, + struct fd_ringbuffer *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; if (ring->pipe->id == FD_PIPE_2D) @@ -77,30 +77,32 @@ void fd_ringbuffer_reset(struct fd_ringbuffer *ring) } /* maybe get rid of this and use fd_ringmarker_flush() from DDX too? */ -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); } -uint32_t fd_ringbuffer_timestamp(struct fd_ringbuffer *ring) +drm_public uint32_t fd_ringbuffer_timestamp(struct fd_ringbuffer *ring) { return ring->last_timestamp; } -void fd_ringbuffer_reloc(struct fd_ringbuffer *ring, - const struct fd_reloc *reloc) +drm_public void fd_ringbuffer_reloc(struct fd_ringbuffer *ring, + const struct fd_reloc *reloc) { ring->funcs->emit_reloc(ring, reloc); } -void fd_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring, - struct fd_ringmarker *target, struct fd_ringmarker *end) +drm_public void +fd_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring, + struct fd_ringmarker *target, + struct fd_ringmarker *end) { assert(target->ring == end->ring); ring->funcs->emit_reloc_ring(ring, target, end); } -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; @@ -117,23 +119,23 @@ struct fd_ringmarker * fd_ringmarker_new(struct fd_ringbuffer *ring) return marker; } -void fd_ringmarker_del(struct fd_ringmarker *marker) +drm_public void fd_ringmarker_del(struct fd_ringmarker *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; } -uint32_t fd_ringmarker_dwords(struct fd_ringmarker *start, - struct fd_ringmarker *end) +drm_public uint32_t fd_ringmarker_dwords(struct fd_ringmarker *start, + struct fd_ringmarker *end) { 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; return ring->funcs->flush(ring, marker->cur); diff --git a/freedreno/kgsl/kgsl_bo.c b/freedreno/kgsl/kgsl_bo.c index 19a1008..c868097 100644 --- a/freedreno/kgsl/kgsl_bo.c +++ b/freedreno/kgsl/kgsl_bo.c @@ -171,8 +171,8 @@ struct fd_bo * kgsl_bo_from_handle(struct fd_device *dev, return bo; } -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) { struct fd_bo *bo;