From patchwork Thu Sep 13 23:57:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas De Marchi X-Patchwork-Id: 10600175 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A7CC16CB for ; Thu, 13 Sep 2018 23:59:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37EFE2B5DA for ; Thu, 13 Sep 2018 23:59:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B4FD2B5E2; Thu, 13 Sep 2018 23:59:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6C6F72B5DA for ; Thu, 13 Sep 2018 23:59:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 692EE6E4D7; Thu, 13 Sep 2018 23:58:29 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id A927C6E3C6 for ; Thu, 13 Sep 2018 23:58:27 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Sep 2018 16:58:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,371,1531810800"; d="scan'208";a="263336617" Received: from ldmartin-desk.jf.intel.com ([10.24.8.150]) by fmsmga006.fm.intel.com with ESMTP; 13 Sep 2018 16:58:27 -0700 From: Lucas De Marchi To: dri-devel@lists.freedesktop.org Subject: [PATCH libdrm v2 06/13] etnaviv: annotate public functions Date: Thu, 13 Sep 2018 16:57:17 -0700 Message-Id: <20180913235724.30476-7-lucas.demarchi@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180913235724.30476-1-lucas.demarchi@intel.com> References: <20180913235724.30476-1-lucas.demarchi@intel.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eric Engestrom , Daniel Vetter , Rodrigo Vivi MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 etnaviv-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 --- etnaviv/etnaviv_bo.c | 25 +++++++++++++------------ etnaviv/etnaviv_cmd_stream.c | 21 ++++++++++++--------- etnaviv/etnaviv_device.c | 10 +++++----- etnaviv/etnaviv_gpu.c | 6 +++--- etnaviv/etnaviv_perfmon.c | 8 ++++---- etnaviv/etnaviv_pipe.c | 8 ++++---- 6 files changed, 41 insertions(+), 37 deletions(-) diff --git a/etnaviv/etnaviv_bo.c b/etnaviv/etnaviv_bo.c index 32f7b348..43ce6b4e 100644 --- a/etnaviv/etnaviv_bo.c +++ b/etnaviv/etnaviv_bo.c @@ -104,7 +104,7 @@ static struct etna_bo *bo_from_handle(struct etna_device *dev, } /* allocate a new (un-tiled) buffer object */ -struct etna_bo *etna_bo_new(struct etna_device *dev, uint32_t size, +drm_public struct etna_bo *etna_bo_new(struct etna_device *dev, uint32_t size, uint32_t flags) { struct etna_bo *bo; @@ -131,7 +131,7 @@ struct etna_bo *etna_bo_new(struct etna_device *dev, uint32_t size, return bo; } -struct etna_bo *etna_bo_ref(struct etna_bo *bo) +drm_public struct etna_bo *etna_bo_ref(struct etna_bo *bo) { atomic_inc(&bo->refcnt); @@ -159,7 +159,8 @@ static int get_buffer_info(struct etna_bo *bo) } /* import a buffer object from DRI2 name */ -struct etna_bo *etna_bo_from_name(struct etna_device *dev, uint32_t name) +drm_public struct etna_bo *etna_bo_from_name(struct etna_device *dev, + uint32_t name) { struct etna_bo *bo; struct drm_gem_open req = { @@ -196,7 +197,7 @@ out_unlock: * fd so caller should close() the fd when it is otherwise done * with it (even if it is still using the 'struct etna_bo *') */ -struct etna_bo *etna_bo_from_dmabuf(struct etna_device *dev, int fd) +drm_public struct etna_bo *etna_bo_from_dmabuf(struct etna_device *dev, int fd) { struct etna_bo *bo; int ret, size; @@ -231,7 +232,7 @@ out_unlock: } /* destroy a buffer object */ -void etna_bo_del(struct etna_bo *bo) +drm_public void etna_bo_del(struct etna_bo *bo) { struct etna_device *dev = bo->dev; @@ -253,7 +254,7 @@ out: } /* get the global flink/DRI2 buffer name */ -int etna_bo_get_name(struct etna_bo *bo, uint32_t *name) +drm_public int etna_bo_get_name(struct etna_bo *bo, uint32_t *name) { if (!bo->name) { struct drm_gem_flink req = { @@ -277,7 +278,7 @@ int etna_bo_get_name(struct etna_bo *bo, uint32_t *name) return 0; } -uint32_t etna_bo_handle(struct etna_bo *bo) +drm_public uint32_t etna_bo_handle(struct etna_bo *bo) { return bo->handle; } @@ -285,7 +286,7 @@ uint32_t etna_bo_handle(struct etna_bo *bo) /* caller owns the dmabuf fd that is returned and is responsible * to close() it when done */ -int etna_bo_dmabuf(struct etna_bo *bo) +drm_public int etna_bo_dmabuf(struct etna_bo *bo) { int ret, prime_fd; @@ -301,12 +302,12 @@ int etna_bo_dmabuf(struct etna_bo *bo) return prime_fd; } -uint32_t etna_bo_size(struct etna_bo *bo) +drm_public uint32_t etna_bo_size(struct etna_bo *bo) { return bo->size; } -void *etna_bo_map(struct etna_bo *bo) +drm_public void *etna_bo_map(struct etna_bo *bo) { if (!bo->map) { if (!bo->offset) { @@ -324,7 +325,7 @@ void *etna_bo_map(struct etna_bo *bo) return bo->map; } -int etna_bo_cpu_prep(struct etna_bo *bo, uint32_t op) +drm_public int etna_bo_cpu_prep(struct etna_bo *bo, uint32_t op) { struct drm_etnaviv_gem_cpu_prep req = { .handle = bo->handle, @@ -337,7 +338,7 @@ int etna_bo_cpu_prep(struct etna_bo *bo, uint32_t op) &req, sizeof(req)); } -void etna_bo_cpu_fini(struct etna_bo *bo) +drm_public void etna_bo_cpu_fini(struct etna_bo *bo) { struct drm_etnaviv_gem_cpu_fini req = { .handle = bo->handle, diff --git a/etnaviv/etnaviv_cmd_stream.c b/etnaviv/etnaviv_cmd_stream.c index 13730168..7139c324 100644 --- a/etnaviv/etnaviv_cmd_stream.c +++ b/etnaviv/etnaviv_cmd_stream.c @@ -55,7 +55,8 @@ etna_cmd_stream_priv(struct etna_cmd_stream *stream) return (struct etna_cmd_stream_priv *)stream; } -struct etna_cmd_stream *etna_cmd_stream_new(struct etna_pipe *pipe, uint32_t size, +drm_public struct etna_cmd_stream *etna_cmd_stream_new(struct etna_pipe *pipe, + uint32_t size, void (*reset_notify)(struct etna_cmd_stream *stream, void *priv), void *priv) { @@ -95,7 +96,7 @@ fail: return NULL; } -void etna_cmd_stream_del(struct etna_cmd_stream *stream) +drm_public void etna_cmd_stream_del(struct etna_cmd_stream *stream) { struct etna_cmd_stream_priv *priv = etna_cmd_stream_priv(stream); @@ -119,7 +120,7 @@ static void reset_buffer(struct etna_cmd_stream *stream) priv->reset_notify(stream, priv->reset_notify_priv); } -uint32_t etna_cmd_stream_timestamp(struct etna_cmd_stream *stream) +drm_public uint32_t etna_cmd_stream_timestamp(struct etna_cmd_stream *stream) { return etna_cmd_stream_priv(stream)->last_timestamp; } @@ -222,20 +223,21 @@ static void flush(struct etna_cmd_stream *stream, int in_fence_fd, *out_fence_fd = req.fence_fd; } -void etna_cmd_stream_flush(struct etna_cmd_stream *stream) +drm_public void etna_cmd_stream_flush(struct etna_cmd_stream *stream) { flush(stream, -1, NULL); reset_buffer(stream); } -void etna_cmd_stream_flush2(struct etna_cmd_stream *stream, int in_fence_fd, - int *out_fence_fd) +drm_public void etna_cmd_stream_flush2(struct etna_cmd_stream *stream, + int in_fence_fd, + int *out_fence_fd) { flush(stream, in_fence_fd, out_fence_fd); reset_buffer(stream); } -void etna_cmd_stream_finish(struct etna_cmd_stream *stream) +drm_public void etna_cmd_stream_finish(struct etna_cmd_stream *stream) { struct etna_cmd_stream_priv *priv = etna_cmd_stream_priv(stream); @@ -244,7 +246,8 @@ void etna_cmd_stream_finish(struct etna_cmd_stream *stream) reset_buffer(stream); } -void etna_cmd_stream_reloc(struct etna_cmd_stream *stream, const struct etna_reloc *r) +drm_public void etna_cmd_stream_reloc(struct etna_cmd_stream *stream, + const struct etna_reloc *r) { struct etna_cmd_stream_priv *priv = etna_cmd_stream_priv(stream); struct drm_etnaviv_gem_submit_reloc *reloc; @@ -261,7 +264,7 @@ void etna_cmd_stream_reloc(struct etna_cmd_stream *stream, const struct etna_rel etna_cmd_stream_emit(stream, addr); } -void etna_cmd_stream_perf(struct etna_cmd_stream *stream, const struct etna_perf *p) +drm_public void etna_cmd_stream_perf(struct etna_cmd_stream *stream, const struct etna_perf *p) { struct etna_cmd_stream_priv *priv = etna_cmd_stream_priv(stream); struct drm_etnaviv_gem_submit_pmr *pmr; diff --git a/etnaviv/etnaviv_device.c b/etnaviv/etnaviv_device.c index d83e8d3e..699df256 100644 --- a/etnaviv/etnaviv_device.c +++ b/etnaviv/etnaviv_device.c @@ -41,7 +41,7 @@ static pthread_mutex_t table_lock = PTHREAD_MUTEX_INITIALIZER; -struct etna_device *etna_device_new(int fd) +drm_public struct etna_device *etna_device_new(int fd) { struct etna_device *dev = calloc(sizeof(*dev), 1); @@ -59,7 +59,7 @@ struct etna_device *etna_device_new(int fd) /* like etna_device_new() but creates it's own private dup() of the fd * which is close()d when the device is finalized. */ -struct etna_device *etna_device_new_dup(int fd) +drm_public struct etna_device *etna_device_new_dup(int fd) { int dup_fd = dup(fd); struct etna_device *dev = etna_device_new(dup_fd); @@ -72,7 +72,7 @@ struct etna_device *etna_device_new_dup(int fd) return dev; } -struct etna_device *etna_device_ref(struct etna_device *dev) +drm_public struct etna_device *etna_device_ref(struct etna_device *dev) { atomic_inc(&dev->refcnt); @@ -99,7 +99,7 @@ drm_private void etna_device_del_locked(struct etna_device *dev) etna_device_del_impl(dev); } -void etna_device_del(struct etna_device *dev) +drm_public void etna_device_del(struct etna_device *dev) { if (!atomic_dec_and_test(&dev->refcnt)) return; @@ -109,7 +109,7 @@ void etna_device_del(struct etna_device *dev) pthread_mutex_unlock(&table_lock); } -int etna_device_fd(struct etna_device *dev) +drm_public int etna_device_fd(struct etna_device *dev) { return dev->fd; } diff --git a/etnaviv/etnaviv_gpu.c b/etnaviv/etnaviv_gpu.c index f7efa028..dc4c126d 100644 --- a/etnaviv/etnaviv_gpu.c +++ b/etnaviv/etnaviv_gpu.c @@ -44,7 +44,7 @@ static uint64_t get_param(struct etna_device *dev, uint32_t core, uint32_t param return req.value; } -struct etna_gpu *etna_gpu_new(struct etna_device *dev, unsigned int core) +drm_public struct etna_gpu *etna_gpu_new(struct etna_device *dev, unsigned int core) { struct etna_gpu *gpu; @@ -73,12 +73,12 @@ fail: return NULL; } -void etna_gpu_del(struct etna_gpu *gpu) +drm_public void etna_gpu_del(struct etna_gpu *gpu) { free(gpu); } -int etna_gpu_get_param(struct etna_gpu *gpu, enum etna_param_id param, +drm_public int etna_gpu_get_param(struct etna_gpu *gpu, enum etna_param_id param, uint64_t *value) { struct etna_device *dev = gpu->dev; diff --git a/etnaviv/etnaviv_perfmon.c b/etnaviv/etnaviv_perfmon.c index 5f408a7b..f6576b8a 100644 --- a/etnaviv/etnaviv_perfmon.c +++ b/etnaviv/etnaviv_perfmon.c @@ -121,7 +121,7 @@ static void etna_perfmon_free_domains(struct etna_perfmon *pm) } } -struct etna_perfmon *etna_perfmon_create(struct etna_pipe *pipe) +drm_public struct etna_perfmon *etna_perfmon_create(struct etna_pipe *pipe) { struct etna_perfmon *pm; int ret; @@ -147,7 +147,7 @@ fail: return NULL; } -void etna_perfmon_del(struct etna_perfmon *pm) +drm_public void etna_perfmon_del(struct etna_perfmon *pm) { if (!pm) return; @@ -156,7 +156,7 @@ void etna_perfmon_del(struct etna_perfmon *pm) free(pm); } -struct etna_perfmon_domain *etna_perfmon_get_dom_by_name(struct etna_perfmon *pm, const char *name) +drm_public struct etna_perfmon_domain *etna_perfmon_get_dom_by_name(struct etna_perfmon *pm, const char *name) { struct etna_perfmon_domain *dom; @@ -170,7 +170,7 @@ struct etna_perfmon_domain *etna_perfmon_get_dom_by_name(struct etna_perfmon *pm return NULL; } -struct etna_perfmon_signal *etna_perfmon_get_sig_by_name(struct etna_perfmon_domain *dom, const char *name) +drm_public struct etna_perfmon_signal *etna_perfmon_get_sig_by_name(struct etna_perfmon_domain *dom, const char *name) { struct etna_perfmon_signal *signal; diff --git a/etnaviv/etnaviv_pipe.c b/etnaviv/etnaviv_pipe.c index 53954aa3..4120a36f 100644 --- a/etnaviv/etnaviv_pipe.c +++ b/etnaviv/etnaviv_pipe.c @@ -26,12 +26,12 @@ #include "etnaviv_priv.h" -int etna_pipe_wait(struct etna_pipe *pipe, uint32_t timestamp, uint32_t ms) +drm_public int etna_pipe_wait(struct etna_pipe *pipe, uint32_t timestamp, uint32_t ms) { return etna_pipe_wait_ns(pipe, timestamp, ms * 1000000); } -int etna_pipe_wait_ns(struct etna_pipe *pipe, uint32_t timestamp, uint64_t ns) +drm_public int etna_pipe_wait_ns(struct etna_pipe *pipe, uint32_t timestamp, uint64_t ns) { struct etna_device *dev = pipe->gpu->dev; int ret; @@ -55,12 +55,12 @@ int etna_pipe_wait_ns(struct etna_pipe *pipe, uint32_t timestamp, uint64_t ns) return 0; } -void etna_pipe_del(struct etna_pipe *pipe) +drm_public void etna_pipe_del(struct etna_pipe *pipe) { free(pipe); } -struct etna_pipe *etna_pipe_new(struct etna_gpu *gpu, enum etna_pipe_id id) +drm_public struct etna_pipe *etna_pipe_new(struct etna_gpu *gpu, enum etna_pipe_id id) { struct etna_pipe *pipe;