summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--freedreno/freedreno_bo.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/freedreno/freedreno_bo.c b/freedreno/freedreno_bo.c
index fe8f503d..9089c931 100644
--- a/freedreno/freedreno_bo.c
+++ b/freedreno/freedreno_bo.c
@@ -207,7 +207,14 @@ fd_bo_from_handle(struct fd_device *dev, uint32_t handle, uint32_t size)
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);
+
+out_unlock:
pthread_mutex_unlock(&table_lock);
return bo;