summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ttm
diff options
context:
space:
mode:
authorChristian König2018-11-29 16:25:10 +0100
committerGreg Kroah-Hartman2018-12-21 14:15:15 +0100
commit546486c5b196423d7a2109583ae4c516954b2932 (patch)
treee637995687136c23b0456a528848bf7389613cd0 /drivers/gpu/drm/ttm
parentdrm/msm: Grab a vblank reference when waiting for commit_done (diff)
downloadkernel-qcow2-linux-546486c5b196423d7a2109583ae4c516954b2932.tar.gz
kernel-qcow2-linux-546486c5b196423d7a2109583ae4c516954b2932.tar.xz
kernel-qcow2-linux-546486c5b196423d7a2109583ae4c516954b2932.zip
drm/ttm: fix LRU handling in ttm_buffer_object_transfer
[ Upstream commit d6e820fcd4cf08b11d291a1dd7bbd0636914647c ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/gpu/drm/ttm')
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo_util.c4
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 046a6dda690a..40904e84f883 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,
if (!fbo)
return -ENOMEM;
- ttm_bo_get(bo);
fbo->base = *bo;
+ fbo->base.mem.placement |= TTM_PL_FLAG_NO_EVICT;
+
+ ttm_bo_get(bo);
fbo->bo = bo;
/**