Commit 5b34406f authored by Christian König's avatar Christian König

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: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarxinhui pan <xinhui.pan@amd.com>
Link: https://patchwork.freedesktop.org/patch/352740/
parent 23575e7a
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment