aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.14.71/1726-drm-amdgpu-Fix-non-contig-ptrace-VRAM-access-crossin.patch
blob: b1c7f1f1430a6b484d84b284d6a0331254d1df52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From 630266ba9d1a05288fa0d873d4b9393fd903fa3b Mon Sep 17 00:00:00 2001
From: Felix Kuehling <Felix.Kuehling@amd.com>
Date: Thu, 22 Jun 2017 15:04:01 -0400
Subject: [PATCH 1726/4131] drm/amdgpu: Fix non-contig ptrace VRAM access
 crossing nodes

Fix ptrace VRAM access when crossing non-contiguous VRAM node
boundaries.

Change-Id: I9c876145d0087a78fc17f0a76b9ac47f55a4f35b
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 4aae374..7bc3ed8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -1687,6 +1687,10 @@ static int amdgpu_ttm_bo_access_vram(struct amdgpu_bo *abo,
                 buf = (uint8_t *)buf + bytes;
                 pos += bytes;
                 len -= bytes;
+		if (pos >= (nodes->start + nodes->size) << PAGE_SHIFT) {
+			++nodes;
+			pos = (nodes->start << PAGE_SHIFT);
+		}
         }
 
         return result;
-- 
2.7.4