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

drm/radeon: Fold radeon_set_cursor() into radeon_show_cursor()

Reviewed-by: Grigori Goronzy <greg@chown.ath.cx>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Michel Dänzer and committed by
Alex Deucher
8991668a f3cbb17b

+19 -30
+19 -30
drivers/gpu/drm/radeon/radeon_cursor.c
··· 91 91 struct radeon_device *rdev = crtc->dev->dev_private; 92 92 93 93 if (ASIC_IS_DCE4(rdev)) { 94 + WREG32(EVERGREEN_CUR_SURFACE_ADDRESS_HIGH + radeon_crtc->crtc_offset, 95 + upper_32_bits(radeon_crtc->cursor_addr)); 96 + WREG32(EVERGREEN_CUR_SURFACE_ADDRESS + radeon_crtc->crtc_offset, 97 + lower_32_bits(radeon_crtc->cursor_addr)); 94 98 WREG32(RADEON_MM_INDEX, EVERGREEN_CUR_CONTROL + radeon_crtc->crtc_offset); 95 99 WREG32(RADEON_MM_DATA, EVERGREEN_CURSOR_EN | 96 100 EVERGREEN_CURSOR_MODE(EVERGREEN_CURSOR_24_8_PRE_MULT) | 97 101 EVERGREEN_CURSOR_URGENT_CONTROL(EVERGREEN_CURSOR_URGENT_1_2)); 98 102 } else if (ASIC_IS_AVIVO(rdev)) { 103 + if (rdev->family >= CHIP_RV770) { 104 + if (radeon_crtc->crtc_id) 105 + WREG32(R700_D2CUR_SURFACE_ADDRESS_HIGH, 106 + upper_32_bits(radeon_crtc->cursor_addr)); 107 + else 108 + WREG32(R700_D1CUR_SURFACE_ADDRESS_HIGH, 109 + upper_32_bits(radeon_crtc->cursor_addr)); 110 + } 111 + 112 + WREG32(AVIVO_D1CUR_SURFACE_ADDRESS + radeon_crtc->crtc_offset, 113 + lower_32_bits(radeon_crtc->cursor_addr)); 99 114 WREG32(RADEON_MM_INDEX, AVIVO_D1CUR_CONTROL + radeon_crtc->crtc_offset); 100 115 WREG32(RADEON_MM_DATA, AVIVO_D1CURSOR_EN | 101 116 (AVIVO_D1CURSOR_MODE_24BPP << AVIVO_D1CURSOR_MODE_SHIFT)); 102 117 } else { 118 + /* offset is from DISP(2)_BASE_ADDRESS */ 119 + WREG32(RADEON_CUR_OFFSET + radeon_crtc->crtc_offset, 120 + radeon_crtc->cursor_addr - radeon_crtc->legacy_display_base_addr); 121 + 103 122 switch (radeon_crtc->crtc_id) { 104 123 case 0: 105 124 WREG32(RADEON_MM_INDEX, RADEON_CRTC_GEN_CNTL); ··· 247 228 return ret; 248 229 } 249 230 250 - static void radeon_set_cursor(struct drm_crtc *crtc) 251 - { 252 - struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); 253 - struct radeon_device *rdev = crtc->dev->dev_private; 254 - 255 - if (ASIC_IS_DCE4(rdev)) { 256 - WREG32(EVERGREEN_CUR_SURFACE_ADDRESS_HIGH + radeon_crtc->crtc_offset, 257 - upper_32_bits(radeon_crtc->cursor_addr)); 258 - WREG32(EVERGREEN_CUR_SURFACE_ADDRESS + radeon_crtc->crtc_offset, 259 - lower_32_bits(radeon_crtc->cursor_addr)); 260 - } else if (ASIC_IS_AVIVO(rdev)) { 261 - if (rdev->family >= CHIP_RV770) { 262 - if (radeon_crtc->crtc_id) 263 - WREG32(R700_D2CUR_SURFACE_ADDRESS_HIGH, 264 - upper_32_bits(radeon_crtc->cursor_addr)); 265 - else 266 - WREG32(R700_D1CUR_SURFACE_ADDRESS_HIGH, 267 - upper_32_bits(radeon_crtc->cursor_addr)); 268 - } 269 - WREG32(AVIVO_D1CUR_SURFACE_ADDRESS + radeon_crtc->crtc_offset, 270 - lower_32_bits(radeon_crtc->cursor_addr)); 271 - } else { 272 - /* offset is from DISP(2)_BASE_ADDRESS */ 273 - WREG32(RADEON_CUR_OFFSET + radeon_crtc->crtc_offset, 274 - radeon_crtc->cursor_addr - radeon_crtc->legacy_display_base_addr); 275 - } 276 - } 277 - 278 231 int radeon_crtc_cursor_set2(struct drm_crtc *crtc, 279 232 struct drm_file *file_priv, 280 233 uint32_t handle, ··· 315 324 radeon_crtc->cursor_hot_y = hot_y; 316 325 } 317 326 318 - radeon_set_cursor(crtc); 319 327 radeon_show_cursor(crtc); 320 328 321 329 radeon_lock_cursor(crtc, false); ··· 352 362 radeon_cursor_move_locked(crtc, radeon_crtc->cursor_x, 353 363 radeon_crtc->cursor_y); 354 364 355 - radeon_set_cursor(crtc); 356 365 radeon_show_cursor(crtc); 357 366 358 367 radeon_lock_cursor(crtc, false);