aboutsummaryrefslogtreecommitdiffstats
path: root/meta-v1000/recipes-kernel/linux/linux-yocto-4.14.71/1682-drm-amdkfd-Fix-CMA-bug.patch
blob: ec6324d0fb4f3653f15ed1e6c6cffe91ef35c2aa (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
From d2a2dd18b9218cee4371c14c6bbc98ba36a78a9f Mon Sep 17 00:00:00 2001
From: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Date: Wed, 3 May 2017 15:58:50 -0400
Subject: [PATCH 1682/4131] drm/amdkfd: Fix CMA bug

If source buffer is copied to multiple destination buffers, the source
offset is not changed. This resulted in same (top) part of the source
buffer repeatedly copied into different destination buffers. Fix it.

Change-Id: Ib1344a3571ae8b1b49e1cd3c11b8525b78454109
Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
index f394f05..c763103 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
@@ -2096,6 +2096,7 @@ static int kfd_ioctl_cross_memory_copy(struct file *filep,
 			space_left -= copied;
 			dst_va_addr += copied;
 			dst_offset += copied;
+			src_offset += copied;
 			if (dst_va_addr > dst_bo->it.last + 1) {
 				pr_err("Cross mem copy failed. Memory overflow\n");
 				err = -EFAULT;
-- 
2.7.4