blob: 19bf122a9d6ff41f55f21ee2059b6dcd97dfe530 [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 }
Alex Deucherb4df8be2011-04-12 13:40:18 -0400125 if (rdev->family >= CHIP_R600) {
Daniel Vetter0a10c852010-03-11 21:19:14 +0000126 rdev->pciep_rreg = &r600_pciep_rreg;
127 rdev->pciep_wreg = &r600_pciep_wreg;
128 }
129}
130
131
132/* helper to disable agp */
Alex Deucherabf1dc62012-07-17 14:02:36 -0400133/**
134 * radeon_agp_disable - AGP disable helper function
135 *
136 * @rdev: radeon device pointer
137 *
138 * Removes AGP flags and changes the gart callbacks on AGP
139 * cards when using the internal gart rather than AGP (all asics).
140 */
Daniel Vetter0a10c852010-03-11 21:19:14 +0000141void radeon_agp_disable(struct radeon_device *rdev)
142{
143 rdev->flags &= ~RADEON_IS_AGP;
144 if (rdev->family >= CHIP_R600) {
145 DRM_INFO("Forcing AGP to PCIE mode\n");
146 rdev->flags |= RADEON_IS_PCIE;
147 } else if (rdev->family >= CHIP_RV515 ||
148 rdev->family == CHIP_RV380 ||
149 rdev->family == CHIP_RV410 ||
150 rdev->family == CHIP_R423) {
151 DRM_INFO("Forcing AGP to PCIE mode\n");
152 rdev->flags |= RADEON_IS_PCIE;
Alex Deucherc5b3b852012-02-23 17:53:46 -0500153 rdev->asic->gart.tlb_flush = &rv370_pcie_gart_tlb_flush;
154 rdev->asic->gart.set_page = &rv370_pcie_gart_set_page;
Daniel Vetter0a10c852010-03-11 21:19:14 +0000155 } else {
156 DRM_INFO("Forcing AGP to PCI mode\n");
157 rdev->flags |= RADEON_IS_PCI;
Alex Deucherc5b3b852012-02-23 17:53:46 -0500158 rdev->asic->gart.tlb_flush = &r100_pci_gart_tlb_flush;
159 rdev->asic->gart.set_page = &r100_pci_gart_set_page;
Daniel Vetter0a10c852010-03-11 21:19:14 +0000160 }
161 rdev->mc.gtt_size = radeon_gart_size * 1024 * 1024;
162}
163
164/*
165 * ASIC
166 */
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000167static struct radeon_asic r100_asic = {
168 .init = &r100_init,
169 .fini = &r100_fini,
170 .suspend = &r100_suspend,
171 .resume = &r100_resume,
172 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000173 .asic_reset = &r100_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500174 .ioctl_wait_idle = NULL,
175 .gui_idle = &r100_gui_idle,
176 .mc_wait_for_idle = &r100_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500177 .gart = {
178 .tlb_flush = &r100_pci_gart_tlb_flush,
179 .set_page = &r100_pci_gart_set_page,
180 },
Christian König4c87bc22011-10-19 19:02:21 +0200181 .ring = {
182 [RADEON_RING_TYPE_GFX_INDEX] = {
183 .ib_execute = &r100_ring_ib_execute,
184 .emit_fence = &r100_fence_ring_emit,
185 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100186 .cs_parse = &r100_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500187 .ring_start = &r100_ring_start,
188 .ring_test = &r100_ring_test,
189 .ib_test = &r100_ib_test,
Christian König312c4a82012-05-02 15:11:09 +0200190 .is_lockup = &r100_gpu_is_lockup,
Christian König4c87bc22011-10-19 19:02:21 +0200191 }
192 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500193 .irq = {
194 .set = &r100_irq_set,
195 .process = &r100_irq_process,
196 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500197 .display = {
198 .bandwidth_update = &r100_bandwidth_update,
199 .get_vblank_counter = &r100_get_vblank_counter,
200 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400201 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400202 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500203 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500204 .copy = {
205 .blit = &r100_copy_blit,
206 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
207 .dma = NULL,
208 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
209 .copy = &r100_copy_blit,
210 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
211 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500212 .surface = {
213 .set_reg = r100_set_surface_reg,
214 .clear_reg = r100_clear_surface_reg,
215 },
Alex Deucher901ea572012-02-23 17:53:39 -0500216 .hpd = {
217 .init = &r100_hpd_init,
218 .fini = &r100_hpd_fini,
219 .sense = &r100_hpd_sense,
220 .set_polarity = &r100_hpd_set_polarity,
221 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500222 .pm = {
223 .misc = &r100_pm_misc,
224 .prepare = &r100_pm_prepare,
225 .finish = &r100_pm_finish,
226 .init_profile = &r100_pm_init_profile,
227 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500228 .get_engine_clock = &radeon_legacy_get_engine_clock,
229 .set_engine_clock = &radeon_legacy_set_engine_clock,
230 .get_memory_clock = &radeon_legacy_get_memory_clock,
231 .set_memory_clock = NULL,
232 .get_pcie_lanes = NULL,
233 .set_pcie_lanes = NULL,
234 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500235 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500236 .pflip = {
237 .pre_page_flip = &r100_pre_page_flip,
238 .page_flip = &r100_page_flip,
239 .post_page_flip = &r100_post_page_flip,
240 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000241};
242
243static struct radeon_asic r200_asic = {
244 .init = &r100_init,
245 .fini = &r100_fini,
246 .suspend = &r100_suspend,
247 .resume = &r100_resume,
248 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000249 .asic_reset = &r100_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500250 .ioctl_wait_idle = NULL,
251 .gui_idle = &r100_gui_idle,
252 .mc_wait_for_idle = &r100_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500253 .gart = {
254 .tlb_flush = &r100_pci_gart_tlb_flush,
255 .set_page = &r100_pci_gart_set_page,
256 },
Christian König4c87bc22011-10-19 19:02:21 +0200257 .ring = {
258 [RADEON_RING_TYPE_GFX_INDEX] = {
259 .ib_execute = &r100_ring_ib_execute,
260 .emit_fence = &r100_fence_ring_emit,
261 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100262 .cs_parse = &r100_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500263 .ring_start = &r100_ring_start,
264 .ring_test = &r100_ring_test,
265 .ib_test = &r100_ib_test,
Christian König312c4a82012-05-02 15:11:09 +0200266 .is_lockup = &r100_gpu_is_lockup,
Christian König4c87bc22011-10-19 19:02:21 +0200267 }
268 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500269 .irq = {
270 .set = &r100_irq_set,
271 .process = &r100_irq_process,
272 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500273 .display = {
274 .bandwidth_update = &r100_bandwidth_update,
275 .get_vblank_counter = &r100_get_vblank_counter,
276 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400277 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400278 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500279 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500280 .copy = {
281 .blit = &r100_copy_blit,
282 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
283 .dma = &r200_copy_dma,
284 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
285 .copy = &r100_copy_blit,
286 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
287 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500288 .surface = {
289 .set_reg = r100_set_surface_reg,
290 .clear_reg = r100_clear_surface_reg,
291 },
Alex Deucher901ea572012-02-23 17:53:39 -0500292 .hpd = {
293 .init = &r100_hpd_init,
294 .fini = &r100_hpd_fini,
295 .sense = &r100_hpd_sense,
296 .set_polarity = &r100_hpd_set_polarity,
297 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500298 .pm = {
299 .misc = &r100_pm_misc,
300 .prepare = &r100_pm_prepare,
301 .finish = &r100_pm_finish,
302 .init_profile = &r100_pm_init_profile,
303 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500304 .get_engine_clock = &radeon_legacy_get_engine_clock,
305 .set_engine_clock = &radeon_legacy_set_engine_clock,
306 .get_memory_clock = &radeon_legacy_get_memory_clock,
307 .set_memory_clock = NULL,
308 .get_pcie_lanes = NULL,
309 .set_pcie_lanes = NULL,
310 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500311 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500312 .pflip = {
313 .pre_page_flip = &r100_pre_page_flip,
314 .page_flip = &r100_page_flip,
315 .post_page_flip = &r100_post_page_flip,
316 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000317};
318
319static struct radeon_asic r300_asic = {
320 .init = &r300_init,
321 .fini = &r300_fini,
322 .suspend = &r300_suspend,
323 .resume = &r300_resume,
324 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000325 .asic_reset = &r300_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500326 .ioctl_wait_idle = NULL,
327 .gui_idle = &r100_gui_idle,
328 .mc_wait_for_idle = &r300_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500329 .gart = {
330 .tlb_flush = &r100_pci_gart_tlb_flush,
331 .set_page = &r100_pci_gart_set_page,
332 },
Christian König4c87bc22011-10-19 19:02:21 +0200333 .ring = {
334 [RADEON_RING_TYPE_GFX_INDEX] = {
335 .ib_execute = &r100_ring_ib_execute,
336 .emit_fence = &r300_fence_ring_emit,
337 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100338 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500339 .ring_start = &r300_ring_start,
340 .ring_test = &r100_ring_test,
341 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200342 .is_lockup = &r100_gpu_is_lockup,
Christian König4c87bc22011-10-19 19:02:21 +0200343 }
344 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500345 .irq = {
346 .set = &r100_irq_set,
347 .process = &r100_irq_process,
348 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500349 .display = {
350 .bandwidth_update = &r100_bandwidth_update,
351 .get_vblank_counter = &r100_get_vblank_counter,
352 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400353 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400354 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500355 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500356 .copy = {
357 .blit = &r100_copy_blit,
358 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
359 .dma = &r200_copy_dma,
360 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
361 .copy = &r100_copy_blit,
362 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
363 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500364 .surface = {
365 .set_reg = r100_set_surface_reg,
366 .clear_reg = r100_clear_surface_reg,
367 },
Alex Deucher901ea572012-02-23 17:53:39 -0500368 .hpd = {
369 .init = &r100_hpd_init,
370 .fini = &r100_hpd_fini,
371 .sense = &r100_hpd_sense,
372 .set_polarity = &r100_hpd_set_polarity,
373 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500374 .pm = {
375 .misc = &r100_pm_misc,
376 .prepare = &r100_pm_prepare,
377 .finish = &r100_pm_finish,
378 .init_profile = &r100_pm_init_profile,
379 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500380 .get_engine_clock = &radeon_legacy_get_engine_clock,
381 .set_engine_clock = &radeon_legacy_set_engine_clock,
382 .get_memory_clock = &radeon_legacy_get_memory_clock,
383 .set_memory_clock = NULL,
384 .get_pcie_lanes = &rv370_get_pcie_lanes,
385 .set_pcie_lanes = &rv370_set_pcie_lanes,
386 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500387 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500388 .pflip = {
389 .pre_page_flip = &r100_pre_page_flip,
390 .page_flip = &r100_page_flip,
391 .post_page_flip = &r100_post_page_flip,
392 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000393};
394
395static struct radeon_asic r300_asic_pcie = {
396 .init = &r300_init,
397 .fini = &r300_fini,
398 .suspend = &r300_suspend,
399 .resume = &r300_resume,
400 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000401 .asic_reset = &r300_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500402 .ioctl_wait_idle = NULL,
403 .gui_idle = &r100_gui_idle,
404 .mc_wait_for_idle = &r300_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500405 .gart = {
406 .tlb_flush = &rv370_pcie_gart_tlb_flush,
407 .set_page = &rv370_pcie_gart_set_page,
408 },
Christian König4c87bc22011-10-19 19:02:21 +0200409 .ring = {
410 [RADEON_RING_TYPE_GFX_INDEX] = {
411 .ib_execute = &r100_ring_ib_execute,
412 .emit_fence = &r300_fence_ring_emit,
413 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100414 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500415 .ring_start = &r300_ring_start,
416 .ring_test = &r100_ring_test,
417 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200418 .is_lockup = &r100_gpu_is_lockup,
Christian König4c87bc22011-10-19 19:02:21 +0200419 }
420 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500421 .irq = {
422 .set = &r100_irq_set,
423 .process = &r100_irq_process,
424 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500425 .display = {
426 .bandwidth_update = &r100_bandwidth_update,
427 .get_vblank_counter = &r100_get_vblank_counter,
428 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400429 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400430 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500431 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500432 .copy = {
433 .blit = &r100_copy_blit,
434 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
435 .dma = &r200_copy_dma,
436 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
437 .copy = &r100_copy_blit,
438 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
439 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500440 .surface = {
441 .set_reg = r100_set_surface_reg,
442 .clear_reg = r100_clear_surface_reg,
443 },
Alex Deucher901ea572012-02-23 17:53:39 -0500444 .hpd = {
445 .init = &r100_hpd_init,
446 .fini = &r100_hpd_fini,
447 .sense = &r100_hpd_sense,
448 .set_polarity = &r100_hpd_set_polarity,
449 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500450 .pm = {
451 .misc = &r100_pm_misc,
452 .prepare = &r100_pm_prepare,
453 .finish = &r100_pm_finish,
454 .init_profile = &r100_pm_init_profile,
455 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500456 .get_engine_clock = &radeon_legacy_get_engine_clock,
457 .set_engine_clock = &radeon_legacy_set_engine_clock,
458 .get_memory_clock = &radeon_legacy_get_memory_clock,
459 .set_memory_clock = NULL,
460 .get_pcie_lanes = &rv370_get_pcie_lanes,
461 .set_pcie_lanes = &rv370_set_pcie_lanes,
462 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500463 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500464 .pflip = {
465 .pre_page_flip = &r100_pre_page_flip,
466 .page_flip = &r100_page_flip,
467 .post_page_flip = &r100_post_page_flip,
468 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000469};
470
471static struct radeon_asic r420_asic = {
472 .init = &r420_init,
473 .fini = &r420_fini,
474 .suspend = &r420_suspend,
475 .resume = &r420_resume,
476 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000477 .asic_reset = &r300_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500478 .ioctl_wait_idle = NULL,
479 .gui_idle = &r100_gui_idle,
480 .mc_wait_for_idle = &r300_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500481 .gart = {
482 .tlb_flush = &rv370_pcie_gart_tlb_flush,
483 .set_page = &rv370_pcie_gart_set_page,
484 },
Christian König4c87bc22011-10-19 19:02:21 +0200485 .ring = {
486 [RADEON_RING_TYPE_GFX_INDEX] = {
487 .ib_execute = &r100_ring_ib_execute,
488 .emit_fence = &r300_fence_ring_emit,
489 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100490 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500491 .ring_start = &r300_ring_start,
492 .ring_test = &r100_ring_test,
493 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200494 .is_lockup = &r100_gpu_is_lockup,
Christian König4c87bc22011-10-19 19:02:21 +0200495 }
496 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500497 .irq = {
498 .set = &r100_irq_set,
499 .process = &r100_irq_process,
500 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500501 .display = {
502 .bandwidth_update = &r100_bandwidth_update,
503 .get_vblank_counter = &r100_get_vblank_counter,
504 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400505 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400506 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500507 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500508 .copy = {
509 .blit = &r100_copy_blit,
510 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
511 .dma = &r200_copy_dma,
512 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
513 .copy = &r100_copy_blit,
514 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
515 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500516 .surface = {
517 .set_reg = r100_set_surface_reg,
518 .clear_reg = r100_clear_surface_reg,
519 },
Alex Deucher901ea572012-02-23 17:53:39 -0500520 .hpd = {
521 .init = &r100_hpd_init,
522 .fini = &r100_hpd_fini,
523 .sense = &r100_hpd_sense,
524 .set_polarity = &r100_hpd_set_polarity,
525 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500526 .pm = {
527 .misc = &r100_pm_misc,
528 .prepare = &r100_pm_prepare,
529 .finish = &r100_pm_finish,
530 .init_profile = &r420_pm_init_profile,
531 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500532 .get_engine_clock = &radeon_atom_get_engine_clock,
533 .set_engine_clock = &radeon_atom_set_engine_clock,
534 .get_memory_clock = &radeon_atom_get_memory_clock,
535 .set_memory_clock = &radeon_atom_set_memory_clock,
536 .get_pcie_lanes = &rv370_get_pcie_lanes,
537 .set_pcie_lanes = &rv370_set_pcie_lanes,
538 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500539 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500540 .pflip = {
541 .pre_page_flip = &r100_pre_page_flip,
542 .page_flip = &r100_page_flip,
543 .post_page_flip = &r100_post_page_flip,
544 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000545};
546
547static struct radeon_asic rs400_asic = {
548 .init = &rs400_init,
549 .fini = &rs400_fini,
550 .suspend = &rs400_suspend,
551 .resume = &rs400_resume,
552 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000553 .asic_reset = &r300_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500554 .ioctl_wait_idle = NULL,
555 .gui_idle = &r100_gui_idle,
556 .mc_wait_for_idle = &rs400_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500557 .gart = {
558 .tlb_flush = &rs400_gart_tlb_flush,
559 .set_page = &rs400_gart_set_page,
560 },
Christian König4c87bc22011-10-19 19:02:21 +0200561 .ring = {
562 [RADEON_RING_TYPE_GFX_INDEX] = {
563 .ib_execute = &r100_ring_ib_execute,
564 .emit_fence = &r300_fence_ring_emit,
565 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100566 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500567 .ring_start = &r300_ring_start,
568 .ring_test = &r100_ring_test,
569 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200570 .is_lockup = &r100_gpu_is_lockup,
Christian König4c87bc22011-10-19 19:02:21 +0200571 }
572 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500573 .irq = {
574 .set = &r100_irq_set,
575 .process = &r100_irq_process,
576 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500577 .display = {
578 .bandwidth_update = &r100_bandwidth_update,
579 .get_vblank_counter = &r100_get_vblank_counter,
580 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400581 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400582 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500583 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500584 .copy = {
585 .blit = &r100_copy_blit,
586 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
587 .dma = &r200_copy_dma,
588 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
589 .copy = &r100_copy_blit,
590 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
591 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500592 .surface = {
593 .set_reg = r100_set_surface_reg,
594 .clear_reg = r100_clear_surface_reg,
595 },
Alex Deucher901ea572012-02-23 17:53:39 -0500596 .hpd = {
597 .init = &r100_hpd_init,
598 .fini = &r100_hpd_fini,
599 .sense = &r100_hpd_sense,
600 .set_polarity = &r100_hpd_set_polarity,
601 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500602 .pm = {
603 .misc = &r100_pm_misc,
604 .prepare = &r100_pm_prepare,
605 .finish = &r100_pm_finish,
606 .init_profile = &r100_pm_init_profile,
607 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500608 .get_engine_clock = &radeon_legacy_get_engine_clock,
609 .set_engine_clock = &radeon_legacy_set_engine_clock,
610 .get_memory_clock = &radeon_legacy_get_memory_clock,
611 .set_memory_clock = NULL,
612 .get_pcie_lanes = NULL,
613 .set_pcie_lanes = NULL,
614 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500615 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500616 .pflip = {
617 .pre_page_flip = &r100_pre_page_flip,
618 .page_flip = &r100_page_flip,
619 .post_page_flip = &r100_post_page_flip,
620 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000621};
622
623static struct radeon_asic rs600_asic = {
624 .init = &rs600_init,
625 .fini = &rs600_fini,
626 .suspend = &rs600_suspend,
627 .resume = &rs600_resume,
628 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000629 .asic_reset = &rs600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500630 .ioctl_wait_idle = NULL,
631 .gui_idle = &r100_gui_idle,
632 .mc_wait_for_idle = &rs600_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500633 .gart = {
634 .tlb_flush = &rs600_gart_tlb_flush,
635 .set_page = &rs600_gart_set_page,
636 },
Christian König4c87bc22011-10-19 19:02:21 +0200637 .ring = {
638 [RADEON_RING_TYPE_GFX_INDEX] = {
639 .ib_execute = &r100_ring_ib_execute,
640 .emit_fence = &r300_fence_ring_emit,
641 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100642 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500643 .ring_start = &r300_ring_start,
644 .ring_test = &r100_ring_test,
645 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200646 .is_lockup = &r100_gpu_is_lockup,
Christian König4c87bc22011-10-19 19:02:21 +0200647 }
648 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500649 .irq = {
650 .set = &rs600_irq_set,
651 .process = &rs600_irq_process,
652 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500653 .display = {
654 .bandwidth_update = &rs600_bandwidth_update,
655 .get_vblank_counter = &rs600_get_vblank_counter,
656 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400657 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400658 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500659 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500660 .copy = {
661 .blit = &r100_copy_blit,
662 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
663 .dma = &r200_copy_dma,
664 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
665 .copy = &r100_copy_blit,
666 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
667 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500668 .surface = {
669 .set_reg = r100_set_surface_reg,
670 .clear_reg = r100_clear_surface_reg,
671 },
Alex Deucher901ea572012-02-23 17:53:39 -0500672 .hpd = {
673 .init = &rs600_hpd_init,
674 .fini = &rs600_hpd_fini,
675 .sense = &rs600_hpd_sense,
676 .set_polarity = &rs600_hpd_set_polarity,
677 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500678 .pm = {
679 .misc = &rs600_pm_misc,
680 .prepare = &rs600_pm_prepare,
681 .finish = &rs600_pm_finish,
682 .init_profile = &r420_pm_init_profile,
683 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500684 .get_engine_clock = &radeon_atom_get_engine_clock,
685 .set_engine_clock = &radeon_atom_set_engine_clock,
686 .get_memory_clock = &radeon_atom_get_memory_clock,
687 .set_memory_clock = &radeon_atom_set_memory_clock,
688 .get_pcie_lanes = NULL,
689 .set_pcie_lanes = NULL,
690 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500691 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500692 .pflip = {
693 .pre_page_flip = &rs600_pre_page_flip,
694 .page_flip = &rs600_page_flip,
695 .post_page_flip = &rs600_post_page_flip,
696 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000697};
698
699static struct radeon_asic rs690_asic = {
700 .init = &rs690_init,
701 .fini = &rs690_fini,
702 .suspend = &rs690_suspend,
703 .resume = &rs690_resume,
704 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000705 .asic_reset = &rs600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500706 .ioctl_wait_idle = NULL,
707 .gui_idle = &r100_gui_idle,
708 .mc_wait_for_idle = &rs690_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500709 .gart = {
710 .tlb_flush = &rs400_gart_tlb_flush,
711 .set_page = &rs400_gart_set_page,
712 },
Christian König4c87bc22011-10-19 19:02:21 +0200713 .ring = {
714 [RADEON_RING_TYPE_GFX_INDEX] = {
715 .ib_execute = &r100_ring_ib_execute,
716 .emit_fence = &r300_fence_ring_emit,
717 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100718 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500719 .ring_start = &r300_ring_start,
720 .ring_test = &r100_ring_test,
721 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200722 .is_lockup = &r100_gpu_is_lockup,
Christian König4c87bc22011-10-19 19:02:21 +0200723 }
724 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500725 .irq = {
726 .set = &rs600_irq_set,
727 .process = &rs600_irq_process,
728 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500729 .display = {
730 .get_vblank_counter = &rs600_get_vblank_counter,
731 .bandwidth_update = &rs690_bandwidth_update,
732 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400733 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400734 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500735 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500736 .copy = {
737 .blit = &r100_copy_blit,
738 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
739 .dma = &r200_copy_dma,
740 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
741 .copy = &r200_copy_dma,
742 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
743 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500744 .surface = {
745 .set_reg = r100_set_surface_reg,
746 .clear_reg = r100_clear_surface_reg,
747 },
Alex Deucher901ea572012-02-23 17:53:39 -0500748 .hpd = {
749 .init = &rs600_hpd_init,
750 .fini = &rs600_hpd_fini,
751 .sense = &rs600_hpd_sense,
752 .set_polarity = &rs600_hpd_set_polarity,
753 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500754 .pm = {
755 .misc = &rs600_pm_misc,
756 .prepare = &rs600_pm_prepare,
757 .finish = &rs600_pm_finish,
758 .init_profile = &r420_pm_init_profile,
759 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500760 .get_engine_clock = &radeon_atom_get_engine_clock,
761 .set_engine_clock = &radeon_atom_set_engine_clock,
762 .get_memory_clock = &radeon_atom_get_memory_clock,
763 .set_memory_clock = &radeon_atom_set_memory_clock,
764 .get_pcie_lanes = NULL,
765 .set_pcie_lanes = NULL,
766 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500767 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500768 .pflip = {
769 .pre_page_flip = &rs600_pre_page_flip,
770 .page_flip = &rs600_page_flip,
771 .post_page_flip = &rs600_post_page_flip,
772 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000773};
774
775static struct radeon_asic rv515_asic = {
776 .init = &rv515_init,
777 .fini = &rv515_fini,
778 .suspend = &rv515_suspend,
779 .resume = &rv515_resume,
780 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000781 .asic_reset = &rs600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500782 .ioctl_wait_idle = NULL,
783 .gui_idle = &r100_gui_idle,
784 .mc_wait_for_idle = &rv515_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500785 .gart = {
786 .tlb_flush = &rv370_pcie_gart_tlb_flush,
787 .set_page = &rv370_pcie_gart_set_page,
788 },
Christian König4c87bc22011-10-19 19:02:21 +0200789 .ring = {
790 [RADEON_RING_TYPE_GFX_INDEX] = {
791 .ib_execute = &r100_ring_ib_execute,
792 .emit_fence = &r300_fence_ring_emit,
793 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100794 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500795 .ring_start = &rv515_ring_start,
796 .ring_test = &r100_ring_test,
797 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200798 .is_lockup = &r100_gpu_is_lockup,
Christian König4c87bc22011-10-19 19:02:21 +0200799 }
800 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500801 .irq = {
802 .set = &rs600_irq_set,
803 .process = &rs600_irq_process,
804 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500805 .display = {
806 .get_vblank_counter = &rs600_get_vblank_counter,
807 .bandwidth_update = &rv515_bandwidth_update,
808 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400809 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400810 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500811 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500812 .copy = {
813 .blit = &r100_copy_blit,
814 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
815 .dma = &r200_copy_dma,
816 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
817 .copy = &r100_copy_blit,
818 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
819 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500820 .surface = {
821 .set_reg = r100_set_surface_reg,
822 .clear_reg = r100_clear_surface_reg,
823 },
Alex Deucher901ea572012-02-23 17:53:39 -0500824 .hpd = {
825 .init = &rs600_hpd_init,
826 .fini = &rs600_hpd_fini,
827 .sense = &rs600_hpd_sense,
828 .set_polarity = &rs600_hpd_set_polarity,
829 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500830 .pm = {
831 .misc = &rs600_pm_misc,
832 .prepare = &rs600_pm_prepare,
833 .finish = &rs600_pm_finish,
834 .init_profile = &r420_pm_init_profile,
835 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500836 .get_engine_clock = &radeon_atom_get_engine_clock,
837 .set_engine_clock = &radeon_atom_set_engine_clock,
838 .get_memory_clock = &radeon_atom_get_memory_clock,
839 .set_memory_clock = &radeon_atom_set_memory_clock,
840 .get_pcie_lanes = &rv370_get_pcie_lanes,
841 .set_pcie_lanes = &rv370_set_pcie_lanes,
842 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500843 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500844 .pflip = {
845 .pre_page_flip = &rs600_pre_page_flip,
846 .page_flip = &rs600_page_flip,
847 .post_page_flip = &rs600_post_page_flip,
848 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000849};
850
851static struct radeon_asic r520_asic = {
852 .init = &r520_init,
853 .fini = &rv515_fini,
854 .suspend = &rv515_suspend,
855 .resume = &r520_resume,
856 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000857 .asic_reset = &rs600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500858 .ioctl_wait_idle = NULL,
859 .gui_idle = &r100_gui_idle,
860 .mc_wait_for_idle = &r520_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500861 .gart = {
862 .tlb_flush = &rv370_pcie_gart_tlb_flush,
863 .set_page = &rv370_pcie_gart_set_page,
864 },
Christian König4c87bc22011-10-19 19:02:21 +0200865 .ring = {
866 [RADEON_RING_TYPE_GFX_INDEX] = {
867 .ib_execute = &r100_ring_ib_execute,
868 .emit_fence = &r300_fence_ring_emit,
869 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100870 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500871 .ring_start = &rv515_ring_start,
872 .ring_test = &r100_ring_test,
873 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200874 .is_lockup = &r100_gpu_is_lockup,
Christian König4c87bc22011-10-19 19:02:21 +0200875 }
876 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500877 .irq = {
878 .set = &rs600_irq_set,
879 .process = &rs600_irq_process,
880 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500881 .display = {
882 .bandwidth_update = &rv515_bandwidth_update,
883 .get_vblank_counter = &rs600_get_vblank_counter,
884 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400885 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400886 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500887 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500888 .copy = {
889 .blit = &r100_copy_blit,
890 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
891 .dma = &r200_copy_dma,
892 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
893 .copy = &r100_copy_blit,
894 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
895 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500896 .surface = {
897 .set_reg = r100_set_surface_reg,
898 .clear_reg = r100_clear_surface_reg,
899 },
Alex Deucher901ea572012-02-23 17:53:39 -0500900 .hpd = {
901 .init = &rs600_hpd_init,
902 .fini = &rs600_hpd_fini,
903 .sense = &rs600_hpd_sense,
904 .set_polarity = &rs600_hpd_set_polarity,
905 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500906 .pm = {
907 .misc = &rs600_pm_misc,
908 .prepare = &rs600_pm_prepare,
909 .finish = &rs600_pm_finish,
910 .init_profile = &r420_pm_init_profile,
911 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500912 .get_engine_clock = &radeon_atom_get_engine_clock,
913 .set_engine_clock = &radeon_atom_set_engine_clock,
914 .get_memory_clock = &radeon_atom_get_memory_clock,
915 .set_memory_clock = &radeon_atom_set_memory_clock,
916 .get_pcie_lanes = &rv370_get_pcie_lanes,
917 .set_pcie_lanes = &rv370_set_pcie_lanes,
918 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500919 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500920 .pflip = {
921 .pre_page_flip = &rs600_pre_page_flip,
922 .page_flip = &rs600_page_flip,
923 .post_page_flip = &rs600_post_page_flip,
924 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000925};
926
927static struct radeon_asic r600_asic = {
928 .init = &r600_init,
929 .fini = &r600_fini,
930 .suspend = &r600_suspend,
931 .resume = &r600_resume,
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000932 .vga_set_state = &r600_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000933 .asic_reset = &r600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500934 .ioctl_wait_idle = r600_ioctl_wait_idle,
935 .gui_idle = &r600_gui_idle,
936 .mc_wait_for_idle = &r600_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -0500937 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -0500938 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500939 .gart = {
940 .tlb_flush = &r600_pcie_gart_tlb_flush,
941 .set_page = &rs600_gart_set_page,
942 },
Christian König4c87bc22011-10-19 19:02:21 +0200943 .ring = {
944 [RADEON_RING_TYPE_GFX_INDEX] = {
945 .ib_execute = &r600_ring_ib_execute,
946 .emit_fence = &r600_fence_ring_emit,
947 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100948 .cs_parse = &r600_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500949 .ring_test = &r600_ring_test,
950 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -0500951 .is_lockup = &r600_gfx_is_lockup,
Alex Deucher4d756582012-09-27 15:08:35 -0400952 },
953 [R600_RING_TYPE_DMA_INDEX] = {
954 .ib_execute = &r600_dma_ring_ib_execute,
955 .emit_fence = &r600_dma_fence_ring_emit,
956 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deuchercf4ccd02011-11-18 10:19:47 -0500957 .cs_parse = &r600_dma_cs_parse,
Alex Deucher4d756582012-09-27 15:08:35 -0400958 .ring_test = &r600_dma_ring_test,
959 .ib_test = &r600_dma_ib_test,
960 .is_lockup = &r600_dma_is_lockup,
Christian König4c87bc22011-10-19 19:02:21 +0200961 }
962 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500963 .irq = {
964 .set = &r600_irq_set,
965 .process = &r600_irq_process,
966 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500967 .display = {
968 .bandwidth_update = &rv515_bandwidth_update,
969 .get_vblank_counter = &rs600_get_vblank_counter,
970 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400971 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400972 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500973 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500974 .copy = {
975 .blit = &r600_copy_blit,
976 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher4d756582012-09-27 15:08:35 -0400977 .dma = &r600_copy_dma,
978 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -0400979 .copy = &r600_copy_dma,
980 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -0500981 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500982 .surface = {
983 .set_reg = r600_set_surface_reg,
984 .clear_reg = r600_clear_surface_reg,
985 },
Alex Deucher901ea572012-02-23 17:53:39 -0500986 .hpd = {
987 .init = &r600_hpd_init,
988 .fini = &r600_hpd_fini,
989 .sense = &r600_hpd_sense,
990 .set_polarity = &r600_hpd_set_polarity,
991 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500992 .pm = {
993 .misc = &r600_pm_misc,
994 .prepare = &rs600_pm_prepare,
995 .finish = &rs600_pm_finish,
996 .init_profile = &r600_pm_init_profile,
997 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500998 .get_engine_clock = &radeon_atom_get_engine_clock,
999 .set_engine_clock = &radeon_atom_set_engine_clock,
1000 .get_memory_clock = &radeon_atom_get_memory_clock,
1001 .set_memory_clock = &radeon_atom_set_memory_clock,
1002 .get_pcie_lanes = &r600_get_pcie_lanes,
1003 .set_pcie_lanes = &r600_set_pcie_lanes,
1004 .set_clock_gating = NULL,
Alex Deuchera02fa392012-02-23 17:53:41 -05001005 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001006 .pflip = {
1007 .pre_page_flip = &rs600_pre_page_flip,
1008 .page_flip = &rs600_page_flip,
1009 .post_page_flip = &rs600_post_page_flip,
1010 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001011};
1012
Alex Deucherf47299c2010-03-16 20:54:38 -04001013static struct radeon_asic rs780_asic = {
1014 .init = &r600_init,
1015 .fini = &r600_fini,
1016 .suspend = &r600_suspend,
1017 .resume = &r600_resume,
Alex Deucherf47299c2010-03-16 20:54:38 -04001018 .vga_set_state = &r600_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +00001019 .asic_reset = &r600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -05001020 .ioctl_wait_idle = r600_ioctl_wait_idle,
1021 .gui_idle = &r600_gui_idle,
1022 .mc_wait_for_idle = &r600_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001023 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001024 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001025 .gart = {
1026 .tlb_flush = &r600_pcie_gart_tlb_flush,
1027 .set_page = &rs600_gart_set_page,
1028 },
Christian König4c87bc22011-10-19 19:02:21 +02001029 .ring = {
1030 [RADEON_RING_TYPE_GFX_INDEX] = {
1031 .ib_execute = &r600_ring_ib_execute,
1032 .emit_fence = &r600_fence_ring_emit,
1033 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001034 .cs_parse = &r600_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001035 .ring_test = &r600_ring_test,
1036 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001037 .is_lockup = &r600_gfx_is_lockup,
Alex Deucher4d756582012-09-27 15:08:35 -04001038 },
1039 [R600_RING_TYPE_DMA_INDEX] = {
1040 .ib_execute = &r600_dma_ring_ib_execute,
1041 .emit_fence = &r600_dma_fence_ring_emit,
1042 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deuchercf4ccd02011-11-18 10:19:47 -05001043 .cs_parse = &r600_dma_cs_parse,
Alex Deucher4d756582012-09-27 15:08:35 -04001044 .ring_test = &r600_dma_ring_test,
1045 .ib_test = &r600_dma_ib_test,
1046 .is_lockup = &r600_dma_is_lockup,
Christian König4c87bc22011-10-19 19:02:21 +02001047 }
1048 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001049 .irq = {
1050 .set = &r600_irq_set,
1051 .process = &r600_irq_process,
1052 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001053 .display = {
1054 .bandwidth_update = &rs690_bandwidth_update,
1055 .get_vblank_counter = &rs600_get_vblank_counter,
1056 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001057 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001058 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001059 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001060 .copy = {
1061 .blit = &r600_copy_blit,
1062 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher4d756582012-09-27 15:08:35 -04001063 .dma = &r600_copy_dma,
1064 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001065 .copy = &r600_copy_dma,
1066 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001067 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001068 .surface = {
1069 .set_reg = r600_set_surface_reg,
1070 .clear_reg = r600_clear_surface_reg,
1071 },
Alex Deucher901ea572012-02-23 17:53:39 -05001072 .hpd = {
1073 .init = &r600_hpd_init,
1074 .fini = &r600_hpd_fini,
1075 .sense = &r600_hpd_sense,
1076 .set_polarity = &r600_hpd_set_polarity,
1077 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001078 .pm = {
1079 .misc = &r600_pm_misc,
1080 .prepare = &rs600_pm_prepare,
1081 .finish = &rs600_pm_finish,
1082 .init_profile = &rs780_pm_init_profile,
1083 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001084 .get_engine_clock = &radeon_atom_get_engine_clock,
1085 .set_engine_clock = &radeon_atom_set_engine_clock,
1086 .get_memory_clock = NULL,
1087 .set_memory_clock = NULL,
1088 .get_pcie_lanes = NULL,
1089 .set_pcie_lanes = NULL,
1090 .set_clock_gating = NULL,
Alex Deuchera02fa392012-02-23 17:53:41 -05001091 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001092 .pflip = {
1093 .pre_page_flip = &rs600_pre_page_flip,
1094 .page_flip = &rs600_page_flip,
1095 .post_page_flip = &rs600_post_page_flip,
1096 },
Alex Deucherf47299c2010-03-16 20:54:38 -04001097};
1098
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001099static struct radeon_asic rv770_asic = {
1100 .init = &rv770_init,
1101 .fini = &rv770_fini,
1102 .suspend = &rv770_suspend,
1103 .resume = &rv770_resume,
Jerome Glissea2d07b72010-03-09 14:45:11 +00001104 .asic_reset = &r600_asic_reset,
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001105 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001106 .ioctl_wait_idle = r600_ioctl_wait_idle,
1107 .gui_idle = &r600_gui_idle,
1108 .mc_wait_for_idle = &r600_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001109 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001110 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001111 .gart = {
1112 .tlb_flush = &r600_pcie_gart_tlb_flush,
1113 .set_page = &rs600_gart_set_page,
1114 },
Christian König4c87bc22011-10-19 19:02:21 +02001115 .ring = {
1116 [RADEON_RING_TYPE_GFX_INDEX] = {
1117 .ib_execute = &r600_ring_ib_execute,
1118 .emit_fence = &r600_fence_ring_emit,
1119 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001120 .cs_parse = &r600_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001121 .ring_test = &r600_ring_test,
1122 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001123 .is_lockup = &r600_gfx_is_lockup,
Alex Deucher4d756582012-09-27 15:08:35 -04001124 },
1125 [R600_RING_TYPE_DMA_INDEX] = {
1126 .ib_execute = &r600_dma_ring_ib_execute,
1127 .emit_fence = &r600_dma_fence_ring_emit,
1128 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deuchercf4ccd02011-11-18 10:19:47 -05001129 .cs_parse = &r600_dma_cs_parse,
Alex Deucher4d756582012-09-27 15:08:35 -04001130 .ring_test = &r600_dma_ring_test,
1131 .ib_test = &r600_dma_ib_test,
1132 .is_lockup = &r600_dma_is_lockup,
Christian Königf2ba57b2013-04-08 12:41:29 +02001133 },
1134 [R600_RING_TYPE_UVD_INDEX] = {
1135 .ib_execute = &r600_uvd_ib_execute,
1136 .emit_fence = &r600_uvd_fence_emit,
1137 .emit_semaphore = &r600_uvd_semaphore_emit,
1138 .cs_parse = &radeon_uvd_cs_parse,
1139 .ring_test = &r600_uvd_ring_test,
1140 .ib_test = &r600_uvd_ib_test,
1141 .is_lockup = &radeon_ring_test_lockup,
Christian König4c87bc22011-10-19 19:02:21 +02001142 }
1143 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001144 .irq = {
1145 .set = &r600_irq_set,
1146 .process = &r600_irq_process,
1147 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001148 .display = {
1149 .bandwidth_update = &rv515_bandwidth_update,
1150 .get_vblank_counter = &rs600_get_vblank_counter,
1151 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001152 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001153 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001154 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001155 .copy = {
1156 .blit = &r600_copy_blit,
1157 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher43fb7782013-01-04 09:24:18 -05001158 .dma = &rv770_copy_dma,
Alex Deucher4d756582012-09-27 15:08:35 -04001159 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher43fb7782013-01-04 09:24:18 -05001160 .copy = &rv770_copy_dma,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001161 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001162 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001163 .surface = {
1164 .set_reg = r600_set_surface_reg,
1165 .clear_reg = r600_clear_surface_reg,
1166 },
Alex Deucher901ea572012-02-23 17:53:39 -05001167 .hpd = {
1168 .init = &r600_hpd_init,
1169 .fini = &r600_hpd_fini,
1170 .sense = &r600_hpd_sense,
1171 .set_polarity = &r600_hpd_set_polarity,
1172 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001173 .pm = {
1174 .misc = &rv770_pm_misc,
1175 .prepare = &rs600_pm_prepare,
1176 .finish = &rs600_pm_finish,
1177 .init_profile = &r600_pm_init_profile,
1178 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001179 .get_engine_clock = &radeon_atom_get_engine_clock,
1180 .set_engine_clock = &radeon_atom_set_engine_clock,
1181 .get_memory_clock = &radeon_atom_get_memory_clock,
1182 .set_memory_clock = &radeon_atom_set_memory_clock,
1183 .get_pcie_lanes = &r600_get_pcie_lanes,
1184 .set_pcie_lanes = &r600_set_pcie_lanes,
1185 .set_clock_gating = &radeon_atom_set_clock_gating,
Christian Königef0e6e62013-04-08 12:41:35 +02001186 .set_uvd_clocks = &rv770_set_uvd_clocks,
Alex Deuchera02fa392012-02-23 17:53:41 -05001187 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001188 .pflip = {
1189 .pre_page_flip = &rs600_pre_page_flip,
1190 .page_flip = &rv770_page_flip,
1191 .post_page_flip = &rs600_post_page_flip,
1192 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001193};
1194
1195static struct radeon_asic evergreen_asic = {
1196 .init = &evergreen_init,
1197 .fini = &evergreen_fini,
1198 .suspend = &evergreen_suspend,
1199 .resume = &evergreen_resume,
Jerome Glissea2d07b72010-03-09 14:45:11 +00001200 .asic_reset = &evergreen_asic_reset,
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001201 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001202 .ioctl_wait_idle = r600_ioctl_wait_idle,
1203 .gui_idle = &r600_gui_idle,
1204 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001205 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001206 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001207 .gart = {
1208 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1209 .set_page = &rs600_gart_set_page,
1210 },
Christian König4c87bc22011-10-19 19:02:21 +02001211 .ring = {
1212 [RADEON_RING_TYPE_GFX_INDEX] = {
1213 .ib_execute = &evergreen_ring_ib_execute,
1214 .emit_fence = &r600_fence_ring_emit,
1215 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001216 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001217 .ring_test = &r600_ring_test,
1218 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001219 .is_lockup = &evergreen_gfx_is_lockup,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001220 },
1221 [R600_RING_TYPE_DMA_INDEX] = {
1222 .ib_execute = &evergreen_dma_ring_ib_execute,
1223 .emit_fence = &evergreen_dma_fence_ring_emit,
1224 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001225 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001226 .ring_test = &r600_dma_ring_test,
1227 .ib_test = &r600_dma_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001228 .is_lockup = &evergreen_dma_is_lockup,
Christian Königf2ba57b2013-04-08 12:41:29 +02001229 },
1230 [R600_RING_TYPE_UVD_INDEX] = {
1231 .ib_execute = &r600_uvd_ib_execute,
1232 .emit_fence = &r600_uvd_fence_emit,
1233 .emit_semaphore = &r600_uvd_semaphore_emit,
1234 .cs_parse = &radeon_uvd_cs_parse,
1235 .ring_test = &r600_uvd_ring_test,
1236 .ib_test = &r600_uvd_ib_test,
1237 .is_lockup = &radeon_ring_test_lockup,
Christian König4c87bc22011-10-19 19:02:21 +02001238 }
1239 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001240 .irq = {
1241 .set = &evergreen_irq_set,
1242 .process = &evergreen_irq_process,
1243 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001244 .display = {
1245 .bandwidth_update = &evergreen_bandwidth_update,
1246 .get_vblank_counter = &evergreen_get_vblank_counter,
1247 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001248 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001249 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001250 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001251 .copy = {
1252 .blit = &r600_copy_blit,
1253 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001254 .dma = &evergreen_copy_dma,
1255 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001256 .copy = &evergreen_copy_dma,
1257 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001258 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001259 .surface = {
1260 .set_reg = r600_set_surface_reg,
1261 .clear_reg = r600_clear_surface_reg,
1262 },
Alex Deucher901ea572012-02-23 17:53:39 -05001263 .hpd = {
1264 .init = &evergreen_hpd_init,
1265 .fini = &evergreen_hpd_fini,
1266 .sense = &evergreen_hpd_sense,
1267 .set_polarity = &evergreen_hpd_set_polarity,
1268 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001269 .pm = {
1270 .misc = &evergreen_pm_misc,
1271 .prepare = &evergreen_pm_prepare,
1272 .finish = &evergreen_pm_finish,
1273 .init_profile = &r600_pm_init_profile,
1274 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001275 .get_engine_clock = &radeon_atom_get_engine_clock,
1276 .set_engine_clock = &radeon_atom_set_engine_clock,
1277 .get_memory_clock = &radeon_atom_get_memory_clock,
1278 .set_memory_clock = &radeon_atom_set_memory_clock,
1279 .get_pcie_lanes = &r600_get_pcie_lanes,
1280 .set_pcie_lanes = &r600_set_pcie_lanes,
1281 .set_clock_gating = NULL,
Alex Deuchera8b49252013-04-08 12:41:33 +02001282 .set_uvd_clocks = &evergreen_set_uvd_clocks,
Alex Deuchera02fa392012-02-23 17:53:41 -05001283 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001284 .pflip = {
1285 .pre_page_flip = &evergreen_pre_page_flip,
1286 .page_flip = &evergreen_page_flip,
1287 .post_page_flip = &evergreen_post_page_flip,
1288 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001289};
1290
Alex Deucher958261d2010-11-22 17:56:30 -05001291static struct radeon_asic sumo_asic = {
1292 .init = &evergreen_init,
1293 .fini = &evergreen_fini,
1294 .suspend = &evergreen_suspend,
1295 .resume = &evergreen_resume,
Alex Deucher958261d2010-11-22 17:56:30 -05001296 .asic_reset = &evergreen_asic_reset,
1297 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001298 .ioctl_wait_idle = r600_ioctl_wait_idle,
1299 .gui_idle = &r600_gui_idle,
1300 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001301 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001302 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001303 .gart = {
1304 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1305 .set_page = &rs600_gart_set_page,
1306 },
Christian König4c87bc22011-10-19 19:02:21 +02001307 .ring = {
1308 [RADEON_RING_TYPE_GFX_INDEX] = {
1309 .ib_execute = &evergreen_ring_ib_execute,
1310 .emit_fence = &r600_fence_ring_emit,
1311 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001312 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001313 .ring_test = &r600_ring_test,
1314 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001315 .is_lockup = &evergreen_gfx_is_lockup,
Christian Königeb0c19c2012-02-23 15:18:44 +01001316 },
Alex Deucher233d1ad2012-12-04 15:25:59 -05001317 [R600_RING_TYPE_DMA_INDEX] = {
1318 .ib_execute = &evergreen_dma_ring_ib_execute,
1319 .emit_fence = &evergreen_dma_fence_ring_emit,
1320 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001321 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001322 .ring_test = &r600_dma_ring_test,
1323 .ib_test = &r600_dma_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001324 .is_lockup = &evergreen_dma_is_lockup,
Christian Königf2ba57b2013-04-08 12:41:29 +02001325 },
1326 [R600_RING_TYPE_UVD_INDEX] = {
1327 .ib_execute = &r600_uvd_ib_execute,
1328 .emit_fence = &r600_uvd_fence_emit,
1329 .emit_semaphore = &r600_uvd_semaphore_emit,
1330 .cs_parse = &radeon_uvd_cs_parse,
1331 .ring_test = &r600_uvd_ring_test,
1332 .ib_test = &r600_uvd_ib_test,
1333 .is_lockup = &radeon_ring_test_lockup,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001334 }
Christian König4c87bc22011-10-19 19:02:21 +02001335 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001336 .irq = {
1337 .set = &evergreen_irq_set,
1338 .process = &evergreen_irq_process,
1339 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001340 .display = {
1341 .bandwidth_update = &evergreen_bandwidth_update,
1342 .get_vblank_counter = &evergreen_get_vblank_counter,
1343 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001344 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001345 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001346 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001347 .copy = {
1348 .blit = &r600_copy_blit,
1349 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001350 .dma = &evergreen_copy_dma,
1351 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001352 .copy = &evergreen_copy_dma,
1353 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001354 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001355 .surface = {
1356 .set_reg = r600_set_surface_reg,
1357 .clear_reg = r600_clear_surface_reg,
1358 },
Alex Deucher901ea572012-02-23 17:53:39 -05001359 .hpd = {
1360 .init = &evergreen_hpd_init,
1361 .fini = &evergreen_hpd_fini,
1362 .sense = &evergreen_hpd_sense,
1363 .set_polarity = &evergreen_hpd_set_polarity,
1364 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001365 .pm = {
1366 .misc = &evergreen_pm_misc,
1367 .prepare = &evergreen_pm_prepare,
1368 .finish = &evergreen_pm_finish,
1369 .init_profile = &sumo_pm_init_profile,
1370 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001371 .get_engine_clock = &radeon_atom_get_engine_clock,
1372 .set_engine_clock = &radeon_atom_set_engine_clock,
1373 .get_memory_clock = NULL,
1374 .set_memory_clock = NULL,
1375 .get_pcie_lanes = NULL,
1376 .set_pcie_lanes = NULL,
1377 .set_clock_gating = NULL,
Alex Deucher23d33ba2013-04-08 12:41:32 +02001378 .set_uvd_clocks = &sumo_set_uvd_clocks,
Alex Deuchera02fa392012-02-23 17:53:41 -05001379 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001380 .pflip = {
1381 .pre_page_flip = &evergreen_pre_page_flip,
1382 .page_flip = &evergreen_page_flip,
1383 .post_page_flip = &evergreen_post_page_flip,
1384 },
Alex Deucher958261d2010-11-22 17:56:30 -05001385};
1386
Alex Deuchera43b7662011-01-06 21:19:33 -05001387static struct radeon_asic btc_asic = {
1388 .init = &evergreen_init,
1389 .fini = &evergreen_fini,
1390 .suspend = &evergreen_suspend,
1391 .resume = &evergreen_resume,
Alex Deuchera43b7662011-01-06 21:19:33 -05001392 .asic_reset = &evergreen_asic_reset,
1393 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001394 .ioctl_wait_idle = r600_ioctl_wait_idle,
1395 .gui_idle = &r600_gui_idle,
1396 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001397 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001398 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001399 .gart = {
1400 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1401 .set_page = &rs600_gart_set_page,
1402 },
Christian König4c87bc22011-10-19 19:02:21 +02001403 .ring = {
1404 [RADEON_RING_TYPE_GFX_INDEX] = {
1405 .ib_execute = &evergreen_ring_ib_execute,
1406 .emit_fence = &r600_fence_ring_emit,
1407 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001408 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001409 .ring_test = &r600_ring_test,
1410 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001411 .is_lockup = &evergreen_gfx_is_lockup,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001412 },
1413 [R600_RING_TYPE_DMA_INDEX] = {
1414 .ib_execute = &evergreen_dma_ring_ib_execute,
1415 .emit_fence = &evergreen_dma_fence_ring_emit,
1416 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001417 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001418 .ring_test = &r600_dma_ring_test,
1419 .ib_test = &r600_dma_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001420 .is_lockup = &evergreen_dma_is_lockup,
Christian Königf2ba57b2013-04-08 12:41:29 +02001421 },
1422 [R600_RING_TYPE_UVD_INDEX] = {
1423 .ib_execute = &r600_uvd_ib_execute,
1424 .emit_fence = &r600_uvd_fence_emit,
1425 .emit_semaphore = &r600_uvd_semaphore_emit,
1426 .cs_parse = &radeon_uvd_cs_parse,
1427 .ring_test = &r600_uvd_ring_test,
1428 .ib_test = &r600_uvd_ib_test,
1429 .is_lockup = &radeon_ring_test_lockup,
Christian König4c87bc22011-10-19 19:02:21 +02001430 }
1431 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001432 .irq = {
1433 .set = &evergreen_irq_set,
1434 .process = &evergreen_irq_process,
1435 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001436 .display = {
1437 .bandwidth_update = &evergreen_bandwidth_update,
1438 .get_vblank_counter = &evergreen_get_vblank_counter,
1439 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001440 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001441 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001442 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001443 .copy = {
1444 .blit = &r600_copy_blit,
1445 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001446 .dma = &evergreen_copy_dma,
1447 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001448 .copy = &evergreen_copy_dma,
1449 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001450 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001451 .surface = {
1452 .set_reg = r600_set_surface_reg,
1453 .clear_reg = r600_clear_surface_reg,
1454 },
Alex Deucher901ea572012-02-23 17:53:39 -05001455 .hpd = {
1456 .init = &evergreen_hpd_init,
1457 .fini = &evergreen_hpd_fini,
1458 .sense = &evergreen_hpd_sense,
1459 .set_polarity = &evergreen_hpd_set_polarity,
1460 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001461 .pm = {
1462 .misc = &evergreen_pm_misc,
1463 .prepare = &evergreen_pm_prepare,
1464 .finish = &evergreen_pm_finish,
Alex Deucher27810fb2012-10-01 19:25:11 -04001465 .init_profile = &btc_pm_init_profile,
Alex Deuchera02fa392012-02-23 17:53:41 -05001466 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001467 .get_engine_clock = &radeon_atom_get_engine_clock,
1468 .set_engine_clock = &radeon_atom_set_engine_clock,
1469 .get_memory_clock = &radeon_atom_get_memory_clock,
1470 .set_memory_clock = &radeon_atom_set_memory_clock,
1471 .get_pcie_lanes = NULL,
1472 .set_pcie_lanes = NULL,
1473 .set_clock_gating = NULL,
Alex Deuchera8b49252013-04-08 12:41:33 +02001474 .set_uvd_clocks = &evergreen_set_uvd_clocks,
Alex Deuchera02fa392012-02-23 17:53:41 -05001475 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001476 .pflip = {
1477 .pre_page_flip = &evergreen_pre_page_flip,
1478 .page_flip = &evergreen_page_flip,
1479 .post_page_flip = &evergreen_post_page_flip,
1480 },
Alex Deuchera43b7662011-01-06 21:19:33 -05001481};
1482
Alex Deuchere3487622011-03-02 20:07:36 -05001483static struct radeon_asic cayman_asic = {
1484 .init = &cayman_init,
1485 .fini = &cayman_fini,
1486 .suspend = &cayman_suspend,
1487 .resume = &cayman_resume,
Alex Deuchere3487622011-03-02 20:07:36 -05001488 .asic_reset = &cayman_asic_reset,
1489 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001490 .ioctl_wait_idle = r600_ioctl_wait_idle,
1491 .gui_idle = &r600_gui_idle,
1492 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001493 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001494 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001495 .gart = {
1496 .tlb_flush = &cayman_pcie_gart_tlb_flush,
1497 .set_page = &rs600_gart_set_page,
1498 },
Christian König05b07142012-08-06 20:21:10 +02001499 .vm = {
1500 .init = &cayman_vm_init,
1501 .fini = &cayman_vm_fini,
Alex Deucherdf160042013-01-31 16:26:02 -05001502 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
Christian König05b07142012-08-06 20:21:10 +02001503 .set_page = &cayman_vm_set_page,
1504 },
Christian König4c87bc22011-10-19 19:02:21 +02001505 .ring = {
1506 [RADEON_RING_TYPE_GFX_INDEX] = {
Jerome Glisse721604a2012-01-05 22:11:05 -05001507 .ib_execute = &cayman_ring_ib_execute,
1508 .ib_parse = &evergreen_ib_parse,
Alex Deucherb40e7e12011-11-17 14:57:50 -05001509 .emit_fence = &cayman_fence_ring_emit,
Christian König4c87bc22011-10-19 19:02:21 +02001510 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001511 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001512 .ring_test = &r600_ring_test,
1513 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001514 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001515 .vm_flush = &cayman_vm_flush,
Christian König4c87bc22011-10-19 19:02:21 +02001516 },
1517 [CAYMAN_RING_TYPE_CP1_INDEX] = {
Jerome Glisse721604a2012-01-05 22:11:05 -05001518 .ib_execute = &cayman_ring_ib_execute,
1519 .ib_parse = &evergreen_ib_parse,
Alex Deucherb40e7e12011-11-17 14:57:50 -05001520 .emit_fence = &cayman_fence_ring_emit,
Christian König4c87bc22011-10-19 19:02:21 +02001521 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001522 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001523 .ring_test = &r600_ring_test,
1524 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001525 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001526 .vm_flush = &cayman_vm_flush,
Christian König4c87bc22011-10-19 19:02:21 +02001527 },
1528 [CAYMAN_RING_TYPE_CP2_INDEX] = {
Jerome Glisse721604a2012-01-05 22:11:05 -05001529 .ib_execute = &cayman_ring_ib_execute,
1530 .ib_parse = &evergreen_ib_parse,
Alex Deucherb40e7e12011-11-17 14:57:50 -05001531 .emit_fence = &cayman_fence_ring_emit,
Christian König4c87bc22011-10-19 19:02:21 +02001532 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001533 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001534 .ring_test = &r600_ring_test,
1535 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001536 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001537 .vm_flush = &cayman_vm_flush,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001538 },
1539 [R600_RING_TYPE_DMA_INDEX] = {
1540 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05001541 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001542 .emit_fence = &evergreen_dma_fence_ring_emit,
1543 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001544 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001545 .ring_test = &r600_dma_ring_test,
1546 .ib_test = &r600_dma_ib_test,
1547 .is_lockup = &cayman_dma_is_lockup,
1548 .vm_flush = &cayman_dma_vm_flush,
1549 },
1550 [CAYMAN_RING_TYPE_DMA1_INDEX] = {
1551 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05001552 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001553 .emit_fence = &evergreen_dma_fence_ring_emit,
1554 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001555 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001556 .ring_test = &r600_dma_ring_test,
1557 .ib_test = &r600_dma_ib_test,
1558 .is_lockup = &cayman_dma_is_lockup,
1559 .vm_flush = &cayman_dma_vm_flush,
Christian Königf2ba57b2013-04-08 12:41:29 +02001560 },
1561 [R600_RING_TYPE_UVD_INDEX] = {
1562 .ib_execute = &r600_uvd_ib_execute,
1563 .emit_fence = &r600_uvd_fence_emit,
1564 .emit_semaphore = &cayman_uvd_semaphore_emit,
1565 .cs_parse = &radeon_uvd_cs_parse,
1566 .ring_test = &r600_uvd_ring_test,
1567 .ib_test = &r600_uvd_ib_test,
1568 .is_lockup = &radeon_ring_test_lockup,
Christian König4c87bc22011-10-19 19:02:21 +02001569 }
1570 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001571 .irq = {
1572 .set = &evergreen_irq_set,
1573 .process = &evergreen_irq_process,
1574 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001575 .display = {
1576 .bandwidth_update = &evergreen_bandwidth_update,
1577 .get_vblank_counter = &evergreen_get_vblank_counter,
1578 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001579 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001580 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001581 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001582 .copy = {
1583 .blit = &r600_copy_blit,
1584 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001585 .dma = &evergreen_copy_dma,
1586 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001587 .copy = &evergreen_copy_dma,
1588 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001589 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001590 .surface = {
1591 .set_reg = r600_set_surface_reg,
1592 .clear_reg = r600_clear_surface_reg,
1593 },
Alex Deucher901ea572012-02-23 17:53:39 -05001594 .hpd = {
1595 .init = &evergreen_hpd_init,
1596 .fini = &evergreen_hpd_fini,
1597 .sense = &evergreen_hpd_sense,
1598 .set_polarity = &evergreen_hpd_set_polarity,
1599 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001600 .pm = {
1601 .misc = &evergreen_pm_misc,
1602 .prepare = &evergreen_pm_prepare,
1603 .finish = &evergreen_pm_finish,
Alex Deucher27810fb2012-10-01 19:25:11 -04001604 .init_profile = &btc_pm_init_profile,
Alex Deuchera02fa392012-02-23 17:53:41 -05001605 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001606 .get_engine_clock = &radeon_atom_get_engine_clock,
1607 .set_engine_clock = &radeon_atom_set_engine_clock,
1608 .get_memory_clock = &radeon_atom_get_memory_clock,
1609 .set_memory_clock = &radeon_atom_set_memory_clock,
1610 .get_pcie_lanes = NULL,
1611 .set_pcie_lanes = NULL,
1612 .set_clock_gating = NULL,
Alex Deuchera8b49252013-04-08 12:41:33 +02001613 .set_uvd_clocks = &evergreen_set_uvd_clocks,
Alex Deuchera02fa392012-02-23 17:53:41 -05001614 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001615 .pflip = {
1616 .pre_page_flip = &evergreen_pre_page_flip,
1617 .page_flip = &evergreen_page_flip,
1618 .post_page_flip = &evergreen_post_page_flip,
1619 },
Alex Deuchere3487622011-03-02 20:07:36 -05001620};
1621
Alex Deucherbe63fe82012-03-20 17:18:40 -04001622static struct radeon_asic trinity_asic = {
1623 .init = &cayman_init,
1624 .fini = &cayman_fini,
1625 .suspend = &cayman_suspend,
1626 .resume = &cayman_resume,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001627 .asic_reset = &cayman_asic_reset,
1628 .vga_set_state = &r600_vga_set_state,
1629 .ioctl_wait_idle = r600_ioctl_wait_idle,
1630 .gui_idle = &r600_gui_idle,
1631 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001632 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001633 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001634 .gart = {
1635 .tlb_flush = &cayman_pcie_gart_tlb_flush,
1636 .set_page = &rs600_gart_set_page,
1637 },
Christian König05b07142012-08-06 20:21:10 +02001638 .vm = {
1639 .init = &cayman_vm_init,
1640 .fini = &cayman_vm_fini,
Alex Deucherdf160042013-01-31 16:26:02 -05001641 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
Christian König05b07142012-08-06 20:21:10 +02001642 .set_page = &cayman_vm_set_page,
1643 },
Alex Deucherbe63fe82012-03-20 17:18:40 -04001644 .ring = {
1645 [RADEON_RING_TYPE_GFX_INDEX] = {
1646 .ib_execute = &cayman_ring_ib_execute,
1647 .ib_parse = &evergreen_ib_parse,
1648 .emit_fence = &cayman_fence_ring_emit,
1649 .emit_semaphore = &r600_semaphore_ring_emit,
1650 .cs_parse = &evergreen_cs_parse,
1651 .ring_test = &r600_ring_test,
1652 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001653 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001654 .vm_flush = &cayman_vm_flush,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001655 },
1656 [CAYMAN_RING_TYPE_CP1_INDEX] = {
1657 .ib_execute = &cayman_ring_ib_execute,
1658 .ib_parse = &evergreen_ib_parse,
1659 .emit_fence = &cayman_fence_ring_emit,
1660 .emit_semaphore = &r600_semaphore_ring_emit,
1661 .cs_parse = &evergreen_cs_parse,
1662 .ring_test = &r600_ring_test,
1663 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001664 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001665 .vm_flush = &cayman_vm_flush,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001666 },
1667 [CAYMAN_RING_TYPE_CP2_INDEX] = {
1668 .ib_execute = &cayman_ring_ib_execute,
1669 .ib_parse = &evergreen_ib_parse,
1670 .emit_fence = &cayman_fence_ring_emit,
1671 .emit_semaphore = &r600_semaphore_ring_emit,
1672 .cs_parse = &evergreen_cs_parse,
1673 .ring_test = &r600_ring_test,
1674 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001675 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001676 .vm_flush = &cayman_vm_flush,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001677 },
1678 [R600_RING_TYPE_DMA_INDEX] = {
1679 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05001680 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001681 .emit_fence = &evergreen_dma_fence_ring_emit,
1682 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001683 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001684 .ring_test = &r600_dma_ring_test,
1685 .ib_test = &r600_dma_ib_test,
1686 .is_lockup = &cayman_dma_is_lockup,
1687 .vm_flush = &cayman_dma_vm_flush,
1688 },
1689 [CAYMAN_RING_TYPE_DMA1_INDEX] = {
1690 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05001691 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001692 .emit_fence = &evergreen_dma_fence_ring_emit,
1693 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001694 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001695 .ring_test = &r600_dma_ring_test,
1696 .ib_test = &r600_dma_ib_test,
1697 .is_lockup = &cayman_dma_is_lockup,
1698 .vm_flush = &cayman_dma_vm_flush,
Christian Königf2ba57b2013-04-08 12:41:29 +02001699 },
1700 [R600_RING_TYPE_UVD_INDEX] = {
1701 .ib_execute = &r600_uvd_ib_execute,
1702 .emit_fence = &r600_uvd_fence_emit,
1703 .emit_semaphore = &cayman_uvd_semaphore_emit,
1704 .cs_parse = &radeon_uvd_cs_parse,
1705 .ring_test = &r600_uvd_ring_test,
1706 .ib_test = &r600_uvd_ib_test,
1707 .is_lockup = &radeon_ring_test_lockup,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001708 }
1709 },
1710 .irq = {
1711 .set = &evergreen_irq_set,
1712 .process = &evergreen_irq_process,
1713 },
1714 .display = {
1715 .bandwidth_update = &dce6_bandwidth_update,
1716 .get_vblank_counter = &evergreen_get_vblank_counter,
1717 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001718 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001719 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001720 },
1721 .copy = {
1722 .blit = &r600_copy_blit,
1723 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001724 .dma = &evergreen_copy_dma,
1725 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001726 .copy = &evergreen_copy_dma,
1727 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001728 },
1729 .surface = {
1730 .set_reg = r600_set_surface_reg,
1731 .clear_reg = r600_clear_surface_reg,
1732 },
1733 .hpd = {
1734 .init = &evergreen_hpd_init,
1735 .fini = &evergreen_hpd_fini,
1736 .sense = &evergreen_hpd_sense,
1737 .set_polarity = &evergreen_hpd_set_polarity,
1738 },
1739 .pm = {
1740 .misc = &evergreen_pm_misc,
1741 .prepare = &evergreen_pm_prepare,
1742 .finish = &evergreen_pm_finish,
1743 .init_profile = &sumo_pm_init_profile,
1744 .get_dynpm_state = &r600_pm_get_dynpm_state,
1745 .get_engine_clock = &radeon_atom_get_engine_clock,
1746 .set_engine_clock = &radeon_atom_set_engine_clock,
1747 .get_memory_clock = NULL,
1748 .set_memory_clock = NULL,
1749 .get_pcie_lanes = NULL,
1750 .set_pcie_lanes = NULL,
1751 .set_clock_gating = NULL,
Alex Deucher23d33ba2013-04-08 12:41:32 +02001752 .set_uvd_clocks = &sumo_set_uvd_clocks,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001753 },
1754 .pflip = {
1755 .pre_page_flip = &evergreen_pre_page_flip,
1756 .page_flip = &evergreen_page_flip,
1757 .post_page_flip = &evergreen_post_page_flip,
1758 },
1759};
1760
Alex Deucher02779c02012-03-20 17:18:25 -04001761static struct radeon_asic si_asic = {
1762 .init = &si_init,
1763 .fini = &si_fini,
1764 .suspend = &si_suspend,
1765 .resume = &si_resume,
Alex Deucher02779c02012-03-20 17:18:25 -04001766 .asic_reset = &si_asic_reset,
1767 .vga_set_state = &r600_vga_set_state,
1768 .ioctl_wait_idle = r600_ioctl_wait_idle,
1769 .gui_idle = &r600_gui_idle,
1770 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001771 .get_xclk = &si_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001772 .get_gpu_clock_counter = &si_get_gpu_clock_counter,
Alex Deucher02779c02012-03-20 17:18:25 -04001773 .gart = {
1774 .tlb_flush = &si_pcie_gart_tlb_flush,
1775 .set_page = &rs600_gart_set_page,
1776 },
Christian König05b07142012-08-06 20:21:10 +02001777 .vm = {
1778 .init = &si_vm_init,
1779 .fini = &si_vm_fini,
Alex Deucherdf160042013-01-31 16:26:02 -05001780 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher82ffd922012-10-02 14:47:46 -04001781 .set_page = &si_vm_set_page,
Christian König05b07142012-08-06 20:21:10 +02001782 },
Alex Deucher02779c02012-03-20 17:18:25 -04001783 .ring = {
1784 [RADEON_RING_TYPE_GFX_INDEX] = {
1785 .ib_execute = &si_ring_ib_execute,
1786 .ib_parse = &si_ib_parse,
1787 .emit_fence = &si_fence_ring_emit,
1788 .emit_semaphore = &r600_semaphore_ring_emit,
1789 .cs_parse = NULL,
1790 .ring_test = &r600_ring_test,
1791 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001792 .is_lockup = &si_gfx_is_lockup,
Christian Königee60e292012-08-09 16:21:08 +02001793 .vm_flush = &si_vm_flush,
Alex Deucher02779c02012-03-20 17:18:25 -04001794 },
1795 [CAYMAN_RING_TYPE_CP1_INDEX] = {
1796 .ib_execute = &si_ring_ib_execute,
1797 .ib_parse = &si_ib_parse,
1798 .emit_fence = &si_fence_ring_emit,
1799 .emit_semaphore = &r600_semaphore_ring_emit,
1800 .cs_parse = NULL,
1801 .ring_test = &r600_ring_test,
1802 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001803 .is_lockup = &si_gfx_is_lockup,
Christian Königee60e292012-08-09 16:21:08 +02001804 .vm_flush = &si_vm_flush,
Alex Deucher02779c02012-03-20 17:18:25 -04001805 },
1806 [CAYMAN_RING_TYPE_CP2_INDEX] = {
1807 .ib_execute = &si_ring_ib_execute,
1808 .ib_parse = &si_ib_parse,
1809 .emit_fence = &si_fence_ring_emit,
1810 .emit_semaphore = &r600_semaphore_ring_emit,
1811 .cs_parse = NULL,
1812 .ring_test = &r600_ring_test,
1813 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001814 .is_lockup = &si_gfx_is_lockup,
Christian Königee60e292012-08-09 16:21:08 +02001815 .vm_flush = &si_vm_flush,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05001816 },
1817 [R600_RING_TYPE_DMA_INDEX] = {
1818 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05001819 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05001820 .emit_fence = &evergreen_dma_fence_ring_emit,
1821 .emit_semaphore = &r600_dma_semaphore_ring_emit,
1822 .cs_parse = NULL,
1823 .ring_test = &r600_dma_ring_test,
1824 .ib_test = &r600_dma_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001825 .is_lockup = &si_dma_is_lockup,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05001826 .vm_flush = &si_dma_vm_flush,
1827 },
1828 [CAYMAN_RING_TYPE_DMA1_INDEX] = {
1829 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05001830 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05001831 .emit_fence = &evergreen_dma_fence_ring_emit,
1832 .emit_semaphore = &r600_dma_semaphore_ring_emit,
1833 .cs_parse = NULL,
1834 .ring_test = &r600_dma_ring_test,
1835 .ib_test = &r600_dma_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001836 .is_lockup = &si_dma_is_lockup,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05001837 .vm_flush = &si_dma_vm_flush,
Christian Königf2ba57b2013-04-08 12:41:29 +02001838 },
1839 [R600_RING_TYPE_UVD_INDEX] = {
1840 .ib_execute = &r600_uvd_ib_execute,
1841 .emit_fence = &r600_uvd_fence_emit,
1842 .emit_semaphore = &cayman_uvd_semaphore_emit,
1843 .cs_parse = &radeon_uvd_cs_parse,
1844 .ring_test = &r600_uvd_ring_test,
1845 .ib_test = &r600_uvd_ib_test,
1846 .is_lockup = &radeon_ring_test_lockup,
Alex Deucher02779c02012-03-20 17:18:25 -04001847 }
1848 },
1849 .irq = {
1850 .set = &si_irq_set,
1851 .process = &si_irq_process,
1852 },
1853 .display = {
1854 .bandwidth_update = &dce6_bandwidth_update,
1855 .get_vblank_counter = &evergreen_get_vblank_counter,
1856 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001857 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001858 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucher02779c02012-03-20 17:18:25 -04001859 },
1860 .copy = {
1861 .blit = NULL,
1862 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05001863 .dma = &si_copy_dma,
1864 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001865 .copy = &si_copy_dma,
1866 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher02779c02012-03-20 17:18:25 -04001867 },
1868 .surface = {
1869 .set_reg = r600_set_surface_reg,
1870 .clear_reg = r600_clear_surface_reg,
1871 },
1872 .hpd = {
1873 .init = &evergreen_hpd_init,
1874 .fini = &evergreen_hpd_fini,
1875 .sense = &evergreen_hpd_sense,
1876 .set_polarity = &evergreen_hpd_set_polarity,
1877 },
1878 .pm = {
1879 .misc = &evergreen_pm_misc,
1880 .prepare = &evergreen_pm_prepare,
1881 .finish = &evergreen_pm_finish,
1882 .init_profile = &sumo_pm_init_profile,
1883 .get_dynpm_state = &r600_pm_get_dynpm_state,
1884 .get_engine_clock = &radeon_atom_get_engine_clock,
1885 .set_engine_clock = &radeon_atom_set_engine_clock,
1886 .get_memory_clock = &radeon_atom_get_memory_clock,
1887 .set_memory_clock = &radeon_atom_set_memory_clock,
1888 .get_pcie_lanes = NULL,
1889 .set_pcie_lanes = NULL,
1890 .set_clock_gating = NULL,
Christian König2539eb02013-04-08 12:41:34 +02001891 .set_uvd_clocks = &si_set_uvd_clocks,
Alex Deucher02779c02012-03-20 17:18:25 -04001892 },
1893 .pflip = {
1894 .pre_page_flip = &evergreen_pre_page_flip,
1895 .page_flip = &evergreen_page_flip,
1896 .post_page_flip = &evergreen_post_page_flip,
1897 },
1898};
1899
Alex Deucherabf1dc62012-07-17 14:02:36 -04001900/**
1901 * radeon_asic_init - register asic specific callbacks
1902 *
1903 * @rdev: radeon device pointer
1904 *
1905 * Registers the appropriate asic specific callbacks for each
1906 * chip family. Also sets other asics specific info like the number
1907 * of crtcs and the register aperture accessors (all asics).
1908 * Returns 0 for success.
1909 */
Daniel Vetter0a10c852010-03-11 21:19:14 +00001910int radeon_asic_init(struct radeon_device *rdev)
1911{
1912 radeon_register_accessor_init(rdev);
Alex Deucherba7e05e2011-06-16 18:14:22 +00001913
1914 /* set the number of crtcs */
1915 if (rdev->flags & RADEON_SINGLE_CRTC)
1916 rdev->num_crtc = 1;
1917 else
1918 rdev->num_crtc = 2;
1919
Daniel Vetter0a10c852010-03-11 21:19:14 +00001920 switch (rdev->family) {
1921 case CHIP_R100:
1922 case CHIP_RV100:
1923 case CHIP_RS100:
1924 case CHIP_RV200:
1925 case CHIP_RS200:
1926 rdev->asic = &r100_asic;
1927 break;
1928 case CHIP_R200:
1929 case CHIP_RV250:
1930 case CHIP_RS300:
1931 case CHIP_RV280:
1932 rdev->asic = &r200_asic;
1933 break;
1934 case CHIP_R300:
1935 case CHIP_R350:
1936 case CHIP_RV350:
1937 case CHIP_RV380:
1938 if (rdev->flags & RADEON_IS_PCIE)
1939 rdev->asic = &r300_asic_pcie;
1940 else
1941 rdev->asic = &r300_asic;
1942 break;
1943 case CHIP_R420:
1944 case CHIP_R423:
1945 case CHIP_RV410:
1946 rdev->asic = &r420_asic;
Alex Deucher07bb0842010-06-22 21:58:26 -04001947 /* handle macs */
1948 if (rdev->bios == NULL) {
Alex Deucher798bcf72012-02-23 17:53:48 -05001949 rdev->asic->pm.get_engine_clock = &radeon_legacy_get_engine_clock;
1950 rdev->asic->pm.set_engine_clock = &radeon_legacy_set_engine_clock;
1951 rdev->asic->pm.get_memory_clock = &radeon_legacy_get_memory_clock;
1952 rdev->asic->pm.set_memory_clock = NULL;
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001953 rdev->asic->display.set_backlight_level = &radeon_legacy_set_backlight_level;
Alex Deucher07bb0842010-06-22 21:58:26 -04001954 }
Daniel Vetter0a10c852010-03-11 21:19:14 +00001955 break;
1956 case CHIP_RS400:
1957 case CHIP_RS480:
1958 rdev->asic = &rs400_asic;
1959 break;
1960 case CHIP_RS600:
1961 rdev->asic = &rs600_asic;
1962 break;
1963 case CHIP_RS690:
1964 case CHIP_RS740:
1965 rdev->asic = &rs690_asic;
1966 break;
1967 case CHIP_RV515:
1968 rdev->asic = &rv515_asic;
1969 break;
1970 case CHIP_R520:
1971 case CHIP_RV530:
1972 case CHIP_RV560:
1973 case CHIP_RV570:
1974 case CHIP_R580:
1975 rdev->asic = &r520_asic;
1976 break;
1977 case CHIP_R600:
1978 case CHIP_RV610:
1979 case CHIP_RV630:
1980 case CHIP_RV620:
1981 case CHIP_RV635:
1982 case CHIP_RV670:
Alex Deucherf47299c2010-03-16 20:54:38 -04001983 rdev->asic = &r600_asic;
1984 break;
Daniel Vetter0a10c852010-03-11 21:19:14 +00001985 case CHIP_RS780:
1986 case CHIP_RS880:
Alex Deucherf47299c2010-03-16 20:54:38 -04001987 rdev->asic = &rs780_asic;
Daniel Vetter0a10c852010-03-11 21:19:14 +00001988 break;
1989 case CHIP_RV770:
1990 case CHIP_RV730:
1991 case CHIP_RV710:
1992 case CHIP_RV740:
1993 rdev->asic = &rv770_asic;
1994 break;
1995 case CHIP_CEDAR:
1996 case CHIP_REDWOOD:
1997 case CHIP_JUNIPER:
1998 case CHIP_CYPRESS:
1999 case CHIP_HEMLOCK:
Alex Deucherba7e05e2011-06-16 18:14:22 +00002000 /* set num crtcs */
2001 if (rdev->family == CHIP_CEDAR)
2002 rdev->num_crtc = 4;
2003 else
2004 rdev->num_crtc = 6;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002005 rdev->asic = &evergreen_asic;
2006 break;
Alex Deucher958261d2010-11-22 17:56:30 -05002007 case CHIP_PALM:
Alex Deucher89da5a32011-05-31 15:42:47 -04002008 case CHIP_SUMO:
2009 case CHIP_SUMO2:
Alex Deucher958261d2010-11-22 17:56:30 -05002010 rdev->asic = &sumo_asic;
2011 break;
Alex Deuchera43b7662011-01-06 21:19:33 -05002012 case CHIP_BARTS:
2013 case CHIP_TURKS:
2014 case CHIP_CAICOS:
Alex Deucherba7e05e2011-06-16 18:14:22 +00002015 /* set num crtcs */
2016 if (rdev->family == CHIP_CAICOS)
2017 rdev->num_crtc = 4;
2018 else
2019 rdev->num_crtc = 6;
Alex Deuchera43b7662011-01-06 21:19:33 -05002020 rdev->asic = &btc_asic;
2021 break;
Alex Deuchere3487622011-03-02 20:07:36 -05002022 case CHIP_CAYMAN:
2023 rdev->asic = &cayman_asic;
Alex Deucherba7e05e2011-06-16 18:14:22 +00002024 /* set num crtcs */
2025 rdev->num_crtc = 6;
Alex Deuchere3487622011-03-02 20:07:36 -05002026 break;
Alex Deucherbe63fe82012-03-20 17:18:40 -04002027 case CHIP_ARUBA:
2028 rdev->asic = &trinity_asic;
2029 /* set num crtcs */
2030 rdev->num_crtc = 4;
Alex Deucherbe63fe82012-03-20 17:18:40 -04002031 break;
Alex Deucher02779c02012-03-20 17:18:25 -04002032 case CHIP_TAHITI:
2033 case CHIP_PITCAIRN:
2034 case CHIP_VERDE:
Alex Deuchere737a142012-08-30 14:00:03 -04002035 case CHIP_OLAND:
Alex Deucher02779c02012-03-20 17:18:25 -04002036 rdev->asic = &si_asic;
2037 /* set num crtcs */
Alex Deuchere737a142012-08-30 14:00:03 -04002038 if (rdev->family == CHIP_OLAND)
2039 rdev->num_crtc = 2;
2040 else
2041 rdev->num_crtc = 6;
Alex Deucher02779c02012-03-20 17:18:25 -04002042 break;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002043 default:
2044 /* FIXME: not supported yet */
2045 return -EINVAL;
2046 }
2047
2048 if (rdev->flags & RADEON_IS_IGP) {
Alex Deucher798bcf72012-02-23 17:53:48 -05002049 rdev->asic->pm.get_memory_clock = NULL;
2050 rdev->asic->pm.set_memory_clock = NULL;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002051 }
2052
Daniel Vetter0a10c852010-03-11 21:19:14 +00002053 return 0;
2054}
2055