]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
drm/ttm: refine ghost BO resv criteria
authorChristian König <christian.koenig@amd.com>
Mon, 11 Nov 2019 12:44:40 +0000 (13:44 +0100)
committerChristian König <christian.koenig@amd.com>
Tue, 11 Feb 2020 13:28:43 +0000 (14:28 +0100)
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 <christian.koenig@amd.com>
Reviewed-by: xinhui pan <xinhui.pan@amd.com>
Link: https://patchwork.freedesktop.org/patch/352740/
drivers/gpu/drm/ttm/ttm_bo_util.c

index 2b0e5a088da07abe639ea88f89abdf56aa52f72e..86d152472f38c64b6ff40d10bcd62cf7510b2182 100644 (file)
@@ -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);