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
parent
cf40cf05a4
commit
857c22e5ec
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue