2 * Copyright 2008 Advanced Micro Devices, Inc.
3 * Copyright 2008 Red Hat Inc.
4 * Copyright 2009 Jerome Glisse.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
24 * Authors: Dave Airlie
29 #include <linux/console.h>
31 #include <drm/drm_crtc_helper.h>
32 #include <drm/radeon_drm.h>
33 #include <linux/vgaarb.h>
34 #include <linux/vga_switcheroo.h>
35 #include "radeon_reg.h"
37 #include "radeon_asic.h"
41 * Registers accessors functions.
44 * radeon_invalid_rreg - dummy reg read function
46 * @rdev: radeon device pointer
47 * @reg: offset of register
49 * Dummy register read function. Used for register blocks
50 * that certain asics don't have (all asics).
51 * Returns the value in the register.
53 static uint32_t radeon_invalid_rreg(struct radeon_device *rdev, uint32_t reg)
55 DRM_ERROR("Invalid callback to read register 0x%04X\n", reg);
61 * radeon_invalid_wreg - dummy reg write function
63 * @rdev: radeon device pointer
64 * @reg: offset of register
65 * @v: value to write to the register
67 * Dummy register read function. Used for register blocks
68 * that certain asics don't have (all asics).
70 static void radeon_invalid_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
72 DRM_ERROR("Invalid callback to write register 0x%04X with 0x%08X\n",
78 * radeon_register_accessor_init - sets up the register accessor callbacks
80 * @rdev: radeon device pointer
82 * Sets up the register accessor callbacks for various register
83 * apertures. Not all asics have all apertures (all asics).
85 static void radeon_register_accessor_init(struct radeon_device *rdev)
87 rdev->mc_rreg = &radeon_invalid_rreg;
88 rdev->mc_wreg = &radeon_invalid_wreg;
89 rdev->pll_rreg = &radeon_invalid_rreg;
90 rdev->pll_wreg = &radeon_invalid_wreg;
91 rdev->pciep_rreg = &radeon_invalid_rreg;
92 rdev->pciep_wreg = &radeon_invalid_wreg;
94 /* Don't change order as we are overridding accessor. */
95 if (rdev->family < CHIP_RV515) {
96 rdev->pcie_reg_mask = 0xff;
98 rdev->pcie_reg_mask = 0x7ff;
100 /* FIXME: not sure here */
101 if (rdev->family <= CHIP_R580) {
102 rdev->pll_rreg = &r100_pll_rreg;
103 rdev->pll_wreg = &r100_pll_wreg;
105 if (rdev->family >= CHIP_R420) {
106 rdev->mc_rreg = &r420_mc_rreg;
107 rdev->mc_wreg = &r420_mc_wreg;
109 if (rdev->family >= CHIP_RV515) {
110 rdev->mc_rreg = &rv515_mc_rreg;
111 rdev->mc_wreg = &rv515_mc_wreg;
113 if (rdev->family == CHIP_RS400 || rdev->family == CHIP_RS480) {
114 rdev->mc_rreg = &rs400_mc_rreg;
115 rdev->mc_wreg = &rs400_mc_wreg;
117 if (rdev->family == CHIP_RS690 || rdev->family == CHIP_RS740) {
118 rdev->mc_rreg = &rs690_mc_rreg;
119 rdev->mc_wreg = &rs690_mc_wreg;
121 if (rdev->family == CHIP_RS600) {
122 rdev->mc_rreg = &rs600_mc_rreg;
123 rdev->mc_wreg = &rs600_mc_wreg;
125 if (rdev->family == CHIP_RS780 || rdev->family == CHIP_RS880) {
126 rdev->mc_rreg = &rs780_mc_rreg;
127 rdev->mc_wreg = &rs780_mc_wreg;
130 if (rdev->family >= CHIP_BONAIRE) {
131 rdev->pciep_rreg = &cik_pciep_rreg;
132 rdev->pciep_wreg = &cik_pciep_wreg;
133 } else if (rdev->family >= CHIP_R600) {
134 rdev->pciep_rreg = &r600_pciep_rreg;
135 rdev->pciep_wreg = &r600_pciep_wreg;
140 /* helper to disable agp */
142 * radeon_agp_disable - AGP disable helper function
144 * @rdev: radeon device pointer
146 * Removes AGP flags and changes the gart callbacks on AGP
147 * cards when using the internal gart rather than AGP (all asics).
149 void radeon_agp_disable(struct radeon_device *rdev)
151 rdev->flags &= ~RADEON_IS_AGP;
152 if (rdev->family >= CHIP_R600) {
153 DRM_INFO("Forcing AGP to PCIE mode\n");
154 rdev->flags |= RADEON_IS_PCIE;
155 } else if (rdev->family >= CHIP_RV515 ||
156 rdev->family == CHIP_RV380 ||
157 rdev->family == CHIP_RV410 ||
158 rdev->family == CHIP_R423) {
159 DRM_INFO("Forcing AGP to PCIE mode\n");
160 rdev->flags |= RADEON_IS_PCIE;
161 rdev->asic->gart.tlb_flush = &rv370_pcie_gart_tlb_flush;
162 rdev->asic->gart.set_page = &rv370_pcie_gart_set_page;
164 DRM_INFO("Forcing AGP to PCI mode\n");
165 rdev->flags |= RADEON_IS_PCI;
166 rdev->asic->gart.tlb_flush = &r100_pci_gart_tlb_flush;
167 rdev->asic->gart.set_page = &r100_pci_gart_set_page;
169 rdev->mc.gtt_size = radeon_gart_size * 1024 * 1024;
175 static struct radeon_asic r100_asic = {
178 .suspend = &r100_suspend,
179 .resume = &r100_resume,
180 .vga_set_state = &r100_vga_set_state,
181 .asic_reset = &r100_asic_reset,
182 .ioctl_wait_idle = NULL,
183 .gui_idle = &r100_gui_idle,
184 .mc_wait_for_idle = &r100_mc_wait_for_idle,
186 .tlb_flush = &r100_pci_gart_tlb_flush,
187 .set_page = &r100_pci_gart_set_page,
190 [RADEON_RING_TYPE_GFX_INDEX] = {
191 .ib_execute = &r100_ring_ib_execute,
192 .emit_fence = &r100_fence_ring_emit,
193 .emit_semaphore = &r100_semaphore_ring_emit,
194 .cs_parse = &r100_cs_parse,
195 .ring_start = &r100_ring_start,
196 .ring_test = &r100_ring_test,
197 .ib_test = &r100_ib_test,
198 .is_lockup = &r100_gpu_is_lockup,
199 .get_rptr = &radeon_ring_generic_get_rptr,
200 .get_wptr = &radeon_ring_generic_get_wptr,
201 .set_wptr = &radeon_ring_generic_set_wptr,
205 .set = &r100_irq_set,
206 .process = &r100_irq_process,
209 .bandwidth_update = &r100_bandwidth_update,
210 .get_vblank_counter = &r100_get_vblank_counter,
211 .wait_for_vblank = &r100_wait_for_vblank,
212 .set_backlight_level = &radeon_legacy_set_backlight_level,
213 .get_backlight_level = &radeon_legacy_get_backlight_level,
216 .blit = &r100_copy_blit,
217 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
219 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
220 .copy = &r100_copy_blit,
221 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
224 .set_reg = r100_set_surface_reg,
225 .clear_reg = r100_clear_surface_reg,
228 .init = &r100_hpd_init,
229 .fini = &r100_hpd_fini,
230 .sense = &r100_hpd_sense,
231 .set_polarity = &r100_hpd_set_polarity,
234 .misc = &r100_pm_misc,
235 .prepare = &r100_pm_prepare,
236 .finish = &r100_pm_finish,
237 .init_profile = &r100_pm_init_profile,
238 .get_dynpm_state = &r100_pm_get_dynpm_state,
239 .get_engine_clock = &radeon_legacy_get_engine_clock,
240 .set_engine_clock = &radeon_legacy_set_engine_clock,
241 .get_memory_clock = &radeon_legacy_get_memory_clock,
242 .set_memory_clock = NULL,
243 .get_pcie_lanes = NULL,
244 .set_pcie_lanes = NULL,
245 .set_clock_gating = &radeon_legacy_set_clock_gating,
248 .pre_page_flip = &r100_pre_page_flip,
249 .page_flip = &r100_page_flip,
250 .post_page_flip = &r100_post_page_flip,
254 static struct radeon_asic r200_asic = {
257 .suspend = &r100_suspend,
258 .resume = &r100_resume,
259 .vga_set_state = &r100_vga_set_state,
260 .asic_reset = &r100_asic_reset,
261 .ioctl_wait_idle = NULL,
262 .gui_idle = &r100_gui_idle,
263 .mc_wait_for_idle = &r100_mc_wait_for_idle,
265 .tlb_flush = &r100_pci_gart_tlb_flush,
266 .set_page = &r100_pci_gart_set_page,
269 [RADEON_RING_TYPE_GFX_INDEX] = {
270 .ib_execute = &r100_ring_ib_execute,
271 .emit_fence = &r100_fence_ring_emit,
272 .emit_semaphore = &r100_semaphore_ring_emit,
273 .cs_parse = &r100_cs_parse,
274 .ring_start = &r100_ring_start,
275 .ring_test = &r100_ring_test,
276 .ib_test = &r100_ib_test,
277 .is_lockup = &r100_gpu_is_lockup,
278 .get_rptr = &radeon_ring_generic_get_rptr,
279 .get_wptr = &radeon_ring_generic_get_wptr,
280 .set_wptr = &radeon_ring_generic_set_wptr,
284 .set = &r100_irq_set,
285 .process = &r100_irq_process,
288 .bandwidth_update = &r100_bandwidth_update,
289 .get_vblank_counter = &r100_get_vblank_counter,
290 .wait_for_vblank = &r100_wait_for_vblank,
291 .set_backlight_level = &radeon_legacy_set_backlight_level,
292 .get_backlight_level = &radeon_legacy_get_backlight_level,
295 .blit = &r100_copy_blit,
296 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
297 .dma = &r200_copy_dma,
298 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
299 .copy = &r100_copy_blit,
300 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
303 .set_reg = r100_set_surface_reg,
304 .clear_reg = r100_clear_surface_reg,
307 .init = &r100_hpd_init,
308 .fini = &r100_hpd_fini,
309 .sense = &r100_hpd_sense,
310 .set_polarity = &r100_hpd_set_polarity,
313 .misc = &r100_pm_misc,
314 .prepare = &r100_pm_prepare,
315 .finish = &r100_pm_finish,
316 .init_profile = &r100_pm_init_profile,
317 .get_dynpm_state = &r100_pm_get_dynpm_state,
318 .get_engine_clock = &radeon_legacy_get_engine_clock,
319 .set_engine_clock = &radeon_legacy_set_engine_clock,
320 .get_memory_clock = &radeon_legacy_get_memory_clock,
321 .set_memory_clock = NULL,
322 .get_pcie_lanes = NULL,
323 .set_pcie_lanes = NULL,
324 .set_clock_gating = &radeon_legacy_set_clock_gating,
327 .pre_page_flip = &r100_pre_page_flip,
328 .page_flip = &r100_page_flip,
329 .post_page_flip = &r100_post_page_flip,
333 static struct radeon_asic r300_asic = {
336 .suspend = &r300_suspend,
337 .resume = &r300_resume,
338 .vga_set_state = &r100_vga_set_state,
339 .asic_reset = &r300_asic_reset,
340 .ioctl_wait_idle = NULL,
341 .gui_idle = &r100_gui_idle,
342 .mc_wait_for_idle = &r300_mc_wait_for_idle,
344 .tlb_flush = &r100_pci_gart_tlb_flush,
345 .set_page = &r100_pci_gart_set_page,
348 [RADEON_RING_TYPE_GFX_INDEX] = {
349 .ib_execute = &r100_ring_ib_execute,
350 .emit_fence = &r300_fence_ring_emit,
351 .emit_semaphore = &r100_semaphore_ring_emit,
352 .cs_parse = &r300_cs_parse,
353 .ring_start = &r300_ring_start,
354 .ring_test = &r100_ring_test,
355 .ib_test = &r100_ib_test,
356 .is_lockup = &r100_gpu_is_lockup,
357 .get_rptr = &radeon_ring_generic_get_rptr,
358 .get_wptr = &radeon_ring_generic_get_wptr,
359 .set_wptr = &radeon_ring_generic_set_wptr,
363 .set = &r100_irq_set,
364 .process = &r100_irq_process,
367 .bandwidth_update = &r100_bandwidth_update,
368 .get_vblank_counter = &r100_get_vblank_counter,
369 .wait_for_vblank = &r100_wait_for_vblank,
370 .set_backlight_level = &radeon_legacy_set_backlight_level,
371 .get_backlight_level = &radeon_legacy_get_backlight_level,
374 .blit = &r100_copy_blit,
375 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
376 .dma = &r200_copy_dma,
377 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
378 .copy = &r100_copy_blit,
379 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
382 .set_reg = r100_set_surface_reg,
383 .clear_reg = r100_clear_surface_reg,
386 .init = &r100_hpd_init,
387 .fini = &r100_hpd_fini,
388 .sense = &r100_hpd_sense,
389 .set_polarity = &r100_hpd_set_polarity,
392 .misc = &r100_pm_misc,
393 .prepare = &r100_pm_prepare,
394 .finish = &r100_pm_finish,
395 .init_profile = &r100_pm_init_profile,
396 .get_dynpm_state = &r100_pm_get_dynpm_state,
397 .get_engine_clock = &radeon_legacy_get_engine_clock,
398 .set_engine_clock = &radeon_legacy_set_engine_clock,
399 .get_memory_clock = &radeon_legacy_get_memory_clock,
400 .set_memory_clock = NULL,
401 .get_pcie_lanes = &rv370_get_pcie_lanes,
402 .set_pcie_lanes = &rv370_set_pcie_lanes,
403 .set_clock_gating = &radeon_legacy_set_clock_gating,
406 .pre_page_flip = &r100_pre_page_flip,
407 .page_flip = &r100_page_flip,
408 .post_page_flip = &r100_post_page_flip,
412 static struct radeon_asic r300_asic_pcie = {
415 .suspend = &r300_suspend,
416 .resume = &r300_resume,
417 .vga_set_state = &r100_vga_set_state,
418 .asic_reset = &r300_asic_reset,
419 .ioctl_wait_idle = NULL,
420 .gui_idle = &r100_gui_idle,
421 .mc_wait_for_idle = &r300_mc_wait_for_idle,
423 .tlb_flush = &rv370_pcie_gart_tlb_flush,
424 .set_page = &rv370_pcie_gart_set_page,
427 [RADEON_RING_TYPE_GFX_INDEX] = {
428 .ib_execute = &r100_ring_ib_execute,
429 .emit_fence = &r300_fence_ring_emit,
430 .emit_semaphore = &r100_semaphore_ring_emit,
431 .cs_parse = &r300_cs_parse,
432 .ring_start = &r300_ring_start,
433 .ring_test = &r100_ring_test,
434 .ib_test = &r100_ib_test,
435 .is_lockup = &r100_gpu_is_lockup,
436 .get_rptr = &radeon_ring_generic_get_rptr,
437 .get_wptr = &radeon_ring_generic_get_wptr,
438 .set_wptr = &radeon_ring_generic_set_wptr,
442 .set = &r100_irq_set,
443 .process = &r100_irq_process,
446 .bandwidth_update = &r100_bandwidth_update,
447 .get_vblank_counter = &r100_get_vblank_counter,
448 .wait_for_vblank = &r100_wait_for_vblank,
449 .set_backlight_level = &radeon_legacy_set_backlight_level,
450 .get_backlight_level = &radeon_legacy_get_backlight_level,
453 .blit = &r100_copy_blit,
454 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
455 .dma = &r200_copy_dma,
456 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
457 .copy = &r100_copy_blit,
458 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
461 .set_reg = r100_set_surface_reg,
462 .clear_reg = r100_clear_surface_reg,
465 .init = &r100_hpd_init,
466 .fini = &r100_hpd_fini,
467 .sense = &r100_hpd_sense,
468 .set_polarity = &r100_hpd_set_polarity,
471 .misc = &r100_pm_misc,
472 .prepare = &r100_pm_prepare,
473 .finish = &r100_pm_finish,
474 .init_profile = &r100_pm_init_profile,
475 .get_dynpm_state = &r100_pm_get_dynpm_state,
476 .get_engine_clock = &radeon_legacy_get_engine_clock,
477 .set_engine_clock = &radeon_legacy_set_engine_clock,
478 .get_memory_clock = &radeon_legacy_get_memory_clock,
479 .set_memory_clock = NULL,
480 .get_pcie_lanes = &rv370_get_pcie_lanes,
481 .set_pcie_lanes = &rv370_set_pcie_lanes,
482 .set_clock_gating = &radeon_legacy_set_clock_gating,
485 .pre_page_flip = &r100_pre_page_flip,
486 .page_flip = &r100_page_flip,
487 .post_page_flip = &r100_post_page_flip,
491 static struct radeon_asic r420_asic = {
494 .suspend = &r420_suspend,
495 .resume = &r420_resume,
496 .vga_set_state = &r100_vga_set_state,
497 .asic_reset = &r300_asic_reset,
498 .ioctl_wait_idle = NULL,
499 .gui_idle = &r100_gui_idle,
500 .mc_wait_for_idle = &r300_mc_wait_for_idle,
502 .tlb_flush = &rv370_pcie_gart_tlb_flush,
503 .set_page = &rv370_pcie_gart_set_page,
506 [RADEON_RING_TYPE_GFX_INDEX] = {
507 .ib_execute = &r100_ring_ib_execute,
508 .emit_fence = &r300_fence_ring_emit,
509 .emit_semaphore = &r100_semaphore_ring_emit,
510 .cs_parse = &r300_cs_parse,
511 .ring_start = &r300_ring_start,
512 .ring_test = &r100_ring_test,
513 .ib_test = &r100_ib_test,
514 .is_lockup = &r100_gpu_is_lockup,
515 .get_rptr = &radeon_ring_generic_get_rptr,
516 .get_wptr = &radeon_ring_generic_get_wptr,
517 .set_wptr = &radeon_ring_generic_set_wptr,
521 .set = &r100_irq_set,
522 .process = &r100_irq_process,
525 .bandwidth_update = &r100_bandwidth_update,
526 .get_vblank_counter = &r100_get_vblank_counter,
527 .wait_for_vblank = &r100_wait_for_vblank,
528 .set_backlight_level = &atombios_set_backlight_level,
529 .get_backlight_level = &atombios_get_backlight_level,
532 .blit = &r100_copy_blit,
533 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
534 .dma = &r200_copy_dma,
535 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
536 .copy = &r100_copy_blit,
537 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
540 .set_reg = r100_set_surface_reg,
541 .clear_reg = r100_clear_surface_reg,
544 .init = &r100_hpd_init,
545 .fini = &r100_hpd_fini,
546 .sense = &r100_hpd_sense,
547 .set_polarity = &r100_hpd_set_polarity,
550 .misc = &r100_pm_misc,
551 .prepare = &r100_pm_prepare,
552 .finish = &r100_pm_finish,
553 .init_profile = &r420_pm_init_profile,
554 .get_dynpm_state = &r100_pm_get_dynpm_state,
555 .get_engine_clock = &radeon_atom_get_engine_clock,
556 .set_engine_clock = &radeon_atom_set_engine_clock,
557 .get_memory_clock = &radeon_atom_get_memory_clock,
558 .set_memory_clock = &radeon_atom_set_memory_clock,
559 .get_pcie_lanes = &rv370_get_pcie_lanes,
560 .set_pcie_lanes = &rv370_set_pcie_lanes,
561 .set_clock_gating = &radeon_atom_set_clock_gating,
564 .pre_page_flip = &r100_pre_page_flip,
565 .page_flip = &r100_page_flip,
566 .post_page_flip = &r100_post_page_flip,
570 static struct radeon_asic rs400_asic = {
573 .suspend = &rs400_suspend,
574 .resume = &rs400_resume,
575 .vga_set_state = &r100_vga_set_state,
576 .asic_reset = &r300_asic_reset,
577 .ioctl_wait_idle = NULL,
578 .gui_idle = &r100_gui_idle,
579 .mc_wait_for_idle = &rs400_mc_wait_for_idle,
581 .tlb_flush = &rs400_gart_tlb_flush,
582 .set_page = &rs400_gart_set_page,
585 [RADEON_RING_TYPE_GFX_INDEX] = {
586 .ib_execute = &r100_ring_ib_execute,
587 .emit_fence = &r300_fence_ring_emit,
588 .emit_semaphore = &r100_semaphore_ring_emit,
589 .cs_parse = &r300_cs_parse,
590 .ring_start = &r300_ring_start,
591 .ring_test = &r100_ring_test,
592 .ib_test = &r100_ib_test,
593 .is_lockup = &r100_gpu_is_lockup,
594 .get_rptr = &radeon_ring_generic_get_rptr,
595 .get_wptr = &radeon_ring_generic_get_wptr,
596 .set_wptr = &radeon_ring_generic_set_wptr,
600 .set = &r100_irq_set,
601 .process = &r100_irq_process,
604 .bandwidth_update = &r100_bandwidth_update,
605 .get_vblank_counter = &r100_get_vblank_counter,
606 .wait_for_vblank = &r100_wait_for_vblank,
607 .set_backlight_level = &radeon_legacy_set_backlight_level,
608 .get_backlight_level = &radeon_legacy_get_backlight_level,
611 .blit = &r100_copy_blit,
612 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
613 .dma = &r200_copy_dma,
614 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
615 .copy = &r100_copy_blit,
616 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
619 .set_reg = r100_set_surface_reg,
620 .clear_reg = r100_clear_surface_reg,
623 .init = &r100_hpd_init,
624 .fini = &r100_hpd_fini,
625 .sense = &r100_hpd_sense,
626 .set_polarity = &r100_hpd_set_polarity,
629 .misc = &r100_pm_misc,
630 .prepare = &r100_pm_prepare,
631 .finish = &r100_pm_finish,
632 .init_profile = &r100_pm_init_profile,
633 .get_dynpm_state = &r100_pm_get_dynpm_state,
634 .get_engine_clock = &radeon_legacy_get_engine_clock,
635 .set_engine_clock = &radeon_legacy_set_engine_clock,
636 .get_memory_clock = &radeon_legacy_get_memory_clock,
637 .set_memory_clock = NULL,
638 .get_pcie_lanes = NULL,
639 .set_pcie_lanes = NULL,
640 .set_clock_gating = &radeon_legacy_set_clock_gating,
643 .pre_page_flip = &r100_pre_page_flip,
644 .page_flip = &r100_page_flip,
645 .post_page_flip = &r100_post_page_flip,
649 static struct radeon_asic rs600_asic = {
652 .suspend = &rs600_suspend,
653 .resume = &rs600_resume,
654 .vga_set_state = &r100_vga_set_state,
655 .asic_reset = &rs600_asic_reset,
656 .ioctl_wait_idle = NULL,
657 .gui_idle = &r100_gui_idle,
658 .mc_wait_for_idle = &rs600_mc_wait_for_idle,
660 .tlb_flush = &rs600_gart_tlb_flush,
661 .set_page = &rs600_gart_set_page,
664 [RADEON_RING_TYPE_GFX_INDEX] = {
665 .ib_execute = &r100_ring_ib_execute,
666 .emit_fence = &r300_fence_ring_emit,
667 .emit_semaphore = &r100_semaphore_ring_emit,
668 .cs_parse = &r300_cs_parse,
669 .ring_start = &r300_ring_start,
670 .ring_test = &r100_ring_test,
671 .ib_test = &r100_ib_test,
672 .is_lockup = &r100_gpu_is_lockup,
673 .get_rptr = &radeon_ring_generic_get_rptr,
674 .get_wptr = &radeon_ring_generic_get_wptr,
675 .set_wptr = &radeon_ring_generic_set_wptr,
679 .set = &rs600_irq_set,
680 .process = &rs600_irq_process,
683 .bandwidth_update = &rs600_bandwidth_update,
684 .get_vblank_counter = &rs600_get_vblank_counter,
685 .wait_for_vblank = &avivo_wait_for_vblank,
686 .set_backlight_level = &atombios_set_backlight_level,
687 .get_backlight_level = &atombios_get_backlight_level,
688 .hdmi_enable = &r600_hdmi_enable,
689 .hdmi_setmode = &r600_hdmi_setmode,
692 .blit = &r100_copy_blit,
693 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
694 .dma = &r200_copy_dma,
695 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
696 .copy = &r100_copy_blit,
697 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
700 .set_reg = r100_set_surface_reg,
701 .clear_reg = r100_clear_surface_reg,
704 .init = &rs600_hpd_init,
705 .fini = &rs600_hpd_fini,
706 .sense = &rs600_hpd_sense,
707 .set_polarity = &rs600_hpd_set_polarity,
710 .misc = &rs600_pm_misc,
711 .prepare = &rs600_pm_prepare,
712 .finish = &rs600_pm_finish,
713 .init_profile = &r420_pm_init_profile,
714 .get_dynpm_state = &r100_pm_get_dynpm_state,
715 .get_engine_clock = &radeon_atom_get_engine_clock,
716 .set_engine_clock = &radeon_atom_set_engine_clock,
717 .get_memory_clock = &radeon_atom_get_memory_clock,
718 .set_memory_clock = &radeon_atom_set_memory_clock,
719 .get_pcie_lanes = NULL,
720 .set_pcie_lanes = NULL,
721 .set_clock_gating = &radeon_atom_set_clock_gating,
724 .pre_page_flip = &rs600_pre_page_flip,
725 .page_flip = &rs600_page_flip,
726 .post_page_flip = &rs600_post_page_flip,
730 static struct radeon_asic rs690_asic = {
733 .suspend = &rs690_suspend,
734 .resume = &rs690_resume,
735 .vga_set_state = &r100_vga_set_state,
736 .asic_reset = &rs600_asic_reset,
737 .ioctl_wait_idle = NULL,
738 .gui_idle = &r100_gui_idle,
739 .mc_wait_for_idle = &rs690_mc_wait_for_idle,
741 .tlb_flush = &rs400_gart_tlb_flush,
742 .set_page = &rs400_gart_set_page,
745 [RADEON_RING_TYPE_GFX_INDEX] = {
746 .ib_execute = &r100_ring_ib_execute,
747 .emit_fence = &r300_fence_ring_emit,
748 .emit_semaphore = &r100_semaphore_ring_emit,
749 .cs_parse = &r300_cs_parse,
750 .ring_start = &r300_ring_start,
751 .ring_test = &r100_ring_test,
752 .ib_test = &r100_ib_test,
753 .is_lockup = &r100_gpu_is_lockup,
754 .get_rptr = &radeon_ring_generic_get_rptr,
755 .get_wptr = &radeon_ring_generic_get_wptr,
756 .set_wptr = &radeon_ring_generic_set_wptr,
760 .set = &rs600_irq_set,
761 .process = &rs600_irq_process,
764 .get_vblank_counter = &rs600_get_vblank_counter,
765 .bandwidth_update = &rs690_bandwidth_update,
766 .wait_for_vblank = &avivo_wait_for_vblank,
767 .set_backlight_level = &atombios_set_backlight_level,
768 .get_backlight_level = &atombios_get_backlight_level,
769 .hdmi_enable = &r600_hdmi_enable,
770 .hdmi_setmode = &r600_hdmi_setmode,
773 .blit = &r100_copy_blit,
774 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
775 .dma = &r200_copy_dma,
776 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
777 .copy = &r200_copy_dma,
778 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
781 .set_reg = r100_set_surface_reg,
782 .clear_reg = r100_clear_surface_reg,
785 .init = &rs600_hpd_init,
786 .fini = &rs600_hpd_fini,
787 .sense = &rs600_hpd_sense,
788 .set_polarity = &rs600_hpd_set_polarity,
791 .misc = &rs600_pm_misc,
792 .prepare = &rs600_pm_prepare,
793 .finish = &rs600_pm_finish,
794 .init_profile = &r420_pm_init_profile,
795 .get_dynpm_state = &r100_pm_get_dynpm_state,
796 .get_engine_clock = &radeon_atom_get_engine_clock,
797 .set_engine_clock = &radeon_atom_set_engine_clock,
798 .get_memory_clock = &radeon_atom_get_memory_clock,
799 .set_memory_clock = &radeon_atom_set_memory_clock,
800 .get_pcie_lanes = NULL,
801 .set_pcie_lanes = NULL,
802 .set_clock_gating = &radeon_atom_set_clock_gating,
805 .pre_page_flip = &rs600_pre_page_flip,
806 .page_flip = &rs600_page_flip,
807 .post_page_flip = &rs600_post_page_flip,
811 static struct radeon_asic rv515_asic = {
814 .suspend = &rv515_suspend,
815 .resume = &rv515_resume,
816 .vga_set_state = &r100_vga_set_state,
817 .asic_reset = &rs600_asic_reset,
818 .ioctl_wait_idle = NULL,
819 .gui_idle = &r100_gui_idle,
820 .mc_wait_for_idle = &rv515_mc_wait_for_idle,
822 .tlb_flush = &rv370_pcie_gart_tlb_flush,
823 .set_page = &rv370_pcie_gart_set_page,
826 [RADEON_RING_TYPE_GFX_INDEX] = {
827 .ib_execute = &r100_ring_ib_execute,
828 .emit_fence = &r300_fence_ring_emit,
829 .emit_semaphore = &r100_semaphore_ring_emit,
830 .cs_parse = &r300_cs_parse,
831 .ring_start = &rv515_ring_start,
832 .ring_test = &r100_ring_test,
833 .ib_test = &r100_ib_test,
834 .is_lockup = &r100_gpu_is_lockup,
835 .get_rptr = &radeon_ring_generic_get_rptr,
836 .get_wptr = &radeon_ring_generic_get_wptr,
837 .set_wptr = &radeon_ring_generic_set_wptr,
841 .set = &rs600_irq_set,
842 .process = &rs600_irq_process,
845 .get_vblank_counter = &rs600_get_vblank_counter,
846 .bandwidth_update = &rv515_bandwidth_update,
847 .wait_for_vblank = &avivo_wait_for_vblank,
848 .set_backlight_level = &atombios_set_backlight_level,
849 .get_backlight_level = &atombios_get_backlight_level,
852 .blit = &r100_copy_blit,
853 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
854 .dma = &r200_copy_dma,
855 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
856 .copy = &r100_copy_blit,
857 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
860 .set_reg = r100_set_surface_reg,
861 .clear_reg = r100_clear_surface_reg,
864 .init = &rs600_hpd_init,
865 .fini = &rs600_hpd_fini,
866 .sense = &rs600_hpd_sense,
867 .set_polarity = &rs600_hpd_set_polarity,
870 .misc = &rs600_pm_misc,
871 .prepare = &rs600_pm_prepare,
872 .finish = &rs600_pm_finish,
873 .init_profile = &r420_pm_init_profile,
874 .get_dynpm_state = &r100_pm_get_dynpm_state,
875 .get_engine_clock = &radeon_atom_get_engine_clock,
876 .set_engine_clock = &radeon_atom_set_engine_clock,
877 .get_memory_clock = &radeon_atom_get_memory_clock,
878 .set_memory_clock = &radeon_atom_set_memory_clock,
879 .get_pcie_lanes = &rv370_get_pcie_lanes,
880 .set_pcie_lanes = &rv370_set_pcie_lanes,
881 .set_clock_gating = &radeon_atom_set_clock_gating,
884 .pre_page_flip = &rs600_pre_page_flip,
885 .page_flip = &rs600_page_flip,
886 .post_page_flip = &rs600_post_page_flip,
890 static struct radeon_asic r520_asic = {
893 .suspend = &rv515_suspend,
894 .resume = &r520_resume,
895 .vga_set_state = &r100_vga_set_state,
896 .asic_reset = &rs600_asic_reset,
897 .ioctl_wait_idle = NULL,
898 .gui_idle = &r100_gui_idle,
899 .mc_wait_for_idle = &r520_mc_wait_for_idle,
901 .tlb_flush = &rv370_pcie_gart_tlb_flush,
902 .set_page = &rv370_pcie_gart_set_page,
905 [RADEON_RING_TYPE_GFX_INDEX] = {
906 .ib_execute = &r100_ring_ib_execute,
907 .emit_fence = &r300_fence_ring_emit,
908 .emit_semaphore = &r100_semaphore_ring_emit,
909 .cs_parse = &r300_cs_parse,
910 .ring_start = &rv515_ring_start,
911 .ring_test = &r100_ring_test,
912 .ib_test = &r100_ib_test,
913 .is_lockup = &r100_gpu_is_lockup,
914 .get_rptr = &radeon_ring_generic_get_rptr,
915 .get_wptr = &radeon_ring_generic_get_wptr,
916 .set_wptr = &radeon_ring_generic_set_wptr,
920 .set = &rs600_irq_set,
921 .process = &rs600_irq_process,
924 .bandwidth_update = &rv515_bandwidth_update,
925 .get_vblank_counter = &rs600_get_vblank_counter,
926 .wait_for_vblank = &avivo_wait_for_vblank,
927 .set_backlight_level = &atombios_set_backlight_level,
928 .get_backlight_level = &atombios_get_backlight_level,
931 .blit = &r100_copy_blit,
932 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
933 .dma = &r200_copy_dma,
934 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
935 .copy = &r100_copy_blit,
936 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
939 .set_reg = r100_set_surface_reg,
940 .clear_reg = r100_clear_surface_reg,
943 .init = &rs600_hpd_init,
944 .fini = &rs600_hpd_fini,
945 .sense = &rs600_hpd_sense,
946 .set_polarity = &rs600_hpd_set_polarity,
949 .misc = &rs600_pm_misc,
950 .prepare = &rs600_pm_prepare,
951 .finish = &rs600_pm_finish,
952 .init_profile = &r420_pm_init_profile,
953 .get_dynpm_state = &r100_pm_get_dynpm_state,
954 .get_engine_clock = &radeon_atom_get_engine_clock,
955 .set_engine_clock = &radeon_atom_set_engine_clock,
956 .get_memory_clock = &radeon_atom_get_memory_clock,
957 .set_memory_clock = &radeon_atom_set_memory_clock,
958 .get_pcie_lanes = &rv370_get_pcie_lanes,
959 .set_pcie_lanes = &rv370_set_pcie_lanes,
960 .set_clock_gating = &radeon_atom_set_clock_gating,
963 .pre_page_flip = &rs600_pre_page_flip,
964 .page_flip = &rs600_page_flip,
965 .post_page_flip = &rs600_post_page_flip,
969 static struct radeon_asic r600_asic = {
972 .suspend = &r600_suspend,
973 .resume = &r600_resume,
974 .vga_set_state = &r600_vga_set_state,
975 .asic_reset = &r600_asic_reset,
976 .ioctl_wait_idle = r600_ioctl_wait_idle,
977 .gui_idle = &r600_gui_idle,
978 .mc_wait_for_idle = &r600_mc_wait_for_idle,
979 .get_xclk = &r600_get_xclk,
980 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
982 .tlb_flush = &r600_pcie_gart_tlb_flush,
983 .set_page = &rs600_gart_set_page,
986 [RADEON_RING_TYPE_GFX_INDEX] = {
987 .ib_execute = &r600_ring_ib_execute,
988 .emit_fence = &r600_fence_ring_emit,
989 .emit_semaphore = &r600_semaphore_ring_emit,
990 .cs_parse = &r600_cs_parse,
991 .ring_test = &r600_ring_test,
992 .ib_test = &r600_ib_test,
993 .is_lockup = &r600_gfx_is_lockup,
994 .get_rptr = &radeon_ring_generic_get_rptr,
995 .get_wptr = &radeon_ring_generic_get_wptr,
996 .set_wptr = &radeon_ring_generic_set_wptr,
998 [R600_RING_TYPE_DMA_INDEX] = {
999 .ib_execute = &r600_dma_ring_ib_execute,
1000 .emit_fence = &r600_dma_fence_ring_emit,
1001 .emit_semaphore = &r600_dma_semaphore_ring_emit,
1002 .cs_parse = &r600_dma_cs_parse,
1003 .ring_test = &r600_dma_ring_test,
1004 .ib_test = &r600_dma_ib_test,
1005 .is_lockup = &r600_dma_is_lockup,
1006 .get_rptr = &radeon_ring_generic_get_rptr,
1007 .get_wptr = &radeon_ring_generic_get_wptr,
1008 .set_wptr = &radeon_ring_generic_set_wptr,
1012 .set = &r600_irq_set,
1013 .process = &r600_irq_process,
1016 .bandwidth_update = &rv515_bandwidth_update,
1017 .get_vblank_counter = &rs600_get_vblank_counter,
1018 .wait_for_vblank = &avivo_wait_for_vblank,
1019 .set_backlight_level = &atombios_set_backlight_level,
1020 .get_backlight_level = &atombios_get_backlight_level,
1021 .hdmi_enable = &r600_hdmi_enable,
1022 .hdmi_setmode = &r600_hdmi_setmode,
1025 .blit = &r600_copy_blit,
1026 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
1027 .dma = &r600_copy_dma,
1028 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
1029 .copy = &r600_copy_cpdma,
1030 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
1033 .set_reg = r600_set_surface_reg,
1034 .clear_reg = r600_clear_surface_reg,
1037 .init = &r600_hpd_init,
1038 .fini = &r600_hpd_fini,
1039 .sense = &r600_hpd_sense,
1040 .set_polarity = &r600_hpd_set_polarity,
1043 .misc = &r600_pm_misc,
1044 .prepare = &rs600_pm_prepare,
1045 .finish = &rs600_pm_finish,
1046 .init_profile = &r600_pm_init_profile,
1047 .get_dynpm_state = &r600_pm_get_dynpm_state,
1048 .get_engine_clock = &radeon_atom_get_engine_clock,
1049 .set_engine_clock = &radeon_atom_set_engine_clock,
1050 .get_memory_clock = &radeon_atom_get_memory_clock,
1051 .set_memory_clock = &radeon_atom_set_memory_clock,
1052 .get_pcie_lanes = &r600_get_pcie_lanes,
1053 .set_pcie_lanes = &r600_set_pcie_lanes,
1054 .set_clock_gating = NULL,
1055 .get_temperature = &rv6xx_get_temp,
1058 .pre_page_flip = &rs600_pre_page_flip,
1059 .page_flip = &rs600_page_flip,
1060 .post_page_flip = &rs600_post_page_flip,
1064 static struct radeon_asic rv6xx_asic = {
1067 .suspend = &r600_suspend,
1068 .resume = &r600_resume,
1069 .vga_set_state = &r600_vga_set_state,
1070 .asic_reset = &r600_asic_reset,
1071 .ioctl_wait_idle = r600_ioctl_wait_idle,
1072 .gui_idle = &r600_gui_idle,
1073 .mc_wait_for_idle = &r600_mc_wait_for_idle,
1074 .get_xclk = &r600_get_xclk,
1075 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
1077 .tlb_flush = &r600_pcie_gart_tlb_flush,
1078 .set_page = &rs600_gart_set_page,
1081 [RADEON_RING_TYPE_GFX_INDEX] = {
1082 .ib_execute = &r600_ring_ib_execute,
1083 .emit_fence = &r600_fence_ring_emit,
1084 .emit_semaphore = &r600_semaphore_ring_emit,
1085 .cs_parse = &r600_cs_parse,
1086 .ring_test = &r600_ring_test,
1087 .ib_test = &r600_ib_test,
1088 .is_lockup = &r600_gfx_is_lockup,
1089 .get_rptr = &radeon_ring_generic_get_rptr,
1090 .get_wptr = &radeon_ring_generic_get_wptr,
1091 .set_wptr = &radeon_ring_generic_set_wptr,
1093 [R600_RING_TYPE_DMA_INDEX] = {
1094 .ib_execute = &r600_dma_ring_ib_execute,
1095 .emit_fence = &r600_dma_fence_ring_emit,
1096 .emit_semaphore = &r600_dma_semaphore_ring_emit,
1097 .cs_parse = &r600_dma_cs_parse,
1098 .ring_test = &r600_dma_ring_test,
1099 .ib_test = &r600_dma_ib_test,
1100 .is_lockup = &r600_dma_is_lockup,
1101 .get_rptr = &radeon_ring_generic_get_rptr,
1102 .get_wptr = &radeon_ring_generic_get_wptr,
1103 .set_wptr = &radeon_ring_generic_set_wptr,
1107 .set = &r600_irq_set,
1108 .process = &r600_irq_process,
1111 .bandwidth_update = &rv515_bandwidth_update,
1112 .get_vblank_counter = &rs600_get_vblank_counter,
1113 .wait_for_vblank = &avivo_wait_for_vblank,
1114 .set_backlight_level = &atombios_set_backlight_level,
1115 .get_backlight_level = &atombios_get_backlight_level,
1118 .blit = &r600_copy_blit,
1119 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
1120 .dma = &r600_copy_dma,
1121 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
1122 .copy = &r600_copy_cpdma,
1123 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
1126 .set_reg = r600_set_surface_reg,
1127 .clear_reg = r600_clear_surface_reg,
1130 .init = &r600_hpd_init,
1131 .fini = &r600_hpd_fini,
1132 .sense = &r600_hpd_sense,
1133 .set_polarity = &r600_hpd_set_polarity,
1136 .misc = &r600_pm_misc,
1137 .prepare = &rs600_pm_prepare,
1138 .finish = &rs600_pm_finish,
1139 .init_profile = &r600_pm_init_profile,
1140 .get_dynpm_state = &r600_pm_get_dynpm_state,
1141 .get_engine_clock = &radeon_atom_get_engine_clock,
1142 .set_engine_clock = &radeon_atom_set_engine_clock,
1143 .get_memory_clock = &radeon_atom_get_memory_clock,
1144 .set_memory_clock = &radeon_atom_set_memory_clock,
1145 .get_pcie_lanes = &r600_get_pcie_lanes,
1146 .set_pcie_lanes = &r600_set_pcie_lanes,
1147 .set_clock_gating = NULL,
1148 .get_temperature = &rv6xx_get_temp,
1151 .init = &rv6xx_dpm_init,
1152 .setup_asic = &rv6xx_setup_asic,
1153 .enable = &rv6xx_dpm_enable,
1154 .disable = &rv6xx_dpm_disable,
1155 .pre_set_power_state = &r600_dpm_pre_set_power_state,
1156 .set_power_state = &rv6xx_dpm_set_power_state,
1157 .post_set_power_state = &r600_dpm_post_set_power_state,
1158 .display_configuration_changed = &rv6xx_dpm_display_configuration_changed,
1159 .fini = &rv6xx_dpm_fini,
1160 .get_sclk = &rv6xx_dpm_get_sclk,
1161 .get_mclk = &rv6xx_dpm_get_mclk,
1162 .print_power_state = &rv6xx_dpm_print_power_state,
1163 .debugfs_print_current_performance_level = &rv6xx_dpm_debugfs_print_current_performance_level,
1166 .pre_page_flip = &rs600_pre_page_flip,
1167 .page_flip = &rs600_page_flip,
1168 .post_page_flip = &rs600_post_page_flip,
1172 static struct radeon_asic rs780_asic = {
1175 .suspend = &r600_suspend,
1176 .resume = &r600_resume,
1177 .vga_set_state = &r600_vga_set_state,
1178 .asic_reset = &r600_asic_reset,
1179 .ioctl_wait_idle = r600_ioctl_wait_idle,
1180 .gui_idle = &r600_gui_idle,
1181 .mc_wait_for_idle = &r600_mc_wait_for_idle,
1182 .get_xclk = &r600_get_xclk,
1183 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
1185 .tlb_flush = &r600_pcie_gart_tlb_flush,
1186 .set_page = &rs600_gart_set_page,
1189 [RADEON_RING_TYPE_GFX_INDEX] = {
1190 .ib_execute = &r600_ring_ib_execute,
1191 .emit_fence = &r600_fence_ring_emit,
1192 .emit_semaphore = &r600_semaphore_ring_emit,
1193 .cs_parse = &r600_cs_parse,
1194 .ring_test = &r600_ring_test,
1195 .ib_test = &r600_ib_test,
1196 .is_lockup = &r600_gfx_is_lockup,
1197 .get_rptr = &radeon_ring_generic_get_rptr,
1198 .get_wptr = &radeon_ring_generic_get_wptr,
1199 .set_wptr = &radeon_ring_generic_set_wptr,
1201 [R600_RING_TYPE_DMA_INDEX] = {
1202 .ib_execute = &r600_dma_ring_ib_execute,
1203 .emit_fence = &r600_dma_fence_ring_emit,
1204 .emit_semaphore = &r600_dma_semaphore_ring_emit,
1205 .cs_parse = &r600_dma_cs_parse,
1206 .ring_test = &r600_dma_ring_test,
1207 .ib_test = &r600_dma_ib_test,
1208 .is_lockup = &r600_dma_is_lockup,
1209 .get_rptr = &radeon_ring_generic_get_rptr,
1210 .get_wptr = &radeon_ring_generic_get_wptr,
1211 .set_wptr = &radeon_ring_generic_set_wptr,
1215 .set = &r600_irq_set,
1216 .process = &r600_irq_process,
1219 .bandwidth_update = &rs690_bandwidth_update,
1220 .get_vblank_counter = &rs600_get_vblank_counter,
1221 .wait_for_vblank = &avivo_wait_for_vblank,
1222 .set_backlight_level = &atombios_set_backlight_level,
1223 .get_backlight_level = &atombios_get_backlight_level,
1224 .hdmi_enable = &r600_hdmi_enable,
1225 .hdmi_setmode = &r600_hdmi_setmode,
1228 .blit = &r600_copy_blit,
1229 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
1230 .dma = &r600_copy_dma,
1231 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
1232 .copy = &r600_copy_cpdma,
1233 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
1236 .set_reg = r600_set_surface_reg,
1237 .clear_reg = r600_clear_surface_reg,
1240 .init = &r600_hpd_init,
1241 .fini = &r600_hpd_fini,
1242 .sense = &r600_hpd_sense,
1243 .set_polarity = &r600_hpd_set_polarity,
1246 .misc = &r600_pm_misc,
1247 .prepare = &rs600_pm_prepare,
1248 .finish = &rs600_pm_finish,
1249 .init_profile = &rs780_pm_init_profile,
1250 .get_dynpm_state = &r600_pm_get_dynpm_state,
1251 .get_engine_clock = &radeon_atom_get_engine_clock,
1252 .set_engine_clock = &radeon_atom_set_engine_clock,
1253 .get_memory_clock = NULL,
1254 .set_memory_clock = NULL,
1255 .get_pcie_lanes = NULL,
1256 .set_pcie_lanes = NULL,
1257 .set_clock_gating = NULL,
1258 .get_temperature = &rv6xx_get_temp,
1261 .init = &rs780_dpm_init,
1262 .setup_asic = &rs780_dpm_setup_asic,
1263 .enable = &rs780_dpm_enable,
1264 .disable = &rs780_dpm_disable,
1265 .pre_set_power_state = &r600_dpm_pre_set_power_state,
1266 .set_power_state = &rs780_dpm_set_power_state,
1267 .post_set_power_state = &r600_dpm_post_set_power_state,
1268 .display_configuration_changed = &rs780_dpm_display_configuration_changed,
1269 .fini = &rs780_dpm_fini,
1270 .get_sclk = &rs780_dpm_get_sclk,
1271 .get_mclk = &rs780_dpm_get_mclk,
1272 .print_power_state = &rs780_dpm_print_power_state,
1273 .debugfs_print_current_performance_level = &rs780_dpm_debugfs_print_current_performance_level,
1276 .pre_page_flip = &rs600_pre_page_flip,
1277 .page_flip = &rs600_page_flip,
1278 .post_page_flip = &rs600_post_page_flip,
1282 static struct radeon_asic rv770_asic = {
1283 .init = &rv770_init,
1284 .fini = &rv770_fini,
1285 .suspend = &rv770_suspend,
1286 .resume = &rv770_resume,
1287 .asic_reset = &r600_asic_reset,
1288 .vga_set_state = &r600_vga_set_state,
1289 .ioctl_wait_idle = r600_ioctl_wait_idle,
1290 .gui_idle = &r600_gui_idle,
1291 .mc_wait_for_idle = &r600_mc_wait_for_idle,
1292 .get_xclk = &rv770_get_xclk,
1293 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
1295 .tlb_flush = &r600_pcie_gart_tlb_flush,
1296 .set_page = &rs600_gart_set_page,
1299 [RADEON_RING_TYPE_GFX_INDEX] = {
1300 .ib_execute = &r600_ring_ib_execute,
1301 .emit_fence = &r600_fence_ring_emit,
1302 .emit_semaphore = &r600_semaphore_ring_emit,
1303 .cs_parse = &r600_cs_parse,
1304 .ring_test = &r600_ring_test,
1305 .ib_test = &r600_ib_test,
1306 .is_lockup = &r600_gfx_is_lockup,
1307 .get_rptr = &radeon_ring_generic_get_rptr,
1308 .get_wptr = &radeon_ring_generic_get_wptr,
1309 .set_wptr = &radeon_ring_generic_set_wptr,
1311 [R600_RING_TYPE_DMA_INDEX] = {
1312 .ib_execute = &r600_dma_ring_ib_execute,
1313 .emit_fence = &r600_dma_fence_ring_emit,
1314 .emit_semaphore = &r600_dma_semaphore_ring_emit,
1315 .cs_parse = &r600_dma_cs_parse,
1316 .ring_test = &r600_dma_ring_test,
1317 .ib_test = &r600_dma_ib_test,
1318 .is_lockup = &r600_dma_is_lockup,
1319 .get_rptr = &radeon_ring_generic_get_rptr,
1320 .get_wptr = &radeon_ring_generic_get_wptr,
1321 .set_wptr = &radeon_ring_generic_set_wptr,
1323 [R600_RING_TYPE_UVD_INDEX] = {
1324 .ib_execute = &r600_uvd_ib_execute,
1325 .emit_fence = &r600_uvd_fence_emit,
1326 .emit_semaphore = &r600_uvd_semaphore_emit,
1327 .cs_parse = &radeon_uvd_cs_parse,
1328 .ring_test = &r600_uvd_ring_test,
1329 .ib_test = &r600_uvd_ib_test,
1330 .is_lockup = &radeon_ring_test_lockup,
1331 .get_rptr = &radeon_ring_generic_get_rptr,
1332 .get_wptr = &radeon_ring_generic_get_wptr,
1333 .set_wptr = &radeon_ring_generic_set_wptr,
1337 .set = &r600_irq_set,
1338 .process = &r600_irq_process,
1341 .bandwidth_update = &rv515_bandwidth_update,
1342 .get_vblank_counter = &rs600_get_vblank_counter,
1343 .wait_for_vblank = &avivo_wait_for_vblank,
1344 .set_backlight_level = &atombios_set_backlight_level,
1345 .get_backlight_level = &atombios_get_backlight_level,
1346 .hdmi_enable = &r600_hdmi_enable,
1347 .hdmi_setmode = &r600_hdmi_setmode,
1350 .blit = &r600_copy_blit,
1351 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
1352 .dma = &rv770_copy_dma,
1353 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
1354 .copy = &rv770_copy_dma,
1355 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
1358 .set_reg = r600_set_surface_reg,
1359 .clear_reg = r600_clear_surface_reg,
1362 .init = &r600_hpd_init,
1363 .fini = &r600_hpd_fini,
1364 .sense = &r600_hpd_sense,
1365 .set_polarity = &r600_hpd_set_polarity,
1368 .misc = &rv770_pm_misc,
1369 .prepare = &rs600_pm_prepare,
1370 .finish = &rs600_pm_finish,
1371 .init_profile = &r600_pm_init_profile,
1372 .get_dynpm_state = &r600_pm_get_dynpm_state,
1373 .get_engine_clock = &radeon_atom_get_engine_clock,
1374 .set_engine_clock = &radeon_atom_set_engine_clock,
1375 .get_memory_clock = &radeon_atom_get_memory_clock,
1376 .set_memory_clock = &radeon_atom_set_memory_clock,
1377 .get_pcie_lanes = &r600_get_pcie_lanes,
1378 .set_pcie_lanes = &r600_set_pcie_lanes,
1379 .set_clock_gating = &radeon_atom_set_clock_gating,
1380 .set_uvd_clocks = &rv770_set_uvd_clocks,
1381 .get_temperature = &rv770_get_temp,
1384 .init = &rv770_dpm_init,
1385 .setup_asic = &rv770_dpm_setup_asic,
1386 .enable = &rv770_dpm_enable,
1387 .disable = &rv770_dpm_disable,
1388 .pre_set_power_state = &r600_dpm_pre_set_power_state,
1389 .set_power_state = &rv770_dpm_set_power_state,
1390 .post_set_power_state = &r600_dpm_post_set_power_state,
1391 .display_configuration_changed = &rv770_dpm_display_configuration_changed,
1392 .fini = &rv770_dpm_fini,
1393 .get_sclk = &rv770_dpm_get_sclk,
1394 .get_mclk = &rv770_dpm_get_mclk,
1395 .print_power_state = &rv770_dpm_print_power_state,
1396 .debugfs_print_current_performance_level = &rv770_dpm_debugfs_print_current_performance_level,
1397 .force_performance_level = &rv770_dpm_force_performance_level,
1398 .vblank_too_short = &rv770_dpm_vblank_too_short,
1401 .pre_page_flip = &rs600_pre_page_flip,
1402 .page_flip = &rv770_page_flip,
1403 .post_page_flip = &rs600_post_page_flip,
1407 static struct radeon_asic evergreen_asic = {
1408 .init = &evergreen_init,
1409 .fini = &evergreen_fini,
1410 .suspend = &evergreen_suspend,
1411 .resume = &evergreen_resume,
1412 .asic_reset = &evergreen_asic_reset,
1413 .vga_set_state = &r600_vga_set_state,
1414 .ioctl_wait_idle = r600_ioctl_wait_idle,
1415 .gui_idle = &r600_gui_idle,
1416 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
1417 .get_xclk = &rv770_get_xclk,
1418 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
1420 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1421 .set_page = &rs600_gart_set_page,
1424 [RADEON_RING_TYPE_GFX_INDEX] = {
1425 .ib_execute = &evergreen_ring_ib_execute,
1426 .emit_fence = &r600_fence_ring_emit,
1427 .emit_semaphore = &r600_semaphore_ring_emit,
1428 .cs_parse = &evergreen_cs_parse,
1429 .ring_test = &r600_ring_test,
1430 .ib_test = &r600_ib_test,
1431 .is_lockup = &evergreen_gfx_is_lockup,
1432 .get_rptr = &radeon_ring_generic_get_rptr,
1433 .get_wptr = &radeon_ring_generic_get_wptr,
1434 .set_wptr = &radeon_ring_generic_set_wptr,
1436 [R600_RING_TYPE_DMA_INDEX] = {
1437 .ib_execute = &evergreen_dma_ring_ib_execute,
1438 .emit_fence = &evergreen_dma_fence_ring_emit,
1439 .emit_semaphore = &r600_dma_semaphore_ring_emit,
1440 .cs_parse = &evergreen_dma_cs_parse,
1441 .ring_test = &r600_dma_ring_test,
1442 .ib_test = &r600_dma_ib_test,
1443 .is_lockup = &evergreen_dma_is_lockup,
1444 .get_rptr = &radeon_ring_generic_get_rptr,
1445 .get_wptr = &radeon_ring_generic_get_wptr,
1446 .set_wptr = &radeon_ring_generic_set_wptr,
1448 [R600_RING_TYPE_UVD_INDEX] = {
1449 .ib_execute = &r600_uvd_ib_execute,
1450 .emit_fence = &r600_uvd_fence_emit,
1451 .emit_semaphore = &r600_uvd_semaphore_emit,
1452 .cs_parse = &radeon_uvd_cs_parse,
1453 .ring_test = &r600_uvd_ring_test,
1454 .ib_test = &r600_uvd_ib_test,
1455 .is_lockup = &radeon_ring_test_lockup,
1456 .get_rptr = &radeon_ring_generic_get_rptr,
1457 .get_wptr = &radeon_ring_generic_get_wptr,
1458 .set_wptr = &radeon_ring_generic_set_wptr,
1462 .set = &evergreen_irq_set,
1463 .process = &evergreen_irq_process,
1466 .bandwidth_update = &evergreen_bandwidth_update,
1467 .get_vblank_counter = &evergreen_get_vblank_counter,
1468 .wait_for_vblank = &dce4_wait_for_vblank,
1469 .set_backlight_level = &atombios_set_backlight_level,
1470 .get_backlight_level = &atombios_get_backlight_level,
1471 .hdmi_enable = &evergreen_hdmi_enable,
1472 .hdmi_setmode = &evergreen_hdmi_setmode,
1475 .blit = &r600_copy_blit,
1476 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
1477 .dma = &evergreen_copy_dma,
1478 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
1479 .copy = &evergreen_copy_dma,
1480 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
1483 .set_reg = r600_set_surface_reg,
1484 .clear_reg = r600_clear_surface_reg,
1487 .init = &evergreen_hpd_init,
1488 .fini = &evergreen_hpd_fini,
1489 .sense = &evergreen_hpd_sense,
1490 .set_polarity = &evergreen_hpd_set_polarity,
1493 .misc = &evergreen_pm_misc,
1494 .prepare = &evergreen_pm_prepare,
1495 .finish = &evergreen_pm_finish,
1496 .init_profile = &r600_pm_init_profile,
1497 .get_dynpm_state = &r600_pm_get_dynpm_state,
1498 .get_engine_clock = &radeon_atom_get_engine_clock,
1499 .set_engine_clock = &radeon_atom_set_engine_clock,
1500 .get_memory_clock = &radeon_atom_get_memory_clock,
1501 .set_memory_clock = &radeon_atom_set_memory_clock,
1502 .get_pcie_lanes = &r600_get_pcie_lanes,
1503 .set_pcie_lanes = &r600_set_pcie_lanes,
1504 .set_clock_gating = NULL,
1505 .set_uvd_clocks = &evergreen_set_uvd_clocks,
1506 .get_temperature = &evergreen_get_temp,
1509 .init = &cypress_dpm_init,
1510 .setup_asic = &cypress_dpm_setup_asic,
1511 .enable = &cypress_dpm_enable,
1512 .disable = &cypress_dpm_disable,
1513 .pre_set_power_state = &r600_dpm_pre_set_power_state,
1514 .set_power_state = &cypress_dpm_set_power_state,
1515 .post_set_power_state = &r600_dpm_post_set_power_state,
1516 .display_configuration_changed = &cypress_dpm_display_configuration_changed,
1517 .fini = &cypress_dpm_fini,
1518 .get_sclk = &rv770_dpm_get_sclk,
1519 .get_mclk = &rv770_dpm_get_mclk,
1520 .print_power_state = &rv770_dpm_print_power_state,
1521 .debugfs_print_current_performance_level = &rv770_dpm_debugfs_print_current_performance_level,
1522 .force_performance_level = &rv770_dpm_force_performance_level,
1523 .vblank_too_short = &cypress_dpm_vblank_too_short,
1526 .pre_page_flip = &evergreen_pre_page_flip,
1527 .page_flip = &evergreen_page_flip,
1528 .post_page_flip = &evergreen_post_page_flip,
1532 static struct radeon_asic sumo_asic = {
1533 .init = &evergreen_init,
1534 .fini = &evergreen_fini,
1535 .suspend = &evergreen_suspend,
1536 .resume = &evergreen_resume,
1537 .asic_reset = &evergreen_asic_reset,
1538 .vga_set_state = &r600_vga_set_state,
1539 .ioctl_wait_idle = r600_ioctl_wait_idle,
1540 .gui_idle = &r600_gui_idle,
1541 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
1542 .get_xclk = &r600_get_xclk,
1543 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
1545 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1546 .set_page = &rs600_gart_set_page,
1549 [RADEON_RING_TYPE_GFX_INDEX] = {
1550 .ib_execute = &evergreen_ring_ib_execute,
1551 .emit_fence = &r600_fence_ring_emit,
1552 .emit_semaphore = &r600_semaphore_ring_emit,
1553 .cs_parse = &evergreen_cs_parse,
1554 .ring_test = &r600_ring_test,
1555 .ib_test = &r600_ib_test,
1556 .is_lockup = &evergreen_gfx_is_lockup,
1557 .get_rptr = &radeon_ring_generic_get_rptr,
1558 .get_wptr = &radeon_ring_generic_get_wptr,
1559 .set_wptr = &radeon_ring_generic_set_wptr,
1561 [R600_RING_TYPE_DMA_INDEX] = {
1562 .ib_execute = &evergreen_dma_ring_ib_execute,
1563 .emit_fence = &evergreen_dma_fence_ring_emit,
1564 .emit_semaphore = &r600_dma_semaphore_ring_emit,
1565 .cs_parse = &evergreen_dma_cs_parse,
1566 .ring_test = &r600_dma_ring_test,
1567 .ib_test = &r600_dma_ib_test,
1568 .is_lockup = &evergreen_dma_is_lockup,
1569 .get_rptr = &radeon_ring_generic_get_rptr,
1570 .get_wptr = &radeon_ring_generic_get_wptr,
1571 .set_wptr = &radeon_ring_generic_set_wptr,
1573 [R600_RING_TYPE_UVD_INDEX] = {
1574 .ib_execute = &r600_uvd_ib_execute,
1575 .emit_fence = &r600_uvd_fence_emit,
1576 .emit_semaphore = &r600_uvd_semaphore_emit,
1577 .cs_parse = &radeon_uvd_cs_parse,
1578 .ring_test = &r600_uvd_ring_test,
1579 .ib_test = &r600_uvd_ib_test,
1580 .is_lockup = &radeon_ring_test_lockup,
1581 .get_rptr = &radeon_ring_generic_get_rptr,
1582 .get_wptr = &radeon_ring_generic_get_wptr,
1583 .set_wptr = &radeon_ring_generic_set_wptr,
1587 .set = &evergreen_irq_set,
1588 .process = &evergreen_irq_process,
1591 .bandwidth_update = &evergreen_bandwidth_update,
1592 .get_vblank_counter = &evergreen_get_vblank_counter,
1593 .wait_for_vblank = &dce4_wait_for_vblank,
1594 .set_backlight_level = &atombios_set_backlight_level,
1595 .get_backlight_level = &atombios_get_backlight_level,
1596 .hdmi_enable = &evergreen_hdmi_enable,
1597 .hdmi_setmode = &evergreen_hdmi_setmode,
1600 .blit = &r600_copy_blit,
1601 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
1602 .dma = &evergreen_copy_dma,
1603 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
1604 .copy = &evergreen_copy_dma,
1605 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
1608 .set_reg = r600_set_surface_reg,
1609 .clear_reg = r600_clear_surface_reg,
1612 .init = &evergreen_hpd_init,
1613 .fini = &evergreen_hpd_fini,
1614 .sense = &evergreen_hpd_sense,
1615 .set_polarity = &evergreen_hpd_set_polarity,
1618 .misc = &evergreen_pm_misc,
1619 .prepare = &evergreen_pm_prepare,
1620 .finish = &evergreen_pm_finish,
1621 .init_profile = &sumo_pm_init_profile,
1622 .get_dynpm_state = &r600_pm_get_dynpm_state,
1623 .get_engine_clock = &radeon_atom_get_engine_clock,
1624 .set_engine_clock = &radeon_atom_set_engine_clock,
1625 .get_memory_clock = NULL,
1626 .set_memory_clock = NULL,
1627 .get_pcie_lanes = NULL,
1628 .set_pcie_lanes = NULL,
1629 .set_clock_gating = NULL,
1630 .set_uvd_clocks = &sumo_set_uvd_clocks,
1631 .get_temperature = &sumo_get_temp,
1634 .init = &sumo_dpm_init,
1635 .setup_asic = &sumo_dpm_setup_asic,
1636 .enable = &sumo_dpm_enable,
1637 .disable = &sumo_dpm_disable,
1638 .pre_set_power_state = &sumo_dpm_pre_set_power_state,
1639 .set_power_state = &sumo_dpm_set_power_state,
1640 .post_set_power_state = &sumo_dpm_post_set_power_state,
1641 .display_configuration_changed = &sumo_dpm_display_configuration_changed,
1642 .fini = &sumo_dpm_fini,
1643 .get_sclk = &sumo_dpm_get_sclk,
1644 .get_mclk = &sumo_dpm_get_mclk,
1645 .print_power_state = &sumo_dpm_print_power_state,
1646 .debugfs_print_current_performance_level = &sumo_dpm_debugfs_print_current_performance_level,
1647 .force_performance_level = &sumo_dpm_force_performance_level,
1650 .pre_page_flip = &evergreen_pre_page_flip,
1651 .page_flip = &evergreen_page_flip,
1652 .post_page_flip = &evergreen_post_page_flip,
1656 static struct radeon_asic btc_asic = {
1657 .init = &evergreen_init,
1658 .fini = &evergreen_fini,
1659 .suspend = &evergreen_suspend,
1660 .resume = &evergreen_resume,
1661 .asic_reset = &evergreen_asic_reset,
1662 .vga_set_state = &r600_vga_set_state,
1663 .ioctl_wait_idle = r600_ioctl_wait_idle,
1664 .gui_idle = &r600_gui_idle,
1665 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
1666 .get_xclk = &rv770_get_xclk,
1667 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
1669 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1670 .set_page = &rs600_gart_set_page,
1673 [RADEON_RING_TYPE_GFX_INDEX] = {
1674 .ib_execute = &evergreen_ring_ib_execute,
1675 .emit_fence = &r600_fence_ring_emit,
1676 .emit_semaphore = &r600_semaphore_ring_emit,
1677 .cs_parse = &evergreen_cs_parse,
1678 .ring_test = &r600_ring_test,
1679 .ib_test = &r600_ib_test,
1680 .is_lockup = &evergreen_gfx_is_lockup,
1681 .get_rptr = &radeon_ring_generic_get_rptr,
1682 .get_wptr = &radeon_ring_generic_get_wptr,
1683 .set_wptr = &radeon_ring_generic_set_wptr,
1685 [R600_RING_TYPE_DMA_INDEX] = {
1686 .ib_execute = &evergreen_dma_ring_ib_execute,
1687 .emit_fence = &evergreen_dma_fence_ring_emit,
1688 .emit_semaphore = &r600_dma_semaphore_ring_emit,
1689 .cs_parse = &evergreen_dma_cs_parse,
1690 .ring_test = &r600_dma_ring_test,
1691 .ib_test = &r600_dma_ib_test,
1692 .is_lockup = &evergreen_dma_is_lockup,
1693 .get_rptr = &radeon_ring_generic_get_rptr,
1694 .get_wptr = &radeon_ring_generic_get_wptr,
1695 .set_wptr = &radeon_ring_generic_set_wptr,
1697 [R600_RING_TYPE_UVD_INDEX] = {
1698 .ib_execute = &r600_uvd_ib_execute,
1699 .emit_fence = &r600_uvd_fence_emit,
1700 .emit_semaphore = &r600_uvd_semaphore_emit,
1701 .cs_parse = &radeon_uvd_cs_parse,
1702 .ring_test = &r600_uvd_ring_test,
1703 .ib_test = &r600_uvd_ib_test,
1704 .is_lockup = &radeon_ring_test_lockup,
1705 .get_rptr = &radeon_ring_generic_get_rptr,
1706 .get_wptr = &radeon_ring_generic_get_wptr,
1707 .set_wptr = &radeon_ring_generic_set_wptr,
1711 .set = &evergreen_irq_set,
1712 .process = &evergreen_irq_process,
1715 .bandwidth_update = &evergreen_bandwidth_update,
1716 .get_vblank_counter = &evergreen_get_vblank_counter,
1717 .wait_for_vblank = &dce4_wait_for_vblank,
1718 .set_backlight_level = &atombios_set_backlight_level,
1719 .get_backlight_level = &atombios_get_backlight_level,
1720 .hdmi_enable = &evergreen_hdmi_enable,
1721 .hdmi_setmode = &evergreen_hdmi_setmode,
1724 .blit = &r600_copy_blit,
1725 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
1726 .dma = &evergreen_copy_dma,
1727 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
1728 .copy = &evergreen_copy_dma,
1729 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
1732 .set_reg = r600_set_surface_reg,
1733 .clear_reg = r600_clear_surface_reg,
1736 .init = &evergreen_hpd_init,
1737 .fini = &evergreen_hpd_fini,
1738 .sense = &evergreen_hpd_sense,
1739 .set_polarity = &evergreen_hpd_set_polarity,
1742 .misc = &evergreen_pm_misc,
1743 .prepare = &evergreen_pm_prepare,
1744 .finish = &evergreen_pm_finish,
1745 .init_profile = &btc_pm_init_profile,
1746 .get_dynpm_state = &r600_pm_get_dynpm_state,
1747 .get_engine_clock = &radeon_atom_get_engine_clock,
1748 .set_engine_clock = &radeon_atom_set_engine_clock,
1749 .get_memory_clock = &radeon_atom_get_memory_clock,
1750 .set_memory_clock = &radeon_atom_set_memory_clock,
1751 .get_pcie_lanes = &r600_get_pcie_lanes,
1752 .set_pcie_lanes = &r600_set_pcie_lanes,
1753 .set_clock_gating = NULL,
1754 .set_uvd_clocks = &evergreen_set_uvd_clocks,
1755 .get_temperature = &evergreen_get_temp,
1758 .init = &btc_dpm_init,
1759 .setup_asic = &btc_dpm_setup_asic,
1760 .enable = &btc_dpm_enable,
1761 .disable = &btc_dpm_disable,
1762 .pre_set_power_state = &btc_dpm_pre_set_power_state,
1763 .set_power_state = &btc_dpm_set_power_state,
1764 .post_set_power_state = &btc_dpm_post_set_power_state,
1765 .display_configuration_changed = &cypress_dpm_display_configuration_changed,
1766 .fini = &btc_dpm_fini,
1767 .get_sclk = &btc_dpm_get_sclk,
1768 .get_mclk = &btc_dpm_get_mclk,
1769 .print_power_state = &rv770_dpm_print_power_state,
1770 .debugfs_print_current_performance_level = &rv770_dpm_debugfs_print_current_performance_level,
1771 .force_performance_level = &rv770_dpm_force_performance_level,
1772 .vblank_too_short = &btc_dpm_vblank_too_short,
1775 .pre_page_flip = &evergreen_pre_page_flip,
1776 .page_flip = &evergreen_page_flip,
1777 .post_page_flip = &evergreen_post_page_flip,
1781 static struct radeon_asic cayman_asic = {
1782 .init = &cayman_init,
1783 .fini = &cayman_fini,
1784 .suspend = &cayman_suspend,
1785 .resume = &cayman_resume,
1786 .asic_reset = &cayman_asic_reset,
1787 .vga_set_state = &r600_vga_set_state,
1788 .ioctl_wait_idle = r600_ioctl_wait_idle,
1789 .gui_idle = &r600_gui_idle,
1790 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
1791 .get_xclk = &rv770_get_xclk,
1792 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
1794 .tlb_flush = &cayman_pcie_gart_tlb_flush,
1795 .set_page = &rs600_gart_set_page,
1798 .init = &cayman_vm_init,
1799 .fini = &cayman_vm_fini,
1800 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
1801 .set_page = &cayman_vm_set_page,
1804 [RADEON_RING_TYPE_GFX_INDEX] = {
1805 .ib_execute = &cayman_ring_ib_execute,
1806 .ib_parse = &evergreen_ib_parse,
1807 .emit_fence = &cayman_fence_ring_emit,
1808 .emit_semaphore = &r600_semaphore_ring_emit,
1809 .cs_parse = &evergreen_cs_parse,
1810 .ring_test = &r600_ring_test,
1811 .ib_test = &r600_ib_test,
1812 .is_lockup = &cayman_gfx_is_lockup,
1813 .vm_flush = &cayman_vm_flush,
1814 .get_rptr = &radeon_ring_generic_get_rptr,
1815 .get_wptr = &radeon_ring_generic_get_wptr,
1816 .set_wptr = &radeon_ring_generic_set_wptr,
1818 [CAYMAN_RING_TYPE_CP1_INDEX] = {
1819 .ib_execute = &cayman_ring_ib_execute,
1820 .ib_parse = &evergreen_ib_parse,
1821 .emit_fence = &cayman_fence_ring_emit,
1822 .emit_semaphore = &r600_semaphore_ring_emit,
1823 .cs_parse = &evergreen_cs_parse,
1824 .ring_test = &r600_ring_test,
1825 .ib_test = &r600_ib_test,
1826 .is_lockup = &cayman_gfx_is_lockup,
1827 .vm_flush = &cayman_vm_flush,
1828 .get_rptr = &radeon_ring_generic_get_rptr,
1829 .get_wptr = &radeon_ring_generic_get_wptr,
1830 .set_wptr = &radeon_ring_generic_set_wptr,
1832 [CAYMAN_RING_TYPE_CP2_INDEX] = {
1833 .ib_execute = &cayman_ring_ib_execute,
1834 .ib_parse = &evergreen_ib_parse,
1835 .emit_fence = &cayman_fence_ring_emit,
1836 .emit_semaphore = &r600_semaphore_ring_emit,
1837 .cs_parse = &evergreen_cs_parse,
1838 .ring_test = &r600_ring_test,
1839 .ib_test = &r600_ib_test,
1840 .is_lockup = &cayman_gfx_is_lockup,
1841 .vm_flush = &cayman_vm_flush,
1842 .get_rptr = &radeon_ring_generic_get_rptr,
1843 .get_wptr = &radeon_ring_generic_get_wptr,
1844 .set_wptr = &radeon_ring_generic_set_wptr,
1846 [R600_RING_TYPE_DMA_INDEX] = {
1847 .ib_execute = &cayman_dma_ring_ib_execute,
1848 .ib_parse = &evergreen_dma_ib_parse,
1849 .emit_fence = &evergreen_dma_fence_ring_emit,
1850 .emit_semaphore = &r600_dma_semaphore_ring_emit,
1851 .cs_parse = &evergreen_dma_cs_parse,
1852 .ring_test = &r600_dma_ring_test,
1853 .ib_test = &r600_dma_ib_test,
1854 .is_lockup = &cayman_dma_is_lockup,
1855 .vm_flush = &cayman_dma_vm_flush,
1856 .get_rptr = &radeon_ring_generic_get_rptr,
1857 .get_wptr = &radeon_ring_generic_get_wptr,
1858 .set_wptr = &radeon_ring_generic_set_wptr,
1860 [CAYMAN_RING_TYPE_DMA1_INDEX] = {
1861 .ib_execute = &cayman_dma_ring_ib_execute,
1862 .ib_parse = &evergreen_dma_ib_parse,
1863 .emit_fence = &evergreen_dma_fence_ring_emit,
1864 .emit_semaphore = &r600_dma_semaphore_ring_emit,
1865 .cs_parse = &evergreen_dma_cs_parse,
1866 .ring_test = &r600_dma_ring_test,
1867 .ib_test = &r600_dma_ib_test,
1868 .is_lockup = &cayman_dma_is_lockup,
1869 .vm_flush = &cayman_dma_vm_flush,
1870 .get_rptr = &radeon_ring_generic_get_rptr,
1871 .get_wptr = &radeon_ring_generic_get_wptr,
1872 .set_wptr = &radeon_ring_generic_set_wptr,
1874 [R600_RING_TYPE_UVD_INDEX] = {
1875 .ib_execute = &r600_uvd_ib_execute,
1876 .emit_fence = &r600_uvd_fence_emit,
1877 .emit_semaphore = &cayman_uvd_semaphore_emit,
1878 .cs_parse = &radeon_uvd_cs_parse,
1879 .ring_test = &r600_uvd_ring_test,
1880 .ib_test = &r600_uvd_ib_test,
1881 .is_lockup = &radeon_ring_test_lockup,
1882 .get_rptr = &radeon_ring_generic_get_rptr,
1883 .get_wptr = &radeon_ring_generic_get_wptr,
1884 .set_wptr = &radeon_ring_generic_set_wptr,
1888 .set = &evergreen_irq_set,
1889 .process = &evergreen_irq_process,
1892 .bandwidth_update = &evergreen_bandwidth_update,
1893 .get_vblank_counter = &evergreen_get_vblank_counter,
1894 .wait_for_vblank = &dce4_wait_for_vblank,
1895 .set_backlight_level = &atombios_set_backlight_level,
1896 .get_backlight_level = &atombios_get_backlight_level,
1897 .hdmi_enable = &evergreen_hdmi_enable,
1898 .hdmi_setmode = &evergreen_hdmi_setmode,
1901 .blit = &r600_copy_blit,
1902 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
1903 .dma = &evergreen_copy_dma,
1904 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
1905 .copy = &evergreen_copy_dma,
1906 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
1909 .set_reg = r600_set_surface_reg,
1910 .clear_reg = r600_clear_surface_reg,
1913 .init = &evergreen_hpd_init,
1914 .fini = &evergreen_hpd_fini,
1915 .sense = &evergreen_hpd_sense,
1916 .set_polarity = &evergreen_hpd_set_polarity,
1919 .misc = &evergreen_pm_misc,
1920 .prepare = &evergreen_pm_prepare,
1921 .finish = &evergreen_pm_finish,
1922 .init_profile = &btc_pm_init_profile,
1923 .get_dynpm_state = &r600_pm_get_dynpm_state,
1924 .get_engine_clock = &radeon_atom_get_engine_clock,
1925 .set_engine_clock = &radeon_atom_set_engine_clock,
1926 .get_memory_clock = &radeon_atom_get_memory_clock,
1927 .set_memory_clock = &radeon_atom_set_memory_clock,
1928 .get_pcie_lanes = &r600_get_pcie_lanes,
1929 .set_pcie_lanes = &r600_set_pcie_lanes,
1930 .set_clock_gating = NULL,
1931 .set_uvd_clocks = &evergreen_set_uvd_clocks,
1932 .get_temperature = &evergreen_get_temp,
1935 .init = &ni_dpm_init,
1936 .setup_asic = &ni_dpm_setup_asic,
1937 .enable = &ni_dpm_enable,
1938 .disable = &ni_dpm_disable,
1939 .pre_set_power_state = &ni_dpm_pre_set_power_state,
1940 .set_power_state = &ni_dpm_set_power_state,
1941 .post_set_power_state = &ni_dpm_post_set_power_state,
1942 .display_configuration_changed = &cypress_dpm_display_configuration_changed,
1943 .fini = &ni_dpm_fini,
1944 .get_sclk = &ni_dpm_get_sclk,
1945 .get_mclk = &ni_dpm_get_mclk,
1946 .print_power_state = &ni_dpm_print_power_state,
1947 .debugfs_print_current_performance_level = &ni_dpm_debugfs_print_current_performance_level,
1948 .force_performance_level = &ni_dpm_force_performance_level,
1949 .vblank_too_short = &ni_dpm_vblank_too_short,
1952 .pre_page_flip = &evergreen_pre_page_flip,
1953 .page_flip = &evergreen_page_flip,
1954 .post_page_flip = &evergreen_post_page_flip,
1958 static struct radeon_asic trinity_asic = {
1959 .init = &cayman_init,
1960 .fini = &cayman_fini,
1961 .suspend = &cayman_suspend,
1962 .resume = &cayman_resume,
1963 .asic_reset = &cayman_asic_reset,
1964 .vga_set_state = &r600_vga_set_state,
1965 .ioctl_wait_idle = r600_ioctl_wait_idle,
1966 .gui_idle = &r600_gui_idle,
1967 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
1968 .get_xclk = &r600_get_xclk,
1969 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
1971 .tlb_flush = &cayman_pcie_gart_tlb_flush,
1972 .set_page = &rs600_gart_set_page,
1975 .init = &cayman_vm_init,
1976 .fini = &cayman_vm_fini,
1977 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
1978 .set_page = &cayman_vm_set_page,
1981 [RADEON_RING_TYPE_GFX_INDEX] = {
1982 .ib_execute = &cayman_ring_ib_execute,
1983 .ib_parse = &evergreen_ib_parse,
1984 .emit_fence = &cayman_fence_ring_emit,
1985 .emit_semaphore = &r600_semaphore_ring_emit,
1986 .cs_parse = &evergreen_cs_parse,
1987 .ring_test = &r600_ring_test,
1988 .ib_test = &r600_ib_test,
1989 .is_lockup = &cayman_gfx_is_lockup,
1990 .vm_flush = &cayman_vm_flush,
1991 .get_rptr = &radeon_ring_generic_get_rptr,
1992 .get_wptr = &radeon_ring_generic_get_wptr,
1993 .set_wptr = &radeon_ring_generic_set_wptr,
1995 [CAYMAN_RING_TYPE_CP1_INDEX] = {
1996 .ib_execute = &cayman_ring_ib_execute,
1997 .ib_parse = &evergreen_ib_parse,
1998 .emit_fence = &cayman_fence_ring_emit,
1999 .emit_semaphore = &r600_semaphore_ring_emit,
2000 .cs_parse = &evergreen_cs_parse,
2001 .ring_test = &r600_ring_test,
2002 .ib_test = &r600_ib_test,
2003 .is_lockup = &cayman_gfx_is_lockup,
2004 .vm_flush = &cayman_vm_flush,
2005 .get_rptr = &radeon_ring_generic_get_rptr,
2006 .get_wptr = &radeon_ring_generic_get_wptr,
2007 .set_wptr = &radeon_ring_generic_set_wptr,
2009 [CAYMAN_RING_TYPE_CP2_INDEX] = {
2010 .ib_execute = &cayman_ring_ib_execute,
2011 .ib_parse = &evergreen_ib_parse,
2012 .emit_fence = &cayman_fence_ring_emit,
2013 .emit_semaphore = &r600_semaphore_ring_emit,
2014 .cs_parse = &evergreen_cs_parse,
2015 .ring_test = &r600_ring_test,
2016 .ib_test = &r600_ib_test,
2017 .is_lockup = &cayman_gfx_is_lockup,
2018 .vm_flush = &cayman_vm_flush,
2019 .get_rptr = &radeon_ring_generic_get_rptr,
2020 .get_wptr = &radeon_ring_generic_get_wptr,
2021 .set_wptr = &radeon_ring_generic_set_wptr,
2023 [R600_RING_TYPE_DMA_INDEX] = {
2024 .ib_execute = &cayman_dma_ring_ib_execute,
2025 .ib_parse = &evergreen_dma_ib_parse,
2026 .emit_fence = &evergreen_dma_fence_ring_emit,
2027 .emit_semaphore = &r600_dma_semaphore_ring_emit,
2028 .cs_parse = &evergreen_dma_cs_parse,
2029 .ring_test = &r600_dma_ring_test,
2030 .ib_test = &r600_dma_ib_test,
2031 .is_lockup = &cayman_dma_is_lockup,
2032 .vm_flush = &cayman_dma_vm_flush,
2033 .get_rptr = &radeon_ring_generic_get_rptr,
2034 .get_wptr = &radeon_ring_generic_get_wptr,
2035 .set_wptr = &radeon_ring_generic_set_wptr,
2037 [CAYMAN_RING_TYPE_DMA1_INDEX] = {
2038 .ib_execute = &cayman_dma_ring_ib_execute,
2039 .ib_parse = &evergreen_dma_ib_parse,
2040 .emit_fence = &evergreen_dma_fence_ring_emit,
2041 .emit_semaphore = &r600_dma_semaphore_ring_emit,
2042 .cs_parse = &evergreen_dma_cs_parse,
2043 .ring_test = &r600_dma_ring_test,
2044 .ib_test = &r600_dma_ib_test,
2045 .is_lockup = &cayman_dma_is_lockup,
2046 .vm_flush = &cayman_dma_vm_flush,
2047 .get_rptr = &radeon_ring_generic_get_rptr,
2048 .get_wptr = &radeon_ring_generic_get_wptr,
2049 .set_wptr = &radeon_ring_generic_set_wptr,
2051 [R600_RING_TYPE_UVD_INDEX] = {
2052 .ib_execute = &r600_uvd_ib_execute,
2053 .emit_fence = &r600_uvd_fence_emit,
2054 .emit_semaphore = &cayman_uvd_semaphore_emit,
2055 .cs_parse = &radeon_uvd_cs_parse,
2056 .ring_test = &r600_uvd_ring_test,
2057 .ib_test = &r600_uvd_ib_test,
2058 .is_lockup = &radeon_ring_test_lockup,
2059 .get_rptr = &radeon_ring_generic_get_rptr,
2060 .get_wptr = &radeon_ring_generic_get_wptr,
2061 .set_wptr = &radeon_ring_generic_set_wptr,
2065 .set = &evergreen_irq_set,
2066 .process = &evergreen_irq_process,
2069 .bandwidth_update = &dce6_bandwidth_update,
2070 .get_vblank_counter = &evergreen_get_vblank_counter,
2071 .wait_for_vblank = &dce4_wait_for_vblank,
2072 .set_backlight_level = &atombios_set_backlight_level,
2073 .get_backlight_level = &atombios_get_backlight_level,
2076 .blit = &r600_copy_blit,
2077 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
2078 .dma = &evergreen_copy_dma,
2079 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
2080 .copy = &evergreen_copy_dma,
2081 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
2084 .set_reg = r600_set_surface_reg,
2085 .clear_reg = r600_clear_surface_reg,
2088 .init = &evergreen_hpd_init,
2089 .fini = &evergreen_hpd_fini,
2090 .sense = &evergreen_hpd_sense,
2091 .set_polarity = &evergreen_hpd_set_polarity,
2094 .misc = &evergreen_pm_misc,
2095 .prepare = &evergreen_pm_prepare,
2096 .finish = &evergreen_pm_finish,
2097 .init_profile = &sumo_pm_init_profile,
2098 .get_dynpm_state = &r600_pm_get_dynpm_state,
2099 .get_engine_clock = &radeon_atom_get_engine_clock,
2100 .set_engine_clock = &radeon_atom_set_engine_clock,
2101 .get_memory_clock = NULL,
2102 .set_memory_clock = NULL,
2103 .get_pcie_lanes = NULL,
2104 .set_pcie_lanes = NULL,
2105 .set_clock_gating = NULL,
2106 .set_uvd_clocks = &sumo_set_uvd_clocks,
2107 .get_temperature = &tn_get_temp,
2110 .init = &trinity_dpm_init,
2111 .setup_asic = &trinity_dpm_setup_asic,
2112 .enable = &trinity_dpm_enable,
2113 .disable = &trinity_dpm_disable,
2114 .pre_set_power_state = &trinity_dpm_pre_set_power_state,
2115 .set_power_state = &trinity_dpm_set_power_state,
2116 .post_set_power_state = &trinity_dpm_post_set_power_state,
2117 .display_configuration_changed = &trinity_dpm_display_configuration_changed,
2118 .fini = &trinity_dpm_fini,
2119 .get_sclk = &trinity_dpm_get_sclk,
2120 .get_mclk = &trinity_dpm_get_mclk,
2121 .print_power_state = &trinity_dpm_print_power_state,
2122 .debugfs_print_current_performance_level = &trinity_dpm_debugfs_print_current_performance_level,
2123 .force_performance_level = &trinity_dpm_force_performance_level,
2126 .pre_page_flip = &evergreen_pre_page_flip,
2127 .page_flip = &evergreen_page_flip,
2128 .post_page_flip = &evergreen_post_page_flip,
2132 static struct radeon_asic si_asic = {
2135 .suspend = &si_suspend,
2136 .resume = &si_resume,
2137 .asic_reset = &si_asic_reset,
2138 .vga_set_state = &r600_vga_set_state,
2139 .ioctl_wait_idle = r600_ioctl_wait_idle,
2140 .gui_idle = &r600_gui_idle,
2141 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
2142 .get_xclk = &si_get_xclk,
2143 .get_gpu_clock_counter = &si_get_gpu_clock_counter,
2145 .tlb_flush = &si_pcie_gart_tlb_flush,
2146 .set_page = &rs600_gart_set_page,
2149 .init = &si_vm_init,
2150 .fini = &si_vm_fini,
2151 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
2152 .set_page = &si_vm_set_page,
2155 [RADEON_RING_TYPE_GFX_INDEX] = {
2156 .ib_execute = &si_ring_ib_execute,
2157 .ib_parse = &si_ib_parse,
2158 .emit_fence = &si_fence_ring_emit,
2159 .emit_semaphore = &r600_semaphore_ring_emit,
2161 .ring_test = &r600_ring_test,
2162 .ib_test = &r600_ib_test,
2163 .is_lockup = &si_gfx_is_lockup,
2164 .vm_flush = &si_vm_flush,
2165 .get_rptr = &radeon_ring_generic_get_rptr,
2166 .get_wptr = &radeon_ring_generic_get_wptr,
2167 .set_wptr = &radeon_ring_generic_set_wptr,
2169 [CAYMAN_RING_TYPE_CP1_INDEX] = {
2170 .ib_execute = &si_ring_ib_execute,
2171 .ib_parse = &si_ib_parse,
2172 .emit_fence = &si_fence_ring_emit,
2173 .emit_semaphore = &r600_semaphore_ring_emit,
2175 .ring_test = &r600_ring_test,
2176 .ib_test = &r600_ib_test,
2177 .is_lockup = &si_gfx_is_lockup,
2178 .vm_flush = &si_vm_flush,
2179 .get_rptr = &radeon_ring_generic_get_rptr,
2180 .get_wptr = &radeon_ring_generic_get_wptr,
2181 .set_wptr = &radeon_ring_generic_set_wptr,
2183 [CAYMAN_RING_TYPE_CP2_INDEX] = {
2184 .ib_execute = &si_ring_ib_execute,
2185 .ib_parse = &si_ib_parse,
2186 .emit_fence = &si_fence_ring_emit,
2187 .emit_semaphore = &r600_semaphore_ring_emit,
2189 .ring_test = &r600_ring_test,
2190 .ib_test = &r600_ib_test,
2191 .is_lockup = &si_gfx_is_lockup,
2192 .vm_flush = &si_vm_flush,
2193 .get_rptr = &radeon_ring_generic_get_rptr,
2194 .get_wptr = &radeon_ring_generic_get_wptr,
2195 .set_wptr = &radeon_ring_generic_set_wptr,
2197 [R600_RING_TYPE_DMA_INDEX] = {
2198 .ib_execute = &cayman_dma_ring_ib_execute,
2199 .ib_parse = &evergreen_dma_ib_parse,
2200 .emit_fence = &evergreen_dma_fence_ring_emit,
2201 .emit_semaphore = &r600_dma_semaphore_ring_emit,
2203 .ring_test = &r600_dma_ring_test,
2204 .ib_test = &r600_dma_ib_test,
2205 .is_lockup = &si_dma_is_lockup,
2206 .vm_flush = &si_dma_vm_flush,
2207 .get_rptr = &radeon_ring_generic_get_rptr,
2208 .get_wptr = &radeon_ring_generic_get_wptr,
2209 .set_wptr = &radeon_ring_generic_set_wptr,
2211 [CAYMAN_RING_TYPE_DMA1_INDEX] = {
2212 .ib_execute = &cayman_dma_ring_ib_execute,
2213 .ib_parse = &evergreen_dma_ib_parse,
2214 .emit_fence = &evergreen_dma_fence_ring_emit,
2215 .emit_semaphore = &r600_dma_semaphore_ring_emit,
2217 .ring_test = &r600_dma_ring_test,
2218 .ib_test = &r600_dma_ib_test,
2219 .is_lockup = &si_dma_is_lockup,
2220 .vm_flush = &si_dma_vm_flush,
2221 .get_rptr = &radeon_ring_generic_get_rptr,
2222 .get_wptr = &radeon_ring_generic_get_wptr,
2223 .set_wptr = &radeon_ring_generic_set_wptr,
2225 [R600_RING_TYPE_UVD_INDEX] = {
2226 .ib_execute = &r600_uvd_ib_execute,
2227 .emit_fence = &r600_uvd_fence_emit,
2228 .emit_semaphore = &cayman_uvd_semaphore_emit,
2229 .cs_parse = &radeon_uvd_cs_parse,
2230 .ring_test = &r600_uvd_ring_test,
2231 .ib_test = &r600_uvd_ib_test,
2232 .is_lockup = &radeon_ring_test_lockup,
2233 .get_rptr = &radeon_ring_generic_get_rptr,
2234 .get_wptr = &radeon_ring_generic_get_wptr,
2235 .set_wptr = &radeon_ring_generic_set_wptr,
2240 .process = &si_irq_process,
2243 .bandwidth_update = &dce6_bandwidth_update,
2244 .get_vblank_counter = &evergreen_get_vblank_counter,
2245 .wait_for_vblank = &dce4_wait_for_vblank,
2246 .set_backlight_level = &atombios_set_backlight_level,
2247 .get_backlight_level = &atombios_get_backlight_level,
2251 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
2252 .dma = &si_copy_dma,
2253 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
2254 .copy = &si_copy_dma,
2255 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
2258 .set_reg = r600_set_surface_reg,
2259 .clear_reg = r600_clear_surface_reg,
2262 .init = &evergreen_hpd_init,
2263 .fini = &evergreen_hpd_fini,
2264 .sense = &evergreen_hpd_sense,
2265 .set_polarity = &evergreen_hpd_set_polarity,
2268 .misc = &evergreen_pm_misc,
2269 .prepare = &evergreen_pm_prepare,
2270 .finish = &evergreen_pm_finish,
2271 .init_profile = &sumo_pm_init_profile,
2272 .get_dynpm_state = &r600_pm_get_dynpm_state,
2273 .get_engine_clock = &radeon_atom_get_engine_clock,
2274 .set_engine_clock = &radeon_atom_set_engine_clock,
2275 .get_memory_clock = &radeon_atom_get_memory_clock,
2276 .set_memory_clock = &radeon_atom_set_memory_clock,
2277 .get_pcie_lanes = &r600_get_pcie_lanes,
2278 .set_pcie_lanes = &r600_set_pcie_lanes,
2279 .set_clock_gating = NULL,
2280 .set_uvd_clocks = &si_set_uvd_clocks,
2281 .get_temperature = &si_get_temp,
2284 .init = &si_dpm_init,
2285 .setup_asic = &si_dpm_setup_asic,
2286 .enable = &si_dpm_enable,
2287 .disable = &si_dpm_disable,
2288 .pre_set_power_state = &si_dpm_pre_set_power_state,
2289 .set_power_state = &si_dpm_set_power_state,
2290 .post_set_power_state = &si_dpm_post_set_power_state,
2291 .display_configuration_changed = &si_dpm_display_configuration_changed,
2292 .fini = &si_dpm_fini,
2293 .get_sclk = &ni_dpm_get_sclk,
2294 .get_mclk = &ni_dpm_get_mclk,
2295 .print_power_state = &ni_dpm_print_power_state,
2296 .debugfs_print_current_performance_level = &si_dpm_debugfs_print_current_performance_level,
2297 .force_performance_level = &si_dpm_force_performance_level,
2298 .vblank_too_short = &ni_dpm_vblank_too_short,
2301 .pre_page_flip = &evergreen_pre_page_flip,
2302 .page_flip = &evergreen_page_flip,
2303 .post_page_flip = &evergreen_post_page_flip,
2307 static struct radeon_asic ci_asic = {
2310 .suspend = &cik_suspend,
2311 .resume = &cik_resume,
2312 .asic_reset = &cik_asic_reset,
2313 .vga_set_state = &r600_vga_set_state,
2314 .ioctl_wait_idle = NULL,
2315 .gui_idle = &r600_gui_idle,
2316 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
2317 .get_xclk = &cik_get_xclk,
2318 .get_gpu_clock_counter = &cik_get_gpu_clock_counter,
2320 .tlb_flush = &cik_pcie_gart_tlb_flush,
2321 .set_page = &rs600_gart_set_page,
2324 .init = &cik_vm_init,
2325 .fini = &cik_vm_fini,
2326 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
2327 .set_page = &cik_vm_set_page,
2330 [RADEON_RING_TYPE_GFX_INDEX] = {
2331 .ib_execute = &cik_ring_ib_execute,
2332 .ib_parse = &cik_ib_parse,
2333 .emit_fence = &cik_fence_gfx_ring_emit,
2334 .emit_semaphore = &cik_semaphore_ring_emit,
2336 .ring_test = &cik_ring_test,
2337 .ib_test = &cik_ib_test,
2338 .is_lockup = &cik_gfx_is_lockup,
2339 .vm_flush = &cik_vm_flush,
2340 .get_rptr = &radeon_ring_generic_get_rptr,
2341 .get_wptr = &radeon_ring_generic_get_wptr,
2342 .set_wptr = &radeon_ring_generic_set_wptr,
2344 [CAYMAN_RING_TYPE_CP1_INDEX] = {
2345 .ib_execute = &cik_ring_ib_execute,
2346 .ib_parse = &cik_ib_parse,
2347 .emit_fence = &cik_fence_compute_ring_emit,
2348 .emit_semaphore = &cik_semaphore_ring_emit,
2350 .ring_test = &cik_ring_test,
2351 .ib_test = &cik_ib_test,
2352 .is_lockup = &cik_gfx_is_lockup,
2353 .vm_flush = &cik_vm_flush,
2354 .get_rptr = &cik_compute_ring_get_rptr,
2355 .get_wptr = &cik_compute_ring_get_wptr,
2356 .set_wptr = &cik_compute_ring_set_wptr,
2358 [CAYMAN_RING_TYPE_CP2_INDEX] = {
2359 .ib_execute = &cik_ring_ib_execute,
2360 .ib_parse = &cik_ib_parse,
2361 .emit_fence = &cik_fence_compute_ring_emit,
2362 .emit_semaphore = &cik_semaphore_ring_emit,
2364 .ring_test = &cik_ring_test,
2365 .ib_test = &cik_ib_test,
2366 .is_lockup = &cik_gfx_is_lockup,
2367 .vm_flush = &cik_vm_flush,
2368 .get_rptr = &cik_compute_ring_get_rptr,
2369 .get_wptr = &cik_compute_ring_get_wptr,
2370 .set_wptr = &cik_compute_ring_set_wptr,
2372 [R600_RING_TYPE_DMA_INDEX] = {
2373 .ib_execute = &cik_sdma_ring_ib_execute,
2374 .ib_parse = &cik_ib_parse,
2375 .emit_fence = &cik_sdma_fence_ring_emit,
2376 .emit_semaphore = &cik_sdma_semaphore_ring_emit,
2378 .ring_test = &cik_sdma_ring_test,
2379 .ib_test = &cik_sdma_ib_test,
2380 .is_lockup = &cik_sdma_is_lockup,
2381 .vm_flush = &cik_dma_vm_flush,
2382 .get_rptr = &radeon_ring_generic_get_rptr,
2383 .get_wptr = &radeon_ring_generic_get_wptr,
2384 .set_wptr = &radeon_ring_generic_set_wptr,
2386 [CAYMAN_RING_TYPE_DMA1_INDEX] = {
2387 .ib_execute = &cik_sdma_ring_ib_execute,
2388 .ib_parse = &cik_ib_parse,
2389 .emit_fence = &cik_sdma_fence_ring_emit,
2390 .emit_semaphore = &cik_sdma_semaphore_ring_emit,
2392 .ring_test = &cik_sdma_ring_test,
2393 .ib_test = &cik_sdma_ib_test,
2394 .is_lockup = &cik_sdma_is_lockup,
2395 .vm_flush = &cik_dma_vm_flush,
2396 .get_rptr = &radeon_ring_generic_get_rptr,
2397 .get_wptr = &radeon_ring_generic_get_wptr,
2398 .set_wptr = &radeon_ring_generic_set_wptr,
2400 [R600_RING_TYPE_UVD_INDEX] = {
2401 .ib_execute = &r600_uvd_ib_execute,
2402 .emit_fence = &r600_uvd_fence_emit,
2403 .emit_semaphore = &cayman_uvd_semaphore_emit,
2404 .cs_parse = &radeon_uvd_cs_parse,
2405 .ring_test = &r600_uvd_ring_test,
2406 .ib_test = &r600_uvd_ib_test,
2407 .is_lockup = &radeon_ring_test_lockup,
2408 .get_rptr = &radeon_ring_generic_get_rptr,
2409 .get_wptr = &radeon_ring_generic_get_wptr,
2410 .set_wptr = &radeon_ring_generic_set_wptr,
2414 .set = &cik_irq_set,
2415 .process = &cik_irq_process,
2418 .bandwidth_update = &dce8_bandwidth_update,
2419 .get_vblank_counter = &evergreen_get_vblank_counter,
2420 .wait_for_vblank = &dce4_wait_for_vblank,
2424 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
2425 .dma = &cik_copy_dma,
2426 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
2427 .copy = &cik_copy_dma,
2428 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
2431 .set_reg = r600_set_surface_reg,
2432 .clear_reg = r600_clear_surface_reg,
2435 .init = &evergreen_hpd_init,
2436 .fini = &evergreen_hpd_fini,
2437 .sense = &evergreen_hpd_sense,
2438 .set_polarity = &evergreen_hpd_set_polarity,
2441 .misc = &evergreen_pm_misc,
2442 .prepare = &evergreen_pm_prepare,
2443 .finish = &evergreen_pm_finish,
2444 .init_profile = &sumo_pm_init_profile,
2445 .get_dynpm_state = &r600_pm_get_dynpm_state,
2446 .get_engine_clock = &radeon_atom_get_engine_clock,
2447 .set_engine_clock = &radeon_atom_set_engine_clock,
2448 .get_memory_clock = &radeon_atom_get_memory_clock,
2449 .set_memory_clock = &radeon_atom_set_memory_clock,
2450 .get_pcie_lanes = NULL,
2451 .set_pcie_lanes = NULL,
2452 .set_clock_gating = NULL,
2453 .set_uvd_clocks = &cik_set_uvd_clocks,
2456 .pre_page_flip = &evergreen_pre_page_flip,
2457 .page_flip = &evergreen_page_flip,
2458 .post_page_flip = &evergreen_post_page_flip,
2462 static struct radeon_asic kv_asic = {
2465 .suspend = &cik_suspend,
2466 .resume = &cik_resume,
2467 .asic_reset = &cik_asic_reset,
2468 .vga_set_state = &r600_vga_set_state,
2469 .ioctl_wait_idle = NULL,
2470 .gui_idle = &r600_gui_idle,
2471 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
2472 .get_xclk = &cik_get_xclk,
2473 .get_gpu_clock_counter = &cik_get_gpu_clock_counter,
2475 .tlb_flush = &cik_pcie_gart_tlb_flush,
2476 .set_page = &rs600_gart_set_page,
2479 .init = &cik_vm_init,
2480 .fini = &cik_vm_fini,
2481 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
2482 .set_page = &cik_vm_set_page,
2485 [RADEON_RING_TYPE_GFX_INDEX] = {
2486 .ib_execute = &cik_ring_ib_execute,
2487 .ib_parse = &cik_ib_parse,
2488 .emit_fence = &cik_fence_gfx_ring_emit,
2489 .emit_semaphore = &cik_semaphore_ring_emit,
2491 .ring_test = &cik_ring_test,
2492 .ib_test = &cik_ib_test,
2493 .is_lockup = &cik_gfx_is_lockup,
2494 .vm_flush = &cik_vm_flush,
2495 .get_rptr = &radeon_ring_generic_get_rptr,
2496 .get_wptr = &radeon_ring_generic_get_wptr,
2497 .set_wptr = &radeon_ring_generic_set_wptr,
2499 [CAYMAN_RING_TYPE_CP1_INDEX] = {
2500 .ib_execute = &cik_ring_ib_execute,
2501 .ib_parse = &cik_ib_parse,
2502 .emit_fence = &cik_fence_compute_ring_emit,
2503 .emit_semaphore = &cik_semaphore_ring_emit,
2505 .ring_test = &cik_ring_test,
2506 .ib_test = &cik_ib_test,
2507 .is_lockup = &cik_gfx_is_lockup,
2508 .vm_flush = &cik_vm_flush,
2509 .get_rptr = &cik_compute_ring_get_rptr,
2510 .get_wptr = &cik_compute_ring_get_wptr,
2511 .set_wptr = &cik_compute_ring_set_wptr,
2513 [CAYMAN_RING_TYPE_CP2_INDEX] = {
2514 .ib_execute = &cik_ring_ib_execute,
2515 .ib_parse = &cik_ib_parse,
2516 .emit_fence = &cik_fence_compute_ring_emit,
2517 .emit_semaphore = &cik_semaphore_ring_emit,
2519 .ring_test = &cik_ring_test,
2520 .ib_test = &cik_ib_test,
2521 .is_lockup = &cik_gfx_is_lockup,
2522 .vm_flush = &cik_vm_flush,
2523 .get_rptr = &cik_compute_ring_get_rptr,
2524 .get_wptr = &cik_compute_ring_get_wptr,
2525 .set_wptr = &cik_compute_ring_set_wptr,
2527 [R600_RING_TYPE_DMA_INDEX] = {
2528 .ib_execute = &cik_sdma_ring_ib_execute,
2529 .ib_parse = &cik_ib_parse,
2530 .emit_fence = &cik_sdma_fence_ring_emit,
2531 .emit_semaphore = &cik_sdma_semaphore_ring_emit,
2533 .ring_test = &cik_sdma_ring_test,
2534 .ib_test = &cik_sdma_ib_test,
2535 .is_lockup = &cik_sdma_is_lockup,
2536 .vm_flush = &cik_dma_vm_flush,
2537 .get_rptr = &radeon_ring_generic_get_rptr,
2538 .get_wptr = &radeon_ring_generic_get_wptr,
2539 .set_wptr = &radeon_ring_generic_set_wptr,
2541 [CAYMAN_RING_TYPE_DMA1_INDEX] = {
2542 .ib_execute = &cik_sdma_ring_ib_execute,
2543 .ib_parse = &cik_ib_parse,
2544 .emit_fence = &cik_sdma_fence_ring_emit,
2545 .emit_semaphore = &cik_sdma_semaphore_ring_emit,
2547 .ring_test = &cik_sdma_ring_test,
2548 .ib_test = &cik_sdma_ib_test,
2549 .is_lockup = &cik_sdma_is_lockup,
2550 .vm_flush = &cik_dma_vm_flush,
2551 .get_rptr = &radeon_ring_generic_get_rptr,
2552 .get_wptr = &radeon_ring_generic_get_wptr,
2553 .set_wptr = &radeon_ring_generic_set_wptr,
2555 [R600_RING_TYPE_UVD_INDEX] = {
2556 .ib_execute = &r600_uvd_ib_execute,
2557 .emit_fence = &r600_uvd_fence_emit,
2558 .emit_semaphore = &cayman_uvd_semaphore_emit,
2559 .cs_parse = &radeon_uvd_cs_parse,
2560 .ring_test = &r600_uvd_ring_test,
2561 .ib_test = &r600_uvd_ib_test,
2562 .is_lockup = &radeon_ring_test_lockup,
2563 .get_rptr = &radeon_ring_generic_get_rptr,
2564 .get_wptr = &radeon_ring_generic_get_wptr,
2565 .set_wptr = &radeon_ring_generic_set_wptr,
2569 .set = &cik_irq_set,
2570 .process = &cik_irq_process,
2573 .bandwidth_update = &dce8_bandwidth_update,
2574 .get_vblank_counter = &evergreen_get_vblank_counter,
2575 .wait_for_vblank = &dce4_wait_for_vblank,
2579 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
2580 .dma = &cik_copy_dma,
2581 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
2582 .copy = &cik_copy_dma,
2583 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
2586 .set_reg = r600_set_surface_reg,
2587 .clear_reg = r600_clear_surface_reg,
2590 .init = &evergreen_hpd_init,
2591 .fini = &evergreen_hpd_fini,
2592 .sense = &evergreen_hpd_sense,
2593 .set_polarity = &evergreen_hpd_set_polarity,
2596 .misc = &evergreen_pm_misc,
2597 .prepare = &evergreen_pm_prepare,
2598 .finish = &evergreen_pm_finish,
2599 .init_profile = &sumo_pm_init_profile,
2600 .get_dynpm_state = &r600_pm_get_dynpm_state,
2601 .get_engine_clock = &radeon_atom_get_engine_clock,
2602 .set_engine_clock = &radeon_atom_set_engine_clock,
2603 .get_memory_clock = &radeon_atom_get_memory_clock,
2604 .set_memory_clock = &radeon_atom_set_memory_clock,
2605 .get_pcie_lanes = NULL,
2606 .set_pcie_lanes = NULL,
2607 .set_clock_gating = NULL,
2608 .set_uvd_clocks = &cik_set_uvd_clocks,
2611 .pre_page_flip = &evergreen_pre_page_flip,
2612 .page_flip = &evergreen_page_flip,
2613 .post_page_flip = &evergreen_post_page_flip,
2618 * radeon_asic_init - register asic specific callbacks
2620 * @rdev: radeon device pointer
2622 * Registers the appropriate asic specific callbacks for each
2623 * chip family. Also sets other asics specific info like the number
2624 * of crtcs and the register aperture accessors (all asics).
2625 * Returns 0 for success.
2627 int radeon_asic_init(struct radeon_device *rdev)
2629 radeon_register_accessor_init(rdev);
2631 /* set the number of crtcs */
2632 if (rdev->flags & RADEON_SINGLE_CRTC)
2637 rdev->has_uvd = false;
2639 switch (rdev->family) {
2645 rdev->asic = &r100_asic;
2651 rdev->asic = &r200_asic;
2657 if (rdev->flags & RADEON_IS_PCIE)
2658 rdev->asic = &r300_asic_pcie;
2660 rdev->asic = &r300_asic;
2665 rdev->asic = &r420_asic;
2667 if (rdev->bios == NULL) {
2668 rdev->asic->pm.get_engine_clock = &radeon_legacy_get_engine_clock;
2669 rdev->asic->pm.set_engine_clock = &radeon_legacy_set_engine_clock;
2670 rdev->asic->pm.get_memory_clock = &radeon_legacy_get_memory_clock;
2671 rdev->asic->pm.set_memory_clock = NULL;
2672 rdev->asic->display.set_backlight_level = &radeon_legacy_set_backlight_level;
2677 rdev->asic = &rs400_asic;
2680 rdev->asic = &rs600_asic;
2684 rdev->asic = &rs690_asic;
2687 rdev->asic = &rv515_asic;
2694 rdev->asic = &r520_asic;
2697 rdev->asic = &r600_asic;
2704 rdev->asic = &rv6xx_asic;
2705 rdev->has_uvd = true;
2709 rdev->asic = &rs780_asic;
2710 rdev->has_uvd = true;
2716 rdev->asic = &rv770_asic;
2717 rdev->has_uvd = true;
2725 if (rdev->family == CHIP_CEDAR)
2729 rdev->asic = &evergreen_asic;
2730 rdev->has_uvd = true;
2735 rdev->asic = &sumo_asic;
2736 rdev->has_uvd = true;
2742 if (rdev->family == CHIP_CAICOS)
2746 rdev->asic = &btc_asic;
2747 rdev->has_uvd = true;
2750 rdev->asic = &cayman_asic;
2753 rdev->has_uvd = true;
2756 rdev->asic = &trinity_asic;
2759 rdev->has_uvd = true;
2766 rdev->asic = &si_asic;
2768 if (rdev->family == CHIP_HAINAN)
2770 else if (rdev->family == CHIP_OLAND)
2774 if (rdev->family == CHIP_HAINAN)
2775 rdev->has_uvd = false;
2777 rdev->has_uvd = true;
2780 rdev->asic = &ci_asic;
2785 rdev->asic = &kv_asic;
2787 if (rdev->family == CHIP_KAVERI)
2793 /* FIXME: not supported yet */
2797 if (rdev->flags & RADEON_IS_IGP) {
2798 rdev->asic->pm.get_memory_clock = NULL;
2799 rdev->asic->pm.set_memory_clock = NULL;