drm/radeon/kms: rs400/480 MC setup is different than r300.

Boot testing on my rs480 laptop found the MC idle never happened
on startup, a quick check with AMD found the idle bit is in a different
place on the rs4xx than r300.

Implement a new rs400 mc idle function to fix this.

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

+21 -5
+21 -5
drivers/gpu/drm/radeon/rs400.c
··· 223 223 return 0; 224 224 } 225 225 226 + int rs400_mc_wait_for_idle(struct radeon_device *rdev) 227 + { 228 + unsigned i; 229 + uint32_t tmp; 230 + 231 + for (i = 0; i < rdev->usec_timeout; i++) { 232 + /* read MC_STATUS */ 233 + tmp = RREG32(0x0150); 234 + if (tmp & (1 << 2)) { 235 + return 0; 236 + } 237 + DRM_UDELAY(1); 238 + } 239 + return -1; 240 + } 241 + 226 242 void rs400_gpu_init(struct radeon_device *rdev) 227 243 { 228 244 /* FIXME: HDP same place on rs400 ? */ 229 245 r100_hdp_reset(rdev); 230 246 /* FIXME: is this correct ? */ 231 247 r420_pipes_init(rdev); 232 - if (r300_mc_wait_for_idle(rdev)) { 233 - printk(KERN_WARNING "Failed to wait MC idle while " 234 - "programming pipes. Bad things might happen.\n"); 248 + if (rs400_mc_wait_for_idle(rdev)) { 249 + printk(KERN_WARNING "rs400: Failed to wait MC idle while " 250 + "programming pipes. Bad things might happen. %08x\n", RREG32(0x150)); 235 251 } 236 252 } 237 253 ··· 386 370 r100_mc_stop(rdev, &save); 387 371 388 372 /* Wait for mc idle */ 389 - if (r300_mc_wait_for_idle(rdev)) 390 - dev_warn(rdev->dev, "Wait MC idle timeout before updating MC.\n"); 373 + if (rs400_mc_wait_for_idle(rdev)) 374 + dev_warn(rdev->dev, "rs400: Wait MC idle timeout before updating MC.\n"); 391 375 WREG32(R_000148_MC_FB_LOCATION, 392 376 S_000148_MC_FB_START(rdev->mc.vram_start >> 16) | 393 377 S_000148_MC_FB_TOP(rdev->mc.vram_end >> 16));