diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/rs600.c')
-rw-r--r-- | drivers/gpu/drm/radeon/rs600.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c index 9320dd6404f..b1053d64042 100644 --- a/drivers/gpu/drm/radeon/rs600.c +++ b/drivers/gpu/drm/radeon/rs600.c | |||
@@ -62,6 +62,7 @@ u32 rs600_page_flip(struct radeon_device *rdev, int crtc_id, u64 crtc_base) | |||
62 | { | 62 | { |
63 | struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id]; | 63 | struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id]; |
64 | u32 tmp = RREG32(AVIVO_D1GRPH_UPDATE + radeon_crtc->crtc_offset); | 64 | u32 tmp = RREG32(AVIVO_D1GRPH_UPDATE + radeon_crtc->crtc_offset); |
65 | int i; | ||
65 | 66 | ||
66 | /* Lock the graphics update lock */ | 67 | /* Lock the graphics update lock */ |
67 | tmp |= AVIVO_D1GRPH_UPDATE_LOCK; | 68 | tmp |= AVIVO_D1GRPH_UPDATE_LOCK; |
@@ -74,7 +75,11 @@ u32 rs600_page_flip(struct radeon_device *rdev, int crtc_id, u64 crtc_base) | |||
74 | (u32)crtc_base); | 75 | (u32)crtc_base); |
75 | 76 | ||
76 | /* Wait for update_pending to go high. */ | 77 | /* Wait for update_pending to go high. */ |
77 | while (!(RREG32(AVIVO_D1GRPH_UPDATE + radeon_crtc->crtc_offset) & AVIVO_D1GRPH_SURFACE_UPDATE_PENDING)); | 78 | for (i = 0; i < rdev->usec_timeout; i++) { |
79 | if (RREG32(AVIVO_D1GRPH_UPDATE + radeon_crtc->crtc_offset) & AVIVO_D1GRPH_SURFACE_UPDATE_PENDING) | ||
80 | break; | ||
81 | udelay(1); | ||
82 | } | ||
78 | DRM_DEBUG("Update pending now high. Unlocking vupdate_lock.\n"); | 83 | DRM_DEBUG("Update pending now high. Unlocking vupdate_lock.\n"); |
79 | 84 | ||
80 | /* Unlock the lock, so double-buffering can take place inside vblank */ | 85 | /* Unlock the lock, so double-buffering can take place inside vblank */ |
@@ -287,6 +292,7 @@ void rs600_hpd_init(struct radeon_device *rdev) | |||
287 | default: | 292 | default: |
288 | break; | 293 | break; |
289 | } | 294 | } |
295 | radeon_hpd_set_polarity(rdev, radeon_connector->hpd.hpd); | ||
290 | } | 296 | } |
291 | if (rdev->irq.installed) | 297 | if (rdev->irq.installed) |
292 | rs600_irq_set(rdev); | 298 | rs600_irq_set(rdev); |
@@ -413,7 +419,7 @@ int rs600_gart_init(struct radeon_device *rdev) | |||
413 | { | 419 | { |
414 | int r; | 420 | int r; |
415 | 421 | ||
416 | if (rdev->gart.table.vram.robj) { | 422 | if (rdev->gart.robj) { |
417 | WARN(1, "RS600 GART already initialized\n"); | 423 | WARN(1, "RS600 GART already initialized\n"); |
418 | return 0; | 424 | return 0; |
419 | } | 425 | } |
@@ -431,7 +437,7 @@ static int rs600_gart_enable(struct radeon_device *rdev) | |||
431 | u32 tmp; | 437 | u32 tmp; |
432 | int r, i; | 438 | int r, i; |
433 | 439 | ||
434 | if (rdev->gart.table.vram.robj == NULL) { | 440 | if (rdev->gart.robj == NULL) { |
435 | dev_err(rdev->dev, "No VRAM object for PCIE GART.\n"); | 441 | dev_err(rdev->dev, "No VRAM object for PCIE GART.\n"); |
436 | return -EINVAL; | 442 | return -EINVAL; |
437 | } | 443 | } |
@@ -494,20 +500,12 @@ static int rs600_gart_enable(struct radeon_device *rdev) | |||
494 | void rs600_gart_disable(struct radeon_device *rdev) | 500 | void rs600_gart_disable(struct radeon_device *rdev) |
495 | { | 501 | { |
496 | u32 tmp; | 502 | u32 tmp; |
497 | int r; | ||
498 | 503 | ||
499 | /* FIXME: disable out of gart access */ | 504 | /* FIXME: disable out of gart access */ |
500 | WREG32_MC(R_000100_MC_PT0_CNTL, 0); | 505 | WREG32_MC(R_000100_MC_PT0_CNTL, 0); |
501 | tmp = RREG32_MC(R_000009_MC_CNTL1); | 506 | tmp = RREG32_MC(R_000009_MC_CNTL1); |
502 | WREG32_MC(R_000009_MC_CNTL1, tmp & C_000009_ENABLE_PAGE_TABLES); | 507 | WREG32_MC(R_000009_MC_CNTL1, tmp & C_000009_ENABLE_PAGE_TABLES); |
503 | if (rdev->gart.table.vram.robj) { | 508 | radeon_gart_table_vram_unpin(rdev); |
504 | r = radeon_bo_reserve(rdev->gart.table.vram.robj, false); | ||
505 | if (r == 0) { | ||
506 | radeon_bo_kunmap(rdev->gart.table.vram.robj); | ||
507 | radeon_bo_unpin(rdev->gart.table.vram.robj); | ||
508 | radeon_bo_unreserve(rdev->gart.table.vram.robj); | ||
509 | } | ||
510 | } | ||
511 | } | 509 | } |
512 | 510 | ||
513 | void rs600_gart_fini(struct radeon_device *rdev) | 511 | void rs600_gart_fini(struct radeon_device *rdev) |
@@ -525,7 +523,7 @@ void rs600_gart_fini(struct radeon_device *rdev) | |||
525 | 523 | ||
526 | int rs600_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr) | 524 | int rs600_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr) |
527 | { | 525 | { |
528 | void __iomem *ptr = (void *)rdev->gart.table.vram.ptr; | 526 | void __iomem *ptr = (void *)rdev->gart.ptr; |
529 | 527 | ||
530 | if (i < 0 || i > rdev->gart.num_gpu_pages) { | 528 | if (i < 0 || i > rdev->gart.num_gpu_pages) { |
531 | return -EINVAL; | 529 | return -EINVAL; |