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

drm/radeon/kms: Convert RS400/RS480 to new init path & fix legacy VGA (V3)

Also cleanup register specific to RS400/RS480. This patch also fix
legacy VGA register used to disable VGA access we were programming
wrong register. Now we should properly disable VGA on r100 up to
rs400 asics. Note that RS400/RS480 resume is broken, it hangs the
computer while reprogramming dynamic clock, doesn't work either
without that patch. We need to spend more time investigating this
issue. Version 2 of the patch remove dead code that was left
commented out in the previous version. Version 3 correct the
placement on IGP of the VRAM inside GPU address space to match the
stollen RAM placement of IGP.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>

authored by

Jerome Glisse and committed by
Dave Airlie
ca6ffc64 f0ed1f65

+582 -144
+11 -3
drivers/gpu/drm/radeon/r100.c
··· 3100 3100 WREG32(R_000740_CP_CSQ_CNTL, 0); 3101 3101 3102 3102 /* Save few CRTC registers */ 3103 - save->GENMO_WT = RREG32(R_0003C0_GENMO_WT); 3103 + save->GENMO_WT = RREG8(R_0003C2_GENMO_WT); 3104 3104 save->CRTC_EXT_CNTL = RREG32(R_000054_CRTC_EXT_CNTL); 3105 3105 save->CRTC_GEN_CNTL = RREG32(R_000050_CRTC_GEN_CNTL); 3106 3106 save->CUR_OFFSET = RREG32(R_000260_CUR_OFFSET); ··· 3110 3110 } 3111 3111 3112 3112 /* Disable VGA aperture access */ 3113 - WREG32(R_0003C0_GENMO_WT, C_0003C0_VGA_RAM_EN & save->GENMO_WT); 3113 + WREG8(R_0003C2_GENMO_WT, C_0003C2_VGA_RAM_EN & save->GENMO_WT); 3114 3114 /* Disable cursor, overlay, crtc */ 3115 3115 WREG32(R_000260_CUR_OFFSET, save->CUR_OFFSET | S_000260_CUR_LOCK(1)); 3116 3116 WREG32(R_000054_CRTC_EXT_CNTL, save->CRTC_EXT_CNTL | ··· 3142 3142 rdev->mc.vram_location); 3143 3143 } 3144 3144 /* Restore CRTC registers */ 3145 - WREG32(R_0003C0_GENMO_WT, save->GENMO_WT); 3145 + WREG8(R_0003C2_GENMO_WT, save->GENMO_WT); 3146 3146 WREG32(R_000054_CRTC_EXT_CNTL, save->CRTC_EXT_CNTL); 3147 3147 WREG32(R_000050_CRTC_GEN_CNTL, save->CRTC_GEN_CNTL); 3148 3148 if (!(rdev->flags & RADEON_SINGLE_CRTC)) { 3149 3149 WREG32(R_0003F8_CRTC2_GEN_CNTL, save->CRTC2_GEN_CNTL); 3150 3150 } 3151 + } 3152 + 3153 + void r100_vga_render_disable(struct radeon_device *rdev) 3154 + { 3155 + u32 tmp; 3156 + 3157 + tmp = RREG8(R_0003C2_GENMO_WT); 3158 + WREG8(R_0003C2_GENMO_WT, C_0003C2_VGA_RAM_EN & tmp); 3151 3159 }
+19 -19
drivers/gpu/drm/radeon/r100d.h
··· 403 403 #define S_000360_CUR2_LOCK(x) (((x) & 0x1) << 31) 404 404 #define G_000360_CUR2_LOCK(x) (((x) >> 31) & 0x1) 405 405 #define C_000360_CUR2_LOCK 0x7FFFFFFF 406 - #define R_0003C0_GENMO_WT 0x0003C0 407 - #define S_0003C0_GENMO_MONO_ADDRESS_B(x) (((x) & 0x1) << 0) 408 - #define G_0003C0_GENMO_MONO_ADDRESS_B(x) (((x) >> 0) & 0x1) 409 - #define C_0003C0_GENMO_MONO_ADDRESS_B 0xFFFFFFFE 410 - #define S_0003C0_VGA_RAM_EN(x) (((x) & 0x1) << 1) 411 - #define G_0003C0_VGA_RAM_EN(x) (((x) >> 1) & 0x1) 412 - #define C_0003C0_VGA_RAM_EN 0xFFFFFFFD 413 - #define S_0003C0_VGA_CKSEL(x) (((x) & 0x3) << 2) 414 - #define G_0003C0_VGA_CKSEL(x) (((x) >> 2) & 0x3) 415 - #define C_0003C0_VGA_CKSEL 0xFFFFFFF3 416 - #define S_0003C0_ODD_EVEN_MD_PGSEL(x) (((x) & 0x1) << 5) 417 - #define G_0003C0_ODD_EVEN_MD_PGSEL(x) (((x) >> 5) & 0x1) 418 - #define C_0003C0_ODD_EVEN_MD_PGSEL 0xFFFFFFDF 419 - #define S_0003C0_VGA_HSYNC_POL(x) (((x) & 0x1) << 6) 420 - #define G_0003C0_VGA_HSYNC_POL(x) (((x) >> 6) & 0x1) 421 - #define C_0003C0_VGA_HSYNC_POL 0xFFFFFFBF 422 - #define S_0003C0_VGA_VSYNC_POL(x) (((x) & 0x1) << 7) 423 - #define G_0003C0_VGA_VSYNC_POL(x) (((x) >> 7) & 0x1) 424 - #define C_0003C0_VGA_VSYNC_POL 0xFFFFFF7F 406 + #define R_0003C2_GENMO_WT 0x0003C0 407 + #define S_0003C2_GENMO_MONO_ADDRESS_B(x) (((x) & 0x1) << 0) 408 + #define G_0003C2_GENMO_MONO_ADDRESS_B(x) (((x) >> 0) & 0x1) 409 + #define C_0003C2_GENMO_MONO_ADDRESS_B 0xFE 410 + #define S_0003C2_VGA_RAM_EN(x) (((x) & 0x1) << 1) 411 + #define G_0003C2_VGA_RAM_EN(x) (((x) >> 1) & 0x1) 412 + #define C_0003C2_VGA_RAM_EN 0xFD 413 + #define S_0003C2_VGA_CKSEL(x) (((x) & 0x3) << 2) 414 + #define G_0003C2_VGA_CKSEL(x) (((x) >> 2) & 0x3) 415 + #define C_0003C2_VGA_CKSEL 0xF3 416 + #define S_0003C2_ODD_EVEN_MD_PGSEL(x) (((x) & 0x1) << 5) 417 + #define G_0003C2_ODD_EVEN_MD_PGSEL(x) (((x) >> 5) & 0x1) 418 + #define C_0003C2_ODD_EVEN_MD_PGSEL 0xDF 419 + #define S_0003C2_VGA_HSYNC_POL(x) (((x) & 0x1) << 6) 420 + #define G_0003C2_VGA_HSYNC_POL(x) (((x) >> 6) & 0x1) 421 + #define C_0003C2_VGA_HSYNC_POL 0xBF 422 + #define S_0003C2_VGA_VSYNC_POL(x) (((x) & 0x1) << 7) 423 + #define G_0003C2_VGA_VSYNC_POL(x) (((x) >> 7) & 0x1) 424 + #define C_0003C2_VGA_VSYNC_POL 0x7F 425 425 #define R_0003F8_CRTC2_GEN_CNTL 0x0003F8 426 426 #define S_0003F8_CRTC2_DBL_SCAN_EN(x) (((x) & 0x1) << 0) 427 427 #define G_0003F8_CRTC2_DBL_SCAN_EN(x) (((x) >> 0) & 0x1)
+15 -1
drivers/gpu/drm/radeon/r300.c
··· 33 33 #include "radeon_drm.h" 34 34 #include "r100_track.h" 35 35 #include "r300d.h" 36 + #include "rv350d.h" 36 37 37 38 #include "r300_reg_safe.h" 38 39 ··· 64 63 * Some of these functions might be used by newer ASICs. 65 64 */ 66 65 void r300_gpu_init(struct radeon_device *rdev); 67 - int r300_mc_wait_for_idle(struct radeon_device *rdev); 68 66 int rv370_debugfs_pcie_gart_info_init(struct radeon_device *rdev); 69 67 70 68 ··· 1264 1264 S_000148_MC_FB_START(rdev->mc.vram_start >> 16) | 1265 1265 S_000148_MC_FB_TOP(rdev->mc.vram_end >> 16)); 1266 1266 r100_mc_resume(rdev, &save); 1267 + } 1268 + 1269 + void r300_clock_startup(struct radeon_device *rdev) 1270 + { 1271 + u32 tmp; 1272 + 1273 + if (radeon_dynclks != -1 && radeon_dynclks) 1274 + radeon_legacy_set_clock_gating(rdev, 1); 1275 + /* We need to force on some of the block */ 1276 + tmp = RREG32_PLL(R_00000D_SCLK_CNTL); 1277 + tmp |= S_00000D_FORCE_CP(1) | S_00000D_FORCE_VIP(1); 1278 + if ((rdev->family == CHIP_RV350) || (rdev->family == CHIP_RV380)) 1279 + tmp |= S_00000D_FORCE_VAP(1); 1280 + WREG32_PLL(R_00000D_SCLK_CNTL, tmp); 1267 1281 }
+92
drivers/gpu/drm/radeon/r300d.h
··· 98 98 #define C_000170_AGP_BASE_ADDR 0x00000000 99 99 100 100 101 + #define R_00000D_SCLK_CNTL 0x00000D 102 + #define S_00000D_SCLK_SRC_SEL(x) (((x) & 0x7) << 0) 103 + #define G_00000D_SCLK_SRC_SEL(x) (((x) >> 0) & 0x7) 104 + #define C_00000D_SCLK_SRC_SEL 0xFFFFFFF8 105 + #define S_00000D_CP_MAX_DYN_STOP_LAT(x) (((x) & 0x1) << 3) 106 + #define G_00000D_CP_MAX_DYN_STOP_LAT(x) (((x) >> 3) & 0x1) 107 + #define C_00000D_CP_MAX_DYN_STOP_LAT 0xFFFFFFF7 108 + #define S_00000D_HDP_MAX_DYN_STOP_LAT(x) (((x) & 0x1) << 4) 109 + #define G_00000D_HDP_MAX_DYN_STOP_LAT(x) (((x) >> 4) & 0x1) 110 + #define C_00000D_HDP_MAX_DYN_STOP_LAT 0xFFFFFFEF 111 + #define S_00000D_TV_MAX_DYN_STOP_LAT(x) (((x) & 0x1) << 5) 112 + #define G_00000D_TV_MAX_DYN_STOP_LAT(x) (((x) >> 5) & 0x1) 113 + #define C_00000D_TV_MAX_DYN_STOP_LAT 0xFFFFFFDF 114 + #define S_00000D_E2_MAX_DYN_STOP_LAT(x) (((x) & 0x1) << 6) 115 + #define G_00000D_E2_MAX_DYN_STOP_LAT(x) (((x) >> 6) & 0x1) 116 + #define C_00000D_E2_MAX_DYN_STOP_LAT 0xFFFFFFBF 117 + #define S_00000D_SE_MAX_DYN_STOP_LAT(x) (((x) & 0x1) << 7) 118 + #define G_00000D_SE_MAX_DYN_STOP_LAT(x) (((x) >> 7) & 0x1) 119 + #define C_00000D_SE_MAX_DYN_STOP_LAT 0xFFFFFF7F 120 + #define S_00000D_IDCT_MAX_DYN_STOP_LAT(x) (((x) & 0x1) << 8) 121 + #define G_00000D_IDCT_MAX_DYN_STOP_LAT(x) (((x) >> 8) & 0x1) 122 + #define C_00000D_IDCT_MAX_DYN_STOP_LAT 0xFFFFFEFF 123 + #define S_00000D_VIP_MAX_DYN_STOP_LAT(x) (((x) & 0x1) << 9) 124 + #define G_00000D_VIP_MAX_DYN_STOP_LAT(x) (((x) >> 9) & 0x1) 125 + #define C_00000D_VIP_MAX_DYN_STOP_LAT 0xFFFFFDFF 126 + #define S_00000D_RE_MAX_DYN_STOP_LAT(x) (((x) & 0x1) << 10) 127 + #define G_00000D_RE_MAX_DYN_STOP_LAT(x) (((x) >> 10) & 0x1) 128 + #define C_00000D_RE_MAX_DYN_STOP_LAT 0xFFFFFBFF 129 + #define S_00000D_PB_MAX_DYN_STOP_LAT(x) (((x) & 0x1) << 11) 130 + #define G_00000D_PB_MAX_DYN_STOP_LAT(x) (((x) >> 11) & 0x1) 131 + #define C_00000D_PB_MAX_DYN_STOP_LAT 0xFFFFF7FF 132 + #define S_00000D_TAM_MAX_DYN_STOP_LAT(x) (((x) & 0x1) << 12) 133 + #define G_00000D_TAM_MAX_DYN_STOP_LAT(x) (((x) >> 12) & 0x1) 134 + #define C_00000D_TAM_MAX_DYN_STOP_LAT 0xFFFFEFFF 135 + #define S_00000D_TDM_MAX_DYN_STOP_LAT(x) (((x) & 0x1) << 13) 136 + #define G_00000D_TDM_MAX_DYN_STOP_LAT(x) (((x) >> 13) & 0x1) 137 + #define C_00000D_TDM_MAX_DYN_STOP_LAT 0xFFFFDFFF 138 + #define S_00000D_RB_MAX_DYN_STOP_LAT(x) (((x) & 0x1) << 14) 139 + #define G_00000D_RB_MAX_DYN_STOP_LAT(x) (((x) >> 14) & 0x1) 140 + #define C_00000D_RB_MAX_DYN_STOP_LAT 0xFFFFBFFF 141 + #define S_00000D_FORCE_DISP2(x) (((x) & 0x1) << 15) 142 + #define G_00000D_FORCE_DISP2(x) (((x) >> 15) & 0x1) 143 + #define C_00000D_FORCE_DISP2 0xFFFF7FFF 144 + #define S_00000D_FORCE_CP(x) (((x) & 0x1) << 16) 145 + #define G_00000D_FORCE_CP(x) (((x) >> 16) & 0x1) 146 + #define C_00000D_FORCE_CP 0xFFFEFFFF 147 + #define S_00000D_FORCE_HDP(x) (((x) & 0x1) << 17) 148 + #define G_00000D_FORCE_HDP(x) (((x) >> 17) & 0x1) 149 + #define C_00000D_FORCE_HDP 0xFFFDFFFF 150 + #define S_00000D_FORCE_DISP1(x) (((x) & 0x1) << 18) 151 + #define G_00000D_FORCE_DISP1(x) (((x) >> 18) & 0x1) 152 + #define C_00000D_FORCE_DISP1 0xFFFBFFFF 153 + #define S_00000D_FORCE_TOP(x) (((x) & 0x1) << 19) 154 + #define G_00000D_FORCE_TOP(x) (((x) >> 19) & 0x1) 155 + #define C_00000D_FORCE_TOP 0xFFF7FFFF 156 + #define S_00000D_FORCE_E2(x) (((x) & 0x1) << 20) 157 + #define G_00000D_FORCE_E2(x) (((x) >> 20) & 0x1) 158 + #define C_00000D_FORCE_E2 0xFFEFFFFF 159 + #define S_00000D_FORCE_SE(x) (((x) & 0x1) << 21) 160 + #define G_00000D_FORCE_SE(x) (((x) >> 21) & 0x1) 161 + #define C_00000D_FORCE_SE 0xFFDFFFFF 162 + #define S_00000D_FORCE_IDCT(x) (((x) & 0x1) << 22) 163 + #define G_00000D_FORCE_IDCT(x) (((x) >> 22) & 0x1) 164 + #define C_00000D_FORCE_IDCT 0xFFBFFFFF 165 + #define S_00000D_FORCE_VIP(x) (((x) & 0x1) << 23) 166 + #define G_00000D_FORCE_VIP(x) (((x) >> 23) & 0x1) 167 + #define C_00000D_FORCE_VIP 0xFF7FFFFF 168 + #define S_00000D_FORCE_RE(x) (((x) & 0x1) << 24) 169 + #define G_00000D_FORCE_RE(x) (((x) >> 24) & 0x1) 170 + #define C_00000D_FORCE_RE 0xFEFFFFFF 171 + #define S_00000D_FORCE_PB(x) (((x) & 0x1) << 25) 172 + #define G_00000D_FORCE_PB(x) (((x) >> 25) & 0x1) 173 + #define C_00000D_FORCE_PB 0xFDFFFFFF 174 + #define S_00000D_FORCE_TAM(x) (((x) & 0x1) << 26) 175 + #define G_00000D_FORCE_TAM(x) (((x) >> 26) & 0x1) 176 + #define C_00000D_FORCE_TAM 0xFBFFFFFF 177 + #define S_00000D_FORCE_TDM(x) (((x) & 0x1) << 27) 178 + #define G_00000D_FORCE_TDM(x) (((x) >> 27) & 0x1) 179 + #define C_00000D_FORCE_TDM 0xF7FFFFFF 180 + #define S_00000D_FORCE_RB(x) (((x) & 0x1) << 28) 181 + #define G_00000D_FORCE_RB(x) (((x) >> 28) & 0x1) 182 + #define C_00000D_FORCE_RB 0xEFFFFFFF 183 + #define S_00000D_FORCE_TV_SCLK(x) (((x) & 0x1) << 29) 184 + #define G_00000D_FORCE_TV_SCLK(x) (((x) >> 29) & 0x1) 185 + #define C_00000D_FORCE_TV_SCLK 0xDFFFFFFF 186 + #define S_00000D_FORCE_SUBPIC(x) (((x) & 0x1) << 30) 187 + #define G_00000D_FORCE_SUBPIC(x) (((x) >> 30) & 0x1) 188 + #define C_00000D_FORCE_SUBPIC 0xBFFFFFFF 189 + #define S_00000D_FORCE_OV0(x) (((x) & 0x1) << 31) 190 + #define G_00000D_FORCE_OV0(x) (((x) >> 31) & 0x1) 191 + #define C_00000D_FORCE_OV0 0x7FFFFFFF 192 + 101 193 #endif
+5
drivers/gpu/drm/radeon/r420.c
··· 155 155 static void r420_clock_resume(struct radeon_device *rdev) 156 156 { 157 157 u32 sclk_cntl; 158 + 159 + if (radeon_dynclks != -1 && radeon_dynclks) 160 + radeon_atom_set_clock_gating(rdev, 1); 158 161 sclk_cntl = RREG32_PLL(R_00000D_SCLK_CNTL); 159 162 sclk_cntl |= S_00000D_FORCE_CP(1) | S_00000D_FORCE_VIP(1); 160 163 if (rdev->family == CHIP_R420) ··· 170 167 int r; 171 168 172 169 r300_mc_program(rdev); 170 + /* Resume clock */ 171 + r420_clock_resume(rdev); 173 172 /* Initialize GART (initialize after TTM so we can allocate 174 173 * memory through TTM but finalize after TTM) */ 175 174 if (rdev->flags & RADEON_IS_PCIE) {
+12 -12
drivers/gpu/drm/radeon/r420d.h
··· 212 212 #define S_00000D_FORCE_E2(x) (((x) & 0x1) << 20) 213 213 #define G_00000D_FORCE_E2(x) (((x) >> 20) & 0x1) 214 214 #define C_00000D_FORCE_E2 0xFFEFFFFF 215 - #define S_00000D_FORCE_SE(x) (((x) & 0x1) << 21) 216 - #define G_00000D_FORCE_SE(x) (((x) >> 21) & 0x1) 217 - #define C_00000D_FORCE_SE 0xFFDFFFFF 215 + #define S_00000D_FORCE_VAP(x) (((x) & 0x1) << 21) 216 + #define G_00000D_FORCE_VAP(x) (((x) >> 21) & 0x1) 217 + #define C_00000D_FORCE_VAP 0xFFDFFFFF 218 218 #define S_00000D_FORCE_IDCT(x) (((x) & 0x1) << 22) 219 219 #define G_00000D_FORCE_IDCT(x) (((x) >> 22) & 0x1) 220 220 #define C_00000D_FORCE_IDCT 0xFFBFFFFF ··· 224 224 #define S_00000D_FORCE_RE(x) (((x) & 0x1) << 24) 225 225 #define G_00000D_FORCE_RE(x) (((x) >> 24) & 0x1) 226 226 #define C_00000D_FORCE_RE 0xFEFFFFFF 227 - #define S_00000D_FORCE_PB(x) (((x) & 0x1) << 25) 228 - #define G_00000D_FORCE_PB(x) (((x) >> 25) & 0x1) 229 - #define C_00000D_FORCE_PB 0xFDFFFFFF 227 + #define S_00000D_FORCE_SR(x) (((x) & 0x1) << 25) 228 + #define G_00000D_FORCE_SR(x) (((x) >> 25) & 0x1) 229 + #define C_00000D_FORCE_SR 0xFDFFFFFF 230 230 #define S_00000D_FORCE_PX(x) (((x) & 0x1) << 26) 231 231 #define G_00000D_FORCE_PX(x) (((x) >> 26) & 0x1) 232 232 #define C_00000D_FORCE_PX 0xFBFFFFFF 233 233 #define S_00000D_FORCE_TX(x) (((x) & 0x1) << 27) 234 234 #define G_00000D_FORCE_TX(x) (((x) >> 27) & 0x1) 235 235 #define C_00000D_FORCE_TX 0xF7FFFFFF 236 - #define S_00000D_FORCE_RB(x) (((x) & 0x1) << 28) 237 - #define G_00000D_FORCE_RB(x) (((x) >> 28) & 0x1) 238 - #define C_00000D_FORCE_RB 0xEFFFFFFF 236 + #define S_00000D_FORCE_US(x) (((x) & 0x1) << 28) 237 + #define G_00000D_FORCE_US(x) (((x) >> 28) & 0x1) 238 + #define C_00000D_FORCE_US 0xEFFFFFFF 239 239 #define S_00000D_FORCE_TV_SCLK(x) (((x) & 0x1) << 29) 240 240 #define G_00000D_FORCE_TV_SCLK(x) (((x) >> 29) & 0x1) 241 241 #define C_00000D_FORCE_TV_SCLK 0xDFFFFFFF 242 - #define S_00000D_FORCE_SUBPIC(x) (((x) & 0x1) << 30) 243 - #define G_00000D_FORCE_SUBPIC(x) (((x) >> 30) & 0x1) 244 - #define C_00000D_FORCE_SUBPIC 0xBFFFFFFF 242 + #define S_00000D_FORCE_SU(x) (((x) & 0x1) << 30) 243 + #define G_00000D_FORCE_SU(x) (((x) >> 30) & 0x1) 244 + #define C_00000D_FORCE_SU 0xBFFFFFFF 245 245 #define S_00000D_FORCE_OV0(x) (((x) & 0x1) << 31) 246 246 #define G_00000D_FORCE_OV0(x) (((x) >> 31) & 0x1) 247 247 #define C_00000D_FORCE_OV0 0x7FFFFFFF
+4
drivers/gpu/drm/radeon/radeon.h
··· 994 994 extern void radeon_scratch_init(struct radeon_device *rdev); 995 995 extern void radeon_surface_init(struct radeon_device *rdev); 996 996 extern int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data); 997 + extern void radeon_legacy_set_clock_gating(struct radeon_device *rdev, int enable); 997 998 extern void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable); 998 999 999 1000 /* r100,rv100,rs100,rv200,rs200,r200,rv250,rs300,rv280 */ ··· 1030 1029 extern void r100_hdp_reset(struct radeon_device *rdev); 1031 1030 extern int r100_rb2d_reset(struct radeon_device *rdev); 1032 1031 extern int r100_cp_reset(struct radeon_device *rdev); 1032 + extern void r100_vga_render_disable(struct radeon_device *rdev); 1033 1033 1034 1034 /* r300,r350,rv350,rv370,rv380 */ 1035 1035 extern void r300_set_reg_safe(struct radeon_device *rdev); 1036 1036 extern void r300_mc_program(struct radeon_device *rdev); 1037 1037 extern void r300_vram_info(struct radeon_device *rdev); 1038 + extern void r300_clock_startup(struct radeon_device *rdev); 1039 + extern int r300_mc_wait_for_idle(struct radeon_device *rdev); 1038 1040 extern int rv370_pcie_gart_init(struct radeon_device *rdev); 1039 1041 extern void rv370_pcie_gart_fini(struct radeon_device *rdev); 1040 1042 extern int rv370_pcie_gart_enable(struct radeon_device *rdev);
+22 -23
drivers/gpu/drm/radeon/radeon_asic.h
··· 246 246 /* 247 247 * rs400,rs480 248 248 */ 249 - void rs400_errata(struct radeon_device *rdev); 250 - void rs400_vram_info(struct radeon_device *rdev); 251 - int rs400_mc_init(struct radeon_device *rdev); 252 - void rs400_mc_fini(struct radeon_device *rdev); 253 - int rs400_gart_init(struct radeon_device *rdev); 254 - void rs400_gart_fini(struct radeon_device *rdev); 255 - int rs400_gart_enable(struct radeon_device *rdev); 256 - void rs400_gart_disable(struct radeon_device *rdev); 249 + extern int rs400_init(struct radeon_device *rdev); 250 + extern void rs400_fini(struct radeon_device *rdev); 251 + extern int rs400_suspend(struct radeon_device *rdev); 252 + extern int rs400_resume(struct radeon_device *rdev); 257 253 void rs400_gart_tlb_flush(struct radeon_device *rdev); 258 254 int rs400_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr); 259 255 uint32_t rs400_mc_rreg(struct radeon_device *rdev, uint32_t reg); 260 256 void rs400_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v); 261 257 static struct radeon_asic rs400_asic = { 262 - .init = &r300_init, 263 - .errata = &rs400_errata, 264 - .vram_info = &rs400_vram_info, 258 + .init = &rs400_init, 259 + .fini = &rs400_fini, 260 + .suspend = &rs400_suspend, 261 + .resume = &rs400_resume, 262 + .errata = NULL, 263 + .vram_info = NULL, 265 264 .gpu_reset = &r300_gpu_reset, 266 - .mc_init = &rs400_mc_init, 267 - .mc_fini = &rs400_mc_fini, 268 - .wb_init = &r100_wb_init, 269 - .wb_fini = &r100_wb_fini, 270 - .gart_init = &rs400_gart_init, 271 - .gart_fini = &rs400_gart_fini, 272 - .gart_enable = &rs400_gart_enable, 273 - .gart_disable = &rs400_gart_disable, 265 + .mc_init = NULL, 266 + .mc_fini = NULL, 267 + .wb_init = NULL, 268 + .wb_fini = NULL, 269 + .gart_init = NULL, 270 + .gart_fini = NULL, 271 + .gart_enable = NULL, 272 + .gart_disable = NULL, 274 273 .gart_tlb_flush = &rs400_gart_tlb_flush, 275 274 .gart_set_page = &rs400_gart_set_page, 276 - .cp_init = &r100_cp_init, 277 - .cp_fini = &r100_cp_fini, 278 - .cp_disable = &r100_cp_disable, 275 + .cp_init = NULL, 276 + .cp_fini = NULL, 277 + .cp_disable = NULL, 279 278 .cp_commit = &r100_cp_commit, 280 279 .ring_start = &r300_ring_start, 281 280 .ring_test = &r100_ring_test, 282 281 .ring_ib_execute = &r100_ring_ib_execute, 283 - .ib_test = &r100_ib_test, 282 + .ib_test = NULL, 284 283 .irq_set = &r100_irq_set, 285 284 .irq_process = &r100_irq_process, 286 285 .get_vblank_counter = &r100_get_vblank_counter,
+190 -86
drivers/gpu/drm/radeon/rs400.c
··· 27 27 */ 28 28 #include <linux/seq_file.h> 29 29 #include <drm/drmP.h> 30 - #include "radeon_reg.h" 31 30 #include "radeon.h" 31 + #include "rs400d.h" 32 32 33 - /* rs400,rs480 depends on : */ 34 - void r100_hdp_reset(struct radeon_device *rdev); 35 - void r100_mc_disable_clients(struct radeon_device *rdev); 36 - int r300_mc_wait_for_idle(struct radeon_device *rdev); 37 - void r420_pipes_init(struct radeon_device *rdev); 33 + /* This files gather functions specifics to : rs400,rs480 */ 34 + static int rs400_debugfs_pcie_gart_info_init(struct radeon_device *rdev); 38 35 39 - /* This files gather functions specifics to : 40 - * rs400,rs480 41 - * 42 - * Some of these functions might be used by newer ASICs. 43 - */ 44 - void rs400_gpu_init(struct radeon_device *rdev); 45 - int rs400_debugfs_pcie_gart_info_init(struct radeon_device *rdev); 46 - 47 - 48 - /* 49 - * GART functions. 50 - */ 51 36 void rs400_gart_adjust_size(struct radeon_device *rdev) 52 37 { 53 38 /* Check gart size */ ··· 223 238 return 0; 224 239 } 225 240 226 - 227 - /* 228 - * MC functions. 229 - */ 230 - int rs400_mc_init(struct radeon_device *rdev) 231 - { 232 - uint32_t tmp; 233 - int r; 234 - 235 - if (r100_debugfs_rbbm_init(rdev)) { 236 - DRM_ERROR("Failed to register debugfs file for RBBM !\n"); 237 - } 238 - 239 - rs400_gpu_init(rdev); 240 - rs400_gart_disable(rdev); 241 - rdev->mc.gtt_location = rdev->mc.mc_vram_size; 242 - rdev->mc.gtt_location += (rdev->mc.gtt_size - 1); 243 - rdev->mc.gtt_location &= ~(rdev->mc.gtt_size - 1); 244 - r = radeon_mc_setup(rdev); 245 - if (r) { 246 - return r; 247 - } 248 - 249 - r100_mc_disable_clients(rdev); 250 - if (r300_mc_wait_for_idle(rdev)) { 251 - printk(KERN_WARNING "Failed to wait MC idle while " 252 - "programming pipes. Bad things might happen.\n"); 253 - } 254 - 255 - tmp = rdev->mc.vram_location + rdev->mc.mc_vram_size - 1; 256 - tmp = REG_SET(RADEON_MC_FB_TOP, tmp >> 16); 257 - tmp |= REG_SET(RADEON_MC_FB_START, rdev->mc.vram_location >> 16); 258 - WREG32(RADEON_MC_FB_LOCATION, tmp); 259 - tmp = RREG32(RADEON_HOST_PATH_CNTL) | RADEON_HP_LIN_RD_CACHE_DIS; 260 - WREG32(RADEON_HOST_PATH_CNTL, tmp | RADEON_HDP_SOFT_RESET | RADEON_HDP_READ_BUFFER_INVALIDATE); 261 - (void)RREG32(RADEON_HOST_PATH_CNTL); 262 - WREG32(RADEON_HOST_PATH_CNTL, tmp); 263 - (void)RREG32(RADEON_HOST_PATH_CNTL); 264 - 265 - return 0; 266 - } 267 - 268 - void rs400_mc_fini(struct radeon_device *rdev) 269 - { 270 - } 271 - 272 - 273 - /* 274 - * Global GPU functions 275 - */ 276 - void rs400_errata(struct radeon_device *rdev) 277 - { 278 - rdev->pll_errata = 0; 279 - } 280 - 281 241 void rs400_gpu_init(struct radeon_device *rdev) 282 242 { 283 243 /* FIXME: HDP same place on rs400 ? */ ··· 235 305 } 236 306 } 237 307 238 - 239 - /* 240 - * VRAM info. 241 - */ 242 308 void rs400_vram_info(struct radeon_device *rdev) 243 309 { 244 310 rs400_gart_adjust_size(rdev); ··· 245 319 r100_vram_init_sizes(rdev); 246 320 } 247 321 248 - 249 - /* 250 - * Indirect registers accessor 251 - */ 252 322 uint32_t rs400_mc_rreg(struct radeon_device *rdev, uint32_t reg) 253 323 { 254 324 uint32_t r; ··· 262 340 WREG32(RS480_NB_MC_INDEX, 0xff); 263 341 } 264 342 265 - 266 - /* 267 - * Debugfs info 268 - */ 269 343 #if defined(CONFIG_DEBUG_FS) 270 344 static int rs400_debugfs_gart_info(struct seq_file *m, void *data) 271 345 { ··· 337 419 }; 338 420 #endif 339 421 340 - int rs400_debugfs_pcie_gart_info_init(struct radeon_device *rdev) 422 + static int rs400_debugfs_pcie_gart_info_init(struct radeon_device *rdev) 341 423 { 342 424 #if defined(CONFIG_DEBUG_FS) 343 425 return radeon_debugfs_add_files(rdev, rs400_gart_info_list, 1); 344 426 #else 345 427 return 0; 346 428 #endif 429 + } 430 + 431 + static int rs400_mc_init(struct radeon_device *rdev) 432 + { 433 + int r; 434 + u32 tmp; 435 + 436 + /* Setup GPU memory space */ 437 + tmp = G_00015C_MC_FB_START(RREG32(R_00015C_NB_TOM)); 438 + rdev->mc.vram_location = G_00015C_MC_FB_START(tmp) << 16; 439 + rdev->mc.gtt_location = 0xFFFFFFFFUL; 440 + r = radeon_mc_setup(rdev); 441 + if (r) 442 + return r; 443 + return 0; 444 + } 445 + 446 + void rs400_mc_program(struct radeon_device *rdev) 447 + { 448 + struct r100_mc_save save; 449 + 450 + /* Stops all mc clients */ 451 + r100_mc_stop(rdev, &save); 452 + 453 + /* Wait for mc idle */ 454 + if (r300_mc_wait_for_idle(rdev)) 455 + dev_warn(rdev->dev, "Wait MC idle timeout before updating MC.\n"); 456 + WREG32(R_000148_MC_FB_LOCATION, 457 + S_000148_MC_FB_START(rdev->mc.vram_start >> 16) | 458 + S_000148_MC_FB_TOP(rdev->mc.vram_end >> 16)); 459 + 460 + r100_mc_resume(rdev, &save); 461 + } 462 + 463 + static int rs400_startup(struct radeon_device *rdev) 464 + { 465 + int r; 466 + 467 + rs400_mc_program(rdev); 468 + /* Resume clock */ 469 + r300_clock_startup(rdev); 470 + /* Initialize GPU configuration (# pipes, ...) */ 471 + rs400_gpu_init(rdev); 472 + /* Initialize GART (initialize after TTM so we can allocate 473 + * memory through TTM but finalize after TTM) */ 474 + r = rs400_gart_enable(rdev); 475 + if (r) 476 + return r; 477 + /* Enable IRQ */ 478 + rdev->irq.sw_int = true; 479 + r100_irq_set(rdev); 480 + /* 1M ring buffer */ 481 + r = r100_cp_init(rdev, 1024 * 1024); 482 + if (r) { 483 + dev_err(rdev->dev, "failled initializing CP (%d).\n", r); 484 + return r; 485 + } 486 + r = r100_wb_init(rdev); 487 + if (r) 488 + dev_err(rdev->dev, "failled initializing WB (%d).\n", r); 489 + r = r100_ib_init(rdev); 490 + if (r) { 491 + dev_err(rdev->dev, "failled initializing IB (%d).\n", r); 492 + return r; 493 + } 494 + return 0; 495 + } 496 + 497 + int rs400_resume(struct radeon_device *rdev) 498 + { 499 + /* Make sur GART are not working */ 500 + rs400_gart_disable(rdev); 501 + /* Resume clock before doing reset */ 502 + r300_clock_startup(rdev); 503 + /* Reset gpu before posting otherwise ATOM will enter infinite loop */ 504 + if (radeon_gpu_reset(rdev)) { 505 + dev_warn(rdev->dev, "GPU reset failed ! (0xE40=0x%08X, 0x7C0=0x%08X)\n", 506 + RREG32(R_000E40_RBBM_STATUS), 507 + RREG32(R_0007C0_CP_STAT)); 508 + } 509 + /* post */ 510 + radeon_combios_asic_init(rdev->ddev); 511 + /* Resume clock after posting */ 512 + r300_clock_startup(rdev); 513 + return rs400_startup(rdev); 514 + } 515 + 516 + int rs400_suspend(struct radeon_device *rdev) 517 + { 518 + r100_cp_disable(rdev); 519 + r100_wb_disable(rdev); 520 + r100_irq_disable(rdev); 521 + rs400_gart_disable(rdev); 522 + return 0; 523 + } 524 + 525 + void rs400_fini(struct radeon_device *rdev) 526 + { 527 + rs400_suspend(rdev); 528 + r100_cp_fini(rdev); 529 + r100_wb_fini(rdev); 530 + r100_ib_fini(rdev); 531 + radeon_gem_fini(rdev); 532 + rs400_gart_fini(rdev); 533 + radeon_irq_kms_fini(rdev); 534 + radeon_fence_driver_fini(rdev); 535 + radeon_object_fini(rdev); 536 + radeon_atombios_fini(rdev); 537 + kfree(rdev->bios); 538 + rdev->bios = NULL; 539 + } 540 + 541 + int rs400_init(struct radeon_device *rdev) 542 + { 543 + int r; 544 + 545 + rdev->new_init_path = true; 546 + /* Disable VGA */ 547 + r100_vga_render_disable(rdev); 548 + /* Initialize scratch registers */ 549 + radeon_scratch_init(rdev); 550 + /* Initialize surface registers */ 551 + radeon_surface_init(rdev); 552 + /* TODO: disable VGA need to use VGA request */ 553 + /* BIOS*/ 554 + if (!radeon_get_bios(rdev)) { 555 + if (ASIC_IS_AVIVO(rdev)) 556 + return -EINVAL; 557 + } 558 + if (rdev->is_atom_bios) { 559 + dev_err(rdev->dev, "Expecting combios for RS400/RS480 GPU\n"); 560 + return -EINVAL; 561 + } else { 562 + r = radeon_combios_init(rdev); 563 + if (r) 564 + return r; 565 + } 566 + /* Reset gpu before posting otherwise ATOM will enter infinite loop */ 567 + if (radeon_gpu_reset(rdev)) { 568 + dev_warn(rdev->dev, 569 + "GPU reset failed ! (0xE40=0x%08X, 0x7C0=0x%08X)\n", 570 + RREG32(R_000E40_RBBM_STATUS), 571 + RREG32(R_0007C0_CP_STAT)); 572 + } 573 + /* check if cards are posted or not */ 574 + if (!radeon_card_posted(rdev) && rdev->bios) { 575 + DRM_INFO("GPU not posted. posting now...\n"); 576 + radeon_combios_asic_init(rdev->ddev); 577 + } 578 + /* Initialize clocks */ 579 + radeon_get_clock_info(rdev->ddev); 580 + /* Get vram informations */ 581 + rs400_vram_info(rdev); 582 + /* Initialize memory controller (also test AGP) */ 583 + r = rs400_mc_init(rdev); 584 + if (r) 585 + return r; 586 + /* Fence driver */ 587 + r = radeon_fence_driver_init(rdev); 588 + if (r) 589 + return r; 590 + r = radeon_irq_kms_init(rdev); 591 + if (r) 592 + return r; 593 + /* Memory manager */ 594 + r = radeon_object_init(rdev); 595 + if (r) 596 + return r; 597 + r = rs400_gart_init(rdev); 598 + if (r) 599 + return r; 600 + r300_set_reg_safe(rdev); 601 + rdev->accel_working = true; 602 + r = rs400_startup(rdev); 603 + if (r) { 604 + /* Somethings want wront with the accel init stop accel */ 605 + dev_err(rdev->dev, "Disabling GPU acceleration\n"); 606 + rs400_suspend(rdev); 607 + r100_cp_fini(rdev); 608 + r100_wb_fini(rdev); 609 + r100_ib_fini(rdev); 610 + rs400_gart_fini(rdev); 611 + radeon_irq_kms_fini(rdev); 612 + rdev->accel_working = false; 613 + } 614 + return 0; 347 615 }
+160
drivers/gpu/drm/radeon/rs400d.h
··· 1 + /* 2 + * Copyright 2008 Advanced Micro Devices, Inc. 3 + * Copyright 2008 Red Hat Inc. 4 + * Copyright 2009 Jerome Glisse. 5 + * 6 + * Permission is hereby granted, free of charge, to any person obtaining a 7 + * copy of this software and associated documentation files (the "Software"), 8 + * to deal in the Software without restriction, including without limitation 9 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, 10 + * and/or sell copies of the Software, and to permit persons to whom the 11 + * Software is furnished to do so, subject to the following conditions: 12 + * 13 + * The above copyright notice and this permission notice shall be included in 14 + * all copies or substantial portions of the Software. 15 + * 16 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19 + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 + * OTHER DEALINGS IN THE SOFTWARE. 23 + * 24 + * Authors: Dave Airlie 25 + * Alex Deucher 26 + * Jerome Glisse 27 + */ 28 + #ifndef __RS400D_H__ 29 + #define __RS400D_H__ 30 + 31 + /* Registers */ 32 + #define R_000148_MC_FB_LOCATION 0x000148 33 + #define S_000148_MC_FB_START(x) (((x) & 0xFFFF) << 0) 34 + #define G_000148_MC_FB_START(x) (((x) >> 0) & 0xFFFF) 35 + #define C_000148_MC_FB_START 0xFFFF0000 36 + #define S_000148_MC_FB_TOP(x) (((x) & 0xFFFF) << 16) 37 + #define G_000148_MC_FB_TOP(x) (((x) >> 16) & 0xFFFF) 38 + #define C_000148_MC_FB_TOP 0x0000FFFF 39 + #define R_00015C_NB_TOM 0x00015C 40 + #define S_00015C_MC_FB_START(x) (((x) & 0xFFFF) << 0) 41 + #define G_00015C_MC_FB_START(x) (((x) >> 0) & 0xFFFF) 42 + #define C_00015C_MC_FB_START 0xFFFF0000 43 + #define S_00015C_MC_FB_TOP(x) (((x) & 0xFFFF) << 16) 44 + #define G_00015C_MC_FB_TOP(x) (((x) >> 16) & 0xFFFF) 45 + #define C_00015C_MC_FB_TOP 0x0000FFFF 46 + #define R_0007C0_CP_STAT 0x0007C0 47 + #define S_0007C0_MRU_BUSY(x) (((x) & 0x1) << 0) 48 + #define G_0007C0_MRU_BUSY(x) (((x) >> 0) & 0x1) 49 + #define C_0007C0_MRU_BUSY 0xFFFFFFFE 50 + #define S_0007C0_MWU_BUSY(x) (((x) & 0x1) << 1) 51 + #define G_0007C0_MWU_BUSY(x) (((x) >> 1) & 0x1) 52 + #define C_0007C0_MWU_BUSY 0xFFFFFFFD 53 + #define S_0007C0_RSIU_BUSY(x) (((x) & 0x1) << 2) 54 + #define G_0007C0_RSIU_BUSY(x) (((x) >> 2) & 0x1) 55 + #define C_0007C0_RSIU_BUSY 0xFFFFFFFB 56 + #define S_0007C0_RCIU_BUSY(x) (((x) & 0x1) << 3) 57 + #define G_0007C0_RCIU_BUSY(x) (((x) >> 3) & 0x1) 58 + #define C_0007C0_RCIU_BUSY 0xFFFFFFF7 59 + #define S_0007C0_CSF_PRIMARY_BUSY(x) (((x) & 0x1) << 9) 60 + #define G_0007C0_CSF_PRIMARY_BUSY(x) (((x) >> 9) & 0x1) 61 + #define C_0007C0_CSF_PRIMARY_BUSY 0xFFFFFDFF 62 + #define S_0007C0_CSF_INDIRECT_BUSY(x) (((x) & 0x1) << 10) 63 + #define G_0007C0_CSF_INDIRECT_BUSY(x) (((x) >> 10) & 0x1) 64 + #define C_0007C0_CSF_INDIRECT_BUSY 0xFFFFFBFF 65 + #define S_0007C0_CSQ_PRIMARY_BUSY(x) (((x) & 0x1) << 11) 66 + #define G_0007C0_CSQ_PRIMARY_BUSY(x) (((x) >> 11) & 0x1) 67 + #define C_0007C0_CSQ_PRIMARY_BUSY 0xFFFFF7FF 68 + #define S_0007C0_CSQ_INDIRECT_BUSY(x) (((x) & 0x1) << 12) 69 + #define G_0007C0_CSQ_INDIRECT_BUSY(x) (((x) >> 12) & 0x1) 70 + #define C_0007C0_CSQ_INDIRECT_BUSY 0xFFFFEFFF 71 + #define S_0007C0_CSI_BUSY(x) (((x) & 0x1) << 13) 72 + #define G_0007C0_CSI_BUSY(x) (((x) >> 13) & 0x1) 73 + #define C_0007C0_CSI_BUSY 0xFFFFDFFF 74 + #define S_0007C0_CSF_INDIRECT2_BUSY(x) (((x) & 0x1) << 14) 75 + #define G_0007C0_CSF_INDIRECT2_BUSY(x) (((x) >> 14) & 0x1) 76 + #define C_0007C0_CSF_INDIRECT2_BUSY 0xFFFFBFFF 77 + #define S_0007C0_CSQ_INDIRECT2_BUSY(x) (((x) & 0x1) << 15) 78 + #define G_0007C0_CSQ_INDIRECT2_BUSY(x) (((x) >> 15) & 0x1) 79 + #define C_0007C0_CSQ_INDIRECT2_BUSY 0xFFFF7FFF 80 + #define S_0007C0_GUIDMA_BUSY(x) (((x) & 0x1) << 28) 81 + #define G_0007C0_GUIDMA_BUSY(x) (((x) >> 28) & 0x1) 82 + #define C_0007C0_GUIDMA_BUSY 0xEFFFFFFF 83 + #define S_0007C0_VIDDMA_BUSY(x) (((x) & 0x1) << 29) 84 + #define G_0007C0_VIDDMA_BUSY(x) (((x) >> 29) & 0x1) 85 + #define C_0007C0_VIDDMA_BUSY 0xDFFFFFFF 86 + #define S_0007C0_CMDSTRM_BUSY(x) (((x) & 0x1) << 30) 87 + #define G_0007C0_CMDSTRM_BUSY(x) (((x) >> 30) & 0x1) 88 + #define C_0007C0_CMDSTRM_BUSY 0xBFFFFFFF 89 + #define S_0007C0_CP_BUSY(x) (((x) & 0x1) << 31) 90 + #define G_0007C0_CP_BUSY(x) (((x) >> 31) & 0x1) 91 + #define C_0007C0_CP_BUSY 0x7FFFFFFF 92 + #define R_000E40_RBBM_STATUS 0x000E40 93 + #define S_000E40_CMDFIFO_AVAIL(x) (((x) & 0x7F) << 0) 94 + #define G_000E40_CMDFIFO_AVAIL(x) (((x) >> 0) & 0x7F) 95 + #define C_000E40_CMDFIFO_AVAIL 0xFFFFFF80 96 + #define S_000E40_HIRQ_ON_RBB(x) (((x) & 0x1) << 8) 97 + #define G_000E40_HIRQ_ON_RBB(x) (((x) >> 8) & 0x1) 98 + #define C_000E40_HIRQ_ON_RBB 0xFFFFFEFF 99 + #define S_000E40_CPRQ_ON_RBB(x) (((x) & 0x1) << 9) 100 + #define G_000E40_CPRQ_ON_RBB(x) (((x) >> 9) & 0x1) 101 + #define C_000E40_CPRQ_ON_RBB 0xFFFFFDFF 102 + #define S_000E40_CFRQ_ON_RBB(x) (((x) & 0x1) << 10) 103 + #define G_000E40_CFRQ_ON_RBB(x) (((x) >> 10) & 0x1) 104 + #define C_000E40_CFRQ_ON_RBB 0xFFFFFBFF 105 + #define S_000E40_HIRQ_IN_RTBUF(x) (((x) & 0x1) << 11) 106 + #define G_000E40_HIRQ_IN_RTBUF(x) (((x) >> 11) & 0x1) 107 + #define C_000E40_HIRQ_IN_RTBUF 0xFFFFF7FF 108 + #define S_000E40_CPRQ_IN_RTBUF(x) (((x) & 0x1) << 12) 109 + #define G_000E40_CPRQ_IN_RTBUF(x) (((x) >> 12) & 0x1) 110 + #define C_000E40_CPRQ_IN_RTBUF 0xFFFFEFFF 111 + #define S_000E40_CFRQ_IN_RTBUF(x) (((x) & 0x1) << 13) 112 + #define G_000E40_CFRQ_IN_RTBUF(x) (((x) >> 13) & 0x1) 113 + #define C_000E40_CFRQ_IN_RTBUF 0xFFFFDFFF 114 + #define S_000E40_CF_PIPE_BUSY(x) (((x) & 0x1) << 14) 115 + #define G_000E40_CF_PIPE_BUSY(x) (((x) >> 14) & 0x1) 116 + #define C_000E40_CF_PIPE_BUSY 0xFFFFBFFF 117 + #define S_000E40_ENG_EV_BUSY(x) (((x) & 0x1) << 15) 118 + #define G_000E40_ENG_EV_BUSY(x) (((x) >> 15) & 0x1) 119 + #define C_000E40_ENG_EV_BUSY 0xFFFF7FFF 120 + #define S_000E40_CP_CMDSTRM_BUSY(x) (((x) & 0x1) << 16) 121 + #define G_000E40_CP_CMDSTRM_BUSY(x) (((x) >> 16) & 0x1) 122 + #define C_000E40_CP_CMDSTRM_BUSY 0xFFFEFFFF 123 + #define S_000E40_E2_BUSY(x) (((x) & 0x1) << 17) 124 + #define G_000E40_E2_BUSY(x) (((x) >> 17) & 0x1) 125 + #define C_000E40_E2_BUSY 0xFFFDFFFF 126 + #define S_000E40_RB2D_BUSY(x) (((x) & 0x1) << 18) 127 + #define G_000E40_RB2D_BUSY(x) (((x) >> 18) & 0x1) 128 + #define C_000E40_RB2D_BUSY 0xFFFBFFFF 129 + #define S_000E40_RB3D_BUSY(x) (((x) & 0x1) << 19) 130 + #define G_000E40_RB3D_BUSY(x) (((x) >> 19) & 0x1) 131 + #define C_000E40_RB3D_BUSY 0xFFF7FFFF 132 + #define S_000E40_VAP_BUSY(x) (((x) & 0x1) << 20) 133 + #define G_000E40_VAP_BUSY(x) (((x) >> 20) & 0x1) 134 + #define C_000E40_VAP_BUSY 0xFFEFFFFF 135 + #define S_000E40_RE_BUSY(x) (((x) & 0x1) << 21) 136 + #define G_000E40_RE_BUSY(x) (((x) >> 21) & 0x1) 137 + #define C_000E40_RE_BUSY 0xFFDFFFFF 138 + #define S_000E40_TAM_BUSY(x) (((x) & 0x1) << 22) 139 + #define G_000E40_TAM_BUSY(x) (((x) >> 22) & 0x1) 140 + #define C_000E40_TAM_BUSY 0xFFBFFFFF 141 + #define S_000E40_TDM_BUSY(x) (((x) & 0x1) << 23) 142 + #define G_000E40_TDM_BUSY(x) (((x) >> 23) & 0x1) 143 + #define C_000E40_TDM_BUSY 0xFF7FFFFF 144 + #define S_000E40_PB_BUSY(x) (((x) & 0x1) << 24) 145 + #define G_000E40_PB_BUSY(x) (((x) >> 24) & 0x1) 146 + #define C_000E40_PB_BUSY 0xFEFFFFFF 147 + #define S_000E40_TIM_BUSY(x) (((x) & 0x1) << 25) 148 + #define G_000E40_TIM_BUSY(x) (((x) >> 25) & 0x1) 149 + #define C_000E40_TIM_BUSY 0xFDFFFFFF 150 + #define S_000E40_GA_BUSY(x) (((x) & 0x1) << 26) 151 + #define G_000E40_GA_BUSY(x) (((x) >> 26) & 0x1) 152 + #define C_000E40_GA_BUSY 0xFBFFFFFF 153 + #define S_000E40_CBA2D_BUSY(x) (((x) & 0x1) << 27) 154 + #define G_000E40_CBA2D_BUSY(x) (((x) >> 27) & 0x1) 155 + #define C_000E40_CBA2D_BUSY 0xF7FFFFFF 156 + #define S_000E40_GUI_ACTIVE(x) (((x) & 0x1) << 31) 157 + #define G_000E40_GUI_ACTIVE(x) (((x) >> 31) & 0x1) 158 + #define C_000E40_GUI_ACTIVE 0x7FFFFFFF 159 + 160 + #endif
+52
drivers/gpu/drm/radeon/rv350d.h
··· 1 + /* 2 + * Copyright 2008 Advanced Micro Devices, Inc. 3 + * Copyright 2008 Red Hat Inc. 4 + * Copyright 2009 Jerome Glisse. 5 + * 6 + * Permission is hereby granted, free of charge, to any person obtaining a 7 + * copy of this software and associated documentation files (the "Software"), 8 + * to deal in the Software without restriction, including without limitation 9 + * the rights to use, copy, modify, merge, publish, distribute, sublicense, 10 + * and/or sell copies of the Software, and to permit persons to whom the 11 + * Software is furnished to do so, subject to the following conditions: 12 + * 13 + * The above copyright notice and this permission notice shall be included in 14 + * all copies or substantial portions of the Software. 15 + * 16 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19 + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 + * OTHER DEALINGS IN THE SOFTWARE. 23 + * 24 + * Authors: Dave Airlie 25 + * Alex Deucher 26 + * Jerome Glisse 27 + */ 28 + #ifndef __RV350D_H__ 29 + #define __RV350D_H__ 30 + 31 + /* RV350, RV380 registers */ 32 + /* #define R_00000D_SCLK_CNTL 0x00000D */ 33 + #define S_00000D_FORCE_VAP(x) (((x) & 0x1) << 21) 34 + #define G_00000D_FORCE_VAP(x) (((x) >> 21) & 0x1) 35 + #define C_00000D_FORCE_VAP 0xFFDFFFFF 36 + #define S_00000D_FORCE_SR(x) (((x) & 0x1) << 25) 37 + #define G_00000D_FORCE_SR(x) (((x) >> 25) & 0x1) 38 + #define C_00000D_FORCE_SR 0xFDFFFFFF 39 + #define S_00000D_FORCE_PX(x) (((x) & 0x1) << 26) 40 + #define G_00000D_FORCE_PX(x) (((x) >> 26) & 0x1) 41 + #define C_00000D_FORCE_PX 0xFBFFFFFF 42 + #define S_00000D_FORCE_TX(x) (((x) & 0x1) << 27) 43 + #define G_00000D_FORCE_TX(x) (((x) >> 27) & 0x1) 44 + #define C_00000D_FORCE_TX 0xF7FFFFFF 45 + #define S_00000D_FORCE_US(x) (((x) & 0x1) << 28) 46 + #define G_00000D_FORCE_US(x) (((x) >> 28) & 0x1) 47 + #define C_00000D_FORCE_US 0xEFFFFFFF 48 + #define S_00000D_FORCE_SU(x) (((x) & 0x1) << 30) 49 + #define G_00000D_FORCE_SU(x) (((x) >> 30) & 0x1) 50 + #define C_00000D_FORCE_SU 0xBFFFFFFF 51 + 52 + #endif