Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1738677 > unrolled thread

[PATCH review for 4.9 27/50] drm/amdgpu: refuse to reserve io mem for split VRAM buffers

Started by"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
First post2017-09-25 03:30 +0200
Last post2017-09-25 03:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH review for 4.9 27/50] drm/amdgpu: refuse to reserve io mem for  split VRAM buffers "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-09-25 03:30 +0200

#1738677 — [PATCH review for 4.9 27/50] drm/amdgpu: refuse to reserve io mem for split VRAM buffers

From"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Date2017-09-25 03:30 +0200
Subject[PATCH review for 4.9 27/50] drm/amdgpu: refuse to reserve io mem for split VRAM buffers
Message-ID<utqnG-7J5-73@gated-at.bofh.it>
From: Nicolai Hähnle <nicolai.haehnle@amd.com>

[ Upstream commit 4694335dad7357e9b3d7822ab13049014d74d8b0 ]

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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 264899df9bfc..05ff98b43c50 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -491,6 +491,9 @@ static int amdgpu_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_
 	case TTM_PL_TT:
 		break;
 	case TTM_PL_VRAM:
+		if (mem->start == AMDGPU_BO_INVALID_OFFSET)
+			return -EINVAL;
+
 		mem->bus.offset = mem->start << PAGE_SHIFT;
 		/* check if it's visible */
 		if ((mem->bus.offset + mem->bus.size) > adev->mc.visible_vram_size)
-- 
2.11.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web