Skip to contentSkip to conversation

amdgpu: cleanup the exported symbols

PATCH In review Emil Velikov 4 participants 14 messages Aug 7, 2015 – Aug 13, 2015 Kbuild

lore
Share & tools
lore
#0 lore raw

cover amdgpu: cleanup the exported symbols

Now that the API is stabilised we can do a bit of a cleanup, and ensure only the symbols part of it are exported - 62 -> 34.

This also gives us some ~10% is size reduction of the final binary.

Android support would be nice, but it's not a show stopper :)

Please review,
Emil

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw

PATCH 1/9 Force enable amdgpu for the dist build/check.

---
 Makefile.am | 1 +
 1 file changed, 1 insertion(+)
Makefile.am +1 -0
index cb808ff..55e39a5 100644
@@ -27,6 +27,7 @@ AM_DISTCHECK_CONFIGURE_FLAGS = \
 	--enable-libkms \
 	--enable-intel \
 	--enable-radeon \
+	--enable-amdgpu \
 	--enable-nouveau \
 	--enable-vmwgfx \
 	--enable-omap-experimental-api \
Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

PATCH 2/9 amdgpu/util_hash: hide private symbols from global namespace

In reply to Emil Velikov
---
 amdgpu/util_hash.c | 29 +++++++++++++++--------------
 amdgpu/util_hash.h | 34 +++++++++++++++++++++-------------
 2 files changed, 36 insertions(+), 27 deletions(-)
amdgpu/util_hash.c +15 -14
index b1e12c4..7e59041 100644
@@ -214,8 +214,8 @@ static struct util_node **util_hash_find_node(struct util_hash *hash, unsigned a
    return node;
 }
 
-struct util_hash_iter util_hash_insert(struct util_hash *hash,
-                                       unsigned key, void *data)
+drm_private struct util_hash_iter
+util_hash_insert(struct util_hash *hash, unsigned key, void *data)
 {
    util_data_might_grow(hash->data.d);
 
@@ -234,7 +234,7 @@ struct util_hash_iter util_hash_insert(struct util_hash *hash,
    }
 }
 
-struct util_hash * util_hash_create(void)
+drm_private struct util_hash *util_hash_create(void)
 {
    struct util_hash *hash = malloc(sizeof(struct util_hash));
    if (!hash)
@@ -257,7 +257,7 @@ struct util_hash * util_hash_create(void)
    return hash;
 }
 
-void util_hash_delete(struct util_hash *hash)
+drm_private void util_hash_delete(struct util_hash *hash)
 {
    struct util_node *e_for_x = (struct util_node *)(hash->data.d);
    struct util_node **bucket = (struct util_node **)(hash->data.d->buckets);
@@ -275,22 +275,22 @@ void util_hash_delete(struct util_hash *hash)
    free(hash);
 }
 
-struct util_hash_iter util_hash_find(struct util_hash *hash,
-                                     unsigned key)
+drm_private struct util_hash_iter
+util_hash_find(struct util_hash *hash, unsigned key)
 {
    struct util_node **nextNode = util_hash_find_node(hash, key);
    struct util_hash_iter iter = {hash, *nextNode};
    return iter;
 }
 
-unsigned util_hash_iter_key(struct util_hash_iter iter)
+drm_private unsigned util_hash_iter_key(struct util_hash_iter iter)
 {
    if (!iter.node || iter.hash->data.e == iter.node)
       return 0;
    return iter.node->key;
 }
 
-void * util_hash_iter_data(struct util_hash_iter iter)
+drm_private void *util_hash_iter_data(struct util_hash_iter iter)
 {
    if (!iter.node || iter.hash->data.e == iter.node)
       return 0;
@@ -327,21 +327,21 @@ static struct util_node *util_hash_data_next(struct util_node *node)
    return a.e;
 }
 
-struct util_hash_iter util_hash_iter_next(struct util_hash_iter iter)
+drm_private struct util_hash_iter
+util_hash_iter_next(struct util_hash_iter iter)
 {
    struct util_hash_iter next = {iter.hash, util_hash_data_next(iter.node)};
    return next;
 }
 
-int util_hash_iter_is_null(struct util_hash_iter iter)
+drm_private int util_hash_iter_is_null(struct util_hash_iter iter)
 {
    if (!iter.node || iter.node == iter.hash->data.e)
       return 1;
    return 0;
 }
 
-void * util_hash_take(struct util_hash *hash,
-                      unsigned akey)
+drm_private void *util_hash_take(struct util_hash *hash, unsigned akey)
 {
    struct util_node **node = util_hash_find_node(hash, akey);
    if (*node != hash->data.e) {
@@ -356,13 +356,14 @@ void * util_hash_take(struct util_hash *hash,
    return 0;
 }
 
-struct util_hash_iter util_hash_first_node(struct util_hash *hash)
+drm_private struct util_hash_iter util_hash_first_node(struct util_hash *hash)
 {
    struct util_hash_iter iter = {hash, util_data_first_node(hash->data.d)};
    return iter;
 }
 
-struct util_hash_iter util_hash_erase(struct util_hash *hash, struct util_hash_iter iter)
+drm_private struct util_hash_iter
+util_hash_erase(struct util_hash *hash, struct util_hash_iter iter)
 {
    struct util_hash_iter ret = iter;
    struct util_node *node = iter.node;
amdgpu/util_hash.h +21 -13
index 8e0f9a2..01a4779 100644
@@ -44,8 +44,14 @@
 #ifndef UTIL_HASH_H
 #define UTIL_HASH_H
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <stdbool.h>
 
+#include "libdrm_macros.h"
+
 struct util_hash;
 struct util_node;
 
@@ -55,8 +61,8 @@ struct util_hash_iter {
 };
 
 
-struct util_hash *util_hash_create(void);
-void util_hash_delete(struct util_hash *hash);
+drm_private struct util_hash *util_hash_create(void);
+drm_private void util_hash_delete(struct util_hash *hash);
 
 
 /**
@@ -65,8 +71,8 @@ void util_hash_delete(struct util_hash *hash);
  * in the collision list.
  * Function returns iterator pointing to the inserted item in the hash.
  */
-struct util_hash_iter util_hash_insert(struct util_hash *hash, unsigned key,
-				       void *data);
+drm_private struct util_hash_iter
+util_hash_insert(struct util_hash *hash, unsigned key, void *data);
 
 /**
  * Removes the item pointed to by the current iterator from the hash.
@@ -75,25 +81,27 @@ struct util_hash_iter util_hash_insert(struct util_hash *hash, unsigned key,
  * Function returns iterator pointing to the item after the removed one in
  * the hash.
  */
-struct util_hash_iter util_hash_erase(struct util_hash *hash,
-				      struct util_hash_iter iter);
+drm_private struct util_hash_iter
+util_hash_erase(struct util_hash *hash, struct util_hash_iter iter);
 
-void *util_hash_take(struct util_hash *hash, unsigned key);
+drm_private void *util_hash_take(struct util_hash *hash, unsigned key);
 
 
-struct util_hash_iter util_hash_first_node(struct util_hash *hash);
+drm_private struct util_hash_iter util_hash_first_node(struct util_hash *hash);
 
 /**
  * Return an iterator pointing to the first entry in the collision list.
  */
-struct util_hash_iter util_hash_find(struct util_hash *hash, unsigned key);
+drm_private struct util_hash_iter
+util_hash_find(struct util_hash *hash, unsigned key);
 
 
-int util_hash_iter_is_null(struct util_hash_iter iter);
-unsigned util_hash_iter_key(struct util_hash_iter iter);
-void *util_hash_iter_data(struct util_hash_iter iter);
+drm_private int util_hash_iter_is_null(struct util_hash_iter iter);
+drm_private unsigned util_hash_iter_key(struct util_hash_iter iter);
+drm_private void *util_hash_iter_data(struct util_hash_iter iter);
 
 
-struct util_hash_iter util_hash_iter_next(struct util_hash_iter iter);
+drm_private struct util_hash_iter
+util_hash_iter_next(struct util_hash_iter iter);
 
 #endif
Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw

PATCH 3/9 amdgpu/util_hash_table: hide private symbols from global namespace

In reply to Emil Velikov
---
 amdgpu/util_hash_table.c | 18 ++++++++++--------
 amdgpu/util_hash_table.h | 24 ++++++++++++++++--------
 2 files changed, 26 insertions(+), 16 deletions(-)
amdgpu/util_hash_table.c +10 -8
index cb7213c..ce6f1d5 100644
@@ -69,8 +69,9 @@ util_hash_table_item(struct util_hash_iter iter)
 	return (struct util_hash_table_item *)util_hash_iter_data(iter);
 }
 
-struct util_hash_table *util_hash_table_create(unsigned (*hash)(void *key),
-				int (*compare)(void *key1, void *key2))
+drm_private struct util_hash_table *
+util_hash_table_create(unsigned (*hash)(void *key),
+		       int (*compare)(void *key1, void *key2))
 {
 	struct util_hash_table *ht;
 
@@ -126,7 +127,8 @@ util_hash_table_find_item(struct util_hash_table *ht,
 	return NULL;
 }
 
-void util_hash_table_set(struct util_hash_table *ht, void *key, void *value)
+drm_private void
+util_hash_table_set(struct util_hash_table *ht, void *key, void *value)
 {
 	unsigned key_hash;
 	struct util_hash_table_item *item;
@@ -159,7 +161,7 @@ void util_hash_table_set(struct util_hash_table *ht, void *key, void *value)
 	}
 }
 
-void *util_hash_table_get(struct util_hash_table *ht, void *key)
+drm_private void *util_hash_table_get(struct util_hash_table *ht, void *key)
 {
 	unsigned key_hash;
 	struct util_hash_table_item *item;
@@ -177,7 +179,7 @@ void *util_hash_table_get(struct util_hash_table *ht, void *key)
 	return item->value;
 }
 
-void util_hash_table_remove(struct util_hash_table *ht, void *key)
+drm_private void util_hash_table_remove(struct util_hash_table *ht, void *key)
 {
 	unsigned key_hash;
 	struct util_hash_iter iter;
@@ -200,7 +202,7 @@ void util_hash_table_remove(struct util_hash_table *ht, void *key)
 	util_hash_erase(ht->head, iter);
 }
 
-void util_hash_table_clear(struct util_hash_table *ht)
+drm_private void util_hash_table_clear(struct util_hash_table *ht)
 {
 	struct util_hash_iter iter;
 	struct util_hash_table_item *item;
@@ -217,7 +219,7 @@ void util_hash_table_clear(struct util_hash_table *ht)
 	}
 }
 
-void util_hash_table_foreach(struct util_hash_table *ht,
+drm_private void util_hash_table_foreach(struct util_hash_table *ht,
 			void (*callback)(void *key, void *value, void *data),
 			void *data)
 {
@@ -236,7 +238,7 @@ void util_hash_table_foreach(struct util_hash_table *ht,
 	}
 }
 
-void util_hash_table_destroy(struct util_hash_table *ht)
+drm_private void util_hash_table_destroy(struct util_hash_table *ht)
 {
 	struct util_hash_iter iter;
 	struct util_hash_table_item *item;
amdgpu/util_hash_table.h +16 -8
index 04fe704..e000128 100644
@@ -34,6 +34,12 @@
 #ifndef U_HASH_TABLE_H_
 #define U_HASH_TABLE_H_
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "libdrm_macros.h"
+
 /**
  * Generic purpose hash table.
  */
@@ -45,21 +51,23 @@ struct util_hash_table;
  * @param hash hash function
  * @param compare should return 0 for two equal keys.
  */
-struct util_hash_table *util_hash_table_create(unsigned (*hash)(void *key),
-				int (*compare)(void *key1, void *key2));
+drm_private struct util_hash_table *
+util_hash_table_create(unsigned (*hash)(void *key),
+		       int (*compare)(void *key1, void *key2));
 
-void util_hash_table_set(struct util_hash_table *ht, void *key, void *value);
+drm_private void
+util_hash_table_set(struct util_hash_table *ht, void *key, void *value);
 
-void *util_hash_table_get(struct util_hash_table *ht, void *key);
+drm_private void *util_hash_table_get(struct util_hash_table *ht, void *key);
 
-void util_hash_table_remove(struct util_hash_table *ht, void *key);
+drm_private void util_hash_table_remove(struct util_hash_table *ht, void *key);
 
-void util_hash_table_clear(struct util_hash_table *ht);
+drm_private void util_hash_table_clear(struct util_hash_table *ht);
 
-void util_hash_table_foreach(struct util_hash_table *ht,
+drm_private void util_hash_table_foreach(struct util_hash_table *ht,
 			void (*callback)(void *key, void *value, void *data),
 			void *data);
 
-void util_hash_table_destroy(struct util_hash_table *ht);
+drm_private void util_hash_table_destroy(struct util_hash_table *ht);
 
 #endif /* U_HASH_TABLE_H_ */
Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

PATCH 4/9 amdgpu: add a bunch of missing config.h includes

In reply to Emil Velikov
---
 amdgpu/amdgpu_cs.c       | 5 +++++
 amdgpu/amdgpu_device.c   | 4 ++++
 amdgpu/amdgpu_gpu_info.c | 4 ++++
 amdgpu/amdgpu_vamgr.c    | 4 ++++
 amdgpu/util_hash.c       | 4 ++++
 amdgpu/util_hash_table.c | 3 +++
 6 files changed, 24 insertions(+)
amdgpu/amdgpu_cs.c +5 -0
index 4ec1941..6caf7ff 100644
@@ -20,6 +20,11 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  *
 */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
amdgpu/amdgpu_device.c +4 -0
index 5f21b32..c21bb74 100644
@@ -29,6 +29,10 @@
  *
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <sys/stat.h>
 #include <errno.h>
 #include <string.h>
amdgpu/amdgpu_gpu_info.c +4 -0
index 16a463e..5994e75 100644
@@ -21,6 +21,10 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <errno.h>
 #include <string.h>
 
amdgpu/amdgpu_vamgr.c +4 -0
index ced4f4f..dd0b420 100644
@@ -21,6 +21,10 @@
  *
 */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
amdgpu/util_hash.c +4 -0
index 7e59041..87cb671 100644
@@ -30,6 +30,10 @@
   *   Zack Rusin <[email protected]>
   */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include "util_hash.h"
 
 #include <stdlib.h>
amdgpu/util_hash_table.c +3 -0
index ce6f1d5..fa7f6ea 100644
@@ -38,6 +38,9 @@
  */
 
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
 #include "util_hash_table.h"
 #include "util_hash.h"
Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#5 lore raw

PATCH 5/9 amdgpu: cosmetic chances in license boilerplate

In reply to Emil Velikov
---
 amdgpu/amdgpu.h          | 2 +-
 amdgpu/amdgpu_bo.c       | 1 +
 amdgpu/amdgpu_cs.c       | 2 +-
 amdgpu/amdgpu_device.c   | 3 +--
 amdgpu/amdgpu_gpu_info.c | 1 +
 amdgpu/amdgpu_internal.h | 1 +
 amdgpu/amdgpu_vamgr.c    | 2 +-
 7 files changed, 7 insertions(+), 5 deletions(-)
amdgpu/amdgpu.h +1 -1
index a90c1ac..b0c22d4 100644
@@ -19,7 +19,7 @@
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
  *
-*/
+ */
 
 /**
  * \file amdgpu.h
amdgpu/amdgpu_bo.c +1 -0
index a17bd0f..aacb42c 100644
@@ -19,6 +19,7 @@
  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
+ *
  */
 
 #ifdef HAVE_CONFIG_H
amdgpu/amdgpu_cs.c +1 -1
index 6caf7ff..fd28bd9 100644
@@ -19,7 +19,7 @@
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
  *
-*/
+ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
amdgpu/amdgpu_device.c +1 -2
index c21bb74..bf941c1 100644
@@ -19,14 +19,13 @@
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
  *
-*/
+ */
 
 /**
  * \file amdgpu_device.c
  *
  *  Implementation of functions for AMD GPU device
  *
- *
  */
 
 #ifdef HAVE_CONFIG_H
amdgpu/amdgpu_gpu_info.c +1 -0
index 5994e75..0970769 100644
@@ -19,6 +19,7 @@
  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
+ *
  */
 
 #ifdef HAVE_CONFIG_H
amdgpu/amdgpu_internal.h +1 -0
index 526a93f..ab01bb5 100644
@@ -19,6 +19,7 @@
  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
+ *
  */
 
 #ifndef _AMDGPU_INTERNAL_H_
amdgpu/amdgpu_vamgr.c +1 -1
index dd0b420..e2a4c87 100644
@@ -19,7 +19,7 @@
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
  *
-*/
+ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#6 lore raw

PATCH 6/9 amdgpu: squash trivial documentation typo

In reply to Emil Velikov
---
 amdgpu/amdgpu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
amdgpu/amdgpu.h +1 -1
index b0c22d4..a3eea84 100644
@@ -709,7 +709,7 @@ int amdgpu_bo_cpu_unmap(amdgpu_bo_handle buf_handle);
 /**
  * Wait until a buffer is not used by the device.
  *
- * \param   dev           - \c [in] Device handle. See #amdgpu_lib_initialize()
+ * \param   dev           - \c [in] Device handle. See #amdgpu_device_initialize()
  * \param   buf_handle    - \c [in] Buffer handle.
  * \param   timeout_ns    - Timeout in nanoseconds.
  * \param   buffer_busy   - 0 if buffer is idle, all GPU access was completed
Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#7 lore raw

PATCH 7/9 amdgpu/amdgpu_vamgr: hide private symbols from global namespace

In reply to Emil Velikov
---
 amdgpu/amdgpu_internal.h | 18 ++++++++++++------
 amdgpu/amdgpu_vamgr.c    | 17 ++++++++++-------
 2 files changed, 22 insertions(+), 13 deletions(-)
amdgpu/amdgpu_internal.h +12 -6
index ab01bb5..7f86da9 100644
@@ -31,6 +31,8 @@
 
 #include <assert.h>
 #include <pthread.h>
+
+#include "libdrm_macros.h"
 #include "xf86atomic.h"
 #include "amdgpu.h"
 #include "util_double_list.h"
@@ -121,15 +123,19 @@ void amdgpu_device_free_internal(amdgpu_device_handle dev);
 
 void amdgpu_bo_free_internal(amdgpu_bo_handle bo);
 
-struct amdgpu_bo_va_mgr* amdgpu_vamgr_get_global(struct amdgpu_device *dev);
+drm_private struct amdgpu_bo_va_mgr*
+amdgpu_vamgr_get_global(struct amdgpu_device *dev);
 
-void amdgpu_vamgr_reference(struct amdgpu_bo_va_mgr **dst, struct amdgpu_bo_va_mgr *src);
+drm_private void
+amdgpu_vamgr_reference(struct amdgpu_bo_va_mgr **dst,
+		       struct amdgpu_bo_va_mgr *src);
 
-uint64_t amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size,
-				uint64_t alignment, uint64_t base_required);
+drm_private uint64_t
+amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size,
+		     uint64_t alignment, uint64_t base_required);
 
-void amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr *mgr, uint64_t va, 
-				uint64_t size);
+drm_private void
+amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr *mgr, uint64_t va, uint64_t size);
 
 int amdgpu_query_gpu_info_init(amdgpu_device_handle dev);
 
amdgpu/amdgpu_vamgr.c +10 -7
index e2a4c87..b5d330f 100644
@@ -66,7 +66,8 @@ static void amdgpu_vamgr_deinit(struct amdgpu_bo_va_mgr *mgr)
 	pthread_mutex_destroy(&mgr->bo_va_mutex);
 }
 
-struct amdgpu_bo_va_mgr * amdgpu_vamgr_get_global(struct amdgpu_device *dev)
+drm_private struct amdgpu_bo_va_mgr *
+amdgpu_vamgr_get_global(struct amdgpu_device *dev)
 {
 	int ref;
 	ref = atomic_inc_return(&vamgr.refcount);
@@ -76,16 +77,18 @@ struct amdgpu_bo_va_mgr * amdgpu_vamgr_get_global(struct amdgpu_device *dev)
 	return &vamgr;
 }
 
-void amdgpu_vamgr_reference(struct amdgpu_bo_va_mgr **dst,
-				struct amdgpu_bo_va_mgr *src)
+drm_private void
+amdgpu_vamgr_reference(struct amdgpu_bo_va_mgr **dst,
+		       struct amdgpu_bo_va_mgr *src)
 {
 	if (update_references(&(*dst)->refcount, NULL))
 		amdgpu_vamgr_deinit(*dst);
 	*dst = src;
 }
 
-uint64_t amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size,
-				uint64_t alignment, uint64_t base_required)
+drm_private uint64_t
+amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size,
+		     uint64_t alignment, uint64_t base_required)
 {
 	struct amdgpu_bo_va_hole *hole, *n;
 	uint64_t offset = 0, waste = 0;
@@ -170,8 +173,8 @@ uint64_t amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size,
 	return offset;
 }
 
-void amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr *mgr,
-				uint64_t va, uint64_t size)
+drm_private void
+amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr *mgr, uint64_t va, uint64_t size)
 {
 	struct amdgpu_bo_va_hole *hole;
 
Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#8 lore raw

PATCH 8/9 amdgpu: hide the final internal functions from global namespace

In reply to Emil Velikov

Thus the only symbols that we export are the ones officially provided by the API.

---
 amdgpu/amdgpu_bo.c       |  2 +-
 amdgpu/amdgpu_cs.c       |  2 +-
 amdgpu/amdgpu_device.c   | 58 ++++++++++++++++++++++++++++++------------------
 amdgpu/amdgpu_gpu_info.c |  2 +-
 amdgpu/amdgpu_internal.h | 24 +++-----------------
 5 files changed, 42 insertions(+), 46 deletions(-)
amdgpu/amdgpu_bo.c +1 -1
index aacb42c..7607f2c 100644
@@ -53,7 +53,7 @@ static void amdgpu_close_kms_handle(amdgpu_device_handle dev,
 	drmIoctl(dev->fd, DRM_IOCTL_GEM_CLOSE, &args);
 }
 
-void amdgpu_bo_free_internal(amdgpu_bo_handle bo)
+drm_private void amdgpu_bo_free_internal(amdgpu_bo_handle bo)
 {
 	/* Remove the buffer from the hash tables. */
 	pthread_mutex_lock(&bo->dev->bo_table_mutex);
amdgpu/amdgpu_cs.c +1 -1
index fd28bd9..ea35326 100644
@@ -290,7 +290,7 @@ int amdgpu_cs_submit(amdgpu_context_handle context,
  *
  * \return  absolute timeout in nanoseconds
 */
-uint64_t amdgpu_cs_calculate_timeout(uint64_t timeout)
+drm_private uint64_t amdgpu_cs_calculate_timeout(uint64_t timeout)
 {
 	int r;
 
amdgpu/amdgpu_device.c +36 -22

78 lines not on this page · raw message

amdgpu/amdgpu_gpu_info.c +1 -1
index 0970769..0cc17f1 100644
@@ -140,7 +140,7 @@ int amdgpu_query_firmware_version(amdgpu_device_handle dev, unsigned fw_type,
 	return 0;
 }
 
-int amdgpu_query_gpu_info_init(amdgpu_device_handle dev)
+drm_private int amdgpu_query_gpu_info_init(amdgpu_device_handle dev)
 {
 	int r, i;
 
amdgpu/amdgpu_internal.h +3 -21
index 7f86da9..4b07aff 100644
@@ -119,9 +119,7 @@ struct amdgpu_context {
  * Functions.
  */
 
-void amdgpu_device_free_internal(amdgpu_device_handle dev);
-
-void amdgpu_bo_free_internal(amdgpu_bo_handle bo);
+drm_private void amdgpu_bo_free_internal(amdgpu_bo_handle bo);
 
 drm_private struct amdgpu_bo_va_mgr*
 amdgpu_vamgr_get_global(struct amdgpu_device *dev);
@@ -137,9 +135,9 @@ amdgpu_vamgr_find_va(struct amdgpu_bo_va_mgr *mgr, uint64_t size,
 drm_private void
 amdgpu_vamgr_free_va(struct amdgpu_bo_va_mgr *mgr, uint64_t va, uint64_t size);
 
-int amdgpu_query_gpu_info_init(amdgpu_device_handle dev);
+drm_private int amdgpu_query_gpu_info_init(amdgpu_device_handle dev);
 
-uint64_t amdgpu_cs_calculate_timeout(uint64_t timeout);
+drm_private uint64_t amdgpu_cs_calculate_timeout(uint64_t timeout);
 
 /**
  * Inline functions.
@@ -189,20 +187,4 @@ static inline void amdgpu_bo_reference(struct amdgpu_bo **dst,
 	*dst = src;
 }
 
-/**
- * Assignment between two amdgpu_device pointers with reference counting.
- *
- * Usage:
- *    struct amdgpu_device *dst = ... , *src = ...;
- *
- *    dst = src;
- *    // No reference counting. Only use this when you need to move
- *    // a reference from one pointer to another.
- *
- *    amdgpu_device_reference(&dst, src);
- *    // Reference counters are updated. dst is decremented and src is
- *    // incremented. dst is freed if its reference counter is 0.
- */
-void amdgpu_device_reference(struct amdgpu_device **dst,
-			     struct amdgpu_device *src);
 #endif
Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#9 lore raw

PATCH 9/9 amdgpu: add symbols check test

In reply to Emil Velikov
---
 amdgpu/Makefile.am         |  3 +++
 amdgpu/amdgpu-symbol-check | 51 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+)
 create mode 100755 amdgpu/amdgpu-symbol-check
amdgpu/Makefile.am +3 -0
index 82e78c7..ed97803 100644
@@ -52,3 +52,6 @@ libdrm_amdgpuinclude_HEADERS = \
 
 pkgconfigdir = @pkgconfigdir@
 pkgconfig_DATA = libdrm_amdgpu.pc
+
+TESTS = amdgpu-symbol-check
+EXTRA_DIST = $(TESTS)
amdgpu/amdgpu-symbol-check new file +51 -0

51 lines not on this page · raw message

Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#10 lore raw
In reply to Emil Velikov

For this series Reviewed-by: Christian König <[email protected]>

Thanks for taking care of this,
Christian.

Quoted 7 lines · Emil Velikov

Now that the API is stabilised we can do a bit of a cleanup, and ensure only the symbols part of it are exported - 62 -> 34.

This also gives us some ~10% is size reduction of the final binary.

Android support would be nice, but it's not a show stopper :)

Quoted 7 lines

Please review,
Emil

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

Reviewed-by
#11 lore raw
Quoted 4 lines · Christian König

For this series Reviewed-by: Christian König <[email protected]>

Thanks for taking care of this,
Christian.

Yes, thanks! For the series:

Quoted 20 lines · Emil Velikov
Quoted 8 lines

Now that the API is stabilised we can do a bit of a cleanup, and ensure only the symbols part of it are exported - 62 -> 34.

This also gives us some ~10% is size reduction of the final binary.

Android support would be nice, but it's not a show stopper :)

Quoted 7 lines

Please review,
Emil

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#12 lore raw
In reply to Emil Velikov

The series are Reviewed-by: Jammy Zhou <[email protected]>

And I will rebase my pending patches on top of this series. Thanks.

Regards,
Jammy

-----Original Message-----
From: dri-devel [mailto:[email protected]] On Behalf Of Emil Velikov
Sent: Saturday, August 08, 2015 12:45 AM
To: [email protected]
Cc: Deucher, Alexander
Subject: [PATCH libdrm 0/9] amdgpu: cleanup the exported symbols

Now that the API is stabilised we can do a bit of a cleanup, and ensure only the symbols part of it are exported - 62 -> 34.

This also gives us some ~10% is size reduction of the final binary.

Android support would be nice, but it's not a show stopper :)

Please review,
Emil

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#13 lore raw
In reply to Emil Velikov
Quoted 7 lines · Emil Velikov

Now that the API is stabilised we can do a bit of a cleanup, and ensure only the symbols part of it are exported - 62 -> 34.

This also gives us some ~10% is size reduction of the final binary.

Android support would be nice, but it's not a show stopper :)

Thanks for the review guys.

I gave it a final quick test and pushed to master.

-Emil
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel