summaryrefslogtreecommitdiff
path: root/freedreno
diff options
context:
space:
mode:
authorVarad Gautam <varadgautam@gmail.com>2015-08-21 22:14:33 +0530
committerRob Clark <robclark@freedesktop.org>2015-08-23 12:33:09 -0400
commit857c22e5ecf016bcd15508fec6e6d435bf69b58d (patch)
tree2e9a5311b4ade95a037189cc66c5fe61c7cf7967 /freedreno
parentcf40cf05a4d7f3945d534790e7768a048adc3ab0 (diff)
downloadlibdrm-857c22e5ecf016bcd15508fec6e6d435bf69b58d.tar.gz
libdrm-857c22e5ecf016bcd15508fec6e6d435bf69b58d.tar.bz2
libdrm-857c22e5ecf016bcd15508fec6e6d435bf69b58d.zip
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>
Diffstat (limited to 'freedreno')
-rw-r--r--freedreno/freedreno_bo.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/freedreno/freedreno_bo.c b/freedreno/freedreno_bo.c
index eec218c6..972ee17d 100644
--- a/freedreno/freedreno_bo.c
+++ b/freedreno/freedreno_bo.c
@@ -52,6 +52,9 @@ static struct fd_bo * lookup_bo(void *tbl, uint32_t key)
if (!drmHashLookup(tbl, key, (void **)&bo)) {
/* found, incr refcnt and return: */
bo = fd_bo_ref(bo);
+
+ /* don't break the bucket if this bo was found in one */
+ list_delinit(&bo->list);
}
return bo;
}