drm/amdgpu: disable 3D pipe 1 on Navi1x
Subsystems (2)
PATCH 1/1 drm/amdgpu: disable 3D pipe 1 on Navi1x
From: "Tianci.Yin" <[email protected]>
[why]
CP firmware decide to skip setting the state for 3D pipe 1 for Navi1x as there is no use case.
[how]
Disable 3D pipe 1 on Navi1x.
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 97 ++++++++++++++------------ 1 file changed, 51 insertions(+), 46 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +51 -46
@@ -52,7 +52,7 @@* 1. Primary ring * 2. Async ring */ -#define GFX10_NUM_GFX_RINGS 2 +#define GFX10_NUM_GFX_RINGS_NV1X 1#define GFX10_MEC_HPD_SIZE 2048#define F32_CE_PROGRAM_RAM_SIZE 65536
@@ -1305,7 +1305,7 @@ static int gfx_v10_0_sw_init(void *handle)case CHIP_NAVI14 :case CHIP_NAVI12 : adev->gfx.me.num_me =1 ; - adev->gfx.me.num_pipe_per_me =2 ; + adev->gfx.me.num_pipe_per_me =1 ; adev->gfx.me.num_queue_per_pipe =1 ; adev->gfx.mec.num_mec =2 ; adev->gfx.mec.num_pipe_per_mec =4 ;
@@ -2711,18 +2711,20 @@ static int gfx_v10_0_cp_gfx_start(struct amdgpu_device *adev)amdgpu_ring_commit (ring);/* submit cs packet to copy state 0 to next available state */ - ring = &adev->gfx.gfx_ring[1 ]; - r =amdgpu_ring_alloc (ring,2 ); -if (r) { -DRM_ERROR ("amdgpu: cp failed to lock ring (%d).\n" , r); -return r; - } - -amdgpu_ring_write (ring,PACKET3 (PACKET3_CLEAR_STATE ,0 )); -amdgpu_ring_write (ring,0 ); +if (adev->gfx.num_gfx_rings >1 ) { +/* maximum supported gfx ring is 2 */ + ring = &adev->gfx.gfx_ring[1 ]; + r =amdgpu_ring_alloc (ring,2 ); +if (r) { +DRM_ERROR ("amdgpu: cp failed to lock ring (%d).\n" , r); +return r; + } -amdgpu_ring_commit (ring); +amdgpu_ring_write (ring,PACKET3 (PACKET3_CLEAR_STATE ,0 )); +amdgpu_ring_write (ring,0 ); +amdgpu_ring_commit (ring); + }return 0 ; }
@@ -2819,39 +2821,41 @@ static int gfx_v10_0_cp_gfx_resume(struct amdgpu_device *adev)mutex_unlock (&adev->srbm_mutex);/* Init gfx ring 1 for pipe 1 */ -mutex_lock (&adev->srbm_mutex); -gfx_v10_0_cp_gfx_switch_pipe (adev,PIPE_ID1 ); - ring = &adev->gfx.gfx_ring[1 ]; - rb_bufsz =order_base_2 (ring->ring_size /8 ); - tmp =REG_SET_FIELD (0 ,CP_RB1_CNTL ,RB_BUFSZ , rb_bufsz); - tmp =REG_SET_FIELD (tmp,CP_RB1_CNTL ,RB_BLKSZ , rb_bufsz -2 ); -WREG32_SOC15 (GC ,0 , mmCP_RB1_CNTL, tmp); -/* Initialize the ring buffer's write pointers */ - ring->wptr =0 ; -WREG32_SOC15 (GC ,0 , mmCP_RB1_WPTR,lower_32_bits (ring->wptr)); -WREG32_SOC15 (GC ,0 , mmCP_RB1_WPTR_HI,upper_32_bits (ring->wptr)); -/* Set the wb address wether it's enabled or not */ - rptr_addr = adev->wb.gpu_addr + (ring->rptr_offs *4 ); -WREG32_SOC15 (GC ,0 , mmCP_RB1_RPTR_ADDR,lower_32_bits (rptr_addr)); -WREG32_SOC15 (GC ,0 , mmCP_RB1_RPTR_ADDR_HI,upper_32_bits (rptr_addr) & -CP_RB1_RPTR_ADDR_HI__RB_RPTR_ADDR_HI_MASK ); - wptr_gpu_addr = adev->wb.gpu_addr + (ring->wptr_offs *4 ); -WREG32_SOC15 (GC ,0 , mmCP_RB_WPTR_POLL_ADDR_LO, -lower_32_bits (wptr_gpu_addr)); -WREG32_SOC15 (GC ,0 , mmCP_RB_WPTR_POLL_ADDR_HI, -upper_32_bits (wptr_gpu_addr)); - -mdelay (1 ); -WREG32_SOC15 (GC ,0 , mmCP_RB1_CNTL, tmp); - - rb_addr = ring->gpu_addr >>8 ; -WREG32_SOC15 (GC ,0 , mmCP_RB1_BASE, rb_addr); -WREG32_SOC15 (GC ,0 , mmCP_RB1_BASE_HI,upper_32_bits (rb_addr)); -WREG32_SOC15 (GC ,0 , mmCP_RB1_ACTIVE,1 ); - -gfx_v10_0_cp_gfx_set_doorbell (adev, ring); -mutex_unlock (&adev->srbm_mutex); - +if (adev->gfx.num_gfx_rings >1 ) { +mutex_lock (&adev->srbm_mutex); +gfx_v10_0_cp_gfx_switch_pipe (adev,PIPE_ID1 ); +/* maximum supported gfx ring is 2 */ + ring = &adev->gfx.gfx_ring[1 ]; + rb_bufsz =order_base_2 (ring->ring_size /8 ); + tmp =REG_SET_FIELD (0 ,CP_RB1_CNTL ,RB_BUFSZ , rb_bufsz); + tmp =REG_SET_FIELD (tmp,CP_RB1_CNTL ,RB_BLKSZ , rb_bufsz -2 ); +WREG32_SOC15 (GC ,0 , mmCP_RB1_CNTL, tmp); +/* Initialize the ring buffer's write pointers */ + ring->wptr =0 ; +WREG32_SOC15 (GC ,0 , mmCP_RB1_WPTR,lower_32_bits (ring->wptr)); +WREG32_SOC15 (GC ,0 , mmCP_RB1_WPTR_HI,upper_32_bits (ring->wptr)); +/* Set the wb address wether it's enabled or not */ + rptr_addr = adev->wb.gpu_addr + (ring->rptr_offs *4 ); +WREG32_SOC15 (GC ,0 , mmCP_RB1_RPTR_ADDR,lower_32_bits (rptr_addr)); +WREG32_SOC15 (GC ,0 , mmCP_RB1_RPTR_ADDR_HI,upper_32_bits (rptr_addr) & +CP_RB1_RPTR_ADDR_HI__RB_RPTR_ADDR_HI_MASK ); + wptr_gpu_addr = adev->wb.gpu_addr + (ring->wptr_offs *4 ); +WREG32_SOC15 (GC ,0 , mmCP_RB_WPTR_POLL_ADDR_LO, +lower_32_bits (wptr_gpu_addr)); +WREG32_SOC15 (GC ,0 , mmCP_RB_WPTR_POLL_ADDR_HI, +upper_32_bits (wptr_gpu_addr)); + +mdelay (1 ); +WREG32_SOC15 (GC ,0 , mmCP_RB1_CNTL, tmp); + + rb_addr = ring->gpu_addr >>8 ; +WREG32_SOC15 (GC ,0 , mmCP_RB1_BASE, rb_addr); +WREG32_SOC15 (GC ,0 , mmCP_RB1_BASE_HI,upper_32_bits (rb_addr)); +WREG32_SOC15 (GC ,0 , mmCP_RB1_ACTIVE,1 ); + +gfx_v10_0_cp_gfx_set_doorbell (adev, ring); +mutex_unlock (&adev->srbm_mutex); + }/* Switch to pipe 0 */ mutex_lock (&adev->srbm_mutex);gfx_v10_0_cp_gfx_switch_pipe (adev,PIPE_ID0 );
@@ -3967,7 +3971,8 @@ static int gfx_v10_0_early_init(void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle; - adev->gfx.num_gfx_rings =GFX10_NUM_GFX_RINGS ; + adev->gfx.num_gfx_rings =GFX10_NUM_GFX_RINGS_NV1X ; + adev->gfx.num_compute_rings =AMDGPU_MAX_COMPUTE_RINGS ;gfx_v10_0_set_kiq_pm4_funcs (adev);
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[AMD Official Use Only - Internal Distribution Only]
-----Original Message-----
From: Tianci Yin <[email protected]>
Sent: 2020年3月2日 9:57
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Xu, Feifei <[email protected]>; Gao, Likun <[email protected]>; Yuan, Xiaojie <[email protected]>; Long, Gang <[email protected]>; Li, Pauline <[email protected]>; Yin, Tianci (Rico) <[email protected]>
Subject: [PATCH] drm/amdgpu: disable 3D pipe 1 on Navi1x
From: "Tianci.Yin" <[email protected]>
[why]
CP firmware decide to skip setting the state for 3D pipe 1 for Navi1x as there is no use case.
[how]
Disable 3D pipe 1 on Navi1x.
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 97 ++++++++++++++------------ 1 file changed, 51 insertions(+), 46 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +49 -45
@@ -52,7 +52,7 @@* 1. Primary ring * 2. Async ring */ -#define GFX10_NUM_GFX_RINGS 2 +#define GFX10_NUM_GFX_RINGS_NV1X 1#define GFX10_MEC_HPD_SIZE 2048#define F32_CE_PROGRAM_RAM_SIZE 65536
@@ -1305,7 +1305,7 @@ static int gfx_v10_0_sw_init(void *handle)case CHIP_NAVI14 :case CHIP_NAVI12 : adev->gfx.me.num_me =1 ; - adev->gfx.me.num_pipe_per_me =2 ; + adev->gfx.me.num_pipe_per_me =1 ; adev->gfx.me.num_queue_per_pipe =1 ; adev->gfx.mec.num_mec =2 ; adev->gfx.mec.num_pipe_per_mec =4 ;
@@ -2711,18 +2711,20 @@ static int gfx_v10_0_cp_gfx_start(struct amdgpu_device *adev)amdgpu_ring_commit (ring);/* submit cs packet to copy state 0 to next available state */ - ring = &adev->gfx.gfx_ring[1 ]; - r =amdgpu_ring_alloc (ring,2 ); -if (r) { -DRM_ERROR ("amdgpu: cp failed to lock ring (%d).\n" , r); -return r; - } - -amdgpu_ring_write (ring,PACKET3 (PACKET3_CLEAR_STATE ,0 )); -amdgpu_ring_write (ring,0 ); +if (adev->gfx.num_gfx_rings >1 ) { +/* maximum supported gfx ring is 2 */ + ring = &adev->gfx.gfx_ring[1 ]; + r =amdgpu_ring_alloc (ring,2 ); +if (r) { +DRM_ERROR ("amdgpu: cp failed to lock ring (%d).\n" , r); +return r; + } -amdgpu_ring_commit (ring); +amdgpu_ring_write (ring,PACKET3 (PACKET3_CLEAR_STATE ,0 )); +amdgpu_ring_write (ring,0 ); +amdgpu_ring_commit (ring); + }return 0 ; }
@@ -2819,39 +2821,41 @@ static int gfx_v10_0_cp_gfx_resume(struct amdgpu_device *adev)mutex_unlock (&adev->srbm_mutex);/* Init gfx ring 1 for pipe 1 */ -mutex_lock (&adev->srbm_mutex); -gfx_v10_0_cp_gfx_switch_pipe (adev,PIPE_ID1 ); - ring = &adev->gfx.gfx_ring[1 ]; - rb_bufsz =order_base_2 (ring->ring_size /8 ); - tmp =REG_SET_FIELD (0 ,CP_RB1_CNTL ,RB_BUFSZ , rb_bufsz); - tmp =REG_SET_FIELD (tmp,CP_RB1_CNTL ,RB_BLKSZ , rb_bufsz -2 ); -WREG32_SOC15 (GC ,0 , mmCP_RB1_CNTL, tmp); -/* Initialize the ring buffer's write pointers */ - ring->wptr =0 ; -WREG32_SOC15 (GC ,0 , mmCP_RB1_WPTR,lower_32_bits (ring->wptr)); -WREG32_SOC15 (GC ,0 , mmCP_RB1_WPTR_HI,upper_32_bits (ring->wptr)); -/* Set the wb address wether it's enabled or not */ - rptr_addr = adev->wb.gpu_addr + (ring->rptr_offs *4 ); -WREG32_SOC15 (GC ,0 , mmCP_RB1_RPTR_ADDR,lower_32_bits (rptr_addr)); -WREG32_SOC15 (GC ,0 , mmCP_RB1_RPTR_ADDR_HI,upper_32_bits (rptr_addr) & -CP_RB1_RPTR_ADDR_HI__RB_RPTR_ADDR_HI_MASK ); - wptr_gpu_addr = adev->wb.gpu_addr + (ring->wptr_offs *4 ); -WREG32_SOC15 (GC ,0 , mmCP_RB_WPTR_POLL_ADDR_LO, -lower_32_bits (wptr_gpu_addr)); -WREG32_SOC15 (GC ,0 , mmCP_RB_WPTR_POLL_ADDR_HI, -upper_32_bits (wptr_gpu_addr)); - -mdelay (1 ); -WREG32_SOC15 (GC ,0 , mmCP_RB1_CNTL, tmp); - - rb_addr = ring->gpu_addr >>8 ; -WREG32_SOC15 (GC ,0 , mmCP_RB1_BASE, rb_addr); -WREG32_SOC15 (GC ,0 , mmCP_RB1_BASE_HI,upper_32_bits (rb_addr)); -WREG32_SOC15 (GC ,0 , mmCP_RB1_ACTIVE,1 ); - -gfx_v10_0_cp_gfx_set_doorbell (adev, ring); -mutex_unlock (&adev->srbm_mutex); - +if (adev->gfx.num_gfx_rings >1 ) { +mutex_lock (&adev->srbm_mutex); +gfx_v10_0_cp_gfx_switch_pipe (adev,PIPE_ID1 ); +/* maximum supported gfx ring is 2 */ + ring = &adev->gfx.gfx_ring[1 ]; + rb_bufsz =order_base_2 (ring->ring_size /8 ); + tmp =REG_SET_FIELD (0 ,CP_RB1_CNTL ,RB_BUFSZ , rb_bufsz); + tmp =REG_SET_FIELD (tmp,CP_RB1_CNTL ,RB_BLKSZ , rb_bufsz -2 ); +WREG32_SOC15 (GC ,0 , mmCP_RB1_CNTL, tmp); +/* Initialize the ring buffer's write pointers */ + ring->wptr =0 ; +WREG32_SOC15 (GC ,0 , mmCP_RB1_WPTR,lower_32_bits (ring->wptr)); +WREG32_SOC15 (GC ,0 , mmCP_RB1_WPTR_HI,upper_32_bits (ring->wptr)); +/* Set the wb address wether it's enabled or not */ + rptr_addr = adev->wb.gpu_addr + (ring->rptr_offs *4 ); +WREG32_SOC15 (GC ,0 , mmCP_RB1_RPTR_ADDR,lower_32_bits (rptr_addr)); +WREG32_SOC15 (GC ,0 , mmCP_RB1_RPTR_ADDR_HI,upper_32_bits (rptr_addr) & +CP_RB1_RPTR_ADDR_HI__RB_RPTR_ADDR_HI_MASK ); + wptr_gpu_addr = adev->wb.gpu_addr + (ring->wptr_offs *4 ); +WREG32_SOC15 (GC ,0 , mmCP_RB_WPTR_POLL_ADDR_LO, +lower_32_bits (wptr_gpu_addr)); +WREG32_SOC15 (GC ,0 , mmCP_RB_WPTR_POLL_ADDR_HI, +upper_32_bits (wptr_gpu_addr)); + +mdelay (1 ); +WREG32_SOC15 (GC ,0 , mmCP_RB1_CNTL, tmp); + + rb_addr = ring->gpu_addr >>8 ; +WREG32_SOC15 (GC ,0 , mmCP_RB1_BASE, rb_addr); +WREG32_SOC15 (GC ,0 , mmCP_RB1_BASE_HI,upper_32_bits (rb_addr)); +WREG32_SOC15 (GC ,0 , mmCP_RB1_ACTIVE,1 ); + +gfx_v10_0_cp_gfx_set_doorbell (adev, ring); +mutex_unlock (&adev->srbm_mutex); + }/* Switch to pipe 0 */ mutex_lock (&adev->srbm_mutex); gfx_v10_0_cp_gfx_switch_pipe(adev, PIPE_ID0); @@ -3967,7 +3971,8 @@ static int gfx_v10_0_early_init(void *handle) {
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
- adev->gfx.num_gfx_rings = GFX10_NUM_GFX_RINGS;
+ adev->gfx.num_gfx_rings = GFX10_NUM_GFX_RINGS_NV1X;
+
adev->gfx.num_compute_rings = AMDGPU_MAX_COMPUTE_RINGS;
gfx_v10_0_set_kiq_pm4_funcs(adev);
--
2.17.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_____________________________________
Monk Liu|GPU Virtualization Team |AMD
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Xu, Feifei
Sent: Monday, March 2, 2020 5:32 PM
To: Yin, Tianci (Rico) <[email protected]>; [email protected]
Cc: Long, Gang <[email protected]>; Li, Pauline <[email protected]>; Yin, Tianci (Rico) <[email protected]>; Gao, Likun <[email protected]>; Zhang, Hawking <[email protected]>; Yuan, Xiaojie <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: disable 3D pipe 1 on Navi1x
[AMD Official Use Only - Internal Distribution Only]
-----Original Message-----
From: Tianci Yin <[email protected]>
Sent: 2020年3月2日 9:57
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Xu, Feifei <[email protected]>; Gao, Likun <[email protected]>; Yuan, Xiaojie <[email protected]>; Long, Gang <[email protected]>; Li, Pauline <[email protected]>; Yin, Tianci (Rico) <[email protected]>
Subject: [PATCH] drm/amdgpu: disable 3D pipe 1 on Navi1x
From: "Tianci.Yin" <[email protected]>
[why]
CP firmware decide to skip setting the state for 3D pipe 1 for Navi1x as there is no use case.
[how]
Disable 3D pipe 1 on Navi1x.
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 97 ++++++++++++++------------ 1 file changed, 51 insertions(+), 46 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +49 -45
@@ -52,7 +52,7 @@* 1. Primary ring * 2. Async ring */ -#define GFX10_NUM_GFX_RINGS 2 +#define GFX10_NUM_GFX_RINGS_NV1X 1#define GFX10_MEC_HPD_SIZE 2048#define F32_CE_PROGRAM_RAM_SIZE 65536
@@ -1305,7 +1305,7 @@ static int gfx_v10_0_sw_init(void *handle)case CHIP_NAVI14 :case CHIP_NAVI12 : adev->gfx.me.num_me =1 ; - adev->gfx.me.num_pipe_per_me =2 ; + adev->gfx.me.num_pipe_per_me =1 ; adev->gfx.me.num_queue_per_pipe =1 ; adev->gfx.mec.num_mec =2 ; adev->gfx.mec.num_pipe_per_mec =4 ;
@@ -2711,18 +2711,20 @@ static int gfx_v10_0_cp_gfx_start(struct amdgpu_device *adev)amdgpu_ring_commit (ring);/* submit cs packet to copy state 0 to next available state */ - ring = &adev->gfx.gfx_ring[1 ]; - r =amdgpu_ring_alloc (ring,2 ); -if (r) { -DRM_ERROR ("amdgpu: cp failed to lock ring (%d).\n" , r); -return r; - } - -amdgpu_ring_write (ring,PACKET3 (PACKET3_CLEAR_STATE ,0 )); -amdgpu_ring_write (ring,0 ); +if (adev->gfx.num_gfx_rings >1 ) { +/* maximum supported gfx ring is 2 */ + ring = &adev->gfx.gfx_ring[1 ]; + r =amdgpu_ring_alloc (ring,2 ); +if (r) { +DRM_ERROR ("amdgpu: cp failed to lock ring (%d).\n" , r); +return r; + } -amdgpu_ring_commit (ring); +amdgpu_ring_write (ring,PACKET3 (PACKET3_CLEAR_STATE ,0 )); +amdgpu_ring_write (ring,0 ); +amdgpu_ring_commit (ring); + }return 0 ; }
@@ -2819,39 +2821,41 @@ static int gfx_v10_0_cp_gfx_resume(struct amdgpu_device *adev)mutex_unlock (&adev->srbm_mutex);/* Init gfx ring 1 for pipe 1 */ -mutex_lock (&adev->srbm_mutex); -gfx_v10_0_cp_gfx_switch_pipe (adev,PIPE_ID1 ); - ring = &adev->gfx.gfx_ring[1 ]; - rb_bufsz =order_base_2 (ring->ring_size /8 ); - tmp =REG_SET_FIELD (0 ,CP_RB1_CNTL ,RB_BUFSZ , rb_bufsz); - tmp =REG_SET_FIELD (tmp,CP_RB1_CNTL ,RB_BLKSZ , rb_bufsz -2 ); -WREG32_SOC15 (GC ,0 , mmCP_RB1_CNTL, tmp); -/* Initialize the ring buffer's write pointers */ - ring->wptr =0 ; -WREG32_SOC15 (GC ,0 , mmCP_RB1_WPTR,lower_32_bits (ring->wptr)); -WREG32_SOC15 (GC ,0 , mmCP_RB1_WPTR_HI,upper_32_bits (ring->wptr)); -/* Set the wb address wether it's enabled or not */ - rptr_addr = adev->wb.gpu_addr + (ring->rptr_offs *4 ); -WREG32_SOC15 (GC ,0 , mmCP_RB1_RPTR_ADDR,lower_32_bits (rptr_addr)); -WREG32_SOC15 (GC ,0 , mmCP_RB1_RPTR_ADDR_HI,upper_32_bits (rptr_addr) & -CP_RB1_RPTR_ADDR_HI__RB_RPTR_ADDR_HI_MASK ); - wptr_gpu_addr = adev->wb.gpu_addr + (ring->wptr_offs *4 ); -WREG32_SOC15 (GC ,0 , mmCP_RB_WPTR_POLL_ADDR_LO, -lower_32_bits (wptr_gpu_addr)); -WREG32_SOC15 (GC ,0 , mmCP_RB_WPTR_POLL_ADDR_HI, -upper_32_bits (wptr_gpu_addr)); - -mdelay (1 ); -WREG32_SOC15 (GC ,0 , mmCP_RB1_CNTL, tmp); - - rb_addr = ring->gpu_addr >>8 ; -WREG32_SOC15 (GC ,0 , mmCP_RB1_BASE, rb_addr); -WREG32_SOC15 (GC ,0 , mmCP_RB1_BASE_HI,upper_32_bits (rb_addr)); -WREG32_SOC15 (GC ,0 , mmCP_RB1_ACTIVE,1 ); - -gfx_v10_0_cp_gfx_set_doorbell (adev, ring); -mutex_unlock (&adev->srbm_mutex); - +if (adev->gfx.num_gfx_rings >1 ) { +mutex_lock (&adev->srbm_mutex); +gfx_v10_0_cp_gfx_switch_pipe (adev,PIPE_ID1 ); +/* maximum supported gfx ring is 2 */ + ring = &adev->gfx.gfx_ring[1 ]; + rb_bufsz =order_base_2 (ring->ring_size /8 ); + tmp =REG_SET_FIELD (0 ,CP_RB1_CNTL ,RB_BUFSZ , rb_bufsz); + tmp =REG_SET_FIELD (tmp,CP_RB1_CNTL ,RB_BLKSZ , rb_bufsz -2 ); +WREG32_SOC15 (GC ,0 , mmCP_RB1_CNTL, tmp); +/* Initialize the ring buffer's write pointers */ + ring->wptr =0 ; +WREG32_SOC15 (GC ,0 , mmCP_RB1_WPTR,lower_32_bits (ring->wptr)); +WREG32_SOC15 (GC ,0 , mmCP_RB1_WPTR_HI,upper_32_bits (ring->wptr)); +/* Set the wb address wether it's enabled or not */ + rptr_addr = adev->wb.gpu_addr + (ring->rptr_offs *4 ); +WREG32_SOC15 (GC ,0 , mmCP_RB1_RPTR_ADDR,lower_32_bits (rptr_addr)); +WREG32_SOC15 (GC ,0 , mmCP_RB1_RPTR_ADDR_HI,upper_32_bits (rptr_addr) & +CP_RB1_RPTR_ADDR_HI__RB_RPTR_ADDR_HI_MASK ); + wptr_gpu_addr = adev->wb.gpu_addr + (ring->wptr_offs *4 ); +WREG32_SOC15 (GC ,0 , mmCP_RB_WPTR_POLL_ADDR_LO, +lower_32_bits (wptr_gpu_addr)); +WREG32_SOC15 (GC ,0 , mmCP_RB_WPTR_POLL_ADDR_HI, +upper_32_bits (wptr_gpu_addr)); + +mdelay (1 ); +WREG32_SOC15 (GC ,0 , mmCP_RB1_CNTL, tmp); + + rb_addr = ring->gpu_addr >>8 ; +WREG32_SOC15 (GC ,0 , mmCP_RB1_BASE, rb_addr); +WREG32_SOC15 (GC ,0 , mmCP_RB1_BASE_HI,upper_32_bits (rb_addr)); +WREG32_SOC15 (GC ,0 , mmCP_RB1_ACTIVE,1 ); + +gfx_v10_0_cp_gfx_set_doorbell (adev, ring); +mutex_unlock (&adev->srbm_mutex); + }/* Switch to pipe 0 */ mutex_lock (&adev->srbm_mutex); gfx_v10_0_cp_gfx_switch_pipe(adev, PIPE_ID0); @@ -3967,7 +3971,8 @@ static int gfx_v10_0_early_init(void *handle) {
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
- adev->gfx.num_gfx_rings = GFX10_NUM_GFX_RINGS;
+ adev->gfx.num_gfx_rings = GFX10_NUM_GFX_RINGS_NV1X;
+
adev->gfx.num_compute_rings = AMDGPU_MAX_COMPUTE_RINGS;
gfx_v10_0_set_kiq_pm4_funcs(adev);
--
2.17.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Cmonk.liu%40amd.com%7C76b6cb68c8524e24a71a08d7be8c9b91%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637187383465069039&sdata=5CYyoryFFaDwGEuB%2F1jyI5FuZCM2kM7hUKD2OuKN%2BhU%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Thanks Feifei and Monk!
________________________________
From: Liu, Monk <[email protected]>
Sent: Monday, March 2, 2020 17:35
To: Xu, Feifei <[email protected]>; Yin, Tianci (Rico) <[email protected]>; [email protected] <[email protected]>
Cc: Long, Gang <[email protected]>; Li, Pauline <[email protected]>; Yin, Tianci (Rico) <[email protected]>; Gao, Likun <[email protected]>; Zhang, Hawking <[email protected]>; Yuan, Xiaojie <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: disable 3D pipe 1 on Navi1x
_____________________________________
Monk Liu|GPU Virtualization Team |AMD
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Xu, Feifei
Sent: Monday, March 2, 2020 5:32 PM
To: Yin, Tianci (Rico) <[email protected]>; [email protected]
Cc: Long, Gang <[email protected]>; Li, Pauline <[email protected]>; Yin, Tianci (Rico) <[email protected]>; Gao, Likun <[email protected]>; Zhang, Hawking <[email protected]>; Yuan, Xiaojie <[email protected]>
Subject: RE: [PATCH] drm/amdgpu: disable 3D pipe 1 on Navi1x
[AMD Official Use Only - Internal Distribution Only]
-----Original Message-----
From: Tianci Yin <[email protected]>
Sent: 2020年3月2日 9:57
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Xu, Feifei <[email protected]>; Gao, Likun <[email protected]>; Yuan, Xiaojie <[email protected]>; Long, Gang <[email protected]>; Li, Pauline <[email protected]>; Yin, Tianci (Rico) <[email protected]>
Subject: [PATCH] drm/amdgpu: disable 3D pipe 1 on Navi1x
From: "Tianci.Yin" <[email protected]>
[why]
CP firmware decide to skip setting the state for 3D pipe 1 for Navi1x as there is no use case.
[how]
Disable 3D pipe 1 on Navi1x.
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 97 ++++++++++++++------------ 1 file changed, 51 insertions(+), 46 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +49 -45
@@ -52,7 +52,7 @@* 1. Primary ring * 2. Async ring */ -#define GFX10_NUM_GFX_RINGS 2 +#define GFX10_NUM_GFX_RINGS_NV1X 1#define GFX10_MEC_HPD_SIZE 2048#define F32_CE_PROGRAM_RAM_SIZE 65536
@@ -1305,7 +1305,7 @@ static int gfx_v10_0_sw_init(void *handle)case CHIP_NAVI14 :case CHIP_NAVI12 : adev->gfx.me.num_me =1 ; - adev->gfx.me.num_pipe_per_me =2 ; + adev->gfx.me.num_pipe_per_me =1 ; adev->gfx.me.num_queue_per_pipe =1 ; adev->gfx.mec.num_mec =2 ; adev->gfx.mec.num_pipe_per_mec =4 ;
@@ -2711,18 +2711,20 @@ static int gfx_v10_0_cp_gfx_start(struct amdgpu_device *adev)amdgpu_ring_commit (ring);/* submit cs packet to copy state 0 to next available state */ - ring = &adev->gfx.gfx_ring[1 ]; - r =amdgpu_ring_alloc (ring,2 ); -if (r) { -DRM_ERROR ("amdgpu: cp failed to lock ring (%d).\n" , r); -return r; - } - -amdgpu_ring_write (ring,PACKET3 (PACKET3_CLEAR_STATE ,0 )); -amdgpu_ring_write (ring,0 ); +if (adev->gfx.num_gfx_rings >1 ) { +/* maximum supported gfx ring is 2 */ + ring = &adev->gfx.gfx_ring[1 ]; + r =amdgpu_ring_alloc (ring,2 ); +if (r) { +DRM_ERROR ("amdgpu: cp failed to lock ring (%d).\n" , r); +return r; + } -amdgpu_ring_commit (ring); +amdgpu_ring_write (ring,PACKET3 (PACKET3_CLEAR_STATE ,0 )); +amdgpu_ring_write (ring,0 ); +amdgpu_ring_commit (ring); + }return 0 ; }
@@ -2819,39 +2821,41 @@ static int gfx_v10_0_cp_gfx_resume(struct amdgpu_device *adev)mutex_unlock (&adev->srbm_mutex);/* Init gfx ring 1 for pipe 1 */ -mutex_lock (&adev->srbm_mutex); -gfx_v10_0_cp_gfx_switch_pipe (adev,PIPE_ID1 ); - ring = &adev->gfx.gfx_ring[1 ]; - rb_bufsz =order_base_2 (ring->ring_size /8 ); - tmp =REG_SET_FIELD (0 ,CP_RB1_CNTL ,RB_BUFSZ , rb_bufsz); - tmp =REG_SET_FIELD (tmp,CP_RB1_CNTL ,RB_BLKSZ , rb_bufsz -2 ); -WREG32_SOC15 (GC ,0 , mmCP_RB1_CNTL, tmp); -/* Initialize the ring buffer's write pointers */ - ring->wptr =0 ; -WREG32_SOC15 (GC ,0 , mmCP_RB1_WPTR,lower_32_bits (ring->wptr)); -WREG32_SOC15 (GC ,0 , mmCP_RB1_WPTR_HI,upper_32_bits (ring->wptr)); -/* Set the wb address wether it's enabled or not */ - rptr_addr = adev->wb.gpu_addr + (ring->rptr_offs *4 ); -WREG32_SOC15 (GC ,0 , mmCP_RB1_RPTR_ADDR,lower_32_bits (rptr_addr)); -WREG32_SOC15 (GC ,0 , mmCP_RB1_RPTR_ADDR_HI,upper_32_bits (rptr_addr) & -CP_RB1_RPTR_ADDR_HI__RB_RPTR_ADDR_HI_MASK ); - wptr_gpu_addr = adev->wb.gpu_addr + (ring->wptr_offs *4 ); -WREG32_SOC15 (GC ,0 , mmCP_RB_WPTR_POLL_ADDR_LO, -lower_32_bits (wptr_gpu_addr)); -WREG32_SOC15 (GC ,0 , mmCP_RB_WPTR_POLL_ADDR_HI, -upper_32_bits (wptr_gpu_addr)); - -mdelay (1 ); -WREG32_SOC15 (GC ,0 , mmCP_RB1_CNTL, tmp); - - rb_addr = ring->gpu_addr >>8 ; -WREG32_SOC15 (GC ,0 , mmCP_RB1_BASE, rb_addr); -WREG32_SOC15 (GC ,0 , mmCP_RB1_BASE_HI,upper_32_bits (rb_addr)); -WREG32_SOC15 (GC ,0 , mmCP_RB1_ACTIVE,1 ); - -gfx_v10_0_cp_gfx_set_doorbell (adev, ring); -mutex_unlock (&adev->srbm_mutex); - +if (adev->gfx.num_gfx_rings >1 ) { +mutex_lock (&adev->srbm_mutex); +gfx_v10_0_cp_gfx_switch_pipe (adev,PIPE_ID1 ); +/* maximum supported gfx ring is 2 */ + ring = &adev->gfx.gfx_ring[1 ]; + rb_bufsz =order_base_2 (ring->ring_size /8 ); + tmp =REG_SET_FIELD (0 ,CP_RB1_CNTL ,RB_BUFSZ , rb_bufsz); + tmp =REG_SET_FIELD (tmp,CP_RB1_CNTL ,RB_BLKSZ , rb_bufsz -2 ); +WREG32_SOC15 (GC ,0 , mmCP_RB1_CNTL, tmp); +/* Initialize the ring buffer's write pointers */ + ring->wptr =0 ; +WREG32_SOC15 (GC ,0 , mmCP_RB1_WPTR,lower_32_bits (ring->wptr)); +WREG32_SOC15 (GC ,0 , mmCP_RB1_WPTR_HI,upper_32_bits (ring->wptr)); +/* Set the wb address wether it's enabled or not */ + rptr_addr = adev->wb.gpu_addr + (ring->rptr_offs *4 ); +WREG32_SOC15 (GC ,0 , mmCP_RB1_RPTR_ADDR,lower_32_bits (rptr_addr)); +WREG32_SOC15 (GC ,0 , mmCP_RB1_RPTR_ADDR_HI,upper_32_bits (rptr_addr) & +CP_RB1_RPTR_ADDR_HI__RB_RPTR_ADDR_HI_MASK ); + wptr_gpu_addr = adev->wb.gpu_addr + (ring->wptr_offs *4 ); +WREG32_SOC15 (GC ,0 , mmCP_RB_WPTR_POLL_ADDR_LO, +lower_32_bits (wptr_gpu_addr)); +WREG32_SOC15 (GC ,0 , mmCP_RB_WPTR_POLL_ADDR_HI, +upper_32_bits (wptr_gpu_addr)); + +mdelay (1 ); +WREG32_SOC15 (GC ,0 , mmCP_RB1_CNTL, tmp); + + rb_addr = ring->gpu_addr >>8 ; +WREG32_SOC15 (GC ,0 , mmCP_RB1_BASE, rb_addr); +WREG32_SOC15 (GC ,0 , mmCP_RB1_BASE_HI,upper_32_bits (rb_addr)); +WREG32_SOC15 (GC ,0 , mmCP_RB1_ACTIVE,1 ); + +gfx_v10_0_cp_gfx_set_doorbell (adev, ring); +mutex_unlock (&adev->srbm_mutex); + }/* Switch to pipe 0 */ mutex_lock (&adev->srbm_mutex); gfx_v10_0_cp_gfx_switch_pipe(adev, PIPE_ID0); @@ -3967,7 +3971,8 @@ static int gfx_v10_0_early_init(void *handle) {
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
- adev->gfx.num_gfx_rings = GFX10_NUM_GFX_RINGS;
+ adev->gfx.num_gfx_rings = GFX10_NUM_GFX_RINGS_NV1X;
+
adev->gfx.num_compute_rings = AMDGPU_MAX_COMPUTE_RINGS;
gfx_v10_0_set_kiq_pm4_funcs(adev);--
2.17.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Cmonk.liu%40amd.com%7C76b6cb68c8524e24a71a08d7be8c9b91%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637187383465069039&sdata=5CYyoryFFaDwGEuB%2F1jyI5FuZCM2kM7hUKD2OuKN%2BhU%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx