v3dv: fix BO allocation
`cleared_and_retried` variable is not required, as once the cache is
empty, in the second retry it will retry it is already empty so it won't
retry a new allocation.
Fixes: 2adea940f1 ("v3dv/bo: adding a BO cache")
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32593>
This commit is contained in:
committed by
Marge Bot
parent
cb9650d1a2
commit
f6766ccadb
@@ -238,20 +238,16 @@ v3dv_bo_alloc(struct v3dv_device *device,
|
||||
}
|
||||
}
|
||||
|
||||
retry:
|
||||
;
|
||||
|
||||
bool cleared_and_retried = false;
|
||||
struct drm_v3d_create_bo create = {
|
||||
.size = size
|
||||
};
|
||||
|
||||
int ret = v3d_ioctl(device->pdevice->render_fd,
|
||||
DRM_IOCTL_V3D_CREATE_BO, &create);
|
||||
int ret;
|
||||
retry:
|
||||
ret = v3d_ioctl(device->pdevice->render_fd,
|
||||
DRM_IOCTL_V3D_CREATE_BO, &create);
|
||||
if (ret != 0) {
|
||||
if (!list_is_empty(&device->bo_cache.time_list) &&
|
||||
!cleared_and_retried) {
|
||||
cleared_and_retried = true;
|
||||
if (!list_is_empty(&device->bo_cache.time_list)) {
|
||||
bo_cache_free_all(device, true);
|
||||
goto retry;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user