#include "etnaviv_priv.h"
#include "etnaviv_drmif.h"
-drm_private void bo_del(struct etna_bo *bo);
-drm_private extern pthread_mutex_t table_lock;
+void _etna_bo_del(struct etna_bo *bo);
+extern pthread_mutex_t etna_drm_table_lock;
static void add_bucket(struct etna_bo_cache *cache, int size)
{
cache->num_buckets++;
}
-drm_private void etna_bo_cache_init(struct etna_bo_cache *cache)
+void etna_bo_cache_init(struct etna_bo_cache *cache)
{
unsigned long size, cache_max_size = 64 * 1024 * 1024;
}
}
-/* Frees older cached buffers. Called under table_lock */
-drm_private void etna_bo_cache_cleanup(struct etna_bo_cache *cache, time_t time)
+/* Frees older cached buffers. Called under etna_drm_table_lock */
+void etna_bo_cache_cleanup(struct etna_bo_cache *cache, time_t time)
{
unsigned i;
break;
list_del(&bo->list);
- bo_del(bo);
+ _etna_bo_del(bo);
}
}
{
struct etna_bo *bo = NULL, *tmp;
- pthread_mutex_lock(&table_lock);
+ pthread_mutex_lock(&etna_drm_table_lock);
if (LIST_IS_EMPTY(&bucket->list))
goto out_unlock;
bo = NULL;
out_unlock:
- pthread_mutex_unlock(&table_lock);
+ pthread_mutex_unlock(&etna_drm_table_lock);
return bo;
}
*
* NOTE: size is potentially rounded up to bucket size
*/
-drm_private struct etna_bo *etna_bo_cache_alloc(struct etna_bo_cache *cache, uint32_t *size,
+struct etna_bo *etna_bo_cache_alloc(struct etna_bo_cache *cache, uint32_t *size,
uint32_t flags)
{
struct etna_bo *bo;
*size = bucket->size;
bo = find_in_bucket(bucket, flags);
if (bo) {
- atomic_set(&bo->refcnt, 1);
+ p_atomic_set(&bo->refcnt, 1);
etna_device_ref(bo->dev);
return bo;
}
return NULL;
}
-drm_private int etna_bo_cache_free(struct etna_bo_cache *cache, struct etna_bo *bo)
+int etna_bo_cache_free(struct etna_bo_cache *cache, struct etna_bo *bo)
{
struct etna_bo_bucket *bucket = get_bucket(cache, bo->size);