Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: add dce_v6_0_soft_reset() to DCE6

DCE6 was missing soft reset, but it was easily identifiable under radeon.
This should be it, pretty much as it is done under DCE8 and DCE10.

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Alexandre Demers and committed by
Alex Deucher
ab23db6d 5f6021d5

+51 -2
+51 -2
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c
··· 371 371 return mmDC_GPIO_HPD_A; 372 372 } 373 373 374 + static bool dce_v6_0_is_display_hung(struct amdgpu_device *adev) 375 + { 376 + u32 crtc_hung = 0; 377 + u32 crtc_status[6]; 378 + u32 i, j, tmp; 379 + 380 + for (i = 0; i < adev->mode_info.num_crtc; i++) { 381 + if (RREG32(mmCRTC_CONTROL + crtc_offsets[i]) & CRTC_CONTROL__CRTC_MASTER_EN_MASK) { 382 + crtc_status[i] = RREG32(mmCRTC_STATUS_HV_COUNT + crtc_offsets[i]); 383 + crtc_hung |= (1 << i); 384 + } 385 + } 386 + 387 + for (j = 0; j < 10; j++) { 388 + for (i = 0; i < adev->mode_info.num_crtc; i++) { 389 + if (crtc_hung & (1 << i)) { 390 + tmp = RREG32(mmCRTC_STATUS_HV_COUNT + crtc_offsets[i]); 391 + if (tmp != crtc_status[i]) 392 + crtc_hung &= ~(1 << i); 393 + } 394 + } 395 + if (crtc_hung == 0) 396 + return false; 397 + udelay(100); 398 + } 399 + 400 + return true; 401 + } 402 + 374 403 static void dce_v6_0_set_vga_render_state(struct amdgpu_device *adev, 375 404 bool render) 376 405 { 377 406 if (!render) 378 407 WREG32(mmVGA_RENDER_CONTROL, 379 408 RREG32(mmVGA_RENDER_CONTROL) & VGA_VSTATUS_CNTL); 380 - 381 409 } 382 410 383 411 static int dce_v6_0_get_num_crtc(struct amdgpu_device *adev) ··· 2914 2886 2915 2887 static int dce_v6_0_soft_reset(struct amdgpu_ip_block *ip_block) 2916 2888 { 2917 - DRM_INFO("xxxx: dce_v6_0_soft_reset --- no impl!!\n"); 2889 + u32 srbm_soft_reset = 0, tmp; 2890 + struct amdgpu_device *adev = ip_block->adev; 2891 + 2892 + if (dce_v6_0_is_display_hung(adev)) 2893 + srbm_soft_reset |= SRBM_SOFT_RESET__SOFT_RESET_DC_MASK; 2894 + 2895 + if (srbm_soft_reset) { 2896 + tmp = RREG32(mmSRBM_SOFT_RESET); 2897 + tmp |= srbm_soft_reset; 2898 + dev_info(adev->dev, "SRBM_SOFT_RESET=0x%08X\n", tmp); 2899 + WREG32(mmSRBM_SOFT_RESET, tmp); 2900 + tmp = RREG32(mmSRBM_SOFT_RESET); 2901 + 2902 + udelay(50); 2903 + 2904 + tmp &= ~srbm_soft_reset; 2905 + WREG32(mmSRBM_SOFT_RESET, tmp); 2906 + tmp = RREG32(mmSRBM_SOFT_RESET); 2907 + 2908 + /* Wait a little for things to settle down */ 2909 + udelay(50); 2910 + } 2918 2911 return 0; 2919 2912 } 2920 2913