diff mbox

[libdrm,07/24] radeon: annotate the private symbols

Message ID 1427904935-14387-8-git-send-email-emil.l.velikov@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Emil Velikov April 1, 2015, 4:15 p.m. UTC
They are less and easier to track than the public ones. The macro
drm_public will be going away by the end of the series.

Cc: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Cc: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
---
 radeon/bof.c | 22 +++++++++++++---------
 radeon/bof.h | 23 ++++++++++++++---------
 2 files changed, 27 insertions(+), 18 deletions(-)

Comments

Michel Dänzer April 2, 2015, 2:48 a.m. UTC | #1
On 02.04.2015 01:15, Emil Velikov wrote:
> They are less and easier to track than the public ones.

Grammar: s/less/fewer/


Other than that, this patch and patch 8 are

Acked-by: Michel Dänzer <michel.daenzer@amd.com>

though I'm not sure about the impact of Jerome's objection to previous
patches on this one.
Jerome Glisse April 2, 2015, 3:57 a.m. UTC | #2
On Thu, Apr 02, 2015 at 11:48:25AM +0900, Michel Dänzer wrote:
> On 02.04.2015 01:15, Emil Velikov wrote:
> > They are less and easier to track than the public ones.
> 
> Grammar: s/less/fewer/
> 
> 
> Other than that, this patch and patch 8 are
> 
> Acked-by: Michel Dänzer <michel.daenzer@amd.com>
> 
> though I'm not sure about the impact of Jerome's objection to previous
> patches on this one.

Yes same apply, adding drm specific define would break my cping of those
file to my tools. But if Emil feels like adding bofreplay to libdrm i do
not have any objection.

Thought using some macro trickery inside bof.h this can be work around.

Cheers,
Jérôme

> 
> 
> -- 
> Earthling Michel Dänzer               |               http://www.amd.com
> Libre software enthusiast             |             Mesa and X developer
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
Emil Velikov April 2, 2015, 11:10 p.m. UTC | #3
On 2 April 2015 at 04:57, Jerome Glisse <j.glisse@gmail.com> wrote:
> On Thu, Apr 02, 2015 at 11:48:25AM +0900, Michel Dänzer wrote:
>> On 02.04.2015 01:15, Emil Velikov wrote:
>> > They are less and easier to track than the public ones.
>>
>> Grammar: s/less/fewer/
>>
>>
>> Other than that, this patch and patch 8 are
>>
>> Acked-by: Michel Dänzer <michel.daenzer@amd.com>
>>
>> though I'm not sure about the impact of Jerome's objection to previous
>> patches on this one.
>
> Yes same apply, adding drm specific define would break my cping of those
> file to my tools. But if Emil feels like adding bofreplay to libdrm i do
> not have any objection.
>
> Thought using some macro trickery inside bof.h this can be work around.
>
Actually the cleanest/quickest solution would be to move bof.[ch] from
libdrm_radeon_la_SOURCES to EXTRA_DIST. This way we won't need any of
these patches,. Plus if one wants to use bof via radeon_cs_gem, they
will have to change one more line (apart from the current CS_BOF_DUMP)
- add the sources into libdrm_radeon_la_SOURCES. I'll add a note about
it next to the define.

As we import bofreplay we can rework things to be more elegant. How
does that sound ?

-Emil
diff mbox

Patch

diff --git a/radeon/bof.c b/radeon/bof.c
index 92f4b91..2b29b89 100644
--- a/radeon/bof.c
+++ b/radeon/bof.c
@@ -23,6 +23,10 @@ 
  * Authors:
  *      Jerome Glisse
  */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <errno.h>
 #include <stdlib.h>
 #include <string.h>
@@ -50,7 +54,7 @@  static void bof_incref(bof_t *bof)
 	bof->refcount++;
 }
 
-void bof_decref(bof_t *bof)
+drm_private void bof_decref(bof_t *bof)
 {
 	unsigned i;
 
@@ -96,7 +100,7 @@  static bof_t *bof_string(const char *value)
 /*
  * object 
  */
-bof_t *bof_object(void)
+drm_private bof_t *bof_object(void)
 {
 	bof_t *object;
 
@@ -109,7 +113,7 @@  bof_t *bof_object(void)
 	return object;
 }
 
-int bof_object_set(bof_t *object, const char *keyname, bof_t *value)
+drm_private int bof_object_set(bof_t *object, const char *keyname, bof_t *value)
 {
 	bof_t *key;
 	int r;
@@ -133,7 +137,7 @@  int bof_object_set(bof_t *object, const char *keyname, bof_t *value)
 /*
  * array
  */
-bof_t *bof_array(void)
+drm_private bof_t *bof_array(void)
 {
 	bof_t *array = bof_object();
 
@@ -144,7 +148,7 @@  bof_t *bof_array(void)
 	return array;
 }
 
-int bof_array_append(bof_t *array, bof_t *value)
+drm_private int bof_array_append(bof_t *array, bof_t *value)
 {
 	int r;
 	if (array->type != BOF_TYPE_ARRAY)
@@ -161,7 +165,7 @@  int bof_array_append(bof_t *array, bof_t *value)
 /*
  * blob
  */
-bof_t *bof_blob(unsigned size, void *value)
+drm_private bof_t *bof_blob(unsigned size, void *value)
 {
 	bof_t *blob = bof_object();
 
@@ -182,7 +186,7 @@  bof_t *bof_blob(unsigned size, void *value)
 /*
  *  int32
  */
-bof_t *bof_int32(int32_t value)
+drm_private bof_t *bof_int32(int32_t value)
 {
 	bof_t *int32 = bof_object();
 
@@ -200,7 +204,7 @@  bof_t *bof_int32(int32_t value)
 	return int32;
 }
 
-int32_t bof_int32_value(bof_t *bof)
+drm_private int32_t bof_int32_value(bof_t *bof)
 {
 	return *((uint32_t*)bof->value);
 }
@@ -245,7 +249,7 @@  static int bof_file_write(bof_t *bof, FILE *file)
 	return 0;
 }
 
-int bof_dump_file(bof_t *bof, const char *filename)
+drm_private int bof_dump_file(bof_t *bof, const char *filename)
 {
 	unsigned i;
 	int r = 0;
diff --git a/radeon/bof.h b/radeon/bof.h
index 8108dd5..b7632b4 100644
--- a/radeon/bof.h
+++ b/radeon/bof.h
@@ -26,8 +26,13 @@ 
 #ifndef BOF_H
 #define BOF_H
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <stdio.h>
 #include <stdint.h>
+#include "libdrm.h"
 
 #define BOF_TYPE_STRING		0
 #define BOF_TYPE_NULL		1
@@ -52,19 +57,19 @@  typedef struct bof {
 } bof_t;
 
 /* object */
-extern bof_t *bof_object(void);
-extern int bof_object_set(bof_t *object, const char *keyname, bof_t *value);
+drm_private extern bof_t *bof_object(void);
+drm_private extern int bof_object_set(bof_t *object, const char *keyname, bof_t *value);
 /* array */
-extern bof_t *bof_array(void);
-extern int bof_array_append(bof_t *array, bof_t *value);
+drm_private extern bof_t *bof_array(void);
+drm_private extern int bof_array_append(bof_t *array, bof_t *value);
 /* blob */
-extern bof_t *bof_blob(unsigned size, void *value);
+drm_private extern bof_t *bof_blob(unsigned size, void *value);
 /* int32 */
-extern bof_t *bof_int32(int32_t value);
-extern int32_t bof_int32_value(bof_t *bof);
+drm_private extern bof_t *bof_int32(int32_t value);
+drm_private extern int32_t bof_int32_value(bof_t *bof);
 /* common functions */
-extern void bof_decref(bof_t *bof);
-extern int bof_dump_file(bof_t *bof, const char *filename);
+drm_private extern void bof_decref(bof_t *bof);
+drm_private extern int bof_dump_file(bof_t *bof, const char *filename);
 
 static inline int bof_is_object(bof_t *bof){return (bof->type == BOF_TYPE_OBJECT);}
 static inline int bof_is_blob(bof_t *bof){return (bof->type == BOF_TYPE_BLOB);}