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/radeon: For single CRTC GPUs move handling of CRTC_CRT_ON to crtc_dpms().

On all dual CRTC GPUs the CRTC_CRT_ON in the RADEON_CRTC_EXT_CNTL register
controls the CRTC of the primary DAC. Therefore it is set in the DAC DMPS
function.
This is different for GPU's with a single CRTC but a primary and a
TV DAC: here it controls the single CRTC no matter where it is routed.
Therefore we set it here. This avoids an elaborate on/off state tracking
since both primary_dac_dpms() and tv_dac_dpms() functions would have
to touch this bit.
On single CRTC GPUs with just one DAC it's irrelevant where this bit
is handled.

agd5f: fix warning

Signed-off-by: Egbert Eich <eich@suse.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Egbert Eich and committed by
Alex Deucher
f8c4d701 701337dc

+18 -4
+13 -2
drivers/gpu/drm/radeon/radeon_legacy_crtc.c
··· 295 295 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); 296 296 struct drm_device *dev = crtc->dev; 297 297 struct radeon_device *rdev = dev->dev_private; 298 + uint32_t crtc_ext_cntl = 0; 298 299 uint32_t mask; 299 300 300 301 if (radeon_crtc->crtc_id) ··· 308 307 RADEON_CRTC_VSYNC_DIS | 309 308 RADEON_CRTC_HSYNC_DIS); 310 309 310 + /* 311 + * On all dual CRTC GPUs this bit controls the CRTC of the primary DAC. 312 + * Therefore it is set in the DAC DMPS function. 313 + * This is different for GPU's with a single CRTC but a primary and a 314 + * TV DAC: here it controls the single CRTC no matter where it is 315 + * routed. Therefore we set it here. 316 + */ 317 + if (rdev->flags & RADEON_SINGLE_CRTC) 318 + crtc_ext_cntl = RADEON_CRTC_CRT_ON; 319 + 311 320 switch (mode) { 312 321 case DRM_MODE_DPMS_ON: 313 322 radeon_crtc->enabled = true; ··· 328 317 else { 329 318 WREG32_P(RADEON_CRTC_GEN_CNTL, RADEON_CRTC_EN, ~(RADEON_CRTC_EN | 330 319 RADEON_CRTC_DISP_REQ_EN_B)); 331 - WREG32_P(RADEON_CRTC_EXT_CNTL, 0, ~mask); 320 + WREG32_P(RADEON_CRTC_EXT_CNTL, crtc_ext_cntl, ~(mask | crtc_ext_cntl)); 332 321 } 333 322 drm_vblank_post_modeset(dev, radeon_crtc->crtc_id); 334 323 radeon_crtc_load_lut(crtc); ··· 342 331 else { 343 332 WREG32_P(RADEON_CRTC_GEN_CNTL, RADEON_CRTC_DISP_REQ_EN_B, ~(RADEON_CRTC_EN | 344 333 RADEON_CRTC_DISP_REQ_EN_B)); 345 - WREG32_P(RADEON_CRTC_EXT_CNTL, mask, ~mask); 334 + WREG32_P(RADEON_CRTC_EXT_CNTL, mask, ~(mask | crtc_ext_cntl)); 346 335 } 347 336 radeon_crtc->enabled = false; 348 337 /* adjust pm to dpms changes AFTER disabling crtcs */
+5 -2
drivers/gpu/drm/radeon/radeon_legacy_encoders.c
··· 537 537 break; 538 538 } 539 539 540 - WREG32(RADEON_CRTC_EXT_CNTL, crtc_ext_cntl); 540 + /* handled in radeon_crtc_dpms() */ 541 + if (!(rdev->flags & RADEON_SINGLE_CRTC)) 542 + WREG32(RADEON_CRTC_EXT_CNTL, crtc_ext_cntl); 541 543 WREG32(RADEON_DAC_CNTL, dac_cntl); 542 544 WREG32(RADEON_DAC_MACRO_CNTL, dac_macro_cntl); 543 545 ··· 1097 1095 } else { 1098 1096 if (is_tv) 1099 1097 WREG32(RADEON_TV_MASTER_CNTL, tv_master_cntl); 1100 - else 1098 + /* handled in radeon_crtc_dpms() */ 1099 + else if (!(rdev->flags & RADEON_SINGLE_CRTC)) 1101 1100 WREG32(RADEON_CRTC2_GEN_CNTL, crtc2_gen_cntl); 1102 1101 WREG32(RADEON_TV_DAC_CNTL, tv_dac_cntl); 1103 1102 }