We also need to check handle_table in the _from_handle() path and the
_from_dmabuf() (which goes through _from_handle()) to avoid duplicate
imports.
Signed-off-by: Rob Clark <robclark@freedesktop.org>
struct fd_bo *bo = NULL;
pthread_mutex_lock(&table_lock);
struct fd_bo *bo = NULL;
pthread_mutex_lock(&table_lock);
+
+ bo = lookup_bo(dev->handle_table, handle);
+ if (bo)
+ goto out_unlock;
+
bo = bo_from_handle(dev, size, handle);
bo = bo_from_handle(dev, size, handle);
pthread_mutex_unlock(&table_lock);
return bo;
pthread_mutex_unlock(&table_lock);
return bo;