No need to reset the wptr and clear the rings.  The UNMAP_QUEUES
packet writes the current MQD state back the MQD on suspend,
so there is no need to reset it as well.

Signed-off-by: Alex Deucher <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c 
b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index d26bad2..f86a7f6 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -2158,18 +2158,7 @@ static int gfx_v9_0_kiq_init_queue(struct amdgpu_ring 
*ring)
 
        gfx_v9_0_kiq_setting(ring);
 
-       if (!adev->gfx.in_reset) {
-               memset((void *)mqd, 0, sizeof(*mqd));
-               mutex_lock(&adev->srbm_mutex);
-               soc15_grbm_select(adev, ring->me, ring->pipe, ring->queue, 0);
-               gfx_v9_0_mqd_init(ring);
-               gfx_v9_0_kiq_init_register(ring);
-               soc15_grbm_select(adev, 0, 0, 0, 0);
-               mutex_unlock(&adev->srbm_mutex);
-
-               if (adev->gfx.mec.mqd_backup[mqd_idx])
-                       memcpy(adev->gfx.mec.mqd_backup[mqd_idx], mqd, 
sizeof(*mqd));
-       } else { /* for GPU_RESET case */
+       if (adev->gfx.in_reset) { /* for GPU_RESET case */
                /* reset MQD to a clean status */
                if (adev->gfx.mec.mqd_backup[mqd_idx])
                        memcpy(mqd, adev->gfx.mec.mqd_backup[mqd_idx], 
sizeof(*mqd));
@@ -2183,6 +2172,17 @@ static int gfx_v9_0_kiq_init_queue(struct amdgpu_ring 
*ring)
                gfx_v9_0_kiq_init_register(ring);
                soc15_grbm_select(adev, 0, 0, 0, 0);
                mutex_unlock(&adev->srbm_mutex);
+       } else {
+               memset((void *)mqd, 0, sizeof(*mqd));
+               mutex_lock(&adev->srbm_mutex);
+               soc15_grbm_select(adev, ring->me, ring->pipe, ring->queue, 0);
+               gfx_v9_0_mqd_init(ring);
+               gfx_v9_0_kiq_init_register(ring);
+               soc15_grbm_select(adev, 0, 0, 0, 0);
+               mutex_unlock(&adev->srbm_mutex);
+
+               if (adev->gfx.mec.mqd_backup[mqd_idx])
+                       memcpy(adev->gfx.mec.mqd_backup[mqd_idx], mqd, 
sizeof(*mqd));
        }
 
        return 0;
@@ -2204,7 +2204,7 @@ static int gfx_v9_0_kcq_init_queue(struct amdgpu_ring 
*ring)
 
                if (adev->gfx.mec.mqd_backup[mqd_idx])
                        memcpy(adev->gfx.mec.mqd_backup[mqd_idx], mqd, 
sizeof(*mqd));
-       } else { /* for GPU_RESET case */
+       } else if (adev->gfx.in_reset) { /* for GPU_RESET case */
                /* reset MQD to a clean status */
                if (adev->gfx.mec.mqd_backup[mqd_idx])
                        memcpy(mqd, adev->gfx.mec.mqd_backup[mqd_idx], 
sizeof(*mqd));
-- 
2.5.5

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to