aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2017-02-16 17:49:12 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-02-21 17:16:28 -0500
commit4694335dad7357e9b3d7822ab13049014d74d8b0 (patch)
tree7285b01bac2477e0711af9a834e2f2ee118d61d2 /drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
parent3089c1df10e2931b1d72d2ffa7d86431084c86b3 (diff)
drm/amdgpu: refuse to reserve io mem for split VRAM buffers
When the fast blit path fails while attempting to move a buffer from RAM to VRAM, we fall back to a CPU-based memcpy that cannot handle split VRAM buffers. Instead of crashing, simply fail the buffer move. Ideally, we would teach TTM about split buffers so that the fallback still works in this case, but that is quite involved. So for now, apply the simplest possible fix. Fixes: 40361bb1704b ("drm/amdgpu: add VRAM manager v2") Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 1154b0a8881d..4c6094eefc51 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -529,6 +529,9 @@ static int amdgpu_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_
529 case TTM_PL_TT: 529 case TTM_PL_TT:
530 break; 530 break;
531 case TTM_PL_VRAM: 531 case TTM_PL_VRAM:
532 if (mem->start == AMDGPU_BO_INVALID_OFFSET)
533 return -EINVAL;
534
532 mem->bus.offset = mem->start << PAGE_SHIFT; 535 mem->bus.offset = mem->start << PAGE_SHIFT;
533 /* check if it's visible */ 536 /* check if it's visible */
534 if ((mem->bus.offset + mem->bus.size) > adev->mc.visible_vram_size) 537 if ((mem->bus.offset + mem->bus.size) > adev->mc.visible_vram_size)