From: Christian König Date: Mon, 11 Nov 2019 12:44:40 +0000 (+0100) Subject: drm/ttm: refine ghost BO resv criteria X-Git-Tag: Ubuntu-5.13.0-19.19~6365^2~19^2~87 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=5b34406f5484e5f2adf86e43c89aa5f778a9c200;p=mirror_ubuntu-jammy-kernel.git drm/ttm: refine ghost BO resv criteria Ghost BOs need to stick with the resv object only when the origin is imported. This is a low hanging fruit to avoid OOM situations on evictions. Signed-off-by: Christian König Reviewed-by: xinhui pan Link: https://patchwork.freedesktop.org/patch/352740/ --- diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index 2b0e5a088da0..86d152472f38 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c @@ -511,7 +511,7 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, kref_init(&fbo->base.kref); fbo->base.destroy = &ttm_transfered_destroy; fbo->base.acc_size = 0; - if (bo->base.resv == &bo->base._resv) + if (bo->type != ttm_bo_type_sg) fbo->base.base.resv = &fbo->base.base._resv; dma_resv_init(&fbo->base.base._resv);