drm/radeon: Clean up rest of amdkfd support
Subsystems (2)
cover drm/radeon: Clean up rest of amdkfd support
From: Michel Dänzer <[email protected]>
The first four patches are mostly straight reverts of changes which were made for amdkfd support, patch 5 cleans up a leftover define.
Michel Dänzer (5):
Revert "drm/radeon: adding synchronization for GRBM GFX" Revert "drm/radeon: Report doorbell configuration to amdkfd" Revert "drm/radeon/cik: Don't touch int of pipes 1-7" Revert "drm/radeon: reduce number of free VMIDs and pipes in KV" drm/radeon: Remove KFD_CIK_SDMA_QUEUE_OFFSET
drivers/gpu/drm/radeon/cik.c | 114 +++++++++++++++++++++++---------- drivers/gpu/drm/radeon/cik_reg.h | 2 - drivers/gpu/drm/radeon/radeon.h | 6 -- drivers/gpu/drm/radeon/radeon_device.c | 32 --------- 4 files changed, 81 insertions(+), 73 deletions(-)
Signature · 6 lines
2.15.0 _______________________________________________ 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): 20171129172453.4953-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org
PATCH 1/5 Revert "drm/radeon: adding synchronization for GRBM GFX"
From: Michel Dänzer <[email protected]>
This reverts commit 1c0a46255f8d7daf5b601668836e185fd1294e94. Not needed anymore, since amdkfd is no longer supported with radeon.
--- drivers/gpu/drm/radeon/cik.c | 26 -------------------------- drivers/gpu/drm/radeon/radeon.h | 2 -- drivers/gpu/drm/radeon/radeon_device.c | 1 - 3 files changed, 29 deletions(-)
drivers/gpu/drm/radeon/cik.c +0 -26
@@ -1627,8 +1627,6 @@ static const u32 godavari_golden_registers[] =static void cik_init_golden_registers (struct radeon_device *rdev) { -/* Some of the registers might be dependent on GRBM_GFX_INDEX */ -mutex_lock (&rdev->grbm_idx_mutex);switch (rdev->family) {case CHIP_BONAIRE : radeon_program_register_sequence(rdev,
@@ -1703,7 +1701,6 @@ static void cik_init_golden_registers(struct radeon_device *rdev)default :break ; } -mutex_unlock (&rdev->grbm_idx_mutex); }/**
@@ -3120,7 +3117,6 @@ static void cik_setup_rb(struct radeon_device *rdev,u32 disabled_rbs =0 ;u32 enabled_rbs =0 ; -mutex_lock (&rdev->grbm_idx_mutex);for (i =0 ; i < se_num; i++) {for (j =0 ; j < sh_per_se; j++) {cik_select_se_sh (rdev, i, j);
@@ -3132,7 +3128,6 @@ static void cik_setup_rb(struct radeon_device *rdev, } }cik_select_se_sh (rdev,0xffffffff ,0xffffffff ); -mutex_unlock (&rdev->grbm_idx_mutex); mask =1 ;for (i =0 ; i < max_rb_num_per_se * se_num; i++) {
@@ -3143,7 +3138,6 @@ static void cik_setup_rb(struct radeon_device *rdev, rdev->config.cik.backend_enable_mask = enabled_rbs; -mutex_lock (&rdev->grbm_idx_mutex);for (i =0 ; i < se_num; i++) {cik_select_se_sh (rdev, i,0xffffffff ); data =0 ;
@@ -3171,7 +3165,6 @@ static void cik_setup_rb(struct radeon_device *rdev,WREG32 (PA_SC_RASTER_CONFIG , data); }cik_select_se_sh (rdev,0xffffffff ,0xffffffff ); -mutex_unlock (&rdev->grbm_idx_mutex); }/**
@@ -3391,12 +3384,6 @@ static void cik_gpu_init(struct radeon_device *rdev)/* set HW defaults for 3D engine */ WREG32 (CP_MEQ_THRESHOLDS ,MEQ1_START (0x30 ) |MEQ2_START (0x60 )); -mutex_lock (&rdev->grbm_idx_mutex); -/* -* making sure that the following register writes will be broadcasted -* to all the shaders -*/ -cik_select_se_sh (rdev,0xffffffff ,0xffffffff );WREG32 (SX_DEBUG_1 ,0x20 );WREG32 (TA_CNTL_AUX ,0x00010000 );
@@ -3452,7 +3439,6 @@ static void cik_gpu_init(struct radeon_device *rdev)WREG32 (PA_CL_ENHANCE ,CLIP_VTX_REORDER_ENA |NUM_CLIP_SEQ (3 ));WREG32 (PA_SC_ENHANCE ,ENABLE_PA_SC_OUT_OF_ORDER ); -mutex_unlock (&rdev->grbm_idx_mutex);udelay (50 ); }
@@ -5830,7 +5816,6 @@ static void cik_wait_for_rlc_serdes(struct radeon_device *rdev)u32 i, j, k;u32 mask; -mutex_lock (&rdev->grbm_idx_mutex);for (i =0 ; i < rdev->config.cik.max_shader_engines; i++) {for (j =0 ; j < rdev->config.cik.max_sh_per_se; j++) {cik_select_se_sh (rdev, i, j);
@@ -5842,7 +5827,6 @@ static void cik_wait_for_rlc_serdes(struct radeon_device *rdev) } }cik_select_se_sh (rdev,0xffffffff ,0xffffffff ); -mutex_unlock (&rdev->grbm_idx_mutex); mask =SE_MASTER_BUSY_MASK |GC_MASTER_BUSY |TC0_MASTER_BUSY |TC1_MASTER_BUSY ;for (k =0 ; k < rdev->usec_timeout; k++) {
@@ -5977,12 +5961,10 @@ static int cik_rlc_resume(struct radeon_device *rdev)WREG32 (RLC_LB_CNTR_INIT ,0 );WREG32 (RLC_LB_CNTR_MAX ,0x00008000 ); -mutex_lock (&rdev->grbm_idx_mutex);cik_select_se_sh (rdev,0xffffffff ,0xffffffff );WREG32 (RLC_LB_INIT_CU_MASK ,0xffffffff );WREG32 (RLC_LB_PARAMS ,0x00600408 );WREG32 (RLC_LB_CNTL ,0x80000004 ); -mutex_unlock (&rdev->grbm_idx_mutex);WREG32 (RLC_MC_CNTL ,0 );WREG32 (RLC_UCODE_CNTL ,0 );
@@ -6049,13 +6031,11 @@ static void cik_enable_cgcg(struct radeon_device *rdev, bool enable) tmp =cik_halt_rlc (rdev); -mutex_lock (&rdev->grbm_idx_mutex);cik_select_se_sh (rdev,0xffffffff ,0xffffffff );WREG32 (RLC_SERDES_WR_CU_MASTER_MASK ,0xffffffff );WREG32 (RLC_SERDES_WR_NONCU_MASTER_MASK ,0xffffffff ); tmp2 =BPM_ADDR_MASK |CGCG_OVERRIDE_0 |CGLS_ENABLE ;WREG32 (RLC_SERDES_WR_CTRL , tmp2); -mutex_unlock (&rdev->grbm_idx_mutex);cik_update_rlc (rdev, tmp);
@@ -6098,13 +6078,11 @@ static void cik_enable_mgcg(struct radeon_device *rdev, bool enable) tmp =cik_halt_rlc (rdev); -mutex_lock (&rdev->grbm_idx_mutex);cik_select_se_sh (rdev,0xffffffff ,0xffffffff );WREG32 (RLC_SERDES_WR_CU_MASTER_MASK ,0xffffffff );WREG32 (RLC_SERDES_WR_NONCU_MASTER_MASK ,0xffffffff ); data =BPM_ADDR_MASK |MGCG_OVERRIDE_0 ;WREG32 (RLC_SERDES_WR_CTRL , data); -mutex_unlock (&rdev->grbm_idx_mutex);cik_update_rlc (rdev, tmp);
@@ -6148,13 +6126,11 @@ static void cik_enable_mgcg(struct radeon_device *rdev, bool enable) tmp =cik_halt_rlc (rdev); -mutex_lock (&rdev->grbm_idx_mutex);cik_select_se_sh (rdev,0xffffffff ,0xffffffff );WREG32 (RLC_SERDES_WR_CU_MASTER_MASK ,0xffffffff );WREG32 (RLC_SERDES_WR_NONCU_MASTER_MASK ,0xffffffff ); data =BPM_ADDR_MASK |MGCG_OVERRIDE_1 ;WREG32 (RLC_SERDES_WR_CTRL , data); -mutex_unlock (&rdev->grbm_idx_mutex);cik_update_rlc (rdev, tmp); }
@@ -6583,12 +6559,10 @@ static u32 cik_get_cu_active_bitmap(struct radeon_device *rdev, u32 se, u32 sh)u32 mask =0 , tmp, tmp1;int i; -mutex_lock (&rdev->grbm_idx_mutex);cik_select_se_sh (rdev, se, sh); tmp =RREG32 (CC_GC_SHADER_ARRAY_CONFIG ); tmp1 =RREG32 (GC_USER_SHADER_ARRAY_CONFIG );cik_select_se_sh (rdev,0xffffffff ,0xffffffff ); -mutex_unlock (&rdev->grbm_idx_mutex); tmp &=0xffff0000 ;
drivers/gpu/drm/radeon/radeon.h +0 -2
@@ -2442,8 +2442,6 @@ struct radeon_device {struct radeon_atcs atcs;/* srbm instance registers */ struct mutex srbm_mutex; -/* GRBM index mutex. Protects concurrents access to GRBM index */ -struct mutex grbm_idx_mutex;/* clock, powergating flags */ u32 cg_flags;u32 pg_flags;
drivers/gpu/drm/radeon/radeon_device.c +0 -1
@@ -1341,7 +1341,6 @@ int radeon_device_init(struct radeon_device *rdev,mutex_init (&rdev->pm.mutex);mutex_init (&rdev->gpu_clock_mutex);mutex_init (&rdev->srbm_mutex); -mutex_init (&rdev->grbm_idx_mutex);init_rwsem (&rdev->pm.mclk_lock);init_rwsem (&rdev->exclusive_lock);init_waitqueue_head (&rdev->irq.vblank_queue);
Signature · 6 lines
2.15.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/5 Revert "drm/radeon: Report doorbell configuration to amdkfd"
In reply to a message not in the archiveFrom: Michel Dänzer <[email protected]>
This reverts commit ebff8453d3a57a2405c4d96d9f9c4f4acc7d4d79. Unused since amdkfd is no longer supported with radeon.
--- drivers/gpu/drm/radeon/radeon.h | 4 ---- drivers/gpu/drm/radeon/radeon_device.c | 31 ------------------------------- 2 files changed, 35 deletions(-)
drivers/gpu/drm/radeon/radeon.h +0 -4
@@ -731,10 +731,6 @@ struct radeon_doorbell {int radeon_doorbell_get (struct radeon_device *rdev,u32 *page);void radeon_doorbell_free (struct radeon_device *rdev,u32 doorbell); -void radeon_doorbell_get_kfd_info (struct radeon_device *rdev, -phys_addr_t *aperture_base, -size_t *aperture_size, -size_t *start_offset);/* * IRQS.
drivers/gpu/drm/radeon/radeon_device.c +0 -31
@@ -392,37 +392,6 @@ void radeon_doorbell_free(struct radeon_device *rdev, u32 doorbell)__clear_bit (doorbell, rdev->doorbell.used); } -/** -* radeon_doorbell_get_kfd_info - Report doorbell configuration required to -* setup KFD -* -* @rdev: radeon_device pointer -* @aperture_base: output returning doorbell aperture base physical address -* @aperture_size: output returning doorbell aperture size in bytes -* @start_offset: output returning # of doorbell bytes reserved for radeon. -* -* Radeon and the KFD share the doorbell aperture. Radeon sets it up, -* takes doorbells required for its own rings and reports the setup to KFD. -* Radeon reserved doorbells are at the start of the doorbell aperture. -*/ -void radeon_doorbell_get_kfd_info (struct radeon_device *rdev, -phys_addr_t *aperture_base, -size_t *aperture_size, -size_t *start_offset) -{ -/* The first num_doorbells are used by radeon. -* KFD takes whatever's left in the aperture. */ -if (rdev->doorbell.size > rdev->doorbell.num_doorbells *sizeof (u32)) { - *aperture_base = rdev->doorbell.base; - *aperture_size = rdev->doorbell.size; - *start_offset = rdev->doorbell.num_doorbells *sizeof (u32); - }else { - *aperture_base =0 ; - *aperture_size =0 ; - *start_offset =0 ; - } -} -/* * radeon_wb_*() * Writeback is the the method by which the the GPU updates special pages
Signature · 6 lines
2.15.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/5 Revert "drm/radeon/cik: Don't touch int of pipes 1-7"
In reply to a message not in the archiveFrom: Michel Dänzer <[email protected]>
This reverts commit 28b57b856b635ea0d44f1281e2efdc963c100ea3. radeon doesn't support amdkfd anymore, so the latter doesn't set up interrupts for pipes 1-7.
--- drivers/gpu/drm/radeon/cik.c | 71 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-)
drivers/gpu/drm/radeon/cik.c +70 -1
@@ -7048,7 +7048,8 @@ static int cik_irq_init(struct radeon_device *rdev)int cik_irq_set (struct radeon_device *rdev) {u32 cp_int_cntl; -u32 cp_m1p0; +u32 cp_m1p0, cp_m1p1, cp_m1p2, cp_m1p3; +u32 cp_m2p0, cp_m2p1, cp_m2p2, cp_m2p3;u32 crtc1 =0 , crtc2 =0 , crtc3 =0 , crtc4 =0 , crtc5 =0 , crtc6 =0 ;u32 hpd1, hpd2, hpd3, hpd4, hpd5, hpd6;u32 grbm_int_cntl =0 ;
@@ -7081,6 +7082,13 @@ int cik_irq_set(struct radeon_device *rdev) dma_cntl1 =RREG32 (SDMA0_CNTL +SDMA1_REGISTER_OFFSET ) & ~TRAP_ENABLE ; cp_m1p0 =RREG32 (CP_ME1_PIPE0_INT_CNTL ) & ~TIME_STAMP_INT_ENABLE ; + cp_m1p1 =RREG32 (CP_ME1_PIPE1_INT_CNTL ) & ~TIME_STAMP_INT_ENABLE ; + cp_m1p2 =RREG32 (CP_ME1_PIPE2_INT_CNTL ) & ~TIME_STAMP_INT_ENABLE ; + cp_m1p3 =RREG32 (CP_ME1_PIPE3_INT_CNTL ) & ~TIME_STAMP_INT_ENABLE ; + cp_m2p0 =RREG32 (CP_ME2_PIPE0_INT_CNTL ) & ~TIME_STAMP_INT_ENABLE ; + cp_m2p1 =RREG32 (CP_ME2_PIPE1_INT_CNTL ) & ~TIME_STAMP_INT_ENABLE ; + cp_m2p2 =RREG32 (CP_ME2_PIPE2_INT_CNTL ) & ~TIME_STAMP_INT_ENABLE ; + cp_m2p3 =RREG32 (CP_ME2_PIPE3_INT_CNTL ) & ~TIME_STAMP_INT_ENABLE ;/* enable CP interrupts on all rings */ if (atomic_read (&rdev->irq.ring_int[RADEON_RING_TYPE_GFX_INDEX ])) {
@@ -7095,6 +7103,33 @@ int cik_irq_set(struct radeon_device *rdev)case 0 : cp_m1p0 |=TIME_STAMP_INT_ENABLE ;break ; +case 1 : + cp_m1p1 |=TIME_STAMP_INT_ENABLE ; +break ; +case 2 : + cp_m1p2 |=TIME_STAMP_INT_ENABLE ; +break ; +case 3 : + cp_m1p2 |=TIME_STAMP_INT_ENABLE ; +break ; +default : +DRM_DEBUG ("si_irq_set: sw int cp1 invalid pipe %d\n" , ring->pipe); +break ; + } + }else if (ring->me ==2 ) { +switch (ring->pipe) { +case 0 : + cp_m2p0 |=TIME_STAMP_INT_ENABLE ; +break ; +case 1 : + cp_m2p1 |=TIME_STAMP_INT_ENABLE ; +break ; +case 2 : + cp_m2p2 |=TIME_STAMP_INT_ENABLE ; +break ; +case 3 : + cp_m2p2 |=TIME_STAMP_INT_ENABLE ; +break ;default :DRM_DEBUG ("si_irq_set: sw int cp1 invalid pipe %d\n" , ring->pipe);break ;
@@ -7111,6 +7146,33 @@ int cik_irq_set(struct radeon_device *rdev)case 0 : cp_m1p0 |=TIME_STAMP_INT_ENABLE ;break ; +case 1 : + cp_m1p1 |=TIME_STAMP_INT_ENABLE ; +break ; +case 2 : + cp_m1p2 |=TIME_STAMP_INT_ENABLE ; +break ; +case 3 : + cp_m1p2 |=TIME_STAMP_INT_ENABLE ; +break ; +default : +DRM_DEBUG ("si_irq_set: sw int cp2 invalid pipe %d\n" , ring->pipe); +break ; + } + }else if (ring->me ==2 ) { +switch (ring->pipe) { +case 0 : + cp_m2p0 |=TIME_STAMP_INT_ENABLE ; +break ; +case 1 : + cp_m2p1 |=TIME_STAMP_INT_ENABLE ; +break ; +case 2 : + cp_m2p2 |=TIME_STAMP_INT_ENABLE ; +break ; +case 3 : + cp_m2p2 |=TIME_STAMP_INT_ENABLE ; +break ;default :DRM_DEBUG ("si_irq_set: sw int cp2 invalid pipe %d\n" , ring->pipe);break ;
@@ -7191,6 +7253,13 @@ int cik_irq_set(struct radeon_device *rdev)WREG32 (SDMA0_CNTL +SDMA1_REGISTER_OFFSET , dma_cntl1);WREG32 (CP_ME1_PIPE0_INT_CNTL , cp_m1p0); +WREG32 (CP_ME1_PIPE1_INT_CNTL , cp_m1p1); +WREG32 (CP_ME1_PIPE2_INT_CNTL , cp_m1p2); +WREG32 (CP_ME1_PIPE3_INT_CNTL , cp_m1p3); +WREG32 (CP_ME2_PIPE0_INT_CNTL , cp_m2p0); +WREG32 (CP_ME2_PIPE1_INT_CNTL , cp_m2p1); +WREG32 (CP_ME2_PIPE2_INT_CNTL , cp_m2p2); +WREG32 (CP_ME2_PIPE3_INT_CNTL , cp_m2p3);WREG32 (GRBM_INT_CNTL , grbm_int_cntl);
Signature · 6 lines
2.15.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/5 Revert "drm/radeon: reduce number of free VMIDs and pipes in KV"
In reply to a message not in the archiveFrom: Michel Dänzer <[email protected]>
This reverts the remaining changes of commit 62a7b7fbd08ef745bb51e8728e89125a0ba6327e, because radeon doesn't support amdkfd anymore. The number of VMIDs was already changed back when amdkfd support was removed.
--- drivers/gpu/drm/radeon/cik.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-)
drivers/gpu/drm/radeon/cik.c +11 -6
@@ -4418,11 +4418,12 @@ static int cik_mec_init(struct radeon_device *rdev)/* * KV: 2 MEC, 4 Pipes/MEC, 8 Queues/Pipe - 64 Queues total * CI/KB: 1 MEC, 4 Pipes/MEC, 8 Queues/Pipe - 32 Queues total -* Nonetheless, we assign only 1 pipe because all other pipes will -* be handled by KFD */ - rdev->mec.num_mec =1 ; - rdev->mec.num_pipe =1 ; +if (rdev->family ==CHIP_KAVERI ) + rdev->mec.num_mec =2 ; +else + rdev->mec.num_mec =1 ; + rdev->mec.num_pipe =4 ; rdev->mec.num_queue = rdev->mec.num_mec * rdev->mec.num_pipe *8 ;if (rdev->mec.hpd_eop_obj ==NULL ) {
@@ -4565,8 +4566,11 @@ static int cik_cp_compute_resume(struct radeon_device *rdev)/* init the pipes */ mutex_lock (&rdev->srbm_mutex); -for (i =0 ; i < rdev->mec.num_pipe; ++i) { -cik_srbm_select (rdev,0 , i,0 ,0 ); +for (i =0 ; i < (rdev->mec.num_pipe * rdev->mec.num_mec); ++i) { +int me = (i <4 ) ?1 :2 ; +int pipe = (i <4 ) ? i : (i -4 ); + +cik_srbm_select (rdev, me, pipe,0 ,0 ); eop_gpu_addr = rdev->mec.hpd_eop_gpu_addr + (i *MEC_HPD_SIZE *2 ) ;/* write the EOP addr */
@@ -4583,6 +4587,7 @@ static int cik_cp_compute_resume(struct radeon_device *rdev)WREG32 (CP_HPD_EOP_CONTROL , tmp); } +cik_srbm_select (rdev,0 ,0 ,0 ,0 );mutex_unlock (&rdev->srbm_mutex);/* init the queues. Just two for now. */
Signature · 6 lines
2.15.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/5 drm/radeon: Remove KFD_CIK_SDMA_QUEUE_OFFSET
In reply to a message not in the archiveFrom: Michel Dänzer <[email protected]>
Leftover from recently removed amdkfd support.
--- drivers/gpu/drm/radeon/cik_reg.h | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/radeon/cik_reg.h +0 -2
@@ -147,8 +147,6 @@#define CIK_LB_DESKTOP_HEIGHT 0x6b0c -#define KFD_CIK_SDMA_QUEUE_OFFSET 0x200 -#define SQ_IND_INDEX 0x8DE0#define SQ_CMD 0x8DEC#define SQ_IND_DATA 0x8DE4
Signature · 6 lines
2.15.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Christian König
Reviewed-byAm 29.11.2017 um 18:24 schrieb Michel Dänzer:
Quoted 1 line
From: Michel Dänzer <[email protected]>
Quoted 11 lines
The first four patches are mostly straight reverts of changes which were made for amdkfd support, patch 5 cleans up a leftover define.
Michel Dänzer (5):
Revert "drm/radeon: adding synchronization for GRBM GFX" Revert "drm/radeon: Report doorbell configuration to amdkfd" Revert "drm/radeon/cik: Don't touch int of pipes 1-7" Revert "drm/radeon: reduce number of free VMIDs and pipes in KV" drm/radeon: RemoveKFD_CIK_SDMA_QUEUE_OFFSET
Quoted 6 lines
drivers/gpu/drm/radeon/cik.c | 114 +++++++++++++++++++++++---------- drivers/gpu/drm/radeon/cik_reg.h | 2 - drivers/gpu/drm/radeon/radeon.h | 6 -- drivers/gpu/drm/radeon/radeon_device.c | 32 --------- 4 files changed, 81 insertions(+), 73 deletions(-)
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx