mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 17:30:20 +01:00
etnaviv: drm: properly handle reviving BOs via a lookup
If a BO is removed from a cache bucket list via a lookup, we must
handle it in the same way as if a allocation from the cache happened:
tell valgrind that the buffer is active again and take a reference
to the etna_device, which the BO had given up while being in the
cache.
Cc: mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14159>
(cherry picked from commit 1b1f8592c0)
This commit is contained in:
parent
d33e79e575
commit
eec8afec25
2 changed files with 6 additions and 2 deletions
|
|
@ -940,7 +940,7 @@
|
|||
"description": "etnaviv: drm: properly handle reviving BOs via a lookup",
|
||||
"nominated": true,
|
||||
"nomination_type": 0,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null
|
||||
},
|
||||
|
|
|
|||
|
|
@ -86,7 +86,11 @@ static struct etna_bo *lookup_bo(void *tbl, uint32_t handle)
|
|||
bo = etna_bo_ref(entry->data);
|
||||
|
||||
/* don't break the bucket if this bo was found in one */
|
||||
list_delinit(&bo->list);
|
||||
if (list_is_linked(&bo->list)) {
|
||||
VG_BO_OBTAIN(bo);
|
||||
etna_device_ref(bo->dev);
|
||||
list_delinit(&bo->list);
|
||||
}
|
||||
}
|
||||
|
||||
return bo;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue