diff options
| author | Christian König <christian.koenig@amd.com> | 2018-11-29 10:25:10 -0500 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2018-11-30 12:00:57 -0500 |
| commit | 082f0f21f71c522491a0cac4895b32bbab1b1006 (patch) | |
| tree | 7525ddd4c305a97aa13e0f3b2ba4b1d752b5ef51 /drivers | |
| parent | fb6e4709e32ce2c8eae2ca03d2175c3c24adbc54 (diff) | |
drm/ttm: fix LRU handling in ttm_buffer_object_transfer
We need to set the NO_EVICT flag on the ghost object or otherwise we are
adding it to the LRU.
When it is added to the LRU we can run into a race between destroying
and evicting it again.
Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo_util.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index ba80150d1052..895d77d799e4 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c | |||
| @@ -492,8 +492,10 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, | |||
| 492 | if (!fbo) | 492 | if (!fbo) |
| 493 | return -ENOMEM; | 493 | return -ENOMEM; |
| 494 | 494 | ||
| 495 | ttm_bo_get(bo); | ||
| 496 | fbo->base = *bo; | 495 | fbo->base = *bo; |
| 496 | fbo->base.mem.placement |= TTM_PL_FLAG_NO_EVICT; | ||
| 497 | |||
| 498 | ttm_bo_get(bo); | ||
| 497 | fbo->bo = bo; | 499 | fbo->bo = bo; |
| 498 | 500 | ||
| 499 | /** | 501 | /** |
