aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3044-drm-amdgpu-Return-mmap-offset-for-private-vram.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3044-drm-amdgpu-Return-mmap-offset-for-private-vram.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3044-drm-amdgpu-Return-mmap-offset-for-private-vram.patch68
1 files changed, 68 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3044-drm-amdgpu-Return-mmap-offset-for-private-vram.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3044-drm-amdgpu-Return-mmap-offset-for-private-vram.patch
new file mode 100644
index 00000000..2fa0d5d8
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3044-drm-amdgpu-Return-mmap-offset-for-private-vram.patch
@@ -0,0 +1,68 @@
+From a559cdf328e9c5e90e50fd0ad1dc8de7d63bfaba Mon Sep 17 00:00:00 2001
+From: Oak Zeng <Oak.Zeng@amd.com>
+Date: Mon, 11 Dec 2017 15:42:52 -0500
+Subject: [PATCH 3044/4131] drm/amdgpu: Return mmap offset for private vram
+
+Previously mmap offset is not returned for private
+vram allocation, because there is no need for user
+space to mmap for this type of buffer. This change
+returns mmap offset even for private vram allocation,
+so user space can essentially mmap the buffer(with
+PROT_NONE flag) for ptrace access
+
+Change-Id: I458059ce7dd19f17830ac50d2297eaf504526293
+Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+index 3648269..606677a 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+@@ -1065,7 +1065,6 @@ int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu(
+ bool aql_queue, public, readonly, execute, coherent, no_sub, userptr;
+ u64 alloc_flag;
+ uint32_t domain;
+- uint64_t *temp_offset;
+ struct sg_table *sg = NULL;
+
+ if (!(flags & ALLOC_MEM_FLAGS_NONPAGED)) {
+@@ -1075,7 +1074,6 @@ int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu(
+
+ domain = 0;
+ alloc_flag = 0;
+- temp_offset = NULL;
+
+ aql_queue = (flags & ALLOC_MEM_FLAGS_AQL_QUEUE_MEM) ? true : false;
+ public = (flags & ALLOC_MEM_FLAGS_PUBLIC) ? true : false;
+@@ -1093,17 +1091,14 @@ int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu(
+ alloc_flag = AMDGPU_GEM_CREATE_NO_CPU_ACCESS;
+ if (public) {
+ alloc_flag = AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED;
+- temp_offset = offset;
+ }
+ alloc_flag |= AMDGPU_GEM_CREATE_VRAM_CLEARED;
+ } else if (flags & (ALLOC_MEM_FLAGS_GTT | ALLOC_MEM_FLAGS_USERPTR)) {
+ domain = AMDGPU_GEM_DOMAIN_GTT;
+ alloc_flag = 0;
+- temp_offset = offset;
+ } else if (flags & ALLOC_MEM_FLAGS_DOORBELL) {
+ domain = AMDGPU_GEM_DOMAIN_GTT;
+ alloc_flag = 0;
+- temp_offset = offset;
+ if (size > UINT_MAX)
+ return -EINVAL;
+ sg = create_doorbell_sg(*offset, size);
+@@ -1124,7 +1119,7 @@ int amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu(
+ BOOL_TO_STR(coherent), BOOL_TO_STR(no_sub));
+
+ return __alloc_memory_of_gpu(kgd, va, size, vm, mem,
+- temp_offset, domain,
++ offset, domain,
+ alloc_flag, sg,
+ aql_queue, readonly, execute,
+ coherent, no_sub, userptr);
+--
+2.7.4
+