freedreno: fix a bo cache segfault with imported bo's

Importing a bo whose handle is still in the bo cache crashes during cleanup.
Remove bo from cache when importing.

Signed-off-by: Varad Gautam <varadgautam@gmail.com>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
main
Varad Gautam 2015-08-21 22:14:33 +05:30 committed by Rob Clark
parent cf40cf05a4
commit 857c22e5ec
1 changed files with 3 additions and 0 deletions

View File

@ -52,6 +52,9 @@ static struct fd_bo * lookup_bo(void *tbl, uint32_t key)
if (!drmHashLookup(tbl, key, (void **)&bo)) { if (!drmHashLookup(tbl, key, (void **)&bo)) {
/* found, incr refcnt and return: */ /* found, incr refcnt and return: */
bo = fd_bo_ref(bo); bo = fd_bo_ref(bo);
/* don't break the bucket if this bo was found in one */
list_delinit(&bo->list);
} }
return bo; return bo;
} }