diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/r600.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r600.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index c52290197292..8f3454e2056a 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -25,12 +25,14 @@ | |||
25 | * Alex Deucher | 25 | * Alex Deucher |
26 | * Jerome Glisse | 26 | * Jerome Glisse |
27 | */ | 27 | */ |
28 | #include <linux/slab.h> | ||
28 | #include <linux/seq_file.h> | 29 | #include <linux/seq_file.h> |
29 | #include <linux/firmware.h> | 30 | #include <linux/firmware.h> |
30 | #include <linux/platform_device.h> | 31 | #include <linux/platform_device.h> |
31 | #include "drmP.h" | 32 | #include "drmP.h" |
32 | #include "radeon_drm.h" | 33 | #include "radeon_drm.h" |
33 | #include "radeon.h" | 34 | #include "radeon.h" |
35 | #include "radeon_asic.h" | ||
34 | #include "radeon_mode.h" | 36 | #include "radeon_mode.h" |
35 | #include "r600d.h" | 37 | #include "r600d.h" |
36 | #include "atom.h" | 38 | #include "atom.h" |
@@ -491,9 +493,9 @@ void r600_pcie_gart_disable(struct radeon_device *rdev) | |||
491 | 493 | ||
492 | void r600_pcie_gart_fini(struct radeon_device *rdev) | 494 | void r600_pcie_gart_fini(struct radeon_device *rdev) |
493 | { | 495 | { |
496 | radeon_gart_fini(rdev); | ||
494 | r600_pcie_gart_disable(rdev); | 497 | r600_pcie_gart_disable(rdev); |
495 | radeon_gart_table_vram_free(rdev); | 498 | radeon_gart_table_vram_free(rdev); |
496 | radeon_gart_fini(rdev); | ||
497 | } | 499 | } |
498 | 500 | ||
499 | void r600_agp_enable(struct radeon_device *rdev) | 501 | void r600_agp_enable(struct radeon_device *rdev) |
@@ -675,7 +677,6 @@ void r600_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc) | |||
675 | 677 | ||
676 | int r600_mc_init(struct radeon_device *rdev) | 678 | int r600_mc_init(struct radeon_device *rdev) |
677 | { | 679 | { |
678 | fixed20_12 a; | ||
679 | u32 tmp; | 680 | u32 tmp; |
680 | int chansize, numchan; | 681 | int chansize, numchan; |
681 | 682 | ||
@@ -719,14 +720,10 @@ int r600_mc_init(struct radeon_device *rdev) | |||
719 | rdev->mc.real_vram_size = rdev->mc.aper_size; | 720 | rdev->mc.real_vram_size = rdev->mc.aper_size; |
720 | } | 721 | } |
721 | r600_vram_gtt_location(rdev, &rdev->mc); | 722 | r600_vram_gtt_location(rdev, &rdev->mc); |
722 | /* FIXME: we should enforce default clock in case GPU is not in | 723 | |
723 | * default setup | ||
724 | */ | ||
725 | a.full = rfixed_const(100); | ||
726 | rdev->pm.sclk.full = rfixed_const(rdev->clock.default_sclk); | ||
727 | rdev->pm.sclk.full = rfixed_div(rdev->pm.sclk, a); | ||
728 | if (rdev->flags & RADEON_IS_IGP) | 724 | if (rdev->flags & RADEON_IS_IGP) |
729 | rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev); | 725 | rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev); |
726 | radeon_update_bandwidth_info(rdev); | ||
730 | return 0; | 727 | return 0; |
731 | } | 728 | } |
732 | 729 | ||
@@ -1132,6 +1129,7 @@ void r600_gpu_init(struct radeon_device *rdev) | |||
1132 | /* Setup pipes */ | 1129 | /* Setup pipes */ |
1133 | WREG32(CC_RB_BACKEND_DISABLE, cc_rb_backend_disable); | 1130 | WREG32(CC_RB_BACKEND_DISABLE, cc_rb_backend_disable); |
1134 | WREG32(CC_GC_SHADER_PIPE_CONFIG, cc_gc_shader_pipe_config); | 1131 | WREG32(CC_GC_SHADER_PIPE_CONFIG, cc_gc_shader_pipe_config); |
1132 | WREG32(GC_USER_SHADER_PIPE_CONFIG, cc_gc_shader_pipe_config); | ||
1135 | 1133 | ||
1136 | tmp = R6XX_MAX_PIPES - r600_count_pipe_bits((cc_gc_shader_pipe_config & INACTIVE_QD_PIPES_MASK) >> 8); | 1134 | tmp = R6XX_MAX_PIPES - r600_count_pipe_bits((cc_gc_shader_pipe_config & INACTIVE_QD_PIPES_MASK) >> 8); |
1137 | WREG32(VGT_OUT_DEALLOC_CNTL, (tmp * 4) & DEALLOC_DIST_MASK); | 1135 | WREG32(VGT_OUT_DEALLOC_CNTL, (tmp * 4) & DEALLOC_DIST_MASK); |
@@ -2119,6 +2117,7 @@ int r600_init(struct radeon_device *rdev) | |||
2119 | 2117 | ||
2120 | void r600_fini(struct radeon_device *rdev) | 2118 | void r600_fini(struct radeon_device *rdev) |
2121 | { | 2119 | { |
2120 | radeon_pm_fini(rdev); | ||
2122 | r600_audio_fini(rdev); | 2121 | r600_audio_fini(rdev); |
2123 | r600_blit_fini(rdev); | 2122 | r600_blit_fini(rdev); |
2124 | r600_cp_fini(rdev); | 2123 | r600_cp_fini(rdev); |
@@ -2398,19 +2397,19 @@ static void r600_disable_interrupt_state(struct radeon_device *rdev) | |||
2398 | WREG32(DC_HPD4_INT_CONTROL, tmp); | 2397 | WREG32(DC_HPD4_INT_CONTROL, tmp); |
2399 | if (ASIC_IS_DCE32(rdev)) { | 2398 | if (ASIC_IS_DCE32(rdev)) { |
2400 | tmp = RREG32(DC_HPD5_INT_CONTROL) & DC_HPDx_INT_POLARITY; | 2399 | tmp = RREG32(DC_HPD5_INT_CONTROL) & DC_HPDx_INT_POLARITY; |
2401 | WREG32(DC_HPD5_INT_CONTROL, 0); | 2400 | WREG32(DC_HPD5_INT_CONTROL, tmp); |
2402 | tmp = RREG32(DC_HPD6_INT_CONTROL) & DC_HPDx_INT_POLARITY; | 2401 | tmp = RREG32(DC_HPD6_INT_CONTROL) & DC_HPDx_INT_POLARITY; |
2403 | WREG32(DC_HPD6_INT_CONTROL, 0); | 2402 | WREG32(DC_HPD6_INT_CONTROL, tmp); |
2404 | } | 2403 | } |
2405 | } else { | 2404 | } else { |
2406 | WREG32(DACA_AUTODETECT_INT_CONTROL, 0); | 2405 | WREG32(DACA_AUTODETECT_INT_CONTROL, 0); |
2407 | WREG32(DACB_AUTODETECT_INT_CONTROL, 0); | 2406 | WREG32(DACB_AUTODETECT_INT_CONTROL, 0); |
2408 | tmp = RREG32(DC_HOT_PLUG_DETECT1_INT_CONTROL) & DC_HOT_PLUG_DETECTx_INT_POLARITY; | 2407 | tmp = RREG32(DC_HOT_PLUG_DETECT1_INT_CONTROL) & DC_HOT_PLUG_DETECTx_INT_POLARITY; |
2409 | WREG32(DC_HOT_PLUG_DETECT1_INT_CONTROL, 0); | 2408 | WREG32(DC_HOT_PLUG_DETECT1_INT_CONTROL, tmp); |
2410 | tmp = RREG32(DC_HOT_PLUG_DETECT2_INT_CONTROL) & DC_HOT_PLUG_DETECTx_INT_POLARITY; | 2409 | tmp = RREG32(DC_HOT_PLUG_DETECT2_INT_CONTROL) & DC_HOT_PLUG_DETECTx_INT_POLARITY; |
2411 | WREG32(DC_HOT_PLUG_DETECT2_INT_CONTROL, 0); | 2410 | WREG32(DC_HOT_PLUG_DETECT2_INT_CONTROL, tmp); |
2412 | tmp = RREG32(DC_HOT_PLUG_DETECT3_INT_CONTROL) & DC_HOT_PLUG_DETECTx_INT_POLARITY; | 2411 | tmp = RREG32(DC_HOT_PLUG_DETECT3_INT_CONTROL) & DC_HOT_PLUG_DETECTx_INT_POLARITY; |
2413 | WREG32(DC_HOT_PLUG_DETECT3_INT_CONTROL, 0); | 2412 | WREG32(DC_HOT_PLUG_DETECT3_INT_CONTROL, tmp); |
2414 | } | 2413 | } |
2415 | } | 2414 | } |
2416 | 2415 | ||
@@ -2765,6 +2764,7 @@ restart_ih: | |||
2765 | case 0: /* D1 vblank */ | 2764 | case 0: /* D1 vblank */ |
2766 | if (disp_int & LB_D1_VBLANK_INTERRUPT) { | 2765 | if (disp_int & LB_D1_VBLANK_INTERRUPT) { |
2767 | drm_handle_vblank(rdev->ddev, 0); | 2766 | drm_handle_vblank(rdev->ddev, 0); |
2767 | rdev->pm.vblank_sync = true; | ||
2768 | wake_up(&rdev->irq.vblank_queue); | 2768 | wake_up(&rdev->irq.vblank_queue); |
2769 | disp_int &= ~LB_D1_VBLANK_INTERRUPT; | 2769 | disp_int &= ~LB_D1_VBLANK_INTERRUPT; |
2770 | DRM_DEBUG("IH: D1 vblank\n"); | 2770 | DRM_DEBUG("IH: D1 vblank\n"); |
@@ -2786,6 +2786,7 @@ restart_ih: | |||
2786 | case 0: /* D2 vblank */ | 2786 | case 0: /* D2 vblank */ |
2787 | if (disp_int & LB_D2_VBLANK_INTERRUPT) { | 2787 | if (disp_int & LB_D2_VBLANK_INTERRUPT) { |
2788 | drm_handle_vblank(rdev->ddev, 1); | 2788 | drm_handle_vblank(rdev->ddev, 1); |
2789 | rdev->pm.vblank_sync = true; | ||
2789 | wake_up(&rdev->irq.vblank_queue); | 2790 | wake_up(&rdev->irq.vblank_queue); |
2790 | disp_int &= ~LB_D2_VBLANK_INTERRUPT; | 2791 | disp_int &= ~LB_D2_VBLANK_INTERRUPT; |
2791 | DRM_DEBUG("IH: D2 vblank\n"); | 2792 | DRM_DEBUG("IH: D2 vblank\n"); |
@@ -2834,14 +2835,14 @@ restart_ih: | |||
2834 | break; | 2835 | break; |
2835 | case 10: | 2836 | case 10: |
2836 | if (disp_int_cont2 & DC_HPD5_INTERRUPT) { | 2837 | if (disp_int_cont2 & DC_HPD5_INTERRUPT) { |
2837 | disp_int_cont &= ~DC_HPD5_INTERRUPT; | 2838 | disp_int_cont2 &= ~DC_HPD5_INTERRUPT; |
2838 | queue_hotplug = true; | 2839 | queue_hotplug = true; |
2839 | DRM_DEBUG("IH: HPD5\n"); | 2840 | DRM_DEBUG("IH: HPD5\n"); |
2840 | } | 2841 | } |
2841 | break; | 2842 | break; |
2842 | case 12: | 2843 | case 12: |
2843 | if (disp_int_cont2 & DC_HPD6_INTERRUPT) { | 2844 | if (disp_int_cont2 & DC_HPD6_INTERRUPT) { |
2844 | disp_int_cont &= ~DC_HPD6_INTERRUPT; | 2845 | disp_int_cont2 &= ~DC_HPD6_INTERRUPT; |
2845 | queue_hotplug = true; | 2846 | queue_hotplug = true; |
2846 | DRM_DEBUG("IH: HPD6\n"); | 2847 | DRM_DEBUG("IH: HPD6\n"); |
2847 | } | 2848 | } |