mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2026-05-09 09:48:05 +02:00
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 <robclark@freedesktop.org>
This commit is contained in:
parent
00847fa48b
commit
5306078bbe
1 changed files with 7 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue