diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/r100.c')
| -rw-r--r-- | drivers/gpu/drm/radeon/r100.c | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index 161094c07d94..c9e93eabcf16 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c | |||
| @@ -186,7 +186,7 @@ static inline uint32_t r100_irq_ack(struct radeon_device *rdev) | |||
| 186 | 186 | ||
| 187 | int r100_irq_process(struct radeon_device *rdev) | 187 | int r100_irq_process(struct radeon_device *rdev) |
| 188 | { | 188 | { |
| 189 | uint32_t status; | 189 | uint32_t status, msi_rearm; |
| 190 | 190 | ||
| 191 | status = r100_irq_ack(rdev); | 191 | status = r100_irq_ack(rdev); |
| 192 | if (!status) { | 192 | if (!status) { |
| @@ -209,6 +209,21 @@ int r100_irq_process(struct radeon_device *rdev) | |||
| 209 | } | 209 | } |
| 210 | status = r100_irq_ack(rdev); | 210 | status = r100_irq_ack(rdev); |
| 211 | } | 211 | } |
| 212 | if (rdev->msi_enabled) { | ||
| 213 | switch (rdev->family) { | ||
| 214 | case CHIP_RS400: | ||
| 215 | case CHIP_RS480: | ||
| 216 | msi_rearm = RREG32(RADEON_AIC_CNTL) & ~RS400_MSI_REARM; | ||
| 217 | WREG32(RADEON_AIC_CNTL, msi_rearm); | ||
| 218 | WREG32(RADEON_AIC_CNTL, msi_rearm | RS400_MSI_REARM); | ||
| 219 | break; | ||
| 220 | default: | ||
| 221 | msi_rearm = RREG32(RADEON_MSI_REARM_EN) & ~RV370_MSI_REARM_EN; | ||
| 222 | WREG32(RADEON_MSI_REARM_EN, msi_rearm); | ||
| 223 | WREG32(RADEON_MSI_REARM_EN, msi_rearm | RV370_MSI_REARM_EN); | ||
| 224 | break; | ||
| 225 | } | ||
| 226 | } | ||
| 212 | return IRQ_HANDLED; | 227 | return IRQ_HANDLED; |
| 213 | } | 228 | } |
| 214 | 229 | ||
| @@ -240,7 +255,7 @@ int r100_wb_init(struct radeon_device *rdev) | |||
| 240 | int r; | 255 | int r; |
| 241 | 256 | ||
| 242 | if (rdev->wb.wb_obj == NULL) { | 257 | if (rdev->wb.wb_obj == NULL) { |
| 243 | r = radeon_object_create(rdev, NULL, 4096, | 258 | r = radeon_object_create(rdev, NULL, RADEON_GPU_PAGE_SIZE, |
| 244 | true, | 259 | true, |
| 245 | RADEON_GEM_DOMAIN_GTT, | 260 | RADEON_GEM_DOMAIN_GTT, |
| 246 | false, &rdev->wb.wb_obj); | 261 | false, &rdev->wb.wb_obj); |
| @@ -563,19 +578,19 @@ int r100_cp_init(struct radeon_device *rdev, unsigned ring_size) | |||
| 563 | indirect1_start = 16; | 578 | indirect1_start = 16; |
| 564 | /* cp setup */ | 579 | /* cp setup */ |
| 565 | WREG32(0x718, pre_write_timer | (pre_write_limit << 28)); | 580 | WREG32(0x718, pre_write_timer | (pre_write_limit << 28)); |
| 566 | WREG32(RADEON_CP_RB_CNTL, | 581 | tmp = (REG_SET(RADEON_RB_BUFSZ, rb_bufsz) | |
| 567 | #ifdef __BIG_ENDIAN | ||
| 568 | RADEON_BUF_SWAP_32BIT | | ||
| 569 | #endif | ||
| 570 | REG_SET(RADEON_RB_BUFSZ, rb_bufsz) | | ||
| 571 | REG_SET(RADEON_RB_BLKSZ, rb_blksz) | | 582 | REG_SET(RADEON_RB_BLKSZ, rb_blksz) | |
| 572 | REG_SET(RADEON_MAX_FETCH, max_fetch) | | 583 | REG_SET(RADEON_MAX_FETCH, max_fetch) | |
| 573 | RADEON_RB_NO_UPDATE); | 584 | RADEON_RB_NO_UPDATE); |
| 585 | #ifdef __BIG_ENDIAN | ||
| 586 | tmp |= RADEON_BUF_SWAP_32BIT; | ||
| 587 | #endif | ||
| 588 | WREG32(RADEON_CP_RB_CNTL, tmp); | ||
| 589 | |||
| 574 | /* Set ring address */ | 590 | /* Set ring address */ |
| 575 | DRM_INFO("radeon: ring at 0x%016lX\n", (unsigned long)rdev->cp.gpu_addr); | 591 | DRM_INFO("radeon: ring at 0x%016lX\n", (unsigned long)rdev->cp.gpu_addr); |
| 576 | WREG32(RADEON_CP_RB_BASE, rdev->cp.gpu_addr); | 592 | WREG32(RADEON_CP_RB_BASE, rdev->cp.gpu_addr); |
| 577 | /* Force read & write ptr to 0 */ | 593 | /* Force read & write ptr to 0 */ |
| 578 | tmp = RREG32(RADEON_CP_RB_CNTL); | ||
| 579 | WREG32(RADEON_CP_RB_CNTL, tmp | RADEON_RB_RPTR_WR_ENA); | 594 | WREG32(RADEON_CP_RB_CNTL, tmp | RADEON_RB_RPTR_WR_ENA); |
| 580 | WREG32(RADEON_CP_RB_RPTR_WR, 0); | 595 | WREG32(RADEON_CP_RB_RPTR_WR, 0); |
| 581 | WREG32(RADEON_CP_RB_WPTR, 0); | 596 | WREG32(RADEON_CP_RB_WPTR, 0); |
| @@ -2364,7 +2379,7 @@ void r100_bandwidth_update(struct radeon_device *rdev) | |||
| 2364 | /* | 2379 | /* |
| 2365 | Find the total latency for the display data. | 2380 | Find the total latency for the display data. |
| 2366 | */ | 2381 | */ |
| 2367 | disp_latency_overhead.full = rfixed_const(80); | 2382 | disp_latency_overhead.full = rfixed_const(8); |
| 2368 | disp_latency_overhead.full = rfixed_div(disp_latency_overhead, sclk_ff); | 2383 | disp_latency_overhead.full = rfixed_div(disp_latency_overhead, sclk_ff); |
| 2369 | mc_latency_mclk.full += disp_latency_overhead.full + cur_latency_mclk.full; | 2384 | mc_latency_mclk.full += disp_latency_overhead.full + cur_latency_mclk.full; |
| 2370 | mc_latency_sclk.full += disp_latency_overhead.full + cur_latency_sclk.full; | 2385 | mc_latency_sclk.full += disp_latency_overhead.full + cur_latency_sclk.full; |
| @@ -2562,8 +2577,11 @@ void r100_bandwidth_update(struct radeon_device *rdev) | |||
| 2562 | static inline void r100_cs_track_texture_print(struct r100_cs_track_texture *t) | 2577 | static inline void r100_cs_track_texture_print(struct r100_cs_track_texture *t) |
| 2563 | { | 2578 | { |
| 2564 | DRM_ERROR("pitch %d\n", t->pitch); | 2579 | DRM_ERROR("pitch %d\n", t->pitch); |
| 2580 | DRM_ERROR("use_pitch %d\n", t->use_pitch); | ||
| 2565 | DRM_ERROR("width %d\n", t->width); | 2581 | DRM_ERROR("width %d\n", t->width); |
| 2582 | DRM_ERROR("width_11 %d\n", t->width_11); | ||
| 2566 | DRM_ERROR("height %d\n", t->height); | 2583 | DRM_ERROR("height %d\n", t->height); |
| 2584 | DRM_ERROR("height_11 %d\n", t->height_11); | ||
| 2567 | DRM_ERROR("num levels %d\n", t->num_levels); | 2585 | DRM_ERROR("num levels %d\n", t->num_levels); |
| 2568 | DRM_ERROR("depth %d\n", t->txdepth); | 2586 | DRM_ERROR("depth %d\n", t->txdepth); |
| 2569 | DRM_ERROR("bpp %d\n", t->cpp); | 2587 | DRM_ERROR("bpp %d\n", t->cpp); |
| @@ -2623,15 +2641,17 @@ static int r100_cs_track_texture_check(struct radeon_device *rdev, | |||
| 2623 | else | 2641 | else |
| 2624 | w = track->textures[u].pitch / (1 << i); | 2642 | w = track->textures[u].pitch / (1 << i); |
| 2625 | } else { | 2643 | } else { |
| 2626 | w = track->textures[u].width / (1 << i); | 2644 | w = track->textures[u].width; |
| 2627 | if (rdev->family >= CHIP_RV515) | 2645 | if (rdev->family >= CHIP_RV515) |
| 2628 | w |= track->textures[u].width_11; | 2646 | w |= track->textures[u].width_11; |
| 2647 | w = w / (1 << i); | ||
| 2629 | if (track->textures[u].roundup_w) | 2648 | if (track->textures[u].roundup_w) |
| 2630 | w = roundup_pow_of_two(w); | 2649 | w = roundup_pow_of_two(w); |
| 2631 | } | 2650 | } |
| 2632 | h = track->textures[u].height / (1 << i); | 2651 | h = track->textures[u].height; |
| 2633 | if (rdev->family >= CHIP_RV515) | 2652 | if (rdev->family >= CHIP_RV515) |
| 2634 | h |= track->textures[u].height_11; | 2653 | h |= track->textures[u].height_11; |
| 2654 | h = h / (1 << i); | ||
| 2635 | if (track->textures[u].roundup_h) | 2655 | if (track->textures[u].roundup_h) |
| 2636 | h = roundup_pow_of_two(h); | 2656 | h = roundup_pow_of_two(h); |
| 2637 | size += w * h; | 2657 | size += w * h; |
