blob: 8f7e04538fd624a5ecb1c302e8b9d5f2455f808a [file] [log] [blame]
Daniel Vetter0a10c852010-03-11 21:19:14 +00001/*
2 * Copyright 2008 Advanced Micro Devices, Inc.
3 * Copyright 2008 Red Hat Inc.
4 * Copyright 2009 Jerome Glisse.
5 *
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:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
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.
23 *
24 * Authors: Dave Airlie
25 * Alex Deucher
26 * Jerome Glisse
27 */
28
29#include <linux/console.h>
30#include <drm/drmP.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"
36#include "radeon.h"
37#include "radeon_asic.h"
38#include "atom.h"
39
40/*
41 * Registers accessors functions.
42 */
Alex Deucherabf1dc62012-07-17 14:02:36 -040043/**
44 * radeon_invalid_rreg - dummy reg read function
45 *
46 * @rdev: radeon device pointer
47 * @reg: offset of register
48 *
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.
52 */
Daniel Vetter0a10c852010-03-11 21:19:14 +000053static uint32_t radeon_invalid_rreg(struct radeon_device *rdev, uint32_t reg)
54{
55 DRM_ERROR("Invalid callback to read register 0x%04X\n", reg);
56 BUG_ON(1);
57 return 0;
58}
59
Alex Deucherabf1dc62012-07-17 14:02:36 -040060/**
61 * radeon_invalid_wreg - dummy reg write function
62 *
63 * @rdev: radeon device pointer
64 * @reg: offset of register
65 * @v: value to write to the register
66 *
67 * Dummy register read function. Used for register blocks
68 * that certain asics don't have (all asics).
69 */
Daniel Vetter0a10c852010-03-11 21:19:14 +000070static void radeon_invalid_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
71{
72 DRM_ERROR("Invalid callback to write register 0x%04X with 0x%08X\n",
73 reg, v);
74 BUG_ON(1);
75}
76
Alex Deucherabf1dc62012-07-17 14:02:36 -040077/**
78 * radeon_register_accessor_init - sets up the register accessor callbacks
79 *
80 * @rdev: radeon device pointer
81 *
82 * Sets up the register accessor callbacks for various register
83 * apertures. Not all asics have all apertures (all asics).
84 */
Daniel Vetter0a10c852010-03-11 21:19:14 +000085static void radeon_register_accessor_init(struct radeon_device *rdev)
86{
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;
93
94 /* Don't change order as we are overridding accessor. */
95 if (rdev->family < CHIP_RV515) {
96 rdev->pcie_reg_mask = 0xff;
97 } else {
98 rdev->pcie_reg_mask = 0x7ff;
99 }
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;
104 }
105 if (rdev->family >= CHIP_R420) {
106 rdev->mc_rreg = &r420_mc_rreg;
107 rdev->mc_wreg = &r420_mc_wreg;
108 }
109 if (rdev->family >= CHIP_RV515) {
110 rdev->mc_rreg = &rv515_mc_rreg;
111 rdev->mc_wreg = &rv515_mc_wreg;
112 }
113 if (rdev->family == CHIP_RS400 || rdev->family == CHIP_RS480) {
114 rdev->mc_rreg = &rs400_mc_rreg;
115 rdev->mc_wreg = &rs400_mc_wreg;
116 }
117 if (rdev->family == CHIP_RS690 || rdev->family == CHIP_RS740) {
118 rdev->mc_rreg = &rs690_mc_rreg;
119 rdev->mc_wreg = &rs690_mc_wreg;
120 }
121 if (rdev->family == CHIP_RS600) {
122 rdev->mc_rreg = &rs600_mc_rreg;
123 rdev->mc_wreg = &rs600_mc_wreg;
124 }
Samuel Li65337e62013-04-05 17:50:53 -0400125 if (rdev->family == CHIP_RS780 || rdev->family == CHIP_RS880) {
126 rdev->mc_rreg = &rs780_mc_rreg;
127 rdev->mc_wreg = &rs780_mc_wreg;
128 }
Alex Deucher6e2c3c02013-04-03 19:28:32 -0400129
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) {
Daniel Vetter0a10c852010-03-11 21:19:14 +0000134 rdev->pciep_rreg = &r600_pciep_rreg;
135 rdev->pciep_wreg = &r600_pciep_wreg;
136 }
137}
138
139
140/* helper to disable agp */
Alex Deucherabf1dc62012-07-17 14:02:36 -0400141/**
142 * radeon_agp_disable - AGP disable helper function
143 *
144 * @rdev: radeon device pointer
145 *
146 * Removes AGP flags and changes the gart callbacks on AGP
147 * cards when using the internal gart rather than AGP (all asics).
148 */
Daniel Vetter0a10c852010-03-11 21:19:14 +0000149void radeon_agp_disable(struct radeon_device *rdev)
150{
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;
Alex Deucherc5b3b852012-02-23 17:53:46 -0500161 rdev->asic->gart.tlb_flush = &rv370_pcie_gart_tlb_flush;
162 rdev->asic->gart.set_page = &rv370_pcie_gart_set_page;
Daniel Vetter0a10c852010-03-11 21:19:14 +0000163 } else {
164 DRM_INFO("Forcing AGP to PCI mode\n");
165 rdev->flags |= RADEON_IS_PCI;
Alex Deucherc5b3b852012-02-23 17:53:46 -0500166 rdev->asic->gart.tlb_flush = &r100_pci_gart_tlb_flush;
167 rdev->asic->gart.set_page = &r100_pci_gart_set_page;
Daniel Vetter0a10c852010-03-11 21:19:14 +0000168 }
169 rdev->mc.gtt_size = radeon_gart_size * 1024 * 1024;
170}
171
172/*
173 * ASIC
174 */
Christian König76a0df82013-08-13 11:56:50 +0200175
176static struct radeon_asic_ring r100_gfx_ring = {
177 .ib_execute = &r100_ring_ib_execute,
178 .emit_fence = &r100_fence_ring_emit,
179 .emit_semaphore = &r100_semaphore_ring_emit,
180 .cs_parse = &r100_cs_parse,
181 .ring_start = &r100_ring_start,
182 .ring_test = &r100_ring_test,
183 .ib_test = &r100_ib_test,
184 .is_lockup = &r100_gpu_is_lockup,
185 .get_rptr = &radeon_ring_generic_get_rptr,
186 .get_wptr = &radeon_ring_generic_get_wptr,
187 .set_wptr = &radeon_ring_generic_set_wptr,
188};
189
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000190static struct radeon_asic r100_asic = {
191 .init = &r100_init,
192 .fini = &r100_fini,
193 .suspend = &r100_suspend,
194 .resume = &r100_resume,
195 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000196 .asic_reset = &r100_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500197 .ioctl_wait_idle = NULL,
198 .gui_idle = &r100_gui_idle,
199 .mc_wait_for_idle = &r100_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500200 .gart = {
201 .tlb_flush = &r100_pci_gart_tlb_flush,
202 .set_page = &r100_pci_gart_set_page,
203 },
Christian König4c87bc22011-10-19 19:02:21 +0200204 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200205 [RADEON_RING_TYPE_GFX_INDEX] = &r100_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200206 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500207 .irq = {
208 .set = &r100_irq_set,
209 .process = &r100_irq_process,
210 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500211 .display = {
212 .bandwidth_update = &r100_bandwidth_update,
213 .get_vblank_counter = &r100_get_vblank_counter,
214 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400215 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400216 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500217 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500218 .copy = {
219 .blit = &r100_copy_blit,
220 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
221 .dma = NULL,
222 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
223 .copy = &r100_copy_blit,
224 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
225 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500226 .surface = {
227 .set_reg = r100_set_surface_reg,
228 .clear_reg = r100_clear_surface_reg,
229 },
Alex Deucher901ea572012-02-23 17:53:39 -0500230 .hpd = {
231 .init = &r100_hpd_init,
232 .fini = &r100_hpd_fini,
233 .sense = &r100_hpd_sense,
234 .set_polarity = &r100_hpd_set_polarity,
235 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500236 .pm = {
237 .misc = &r100_pm_misc,
238 .prepare = &r100_pm_prepare,
239 .finish = &r100_pm_finish,
240 .init_profile = &r100_pm_init_profile,
241 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500242 .get_engine_clock = &radeon_legacy_get_engine_clock,
243 .set_engine_clock = &radeon_legacy_set_engine_clock,
244 .get_memory_clock = &radeon_legacy_get_memory_clock,
245 .set_memory_clock = NULL,
246 .get_pcie_lanes = NULL,
247 .set_pcie_lanes = NULL,
248 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500249 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500250 .pflip = {
251 .pre_page_flip = &r100_pre_page_flip,
252 .page_flip = &r100_page_flip,
253 .post_page_flip = &r100_post_page_flip,
254 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000255};
256
257static struct radeon_asic r200_asic = {
258 .init = &r100_init,
259 .fini = &r100_fini,
260 .suspend = &r100_suspend,
261 .resume = &r100_resume,
262 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000263 .asic_reset = &r100_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500264 .ioctl_wait_idle = NULL,
265 .gui_idle = &r100_gui_idle,
266 .mc_wait_for_idle = &r100_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500267 .gart = {
268 .tlb_flush = &r100_pci_gart_tlb_flush,
269 .set_page = &r100_pci_gart_set_page,
270 },
Christian König4c87bc22011-10-19 19:02:21 +0200271 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200272 [RADEON_RING_TYPE_GFX_INDEX] = &r100_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200273 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500274 .irq = {
275 .set = &r100_irq_set,
276 .process = &r100_irq_process,
277 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500278 .display = {
279 .bandwidth_update = &r100_bandwidth_update,
280 .get_vblank_counter = &r100_get_vblank_counter,
281 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400282 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400283 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500284 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500285 .copy = {
286 .blit = &r100_copy_blit,
287 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
288 .dma = &r200_copy_dma,
289 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
290 .copy = &r100_copy_blit,
291 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
292 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500293 .surface = {
294 .set_reg = r100_set_surface_reg,
295 .clear_reg = r100_clear_surface_reg,
296 },
Alex Deucher901ea572012-02-23 17:53:39 -0500297 .hpd = {
298 .init = &r100_hpd_init,
299 .fini = &r100_hpd_fini,
300 .sense = &r100_hpd_sense,
301 .set_polarity = &r100_hpd_set_polarity,
302 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500303 .pm = {
304 .misc = &r100_pm_misc,
305 .prepare = &r100_pm_prepare,
306 .finish = &r100_pm_finish,
307 .init_profile = &r100_pm_init_profile,
308 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500309 .get_engine_clock = &radeon_legacy_get_engine_clock,
310 .set_engine_clock = &radeon_legacy_set_engine_clock,
311 .get_memory_clock = &radeon_legacy_get_memory_clock,
312 .set_memory_clock = NULL,
313 .get_pcie_lanes = NULL,
314 .set_pcie_lanes = NULL,
315 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500316 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500317 .pflip = {
318 .pre_page_flip = &r100_pre_page_flip,
319 .page_flip = &r100_page_flip,
320 .post_page_flip = &r100_post_page_flip,
321 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000322};
323
Christian König76a0df82013-08-13 11:56:50 +0200324static struct radeon_asic_ring r300_gfx_ring = {
325 .ib_execute = &r100_ring_ib_execute,
326 .emit_fence = &r300_fence_ring_emit,
327 .emit_semaphore = &r100_semaphore_ring_emit,
328 .cs_parse = &r300_cs_parse,
329 .ring_start = &r300_ring_start,
330 .ring_test = &r100_ring_test,
331 .ib_test = &r100_ib_test,
332 .is_lockup = &r100_gpu_is_lockup,
333 .get_rptr = &radeon_ring_generic_get_rptr,
334 .get_wptr = &radeon_ring_generic_get_wptr,
335 .set_wptr = &radeon_ring_generic_set_wptr,
336};
337
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000338static struct radeon_asic r300_asic = {
339 .init = &r300_init,
340 .fini = &r300_fini,
341 .suspend = &r300_suspend,
342 .resume = &r300_resume,
343 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000344 .asic_reset = &r300_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500345 .ioctl_wait_idle = NULL,
346 .gui_idle = &r100_gui_idle,
347 .mc_wait_for_idle = &r300_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500348 .gart = {
349 .tlb_flush = &r100_pci_gart_tlb_flush,
350 .set_page = &r100_pci_gart_set_page,
351 },
Christian König4c87bc22011-10-19 19:02:21 +0200352 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200353 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200354 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500355 .irq = {
356 .set = &r100_irq_set,
357 .process = &r100_irq_process,
358 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500359 .display = {
360 .bandwidth_update = &r100_bandwidth_update,
361 .get_vblank_counter = &r100_get_vblank_counter,
362 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400363 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400364 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500365 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500366 .copy = {
367 .blit = &r100_copy_blit,
368 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
369 .dma = &r200_copy_dma,
370 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
371 .copy = &r100_copy_blit,
372 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
373 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500374 .surface = {
375 .set_reg = r100_set_surface_reg,
376 .clear_reg = r100_clear_surface_reg,
377 },
Alex Deucher901ea572012-02-23 17:53:39 -0500378 .hpd = {
379 .init = &r100_hpd_init,
380 .fini = &r100_hpd_fini,
381 .sense = &r100_hpd_sense,
382 .set_polarity = &r100_hpd_set_polarity,
383 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500384 .pm = {
385 .misc = &r100_pm_misc,
386 .prepare = &r100_pm_prepare,
387 .finish = &r100_pm_finish,
388 .init_profile = &r100_pm_init_profile,
389 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500390 .get_engine_clock = &radeon_legacy_get_engine_clock,
391 .set_engine_clock = &radeon_legacy_set_engine_clock,
392 .get_memory_clock = &radeon_legacy_get_memory_clock,
393 .set_memory_clock = NULL,
394 .get_pcie_lanes = &rv370_get_pcie_lanes,
395 .set_pcie_lanes = &rv370_set_pcie_lanes,
396 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500397 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500398 .pflip = {
399 .pre_page_flip = &r100_pre_page_flip,
400 .page_flip = &r100_page_flip,
401 .post_page_flip = &r100_post_page_flip,
402 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000403};
404
405static struct radeon_asic r300_asic_pcie = {
406 .init = &r300_init,
407 .fini = &r300_fini,
408 .suspend = &r300_suspend,
409 .resume = &r300_resume,
410 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000411 .asic_reset = &r300_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500412 .ioctl_wait_idle = NULL,
413 .gui_idle = &r100_gui_idle,
414 .mc_wait_for_idle = &r300_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500415 .gart = {
416 .tlb_flush = &rv370_pcie_gart_tlb_flush,
417 .set_page = &rv370_pcie_gart_set_page,
418 },
Christian König4c87bc22011-10-19 19:02:21 +0200419 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200420 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200421 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500422 .irq = {
423 .set = &r100_irq_set,
424 .process = &r100_irq_process,
425 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500426 .display = {
427 .bandwidth_update = &r100_bandwidth_update,
428 .get_vblank_counter = &r100_get_vblank_counter,
429 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400430 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400431 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500432 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500433 .copy = {
434 .blit = &r100_copy_blit,
435 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
436 .dma = &r200_copy_dma,
437 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
438 .copy = &r100_copy_blit,
439 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
440 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500441 .surface = {
442 .set_reg = r100_set_surface_reg,
443 .clear_reg = r100_clear_surface_reg,
444 },
Alex Deucher901ea572012-02-23 17:53:39 -0500445 .hpd = {
446 .init = &r100_hpd_init,
447 .fini = &r100_hpd_fini,
448 .sense = &r100_hpd_sense,
449 .set_polarity = &r100_hpd_set_polarity,
450 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500451 .pm = {
452 .misc = &r100_pm_misc,
453 .prepare = &r100_pm_prepare,
454 .finish = &r100_pm_finish,
455 .init_profile = &r100_pm_init_profile,
456 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500457 .get_engine_clock = &radeon_legacy_get_engine_clock,
458 .set_engine_clock = &radeon_legacy_set_engine_clock,
459 .get_memory_clock = &radeon_legacy_get_memory_clock,
460 .set_memory_clock = NULL,
461 .get_pcie_lanes = &rv370_get_pcie_lanes,
462 .set_pcie_lanes = &rv370_set_pcie_lanes,
463 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500464 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500465 .pflip = {
466 .pre_page_flip = &r100_pre_page_flip,
467 .page_flip = &r100_page_flip,
468 .post_page_flip = &r100_post_page_flip,
469 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000470};
471
472static struct radeon_asic r420_asic = {
473 .init = &r420_init,
474 .fini = &r420_fini,
475 .suspend = &r420_suspend,
476 .resume = &r420_resume,
477 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000478 .asic_reset = &r300_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500479 .ioctl_wait_idle = NULL,
480 .gui_idle = &r100_gui_idle,
481 .mc_wait_for_idle = &r300_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500482 .gart = {
483 .tlb_flush = &rv370_pcie_gart_tlb_flush,
484 .set_page = &rv370_pcie_gart_set_page,
485 },
Christian König4c87bc22011-10-19 19:02:21 +0200486 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200487 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200488 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500489 .irq = {
490 .set = &r100_irq_set,
491 .process = &r100_irq_process,
492 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500493 .display = {
494 .bandwidth_update = &r100_bandwidth_update,
495 .get_vblank_counter = &r100_get_vblank_counter,
496 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400497 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400498 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500499 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500500 .copy = {
501 .blit = &r100_copy_blit,
502 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
503 .dma = &r200_copy_dma,
504 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
505 .copy = &r100_copy_blit,
506 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
507 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500508 .surface = {
509 .set_reg = r100_set_surface_reg,
510 .clear_reg = r100_clear_surface_reg,
511 },
Alex Deucher901ea572012-02-23 17:53:39 -0500512 .hpd = {
513 .init = &r100_hpd_init,
514 .fini = &r100_hpd_fini,
515 .sense = &r100_hpd_sense,
516 .set_polarity = &r100_hpd_set_polarity,
517 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500518 .pm = {
519 .misc = &r100_pm_misc,
520 .prepare = &r100_pm_prepare,
521 .finish = &r100_pm_finish,
522 .init_profile = &r420_pm_init_profile,
523 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500524 .get_engine_clock = &radeon_atom_get_engine_clock,
525 .set_engine_clock = &radeon_atom_set_engine_clock,
526 .get_memory_clock = &radeon_atom_get_memory_clock,
527 .set_memory_clock = &radeon_atom_set_memory_clock,
528 .get_pcie_lanes = &rv370_get_pcie_lanes,
529 .set_pcie_lanes = &rv370_set_pcie_lanes,
530 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500531 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500532 .pflip = {
533 .pre_page_flip = &r100_pre_page_flip,
534 .page_flip = &r100_page_flip,
535 .post_page_flip = &r100_post_page_flip,
536 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000537};
538
539static struct radeon_asic rs400_asic = {
540 .init = &rs400_init,
541 .fini = &rs400_fini,
542 .suspend = &rs400_suspend,
543 .resume = &rs400_resume,
544 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000545 .asic_reset = &r300_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500546 .ioctl_wait_idle = NULL,
547 .gui_idle = &r100_gui_idle,
548 .mc_wait_for_idle = &rs400_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500549 .gart = {
550 .tlb_flush = &rs400_gart_tlb_flush,
551 .set_page = &rs400_gart_set_page,
552 },
Christian König4c87bc22011-10-19 19:02:21 +0200553 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200554 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200555 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500556 .irq = {
557 .set = &r100_irq_set,
558 .process = &r100_irq_process,
559 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500560 .display = {
561 .bandwidth_update = &r100_bandwidth_update,
562 .get_vblank_counter = &r100_get_vblank_counter,
563 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400564 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400565 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500566 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500567 .copy = {
568 .blit = &r100_copy_blit,
569 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
570 .dma = &r200_copy_dma,
571 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
572 .copy = &r100_copy_blit,
573 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
574 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500575 .surface = {
576 .set_reg = r100_set_surface_reg,
577 .clear_reg = r100_clear_surface_reg,
578 },
Alex Deucher901ea572012-02-23 17:53:39 -0500579 .hpd = {
580 .init = &r100_hpd_init,
581 .fini = &r100_hpd_fini,
582 .sense = &r100_hpd_sense,
583 .set_polarity = &r100_hpd_set_polarity,
584 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500585 .pm = {
586 .misc = &r100_pm_misc,
587 .prepare = &r100_pm_prepare,
588 .finish = &r100_pm_finish,
589 .init_profile = &r100_pm_init_profile,
590 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500591 .get_engine_clock = &radeon_legacy_get_engine_clock,
592 .set_engine_clock = &radeon_legacy_set_engine_clock,
593 .get_memory_clock = &radeon_legacy_get_memory_clock,
594 .set_memory_clock = NULL,
595 .get_pcie_lanes = NULL,
596 .set_pcie_lanes = NULL,
597 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500598 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500599 .pflip = {
600 .pre_page_flip = &r100_pre_page_flip,
601 .page_flip = &r100_page_flip,
602 .post_page_flip = &r100_post_page_flip,
603 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000604};
605
606static struct radeon_asic rs600_asic = {
607 .init = &rs600_init,
608 .fini = &rs600_fini,
609 .suspend = &rs600_suspend,
610 .resume = &rs600_resume,
611 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000612 .asic_reset = &rs600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500613 .ioctl_wait_idle = NULL,
614 .gui_idle = &r100_gui_idle,
615 .mc_wait_for_idle = &rs600_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500616 .gart = {
617 .tlb_flush = &rs600_gart_tlb_flush,
618 .set_page = &rs600_gart_set_page,
619 },
Christian König4c87bc22011-10-19 19:02:21 +0200620 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200621 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200622 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500623 .irq = {
624 .set = &rs600_irq_set,
625 .process = &rs600_irq_process,
626 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500627 .display = {
628 .bandwidth_update = &rs600_bandwidth_update,
629 .get_vblank_counter = &rs600_get_vblank_counter,
630 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400631 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400632 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -0400633 .hdmi_enable = &r600_hdmi_enable,
634 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500635 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500636 .copy = {
637 .blit = &r100_copy_blit,
638 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
639 .dma = &r200_copy_dma,
640 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
641 .copy = &r100_copy_blit,
642 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
643 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500644 .surface = {
645 .set_reg = r100_set_surface_reg,
646 .clear_reg = r100_clear_surface_reg,
647 },
Alex Deucher901ea572012-02-23 17:53:39 -0500648 .hpd = {
649 .init = &rs600_hpd_init,
650 .fini = &rs600_hpd_fini,
651 .sense = &rs600_hpd_sense,
652 .set_polarity = &rs600_hpd_set_polarity,
653 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500654 .pm = {
655 .misc = &rs600_pm_misc,
656 .prepare = &rs600_pm_prepare,
657 .finish = &rs600_pm_finish,
658 .init_profile = &r420_pm_init_profile,
659 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500660 .get_engine_clock = &radeon_atom_get_engine_clock,
661 .set_engine_clock = &radeon_atom_set_engine_clock,
662 .get_memory_clock = &radeon_atom_get_memory_clock,
663 .set_memory_clock = &radeon_atom_set_memory_clock,
664 .get_pcie_lanes = NULL,
665 .set_pcie_lanes = NULL,
666 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500667 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500668 .pflip = {
669 .pre_page_flip = &rs600_pre_page_flip,
670 .page_flip = &rs600_page_flip,
671 .post_page_flip = &rs600_post_page_flip,
672 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000673};
674
675static struct radeon_asic rs690_asic = {
676 .init = &rs690_init,
677 .fini = &rs690_fini,
678 .suspend = &rs690_suspend,
679 .resume = &rs690_resume,
680 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000681 .asic_reset = &rs600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500682 .ioctl_wait_idle = NULL,
683 .gui_idle = &r100_gui_idle,
684 .mc_wait_for_idle = &rs690_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500685 .gart = {
686 .tlb_flush = &rs400_gart_tlb_flush,
687 .set_page = &rs400_gart_set_page,
688 },
Christian König4c87bc22011-10-19 19:02:21 +0200689 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200690 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200691 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500692 .irq = {
693 .set = &rs600_irq_set,
694 .process = &rs600_irq_process,
695 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500696 .display = {
697 .get_vblank_counter = &rs600_get_vblank_counter,
698 .bandwidth_update = &rs690_bandwidth_update,
699 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400700 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400701 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -0400702 .hdmi_enable = &r600_hdmi_enable,
703 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500704 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500705 .copy = {
706 .blit = &r100_copy_blit,
707 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
708 .dma = &r200_copy_dma,
709 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
710 .copy = &r200_copy_dma,
711 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
712 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500713 .surface = {
714 .set_reg = r100_set_surface_reg,
715 .clear_reg = r100_clear_surface_reg,
716 },
Alex Deucher901ea572012-02-23 17:53:39 -0500717 .hpd = {
718 .init = &rs600_hpd_init,
719 .fini = &rs600_hpd_fini,
720 .sense = &rs600_hpd_sense,
721 .set_polarity = &rs600_hpd_set_polarity,
722 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500723 .pm = {
724 .misc = &rs600_pm_misc,
725 .prepare = &rs600_pm_prepare,
726 .finish = &rs600_pm_finish,
727 .init_profile = &r420_pm_init_profile,
728 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500729 .get_engine_clock = &radeon_atom_get_engine_clock,
730 .set_engine_clock = &radeon_atom_set_engine_clock,
731 .get_memory_clock = &radeon_atom_get_memory_clock,
732 .set_memory_clock = &radeon_atom_set_memory_clock,
733 .get_pcie_lanes = NULL,
734 .set_pcie_lanes = NULL,
735 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500736 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500737 .pflip = {
738 .pre_page_flip = &rs600_pre_page_flip,
739 .page_flip = &rs600_page_flip,
740 .post_page_flip = &rs600_post_page_flip,
741 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000742};
743
744static struct radeon_asic rv515_asic = {
745 .init = &rv515_init,
746 .fini = &rv515_fini,
747 .suspend = &rv515_suspend,
748 .resume = &rv515_resume,
749 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000750 .asic_reset = &rs600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500751 .ioctl_wait_idle = NULL,
752 .gui_idle = &r100_gui_idle,
753 .mc_wait_for_idle = &rv515_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500754 .gart = {
755 .tlb_flush = &rv370_pcie_gart_tlb_flush,
756 .set_page = &rv370_pcie_gart_set_page,
757 },
Christian König4c87bc22011-10-19 19:02:21 +0200758 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200759 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200760 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500761 .irq = {
762 .set = &rs600_irq_set,
763 .process = &rs600_irq_process,
764 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500765 .display = {
766 .get_vblank_counter = &rs600_get_vblank_counter,
767 .bandwidth_update = &rv515_bandwidth_update,
768 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400769 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400770 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500771 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500772 .copy = {
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 = &r100_copy_blit,
778 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
779 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500780 .surface = {
781 .set_reg = r100_set_surface_reg,
782 .clear_reg = r100_clear_surface_reg,
783 },
Alex Deucher901ea572012-02-23 17:53:39 -0500784 .hpd = {
785 .init = &rs600_hpd_init,
786 .fini = &rs600_hpd_fini,
787 .sense = &rs600_hpd_sense,
788 .set_polarity = &rs600_hpd_set_polarity,
789 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500790 .pm = {
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,
Alex Deucher798bcf72012-02-23 17:53:48 -0500796 .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 = &rv370_get_pcie_lanes,
801 .set_pcie_lanes = &rv370_set_pcie_lanes,
802 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500803 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500804 .pflip = {
805 .pre_page_flip = &rs600_pre_page_flip,
806 .page_flip = &rs600_page_flip,
807 .post_page_flip = &rs600_post_page_flip,
808 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000809};
810
811static struct radeon_asic r520_asic = {
812 .init = &r520_init,
813 .fini = &rv515_fini,
814 .suspend = &rv515_suspend,
815 .resume = &r520_resume,
816 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000817 .asic_reset = &rs600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500818 .ioctl_wait_idle = NULL,
819 .gui_idle = &r100_gui_idle,
820 .mc_wait_for_idle = &r520_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500821 .gart = {
822 .tlb_flush = &rv370_pcie_gart_tlb_flush,
823 .set_page = &rv370_pcie_gart_set_page,
824 },
Christian König4c87bc22011-10-19 19:02:21 +0200825 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200826 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200827 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500828 .irq = {
829 .set = &rs600_irq_set,
830 .process = &rs600_irq_process,
831 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500832 .display = {
833 .bandwidth_update = &rv515_bandwidth_update,
834 .get_vblank_counter = &rs600_get_vblank_counter,
835 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400836 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400837 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500838 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500839 .copy = {
840 .blit = &r100_copy_blit,
841 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
842 .dma = &r200_copy_dma,
843 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
844 .copy = &r100_copy_blit,
845 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
846 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500847 .surface = {
848 .set_reg = r100_set_surface_reg,
849 .clear_reg = r100_clear_surface_reg,
850 },
Alex Deucher901ea572012-02-23 17:53:39 -0500851 .hpd = {
852 .init = &rs600_hpd_init,
853 .fini = &rs600_hpd_fini,
854 .sense = &rs600_hpd_sense,
855 .set_polarity = &rs600_hpd_set_polarity,
856 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500857 .pm = {
858 .misc = &rs600_pm_misc,
859 .prepare = &rs600_pm_prepare,
860 .finish = &rs600_pm_finish,
861 .init_profile = &r420_pm_init_profile,
862 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500863 .get_engine_clock = &radeon_atom_get_engine_clock,
864 .set_engine_clock = &radeon_atom_set_engine_clock,
865 .get_memory_clock = &radeon_atom_get_memory_clock,
866 .set_memory_clock = &radeon_atom_set_memory_clock,
867 .get_pcie_lanes = &rv370_get_pcie_lanes,
868 .set_pcie_lanes = &rv370_set_pcie_lanes,
869 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500870 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500871 .pflip = {
872 .pre_page_flip = &rs600_pre_page_flip,
873 .page_flip = &rs600_page_flip,
874 .post_page_flip = &rs600_post_page_flip,
875 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000876};
877
Christian König76a0df82013-08-13 11:56:50 +0200878static struct radeon_asic_ring r600_gfx_ring = {
879 .ib_execute = &r600_ring_ib_execute,
880 .emit_fence = &r600_fence_ring_emit,
881 .emit_semaphore = &r600_semaphore_ring_emit,
882 .cs_parse = &r600_cs_parse,
883 .ring_test = &r600_ring_test,
884 .ib_test = &r600_ib_test,
885 .is_lockup = &r600_gfx_is_lockup,
886 .get_rptr = &radeon_ring_generic_get_rptr,
887 .get_wptr = &radeon_ring_generic_get_wptr,
888 .set_wptr = &radeon_ring_generic_set_wptr,
889};
890
891static struct radeon_asic_ring r600_dma_ring = {
892 .ib_execute = &r600_dma_ring_ib_execute,
893 .emit_fence = &r600_dma_fence_ring_emit,
894 .emit_semaphore = &r600_dma_semaphore_ring_emit,
895 .cs_parse = &r600_dma_cs_parse,
896 .ring_test = &r600_dma_ring_test,
897 .ib_test = &r600_dma_ib_test,
898 .is_lockup = &r600_dma_is_lockup,
Christian König2e1e6da2013-08-13 11:56:52 +0200899 .get_rptr = &r600_dma_get_rptr,
900 .get_wptr = &r600_dma_get_wptr,
901 .set_wptr = &r600_dma_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +0200902};
903
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000904static struct radeon_asic r600_asic = {
905 .init = &r600_init,
906 .fini = &r600_fini,
907 .suspend = &r600_suspend,
908 .resume = &r600_resume,
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000909 .vga_set_state = &r600_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000910 .asic_reset = &r600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500911 .ioctl_wait_idle = r600_ioctl_wait_idle,
912 .gui_idle = &r600_gui_idle,
913 .mc_wait_for_idle = &r600_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -0500914 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -0500915 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500916 .gart = {
917 .tlb_flush = &r600_pcie_gart_tlb_flush,
918 .set_page = &rs600_gart_set_page,
919 },
Christian König4c87bc22011-10-19 19:02:21 +0200920 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200921 [RADEON_RING_TYPE_GFX_INDEX] = &r600_gfx_ring,
922 [R600_RING_TYPE_DMA_INDEX] = &r600_dma_ring,
Christian König4c87bc22011-10-19 19:02:21 +0200923 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500924 .irq = {
925 .set = &r600_irq_set,
926 .process = &r600_irq_process,
927 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500928 .display = {
929 .bandwidth_update = &rv515_bandwidth_update,
930 .get_vblank_counter = &rs600_get_vblank_counter,
931 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400932 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400933 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -0400934 .hdmi_enable = &r600_hdmi_enable,
935 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500936 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500937 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -0400938 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -0500939 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher4d756582012-09-27 15:08:35 -0400940 .dma = &r600_copy_dma,
941 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucherbfea6a62013-07-11 14:53:34 -0400942 .copy = &r600_copy_cpdma,
Alex Deucheraeea40c2013-07-11 14:20:11 -0400943 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -0500944 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500945 .surface = {
946 .set_reg = r600_set_surface_reg,
947 .clear_reg = r600_clear_surface_reg,
948 },
Alex Deucher901ea572012-02-23 17:53:39 -0500949 .hpd = {
950 .init = &r600_hpd_init,
951 .fini = &r600_hpd_fini,
952 .sense = &r600_hpd_sense,
953 .set_polarity = &r600_hpd_set_polarity,
954 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500955 .pm = {
956 .misc = &r600_pm_misc,
957 .prepare = &rs600_pm_prepare,
958 .finish = &rs600_pm_finish,
959 .init_profile = &r600_pm_init_profile,
960 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500961 .get_engine_clock = &radeon_atom_get_engine_clock,
962 .set_engine_clock = &radeon_atom_set_engine_clock,
963 .get_memory_clock = &radeon_atom_get_memory_clock,
964 .set_memory_clock = &radeon_atom_set_memory_clock,
965 .get_pcie_lanes = &r600_get_pcie_lanes,
966 .set_pcie_lanes = &r600_set_pcie_lanes,
967 .set_clock_gating = NULL,
Alex Deucher6bd1c382013-06-21 14:38:03 -0400968 .get_temperature = &rv6xx_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -0500969 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500970 .pflip = {
971 .pre_page_flip = &rs600_pre_page_flip,
972 .page_flip = &rs600_page_flip,
973 .post_page_flip = &rs600_post_page_flip,
974 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000975};
976
Alex Deucherca361b62013-06-21 14:42:08 -0400977static struct radeon_asic rv6xx_asic = {
978 .init = &r600_init,
979 .fini = &r600_fini,
980 .suspend = &r600_suspend,
981 .resume = &r600_resume,
982 .vga_set_state = &r600_vga_set_state,
983 .asic_reset = &r600_asic_reset,
984 .ioctl_wait_idle = r600_ioctl_wait_idle,
985 .gui_idle = &r600_gui_idle,
986 .mc_wait_for_idle = &r600_mc_wait_for_idle,
987 .get_xclk = &r600_get_xclk,
988 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
989 .gart = {
990 .tlb_flush = &r600_pcie_gart_tlb_flush,
991 .set_page = &rs600_gart_set_page,
992 },
993 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200994 [RADEON_RING_TYPE_GFX_INDEX] = &r600_gfx_ring,
995 [R600_RING_TYPE_DMA_INDEX] = &r600_dma_ring,
Alex Deucherca361b62013-06-21 14:42:08 -0400996 },
997 .irq = {
998 .set = &r600_irq_set,
999 .process = &r600_irq_process,
1000 },
1001 .display = {
1002 .bandwidth_update = &rv515_bandwidth_update,
1003 .get_vblank_counter = &rs600_get_vblank_counter,
1004 .wait_for_vblank = &avivo_wait_for_vblank,
1005 .set_backlight_level = &atombios_set_backlight_level,
1006 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucher99d79aa2013-09-23 15:47:08 -04001007 .hdmi_enable = &r600_hdmi_enable,
1008 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherca361b62013-06-21 14:42:08 -04001009 },
1010 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001011 .blit = &r600_copy_cpdma,
Alex Deucherca361b62013-06-21 14:42:08 -04001012 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
1013 .dma = &r600_copy_dma,
1014 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucherbfea6a62013-07-11 14:53:34 -04001015 .copy = &r600_copy_cpdma,
Alex Deucheraeea40c2013-07-11 14:20:11 -04001016 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucherca361b62013-06-21 14:42:08 -04001017 },
1018 .surface = {
1019 .set_reg = r600_set_surface_reg,
1020 .clear_reg = r600_clear_surface_reg,
1021 },
1022 .hpd = {
1023 .init = &r600_hpd_init,
1024 .fini = &r600_hpd_fini,
1025 .sense = &r600_hpd_sense,
1026 .set_polarity = &r600_hpd_set_polarity,
1027 },
1028 .pm = {
1029 .misc = &r600_pm_misc,
1030 .prepare = &rs600_pm_prepare,
1031 .finish = &rs600_pm_finish,
1032 .init_profile = &r600_pm_init_profile,
1033 .get_dynpm_state = &r600_pm_get_dynpm_state,
1034 .get_engine_clock = &radeon_atom_get_engine_clock,
1035 .set_engine_clock = &radeon_atom_set_engine_clock,
1036 .get_memory_clock = &radeon_atom_get_memory_clock,
1037 .set_memory_clock = &radeon_atom_set_memory_clock,
1038 .get_pcie_lanes = &r600_get_pcie_lanes,
1039 .set_pcie_lanes = &r600_set_pcie_lanes,
1040 .set_clock_gating = NULL,
1041 .get_temperature = &rv6xx_get_temp,
Alex Deucher1b9ba702013-09-05 09:52:37 -04001042 .set_uvd_clocks = &r600_set_uvd_clocks,
Alex Deucherca361b62013-06-21 14:42:08 -04001043 },
Alex Deucher4a6369e2013-04-12 14:04:10 -04001044 .dpm = {
1045 .init = &rv6xx_dpm_init,
1046 .setup_asic = &rv6xx_setup_asic,
1047 .enable = &rv6xx_dpm_enable,
1048 .disable = &rv6xx_dpm_disable,
Alex Deucher98243912013-01-16 13:13:42 -05001049 .pre_set_power_state = &r600_dpm_pre_set_power_state,
Alex Deucher4a6369e2013-04-12 14:04:10 -04001050 .set_power_state = &rv6xx_dpm_set_power_state,
Alex Deucher98243912013-01-16 13:13:42 -05001051 .post_set_power_state = &r600_dpm_post_set_power_state,
Alex Deucher4a6369e2013-04-12 14:04:10 -04001052 .display_configuration_changed = &rv6xx_dpm_display_configuration_changed,
1053 .fini = &rv6xx_dpm_fini,
1054 .get_sclk = &rv6xx_dpm_get_sclk,
1055 .get_mclk = &rv6xx_dpm_get_mclk,
1056 .print_power_state = &rv6xx_dpm_print_power_state,
Alex Deucher242916a2013-06-28 14:20:53 -04001057 .debugfs_print_current_performance_level = &rv6xx_dpm_debugfs_print_current_performance_level,
Alex Deucherf4f85a82013-07-25 20:07:25 -04001058 .force_performance_level = &rv6xx_dpm_force_performance_level,
Alex Deucher4a6369e2013-04-12 14:04:10 -04001059 },
Alex Deucherca361b62013-06-21 14:42:08 -04001060 .pflip = {
1061 .pre_page_flip = &rs600_pre_page_flip,
1062 .page_flip = &rs600_page_flip,
1063 .post_page_flip = &rs600_post_page_flip,
1064 },
1065};
1066
Alex Deucherf47299c2010-03-16 20:54:38 -04001067static struct radeon_asic rs780_asic = {
1068 .init = &r600_init,
1069 .fini = &r600_fini,
1070 .suspend = &r600_suspend,
1071 .resume = &r600_resume,
Alex Deucherf47299c2010-03-16 20:54:38 -04001072 .vga_set_state = &r600_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +00001073 .asic_reset = &r600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -05001074 .ioctl_wait_idle = r600_ioctl_wait_idle,
1075 .gui_idle = &r600_gui_idle,
1076 .mc_wait_for_idle = &r600_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001077 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001078 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001079 .gart = {
1080 .tlb_flush = &r600_pcie_gart_tlb_flush,
1081 .set_page = &rs600_gart_set_page,
1082 },
Christian König4c87bc22011-10-19 19:02:21 +02001083 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001084 [RADEON_RING_TYPE_GFX_INDEX] = &r600_gfx_ring,
1085 [R600_RING_TYPE_DMA_INDEX] = &r600_dma_ring,
Christian König4c87bc22011-10-19 19:02:21 +02001086 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001087 .irq = {
1088 .set = &r600_irq_set,
1089 .process = &r600_irq_process,
1090 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001091 .display = {
1092 .bandwidth_update = &rs690_bandwidth_update,
1093 .get_vblank_counter = &rs600_get_vblank_counter,
1094 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001095 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001096 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001097 .hdmi_enable = &r600_hdmi_enable,
1098 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001099 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001100 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001101 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -05001102 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher4d756582012-09-27 15:08:35 -04001103 .dma = &r600_copy_dma,
1104 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucherbfea6a62013-07-11 14:53:34 -04001105 .copy = &r600_copy_cpdma,
Alex Deucheraeea40c2013-07-11 14:20:11 -04001106 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001107 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001108 .surface = {
1109 .set_reg = r600_set_surface_reg,
1110 .clear_reg = r600_clear_surface_reg,
1111 },
Alex Deucher901ea572012-02-23 17:53:39 -05001112 .hpd = {
1113 .init = &r600_hpd_init,
1114 .fini = &r600_hpd_fini,
1115 .sense = &r600_hpd_sense,
1116 .set_polarity = &r600_hpd_set_polarity,
1117 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001118 .pm = {
1119 .misc = &r600_pm_misc,
1120 .prepare = &rs600_pm_prepare,
1121 .finish = &rs600_pm_finish,
1122 .init_profile = &rs780_pm_init_profile,
1123 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001124 .get_engine_clock = &radeon_atom_get_engine_clock,
1125 .set_engine_clock = &radeon_atom_set_engine_clock,
1126 .get_memory_clock = NULL,
1127 .set_memory_clock = NULL,
1128 .get_pcie_lanes = NULL,
1129 .set_pcie_lanes = NULL,
1130 .set_clock_gating = NULL,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001131 .get_temperature = &rv6xx_get_temp,
Alex Deucher1b9ba702013-09-05 09:52:37 -04001132 .set_uvd_clocks = &r600_set_uvd_clocks,
Alex Deuchera02fa392012-02-23 17:53:41 -05001133 },
Alex Deucher9d670062013-04-12 13:59:22 -04001134 .dpm = {
1135 .init = &rs780_dpm_init,
1136 .setup_asic = &rs780_dpm_setup_asic,
1137 .enable = &rs780_dpm_enable,
1138 .disable = &rs780_dpm_disable,
Alex Deucher98243912013-01-16 13:13:42 -05001139 .pre_set_power_state = &r600_dpm_pre_set_power_state,
Alex Deucher9d670062013-04-12 13:59:22 -04001140 .set_power_state = &rs780_dpm_set_power_state,
Alex Deucher98243912013-01-16 13:13:42 -05001141 .post_set_power_state = &r600_dpm_post_set_power_state,
Alex Deucher9d670062013-04-12 13:59:22 -04001142 .display_configuration_changed = &rs780_dpm_display_configuration_changed,
1143 .fini = &rs780_dpm_fini,
1144 .get_sclk = &rs780_dpm_get_sclk,
1145 .get_mclk = &rs780_dpm_get_mclk,
1146 .print_power_state = &rs780_dpm_print_power_state,
Alex Deucher444bddc2013-07-02 13:05:23 -04001147 .debugfs_print_current_performance_level = &rs780_dpm_debugfs_print_current_performance_level,
Anthoine Bourgeois63580c32013-09-03 13:52:19 -04001148 .force_performance_level = &rs780_dpm_force_performance_level,
Alex Deucher9d670062013-04-12 13:59:22 -04001149 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001150 .pflip = {
1151 .pre_page_flip = &rs600_pre_page_flip,
1152 .page_flip = &rs600_page_flip,
1153 .post_page_flip = &rs600_post_page_flip,
1154 },
Alex Deucherf47299c2010-03-16 20:54:38 -04001155};
1156
Christian König76a0df82013-08-13 11:56:50 +02001157static struct radeon_asic_ring rv770_uvd_ring = {
Christian Könige409b122013-08-13 11:56:53 +02001158 .ib_execute = &uvd_v1_0_ib_execute,
1159 .emit_fence = &uvd_v2_2_fence_emit,
1160 .emit_semaphore = &uvd_v1_0_semaphore_emit,
Christian König76a0df82013-08-13 11:56:50 +02001161 .cs_parse = &radeon_uvd_cs_parse,
Christian Könige409b122013-08-13 11:56:53 +02001162 .ring_test = &uvd_v1_0_ring_test,
1163 .ib_test = &uvd_v1_0_ib_test,
Christian König76a0df82013-08-13 11:56:50 +02001164 .is_lockup = &radeon_ring_test_lockup,
Christian Könige409b122013-08-13 11:56:53 +02001165 .get_rptr = &uvd_v1_0_get_rptr,
1166 .get_wptr = &uvd_v1_0_get_wptr,
1167 .set_wptr = &uvd_v1_0_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001168};
1169
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001170static struct radeon_asic rv770_asic = {
1171 .init = &rv770_init,
1172 .fini = &rv770_fini,
1173 .suspend = &rv770_suspend,
1174 .resume = &rv770_resume,
Jerome Glissea2d07b72010-03-09 14:45:11 +00001175 .asic_reset = &r600_asic_reset,
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001176 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001177 .ioctl_wait_idle = r600_ioctl_wait_idle,
1178 .gui_idle = &r600_gui_idle,
1179 .mc_wait_for_idle = &r600_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001180 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001181 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001182 .gart = {
1183 .tlb_flush = &r600_pcie_gart_tlb_flush,
1184 .set_page = &rs600_gart_set_page,
1185 },
Christian König4c87bc22011-10-19 19:02:21 +02001186 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001187 [RADEON_RING_TYPE_GFX_INDEX] = &r600_gfx_ring,
1188 [R600_RING_TYPE_DMA_INDEX] = &r600_dma_ring,
1189 [R600_RING_TYPE_UVD_INDEX] = &rv770_uvd_ring,
Christian König4c87bc22011-10-19 19:02:21 +02001190 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001191 .irq = {
1192 .set = &r600_irq_set,
1193 .process = &r600_irq_process,
1194 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001195 .display = {
1196 .bandwidth_update = &rv515_bandwidth_update,
1197 .get_vblank_counter = &rs600_get_vblank_counter,
1198 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001199 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001200 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001201 .hdmi_enable = &r600_hdmi_enable,
1202 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001203 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001204 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001205 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -05001206 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher43fb7782013-01-04 09:24:18 -05001207 .dma = &rv770_copy_dma,
Alex Deucher4d756582012-09-27 15:08:35 -04001208 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher43fb7782013-01-04 09:24:18 -05001209 .copy = &rv770_copy_dma,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001210 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001211 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001212 .surface = {
1213 .set_reg = r600_set_surface_reg,
1214 .clear_reg = r600_clear_surface_reg,
1215 },
Alex Deucher901ea572012-02-23 17:53:39 -05001216 .hpd = {
1217 .init = &r600_hpd_init,
1218 .fini = &r600_hpd_fini,
1219 .sense = &r600_hpd_sense,
1220 .set_polarity = &r600_hpd_set_polarity,
1221 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001222 .pm = {
1223 .misc = &rv770_pm_misc,
1224 .prepare = &rs600_pm_prepare,
1225 .finish = &rs600_pm_finish,
1226 .init_profile = &r600_pm_init_profile,
1227 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001228 .get_engine_clock = &radeon_atom_get_engine_clock,
1229 .set_engine_clock = &radeon_atom_set_engine_clock,
1230 .get_memory_clock = &radeon_atom_get_memory_clock,
1231 .set_memory_clock = &radeon_atom_set_memory_clock,
1232 .get_pcie_lanes = &r600_get_pcie_lanes,
1233 .set_pcie_lanes = &r600_set_pcie_lanes,
1234 .set_clock_gating = &radeon_atom_set_clock_gating,
Christian Königef0e6e62013-04-08 12:41:35 +02001235 .set_uvd_clocks = &rv770_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001236 .get_temperature = &rv770_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001237 },
Alex Deucher66229b22013-06-26 00:11:19 -04001238 .dpm = {
1239 .init = &rv770_dpm_init,
1240 .setup_asic = &rv770_dpm_setup_asic,
1241 .enable = &rv770_dpm_enable,
1242 .disable = &rv770_dpm_disable,
Alex Deucher98243912013-01-16 13:13:42 -05001243 .pre_set_power_state = &r600_dpm_pre_set_power_state,
Alex Deucher66229b22013-06-26 00:11:19 -04001244 .set_power_state = &rv770_dpm_set_power_state,
Alex Deucher98243912013-01-16 13:13:42 -05001245 .post_set_power_state = &r600_dpm_post_set_power_state,
Alex Deucher66229b22013-06-26 00:11:19 -04001246 .display_configuration_changed = &rv770_dpm_display_configuration_changed,
1247 .fini = &rv770_dpm_fini,
1248 .get_sclk = &rv770_dpm_get_sclk,
1249 .get_mclk = &rv770_dpm_get_mclk,
1250 .print_power_state = &rv770_dpm_print_power_state,
Alex Deucherbd210d12013-06-28 10:06:26 -04001251 .debugfs_print_current_performance_level = &rv770_dpm_debugfs_print_current_performance_level,
Alex Deucher8b5e6b72013-07-02 18:40:35 -04001252 .force_performance_level = &rv770_dpm_force_performance_level,
Alex Deucherb06195d2013-07-08 11:49:48 -04001253 .vblank_too_short = &rv770_dpm_vblank_too_short,
Alex Deucher66229b22013-06-26 00:11:19 -04001254 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001255 .pflip = {
1256 .pre_page_flip = &rs600_pre_page_flip,
1257 .page_flip = &rv770_page_flip,
1258 .post_page_flip = &rs600_post_page_flip,
1259 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001260};
1261
Christian König76a0df82013-08-13 11:56:50 +02001262static struct radeon_asic_ring evergreen_gfx_ring = {
1263 .ib_execute = &evergreen_ring_ib_execute,
1264 .emit_fence = &r600_fence_ring_emit,
1265 .emit_semaphore = &r600_semaphore_ring_emit,
1266 .cs_parse = &evergreen_cs_parse,
1267 .ring_test = &r600_ring_test,
1268 .ib_test = &r600_ib_test,
1269 .is_lockup = &evergreen_gfx_is_lockup,
1270 .get_rptr = &radeon_ring_generic_get_rptr,
1271 .get_wptr = &radeon_ring_generic_get_wptr,
1272 .set_wptr = &radeon_ring_generic_set_wptr,
1273};
1274
1275static struct radeon_asic_ring evergreen_dma_ring = {
1276 .ib_execute = &evergreen_dma_ring_ib_execute,
1277 .emit_fence = &evergreen_dma_fence_ring_emit,
1278 .emit_semaphore = &r600_dma_semaphore_ring_emit,
1279 .cs_parse = &evergreen_dma_cs_parse,
1280 .ring_test = &r600_dma_ring_test,
1281 .ib_test = &r600_dma_ib_test,
1282 .is_lockup = &evergreen_dma_is_lockup,
Christian König2e1e6da2013-08-13 11:56:52 +02001283 .get_rptr = &r600_dma_get_rptr,
1284 .get_wptr = &r600_dma_get_wptr,
1285 .set_wptr = &r600_dma_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001286};
1287
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001288static struct radeon_asic evergreen_asic = {
1289 .init = &evergreen_init,
1290 .fini = &evergreen_fini,
1291 .suspend = &evergreen_suspend,
1292 .resume = &evergreen_resume,
Jerome Glissea2d07b72010-03-09 14:45:11 +00001293 .asic_reset = &evergreen_asic_reset,
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001294 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001295 .ioctl_wait_idle = r600_ioctl_wait_idle,
1296 .gui_idle = &r600_gui_idle,
1297 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001298 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001299 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001300 .gart = {
1301 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1302 .set_page = &rs600_gart_set_page,
1303 },
Christian König4c87bc22011-10-19 19:02:21 +02001304 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001305 [RADEON_RING_TYPE_GFX_INDEX] = &evergreen_gfx_ring,
1306 [R600_RING_TYPE_DMA_INDEX] = &evergreen_dma_ring,
1307 [R600_RING_TYPE_UVD_INDEX] = &rv770_uvd_ring,
Christian König4c87bc22011-10-19 19:02:21 +02001308 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001309 .irq = {
1310 .set = &evergreen_irq_set,
1311 .process = &evergreen_irq_process,
1312 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001313 .display = {
1314 .bandwidth_update = &evergreen_bandwidth_update,
1315 .get_vblank_counter = &evergreen_get_vblank_counter,
1316 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001317 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001318 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001319 .hdmi_enable = &evergreen_hdmi_enable,
1320 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001321 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001322 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001323 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -05001324 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001325 .dma = &evergreen_copy_dma,
1326 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001327 .copy = &evergreen_copy_dma,
1328 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001329 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001330 .surface = {
1331 .set_reg = r600_set_surface_reg,
1332 .clear_reg = r600_clear_surface_reg,
1333 },
Alex Deucher901ea572012-02-23 17:53:39 -05001334 .hpd = {
1335 .init = &evergreen_hpd_init,
1336 .fini = &evergreen_hpd_fini,
1337 .sense = &evergreen_hpd_sense,
1338 .set_polarity = &evergreen_hpd_set_polarity,
1339 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001340 .pm = {
1341 .misc = &evergreen_pm_misc,
1342 .prepare = &evergreen_pm_prepare,
1343 .finish = &evergreen_pm_finish,
1344 .init_profile = &r600_pm_init_profile,
1345 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001346 .get_engine_clock = &radeon_atom_get_engine_clock,
1347 .set_engine_clock = &radeon_atom_set_engine_clock,
1348 .get_memory_clock = &radeon_atom_get_memory_clock,
1349 .set_memory_clock = &radeon_atom_set_memory_clock,
1350 .get_pcie_lanes = &r600_get_pcie_lanes,
1351 .set_pcie_lanes = &r600_set_pcie_lanes,
1352 .set_clock_gating = NULL,
Alex Deuchera8b49252013-04-08 12:41:33 +02001353 .set_uvd_clocks = &evergreen_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001354 .get_temperature = &evergreen_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001355 },
Alex Deucherdc50ba72013-06-26 00:33:35 -04001356 .dpm = {
1357 .init = &cypress_dpm_init,
1358 .setup_asic = &cypress_dpm_setup_asic,
1359 .enable = &cypress_dpm_enable,
1360 .disable = &cypress_dpm_disable,
Alex Deucher98243912013-01-16 13:13:42 -05001361 .pre_set_power_state = &r600_dpm_pre_set_power_state,
Alex Deucherdc50ba72013-06-26 00:33:35 -04001362 .set_power_state = &cypress_dpm_set_power_state,
Alex Deucher98243912013-01-16 13:13:42 -05001363 .post_set_power_state = &r600_dpm_post_set_power_state,
Alex Deucherdc50ba72013-06-26 00:33:35 -04001364 .display_configuration_changed = &cypress_dpm_display_configuration_changed,
1365 .fini = &cypress_dpm_fini,
1366 .get_sclk = &rv770_dpm_get_sclk,
1367 .get_mclk = &rv770_dpm_get_mclk,
1368 .print_power_state = &rv770_dpm_print_power_state,
Alex Deucherbd210d12013-06-28 10:06:26 -04001369 .debugfs_print_current_performance_level = &rv770_dpm_debugfs_print_current_performance_level,
Alex Deucher8b5e6b72013-07-02 18:40:35 -04001370 .force_performance_level = &rv770_dpm_force_performance_level,
Alex Deucherd0b54bd2013-07-08 11:56:09 -04001371 .vblank_too_short = &cypress_dpm_vblank_too_short,
Alex Deucherdc50ba72013-06-26 00:33:35 -04001372 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001373 .pflip = {
1374 .pre_page_flip = &evergreen_pre_page_flip,
1375 .page_flip = &evergreen_page_flip,
1376 .post_page_flip = &evergreen_post_page_flip,
1377 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001378};
1379
Alex Deucher958261d2010-11-22 17:56:30 -05001380static struct radeon_asic sumo_asic = {
1381 .init = &evergreen_init,
1382 .fini = &evergreen_fini,
1383 .suspend = &evergreen_suspend,
1384 .resume = &evergreen_resume,
Alex Deucher958261d2010-11-22 17:56:30 -05001385 .asic_reset = &evergreen_asic_reset,
1386 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001387 .ioctl_wait_idle = r600_ioctl_wait_idle,
1388 .gui_idle = &r600_gui_idle,
1389 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001390 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001391 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001392 .gart = {
1393 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1394 .set_page = &rs600_gart_set_page,
1395 },
Christian König4c87bc22011-10-19 19:02:21 +02001396 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001397 [RADEON_RING_TYPE_GFX_INDEX] = &evergreen_gfx_ring,
1398 [R600_RING_TYPE_DMA_INDEX] = &evergreen_dma_ring,
1399 [R600_RING_TYPE_UVD_INDEX] = &rv770_uvd_ring,
Christian König4c87bc22011-10-19 19:02:21 +02001400 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001401 .irq = {
1402 .set = &evergreen_irq_set,
1403 .process = &evergreen_irq_process,
1404 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001405 .display = {
1406 .bandwidth_update = &evergreen_bandwidth_update,
1407 .get_vblank_counter = &evergreen_get_vblank_counter,
1408 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001409 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001410 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001411 .hdmi_enable = &evergreen_hdmi_enable,
1412 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001413 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001414 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001415 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -05001416 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001417 .dma = &evergreen_copy_dma,
1418 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001419 .copy = &evergreen_copy_dma,
1420 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001421 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001422 .surface = {
1423 .set_reg = r600_set_surface_reg,
1424 .clear_reg = r600_clear_surface_reg,
1425 },
Alex Deucher901ea572012-02-23 17:53:39 -05001426 .hpd = {
1427 .init = &evergreen_hpd_init,
1428 .fini = &evergreen_hpd_fini,
1429 .sense = &evergreen_hpd_sense,
1430 .set_polarity = &evergreen_hpd_set_polarity,
1431 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001432 .pm = {
1433 .misc = &evergreen_pm_misc,
1434 .prepare = &evergreen_pm_prepare,
1435 .finish = &evergreen_pm_finish,
1436 .init_profile = &sumo_pm_init_profile,
1437 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001438 .get_engine_clock = &radeon_atom_get_engine_clock,
1439 .set_engine_clock = &radeon_atom_set_engine_clock,
1440 .get_memory_clock = NULL,
1441 .set_memory_clock = NULL,
1442 .get_pcie_lanes = NULL,
1443 .set_pcie_lanes = NULL,
1444 .set_clock_gating = NULL,
Alex Deucher23d33ba2013-04-08 12:41:32 +02001445 .set_uvd_clocks = &sumo_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001446 .get_temperature = &sumo_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001447 },
Alex Deucher80ea2c12013-04-12 14:56:21 -04001448 .dpm = {
1449 .init = &sumo_dpm_init,
1450 .setup_asic = &sumo_dpm_setup_asic,
1451 .enable = &sumo_dpm_enable,
1452 .disable = &sumo_dpm_disable,
Alex Deucher422a56b2013-06-25 15:40:21 -04001453 .pre_set_power_state = &sumo_dpm_pre_set_power_state,
Alex Deucher80ea2c12013-04-12 14:56:21 -04001454 .set_power_state = &sumo_dpm_set_power_state,
Alex Deucher422a56b2013-06-25 15:40:21 -04001455 .post_set_power_state = &sumo_dpm_post_set_power_state,
Alex Deucher80ea2c12013-04-12 14:56:21 -04001456 .display_configuration_changed = &sumo_dpm_display_configuration_changed,
1457 .fini = &sumo_dpm_fini,
1458 .get_sclk = &sumo_dpm_get_sclk,
1459 .get_mclk = &sumo_dpm_get_mclk,
1460 .print_power_state = &sumo_dpm_print_power_state,
Alex Deucherfb701602013-06-28 10:47:56 -04001461 .debugfs_print_current_performance_level = &sumo_dpm_debugfs_print_current_performance_level,
Alex Deucher5d5e5592013-07-02 18:50:09 -04001462 .force_performance_level = &sumo_dpm_force_performance_level,
Alex Deucher80ea2c12013-04-12 14:56:21 -04001463 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001464 .pflip = {
1465 .pre_page_flip = &evergreen_pre_page_flip,
1466 .page_flip = &evergreen_page_flip,
1467 .post_page_flip = &evergreen_post_page_flip,
1468 },
Alex Deucher958261d2010-11-22 17:56:30 -05001469};
1470
Alex Deuchera43b7662011-01-06 21:19:33 -05001471static struct radeon_asic btc_asic = {
1472 .init = &evergreen_init,
1473 .fini = &evergreen_fini,
1474 .suspend = &evergreen_suspend,
1475 .resume = &evergreen_resume,
Alex Deuchera43b7662011-01-06 21:19:33 -05001476 .asic_reset = &evergreen_asic_reset,
1477 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001478 .ioctl_wait_idle = r600_ioctl_wait_idle,
1479 .gui_idle = &r600_gui_idle,
1480 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001481 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001482 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001483 .gart = {
1484 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1485 .set_page = &rs600_gart_set_page,
1486 },
Christian König4c87bc22011-10-19 19:02:21 +02001487 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001488 [RADEON_RING_TYPE_GFX_INDEX] = &evergreen_gfx_ring,
1489 [R600_RING_TYPE_DMA_INDEX] = &evergreen_dma_ring,
1490 [R600_RING_TYPE_UVD_INDEX] = &rv770_uvd_ring,
Christian König4c87bc22011-10-19 19:02:21 +02001491 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001492 .irq = {
1493 .set = &evergreen_irq_set,
1494 .process = &evergreen_irq_process,
1495 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001496 .display = {
1497 .bandwidth_update = &evergreen_bandwidth_update,
1498 .get_vblank_counter = &evergreen_get_vblank_counter,
1499 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001500 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001501 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001502 .hdmi_enable = &evergreen_hdmi_enable,
1503 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001504 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001505 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001506 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -05001507 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001508 .dma = &evergreen_copy_dma,
1509 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001510 .copy = &evergreen_copy_dma,
1511 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001512 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001513 .surface = {
1514 .set_reg = r600_set_surface_reg,
1515 .clear_reg = r600_clear_surface_reg,
1516 },
Alex Deucher901ea572012-02-23 17:53:39 -05001517 .hpd = {
1518 .init = &evergreen_hpd_init,
1519 .fini = &evergreen_hpd_fini,
1520 .sense = &evergreen_hpd_sense,
1521 .set_polarity = &evergreen_hpd_set_polarity,
1522 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001523 .pm = {
1524 .misc = &evergreen_pm_misc,
1525 .prepare = &evergreen_pm_prepare,
1526 .finish = &evergreen_pm_finish,
Alex Deucher27810fb2012-10-01 19:25:11 -04001527 .init_profile = &btc_pm_init_profile,
Alex Deuchera02fa392012-02-23 17:53:41 -05001528 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001529 .get_engine_clock = &radeon_atom_get_engine_clock,
1530 .set_engine_clock = &radeon_atom_set_engine_clock,
1531 .get_memory_clock = &radeon_atom_get_memory_clock,
1532 .set_memory_clock = &radeon_atom_set_memory_clock,
Alex Deucher55b615a2013-03-18 18:57:27 -04001533 .get_pcie_lanes = &r600_get_pcie_lanes,
1534 .set_pcie_lanes = &r600_set_pcie_lanes,
Alex Deucher798bcf72012-02-23 17:53:48 -05001535 .set_clock_gating = NULL,
Alex Deuchera8b49252013-04-08 12:41:33 +02001536 .set_uvd_clocks = &evergreen_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001537 .get_temperature = &evergreen_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001538 },
Alex Deucher6596afd2013-06-26 00:15:24 -04001539 .dpm = {
1540 .init = &btc_dpm_init,
1541 .setup_asic = &btc_dpm_setup_asic,
1542 .enable = &btc_dpm_enable,
1543 .disable = &btc_dpm_disable,
Alex Deuchere8a95392013-01-16 14:17:23 -05001544 .pre_set_power_state = &btc_dpm_pre_set_power_state,
Alex Deucher6596afd2013-06-26 00:15:24 -04001545 .set_power_state = &btc_dpm_set_power_state,
Alex Deuchere8a95392013-01-16 14:17:23 -05001546 .post_set_power_state = &btc_dpm_post_set_power_state,
Alex Deucher6596afd2013-06-26 00:15:24 -04001547 .display_configuration_changed = &cypress_dpm_display_configuration_changed,
1548 .fini = &btc_dpm_fini,
Alex Deuchere8a95392013-01-16 14:17:23 -05001549 .get_sclk = &btc_dpm_get_sclk,
1550 .get_mclk = &btc_dpm_get_mclk,
Alex Deucher6596afd2013-06-26 00:15:24 -04001551 .print_power_state = &rv770_dpm_print_power_state,
Alex Deucherbd210d12013-06-28 10:06:26 -04001552 .debugfs_print_current_performance_level = &rv770_dpm_debugfs_print_current_performance_level,
Alex Deucher8b5e6b72013-07-02 18:40:35 -04001553 .force_performance_level = &rv770_dpm_force_performance_level,
Alex Deuchera84301c2013-07-08 12:03:55 -04001554 .vblank_too_short = &btc_dpm_vblank_too_short,
Alex Deucher6596afd2013-06-26 00:15:24 -04001555 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001556 .pflip = {
1557 .pre_page_flip = &evergreen_pre_page_flip,
1558 .page_flip = &evergreen_page_flip,
1559 .post_page_flip = &evergreen_post_page_flip,
1560 },
Alex Deuchera43b7662011-01-06 21:19:33 -05001561};
1562
Christian König76a0df82013-08-13 11:56:50 +02001563static struct radeon_asic_ring cayman_gfx_ring = {
1564 .ib_execute = &cayman_ring_ib_execute,
1565 .ib_parse = &evergreen_ib_parse,
1566 .emit_fence = &cayman_fence_ring_emit,
1567 .emit_semaphore = &r600_semaphore_ring_emit,
1568 .cs_parse = &evergreen_cs_parse,
1569 .ring_test = &r600_ring_test,
1570 .ib_test = &r600_ib_test,
1571 .is_lockup = &cayman_gfx_is_lockup,
1572 .vm_flush = &cayman_vm_flush,
1573 .get_rptr = &radeon_ring_generic_get_rptr,
1574 .get_wptr = &radeon_ring_generic_get_wptr,
1575 .set_wptr = &radeon_ring_generic_set_wptr,
1576};
1577
1578static struct radeon_asic_ring cayman_dma_ring = {
1579 .ib_execute = &cayman_dma_ring_ib_execute,
1580 .ib_parse = &evergreen_dma_ib_parse,
1581 .emit_fence = &evergreen_dma_fence_ring_emit,
1582 .emit_semaphore = &r600_dma_semaphore_ring_emit,
1583 .cs_parse = &evergreen_dma_cs_parse,
1584 .ring_test = &r600_dma_ring_test,
1585 .ib_test = &r600_dma_ib_test,
1586 .is_lockup = &cayman_dma_is_lockup,
1587 .vm_flush = &cayman_dma_vm_flush,
Christian König2e1e6da2013-08-13 11:56:52 +02001588 .get_rptr = &r600_dma_get_rptr,
1589 .get_wptr = &r600_dma_get_wptr,
1590 .set_wptr = &r600_dma_set_wptr
Christian König76a0df82013-08-13 11:56:50 +02001591};
1592
1593static struct radeon_asic_ring cayman_uvd_ring = {
Christian Könige409b122013-08-13 11:56:53 +02001594 .ib_execute = &uvd_v1_0_ib_execute,
1595 .emit_fence = &uvd_v2_2_fence_emit,
1596 .emit_semaphore = &uvd_v3_1_semaphore_emit,
Christian König76a0df82013-08-13 11:56:50 +02001597 .cs_parse = &radeon_uvd_cs_parse,
Christian Könige409b122013-08-13 11:56:53 +02001598 .ring_test = &uvd_v1_0_ring_test,
1599 .ib_test = &uvd_v1_0_ib_test,
Christian König76a0df82013-08-13 11:56:50 +02001600 .is_lockup = &radeon_ring_test_lockup,
Christian Könige409b122013-08-13 11:56:53 +02001601 .get_rptr = &uvd_v1_0_get_rptr,
1602 .get_wptr = &uvd_v1_0_get_wptr,
1603 .set_wptr = &uvd_v1_0_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001604};
1605
Alex Deuchere3487622011-03-02 20:07:36 -05001606static struct radeon_asic cayman_asic = {
1607 .init = &cayman_init,
1608 .fini = &cayman_fini,
1609 .suspend = &cayman_suspend,
1610 .resume = &cayman_resume,
Alex Deuchere3487622011-03-02 20:07:36 -05001611 .asic_reset = &cayman_asic_reset,
1612 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001613 .ioctl_wait_idle = r600_ioctl_wait_idle,
1614 .gui_idle = &r600_gui_idle,
1615 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001616 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001617 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001618 .gart = {
1619 .tlb_flush = &cayman_pcie_gart_tlb_flush,
1620 .set_page = &rs600_gart_set_page,
1621 },
Christian König05b07142012-08-06 20:21:10 +02001622 .vm = {
1623 .init = &cayman_vm_init,
1624 .fini = &cayman_vm_fini,
Alex Deucherdf160042013-01-31 16:26:02 -05001625 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
Christian König05b07142012-08-06 20:21:10 +02001626 .set_page = &cayman_vm_set_page,
1627 },
Christian König4c87bc22011-10-19 19:02:21 +02001628 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001629 [RADEON_RING_TYPE_GFX_INDEX] = &cayman_gfx_ring,
1630 [CAYMAN_RING_TYPE_CP1_INDEX] = &cayman_gfx_ring,
1631 [CAYMAN_RING_TYPE_CP2_INDEX] = &cayman_gfx_ring,
1632 [R600_RING_TYPE_DMA_INDEX] = &cayman_dma_ring,
1633 [CAYMAN_RING_TYPE_DMA1_INDEX] = &cayman_dma_ring,
1634 [R600_RING_TYPE_UVD_INDEX] = &cayman_uvd_ring,
Christian König4c87bc22011-10-19 19:02:21 +02001635 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001636 .irq = {
1637 .set = &evergreen_irq_set,
1638 .process = &evergreen_irq_process,
1639 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001640 .display = {
1641 .bandwidth_update = &evergreen_bandwidth_update,
1642 .get_vblank_counter = &evergreen_get_vblank_counter,
1643 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001644 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001645 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001646 .hdmi_enable = &evergreen_hdmi_enable,
1647 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001648 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001649 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001650 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -05001651 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001652 .dma = &evergreen_copy_dma,
1653 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001654 .copy = &evergreen_copy_dma,
1655 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001656 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001657 .surface = {
1658 .set_reg = r600_set_surface_reg,
1659 .clear_reg = r600_clear_surface_reg,
1660 },
Alex Deucher901ea572012-02-23 17:53:39 -05001661 .hpd = {
1662 .init = &evergreen_hpd_init,
1663 .fini = &evergreen_hpd_fini,
1664 .sense = &evergreen_hpd_sense,
1665 .set_polarity = &evergreen_hpd_set_polarity,
1666 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001667 .pm = {
1668 .misc = &evergreen_pm_misc,
1669 .prepare = &evergreen_pm_prepare,
1670 .finish = &evergreen_pm_finish,
Alex Deucher27810fb2012-10-01 19:25:11 -04001671 .init_profile = &btc_pm_init_profile,
Alex Deuchera02fa392012-02-23 17:53:41 -05001672 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001673 .get_engine_clock = &radeon_atom_get_engine_clock,
1674 .set_engine_clock = &radeon_atom_set_engine_clock,
1675 .get_memory_clock = &radeon_atom_get_memory_clock,
1676 .set_memory_clock = &radeon_atom_set_memory_clock,
Alex Deucher55b615a2013-03-18 18:57:27 -04001677 .get_pcie_lanes = &r600_get_pcie_lanes,
1678 .set_pcie_lanes = &r600_set_pcie_lanes,
Alex Deucher798bcf72012-02-23 17:53:48 -05001679 .set_clock_gating = NULL,
Alex Deuchera8b49252013-04-08 12:41:33 +02001680 .set_uvd_clocks = &evergreen_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001681 .get_temperature = &evergreen_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001682 },
Alex Deucher69e0b572013-04-12 16:42:42 -04001683 .dpm = {
1684 .init = &ni_dpm_init,
1685 .setup_asic = &ni_dpm_setup_asic,
1686 .enable = &ni_dpm_enable,
1687 .disable = &ni_dpm_disable,
Alex Deucherfee3d742013-01-16 14:35:39 -05001688 .pre_set_power_state = &ni_dpm_pre_set_power_state,
Alex Deucher69e0b572013-04-12 16:42:42 -04001689 .set_power_state = &ni_dpm_set_power_state,
Alex Deucherfee3d742013-01-16 14:35:39 -05001690 .post_set_power_state = &ni_dpm_post_set_power_state,
Alex Deucher69e0b572013-04-12 16:42:42 -04001691 .display_configuration_changed = &cypress_dpm_display_configuration_changed,
1692 .fini = &ni_dpm_fini,
1693 .get_sclk = &ni_dpm_get_sclk,
1694 .get_mclk = &ni_dpm_get_mclk,
1695 .print_power_state = &ni_dpm_print_power_state,
Alex Deucherbdf0c4f2013-06-28 17:49:02 -04001696 .debugfs_print_current_performance_level = &ni_dpm_debugfs_print_current_performance_level,
Alex Deucher170a47f2013-07-02 18:43:53 -04001697 .force_performance_level = &ni_dpm_force_performance_level,
Alex Deucher76ad73e2013-07-08 12:09:41 -04001698 .vblank_too_short = &ni_dpm_vblank_too_short,
Alex Deucher69e0b572013-04-12 16:42:42 -04001699 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001700 .pflip = {
1701 .pre_page_flip = &evergreen_pre_page_flip,
1702 .page_flip = &evergreen_page_flip,
1703 .post_page_flip = &evergreen_post_page_flip,
1704 },
Alex Deuchere3487622011-03-02 20:07:36 -05001705};
1706
Alex Deucherbe63fe82012-03-20 17:18:40 -04001707static struct radeon_asic trinity_asic = {
1708 .init = &cayman_init,
1709 .fini = &cayman_fini,
1710 .suspend = &cayman_suspend,
1711 .resume = &cayman_resume,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001712 .asic_reset = &cayman_asic_reset,
1713 .vga_set_state = &r600_vga_set_state,
1714 .ioctl_wait_idle = r600_ioctl_wait_idle,
1715 .gui_idle = &r600_gui_idle,
1716 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001717 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001718 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001719 .gart = {
1720 .tlb_flush = &cayman_pcie_gart_tlb_flush,
1721 .set_page = &rs600_gart_set_page,
1722 },
Christian König05b07142012-08-06 20:21:10 +02001723 .vm = {
1724 .init = &cayman_vm_init,
1725 .fini = &cayman_vm_fini,
Alex Deucherdf160042013-01-31 16:26:02 -05001726 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
Christian König05b07142012-08-06 20:21:10 +02001727 .set_page = &cayman_vm_set_page,
1728 },
Alex Deucherbe63fe82012-03-20 17:18:40 -04001729 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001730 [RADEON_RING_TYPE_GFX_INDEX] = &cayman_gfx_ring,
1731 [CAYMAN_RING_TYPE_CP1_INDEX] = &cayman_gfx_ring,
1732 [CAYMAN_RING_TYPE_CP2_INDEX] = &cayman_gfx_ring,
1733 [R600_RING_TYPE_DMA_INDEX] = &cayman_dma_ring,
1734 [CAYMAN_RING_TYPE_DMA1_INDEX] = &cayman_dma_ring,
1735 [R600_RING_TYPE_UVD_INDEX] = &cayman_uvd_ring,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001736 },
1737 .irq = {
1738 .set = &evergreen_irq_set,
1739 .process = &evergreen_irq_process,
1740 },
1741 .display = {
1742 .bandwidth_update = &dce6_bandwidth_update,
1743 .get_vblank_counter = &evergreen_get_vblank_counter,
1744 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001745 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001746 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherb5306022013-07-31 16:51:33 -04001747 .hdmi_enable = &evergreen_hdmi_enable,
1748 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001749 },
1750 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001751 .blit = &r600_copy_cpdma,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001752 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001753 .dma = &evergreen_copy_dma,
1754 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001755 .copy = &evergreen_copy_dma,
1756 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001757 },
1758 .surface = {
1759 .set_reg = r600_set_surface_reg,
1760 .clear_reg = r600_clear_surface_reg,
1761 },
1762 .hpd = {
1763 .init = &evergreen_hpd_init,
1764 .fini = &evergreen_hpd_fini,
1765 .sense = &evergreen_hpd_sense,
1766 .set_polarity = &evergreen_hpd_set_polarity,
1767 },
1768 .pm = {
1769 .misc = &evergreen_pm_misc,
1770 .prepare = &evergreen_pm_prepare,
1771 .finish = &evergreen_pm_finish,
1772 .init_profile = &sumo_pm_init_profile,
1773 .get_dynpm_state = &r600_pm_get_dynpm_state,
1774 .get_engine_clock = &radeon_atom_get_engine_clock,
1775 .set_engine_clock = &radeon_atom_set_engine_clock,
1776 .get_memory_clock = NULL,
1777 .set_memory_clock = NULL,
1778 .get_pcie_lanes = NULL,
1779 .set_pcie_lanes = NULL,
1780 .set_clock_gating = NULL,
Alex Deucher23d33ba2013-04-08 12:41:32 +02001781 .set_uvd_clocks = &sumo_set_uvd_clocks,
Alex Deucher29a15222012-12-14 11:57:36 -05001782 .get_temperature = &tn_get_temp,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001783 },
Alex Deucherd70229f2013-04-12 16:40:41 -04001784 .dpm = {
1785 .init = &trinity_dpm_init,
1786 .setup_asic = &trinity_dpm_setup_asic,
1787 .enable = &trinity_dpm_enable,
1788 .disable = &trinity_dpm_disable,
Alex Deuchera284c482013-01-16 13:53:40 -05001789 .pre_set_power_state = &trinity_dpm_pre_set_power_state,
Alex Deucherd70229f2013-04-12 16:40:41 -04001790 .set_power_state = &trinity_dpm_set_power_state,
Alex Deuchera284c482013-01-16 13:53:40 -05001791 .post_set_power_state = &trinity_dpm_post_set_power_state,
Alex Deucherd70229f2013-04-12 16:40:41 -04001792 .display_configuration_changed = &trinity_dpm_display_configuration_changed,
1793 .fini = &trinity_dpm_fini,
1794 .get_sclk = &trinity_dpm_get_sclk,
1795 .get_mclk = &trinity_dpm_get_mclk,
1796 .print_power_state = &trinity_dpm_print_power_state,
Alex Deucher490ab932013-06-28 12:01:38 -04001797 .debugfs_print_current_performance_level = &trinity_dpm_debugfs_print_current_performance_level,
Alex Deucher9b5de592013-07-02 18:52:10 -04001798 .force_performance_level = &trinity_dpm_force_performance_level,
Alex Deucher11877062013-09-09 19:19:52 -04001799 .enable_bapm = &trinity_dpm_enable_bapm,
Alex Deucherd70229f2013-04-12 16:40:41 -04001800 },
Alex Deucherbe63fe82012-03-20 17:18:40 -04001801 .pflip = {
1802 .pre_page_flip = &evergreen_pre_page_flip,
1803 .page_flip = &evergreen_page_flip,
1804 .post_page_flip = &evergreen_post_page_flip,
1805 },
1806};
1807
Christian König76a0df82013-08-13 11:56:50 +02001808static struct radeon_asic_ring si_gfx_ring = {
1809 .ib_execute = &si_ring_ib_execute,
1810 .ib_parse = &si_ib_parse,
1811 .emit_fence = &si_fence_ring_emit,
1812 .emit_semaphore = &r600_semaphore_ring_emit,
1813 .cs_parse = NULL,
1814 .ring_test = &r600_ring_test,
1815 .ib_test = &r600_ib_test,
1816 .is_lockup = &si_gfx_is_lockup,
1817 .vm_flush = &si_vm_flush,
1818 .get_rptr = &radeon_ring_generic_get_rptr,
1819 .get_wptr = &radeon_ring_generic_get_wptr,
1820 .set_wptr = &radeon_ring_generic_set_wptr,
1821};
1822
1823static struct radeon_asic_ring si_dma_ring = {
1824 .ib_execute = &cayman_dma_ring_ib_execute,
1825 .ib_parse = &evergreen_dma_ib_parse,
1826 .emit_fence = &evergreen_dma_fence_ring_emit,
1827 .emit_semaphore = &r600_dma_semaphore_ring_emit,
1828 .cs_parse = NULL,
1829 .ring_test = &r600_dma_ring_test,
1830 .ib_test = &r600_dma_ib_test,
1831 .is_lockup = &si_dma_is_lockup,
1832 .vm_flush = &si_dma_vm_flush,
Christian König2e1e6da2013-08-13 11:56:52 +02001833 .get_rptr = &r600_dma_get_rptr,
1834 .get_wptr = &r600_dma_get_wptr,
1835 .set_wptr = &r600_dma_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001836};
1837
Alex Deucher02779c02012-03-20 17:18:25 -04001838static struct radeon_asic si_asic = {
1839 .init = &si_init,
1840 .fini = &si_fini,
1841 .suspend = &si_suspend,
1842 .resume = &si_resume,
Alex Deucher02779c02012-03-20 17:18:25 -04001843 .asic_reset = &si_asic_reset,
1844 .vga_set_state = &r600_vga_set_state,
1845 .ioctl_wait_idle = r600_ioctl_wait_idle,
1846 .gui_idle = &r600_gui_idle,
1847 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001848 .get_xclk = &si_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001849 .get_gpu_clock_counter = &si_get_gpu_clock_counter,
Alex Deucher02779c02012-03-20 17:18:25 -04001850 .gart = {
1851 .tlb_flush = &si_pcie_gart_tlb_flush,
1852 .set_page = &rs600_gart_set_page,
1853 },
Christian König05b07142012-08-06 20:21:10 +02001854 .vm = {
1855 .init = &si_vm_init,
1856 .fini = &si_vm_fini,
Alex Deucherdf160042013-01-31 16:26:02 -05001857 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher82ffd922012-10-02 14:47:46 -04001858 .set_page = &si_vm_set_page,
Christian König05b07142012-08-06 20:21:10 +02001859 },
Alex Deucher02779c02012-03-20 17:18:25 -04001860 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001861 [RADEON_RING_TYPE_GFX_INDEX] = &si_gfx_ring,
1862 [CAYMAN_RING_TYPE_CP1_INDEX] = &si_gfx_ring,
1863 [CAYMAN_RING_TYPE_CP2_INDEX] = &si_gfx_ring,
1864 [R600_RING_TYPE_DMA_INDEX] = &si_dma_ring,
1865 [CAYMAN_RING_TYPE_DMA1_INDEX] = &si_dma_ring,
1866 [R600_RING_TYPE_UVD_INDEX] = &cayman_uvd_ring,
Alex Deucher02779c02012-03-20 17:18:25 -04001867 },
1868 .irq = {
1869 .set = &si_irq_set,
1870 .process = &si_irq_process,
1871 },
1872 .display = {
1873 .bandwidth_update = &dce6_bandwidth_update,
1874 .get_vblank_counter = &evergreen_get_vblank_counter,
1875 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001876 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001877 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherb5306022013-07-31 16:51:33 -04001878 .hdmi_enable = &evergreen_hdmi_enable,
1879 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucher02779c02012-03-20 17:18:25 -04001880 },
1881 .copy = {
1882 .blit = NULL,
1883 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05001884 .dma = &si_copy_dma,
1885 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001886 .copy = &si_copy_dma,
1887 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher02779c02012-03-20 17:18:25 -04001888 },
1889 .surface = {
1890 .set_reg = r600_set_surface_reg,
1891 .clear_reg = r600_clear_surface_reg,
1892 },
1893 .hpd = {
1894 .init = &evergreen_hpd_init,
1895 .fini = &evergreen_hpd_fini,
1896 .sense = &evergreen_hpd_sense,
1897 .set_polarity = &evergreen_hpd_set_polarity,
1898 },
1899 .pm = {
1900 .misc = &evergreen_pm_misc,
1901 .prepare = &evergreen_pm_prepare,
1902 .finish = &evergreen_pm_finish,
1903 .init_profile = &sumo_pm_init_profile,
1904 .get_dynpm_state = &r600_pm_get_dynpm_state,
1905 .get_engine_clock = &radeon_atom_get_engine_clock,
1906 .set_engine_clock = &radeon_atom_set_engine_clock,
1907 .get_memory_clock = &radeon_atom_get_memory_clock,
1908 .set_memory_clock = &radeon_atom_set_memory_clock,
Alex Deucher55b615a2013-03-18 18:57:27 -04001909 .get_pcie_lanes = &r600_get_pcie_lanes,
1910 .set_pcie_lanes = &r600_set_pcie_lanes,
Alex Deucher02779c02012-03-20 17:18:25 -04001911 .set_clock_gating = NULL,
Christian König2539eb02013-04-08 12:41:34 +02001912 .set_uvd_clocks = &si_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001913 .get_temperature = &si_get_temp,
Alex Deucher02779c02012-03-20 17:18:25 -04001914 },
Alex Deuchera9e61412013-06-25 17:56:16 -04001915 .dpm = {
1916 .init = &si_dpm_init,
1917 .setup_asic = &si_dpm_setup_asic,
1918 .enable = &si_dpm_enable,
1919 .disable = &si_dpm_disable,
1920 .pre_set_power_state = &si_dpm_pre_set_power_state,
1921 .set_power_state = &si_dpm_set_power_state,
1922 .post_set_power_state = &si_dpm_post_set_power_state,
1923 .display_configuration_changed = &si_dpm_display_configuration_changed,
1924 .fini = &si_dpm_fini,
1925 .get_sclk = &ni_dpm_get_sclk,
1926 .get_mclk = &ni_dpm_get_mclk,
1927 .print_power_state = &ni_dpm_print_power_state,
Alex Deucher79821282013-06-28 18:02:19 -04001928 .debugfs_print_current_performance_level = &si_dpm_debugfs_print_current_performance_level,
Alex Deuchera160a6a2013-07-02 18:46:28 -04001929 .force_performance_level = &si_dpm_force_performance_level,
Alex Deucherf4dec312013-07-08 12:15:11 -04001930 .vblank_too_short = &ni_dpm_vblank_too_short,
Alex Deuchera9e61412013-06-25 17:56:16 -04001931 },
Alex Deucher02779c02012-03-20 17:18:25 -04001932 .pflip = {
1933 .pre_page_flip = &evergreen_pre_page_flip,
1934 .page_flip = &evergreen_page_flip,
1935 .post_page_flip = &evergreen_post_page_flip,
1936 },
1937};
1938
Christian König76a0df82013-08-13 11:56:50 +02001939static struct radeon_asic_ring ci_gfx_ring = {
1940 .ib_execute = &cik_ring_ib_execute,
1941 .ib_parse = &cik_ib_parse,
1942 .emit_fence = &cik_fence_gfx_ring_emit,
1943 .emit_semaphore = &cik_semaphore_ring_emit,
1944 .cs_parse = NULL,
1945 .ring_test = &cik_ring_test,
1946 .ib_test = &cik_ib_test,
1947 .is_lockup = &cik_gfx_is_lockup,
1948 .vm_flush = &cik_vm_flush,
1949 .get_rptr = &radeon_ring_generic_get_rptr,
1950 .get_wptr = &radeon_ring_generic_get_wptr,
1951 .set_wptr = &radeon_ring_generic_set_wptr,
1952};
1953
1954static struct radeon_asic_ring ci_cp_ring = {
1955 .ib_execute = &cik_ring_ib_execute,
1956 .ib_parse = &cik_ib_parse,
1957 .emit_fence = &cik_fence_compute_ring_emit,
1958 .emit_semaphore = &cik_semaphore_ring_emit,
1959 .cs_parse = NULL,
1960 .ring_test = &cik_ring_test,
1961 .ib_test = &cik_ib_test,
1962 .is_lockup = &cik_gfx_is_lockup,
1963 .vm_flush = &cik_vm_flush,
1964 .get_rptr = &cik_compute_ring_get_rptr,
1965 .get_wptr = &cik_compute_ring_get_wptr,
1966 .set_wptr = &cik_compute_ring_set_wptr,
1967};
1968
1969static struct radeon_asic_ring ci_dma_ring = {
1970 .ib_execute = &cik_sdma_ring_ib_execute,
1971 .ib_parse = &cik_ib_parse,
1972 .emit_fence = &cik_sdma_fence_ring_emit,
1973 .emit_semaphore = &cik_sdma_semaphore_ring_emit,
1974 .cs_parse = NULL,
1975 .ring_test = &cik_sdma_ring_test,
1976 .ib_test = &cik_sdma_ib_test,
1977 .is_lockup = &cik_sdma_is_lockup,
1978 .vm_flush = &cik_dma_vm_flush,
Christian König2e1e6da2013-08-13 11:56:52 +02001979 .get_rptr = &r600_dma_get_rptr,
1980 .get_wptr = &r600_dma_get_wptr,
1981 .set_wptr = &r600_dma_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001982};
1983
Alex Deucher0672e272013-04-09 16:22:31 -04001984static struct radeon_asic ci_asic = {
1985 .init = &cik_init,
1986 .fini = &cik_fini,
1987 .suspend = &cik_suspend,
1988 .resume = &cik_resume,
1989 .asic_reset = &cik_asic_reset,
1990 .vga_set_state = &r600_vga_set_state,
1991 .ioctl_wait_idle = NULL,
1992 .gui_idle = &r600_gui_idle,
1993 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
1994 .get_xclk = &cik_get_xclk,
1995 .get_gpu_clock_counter = &cik_get_gpu_clock_counter,
1996 .gart = {
1997 .tlb_flush = &cik_pcie_gart_tlb_flush,
1998 .set_page = &rs600_gart_set_page,
1999 },
2000 .vm = {
2001 .init = &cik_vm_init,
2002 .fini = &cik_vm_fini,
2003 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
2004 .set_page = &cik_vm_set_page,
2005 },
2006 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02002007 [RADEON_RING_TYPE_GFX_INDEX] = &ci_gfx_ring,
2008 [CAYMAN_RING_TYPE_CP1_INDEX] = &ci_cp_ring,
2009 [CAYMAN_RING_TYPE_CP2_INDEX] = &ci_cp_ring,
2010 [R600_RING_TYPE_DMA_INDEX] = &ci_dma_ring,
2011 [CAYMAN_RING_TYPE_DMA1_INDEX] = &ci_dma_ring,
2012 [R600_RING_TYPE_UVD_INDEX] = &cayman_uvd_ring,
Alex Deucher0672e272013-04-09 16:22:31 -04002013 },
2014 .irq = {
2015 .set = &cik_irq_set,
2016 .process = &cik_irq_process,
2017 },
2018 .display = {
2019 .bandwidth_update = &dce8_bandwidth_update,
2020 .get_vblank_counter = &evergreen_get_vblank_counter,
2021 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucherb5306022013-07-31 16:51:33 -04002022 .hdmi_enable = &evergreen_hdmi_enable,
2023 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucher0672e272013-04-09 16:22:31 -04002024 },
2025 .copy = {
2026 .blit = NULL,
2027 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
2028 .dma = &cik_copy_dma,
2029 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
2030 .copy = &cik_copy_dma,
2031 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
2032 },
2033 .surface = {
2034 .set_reg = r600_set_surface_reg,
2035 .clear_reg = r600_clear_surface_reg,
2036 },
2037 .hpd = {
2038 .init = &evergreen_hpd_init,
2039 .fini = &evergreen_hpd_fini,
2040 .sense = &evergreen_hpd_sense,
2041 .set_polarity = &evergreen_hpd_set_polarity,
2042 },
2043 .pm = {
2044 .misc = &evergreen_pm_misc,
2045 .prepare = &evergreen_pm_prepare,
2046 .finish = &evergreen_pm_finish,
2047 .init_profile = &sumo_pm_init_profile,
2048 .get_dynpm_state = &r600_pm_get_dynpm_state,
2049 .get_engine_clock = &radeon_atom_get_engine_clock,
2050 .set_engine_clock = &radeon_atom_set_engine_clock,
2051 .get_memory_clock = &radeon_atom_get_memory_clock,
2052 .set_memory_clock = &radeon_atom_set_memory_clock,
2053 .get_pcie_lanes = NULL,
2054 .set_pcie_lanes = NULL,
2055 .set_clock_gating = NULL,
2056 .set_uvd_clocks = &cik_set_uvd_clocks,
Alex Deucher286d9cc2013-06-21 15:50:47 -04002057 .get_temperature = &ci_get_temp,
Alex Deucher0672e272013-04-09 16:22:31 -04002058 },
Alex Deuchercc8dbbb2013-08-14 01:03:41 -04002059 .dpm = {
2060 .init = &ci_dpm_init,
2061 .setup_asic = &ci_dpm_setup_asic,
2062 .enable = &ci_dpm_enable,
2063 .disable = &ci_dpm_disable,
2064 .pre_set_power_state = &ci_dpm_pre_set_power_state,
2065 .set_power_state = &ci_dpm_set_power_state,
2066 .post_set_power_state = &ci_dpm_post_set_power_state,
2067 .display_configuration_changed = &ci_dpm_display_configuration_changed,
2068 .fini = &ci_dpm_fini,
2069 .get_sclk = &ci_dpm_get_sclk,
2070 .get_mclk = &ci_dpm_get_mclk,
2071 .print_power_state = &ci_dpm_print_power_state,
Alex Deucher94b4adc2013-07-15 17:34:33 -04002072 .debugfs_print_current_performance_level = &ci_dpm_debugfs_print_current_performance_level,
Alex Deucher89536fd2013-07-15 18:14:24 -04002073 .force_performance_level = &ci_dpm_force_performance_level,
Alex Deucher54961312013-07-15 18:24:31 -04002074 .vblank_too_short = &ci_dpm_vblank_too_short,
Alex Deucher942bdf72013-08-09 10:05:24 -04002075 .powergate_uvd = &ci_dpm_powergate_uvd,
Alex Deuchercc8dbbb2013-08-14 01:03:41 -04002076 },
Alex Deucher0672e272013-04-09 16:22:31 -04002077 .pflip = {
2078 .pre_page_flip = &evergreen_pre_page_flip,
2079 .page_flip = &evergreen_page_flip,
2080 .post_page_flip = &evergreen_post_page_flip,
2081 },
2082};
2083
2084static struct radeon_asic kv_asic = {
2085 .init = &cik_init,
2086 .fini = &cik_fini,
2087 .suspend = &cik_suspend,
2088 .resume = &cik_resume,
2089 .asic_reset = &cik_asic_reset,
2090 .vga_set_state = &r600_vga_set_state,
2091 .ioctl_wait_idle = NULL,
2092 .gui_idle = &r600_gui_idle,
2093 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
2094 .get_xclk = &cik_get_xclk,
2095 .get_gpu_clock_counter = &cik_get_gpu_clock_counter,
2096 .gart = {
2097 .tlb_flush = &cik_pcie_gart_tlb_flush,
2098 .set_page = &rs600_gart_set_page,
2099 },
2100 .vm = {
2101 .init = &cik_vm_init,
2102 .fini = &cik_vm_fini,
2103 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
2104 .set_page = &cik_vm_set_page,
2105 },
2106 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02002107 [RADEON_RING_TYPE_GFX_INDEX] = &ci_gfx_ring,
2108 [CAYMAN_RING_TYPE_CP1_INDEX] = &ci_cp_ring,
2109 [CAYMAN_RING_TYPE_CP2_INDEX] = &ci_cp_ring,
2110 [R600_RING_TYPE_DMA_INDEX] = &ci_dma_ring,
2111 [CAYMAN_RING_TYPE_DMA1_INDEX] = &ci_dma_ring,
2112 [R600_RING_TYPE_UVD_INDEX] = &cayman_uvd_ring,
Alex Deucher0672e272013-04-09 16:22:31 -04002113 },
2114 .irq = {
2115 .set = &cik_irq_set,
2116 .process = &cik_irq_process,
2117 },
2118 .display = {
2119 .bandwidth_update = &dce8_bandwidth_update,
2120 .get_vblank_counter = &evergreen_get_vblank_counter,
2121 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucherb5306022013-07-31 16:51:33 -04002122 .hdmi_enable = &evergreen_hdmi_enable,
2123 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucher0672e272013-04-09 16:22:31 -04002124 },
2125 .copy = {
2126 .blit = NULL,
2127 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
2128 .dma = &cik_copy_dma,
2129 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
2130 .copy = &cik_copy_dma,
2131 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
2132 },
2133 .surface = {
2134 .set_reg = r600_set_surface_reg,
2135 .clear_reg = r600_clear_surface_reg,
2136 },
2137 .hpd = {
2138 .init = &evergreen_hpd_init,
2139 .fini = &evergreen_hpd_fini,
2140 .sense = &evergreen_hpd_sense,
2141 .set_polarity = &evergreen_hpd_set_polarity,
2142 },
2143 .pm = {
2144 .misc = &evergreen_pm_misc,
2145 .prepare = &evergreen_pm_prepare,
2146 .finish = &evergreen_pm_finish,
2147 .init_profile = &sumo_pm_init_profile,
2148 .get_dynpm_state = &r600_pm_get_dynpm_state,
2149 .get_engine_clock = &radeon_atom_get_engine_clock,
2150 .set_engine_clock = &radeon_atom_set_engine_clock,
2151 .get_memory_clock = &radeon_atom_get_memory_clock,
2152 .set_memory_clock = &radeon_atom_set_memory_clock,
2153 .get_pcie_lanes = NULL,
2154 .set_pcie_lanes = NULL,
2155 .set_clock_gating = NULL,
2156 .set_uvd_clocks = &cik_set_uvd_clocks,
Alex Deucher286d9cc2013-06-21 15:50:47 -04002157 .get_temperature = &kv_get_temp,
Alex Deucher0672e272013-04-09 16:22:31 -04002158 },
Alex Deucher41a524a2013-08-14 01:01:40 -04002159 .dpm = {
2160 .init = &kv_dpm_init,
2161 .setup_asic = &kv_dpm_setup_asic,
2162 .enable = &kv_dpm_enable,
2163 .disable = &kv_dpm_disable,
2164 .pre_set_power_state = &kv_dpm_pre_set_power_state,
2165 .set_power_state = &kv_dpm_set_power_state,
2166 .post_set_power_state = &kv_dpm_post_set_power_state,
2167 .display_configuration_changed = &kv_dpm_display_configuration_changed,
2168 .fini = &kv_dpm_fini,
2169 .get_sclk = &kv_dpm_get_sclk,
2170 .get_mclk = &kv_dpm_get_mclk,
2171 .print_power_state = &kv_dpm_print_power_state,
Alex Deucherae3e40e2013-07-18 16:39:53 -04002172 .debugfs_print_current_performance_level = &kv_dpm_debugfs_print_current_performance_level,
Alex Deucher2b4c8022013-07-18 16:48:46 -04002173 .force_performance_level = &kv_dpm_force_performance_level,
Alex Deucher77df5082013-08-09 10:02:40 -04002174 .powergate_uvd = &kv_dpm_powergate_uvd,
Alex Deucherb7a5ae92013-09-09 19:33:08 -04002175 .enable_bapm = &kv_dpm_enable_bapm,
Alex Deucher41a524a2013-08-14 01:01:40 -04002176 },
Alex Deucher0672e272013-04-09 16:22:31 -04002177 .pflip = {
2178 .pre_page_flip = &evergreen_pre_page_flip,
2179 .page_flip = &evergreen_page_flip,
2180 .post_page_flip = &evergreen_post_page_flip,
2181 },
2182};
2183
Alex Deucherabf1dc62012-07-17 14:02:36 -04002184/**
2185 * radeon_asic_init - register asic specific callbacks
2186 *
2187 * @rdev: radeon device pointer
2188 *
2189 * Registers the appropriate asic specific callbacks for each
2190 * chip family. Also sets other asics specific info like the number
2191 * of crtcs and the register aperture accessors (all asics).
2192 * Returns 0 for success.
2193 */
Daniel Vetter0a10c852010-03-11 21:19:14 +00002194int radeon_asic_init(struct radeon_device *rdev)
2195{
2196 radeon_register_accessor_init(rdev);
Alex Deucherba7e05e2011-06-16 18:14:22 +00002197
2198 /* set the number of crtcs */
2199 if (rdev->flags & RADEON_SINGLE_CRTC)
2200 rdev->num_crtc = 1;
2201 else
2202 rdev->num_crtc = 2;
2203
Alex Deucher948bee32013-05-14 12:08:35 -04002204 rdev->has_uvd = false;
2205
Daniel Vetter0a10c852010-03-11 21:19:14 +00002206 switch (rdev->family) {
2207 case CHIP_R100:
2208 case CHIP_RV100:
2209 case CHIP_RS100:
2210 case CHIP_RV200:
2211 case CHIP_RS200:
2212 rdev->asic = &r100_asic;
2213 break;
2214 case CHIP_R200:
2215 case CHIP_RV250:
2216 case CHIP_RS300:
2217 case CHIP_RV280:
2218 rdev->asic = &r200_asic;
2219 break;
2220 case CHIP_R300:
2221 case CHIP_R350:
2222 case CHIP_RV350:
2223 case CHIP_RV380:
2224 if (rdev->flags & RADEON_IS_PCIE)
2225 rdev->asic = &r300_asic_pcie;
2226 else
2227 rdev->asic = &r300_asic;
2228 break;
2229 case CHIP_R420:
2230 case CHIP_R423:
2231 case CHIP_RV410:
2232 rdev->asic = &r420_asic;
Alex Deucher07bb0842010-06-22 21:58:26 -04002233 /* handle macs */
2234 if (rdev->bios == NULL) {
Alex Deucher798bcf72012-02-23 17:53:48 -05002235 rdev->asic->pm.get_engine_clock = &radeon_legacy_get_engine_clock;
2236 rdev->asic->pm.set_engine_clock = &radeon_legacy_set_engine_clock;
2237 rdev->asic->pm.get_memory_clock = &radeon_legacy_get_memory_clock;
2238 rdev->asic->pm.set_memory_clock = NULL;
Alex Deucher37e9b6a2012-08-03 11:39:43 -04002239 rdev->asic->display.set_backlight_level = &radeon_legacy_set_backlight_level;
Alex Deucher07bb0842010-06-22 21:58:26 -04002240 }
Daniel Vetter0a10c852010-03-11 21:19:14 +00002241 break;
2242 case CHIP_RS400:
2243 case CHIP_RS480:
2244 rdev->asic = &rs400_asic;
2245 break;
2246 case CHIP_RS600:
2247 rdev->asic = &rs600_asic;
2248 break;
2249 case CHIP_RS690:
2250 case CHIP_RS740:
2251 rdev->asic = &rs690_asic;
2252 break;
2253 case CHIP_RV515:
2254 rdev->asic = &rv515_asic;
2255 break;
2256 case CHIP_R520:
2257 case CHIP_RV530:
2258 case CHIP_RV560:
2259 case CHIP_RV570:
2260 case CHIP_R580:
2261 rdev->asic = &r520_asic;
2262 break;
2263 case CHIP_R600:
Alex Deucherca361b62013-06-21 14:42:08 -04002264 rdev->asic = &r600_asic;
2265 break;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002266 case CHIP_RV610:
2267 case CHIP_RV630:
2268 case CHIP_RV620:
2269 case CHIP_RV635:
2270 case CHIP_RV670:
Alex Deucherca361b62013-06-21 14:42:08 -04002271 rdev->asic = &rv6xx_asic;
2272 rdev->has_uvd = true;
Alex Deucherf47299c2010-03-16 20:54:38 -04002273 break;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002274 case CHIP_RS780:
2275 case CHIP_RS880:
Alex Deucherf47299c2010-03-16 20:54:38 -04002276 rdev->asic = &rs780_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002277 rdev->has_uvd = true;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002278 break;
2279 case CHIP_RV770:
2280 case CHIP_RV730:
2281 case CHIP_RV710:
2282 case CHIP_RV740:
2283 rdev->asic = &rv770_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002284 rdev->has_uvd = true;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002285 break;
2286 case CHIP_CEDAR:
2287 case CHIP_REDWOOD:
2288 case CHIP_JUNIPER:
2289 case CHIP_CYPRESS:
2290 case CHIP_HEMLOCK:
Alex Deucherba7e05e2011-06-16 18:14:22 +00002291 /* set num crtcs */
2292 if (rdev->family == CHIP_CEDAR)
2293 rdev->num_crtc = 4;
2294 else
2295 rdev->num_crtc = 6;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002296 rdev->asic = &evergreen_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002297 rdev->has_uvd = true;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002298 break;
Alex Deucher958261d2010-11-22 17:56:30 -05002299 case CHIP_PALM:
Alex Deucher89da5a32011-05-31 15:42:47 -04002300 case CHIP_SUMO:
2301 case CHIP_SUMO2:
Alex Deucher958261d2010-11-22 17:56:30 -05002302 rdev->asic = &sumo_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002303 rdev->has_uvd = true;
Alex Deucher958261d2010-11-22 17:56:30 -05002304 break;
Alex Deuchera43b7662011-01-06 21:19:33 -05002305 case CHIP_BARTS:
2306 case CHIP_TURKS:
2307 case CHIP_CAICOS:
Alex Deucherba7e05e2011-06-16 18:14:22 +00002308 /* set num crtcs */
2309 if (rdev->family == CHIP_CAICOS)
2310 rdev->num_crtc = 4;
2311 else
2312 rdev->num_crtc = 6;
Alex Deuchera43b7662011-01-06 21:19:33 -05002313 rdev->asic = &btc_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002314 rdev->has_uvd = true;
Alex Deuchera43b7662011-01-06 21:19:33 -05002315 break;
Alex Deuchere3487622011-03-02 20:07:36 -05002316 case CHIP_CAYMAN:
2317 rdev->asic = &cayman_asic;
Alex Deucherba7e05e2011-06-16 18:14:22 +00002318 /* set num crtcs */
2319 rdev->num_crtc = 6;
Alex Deucher948bee32013-05-14 12:08:35 -04002320 rdev->has_uvd = true;
Alex Deuchere3487622011-03-02 20:07:36 -05002321 break;
Alex Deucherbe63fe82012-03-20 17:18:40 -04002322 case CHIP_ARUBA:
2323 rdev->asic = &trinity_asic;
2324 /* set num crtcs */
2325 rdev->num_crtc = 4;
Alex Deucher948bee32013-05-14 12:08:35 -04002326 rdev->has_uvd = true;
Alex Deucherbe63fe82012-03-20 17:18:40 -04002327 break;
Alex Deucher02779c02012-03-20 17:18:25 -04002328 case CHIP_TAHITI:
2329 case CHIP_PITCAIRN:
2330 case CHIP_VERDE:
Alex Deuchere737a142012-08-30 14:00:03 -04002331 case CHIP_OLAND:
Alex Deucher86a45ca2012-07-26 19:04:20 -04002332 case CHIP_HAINAN:
Alex Deucher02779c02012-03-20 17:18:25 -04002333 rdev->asic = &si_asic;
2334 /* set num crtcs */
Alex Deucher86a45ca2012-07-26 19:04:20 -04002335 if (rdev->family == CHIP_HAINAN)
2336 rdev->num_crtc = 0;
2337 else if (rdev->family == CHIP_OLAND)
Alex Deuchere737a142012-08-30 14:00:03 -04002338 rdev->num_crtc = 2;
2339 else
2340 rdev->num_crtc = 6;
Alex Deucher948bee32013-05-14 12:08:35 -04002341 if (rdev->family == CHIP_HAINAN)
2342 rdev->has_uvd = false;
2343 else
2344 rdev->has_uvd = true;
Alex Deucher0116e1e2013-08-08 18:00:10 -04002345 switch (rdev->family) {
2346 case CHIP_TAHITI:
2347 rdev->cg_flags =
Alex Deucher090f4b62013-08-14 18:53:56 -04002348 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher0116e1e2013-08-08 18:00:10 -04002349 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deuchere16866e2013-08-08 19:34:07 -04002350 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
Alex Deucher0116e1e2013-08-08 18:00:10 -04002351 RADEON_CG_SUPPORT_GFX_CGLS |
2352 RADEON_CG_SUPPORT_GFX_CGTS |
2353 RADEON_CG_SUPPORT_GFX_CP_LS |
2354 RADEON_CG_SUPPORT_MC_MGCG |
2355 RADEON_CG_SUPPORT_SDMA_MGCG |
2356 RADEON_CG_SUPPORT_BIF_LS |
2357 RADEON_CG_SUPPORT_VCE_MGCG |
2358 RADEON_CG_SUPPORT_UVD_MGCG |
2359 RADEON_CG_SUPPORT_HDP_LS |
2360 RADEON_CG_SUPPORT_HDP_MGCG;
2361 rdev->pg_flags = 0;
2362 break;
2363 case CHIP_PITCAIRN:
2364 rdev->cg_flags =
Alex Deucher090f4b62013-08-14 18:53:56 -04002365 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher0116e1e2013-08-08 18:00:10 -04002366 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deuchere16866e2013-08-08 19:34:07 -04002367 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
Alex Deucher0116e1e2013-08-08 18:00:10 -04002368 RADEON_CG_SUPPORT_GFX_CGLS |
2369 RADEON_CG_SUPPORT_GFX_CGTS |
2370 RADEON_CG_SUPPORT_GFX_CP_LS |
2371 RADEON_CG_SUPPORT_GFX_RLC_LS |
2372 RADEON_CG_SUPPORT_MC_LS |
2373 RADEON_CG_SUPPORT_MC_MGCG |
2374 RADEON_CG_SUPPORT_SDMA_MGCG |
2375 RADEON_CG_SUPPORT_BIF_LS |
2376 RADEON_CG_SUPPORT_VCE_MGCG |
2377 RADEON_CG_SUPPORT_UVD_MGCG |
2378 RADEON_CG_SUPPORT_HDP_LS |
2379 RADEON_CG_SUPPORT_HDP_MGCG;
2380 rdev->pg_flags = 0;
2381 break;
2382 case CHIP_VERDE:
2383 rdev->cg_flags =
Alex Deucher090f4b62013-08-14 18:53:56 -04002384 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher0116e1e2013-08-08 18:00:10 -04002385 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deuchere16866e2013-08-08 19:34:07 -04002386 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
Alex Deucher0116e1e2013-08-08 18:00:10 -04002387 RADEON_CG_SUPPORT_GFX_CGLS |
2388 RADEON_CG_SUPPORT_GFX_CGTS |
2389 RADEON_CG_SUPPORT_GFX_CP_LS |
2390 RADEON_CG_SUPPORT_GFX_RLC_LS |
2391 RADEON_CG_SUPPORT_MC_LS |
2392 RADEON_CG_SUPPORT_MC_MGCG |
2393 RADEON_CG_SUPPORT_SDMA_MGCG |
2394 RADEON_CG_SUPPORT_BIF_LS |
2395 RADEON_CG_SUPPORT_VCE_MGCG |
2396 RADEON_CG_SUPPORT_UVD_MGCG |
2397 RADEON_CG_SUPPORT_HDP_LS |
2398 RADEON_CG_SUPPORT_HDP_MGCG;
Alex Deucherca6ebb32013-08-13 13:18:37 -04002399 rdev->pg_flags = 0 |
Alex Deucher2b19d172013-09-04 16:58:29 -04002400 /*RADEON_PG_SUPPORT_GFX_PG | */
Alex Deucherca6ebb32013-08-13 13:18:37 -04002401 RADEON_PG_SUPPORT_SDMA;
Alex Deucher0116e1e2013-08-08 18:00:10 -04002402 break;
2403 case CHIP_OLAND:
2404 rdev->cg_flags =
Alex Deucher090f4b62013-08-14 18:53:56 -04002405 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher0116e1e2013-08-08 18:00:10 -04002406 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deuchere16866e2013-08-08 19:34:07 -04002407 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
Alex Deucher0116e1e2013-08-08 18:00:10 -04002408 RADEON_CG_SUPPORT_GFX_CGLS |
2409 RADEON_CG_SUPPORT_GFX_CGTS |
2410 RADEON_CG_SUPPORT_GFX_CP_LS |
2411 RADEON_CG_SUPPORT_GFX_RLC_LS |
2412 RADEON_CG_SUPPORT_MC_LS |
2413 RADEON_CG_SUPPORT_MC_MGCG |
2414 RADEON_CG_SUPPORT_SDMA_MGCG |
2415 RADEON_CG_SUPPORT_BIF_LS |
2416 RADEON_CG_SUPPORT_UVD_MGCG |
2417 RADEON_CG_SUPPORT_HDP_LS |
2418 RADEON_CG_SUPPORT_HDP_MGCG;
2419 rdev->pg_flags = 0;
2420 break;
2421 case CHIP_HAINAN:
2422 rdev->cg_flags =
Alex Deucher090f4b62013-08-14 18:53:56 -04002423 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher0116e1e2013-08-08 18:00:10 -04002424 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deuchere16866e2013-08-08 19:34:07 -04002425 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
Alex Deucher0116e1e2013-08-08 18:00:10 -04002426 RADEON_CG_SUPPORT_GFX_CGLS |
2427 RADEON_CG_SUPPORT_GFX_CGTS |
2428 RADEON_CG_SUPPORT_GFX_CP_LS |
2429 RADEON_CG_SUPPORT_GFX_RLC_LS |
2430 RADEON_CG_SUPPORT_MC_LS |
2431 RADEON_CG_SUPPORT_MC_MGCG |
2432 RADEON_CG_SUPPORT_SDMA_MGCG |
2433 RADEON_CG_SUPPORT_BIF_LS |
2434 RADEON_CG_SUPPORT_HDP_LS |
2435 RADEON_CG_SUPPORT_HDP_MGCG;
2436 rdev->pg_flags = 0;
2437 break;
2438 default:
2439 rdev->cg_flags = 0;
2440 rdev->pg_flags = 0;
2441 break;
2442 }
Alex Deucher02779c02012-03-20 17:18:25 -04002443 break;
Alex Deucher0672e272013-04-09 16:22:31 -04002444 case CHIP_BONAIRE:
2445 rdev->asic = &ci_asic;
2446 rdev->num_crtc = 6;
Alex Deucher22c775c2013-07-23 09:41:05 -04002447 rdev->has_uvd = true;
Alex Deucher473359b2013-08-09 11:18:39 -04002448 rdev->cg_flags =
Alex Deucher773dc102013-08-14 18:58:43 -04002449 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher473359b2013-08-09 11:18:39 -04002450 RADEON_CG_SUPPORT_GFX_MGLS |
2451 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
2452 RADEON_CG_SUPPORT_GFX_CGLS |
2453 RADEON_CG_SUPPORT_GFX_CGTS |
2454 RADEON_CG_SUPPORT_GFX_CGTS_LS |
2455 RADEON_CG_SUPPORT_GFX_CP_LS |
2456 RADEON_CG_SUPPORT_MC_LS |
2457 RADEON_CG_SUPPORT_MC_MGCG |
2458 RADEON_CG_SUPPORT_SDMA_MGCG |
2459 RADEON_CG_SUPPORT_SDMA_LS |
2460 RADEON_CG_SUPPORT_BIF_LS |
2461 RADEON_CG_SUPPORT_VCE_MGCG |
2462 RADEON_CG_SUPPORT_UVD_MGCG |
2463 RADEON_CG_SUPPORT_HDP_LS |
2464 RADEON_CG_SUPPORT_HDP_MGCG;
2465 rdev->pg_flags = 0;
Alex Deucher0672e272013-04-09 16:22:31 -04002466 break;
2467 case CHIP_KAVERI:
2468 case CHIP_KABINI:
2469 rdev->asic = &kv_asic;
2470 /* set num crtcs */
Alex Deucher473359b2013-08-09 11:18:39 -04002471 if (rdev->family == CHIP_KAVERI) {
Alex Deucher0672e272013-04-09 16:22:31 -04002472 rdev->num_crtc = 4;
Alex Deucher473359b2013-08-09 11:18:39 -04002473 rdev->cg_flags =
Alex Deucher773dc102013-08-14 18:58:43 -04002474 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher473359b2013-08-09 11:18:39 -04002475 RADEON_CG_SUPPORT_GFX_MGLS |
2476 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
2477 RADEON_CG_SUPPORT_GFX_CGLS |
2478 RADEON_CG_SUPPORT_GFX_CGTS |
2479 RADEON_CG_SUPPORT_GFX_CGTS_LS |
2480 RADEON_CG_SUPPORT_GFX_CP_LS |
2481 RADEON_CG_SUPPORT_SDMA_MGCG |
2482 RADEON_CG_SUPPORT_SDMA_LS |
2483 RADEON_CG_SUPPORT_BIF_LS |
2484 RADEON_CG_SUPPORT_VCE_MGCG |
2485 RADEON_CG_SUPPORT_UVD_MGCG |
2486 RADEON_CG_SUPPORT_HDP_LS |
2487 RADEON_CG_SUPPORT_HDP_MGCG;
2488 rdev->pg_flags = 0;
Alex Deucher2b19d172013-09-04 16:58:29 -04002489 /*RADEON_PG_SUPPORT_GFX_PG |
Alex Deucher473359b2013-08-09 11:18:39 -04002490 RADEON_PG_SUPPORT_GFX_SMG |
2491 RADEON_PG_SUPPORT_GFX_DMG |
2492 RADEON_PG_SUPPORT_UVD |
2493 RADEON_PG_SUPPORT_VCE |
2494 RADEON_PG_SUPPORT_CP |
2495 RADEON_PG_SUPPORT_GDS |
2496 RADEON_PG_SUPPORT_RLC_SMU_HS |
2497 RADEON_PG_SUPPORT_ACP |
2498 RADEON_PG_SUPPORT_SAMU;*/
2499 } else {
Alex Deucher0672e272013-04-09 16:22:31 -04002500 rdev->num_crtc = 2;
Alex Deucher473359b2013-08-09 11:18:39 -04002501 rdev->cg_flags =
Alex Deucher773dc102013-08-14 18:58:43 -04002502 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher473359b2013-08-09 11:18:39 -04002503 RADEON_CG_SUPPORT_GFX_MGLS |
2504 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
2505 RADEON_CG_SUPPORT_GFX_CGLS |
2506 RADEON_CG_SUPPORT_GFX_CGTS |
2507 RADEON_CG_SUPPORT_GFX_CGTS_LS |
2508 RADEON_CG_SUPPORT_GFX_CP_LS |
2509 RADEON_CG_SUPPORT_SDMA_MGCG |
2510 RADEON_CG_SUPPORT_SDMA_LS |
2511 RADEON_CG_SUPPORT_BIF_LS |
2512 RADEON_CG_SUPPORT_VCE_MGCG |
2513 RADEON_CG_SUPPORT_UVD_MGCG |
2514 RADEON_CG_SUPPORT_HDP_LS |
2515 RADEON_CG_SUPPORT_HDP_MGCG;
2516 rdev->pg_flags = 0;
Alex Deucher2b19d172013-09-04 16:58:29 -04002517 /*RADEON_PG_SUPPORT_GFX_PG |
Alex Deucher473359b2013-08-09 11:18:39 -04002518 RADEON_PG_SUPPORT_GFX_SMG |
2519 RADEON_PG_SUPPORT_UVD |
2520 RADEON_PG_SUPPORT_VCE |
2521 RADEON_PG_SUPPORT_CP |
2522 RADEON_PG_SUPPORT_GDS |
2523 RADEON_PG_SUPPORT_RLC_SMU_HS |
2524 RADEON_PG_SUPPORT_SAMU;*/
2525 }
Alex Deucher22c775c2013-07-23 09:41:05 -04002526 rdev->has_uvd = true;
Alex Deucher0672e272013-04-09 16:22:31 -04002527 break;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002528 default:
2529 /* FIXME: not supported yet */
2530 return -EINVAL;
2531 }
2532
2533 if (rdev->flags & RADEON_IS_IGP) {
Alex Deucher798bcf72012-02-23 17:53:48 -05002534 rdev->asic->pm.get_memory_clock = NULL;
2535 rdev->asic->pm.set_memory_clock = NULL;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002536 }
2537
Daniel Vetter0a10c852010-03-11 21:19:14 +00002538 return 0;
2539}
2540