From 5306078bbe21e05365700c186c6c8a1ae86b776c Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 22 Oct 2014 12:57:16 -0400 Subject: freedreno: do handle lookup on handle and dmabuf import 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 --- freedreno/freedreno_bo.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'freedreno') 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; -- cgit v1.2.3