Rev 1179 | Rev 1246 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1179 | Rev 1221 | ||
---|---|---|---|
Line 27... | Line 27... | ||
27 | */ |
27 | */ |
28 | #include |
28 | #include |
29 | #include "drmP.h" |
29 | #include "drmP.h" |
30 | #include "rv515d.h" |
30 | #include "rv515d.h" |
31 | #include "radeon.h" |
31 | #include "radeon.h" |
32 | - | ||
- | 32 | #include "atom.h" |
|
33 | #include "rv515_reg_safe.h" |
33 | #include "rv515_reg_safe.h" |
34 | /* rv515 depends on : */ |
- | |
35 | void r100_hdp_reset(struct radeon_device *rdev); |
- | |
36 | int r100_cp_reset(struct radeon_device *rdev); |
- | |
37 | int r100_rb2d_reset(struct radeon_device *rdev); |
- | |
38 | int r100_gui_wait_for_idle(struct radeon_device *rdev); |
- | |
39 | int r100_cp_init(struct radeon_device *rdev, unsigned ring_size); |
- | |
40 | void r420_pipes_init(struct radeon_device *rdev); |
- | |
41 | void rs600_mc_disable_clients(struct radeon_device *rdev); |
- | |
42 | void rs600_disable_vga(struct radeon_device *rdev); |
- | |
43 | 34 | ||
44 | /* This files gather functions specifics to: |
35 | /* This files gather functions specifics to: rv515 */ |
45 | * rv515 |
- | |
46 | * |
- | |
47 | * Some of these functions might be used by newer ASICs. |
- | |
48 | */ |
- | |
49 | int rv515_debugfs_pipes_info_init(struct radeon_device *rdev); |
36 | int rv515_debugfs_pipes_info_init(struct radeon_device *rdev); |
50 | int rv515_debugfs_ga_info_init(struct radeon_device *rdev); |
37 | int rv515_debugfs_ga_info_init(struct radeon_device *rdev); |
51 | void rv515_gpu_init(struct radeon_device *rdev); |
38 | void rv515_gpu_init(struct radeon_device *rdev); |
52 | int rv515_mc_wait_for_idle(struct radeon_device *rdev); |
39 | int rv515_mc_wait_for_idle(struct radeon_device *rdev); |
Line 53... | Line -... | ||
53 | - | ||
54 | - | ||
55 | /* |
- | |
56 | * MC |
- | |
57 | */ |
40 | |
58 | int rv515_mc_init(struct radeon_device *rdev) |
41 | void rv515_debugfs(struct radeon_device *rdev) |
59 | { |
- | |
60 | uint32_t tmp; |
- | |
61 | int r; |
- | |
62 | 42 | { |
|
63 | if (r100_debugfs_rbbm_init(rdev)) { |
43 | if (r100_debugfs_rbbm_init(rdev)) { |
64 | DRM_ERROR("Failed to register debugfs file for RBBM !\n"); |
44 | DRM_ERROR("Failed to register debugfs file for RBBM !\n"); |
65 | } |
45 | } |
66 | if (rv515_debugfs_pipes_info_init(rdev)) { |
46 | if (rv515_debugfs_pipes_info_init(rdev)) { |
67 | DRM_ERROR("Failed to register debugfs file for pipes !\n"); |
47 | DRM_ERROR("Failed to register debugfs file for pipes !\n"); |
68 | } |
48 | } |
69 | if (rv515_debugfs_ga_info_init(rdev)) { |
49 | if (rv515_debugfs_ga_info_init(rdev)) { |
70 | DRM_ERROR("Failed to register debugfs file for pipes !\n"); |
50 | DRM_ERROR("Failed to register debugfs file for pipes !\n"); |
71 | } |
- | |
72 | - | ||
73 | rv515_gpu_init(rdev); |
- | |
74 | rv370_pcie_gart_disable(rdev); |
- | |
75 | - | ||
76 | /* Setup GPU memory space */ |
- | |
77 | rdev->mc.vram_location = 0xFFFFFFFFUL; |
- | |
78 | rdev->mc.gtt_location = 0xFFFFFFFFUL; |
- | |
79 | // if (rdev->flags & RADEON_IS_AGP) { |
- | |
80 | // r = radeon_agp_init(rdev); |
- | |
81 | // if (r) { |
- | |
82 | // printk(KERN_WARNING "[drm] Disabling AGP\n"); |
- | |
83 | // rdev->flags &= ~RADEON_IS_AGP; |
- | |
84 | // rdev->mc.gtt_size = radeon_gart_size * 1024 * 1024; |
- | |
85 | // } else { |
- | |
86 | // rdev->mc.gtt_location = rdev->mc.agp_base; |
- | |
87 | // } |
- | |
88 | // } |
- | |
89 | r = radeon_mc_setup(rdev); |
- | |
90 | if (r) { |
- | |
91 | return r; |
51 | } |
Line 92... | Line -... | ||
92 | } |
- | |
93 | - | ||
94 | /* Program GPU memory space */ |
- | |
95 | rs600_mc_disable_clients(rdev); |
- | |
96 | if (rv515_mc_wait_for_idle(rdev)) { |
- | |
97 | printk(KERN_WARNING "Failed to wait MC idle while " |
- | |
98 | "programming pipes. Bad things might happen.\n"); |
- | |
99 | } |
- | |
100 | /* Write VRAM size in case we are limiting it */ |
- | |
101 | WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.real_vram_size); |
- | |
102 | tmp = REG_SET(MC_FB_START, rdev->mc.vram_location >> 16); |
- | |
103 | WREG32(0x134, tmp); |
- | |
104 | tmp = rdev->mc.vram_location + rdev->mc.mc_vram_size - 1; |
- | |
105 | tmp = REG_SET(MC_FB_TOP, tmp >> 16); |
- | |
106 | tmp |= REG_SET(MC_FB_START, rdev->mc.vram_location >> 16); |
- | |
107 | WREG32_MC(MC_FB_LOCATION, tmp); |
- | |
108 | WREG32(HDP_FB_LOCATION, rdev->mc.vram_location >> 16); |
- | |
109 | WREG32(0x310, rdev->mc.vram_location); |
- | |
110 | if (rdev->flags & RADEON_IS_AGP) { |
- | |
111 | tmp = rdev->mc.gtt_location + rdev->mc.gtt_size - 1; |
- | |
112 | tmp = REG_SET(MC_AGP_TOP, tmp >> 16); |
- | |
113 | tmp |= REG_SET(MC_AGP_START, rdev->mc.gtt_location >> 16); |
- | |
114 | WREG32_MC(MC_AGP_LOCATION, tmp); |
- | |
115 | WREG32_MC(MC_AGP_BASE, rdev->mc.agp_base); |
- | |
116 | WREG32_MC(MC_AGP_BASE_2, 0); |
- | |
117 | } else { |
- | |
118 | WREG32_MC(MC_AGP_LOCATION, 0x0FFFFFFF); |
- | |
119 | WREG32_MC(MC_AGP_BASE, 0); |
- | |
120 | WREG32_MC(MC_AGP_BASE_2, 0); |
- | |
121 | } |
- | |
122 | return 0; |
- | |
123 | } |
- | |
124 | - | ||
125 | void rv515_mc_fini(struct radeon_device *rdev) |
- | |
126 | { |
- | |
127 | } |
- | |
128 | - | ||
129 | - | ||
130 | /* |
- | |
131 | * Global GPU functions |
52 | } |
132 | */ |
53 | |
133 | void rv515_ring_start(struct radeon_device *rdev) |
54 | void rv515_ring_start(struct radeon_device *rdev) |
Line 134... | Line 55... | ||
134 | { |
55 | { |
Line 201... | Line 122... | ||
201 | 122 | ||
Line 202... | Line 123... | ||
202 | LEAVE(); |
123 | LEAVE(); |
Line 203... | Line -... | ||
203 | - | ||
204 | } |
- | |
205 | - | ||
206 | void rv515_errata(struct radeon_device *rdev) |
- | |
207 | { |
- | |
208 | rdev->pll_errata = 0; |
124 | |
209 | } |
125 | } |
210 | 126 | ||
211 | int rv515_mc_wait_for_idle(struct radeon_device *rdev) |
127 | int rv515_mc_wait_for_idle(struct radeon_device *rdev) |
Line 222... | Line 138... | ||
222 | DRM_UDELAY(1); |
138 | DRM_UDELAY(1); |
223 | } |
139 | } |
224 | return -1; |
140 | return -1; |
225 | } |
141 | } |
Line -... | Line 142... | ||
- | 142 | ||
- | 143 | void rv515_vga_render_disable(struct radeon_device *rdev) |
|
- | 144 | { |
|
- | 145 | WREG32(R_000300_VGA_RENDER_CONTROL, |
|
- | 146 | RREG32(R_000300_VGA_RENDER_CONTROL) & C_000300_VGA_VSTATUS_CNTL); |
|
- | 147 | } |
|
226 | 148 | ||
227 | void rv515_gpu_init(struct radeon_device *rdev) |
149 | void rv515_gpu_init(struct radeon_device *rdev) |
228 | { |
150 | { |
Line 229... | Line 151... | ||
229 | unsigned pipe_select_current, gb_pipe_select, tmp; |
151 | unsigned pipe_select_current, gb_pipe_select, tmp; |
Line 234... | Line 156... | ||
234 | if (r100_gui_wait_for_idle(rdev)) { |
156 | if (r100_gui_wait_for_idle(rdev)) { |
235 | printk(KERN_WARNING "Failed to wait GUI idle while " |
157 | printk(KERN_WARNING "Failed to wait GUI idle while " |
236 | "reseting GPU. Bad things might happen.\n"); |
158 | "reseting GPU. Bad things might happen.\n"); |
237 | } |
159 | } |
Line 238... | Line 160... | ||
238 | 160 | ||
Line 239... | Line 161... | ||
239 | rs600_disable_vga(rdev); |
161 | rv515_vga_render_disable(rdev); |
240 | 162 | ||
241 | r420_pipes_init(rdev); |
163 | r420_pipes_init(rdev); |
242 | gb_pipe_select = RREG32(0x402C); |
164 | gb_pipe_select = RREG32(0x402C); |
Line 342... | Line 264... | ||
342 | } |
264 | } |
343 | DRM_INFO("GPU reset succeed (RBBM_STATUS=0x%08X)\n", status); |
265 | DRM_INFO("GPU reset succeed (RBBM_STATUS=0x%08X)\n", status); |
344 | return 0; |
266 | return 0; |
345 | } |
267 | } |
Line 346... | Line -... | ||
346 | - | ||
347 | - | ||
348 | /* |
- | |
349 | * VRAM info |
- | |
350 | */ |
268 | |
351 | static void rv515_vram_get_type(struct radeon_device *rdev) |
269 | static void rv515_vram_get_type(struct radeon_device *rdev) |
352 | { |
270 | { |
Line 353... | Line 271... | ||
353 | uint32_t tmp; |
271 | uint32_t tmp; |
Line 381... | Line 299... | ||
381 | a.full = rfixed_const(100); |
299 | a.full = rfixed_const(100); |
382 | rdev->pm.sclk.full = rfixed_const(rdev->clock.default_sclk); |
300 | rdev->pm.sclk.full = rfixed_const(rdev->clock.default_sclk); |
383 | rdev->pm.sclk.full = rfixed_div(rdev->pm.sclk, a); |
301 | rdev->pm.sclk.full = rfixed_div(rdev->pm.sclk, a); |
384 | } |
302 | } |
Line 385... | Line -... | ||
385 | - | ||
386 | - | ||
387 | /* |
- | |
388 | * Indirect registers accessor |
- | |
389 | */ |
303 | |
390 | uint32_t rv515_mc_rreg(struct radeon_device *rdev, uint32_t reg) |
304 | uint32_t rv515_mc_rreg(struct radeon_device *rdev, uint32_t reg) |
391 | { |
305 | { |
Line 392... | Line 306... | ||
392 | uint32_t r; |
306 | uint32_t r; |
Line 402... | Line 316... | ||
402 | WREG32(MC_IND_INDEX, 0xff0000 | ((reg) & 0xffff)); |
316 | WREG32(MC_IND_INDEX, 0xff0000 | ((reg) & 0xffff)); |
403 | WREG32(MC_IND_DATA, (v)); |
317 | WREG32(MC_IND_DATA, (v)); |
404 | WREG32(MC_IND_INDEX, 0); |
318 | WREG32(MC_IND_INDEX, 0); |
405 | } |
319 | } |
Line 406... | Line -... | ||
406 | - | ||
407 | /* |
- | |
408 | * Debugfs info |
- | |
409 | */ |
320 | |
410 | #if defined(CONFIG_DEBUG_FS) |
321 | #if defined(CONFIG_DEBUG_FS) |
411 | static int rv515_debugfs_pipes_info(struct seq_file *m, void *data) |
322 | static int rv515_debugfs_pipes_info(struct seq_file *m, void *data) |
412 | { |
323 | { |
413 | struct drm_info_node *node = (struct drm_info_node *) m->private; |
324 | struct drm_info_node *node = (struct drm_info_node *) m->private; |
Line 466... | Line 377... | ||
466 | #else |
377 | #else |
467 | return 0; |
378 | return 0; |
468 | #endif |
379 | #endif |
469 | } |
380 | } |
Line 470... | Line -... | ||
470 | - | ||
471 | /* |
- | |
472 | * Asic initialization |
- | |
473 | */ |
381 | |
474 | int rv515_init(struct radeon_device *rdev) |
382 | void rv515_mc_stop(struct radeon_device *rdev, struct rv515_mc_save *save) |
- | 383 | { |
|
- | 384 | save->d1vga_control = RREG32(R_000330_D1VGA_CONTROL); |
|
- | 385 | save->d2vga_control = RREG32(R_000338_D2VGA_CONTROL); |
|
- | 386 | save->vga_render_control = RREG32(R_000300_VGA_RENDER_CONTROL); |
|
- | 387 | save->vga_hdp_control = RREG32(R_000328_VGA_HDP_CONTROL); |
|
- | 388 | save->d1crtc_control = RREG32(R_006080_D1CRTC_CONTROL); |
|
- | 389 | save->d2crtc_control = RREG32(R_006880_D2CRTC_CONTROL); |
|
- | 390 | ||
- | 391 | /* Stop all video */ |
|
- | 392 | WREG32(R_000330_D1VGA_CONTROL, 0); |
|
- | 393 | WREG32(R_0068E8_D2CRTC_UPDATE_LOCK, 0); |
|
- | 394 | WREG32(R_000300_VGA_RENDER_CONTROL, 0); |
|
- | 395 | WREG32(R_0060E8_D1CRTC_UPDATE_LOCK, 1); |
|
- | 396 | WREG32(R_0068E8_D2CRTC_UPDATE_LOCK, 1); |
|
- | 397 | WREG32(R_006080_D1CRTC_CONTROL, 0); |
|
- | 398 | WREG32(R_006880_D2CRTC_CONTROL, 0); |
|
- | 399 | WREG32(R_0060E8_D1CRTC_UPDATE_LOCK, 0); |
|
- | 400 | WREG32(R_0068E8_D2CRTC_UPDATE_LOCK, 0); |
|
- | 401 | } |
|
- | 402 | ||
- | 403 | void rv515_mc_resume(struct radeon_device *rdev, struct rv515_mc_save *save) |
|
- | 404 | { |
|
- | 405 | WREG32(R_006110_D1GRPH_PRIMARY_SURFACE_ADDRESS, rdev->mc.vram_start); |
|
- | 406 | WREG32(R_006118_D1GRPH_SECONDARY_SURFACE_ADDRESS, rdev->mc.vram_start); |
|
- | 407 | WREG32(R_006910_D2GRPH_PRIMARY_SURFACE_ADDRESS, rdev->mc.vram_start); |
|
- | 408 | WREG32(R_006918_D2GRPH_SECONDARY_SURFACE_ADDRESS, rdev->mc.vram_start); |
|
- | 409 | WREG32(R_000310_VGA_MEMORY_BASE_ADDRESS, rdev->mc.vram_start); |
|
- | 410 | /* Unlock host access */ |
|
475 | { |
411 | WREG32(R_000328_VGA_HDP_CONTROL, save->vga_hdp_control); |
- | 412 | mdelay(1); |
|
- | 413 | /* Restore video state */ |
|
- | 414 | WREG32(R_0060E8_D1CRTC_UPDATE_LOCK, 1); |
|
- | 415 | WREG32(R_0068E8_D2CRTC_UPDATE_LOCK, 1); |
|
- | 416 | WREG32(R_006080_D1CRTC_CONTROL, save->d1crtc_control); |
|
- | 417 | WREG32(R_006880_D2CRTC_CONTROL, save->d2crtc_control); |
|
- | 418 | WREG32(R_0060E8_D1CRTC_UPDATE_LOCK, 0); |
|
- | 419 | WREG32(R_0068E8_D2CRTC_UPDATE_LOCK, 0); |
|
- | 420 | WREG32(R_000330_D1VGA_CONTROL, save->d1vga_control); |
|
- | 421 | WREG32(R_000338_D2VGA_CONTROL, save->d2vga_control); |
|
- | 422 | WREG32(R_000300_VGA_RENDER_CONTROL, save->vga_render_control); |
|
- | 423 | } |
|
- | 424 | ||
- | 425 | void rv515_mc_program(struct radeon_device *rdev) |
|
- | 426 | { |
|
- | 427 | struct rv515_mc_save save; |
|
- | 428 | ||
- | 429 | /* Stops all mc clients */ |
|
- | 430 | rv515_mc_stop(rdev, &save); |
|
- | 431 | ||
- | 432 | /* Wait for mc idle */ |
|
- | 433 | if (rv515_mc_wait_for_idle(rdev)) |
|
- | 434 | dev_warn(rdev->dev, "Wait MC idle timeout before updating MC.\n"); |
|
- | 435 | /* Write VRAM size in case we are limiting it */ |
|
- | 436 | WREG32(R_0000F8_CONFIG_MEMSIZE, rdev->mc.real_vram_size); |
|
- | 437 | /* Program MC, should be a 32bits limited address space */ |
|
- | 438 | WREG32_MC(R_000001_MC_FB_LOCATION, |
|
- | 439 | S_000001_MC_FB_START(rdev->mc.vram_start >> 16) | |
|
- | 440 | S_000001_MC_FB_TOP(rdev->mc.vram_end >> 16)); |
|
- | 441 | WREG32(R_000134_HDP_FB_LOCATION, |
|
- | 442 | S_000134_HDP_FB_START(rdev->mc.vram_start >> 16)); |
|
- | 443 | if (rdev->flags & RADEON_IS_AGP) { |
|
- | 444 | WREG32_MC(R_000002_MC_AGP_LOCATION, |
|
- | 445 | S_000002_MC_AGP_START(rdev->mc.gtt_start >> 16) | |
|
- | 446 | S_000002_MC_AGP_TOP(rdev->mc.gtt_end >> 16)); |
|
- | 447 | WREG32_MC(R_000003_MC_AGP_BASE, lower_32_bits(rdev->mc.agp_base)); |
|
- | 448 | WREG32_MC(R_000004_MC_AGP_BASE_2, |
|
- | 449 | S_000004_AGP_BASE_ADDR_2(upper_32_bits(rdev->mc.agp_base))); |
|
- | 450 | } else { |
|
- | 451 | WREG32_MC(R_000002_MC_AGP_LOCATION, 0xFFFFFFFF); |
|
- | 452 | WREG32_MC(R_000003_MC_AGP_BASE, 0); |
|
- | 453 | WREG32_MC(R_000004_MC_AGP_BASE_2, 0); |
|
- | 454 | } |
|
- | 455 | ||
- | 456 | rv515_mc_resume(rdev, &save); |
|
- | 457 | } |
|
- | 458 | ||
- | 459 | void rv515_clock_startup(struct radeon_device *rdev) |
|
- | 460 | { |
|
- | 461 | if (radeon_dynclks != -1 && radeon_dynclks) |
|
- | 462 | radeon_atom_set_clock_gating(rdev, 1); |
|
- | 463 | /* We need to force on some of the block */ |
|
- | 464 | WREG32_PLL(R_00000F_CP_DYN_CNTL, |
|
- | 465 | RREG32_PLL(R_00000F_CP_DYN_CNTL) | S_00000F_CP_FORCEON(1)); |
|
- | 466 | WREG32_PLL(R_000011_E2_DYN_CNTL, |
|
- | 467 | RREG32_PLL(R_000011_E2_DYN_CNTL) | S_000011_E2_FORCEON(1)); |
|
- | 468 | WREG32_PLL(R_000013_IDCT_DYN_CNTL, |
|
- | 469 | RREG32_PLL(R_000013_IDCT_DYN_CNTL) | S_000013_IDCT_FORCEON(1)); |
|
- | 470 | } |
|
- | 471 | ||
- | 472 | static int rv515_startup(struct radeon_device *rdev) |
|
- | 473 | { |
|
- | 474 | int r; |
|
- | 475 | ||
- | 476 | rv515_mc_program(rdev); |
|
- | 477 | /* Resume clock */ |
|
- | 478 | rv515_clock_startup(rdev); |
|
- | 479 | /* Initialize GPU configuration (# pipes, ...) */ |
|
- | 480 | rv515_gpu_init(rdev); |
|
- | 481 | /* Initialize GART (initialize after TTM so we can allocate |
|
- | 482 | * memory through TTM but finalize after TTM) */ |
|
- | 483 | if (rdev->flags & RADEON_IS_PCIE) { |
|
- | 484 | r = rv370_pcie_gart_enable(rdev); |
|
- | 485 | if (r) |
|
- | 486 | return r; |
|
- | 487 | } |
|
- | 488 | /* Enable IRQ */ |
|
- | 489 | // rdev->irq.sw_int = true; |
|
- | 490 | // rs600_irq_set(rdev); |
|
- | 491 | /* 1M ring buffer */ |
|
- | 492 | // r = r100_cp_init(rdev, 1024 * 1024); |
|
- | 493 | // if (r) { |
|
- | 494 | // dev_err(rdev->dev, "failled initializing CP (%d).\n", r); |
|
- | 495 | // return r; |
|
- | 496 | // } |
|
- | 497 | // r = r100_wb_init(rdev); |
|
- | 498 | // if (r) |
|
- | 499 | // dev_err(rdev->dev, "failled initializing WB (%d).\n", r); |
|
- | 500 | // r = r100_ib_init(rdev); |
|
- | 501 | // if (r) { |
|
- | 502 | // dev_err(rdev->dev, "failled initializing IB (%d).\n", r); |
|
- | 503 | // return r; |
|
- | 504 | // } |
|
- | 505 | return 0; |
|
- | 506 | } |
|
Line -... | Line 507... | ||
- | 507 | ||
- | 508 | ||
476 | ENTER(); |
509 | void rv515_set_safe_registers(struct radeon_device *rdev) |
477 | 510 | { |
|
- | 511 | rdev->config.r300.reg_safe_bm = rv515_reg_safe_bm; |
|
- | 512 | rdev->config.r300.reg_safe_bm_size = ARRAY_SIZE(rv515_reg_safe_bm); |
|
- | 513 | } |
|
- | 514 | ||
- | 515 | int rv515_init(struct radeon_device *rdev) |
|
- | 516 | { |
|
- | 517 | int r; |
|
- | 518 | ||
- | 519 | /* Initialize scratch registers */ |
|
- | 520 | radeon_scratch_init(rdev); |
|
- | 521 | /* Initialize surface registers */ |
|
- | 522 | radeon_surface_init(rdev); |
|
- | 523 | /* TODO: disable VGA need to use VGA request */ |
|
- | 524 | /* BIOS*/ |
|
- | 525 | if (!radeon_get_bios(rdev)) { |
|
- | 526 | if (ASIC_IS_AVIVO(rdev)) |
|
- | 527 | return -EINVAL; |
|
- | 528 | } |
|
- | 529 | if (rdev->is_atom_bios) { |
|
- | 530 | r = radeon_atombios_init(rdev); |
|
- | 531 | if (r) |
|
- | 532 | return r; |
|
- | 533 | } else { |
|
- | 534 | dev_err(rdev->dev, "Expecting atombios for RV515 GPU\n"); |
|
- | 535 | return -EINVAL; |
|
- | 536 | } |
|
- | 537 | /* Reset gpu before posting otherwise ATOM will enter infinite loop */ |
|
- | 538 | if (radeon_gpu_reset(rdev)) { |
|
- | 539 | dev_warn(rdev->dev, |
|
- | 540 | "GPU reset failed ! (0xE40=0x%08X, 0x7C0=0x%08X)\n", |
|
- | 541 | RREG32(R_000E40_RBBM_STATUS), |
|
- | 542 | RREG32(R_0007C0_CP_STAT)); |
|
- | 543 | } |
|
- | 544 | /* check if cards are posted or not */ |
|
- | 545 | if (!radeon_card_posted(rdev) && rdev->bios) { |
|
- | 546 | DRM_INFO("GPU not posted. posting now...\n"); |
|
- | 547 | atom_asic_init(rdev->mode_info.atom_context); |
|
- | 548 | } |
|
- | 549 | /* Initialize clocks */ |
|
- | 550 | radeon_get_clock_info(rdev->ddev); |
|
- | 551 | /* Get vram informations */ |
|
- | 552 | rv515_vram_info(rdev); |
|
- | 553 | /* Initialize memory controller (also test AGP) */ |
|
- | 554 | r = r420_mc_init(rdev); |
|
- | 555 | if (r) |
|
- | 556 | return r; |
|
- | 557 | rv515_debugfs(rdev); |
|
- | 558 | /* Fence driver */ |
|
- | 559 | // r = radeon_fence_driver_init(rdev); |
|
- | 560 | // if (r) |
|
- | 561 | // return r; |
|
- | 562 | // r = radeon_irq_kms_init(rdev); |
|
- | 563 | // if (r) |
|
- | 564 | // return r; |
|
- | 565 | /* Memory manager */ |
|
- | 566 | r = radeon_object_init(rdev); |
|
- | 567 | if (r) |
|
- | 568 | return r; |
|
- | 569 | r = rv370_pcie_gart_init(rdev); |
|
- | 570 | if (r) |
|
- | 571 | return r; |
|
- | 572 | rv515_set_safe_registers(rdev); |
|
- | 573 | rdev->accel_working = true; |
|
- | 574 | r = rv515_startup(rdev); |
|
- | 575 | if (r) { |
|
- | 576 | /* Somethings want wront with the accel init stop accel */ |
|
- | 577 | dev_err(rdev->dev, "Disabling GPU acceleration\n"); |
|
- | 578 | // rv515_suspend(rdev); |
|
- | 579 | // r100_cp_fini(rdev); |
|
- | 580 | // r100_wb_fini(rdev); |
|
- | 581 | // r100_ib_fini(rdev); |
|
- | 582 | rv370_pcie_gart_fini(rdev); |
|
- | 583 | // radeon_agp_fini(rdev); |
|
- | 584 | // radeon_irq_kms_fini(rdev); |
|
478 | rdev->config.r300.reg_safe_bm = rv515_reg_safe_bm; |
585 | rdev->accel_working = false; |
479 | rdev->config.r300.reg_safe_bm_size = ARRAY_SIZE(rv515_reg_safe_bm); |
586 | } |
Line 480... | Line 587... | ||
480 | return 0; |
587 | return 0; |
481 | } |
588 | } |