diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/evergreen.c')
-rw-r--r-- | drivers/gpu/drm/radeon/evergreen.c | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index f12a5b3ec050..4dc5b4714c5a 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
@@ -1650,7 +1650,36 @@ static void evergreen_gpu_init(struct radeon_device *rdev) | |||
1650 | } | 1650 | } |
1651 | } | 1651 | } |
1652 | 1652 | ||
1653 | rdev->config.evergreen.tile_config = gb_addr_config; | 1653 | /* setup tiling info dword. gb_addr_config is not adequate since it does |
1654 | * not have bank info, so create a custom tiling dword. | ||
1655 | * bits 3:0 num_pipes | ||
1656 | * bits 7:4 num_banks | ||
1657 | * bits 11:8 group_size | ||
1658 | * bits 15:12 row_size | ||
1659 | */ | ||
1660 | rdev->config.evergreen.tile_config = 0; | ||
1661 | switch (rdev->config.evergreen.max_tile_pipes) { | ||
1662 | case 1: | ||
1663 | default: | ||
1664 | rdev->config.evergreen.tile_config |= (0 << 0); | ||
1665 | break; | ||
1666 | case 2: | ||
1667 | rdev->config.evergreen.tile_config |= (1 << 0); | ||
1668 | break; | ||
1669 | case 4: | ||
1670 | rdev->config.evergreen.tile_config |= (2 << 0); | ||
1671 | break; | ||
1672 | case 8: | ||
1673 | rdev->config.evergreen.tile_config |= (3 << 0); | ||
1674 | break; | ||
1675 | } | ||
1676 | rdev->config.evergreen.tile_config |= | ||
1677 | ((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT) << 4; | ||
1678 | rdev->config.evergreen.tile_config |= | ||
1679 | ((mc_arb_ramcfg & BURSTLENGTH_MASK) >> BURSTLENGTH_SHIFT) << 8; | ||
1680 | rdev->config.evergreen.tile_config |= | ||
1681 | ((gb_addr_config & 0x30000000) >> 28) << 12; | ||
1682 | |||
1654 | WREG32(GB_BACKEND_MAP, gb_backend_map); | 1683 | WREG32(GB_BACKEND_MAP, gb_backend_map); |
1655 | WREG32(GB_ADDR_CONFIG, gb_addr_config); | 1684 | WREG32(GB_ADDR_CONFIG, gb_addr_config); |
1656 | WREG32(DMIF_ADDR_CONFIG, gb_addr_config); | 1685 | WREG32(DMIF_ADDR_CONFIG, gb_addr_config); |
@@ -2033,7 +2062,7 @@ int evergreen_irq_set(struct radeon_device *rdev) | |||
2033 | u32 grbm_int_cntl = 0; | 2062 | u32 grbm_int_cntl = 0; |
2034 | 2063 | ||
2035 | if (!rdev->irq.installed) { | 2064 | if (!rdev->irq.installed) { |
2036 | WARN(1, "Can't enable IRQ/MSI because no handler is installed.\n"); | 2065 | WARN(1, "Can't enable IRQ/MSI because no handler is installed\n"); |
2037 | return -EINVAL; | 2066 | return -EINVAL; |
2038 | } | 2067 | } |
2039 | /* don't enable anything if the ih is disabled */ | 2068 | /* don't enable anything if the ih is disabled */ |
@@ -2295,6 +2324,7 @@ restart_ih: | |||
2295 | case 0: /* D1 vblank */ | 2324 | case 0: /* D1 vblank */ |
2296 | if (disp_int & LB_D1_VBLANK_INTERRUPT) { | 2325 | if (disp_int & LB_D1_VBLANK_INTERRUPT) { |
2297 | drm_handle_vblank(rdev->ddev, 0); | 2326 | drm_handle_vblank(rdev->ddev, 0); |
2327 | rdev->pm.vblank_sync = true; | ||
2298 | wake_up(&rdev->irq.vblank_queue); | 2328 | wake_up(&rdev->irq.vblank_queue); |
2299 | disp_int &= ~LB_D1_VBLANK_INTERRUPT; | 2329 | disp_int &= ~LB_D1_VBLANK_INTERRUPT; |
2300 | DRM_DEBUG("IH: D1 vblank\n"); | 2330 | DRM_DEBUG("IH: D1 vblank\n"); |
@@ -2316,6 +2346,7 @@ restart_ih: | |||
2316 | case 0: /* D2 vblank */ | 2346 | case 0: /* D2 vblank */ |
2317 | if (disp_int_cont & LB_D2_VBLANK_INTERRUPT) { | 2347 | if (disp_int_cont & LB_D2_VBLANK_INTERRUPT) { |
2318 | drm_handle_vblank(rdev->ddev, 1); | 2348 | drm_handle_vblank(rdev->ddev, 1); |
2349 | rdev->pm.vblank_sync = true; | ||
2319 | wake_up(&rdev->irq.vblank_queue); | 2350 | wake_up(&rdev->irq.vblank_queue); |
2320 | disp_int_cont &= ~LB_D2_VBLANK_INTERRUPT; | 2351 | disp_int_cont &= ~LB_D2_VBLANK_INTERRUPT; |
2321 | DRM_DEBUG("IH: D2 vblank\n"); | 2352 | DRM_DEBUG("IH: D2 vblank\n"); |
@@ -2337,6 +2368,7 @@ restart_ih: | |||
2337 | case 0: /* D3 vblank */ | 2368 | case 0: /* D3 vblank */ |
2338 | if (disp_int_cont2 & LB_D3_VBLANK_INTERRUPT) { | 2369 | if (disp_int_cont2 & LB_D3_VBLANK_INTERRUPT) { |
2339 | drm_handle_vblank(rdev->ddev, 2); | 2370 | drm_handle_vblank(rdev->ddev, 2); |
2371 | rdev->pm.vblank_sync = true; | ||
2340 | wake_up(&rdev->irq.vblank_queue); | 2372 | wake_up(&rdev->irq.vblank_queue); |
2341 | disp_int_cont2 &= ~LB_D3_VBLANK_INTERRUPT; | 2373 | disp_int_cont2 &= ~LB_D3_VBLANK_INTERRUPT; |
2342 | DRM_DEBUG("IH: D3 vblank\n"); | 2374 | DRM_DEBUG("IH: D3 vblank\n"); |
@@ -2358,6 +2390,7 @@ restart_ih: | |||
2358 | case 0: /* D4 vblank */ | 2390 | case 0: /* D4 vblank */ |
2359 | if (disp_int_cont3 & LB_D4_VBLANK_INTERRUPT) { | 2391 | if (disp_int_cont3 & LB_D4_VBLANK_INTERRUPT) { |
2360 | drm_handle_vblank(rdev->ddev, 3); | 2392 | drm_handle_vblank(rdev->ddev, 3); |
2393 | rdev->pm.vblank_sync = true; | ||
2361 | wake_up(&rdev->irq.vblank_queue); | 2394 | wake_up(&rdev->irq.vblank_queue); |
2362 | disp_int_cont3 &= ~LB_D4_VBLANK_INTERRUPT; | 2395 | disp_int_cont3 &= ~LB_D4_VBLANK_INTERRUPT; |
2363 | DRM_DEBUG("IH: D4 vblank\n"); | 2396 | DRM_DEBUG("IH: D4 vblank\n"); |
@@ -2379,6 +2412,7 @@ restart_ih: | |||
2379 | case 0: /* D5 vblank */ | 2412 | case 0: /* D5 vblank */ |
2380 | if (disp_int_cont4 & LB_D5_VBLANK_INTERRUPT) { | 2413 | if (disp_int_cont4 & LB_D5_VBLANK_INTERRUPT) { |
2381 | drm_handle_vblank(rdev->ddev, 4); | 2414 | drm_handle_vblank(rdev->ddev, 4); |
2415 | rdev->pm.vblank_sync = true; | ||
2382 | wake_up(&rdev->irq.vblank_queue); | 2416 | wake_up(&rdev->irq.vblank_queue); |
2383 | disp_int_cont4 &= ~LB_D5_VBLANK_INTERRUPT; | 2417 | disp_int_cont4 &= ~LB_D5_VBLANK_INTERRUPT; |
2384 | DRM_DEBUG("IH: D5 vblank\n"); | 2418 | DRM_DEBUG("IH: D5 vblank\n"); |
@@ -2400,6 +2434,7 @@ restart_ih: | |||
2400 | case 0: /* D6 vblank */ | 2434 | case 0: /* D6 vblank */ |
2401 | if (disp_int_cont5 & LB_D6_VBLANK_INTERRUPT) { | 2435 | if (disp_int_cont5 & LB_D6_VBLANK_INTERRUPT) { |
2402 | drm_handle_vblank(rdev->ddev, 5); | 2436 | drm_handle_vblank(rdev->ddev, 5); |
2437 | rdev->pm.vblank_sync = true; | ||
2403 | wake_up(&rdev->irq.vblank_queue); | 2438 | wake_up(&rdev->irq.vblank_queue); |
2404 | disp_int_cont5 &= ~LB_D6_VBLANK_INTERRUPT; | 2439 | disp_int_cont5 &= ~LB_D6_VBLANK_INTERRUPT; |
2405 | DRM_DEBUG("IH: D6 vblank\n"); | 2440 | DRM_DEBUG("IH: D6 vblank\n"); |