/* set buffer name, and add to table, call w/ etna_drm_table_lock held: */
static void set_name(struct etna_bo *bo, uint32_t name)
{
+ simple_mtx_assert_locked(&etna_drm_table_lock);
+
bo->name = name;
/* add ourself into the name table: */
_mesa_hash_table_insert(bo->dev->name_table, &bo->name, bo);
{
VG_BO_FREE(bo);
+ simple_mtx_assert_locked(&etna_drm_table_lock);
+
if (bo->va)
util_vma_heap_free(&bo->dev->address_space, bo->va, bo->size);
static struct etna_bo *lookup_bo(void *tbl, uint32_t handle)
{
struct etna_bo *bo = NULL;
- struct hash_entry *entry = _mesa_hash_table_search(tbl, &handle);
+ struct hash_entry *entry;
+
+ simple_mtx_assert_locked(&etna_drm_table_lock);
+
+ entry = _mesa_hash_table_search(tbl, &handle);
if (entry) {
/* found, incr refcnt and return: */
{
struct etna_bo *bo = calloc(sizeof(*bo), 1);
+ simple_mtx_assert_locked(&etna_drm_table_lock);
+
if (!bo) {
struct drm_gem_close req = {
.handle = handle,
int etna_bo_cache_free(struct etna_bo_cache *cache, struct etna_bo *bo)
{
- struct etna_bo_bucket *bucket = get_bucket(cache, bo->size);
+ struct etna_bo_bucket *bucket;
+
+ simple_mtx_assert_locked(&etna_drm_table_lock);
+
+ bucket = get_bucket(cache, bo->size);
/* see if we can be green and recycle: */
if (bucket) {