From 4a69b4809187bc1edada84d8182b83b772d9e3cb Mon Sep 17 00:00:00 2001 From: Harish Kasiviswanathan Date: Wed, 3 May 2017 15:58:50 -0400 Subject: [PATCH 1276/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 --- 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