All of lore.kernel.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 02/13] libkms: annotate public functions
Date: Thu, 13 Sep 2018 16:57:13 -0700	[thread overview]
Message-ID: <20180913235724.30476-3-lucas.demarchi@intel.com> (raw)
In-Reply-To: <20180913235724.30476-1-lucas.demarchi@intel.com>

This was done with:
nm --dynamic --defined-only build/libkms/libkms.so | \
	grep kms_ | \
	cut -d' ' -f3 > /tmp/a.txt

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

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>
---
 libkms/api.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libkms/api.c b/libkms/api.c
index 22dd32d7..caca1a87 100644
--- a/libkms/api.c
+++ b/libkms/api.c
@@ -33,12 +33,12 @@
 #include "libdrm_macros.h"
 #include "internal.h"
 
-int kms_create(int fd, struct kms_driver **out)
+drm_public int kms_create(int fd, struct kms_driver **out)
 {
 	return linux_create(fd, out);
 }
 
-int kms_get_prop(struct kms_driver *kms, unsigned key, unsigned *out)
+drm_public int kms_get_prop(struct kms_driver *kms, unsigned key, unsigned *out)
 {
 	switch (key) {
 	case KMS_BO_TYPE:
@@ -49,7 +49,7 @@ int kms_get_prop(struct kms_driver *kms, unsigned key, unsigned *out)
 	return kms->get_prop(kms, key, out);
 }
 
-int kms_destroy(struct kms_driver **kms)
+drm_public int kms_destroy(struct kms_driver **kms)
 {
 	if (!(*kms))
 		return 0;
@@ -59,7 +59,7 @@ int kms_destroy(struct kms_driver **kms)
 	return 0;
 }
 
-int kms_bo_create(struct kms_driver *kms, const unsigned *attr, struct kms_bo **out)
+drm_public int kms_bo_create(struct kms_driver *kms, const unsigned *attr, struct kms_bo **out)
 {
 	unsigned width = 0;
 	unsigned height = 0;
@@ -97,7 +97,7 @@ int kms_bo_create(struct kms_driver *kms, const unsigned *attr, struct kms_bo **
 	return kms->bo_create(kms, width, height, type, attr, out);
 }
 
-int kms_bo_get_prop(struct kms_bo *bo, unsigned key, unsigned *out)
+drm_public int kms_bo_get_prop(struct kms_bo *bo, unsigned key, unsigned *out)
 {
 	switch (key) {
 	case KMS_PITCH:
@@ -113,17 +113,17 @@ int kms_bo_get_prop(struct kms_bo *bo, unsigned key, unsigned *out)
 	return 0;
 }
 
-int kms_bo_map(struct kms_bo *bo, void **out)
+drm_public int kms_bo_map(struct kms_bo *bo, void **out)
 {
 	return bo->kms->bo_map(bo, out);
 }
 
-int kms_bo_unmap(struct kms_bo *bo)
+drm_public int kms_bo_unmap(struct kms_bo *bo)
 {
 	return bo->kms->bo_unmap(bo);
 }
 
-int kms_bo_destroy(struct kms_bo **bo)
+drm_public int kms_bo_destroy(struct kms_bo **bo)
 {
 	int ret;
 
-- 
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 ` Lucas De Marchi [this message]
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 ` [PATCH libdrm v2 08/13] omap: " Lucas De Marchi
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-3-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.