diff options
author | Rex Zhu <Rex.Zhu@amd.com> | 2018-09-29 03:27:02 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-10-09 18:05:33 -0400 |
commit | 44779b43f15977885a0e3b45bf6deb6be18725e5 (patch) | |
tree | 2319438d337d6a81714532471b843f23f849b1ba /drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | |
parent | 3023015f791639838ec5d80e5c14851238a1a7d9 (diff) |
drm/amdgpu: Move gfx flag in_suspend to adev
Move in_suspend flag to adev from gfx, so
can be used in other ip blocks, also keep
consistent with gpu_in_reset flag.
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c index 2aeef2bb93a4..f9e0a21435f8 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | |||
@@ -4872,7 +4872,7 @@ static int gfx_v8_0_kcq_init_queue(struct amdgpu_ring *ring) | |||
4872 | struct vi_mqd *mqd = ring->mqd_ptr; | 4872 | struct vi_mqd *mqd = ring->mqd_ptr; |
4873 | int mqd_idx = ring - &adev->gfx.compute_ring[0]; | 4873 | int mqd_idx = ring - &adev->gfx.compute_ring[0]; |
4874 | 4874 | ||
4875 | if (!adev->in_gpu_reset && !adev->gfx.in_suspend) { | 4875 | if (!adev->in_gpu_reset && !adev->in_suspend) { |
4876 | memset((void *)mqd, 0, sizeof(struct vi_mqd_allocation)); | 4876 | memset((void *)mqd, 0, sizeof(struct vi_mqd_allocation)); |
4877 | ((struct vi_mqd_allocation *)mqd)->dynamic_cu_mask = 0xFFFFFFFF; | 4877 | ((struct vi_mqd_allocation *)mqd)->dynamic_cu_mask = 0xFFFFFFFF; |
4878 | ((struct vi_mqd_allocation *)mqd)->dynamic_rb_mask = 0xFFFFFFFF; | 4878 | ((struct vi_mqd_allocation *)mqd)->dynamic_rb_mask = 0xFFFFFFFF; |
@@ -5142,19 +5142,12 @@ static int gfx_v8_0_hw_fini(void *handle) | |||
5142 | 5142 | ||
5143 | static int gfx_v8_0_suspend(void *handle) | 5143 | static int gfx_v8_0_suspend(void *handle) |
5144 | { | 5144 | { |
5145 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 5145 | return gfx_v8_0_hw_fini(handle); |
5146 | adev->gfx.in_suspend = true; | ||
5147 | return gfx_v8_0_hw_fini(adev); | ||
5148 | } | 5146 | } |
5149 | 5147 | ||
5150 | static int gfx_v8_0_resume(void *handle) | 5148 | static int gfx_v8_0_resume(void *handle) |
5151 | { | 5149 | { |
5152 | int r; | 5150 | return gfx_v8_0_hw_init(handle); |
5153 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | ||
5154 | |||
5155 | r = gfx_v8_0_hw_init(adev); | ||
5156 | adev->gfx.in_suspend = false; | ||
5157 | return r; | ||
5158 | } | 5151 | } |
5159 | 5152 | ||
5160 | static bool gfx_v8_0_check_soft_reset(void *handle) | 5153 | static bool gfx_v8_0_check_soft_reset(void *handle) |