diff options
author | Dave Airlie <airlied@linux.ie> | 2009-09-18 01:19:37 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-09-18 02:17:42 -0400 |
commit | fc30b8efbe1b271eb64e0d4f6cb2a91bb57ee5f3 (patch) | |
tree | 87e0fb824b19667c2570bc99bc9ca918f4a25f6e /drivers/gpu/drm/radeon/r420.c | |
parent | bc1a631e5104317cc8b4ef7d14adc597f2844003 (diff) |
drm/radeon/kms: move around new init path code to avoid posting at init
We really don't want to post the card at init, it takes a relatively
long time and isn't required, so split the resume path into
a startup path called by both init/resume and separate resume
entry point to do posting.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/r420.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r420.c | 52 |
1 files changed, 29 insertions, 23 deletions
diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c index 2142a4781970..9b38956e91c7 100644 --- a/drivers/gpu/drm/radeon/r420.c +++ b/drivers/gpu/drm/radeon/r420.c | |||
@@ -157,31 +157,10 @@ static void r420_clock_resume(struct radeon_device *rdev) | |||
157 | WREG32_PLL(R_00000D_SCLK_CNTL, sclk_cntl); | 157 | WREG32_PLL(R_00000D_SCLK_CNTL, sclk_cntl); |
158 | } | 158 | } |
159 | 159 | ||
160 | int r420_resume(struct radeon_device *rdev) | 160 | static int r420_startup(struct radeon_device *rdev) |
161 | { | 161 | { |
162 | int r; | 162 | int r; |
163 | 163 | ||
164 | /* Make sur GART are not working */ | ||
165 | if (rdev->flags & RADEON_IS_PCIE) | ||
166 | rv370_pcie_gart_disable(rdev); | ||
167 | if (rdev->flags & RADEON_IS_PCI) | ||
168 | r100_pci_gart_disable(rdev); | ||
169 | /* Resume clock before doing reset */ | ||
170 | r420_clock_resume(rdev); | ||
171 | /* Reset gpu before posting otherwise ATOM will enter infinite loop */ | ||
172 | if (radeon_gpu_reset(rdev)) { | ||
173 | dev_warn(rdev->dev, "GPU reset failed ! (0xE40=0x%08X, 0x7C0=0x%08X)\n", | ||
174 | RREG32(R_000E40_RBBM_STATUS), | ||
175 | RREG32(R_0007C0_CP_STAT)); | ||
176 | } | ||
177 | /* check if cards are posted or not */ | ||
178 | if (rdev->is_atom_bios) { | ||
179 | atom_asic_init(rdev->mode_info.atom_context); | ||
180 | } else { | ||
181 | radeon_combios_asic_init(rdev->ddev); | ||
182 | } | ||
183 | /* Resume clock after posting */ | ||
184 | r420_clock_resume(rdev); | ||
185 | r300_mc_program(rdev); | 164 | r300_mc_program(rdev); |
186 | /* Initialize GART (initialize after TTM so we can allocate | 165 | /* Initialize GART (initialize after TTM so we can allocate |
187 | * memory through TTM but finalize after TTM) */ | 166 | * memory through TTM but finalize after TTM) */ |
@@ -217,6 +196,33 @@ int r420_resume(struct radeon_device *rdev) | |||
217 | return 0; | 196 | return 0; |
218 | } | 197 | } |
219 | 198 | ||
199 | int r420_resume(struct radeon_device *rdev) | ||
200 | { | ||
201 | /* Make sur GART are not working */ | ||
202 | if (rdev->flags & RADEON_IS_PCIE) | ||
203 | rv370_pcie_gart_disable(rdev); | ||
204 | if (rdev->flags & RADEON_IS_PCI) | ||
205 | r100_pci_gart_disable(rdev); | ||
206 | /* Resume clock before doing reset */ | ||
207 | r420_clock_resume(rdev); | ||
208 | /* Reset gpu before posting otherwise ATOM will enter infinite loop */ | ||
209 | if (radeon_gpu_reset(rdev)) { | ||
210 | dev_warn(rdev->dev, "GPU reset failed ! (0xE40=0x%08X, 0x7C0=0x%08X)\n", | ||
211 | RREG32(R_000E40_RBBM_STATUS), | ||
212 | RREG32(R_0007C0_CP_STAT)); | ||
213 | } | ||
214 | /* check if cards are posted or not */ | ||
215 | if (rdev->is_atom_bios) { | ||
216 | atom_asic_init(rdev->mode_info.atom_context); | ||
217 | } else { | ||
218 | radeon_combios_asic_init(rdev->ddev); | ||
219 | } | ||
220 | /* Resume clock after posting */ | ||
221 | r420_clock_resume(rdev); | ||
222 | |||
223 | return r420_startup(rdev); | ||
224 | } | ||
225 | |||
220 | int r420_suspend(struct radeon_device *rdev) | 226 | int r420_suspend(struct radeon_device *rdev) |
221 | { | 227 | { |
222 | r100_cp_disable(rdev); | 228 | r100_cp_disable(rdev); |
@@ -330,7 +336,7 @@ int r420_init(struct radeon_device *rdev) | |||
330 | } | 336 | } |
331 | r300_set_reg_safe(rdev); | 337 | r300_set_reg_safe(rdev); |
332 | rdev->accel_working = true; | 338 | rdev->accel_working = true; |
333 | r = r420_resume(rdev); | 339 | r = r420_startup(rdev); |
334 | if (r) { | 340 | if (r) { |
335 | /* Somethings want wront with the accel init stop accel */ | 341 | /* Somethings want wront with the accel init stop accel */ |
336 | dev_err(rdev->dev, "Disabling GPU acceleration\n"); | 342 | dev_err(rdev->dev, "Disabling GPU acceleration\n"); |