public inbox for dri-devel@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Lucas De Marchi <lucas.demarchi@intel.com>
To: dri-devel@lists.freedesktop.org
Cc: Eric Engestrom <eric.engestrom@intel.com>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: [PATCH libdrm v2 08/13] omap: annotate public functions
Date: Thu, 13 Sep 2018 16:57:19 -0700	[thread overview]
Message-ID: <20180913235724.30476-9-lucas.demarchi@intel.com> (raw)
In-Reply-To: <20180913235724.30476-1-lucas.demarchi@intel.com>

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
omap-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>
---
 omap/omap_drm.c | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/omap/omap_drm.c b/omap/omap_drm.c
index 417d522c..3136e04e 100644
--- a/omap/omap_drm.c
+++ b/omap/omap_drm.c
@@ -88,7 +88,7 @@ static struct omap_device * omap_device_new_impl(int fd)
 	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;
 
@@ -111,13 +111,13 @@ struct omap_device * omap_device_new(int fd)
 	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);
 	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))
 		return;
@@ -129,7 +129,7 @@ void omap_device_del(struct omap_device *dev)
 }
 
 int
-omap_get_param(struct omap_device *dev, uint64_t param, uint64_t *value)
+drm_public omap_get_param(struct omap_device *dev, uint64_t param, uint64_t *value)
 {
 	struct drm_omap_param req = {
 			.param = param,
@@ -147,7 +147,7 @@ omap_get_param(struct omap_device *dev, uint64_t param, uint64_t *value)
 }
 
 int
-omap_set_param(struct omap_device *dev, uint64_t param, uint64_t value)
+drm_public omap_set_param(struct omap_device *dev, uint64_t param, uint64_t value)
 {
 	struct drm_omap_param req = {
 			.param = param,
@@ -227,7 +227,7 @@ fail:
 
 /* allocate a new (un-tiled) buffer object */
 struct omap_bo *
-omap_bo_new(struct omap_device *dev, uint32_t size, uint32_t flags)
+drm_public omap_bo_new(struct omap_device *dev, uint32_t size, uint32_t flags)
 {
 	union omap_gem_size gsize = {
 			.bytes = size,
@@ -240,7 +240,7 @@ omap_bo_new(struct omap_device *dev, uint32_t size, uint32_t flags)
 
 /* allocate a new buffer object */
 struct omap_bo *
-omap_bo_new_tiled(struct omap_device *dev, uint32_t width,
+drm_public omap_bo_new_tiled(struct omap_device *dev, uint32_t width,
 		  uint32_t height, uint32_t flags)
 {
 	union omap_gem_size gsize = {
@@ -255,7 +255,7 @@ omap_bo_new_tiled(struct omap_device *dev, uint32_t width,
 	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);
 	return bo;
@@ -282,7 +282,7 @@ static int get_buffer_info(struct omap_bo *bo)
 
 /* import a buffer object from DRI2 name */
 struct omap_bo *
-omap_bo_from_name(struct omap_device *dev, uint32_t name)
+drm_public omap_bo_from_name(struct omap_device *dev, uint32_t name)
 {
 	struct omap_bo *bo = NULL;
 	struct drm_gem_open req = {
@@ -316,7 +316,7 @@ fail:
  * 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 omap_bo_from_dmabuf(struct omap_device *dev, int fd)
 {
 	struct omap_bo *bo = NULL;
 	struct drm_prime_handle req = {
@@ -347,7 +347,7 @@ fail:
 }
 
 /* destroy a buffer object */
-void omap_bo_del(struct omap_bo *bo)
+drm_public void omap_bo_del(struct omap_bo *bo)
 {
 	if (!bo) {
 		return;
@@ -380,7 +380,7 @@ void omap_bo_del(struct omap_bo *bo)
 }
 
 /* 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) {
 		struct drm_gem_flink req = {
@@ -401,7 +401,7 @@ int omap_bo_get_name(struct omap_bo *bo, uint32_t *name)
 	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;
 }
@@ -409,7 +409,7 @@ uint32_t omap_bo_handle(struct omap_bo *bo)
 /* caller owns the dmabuf fd that is returned and is responsible
  * 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 < 0) {
 		struct drm_prime_handle req = {
@@ -428,7 +428,7 @@ int omap_bo_dmabuf(struct omap_bo *bo)
 	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) {
 		get_buffer_info(bo);
@@ -436,7 +436,7 @@ uint32_t omap_bo_size(struct omap_bo *bo)
 	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->offset) {
@@ -452,7 +452,7 @@ void *omap_bo_map(struct omap_bo *bo)
 	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 = {
 			.handle = bo->handle,
@@ -462,7 +462,7 @@ int omap_bo_cpu_prep(struct omap_bo *bo, enum omap_gem_op op)
 			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 = {
 			.handle = bo->handle,
-- 
2.17.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2018-09-13 23:58 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-13 23:57 [PATCH libdrm v2 00/13] hide library symbols by default Lucas De Marchi
2018-09-13 23:57 ` [PATCH libdrm v2 01/13] intel: annotate public functions Lucas De Marchi
2018-09-13 23:57 ` [PATCH libdrm v2 02/13] libkms: " Lucas De Marchi
2018-09-13 23:57 ` [PATCH libdrm v2 03/13] nouveau: " Lucas De Marchi
2018-09-13 23:57 ` [PATCH libdrm v2 04/13] libkms: " Lucas De Marchi
2018-09-14  8:02   ` Michel Dänzer
2018-09-20  6:00     ` Lucas De Marchi
2018-09-13 23:57 ` [PATCH libdrm v2 05/13] libdrm: " Lucas De Marchi
2018-09-13 23:57 ` [PATCH libdrm v2 06/13] etnaviv: " Lucas De Marchi
2018-09-13 23:57 ` [PATCH libdrm v2 07/13] freedreno: " Lucas De Marchi
2018-09-13 23:57 ` Lucas De Marchi [this message]
2018-09-13 23:57 ` [PATCH libdrm v2 09/13] radeon: " Lucas De Marchi
2018-09-13 23:57 ` [PATCH libdrm v2 10/13] tegra: " Lucas De Marchi
2018-09-13 23:57 ` [PATCH libdrm v2 11/13] exynos: " Lucas De Marchi
2018-09-13 23:57 ` [PATCH libdrm v2 12/13] meson: make symbols hidden by default Lucas De Marchi
2018-09-14 16:21   ` Dylan Baker
2018-09-13 23:57 ` [PATCH libdrm v2 13/13] autotools: " Lucas De Marchi
2018-09-14  9:28 ` [PATCH libdrm v2 00/13] hide library symbols " Eric Engestrom
2018-09-20  0:05   ` Lucas De Marchi
2018-09-20  6:03   ` Lucas De Marchi
2018-09-20 12:16 ` Emil Velikov
2018-09-21 21:14   ` Lucas De Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180913235724.30476-9-lucas.demarchi@intel.com \
    --to=lucas.demarchi@intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eric.engestrom@intel.com \
    --cc=rodrigo.vivi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox