drm/amdgpu: Change kiq initialize/reset sequence on gfx8
Subsystems (2)
PATCH 1/2 drm/amdgpu: Change kiq initialize/reset sequence on gfx8
1. initialize kiq before initialize gfx ring.
2. set kiq ring ready immediately when kiq initialize successfully.
3. split function gfx_v8_0_kiq_resume into two functions. gfx_v8_0_kiq_resume is for kiq initialize. gfx_v8_0_kcq_resume is for kcq initialize.
--- drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 49 +++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 19 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +30 -19
@@ -4622,7 +4622,6 @@ static int gfx_v8_0_kiq_kcq_enable(struct amdgpu_device *adev) queue_mask |= (1ull << i); } - kiq_ring->ready = true; r =amdgpu_ring_alloc (kiq_ring, (8 * adev->gfx.num_compute_rings) +8 );if (r) {DRM_ERROR ("Failed to lock KIQ (%d).\n" , r);
@@ -4949,26 +4948,33 @@ static void gfx_v8_0_set_mec_doorbell_range(struct amdgpu_device *adev)static int gfx_v8_0_kiq_resume (struct amdgpu_device *adev) { -struct amdgpu_ring *ring =NULL ; -int r =0 , i; - -gfx_v8_0_cp_compute_enable (adev, true); +struct amdgpu_ring *ring; +int r; ring = &adev->gfx.kiq.ring; r =amdgpu_bo_reserve (ring->mqd_obj, false);if (unlikely (r !=0 )) - goto done; +return r; r =amdgpu_bo_kmap (ring->mqd_obj, &ring->mqd_ptr); -if (!r) { - r =gfx_v8_0_kiq_init_queue (ring); -amdgpu_bo_kunmap (ring->mqd_obj); - ring->mqd_ptr =NULL ; - } +if (unlikely (r !=0 )) +return r; + +gfx_v8_0_kiq_init_queue (ring); +amdgpu_bo_kunmap (ring->mqd_obj); + ring->mqd_ptr =NULL ;amdgpu_bo_unreserve (ring->mqd_obj); -if (r) - goto done; + ring->ready = true; +return 0 ; +} + +static int gfx_v8_0_kcq_resume (struct amdgpu_device *adev) +{ +struct amdgpu_ring *ring =NULL ; +int r =0 , i; + +gfx_v8_0_cp_compute_enable (adev, true);for (i =0 ; i < adev->gfx.num_compute_rings; i++) { ring = &adev->gfx.compute_ring[i];
@@ -5024,14 +5030,17 @@ static int gfx_v8_0_cp_resume(struct amdgpu_device *adev)return r; } - r =gfx_v8_0_cp_gfx_resume (adev); + r =gfx_v8_0_kiq_resume (adev);if (r)return r; - r =gfx_v8_0_kiq_resume (adev); + r =gfx_v8_0_cp_gfx_resume (adev);if (r)return r; + r =gfx_v8_0_kcq_resume (adev); +if (r) +return r;gfx_v8_0_enable_gui_idle_interrupt (adev, true);return 0 ;
@@ -5334,10 +5343,6 @@ static int gfx_v8_0_post_soft_reset(void *handle) srbm_soft_reset = adev->gfx.srbm_soft_reset;if (REG_GET_FIELD (grbm_soft_reset,GRBM_SOFT_RESET ,SOFT_RESET_CP ) || -REG_GET_FIELD (grbm_soft_reset,GRBM_SOFT_RESET ,SOFT_RESET_GFX )) -gfx_v8_0_cp_gfx_resume (adev); - -if (REG_GET_FIELD (grbm_soft_reset,GRBM_SOFT_RESET ,SOFT_RESET_CP ) ||REG_GET_FIELD (grbm_soft_reset,GRBM_SOFT_RESET ,SOFT_RESET_CPF ) ||REG_GET_FIELD (grbm_soft_reset,GRBM_SOFT_RESET ,SOFT_RESET_CPC ) ||REG_GET_FIELD (grbm_soft_reset,GRBM_SOFT_RESET ,SOFT_RESET_CPG )) {
@@ -5353,7 +5358,13 @@ static int gfx_v8_0_post_soft_reset(void *handle)mutex_unlock (&adev->srbm_mutex); }gfx_v8_0_kiq_resume (adev); +gfx_v8_0_kcq_resume (adev); } + +if (REG_GET_FIELD (grbm_soft_reset,GRBM_SOFT_RESET ,SOFT_RESET_CP ) || +REG_GET_FIELD (grbm_soft_reset,GRBM_SOFT_RESET ,SOFT_RESET_GFX )) +gfx_v8_0_cp_gfx_resume (adev); +gfx_v8_0_rlc_start (adev);return 0 ;
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1534937094-28029-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org
PATCH 2/2 drm/amdgpu: Change kiq ring initialize sequence on gfx9
1. initialize kiq before initialize gfx ring.
2. set kiq ring ready immediately when kiq initialize successfully.
3. split function gfx_v9_0_kiq_resume into two functions. gfx_v9_0_kiq_resume is for kiq initialize. gfx_v9_0_kcq_resume is for kcq initialize.
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 38 ++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +24 -14
@@ -2684,7 +2684,6 @@ static int gfx_v9_0_kiq_kcq_enable(struct amdgpu_device *adev) queue_mask |= (1ull << i); } - kiq_ring->ready = true; r =amdgpu_ring_alloc (kiq_ring, (7 * adev->gfx.num_compute_rings) +8 );if (r) {DRM_ERROR ("Failed to lock KIQ (%d).\n" , r);
@@ -3091,26 +3090,33 @@ static int gfx_v9_0_kcq_init_queue(struct amdgpu_ring *ring)static int gfx_v9_0_kiq_resume (struct amdgpu_device *adev) { -struct amdgpu_ring *ring =NULL ; -int r =0 , i; - -gfx_v9_0_cp_compute_enable (adev, true); +struct amdgpu_ring *ring; +int r; ring = &adev->gfx.kiq.ring; r =amdgpu_bo_reserve (ring->mqd_obj, false);if (unlikely (r !=0 )) - goto done; +return r; r =amdgpu_bo_kmap (ring->mqd_obj, (void **)&ring->mqd_ptr); -if (!r) { - r =gfx_v9_0_kiq_init_queue (ring); -amdgpu_bo_kunmap (ring->mqd_obj); - ring->mqd_ptr =NULL ; - } +if (unlikely (r !=0 )) +return r; + +gfx_v9_0_kiq_init_queue (ring); +amdgpu_bo_kunmap (ring->mqd_obj); + ring->mqd_ptr =NULL ;amdgpu_bo_unreserve (ring->mqd_obj); -if (r) - goto done; + ring->ready = true; +return 0 ; +} + +static int gfx_v9_0_kcq_resume (struct amdgpu_device *adev) +{ +struct amdgpu_ring *ring =NULL ; +int r =0 , i; + +gfx_v9_0_cp_compute_enable (adev, true);for (i =0 ; i < adev->gfx.num_compute_rings; i++) { ring = &adev->gfx.compute_ring[i];
@@ -3153,11 +3159,15 @@ static int gfx_v9_0_cp_resume(struct amdgpu_device *adev)return r; } + r =gfx_v9_0_kiq_resume (adev); +if (r) +return r; + r =gfx_v9_0_cp_gfx_resume (adev);if (r)return r; - r =gfx_v9_0_kiq_resume (adev); + r =gfx_v9_0_kcq_resume (adev);if (r)return r;
Signature · 6 lines
1.9.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1534937094-28029-2-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org
Alex Deucher
Reviewed-byRe: [PATCH 2/2] drm/amdgpu: Change kiq ring initialize sequence on gfx9
Quoted 9 lines · Rex Zhu
1. initialize kiq before initialize gfx ring.
2. set kiq ring ready immediately when kiq initialize successfully.
3. split functiongfx_v9_0_kiq_resumeinto two functions.gfx_v9_0_kiq_resumeis for kiq initialize.gfx_v9_0_kcq_resumeis for kcq initialize.Signed-off-by Rex Zhu <[email protected]>
Series is:
Quoted 82 lines
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 38 ++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 14 deletions(-)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +24
-15@@ -2684,7 +2684,6 @@ static int gfx_v9_0_kiq_kcq_enable(struct amdgpu_device *adev) queue_mask |= (1ull << i); } - kiq_ring->ready = true; r =amdgpu_ring_alloc (kiq_ring, (7 * adev->gfx.num_compute_rings) +8 );if (r) {DRM_ERROR ("Failed to lock KIQ (%d).\n" , r);@@ -3091,26 +3090,33 @@ static int gfx_v9_0_kcq_init_queue(struct amdgpu_ring *ring)static int gfx_v9_0_kiq_resume (struct amdgpu_device *adev) { -struct amdgpu_ring *ring =NULL ; -int r =0 , i; - -gfx_v9_0_cp_compute_enable (adev, true); +struct amdgpu_ring *ring; +int r; ring = &adev->gfx.kiq.ring; r =amdgpu_bo_reserve (ring->mqd_obj, false);if (unlikely (r !=0 )) - goto done; +return r; r =amdgpu_bo_kmap (ring->mqd_obj, (void **)&ring->mqd_ptr); -if (!r) { - r =gfx_v9_0_kiq_init_queue (ring); -amdgpu_bo_kunmap (ring->mqd_obj); - ring->mqd_ptr =NULL ; - } +if (unlikely (r !=0 )) +return r; + +gfx_v9_0_kiq_init_queue (ring); +amdgpu_bo_kunmap (ring->mqd_obj); + ring->mqd_ptr =NULL ;amdgpu_bo_unreserve (ring->mqd_obj); -if (r) - goto done; + ring->ready = true; +return 0 ; +} + +static int gfx_v9_0_kcq_resume (struct amdgpu_device *adev) +{ +struct amdgpu_ring *ring =NULL ; +int r =0 , i; + +gfx_v9_0_cp_compute_enable (adev, true);for (i =0 ; i < adev->gfx.num_compute_rings; i++) { ring = &adev->gfx.compute_ring[i];@@ -3153,11 +3159,15 @@ static int gfx_v9_0_cp_resume(struct amdgpu_device *adev)return r; } + r =gfx_v9_0_kiq_resume (adev); +if (r) +return r; + r =gfx_v9_0_cp_gfx_resume (adev);if (r)return r; - r =gfx_v9_0_kiq_resume (adev); + r =gfx_v9_0_kcq_resume (adev);if (r)return r; --1.9.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx