Although etnaviv_drmif.h declared etna_bo_from_handle from the start, there was no implementation. Signed-off-by: Philipp Zabel <p.zabel@xxxxxxxxxxxxxx> Reviewed-by: Daniel Stone <daniels@xxxxxxxxxxxxx> --- v3: drop unnecessary variable initialisation --- etnaviv/etnaviv_bo.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/etnaviv/etnaviv_bo.c b/etnaviv/etnaviv_bo.c index 4fe877f1..0cc3ab97 100644 --- a/etnaviv/etnaviv_bo.c +++ b/etnaviv/etnaviv_bo.c @@ -135,6 +135,25 @@ struct etna_bo *etna_bo_new(struct etna_device *dev, uint32_t size, return bo; } +struct etna_bo * +etna_bo_from_handle(struct etna_device *dev, uint32_t handle, uint32_t size) +{ + struct etna_bo *bo; + + pthread_mutex_lock(&table_lock); + + bo = lookup_bo(dev->handle_table, handle); + if (bo) + goto out_unlock; + + bo = bo_from_handle(dev, size, handle, 0); + +out_unlock: + pthread_mutex_unlock(&table_lock); + + return bo; +} + struct etna_bo *etna_bo_ref(struct etna_bo *bo) { atomic_inc(&bo->refcnt); -- 2.11.0 _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel