|
52 | 52 | * 1. Primary ring |
53 | 53 | * 2. Async ring |
54 | 54 | */ |
55 | | -#define GFX10_NUM_GFX_RINGS 2 |
| 55 | +#define GFX10_NUM_GFX_RINGS_NV1X 1 |
56 | 56 | #define GFX10_MEC_HPD_SIZE 2048 |
57 | 57 |
|
58 | 58 | #define F32_CE_PROGRAM_RAM_SIZE 65536 |
@@ -1304,7 +1304,7 @@ static int gfx_v10_0_sw_init(void *handle) |
1304 | 1304 | case CHIP_NAVI14: |
1305 | 1305 | case CHIP_NAVI12: |
1306 | 1306 | adev->gfx.me.num_me = 1; |
1307 | | - adev->gfx.me.num_pipe_per_me = 2; |
| 1307 | + adev->gfx.me.num_pipe_per_me = 1; |
1308 | 1308 | adev->gfx.me.num_queue_per_pipe = 1; |
1309 | 1309 | adev->gfx.mec.num_mec = 2; |
1310 | 1310 | adev->gfx.mec.num_pipe_per_mec = 4; |
@@ -2710,18 +2710,20 @@ static int gfx_v10_0_cp_gfx_start(struct amdgpu_device *adev) |
2710 | 2710 | amdgpu_ring_commit(ring); |
2711 | 2711 |
|
2712 | 2712 | /* submit cs packet to copy state 0 to next available state */ |
2713 | | - ring = &adev->gfx.gfx_ring[1]; |
2714 | | - r = amdgpu_ring_alloc(ring, 2); |
2715 | | - if (r) { |
2716 | | - DRM_ERROR("amdgpu: cp failed to lock ring (%d).\n", r); |
2717 | | - return r; |
2718 | | - } |
2719 | | - |
2720 | | - amdgpu_ring_write(ring, PACKET3(PACKET3_CLEAR_STATE, 0)); |
2721 | | - amdgpu_ring_write(ring, 0); |
| 2713 | + if (adev->gfx.num_gfx_rings > 1) { |
| 2714 | + /* maximum supported gfx ring is 2 */ |
| 2715 | + ring = &adev->gfx.gfx_ring[1]; |
| 2716 | + r = amdgpu_ring_alloc(ring, 2); |
| 2717 | + if (r) { |
| 2718 | + DRM_ERROR("amdgpu: cp failed to lock ring (%d).\n", r); |
| 2719 | + return r; |
| 2720 | + } |
2722 | 2721 |
|
2723 | | - amdgpu_ring_commit(ring); |
| 2722 | + amdgpu_ring_write(ring, PACKET3(PACKET3_CLEAR_STATE, 0)); |
| 2723 | + amdgpu_ring_write(ring, 0); |
2724 | 2724 |
|
| 2725 | + amdgpu_ring_commit(ring); |
| 2726 | + } |
2725 | 2727 | return 0; |
2726 | 2728 | } |
2727 | 2729 |
|
@@ -2818,39 +2820,41 @@ static int gfx_v10_0_cp_gfx_resume(struct amdgpu_device *adev) |
2818 | 2820 | mutex_unlock(&adev->srbm_mutex); |
2819 | 2821 |
|
2820 | 2822 | /* Init gfx ring 1 for pipe 1 */ |
2821 | | - mutex_lock(&adev->srbm_mutex); |
2822 | | - gfx_v10_0_cp_gfx_switch_pipe(adev, PIPE_ID1); |
2823 | | - ring = &adev->gfx.gfx_ring[1]; |
2824 | | - rb_bufsz = order_base_2(ring->ring_size / 8); |
2825 | | - tmp = REG_SET_FIELD(0, CP_RB1_CNTL, RB_BUFSZ, rb_bufsz); |
2826 | | - tmp = REG_SET_FIELD(tmp, CP_RB1_CNTL, RB_BLKSZ, rb_bufsz - 2); |
2827 | | - WREG32_SOC15(GC, 0, mmCP_RB1_CNTL, tmp); |
2828 | | - /* Initialize the ring buffer's write pointers */ |
2829 | | - ring->wptr = 0; |
2830 | | - WREG32_SOC15(GC, 0, mmCP_RB1_WPTR, lower_32_bits(ring->wptr)); |
2831 | | - WREG32_SOC15(GC, 0, mmCP_RB1_WPTR_HI, upper_32_bits(ring->wptr)); |
2832 | | - /* Set the wb address wether it's enabled or not */ |
2833 | | - rptr_addr = adev->wb.gpu_addr + (ring->rptr_offs * 4); |
2834 | | - WREG32_SOC15(GC, 0, mmCP_RB1_RPTR_ADDR, lower_32_bits(rptr_addr)); |
2835 | | - WREG32_SOC15(GC, 0, mmCP_RB1_RPTR_ADDR_HI, upper_32_bits(rptr_addr) & |
2836 | | - CP_RB1_RPTR_ADDR_HI__RB_RPTR_ADDR_HI_MASK); |
2837 | | - wptr_gpu_addr = adev->wb.gpu_addr + (ring->wptr_offs * 4); |
2838 | | - WREG32_SOC15(GC, 0, mmCP_RB_WPTR_POLL_ADDR_LO, |
2839 | | - lower_32_bits(wptr_gpu_addr)); |
2840 | | - WREG32_SOC15(GC, 0, mmCP_RB_WPTR_POLL_ADDR_HI, |
2841 | | - upper_32_bits(wptr_gpu_addr)); |
2842 | | - |
2843 | | - mdelay(1); |
2844 | | - WREG32_SOC15(GC, 0, mmCP_RB1_CNTL, tmp); |
2845 | | - |
2846 | | - rb_addr = ring->gpu_addr >> 8; |
2847 | | - WREG32_SOC15(GC, 0, mmCP_RB1_BASE, rb_addr); |
2848 | | - WREG32_SOC15(GC, 0, mmCP_RB1_BASE_HI, upper_32_bits(rb_addr)); |
2849 | | - WREG32_SOC15(GC, 0, mmCP_RB1_ACTIVE, 1); |
2850 | | - |
2851 | | - gfx_v10_0_cp_gfx_set_doorbell(adev, ring); |
2852 | | - mutex_unlock(&adev->srbm_mutex); |
2853 | | - |
| 2823 | + if (adev->gfx.num_gfx_rings > 1) { |
| 2824 | + mutex_lock(&adev->srbm_mutex); |
| 2825 | + gfx_v10_0_cp_gfx_switch_pipe(adev, PIPE_ID1); |
| 2826 | + /* maximum supported gfx ring is 2 */ |
| 2827 | + ring = &adev->gfx.gfx_ring[1]; |
| 2828 | + rb_bufsz = order_base_2(ring->ring_size / 8); |
| 2829 | + tmp = REG_SET_FIELD(0, CP_RB1_CNTL, RB_BUFSZ, rb_bufsz); |
| 2830 | + tmp = REG_SET_FIELD(tmp, CP_RB1_CNTL, RB_BLKSZ, rb_bufsz - 2); |
| 2831 | + WREG32_SOC15(GC, 0, mmCP_RB1_CNTL, tmp); |
| 2832 | + /* Initialize the ring buffer's write pointers */ |
| 2833 | + ring->wptr = 0; |
| 2834 | + WREG32_SOC15(GC, 0, mmCP_RB1_WPTR, lower_32_bits(ring->wptr)); |
| 2835 | + WREG32_SOC15(GC, 0, mmCP_RB1_WPTR_HI, upper_32_bits(ring->wptr)); |
| 2836 | + /* Set the wb address wether it's enabled or not */ |
| 2837 | + rptr_addr = adev->wb.gpu_addr + (ring->rptr_offs * 4); |
| 2838 | + WREG32_SOC15(GC, 0, mmCP_RB1_RPTR_ADDR, lower_32_bits(rptr_addr)); |
| 2839 | + WREG32_SOC15(GC, 0, mmCP_RB1_RPTR_ADDR_HI, upper_32_bits(rptr_addr) & |
| 2840 | + CP_RB1_RPTR_ADDR_HI__RB_RPTR_ADDR_HI_MASK); |
| 2841 | + wptr_gpu_addr = adev->wb.gpu_addr + (ring->wptr_offs * 4); |
| 2842 | + WREG32_SOC15(GC, 0, mmCP_RB_WPTR_POLL_ADDR_LO, |
| 2843 | + lower_32_bits(wptr_gpu_addr)); |
| 2844 | + WREG32_SOC15(GC, 0, mmCP_RB_WPTR_POLL_ADDR_HI, |
| 2845 | + upper_32_bits(wptr_gpu_addr)); |
| 2846 | + |
| 2847 | + mdelay(1); |
| 2848 | + WREG32_SOC15(GC, 0, mmCP_RB1_CNTL, tmp); |
| 2849 | + |
| 2850 | + rb_addr = ring->gpu_addr >> 8; |
| 2851 | + WREG32_SOC15(GC, 0, mmCP_RB1_BASE, rb_addr); |
| 2852 | + WREG32_SOC15(GC, 0, mmCP_RB1_BASE_HI, upper_32_bits(rb_addr)); |
| 2853 | + WREG32_SOC15(GC, 0, mmCP_RB1_ACTIVE, 1); |
| 2854 | + |
| 2855 | + gfx_v10_0_cp_gfx_set_doorbell(adev, ring); |
| 2856 | + mutex_unlock(&adev->srbm_mutex); |
| 2857 | + } |
2854 | 2858 | /* Switch to pipe 0 */ |
2855 | 2859 | mutex_lock(&adev->srbm_mutex); |
2856 | 2860 | gfx_v10_0_cp_gfx_switch_pipe(adev, PIPE_ID0); |
@@ -3967,7 +3971,8 @@ static int gfx_v10_0_early_init(void *handle) |
3967 | 3971 | { |
3968 | 3972 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
3969 | 3973 |
|
3970 | | - adev->gfx.num_gfx_rings = GFX10_NUM_GFX_RINGS; |
| 3974 | + adev->gfx.num_gfx_rings = GFX10_NUM_GFX_RINGS_NV1X; |
| 3975 | + |
3971 | 3976 | adev->gfx.num_compute_rings = AMDGPU_MAX_COMPUTE_RINGS; |
3972 | 3977 |
|
3973 | 3978 | gfx_v10_0_set_kiq_pm4_funcs(adev); |
|
0 commit comments