Skip to content

Commit

Permalink
drm/ttm: refine ghost BO resv criteria
Browse files Browse the repository at this point in the history
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/
  • Loading branch information
Christian König committed Feb 11, 2020
1 parent 23575e7 commit 5b34406
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/ttm/ttm_bo_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5b34406

Please sign in to comment.