Skip to content

Commit

Permalink
drm/ttm: never consider pinned BOs for eviction&swap
Browse files Browse the repository at this point in the history
There is a small window where we have already incremented the pin count
but not yet moved the bo from the lru to the pinned list.

Signed-off-by: Christian König <[email protected]>
Reported-by: Pelloux-Prayer, Pierre-Eric <[email protected]>
Tested-by: Pelloux-Prayer, Pierre-Eric <[email protected]>
Acked-by: Alex Deucher <[email protected]>
Cc: [email protected]
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
ChristianKoenigAMD committed Jul 10, 2023
1 parent 1500805 commit a2848d0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/gpu/drm/ttm/ttm_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,12 @@ static bool ttm_bo_evict_swapout_allowable(struct ttm_buffer_object *bo,
{
bool ret = false;

if (bo->pin_count) {
*locked = false;
*busy = false;
return false;
}

if (bo->base.resv == ctx->resv) {
dma_resv_assert_held(bo->base.resv);
if (ctx->allow_res_evict)
Expand Down

0 comments on commit a2848d0

Please sign in to comment.