asahi: fix zero bo leak
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34486>
This commit is contained in:
committed by
Marge Bot
parent
546bc893f1
commit
fb71b8a4ee
@@ -670,6 +670,8 @@ agx_open_device(void *memctx, struct agx_device *dev)
|
||||
fprintf(stderr, "Failed to bind zero page");
|
||||
return false;
|
||||
}
|
||||
|
||||
dev->zero_bo = bo;
|
||||
}
|
||||
|
||||
void *bo = agx_bo_create(dev, LIBAGX_PRINTF_BUFFER_SIZE, 0, AGX_BO_WRITEBACK,
|
||||
@@ -691,6 +693,7 @@ void
|
||||
agx_close_device(struct agx_device *dev)
|
||||
{
|
||||
agx_bo_unreference(dev, dev->printf.bo);
|
||||
agx_bo_unreference(dev, dev->zero_bo);
|
||||
u_printf_destroy(&dev->printf);
|
||||
agx_bo_cache_evict_all(dev);
|
||||
util_sparse_array_finish(&dev->bo_map);
|
||||
|
||||
@@ -133,6 +133,8 @@ struct agx_device {
|
||||
*/
|
||||
uint64_t sparse_ro_offset;
|
||||
|
||||
struct agx_bo *zero_bo;
|
||||
|
||||
struct renderonly *ro;
|
||||
|
||||
pthread_mutex_t bo_map_lock;
|
||||
|
||||
Reference in New Issue
Block a user