/* lookup a buffer from it's handle, call w/ table_lock held: */ static struct etna_bo * lookup_bo(struct etna_device *dev, uint32_t handle) { struct etna_bo *bo = NULL; if (!drmHashLookup(dev->handle_table, handle, (void **)&bo)) { /* found, incr refcnt and return: */ bo = etna_bo_ref(bo); } return bo; }
static uint32_t append_bo(struct etna_cmd_stream *stream, struct etna_bo *bo) { struct etna_cmd_stream_priv *priv = etna_cmd_stream_priv(stream); uint32_t idx; idx = APPEND(&priv->submit, bos); idx = APPEND(priv, bos); priv->submit.bos[idx].flags = 0; priv->submit.bos[idx].handle = bo->handle; priv->bos[idx] = etna_bo_ref(bo); return idx; }