aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4427-drm-amdkfd-Update-get_wave_state-for-GFX10.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4427-drm-amdkfd-Update-get_wave_state-for-GFX10.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4427-drm-amdkfd-Update-get_wave_state-for-GFX10.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4427-drm-amdkfd-Update-get_wave_state-for-GFX10.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4427-drm-amdkfd-Update-get_wave_state-for-GFX10.patch
new file mode 100644
index 00000000..28b21ed9
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/4427-drm-amdkfd-Update-get_wave_state-for-GFX10.patch
@@ -0,0 +1,50 @@
+From 748b3ec8dd68824402757dac7c4e6d270c34da28 Mon Sep 17 00:00:00 2001
+From: Yong Zhao <Yong.Zhao@amd.com>
+Date: Fri, 8 Nov 2019 22:54:07 -0500
+Subject: [PATCH 4427/4736] drm/amdkfd: Update get_wave_state() for GFX10
+
+Given control stack is now in the userspace context save restore area
+on GFX10, the same as GFX8, it is not needed to copy it back to userspace.
+
+Change-Id: I063ddc3026eefa57713ec47b466a90f9bf9d49b8
+Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
+Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
+---
+ drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c | 14 +++++++++-----
+ 1 file changed, 9 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c
+index 79827017ea45..4cb7c226d4e0 100644
+--- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c
++++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c
+@@ -251,18 +251,22 @@ static int get_wave_state(struct mqd_manager *mm, void *mqd,
+ {
+ struct v10_compute_mqd *m;
+
+- /* Control stack is located one page after MQD. */
+- void *mqd_ctl_stack = (void *)((uintptr_t)mqd + PAGE_SIZE);
+-
+ m = get_mqd(mqd);
+
++ /* Control stack is written backwards, while workgroup context data
++ * is written forwards. Both starts from m->cp_hqd_cntl_stack_size.
++ * Current position is at m->cp_hqd_cntl_stack_offset and
++ * m->cp_hqd_wg_state_offset, respectively.
++ */
+ *ctl_stack_used_size = m->cp_hqd_cntl_stack_size -
+ m->cp_hqd_cntl_stack_offset;
+ *save_area_used_size = m->cp_hqd_wg_state_offset -
+ m->cp_hqd_cntl_stack_size;
+
+- if (copy_to_user(ctl_stack, mqd_ctl_stack, m->cp_hqd_cntl_stack_size))
+- return -EFAULT;
++ /* Control stack is not copied to user mode for GFXv10 because
++ * it's part of the context save area that is already
++ * accessible to user mode
++ */
+
+ return 0;
+ }
+--
+2.17.1
+