Commit 681a9167 authored by Yong Zhao's avatar Yong Zhao Committed by Alex Deucher

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.
Signed-off-by: default avatarYong Zhao <Yong.Zhao@amd.com>
Reviewed-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 4d428e91
...@@ -251,18 +251,22 @@ static int get_wave_state(struct mqd_manager *mm, void *mqd, ...@@ -251,18 +251,22 @@ static int get_wave_state(struct mqd_manager *mm, void *mqd,
{ {
struct v10_compute_mqd *m; 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); 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 - *ctl_stack_used_size = m->cp_hqd_cntl_stack_size -
m->cp_hqd_cntl_stack_offset; m->cp_hqd_cntl_stack_offset;
*save_area_used_size = m->cp_hqd_wg_state_offset - *save_area_used_size = m->cp_hqd_wg_state_offset -
m->cp_hqd_cntl_stack_size; m->cp_hqd_cntl_stack_size;
if (copy_to_user(ctl_stack, mqd_ctl_stack, m->cp_hqd_cntl_stack_size)) /* Control stack is not copied to user mode for GFXv10 because
return -EFAULT; * it's part of the context save area that is already
* accessible to user mode
*/
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment