blob: a6906d4ca734f62b08e2e987f042ada0c8ade3d0 [file] [log] [blame]
Daniel Vetter0a10c852010-03-11 21:19:14 +00001/*
2 * Copyright 2008 Advanced Micro Devices, Inc.
3 * Copyright 2008 Red Hat Inc.
4 * Copyright 2009 Jerome Glisse.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
23 *
24 * Authors: Dave Airlie
25 * Alex Deucher
26 * Jerome Glisse
27 */
28
29#include <linux/console.h>
30#include <drm/drmP.h>
31#include <drm/drm_crtc_helper.h>
32#include <drm/radeon_drm.h>
33#include <linux/vgaarb.h>
34#include <linux/vga_switcheroo.h>
35#include "radeon_reg.h"
36#include "radeon.h"
37#include "radeon_asic.h"
38#include "atom.h"
39
40/*
41 * Registers accessors functions.
42 */
Alex Deucherabf1dc62012-07-17 14:02:36 -040043/**
44 * radeon_invalid_rreg - dummy reg read function
45 *
46 * @rdev: radeon device pointer
47 * @reg: offset of register
48 *
49 * Dummy register read function. Used for register blocks
50 * that certain asics don't have (all asics).
51 * Returns the value in the register.
52 */
Daniel Vetter0a10c852010-03-11 21:19:14 +000053static uint32_t radeon_invalid_rreg(struct radeon_device *rdev, uint32_t reg)
54{
55 DRM_ERROR("Invalid callback to read register 0x%04X\n", reg);
56 BUG_ON(1);
57 return 0;
58}
59
Alex Deucherabf1dc62012-07-17 14:02:36 -040060/**
61 * radeon_invalid_wreg - dummy reg write function
62 *
63 * @rdev: radeon device pointer
64 * @reg: offset of register
65 * @v: value to write to the register
66 *
67 * Dummy register read function. Used for register blocks
68 * that certain asics don't have (all asics).
69 */
Daniel Vetter0a10c852010-03-11 21:19:14 +000070static void radeon_invalid_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
71{
72 DRM_ERROR("Invalid callback to write register 0x%04X with 0x%08X\n",
73 reg, v);
74 BUG_ON(1);
75}
76
Alex Deucherabf1dc62012-07-17 14:02:36 -040077/**
78 * radeon_register_accessor_init - sets up the register accessor callbacks
79 *
80 * @rdev: radeon device pointer
81 *
82 * Sets up the register accessor callbacks for various register
83 * apertures. Not all asics have all apertures (all asics).
84 */
Daniel Vetter0a10c852010-03-11 21:19:14 +000085static void radeon_register_accessor_init(struct radeon_device *rdev)
86{
87 rdev->mc_rreg = &radeon_invalid_rreg;
88 rdev->mc_wreg = &radeon_invalid_wreg;
89 rdev->pll_rreg = &radeon_invalid_rreg;
90 rdev->pll_wreg = &radeon_invalid_wreg;
91 rdev->pciep_rreg = &radeon_invalid_rreg;
92 rdev->pciep_wreg = &radeon_invalid_wreg;
93
94 /* Don't change order as we are overridding accessor. */
95 if (rdev->family < CHIP_RV515) {
96 rdev->pcie_reg_mask = 0xff;
97 } else {
98 rdev->pcie_reg_mask = 0x7ff;
99 }
100 /* FIXME: not sure here */
101 if (rdev->family <= CHIP_R580) {
102 rdev->pll_rreg = &r100_pll_rreg;
103 rdev->pll_wreg = &r100_pll_wreg;
104 }
105 if (rdev->family >= CHIP_R420) {
106 rdev->mc_rreg = &r420_mc_rreg;
107 rdev->mc_wreg = &r420_mc_wreg;
108 }
109 if (rdev->family >= CHIP_RV515) {
110 rdev->mc_rreg = &rv515_mc_rreg;
111 rdev->mc_wreg = &rv515_mc_wreg;
112 }
113 if (rdev->family == CHIP_RS400 || rdev->family == CHIP_RS480) {
114 rdev->mc_rreg = &rs400_mc_rreg;
115 rdev->mc_wreg = &rs400_mc_wreg;
116 }
117 if (rdev->family == CHIP_RS690 || rdev->family == CHIP_RS740) {
118 rdev->mc_rreg = &rs690_mc_rreg;
119 rdev->mc_wreg = &rs690_mc_wreg;
120 }
121 if (rdev->family == CHIP_RS600) {
122 rdev->mc_rreg = &rs600_mc_rreg;
123 rdev->mc_wreg = &rs600_mc_wreg;
124 }
Samuel Li65337e62013-04-05 17:50:53 -0400125 if (rdev->family == CHIP_RS780 || rdev->family == CHIP_RS880) {
126 rdev->mc_rreg = &rs780_mc_rreg;
127 rdev->mc_wreg = &rs780_mc_wreg;
128 }
Alex Deucher6e2c3c02013-04-03 19:28:32 -0400129
130 if (rdev->family >= CHIP_BONAIRE) {
131 rdev->pciep_rreg = &cik_pciep_rreg;
132 rdev->pciep_wreg = &cik_pciep_wreg;
133 } else if (rdev->family >= CHIP_R600) {
Daniel Vetter0a10c852010-03-11 21:19:14 +0000134 rdev->pciep_rreg = &r600_pciep_rreg;
135 rdev->pciep_wreg = &r600_pciep_wreg;
136 }
137}
138
139
140/* helper to disable agp */
Alex Deucherabf1dc62012-07-17 14:02:36 -0400141/**
142 * radeon_agp_disable - AGP disable helper function
143 *
144 * @rdev: radeon device pointer
145 *
146 * Removes AGP flags and changes the gart callbacks on AGP
147 * cards when using the internal gart rather than AGP (all asics).
148 */
Daniel Vetter0a10c852010-03-11 21:19:14 +0000149void radeon_agp_disable(struct radeon_device *rdev)
150{
151 rdev->flags &= ~RADEON_IS_AGP;
152 if (rdev->family >= CHIP_R600) {
153 DRM_INFO("Forcing AGP to PCIE mode\n");
154 rdev->flags |= RADEON_IS_PCIE;
155 } else if (rdev->family >= CHIP_RV515 ||
156 rdev->family == CHIP_RV380 ||
157 rdev->family == CHIP_RV410 ||
158 rdev->family == CHIP_R423) {
159 DRM_INFO("Forcing AGP to PCIE mode\n");
160 rdev->flags |= RADEON_IS_PCIE;
Alex Deucherc5b3b852012-02-23 17:53:46 -0500161 rdev->asic->gart.tlb_flush = &rv370_pcie_gart_tlb_flush;
162 rdev->asic->gart.set_page = &rv370_pcie_gart_set_page;
Daniel Vetter0a10c852010-03-11 21:19:14 +0000163 } else {
164 DRM_INFO("Forcing AGP to PCI mode\n");
165 rdev->flags |= RADEON_IS_PCI;
Alex Deucherc5b3b852012-02-23 17:53:46 -0500166 rdev->asic->gart.tlb_flush = &r100_pci_gart_tlb_flush;
167 rdev->asic->gart.set_page = &r100_pci_gart_set_page;
Daniel Vetter0a10c852010-03-11 21:19:14 +0000168 }
169 rdev->mc.gtt_size = radeon_gart_size * 1024 * 1024;
170}
171
172/*
173 * ASIC
174 */
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000175static struct radeon_asic r100_asic = {
176 .init = &r100_init,
177 .fini = &r100_fini,
178 .suspend = &r100_suspend,
179 .resume = &r100_resume,
180 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000181 .asic_reset = &r100_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500182 .ioctl_wait_idle = NULL,
183 .gui_idle = &r100_gui_idle,
184 .mc_wait_for_idle = &r100_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500185 .gart = {
186 .tlb_flush = &r100_pci_gart_tlb_flush,
187 .set_page = &r100_pci_gart_set_page,
188 },
Christian König4c87bc22011-10-19 19:02:21 +0200189 .ring = {
190 [RADEON_RING_TYPE_GFX_INDEX] = {
191 .ib_execute = &r100_ring_ib_execute,
192 .emit_fence = &r100_fence_ring_emit,
193 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100194 .cs_parse = &r100_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500195 .ring_start = &r100_ring_start,
196 .ring_test = &r100_ring_test,
197 .ib_test = &r100_ib_test,
Christian König312c4a82012-05-02 15:11:09 +0200198 .is_lockup = &r100_gpu_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -0500199 .get_rptr = &radeon_ring_generic_get_rptr,
200 .get_wptr = &radeon_ring_generic_get_wptr,
201 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +0200202 }
203 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500204 .irq = {
205 .set = &r100_irq_set,
206 .process = &r100_irq_process,
207 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500208 .display = {
209 .bandwidth_update = &r100_bandwidth_update,
210 .get_vblank_counter = &r100_get_vblank_counter,
211 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400212 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400213 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500214 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500215 .copy = {
216 .blit = &r100_copy_blit,
217 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
218 .dma = NULL,
219 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
220 .copy = &r100_copy_blit,
221 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
222 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500223 .surface = {
224 .set_reg = r100_set_surface_reg,
225 .clear_reg = r100_clear_surface_reg,
226 },
Alex Deucher901ea572012-02-23 17:53:39 -0500227 .hpd = {
228 .init = &r100_hpd_init,
229 .fini = &r100_hpd_fini,
230 .sense = &r100_hpd_sense,
231 .set_polarity = &r100_hpd_set_polarity,
232 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500233 .pm = {
234 .misc = &r100_pm_misc,
235 .prepare = &r100_pm_prepare,
236 .finish = &r100_pm_finish,
237 .init_profile = &r100_pm_init_profile,
238 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500239 .get_engine_clock = &radeon_legacy_get_engine_clock,
240 .set_engine_clock = &radeon_legacy_set_engine_clock,
241 .get_memory_clock = &radeon_legacy_get_memory_clock,
242 .set_memory_clock = NULL,
243 .get_pcie_lanes = NULL,
244 .set_pcie_lanes = NULL,
245 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500246 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500247 .pflip = {
248 .pre_page_flip = &r100_pre_page_flip,
249 .page_flip = &r100_page_flip,
250 .post_page_flip = &r100_post_page_flip,
251 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000252};
253
254static struct radeon_asic r200_asic = {
255 .init = &r100_init,
256 .fini = &r100_fini,
257 .suspend = &r100_suspend,
258 .resume = &r100_resume,
259 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000260 .asic_reset = &r100_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500261 .ioctl_wait_idle = NULL,
262 .gui_idle = &r100_gui_idle,
263 .mc_wait_for_idle = &r100_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500264 .gart = {
265 .tlb_flush = &r100_pci_gart_tlb_flush,
266 .set_page = &r100_pci_gart_set_page,
267 },
Christian König4c87bc22011-10-19 19:02:21 +0200268 .ring = {
269 [RADEON_RING_TYPE_GFX_INDEX] = {
270 .ib_execute = &r100_ring_ib_execute,
271 .emit_fence = &r100_fence_ring_emit,
272 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100273 .cs_parse = &r100_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500274 .ring_start = &r100_ring_start,
275 .ring_test = &r100_ring_test,
276 .ib_test = &r100_ib_test,
Christian König312c4a82012-05-02 15:11:09 +0200277 .is_lockup = &r100_gpu_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -0500278 .get_rptr = &radeon_ring_generic_get_rptr,
279 .get_wptr = &radeon_ring_generic_get_wptr,
280 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +0200281 }
282 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500283 .irq = {
284 .set = &r100_irq_set,
285 .process = &r100_irq_process,
286 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500287 .display = {
288 .bandwidth_update = &r100_bandwidth_update,
289 .get_vblank_counter = &r100_get_vblank_counter,
290 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400291 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400292 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500293 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500294 .copy = {
295 .blit = &r100_copy_blit,
296 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
297 .dma = &r200_copy_dma,
298 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
299 .copy = &r100_copy_blit,
300 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
301 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500302 .surface = {
303 .set_reg = r100_set_surface_reg,
304 .clear_reg = r100_clear_surface_reg,
305 },
Alex Deucher901ea572012-02-23 17:53:39 -0500306 .hpd = {
307 .init = &r100_hpd_init,
308 .fini = &r100_hpd_fini,
309 .sense = &r100_hpd_sense,
310 .set_polarity = &r100_hpd_set_polarity,
311 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500312 .pm = {
313 .misc = &r100_pm_misc,
314 .prepare = &r100_pm_prepare,
315 .finish = &r100_pm_finish,
316 .init_profile = &r100_pm_init_profile,
317 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500318 .get_engine_clock = &radeon_legacy_get_engine_clock,
319 .set_engine_clock = &radeon_legacy_set_engine_clock,
320 .get_memory_clock = &radeon_legacy_get_memory_clock,
321 .set_memory_clock = NULL,
322 .get_pcie_lanes = NULL,
323 .set_pcie_lanes = NULL,
324 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500325 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500326 .pflip = {
327 .pre_page_flip = &r100_pre_page_flip,
328 .page_flip = &r100_page_flip,
329 .post_page_flip = &r100_post_page_flip,
330 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000331};
332
333static struct radeon_asic r300_asic = {
334 .init = &r300_init,
335 .fini = &r300_fini,
336 .suspend = &r300_suspend,
337 .resume = &r300_resume,
338 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000339 .asic_reset = &r300_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500340 .ioctl_wait_idle = NULL,
341 .gui_idle = &r100_gui_idle,
342 .mc_wait_for_idle = &r300_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500343 .gart = {
344 .tlb_flush = &r100_pci_gart_tlb_flush,
345 .set_page = &r100_pci_gart_set_page,
346 },
Christian König4c87bc22011-10-19 19:02:21 +0200347 .ring = {
348 [RADEON_RING_TYPE_GFX_INDEX] = {
349 .ib_execute = &r100_ring_ib_execute,
350 .emit_fence = &r300_fence_ring_emit,
351 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100352 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500353 .ring_start = &r300_ring_start,
354 .ring_test = &r100_ring_test,
355 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200356 .is_lockup = &r100_gpu_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -0500357 .get_rptr = &radeon_ring_generic_get_rptr,
358 .get_wptr = &radeon_ring_generic_get_wptr,
359 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +0200360 }
361 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500362 .irq = {
363 .set = &r100_irq_set,
364 .process = &r100_irq_process,
365 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500366 .display = {
367 .bandwidth_update = &r100_bandwidth_update,
368 .get_vblank_counter = &r100_get_vblank_counter,
369 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400370 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400371 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500372 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500373 .copy = {
374 .blit = &r100_copy_blit,
375 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
376 .dma = &r200_copy_dma,
377 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
378 .copy = &r100_copy_blit,
379 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
380 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500381 .surface = {
382 .set_reg = r100_set_surface_reg,
383 .clear_reg = r100_clear_surface_reg,
384 },
Alex Deucher901ea572012-02-23 17:53:39 -0500385 .hpd = {
386 .init = &r100_hpd_init,
387 .fini = &r100_hpd_fini,
388 .sense = &r100_hpd_sense,
389 .set_polarity = &r100_hpd_set_polarity,
390 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500391 .pm = {
392 .misc = &r100_pm_misc,
393 .prepare = &r100_pm_prepare,
394 .finish = &r100_pm_finish,
395 .init_profile = &r100_pm_init_profile,
396 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500397 .get_engine_clock = &radeon_legacy_get_engine_clock,
398 .set_engine_clock = &radeon_legacy_set_engine_clock,
399 .get_memory_clock = &radeon_legacy_get_memory_clock,
400 .set_memory_clock = NULL,
401 .get_pcie_lanes = &rv370_get_pcie_lanes,
402 .set_pcie_lanes = &rv370_set_pcie_lanes,
403 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500404 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500405 .pflip = {
406 .pre_page_flip = &r100_pre_page_flip,
407 .page_flip = &r100_page_flip,
408 .post_page_flip = &r100_post_page_flip,
409 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000410};
411
412static struct radeon_asic r300_asic_pcie = {
413 .init = &r300_init,
414 .fini = &r300_fini,
415 .suspend = &r300_suspend,
416 .resume = &r300_resume,
417 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000418 .asic_reset = &r300_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500419 .ioctl_wait_idle = NULL,
420 .gui_idle = &r100_gui_idle,
421 .mc_wait_for_idle = &r300_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500422 .gart = {
423 .tlb_flush = &rv370_pcie_gart_tlb_flush,
424 .set_page = &rv370_pcie_gart_set_page,
425 },
Christian König4c87bc22011-10-19 19:02:21 +0200426 .ring = {
427 [RADEON_RING_TYPE_GFX_INDEX] = {
428 .ib_execute = &r100_ring_ib_execute,
429 .emit_fence = &r300_fence_ring_emit,
430 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100431 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500432 .ring_start = &r300_ring_start,
433 .ring_test = &r100_ring_test,
434 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200435 .is_lockup = &r100_gpu_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -0500436 .get_rptr = &radeon_ring_generic_get_rptr,
437 .get_wptr = &radeon_ring_generic_get_wptr,
438 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +0200439 }
440 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500441 .irq = {
442 .set = &r100_irq_set,
443 .process = &r100_irq_process,
444 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500445 .display = {
446 .bandwidth_update = &r100_bandwidth_update,
447 .get_vblank_counter = &r100_get_vblank_counter,
448 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400449 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400450 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500451 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500452 .copy = {
453 .blit = &r100_copy_blit,
454 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
455 .dma = &r200_copy_dma,
456 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
457 .copy = &r100_copy_blit,
458 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
459 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500460 .surface = {
461 .set_reg = r100_set_surface_reg,
462 .clear_reg = r100_clear_surface_reg,
463 },
Alex Deucher901ea572012-02-23 17:53:39 -0500464 .hpd = {
465 .init = &r100_hpd_init,
466 .fini = &r100_hpd_fini,
467 .sense = &r100_hpd_sense,
468 .set_polarity = &r100_hpd_set_polarity,
469 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500470 .pm = {
471 .misc = &r100_pm_misc,
472 .prepare = &r100_pm_prepare,
473 .finish = &r100_pm_finish,
474 .init_profile = &r100_pm_init_profile,
475 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500476 .get_engine_clock = &radeon_legacy_get_engine_clock,
477 .set_engine_clock = &radeon_legacy_set_engine_clock,
478 .get_memory_clock = &radeon_legacy_get_memory_clock,
479 .set_memory_clock = NULL,
480 .get_pcie_lanes = &rv370_get_pcie_lanes,
481 .set_pcie_lanes = &rv370_set_pcie_lanes,
482 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500483 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500484 .pflip = {
485 .pre_page_flip = &r100_pre_page_flip,
486 .page_flip = &r100_page_flip,
487 .post_page_flip = &r100_post_page_flip,
488 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000489};
490
491static struct radeon_asic r420_asic = {
492 .init = &r420_init,
493 .fini = &r420_fini,
494 .suspend = &r420_suspend,
495 .resume = &r420_resume,
496 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000497 .asic_reset = &r300_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500498 .ioctl_wait_idle = NULL,
499 .gui_idle = &r100_gui_idle,
500 .mc_wait_for_idle = &r300_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500501 .gart = {
502 .tlb_flush = &rv370_pcie_gart_tlb_flush,
503 .set_page = &rv370_pcie_gart_set_page,
504 },
Christian König4c87bc22011-10-19 19:02:21 +0200505 .ring = {
506 [RADEON_RING_TYPE_GFX_INDEX] = {
507 .ib_execute = &r100_ring_ib_execute,
508 .emit_fence = &r300_fence_ring_emit,
509 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100510 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500511 .ring_start = &r300_ring_start,
512 .ring_test = &r100_ring_test,
513 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200514 .is_lockup = &r100_gpu_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -0500515 .get_rptr = &radeon_ring_generic_get_rptr,
516 .get_wptr = &radeon_ring_generic_get_wptr,
517 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +0200518 }
519 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500520 .irq = {
521 .set = &r100_irq_set,
522 .process = &r100_irq_process,
523 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500524 .display = {
525 .bandwidth_update = &r100_bandwidth_update,
526 .get_vblank_counter = &r100_get_vblank_counter,
527 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400528 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400529 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500530 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500531 .copy = {
532 .blit = &r100_copy_blit,
533 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
534 .dma = &r200_copy_dma,
535 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
536 .copy = &r100_copy_blit,
537 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
538 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500539 .surface = {
540 .set_reg = r100_set_surface_reg,
541 .clear_reg = r100_clear_surface_reg,
542 },
Alex Deucher901ea572012-02-23 17:53:39 -0500543 .hpd = {
544 .init = &r100_hpd_init,
545 .fini = &r100_hpd_fini,
546 .sense = &r100_hpd_sense,
547 .set_polarity = &r100_hpd_set_polarity,
548 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500549 .pm = {
550 .misc = &r100_pm_misc,
551 .prepare = &r100_pm_prepare,
552 .finish = &r100_pm_finish,
553 .init_profile = &r420_pm_init_profile,
554 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500555 .get_engine_clock = &radeon_atom_get_engine_clock,
556 .set_engine_clock = &radeon_atom_set_engine_clock,
557 .get_memory_clock = &radeon_atom_get_memory_clock,
558 .set_memory_clock = &radeon_atom_set_memory_clock,
559 .get_pcie_lanes = &rv370_get_pcie_lanes,
560 .set_pcie_lanes = &rv370_set_pcie_lanes,
561 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500562 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500563 .pflip = {
564 .pre_page_flip = &r100_pre_page_flip,
565 .page_flip = &r100_page_flip,
566 .post_page_flip = &r100_post_page_flip,
567 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000568};
569
570static struct radeon_asic rs400_asic = {
571 .init = &rs400_init,
572 .fini = &rs400_fini,
573 .suspend = &rs400_suspend,
574 .resume = &rs400_resume,
575 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000576 .asic_reset = &r300_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500577 .ioctl_wait_idle = NULL,
578 .gui_idle = &r100_gui_idle,
579 .mc_wait_for_idle = &rs400_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500580 .gart = {
581 .tlb_flush = &rs400_gart_tlb_flush,
582 .set_page = &rs400_gart_set_page,
583 },
Christian König4c87bc22011-10-19 19:02:21 +0200584 .ring = {
585 [RADEON_RING_TYPE_GFX_INDEX] = {
586 .ib_execute = &r100_ring_ib_execute,
587 .emit_fence = &r300_fence_ring_emit,
588 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100589 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500590 .ring_start = &r300_ring_start,
591 .ring_test = &r100_ring_test,
592 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200593 .is_lockup = &r100_gpu_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -0500594 .get_rptr = &radeon_ring_generic_get_rptr,
595 .get_wptr = &radeon_ring_generic_get_wptr,
596 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +0200597 }
598 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500599 .irq = {
600 .set = &r100_irq_set,
601 .process = &r100_irq_process,
602 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500603 .display = {
604 .bandwidth_update = &r100_bandwidth_update,
605 .get_vblank_counter = &r100_get_vblank_counter,
606 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400607 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400608 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500609 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500610 .copy = {
611 .blit = &r100_copy_blit,
612 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
613 .dma = &r200_copy_dma,
614 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
615 .copy = &r100_copy_blit,
616 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
617 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500618 .surface = {
619 .set_reg = r100_set_surface_reg,
620 .clear_reg = r100_clear_surface_reg,
621 },
Alex Deucher901ea572012-02-23 17:53:39 -0500622 .hpd = {
623 .init = &r100_hpd_init,
624 .fini = &r100_hpd_fini,
625 .sense = &r100_hpd_sense,
626 .set_polarity = &r100_hpd_set_polarity,
627 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500628 .pm = {
629 .misc = &r100_pm_misc,
630 .prepare = &r100_pm_prepare,
631 .finish = &r100_pm_finish,
632 .init_profile = &r100_pm_init_profile,
633 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500634 .get_engine_clock = &radeon_legacy_get_engine_clock,
635 .set_engine_clock = &radeon_legacy_set_engine_clock,
636 .get_memory_clock = &radeon_legacy_get_memory_clock,
637 .set_memory_clock = NULL,
638 .get_pcie_lanes = NULL,
639 .set_pcie_lanes = NULL,
640 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500641 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500642 .pflip = {
643 .pre_page_flip = &r100_pre_page_flip,
644 .page_flip = &r100_page_flip,
645 .post_page_flip = &r100_post_page_flip,
646 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000647};
648
649static struct radeon_asic rs600_asic = {
650 .init = &rs600_init,
651 .fini = &rs600_fini,
652 .suspend = &rs600_suspend,
653 .resume = &rs600_resume,
654 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000655 .asic_reset = &rs600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500656 .ioctl_wait_idle = NULL,
657 .gui_idle = &r100_gui_idle,
658 .mc_wait_for_idle = &rs600_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500659 .gart = {
660 .tlb_flush = &rs600_gart_tlb_flush,
661 .set_page = &rs600_gart_set_page,
662 },
Christian König4c87bc22011-10-19 19:02:21 +0200663 .ring = {
664 [RADEON_RING_TYPE_GFX_INDEX] = {
665 .ib_execute = &r100_ring_ib_execute,
666 .emit_fence = &r300_fence_ring_emit,
667 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100668 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500669 .ring_start = &r300_ring_start,
670 .ring_test = &r100_ring_test,
671 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200672 .is_lockup = &r100_gpu_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -0500673 .get_rptr = &radeon_ring_generic_get_rptr,
674 .get_wptr = &radeon_ring_generic_get_wptr,
675 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +0200676 }
677 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500678 .irq = {
679 .set = &rs600_irq_set,
680 .process = &rs600_irq_process,
681 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500682 .display = {
683 .bandwidth_update = &rs600_bandwidth_update,
684 .get_vblank_counter = &rs600_get_vblank_counter,
685 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400686 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400687 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -0400688 .hdmi_enable = &r600_hdmi_enable,
689 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500690 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500691 .copy = {
692 .blit = &r100_copy_blit,
693 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
694 .dma = &r200_copy_dma,
695 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
696 .copy = &r100_copy_blit,
697 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
698 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500699 .surface = {
700 .set_reg = r100_set_surface_reg,
701 .clear_reg = r100_clear_surface_reg,
702 },
Alex Deucher901ea572012-02-23 17:53:39 -0500703 .hpd = {
704 .init = &rs600_hpd_init,
705 .fini = &rs600_hpd_fini,
706 .sense = &rs600_hpd_sense,
707 .set_polarity = &rs600_hpd_set_polarity,
708 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500709 .pm = {
710 .misc = &rs600_pm_misc,
711 .prepare = &rs600_pm_prepare,
712 .finish = &rs600_pm_finish,
713 .init_profile = &r420_pm_init_profile,
714 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500715 .get_engine_clock = &radeon_atom_get_engine_clock,
716 .set_engine_clock = &radeon_atom_set_engine_clock,
717 .get_memory_clock = &radeon_atom_get_memory_clock,
718 .set_memory_clock = &radeon_atom_set_memory_clock,
719 .get_pcie_lanes = NULL,
720 .set_pcie_lanes = NULL,
721 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500722 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500723 .pflip = {
724 .pre_page_flip = &rs600_pre_page_flip,
725 .page_flip = &rs600_page_flip,
726 .post_page_flip = &rs600_post_page_flip,
727 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000728};
729
730static struct radeon_asic rs690_asic = {
731 .init = &rs690_init,
732 .fini = &rs690_fini,
733 .suspend = &rs690_suspend,
734 .resume = &rs690_resume,
735 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000736 .asic_reset = &rs600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500737 .ioctl_wait_idle = NULL,
738 .gui_idle = &r100_gui_idle,
739 .mc_wait_for_idle = &rs690_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500740 .gart = {
741 .tlb_flush = &rs400_gart_tlb_flush,
742 .set_page = &rs400_gart_set_page,
743 },
Christian König4c87bc22011-10-19 19:02:21 +0200744 .ring = {
745 [RADEON_RING_TYPE_GFX_INDEX] = {
746 .ib_execute = &r100_ring_ib_execute,
747 .emit_fence = &r300_fence_ring_emit,
748 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100749 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500750 .ring_start = &r300_ring_start,
751 .ring_test = &r100_ring_test,
752 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200753 .is_lockup = &r100_gpu_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -0500754 .get_rptr = &radeon_ring_generic_get_rptr,
755 .get_wptr = &radeon_ring_generic_get_wptr,
756 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +0200757 }
758 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500759 .irq = {
760 .set = &rs600_irq_set,
761 .process = &rs600_irq_process,
762 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500763 .display = {
764 .get_vblank_counter = &rs600_get_vblank_counter,
765 .bandwidth_update = &rs690_bandwidth_update,
766 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400767 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400768 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -0400769 .hdmi_enable = &r600_hdmi_enable,
770 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500771 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500772 .copy = {
773 .blit = &r100_copy_blit,
774 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
775 .dma = &r200_copy_dma,
776 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
777 .copy = &r200_copy_dma,
778 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
779 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500780 .surface = {
781 .set_reg = r100_set_surface_reg,
782 .clear_reg = r100_clear_surface_reg,
783 },
Alex Deucher901ea572012-02-23 17:53:39 -0500784 .hpd = {
785 .init = &rs600_hpd_init,
786 .fini = &rs600_hpd_fini,
787 .sense = &rs600_hpd_sense,
788 .set_polarity = &rs600_hpd_set_polarity,
789 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500790 .pm = {
791 .misc = &rs600_pm_misc,
792 .prepare = &rs600_pm_prepare,
793 .finish = &rs600_pm_finish,
794 .init_profile = &r420_pm_init_profile,
795 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500796 .get_engine_clock = &radeon_atom_get_engine_clock,
797 .set_engine_clock = &radeon_atom_set_engine_clock,
798 .get_memory_clock = &radeon_atom_get_memory_clock,
799 .set_memory_clock = &radeon_atom_set_memory_clock,
800 .get_pcie_lanes = NULL,
801 .set_pcie_lanes = NULL,
802 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500803 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500804 .pflip = {
805 .pre_page_flip = &rs600_pre_page_flip,
806 .page_flip = &rs600_page_flip,
807 .post_page_flip = &rs600_post_page_flip,
808 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000809};
810
811static struct radeon_asic rv515_asic = {
812 .init = &rv515_init,
813 .fini = &rv515_fini,
814 .suspend = &rv515_suspend,
815 .resume = &rv515_resume,
816 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000817 .asic_reset = &rs600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500818 .ioctl_wait_idle = NULL,
819 .gui_idle = &r100_gui_idle,
820 .mc_wait_for_idle = &rv515_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500821 .gart = {
822 .tlb_flush = &rv370_pcie_gart_tlb_flush,
823 .set_page = &rv370_pcie_gart_set_page,
824 },
Christian König4c87bc22011-10-19 19:02:21 +0200825 .ring = {
826 [RADEON_RING_TYPE_GFX_INDEX] = {
827 .ib_execute = &r100_ring_ib_execute,
828 .emit_fence = &r300_fence_ring_emit,
829 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100830 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500831 .ring_start = &rv515_ring_start,
832 .ring_test = &r100_ring_test,
833 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200834 .is_lockup = &r100_gpu_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -0500835 .get_rptr = &radeon_ring_generic_get_rptr,
836 .get_wptr = &radeon_ring_generic_get_wptr,
837 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +0200838 }
839 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500840 .irq = {
841 .set = &rs600_irq_set,
842 .process = &rs600_irq_process,
843 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500844 .display = {
845 .get_vblank_counter = &rs600_get_vblank_counter,
846 .bandwidth_update = &rv515_bandwidth_update,
847 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400848 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400849 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500850 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500851 .copy = {
852 .blit = &r100_copy_blit,
853 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
854 .dma = &r200_copy_dma,
855 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
856 .copy = &r100_copy_blit,
857 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
858 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500859 .surface = {
860 .set_reg = r100_set_surface_reg,
861 .clear_reg = r100_clear_surface_reg,
862 },
Alex Deucher901ea572012-02-23 17:53:39 -0500863 .hpd = {
864 .init = &rs600_hpd_init,
865 .fini = &rs600_hpd_fini,
866 .sense = &rs600_hpd_sense,
867 .set_polarity = &rs600_hpd_set_polarity,
868 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500869 .pm = {
870 .misc = &rs600_pm_misc,
871 .prepare = &rs600_pm_prepare,
872 .finish = &rs600_pm_finish,
873 .init_profile = &r420_pm_init_profile,
874 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500875 .get_engine_clock = &radeon_atom_get_engine_clock,
876 .set_engine_clock = &radeon_atom_set_engine_clock,
877 .get_memory_clock = &radeon_atom_get_memory_clock,
878 .set_memory_clock = &radeon_atom_set_memory_clock,
879 .get_pcie_lanes = &rv370_get_pcie_lanes,
880 .set_pcie_lanes = &rv370_set_pcie_lanes,
881 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500882 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500883 .pflip = {
884 .pre_page_flip = &rs600_pre_page_flip,
885 .page_flip = &rs600_page_flip,
886 .post_page_flip = &rs600_post_page_flip,
887 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000888};
889
890static struct radeon_asic r520_asic = {
891 .init = &r520_init,
892 .fini = &rv515_fini,
893 .suspend = &rv515_suspend,
894 .resume = &r520_resume,
895 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000896 .asic_reset = &rs600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500897 .ioctl_wait_idle = NULL,
898 .gui_idle = &r100_gui_idle,
899 .mc_wait_for_idle = &r520_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500900 .gart = {
901 .tlb_flush = &rv370_pcie_gart_tlb_flush,
902 .set_page = &rv370_pcie_gart_set_page,
903 },
Christian König4c87bc22011-10-19 19:02:21 +0200904 .ring = {
905 [RADEON_RING_TYPE_GFX_INDEX] = {
906 .ib_execute = &r100_ring_ib_execute,
907 .emit_fence = &r300_fence_ring_emit,
908 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100909 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500910 .ring_start = &rv515_ring_start,
911 .ring_test = &r100_ring_test,
912 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200913 .is_lockup = &r100_gpu_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -0500914 .get_rptr = &radeon_ring_generic_get_rptr,
915 .get_wptr = &radeon_ring_generic_get_wptr,
916 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +0200917 }
918 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500919 .irq = {
920 .set = &rs600_irq_set,
921 .process = &rs600_irq_process,
922 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500923 .display = {
924 .bandwidth_update = &rv515_bandwidth_update,
925 .get_vblank_counter = &rs600_get_vblank_counter,
926 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400927 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400928 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500929 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500930 .copy = {
931 .blit = &r100_copy_blit,
932 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
933 .dma = &r200_copy_dma,
934 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
935 .copy = &r100_copy_blit,
936 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
937 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500938 .surface = {
939 .set_reg = r100_set_surface_reg,
940 .clear_reg = r100_clear_surface_reg,
941 },
Alex Deucher901ea572012-02-23 17:53:39 -0500942 .hpd = {
943 .init = &rs600_hpd_init,
944 .fini = &rs600_hpd_fini,
945 .sense = &rs600_hpd_sense,
946 .set_polarity = &rs600_hpd_set_polarity,
947 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500948 .pm = {
949 .misc = &rs600_pm_misc,
950 .prepare = &rs600_pm_prepare,
951 .finish = &rs600_pm_finish,
952 .init_profile = &r420_pm_init_profile,
953 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500954 .get_engine_clock = &radeon_atom_get_engine_clock,
955 .set_engine_clock = &radeon_atom_set_engine_clock,
956 .get_memory_clock = &radeon_atom_get_memory_clock,
957 .set_memory_clock = &radeon_atom_set_memory_clock,
958 .get_pcie_lanes = &rv370_get_pcie_lanes,
959 .set_pcie_lanes = &rv370_set_pcie_lanes,
960 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500961 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500962 .pflip = {
963 .pre_page_flip = &rs600_pre_page_flip,
964 .page_flip = &rs600_page_flip,
965 .post_page_flip = &rs600_post_page_flip,
966 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000967};
968
969static struct radeon_asic r600_asic = {
970 .init = &r600_init,
971 .fini = &r600_fini,
972 .suspend = &r600_suspend,
973 .resume = &r600_resume,
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000974 .vga_set_state = &r600_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000975 .asic_reset = &r600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500976 .ioctl_wait_idle = r600_ioctl_wait_idle,
977 .gui_idle = &r600_gui_idle,
978 .mc_wait_for_idle = &r600_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -0500979 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -0500980 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500981 .gart = {
982 .tlb_flush = &r600_pcie_gart_tlb_flush,
983 .set_page = &rs600_gart_set_page,
984 },
Christian König4c87bc22011-10-19 19:02:21 +0200985 .ring = {
986 [RADEON_RING_TYPE_GFX_INDEX] = {
987 .ib_execute = &r600_ring_ib_execute,
988 .emit_fence = &r600_fence_ring_emit,
989 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100990 .cs_parse = &r600_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500991 .ring_test = &r600_ring_test,
992 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -0500993 .is_lockup = &r600_gfx_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -0500994 .get_rptr = &radeon_ring_generic_get_rptr,
995 .get_wptr = &radeon_ring_generic_get_wptr,
996 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher4d756582012-09-27 15:08:35 -0400997 },
998 [R600_RING_TYPE_DMA_INDEX] = {
999 .ib_execute = &r600_dma_ring_ib_execute,
1000 .emit_fence = &r600_dma_fence_ring_emit,
1001 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deuchercf4ccd02011-11-18 10:19:47 -05001002 .cs_parse = &r600_dma_cs_parse,
Alex Deucher4d756582012-09-27 15:08:35 -04001003 .ring_test = &r600_dma_ring_test,
1004 .ib_test = &r600_dma_ib_test,
1005 .is_lockup = &r600_dma_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001006 .get_rptr = &radeon_ring_generic_get_rptr,
1007 .get_wptr = &radeon_ring_generic_get_wptr,
1008 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +02001009 }
1010 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001011 .irq = {
1012 .set = &r600_irq_set,
1013 .process = &r600_irq_process,
1014 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001015 .display = {
1016 .bandwidth_update = &rv515_bandwidth_update,
1017 .get_vblank_counter = &rs600_get_vblank_counter,
1018 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001019 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001020 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001021 .hdmi_enable = &r600_hdmi_enable,
1022 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001023 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001024 .copy = {
1025 .blit = &r600_copy_blit,
1026 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher4d756582012-09-27 15:08:35 -04001027 .dma = &r600_copy_dma,
1028 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001029 .copy = &r600_copy_dma,
1030 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001031 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001032 .surface = {
1033 .set_reg = r600_set_surface_reg,
1034 .clear_reg = r600_clear_surface_reg,
1035 },
Alex Deucher901ea572012-02-23 17:53:39 -05001036 .hpd = {
1037 .init = &r600_hpd_init,
1038 .fini = &r600_hpd_fini,
1039 .sense = &r600_hpd_sense,
1040 .set_polarity = &r600_hpd_set_polarity,
1041 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001042 .pm = {
1043 .misc = &r600_pm_misc,
1044 .prepare = &rs600_pm_prepare,
1045 .finish = &rs600_pm_finish,
1046 .init_profile = &r600_pm_init_profile,
1047 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001048 .get_engine_clock = &radeon_atom_get_engine_clock,
1049 .set_engine_clock = &radeon_atom_set_engine_clock,
1050 .get_memory_clock = &radeon_atom_get_memory_clock,
1051 .set_memory_clock = &radeon_atom_set_memory_clock,
1052 .get_pcie_lanes = &r600_get_pcie_lanes,
1053 .set_pcie_lanes = &r600_set_pcie_lanes,
1054 .set_clock_gating = NULL,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001055 .get_temperature = &rv6xx_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001056 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001057 .pflip = {
1058 .pre_page_flip = &rs600_pre_page_flip,
1059 .page_flip = &rs600_page_flip,
1060 .post_page_flip = &rs600_post_page_flip,
1061 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001062};
1063
Alex Deucherca361b62013-06-21 14:42:08 -04001064static struct radeon_asic rv6xx_asic = {
1065 .init = &r600_init,
1066 .fini = &r600_fini,
1067 .suspend = &r600_suspend,
1068 .resume = &r600_resume,
1069 .vga_set_state = &r600_vga_set_state,
1070 .asic_reset = &r600_asic_reset,
1071 .ioctl_wait_idle = r600_ioctl_wait_idle,
1072 .gui_idle = &r600_gui_idle,
1073 .mc_wait_for_idle = &r600_mc_wait_for_idle,
1074 .get_xclk = &r600_get_xclk,
1075 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
1076 .gart = {
1077 .tlb_flush = &r600_pcie_gart_tlb_flush,
1078 .set_page = &rs600_gart_set_page,
1079 },
1080 .ring = {
1081 [RADEON_RING_TYPE_GFX_INDEX] = {
1082 .ib_execute = &r600_ring_ib_execute,
1083 .emit_fence = &r600_fence_ring_emit,
1084 .emit_semaphore = &r600_semaphore_ring_emit,
1085 .cs_parse = &r600_cs_parse,
1086 .ring_test = &r600_ring_test,
1087 .ib_test = &r600_ib_test,
1088 .is_lockup = &r600_gfx_is_lockup,
1089 .get_rptr = &radeon_ring_generic_get_rptr,
1090 .get_wptr = &radeon_ring_generic_get_wptr,
1091 .set_wptr = &radeon_ring_generic_set_wptr,
1092 },
1093 [R600_RING_TYPE_DMA_INDEX] = {
1094 .ib_execute = &r600_dma_ring_ib_execute,
1095 .emit_fence = &r600_dma_fence_ring_emit,
1096 .emit_semaphore = &r600_dma_semaphore_ring_emit,
1097 .cs_parse = &r600_dma_cs_parse,
1098 .ring_test = &r600_dma_ring_test,
1099 .ib_test = &r600_dma_ib_test,
1100 .is_lockup = &r600_dma_is_lockup,
1101 .get_rptr = &radeon_ring_generic_get_rptr,
1102 .get_wptr = &radeon_ring_generic_get_wptr,
1103 .set_wptr = &radeon_ring_generic_set_wptr,
1104 }
1105 },
1106 .irq = {
1107 .set = &r600_irq_set,
1108 .process = &r600_irq_process,
1109 },
1110 .display = {
1111 .bandwidth_update = &rv515_bandwidth_update,
1112 .get_vblank_counter = &rs600_get_vblank_counter,
1113 .wait_for_vblank = &avivo_wait_for_vblank,
1114 .set_backlight_level = &atombios_set_backlight_level,
1115 .get_backlight_level = &atombios_get_backlight_level,
1116 },
1117 .copy = {
1118 .blit = &r600_copy_blit,
1119 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
1120 .dma = &r600_copy_dma,
1121 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
1122 .copy = &r600_copy_dma,
1123 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
1124 },
1125 .surface = {
1126 .set_reg = r600_set_surface_reg,
1127 .clear_reg = r600_clear_surface_reg,
1128 },
1129 .hpd = {
1130 .init = &r600_hpd_init,
1131 .fini = &r600_hpd_fini,
1132 .sense = &r600_hpd_sense,
1133 .set_polarity = &r600_hpd_set_polarity,
1134 },
1135 .pm = {
1136 .misc = &r600_pm_misc,
1137 .prepare = &rs600_pm_prepare,
1138 .finish = &rs600_pm_finish,
1139 .init_profile = &r600_pm_init_profile,
1140 .get_dynpm_state = &r600_pm_get_dynpm_state,
1141 .get_engine_clock = &radeon_atom_get_engine_clock,
1142 .set_engine_clock = &radeon_atom_set_engine_clock,
1143 .get_memory_clock = &radeon_atom_get_memory_clock,
1144 .set_memory_clock = &radeon_atom_set_memory_clock,
1145 .get_pcie_lanes = &r600_get_pcie_lanes,
1146 .set_pcie_lanes = &r600_set_pcie_lanes,
1147 .set_clock_gating = NULL,
1148 .get_temperature = &rv6xx_get_temp,
1149 },
Alex Deucher4a6369e2013-04-12 14:04:10 -04001150 .dpm = {
1151 .init = &rv6xx_dpm_init,
1152 .setup_asic = &rv6xx_setup_asic,
1153 .enable = &rv6xx_dpm_enable,
1154 .disable = &rv6xx_dpm_disable,
Alex Deucher98243912013-01-16 13:13:42 -05001155 .pre_set_power_state = &r600_dpm_pre_set_power_state,
Alex Deucher4a6369e2013-04-12 14:04:10 -04001156 .set_power_state = &rv6xx_dpm_set_power_state,
Alex Deucher98243912013-01-16 13:13:42 -05001157 .post_set_power_state = &r600_dpm_post_set_power_state,
Alex Deucher4a6369e2013-04-12 14:04:10 -04001158 .display_configuration_changed = &rv6xx_dpm_display_configuration_changed,
1159 .fini = &rv6xx_dpm_fini,
1160 .get_sclk = &rv6xx_dpm_get_sclk,
1161 .get_mclk = &rv6xx_dpm_get_mclk,
1162 .print_power_state = &rv6xx_dpm_print_power_state,
Alex Deucher242916a2013-06-28 14:20:53 -04001163 .debugfs_print_current_performance_level = &rv6xx_dpm_debugfs_print_current_performance_level,
Alex Deucher4a6369e2013-04-12 14:04:10 -04001164 },
Alex Deucherca361b62013-06-21 14:42:08 -04001165 .pflip = {
1166 .pre_page_flip = &rs600_pre_page_flip,
1167 .page_flip = &rs600_page_flip,
1168 .post_page_flip = &rs600_post_page_flip,
1169 },
1170};
1171
Alex Deucherf47299c2010-03-16 20:54:38 -04001172static struct radeon_asic rs780_asic = {
1173 .init = &r600_init,
1174 .fini = &r600_fini,
1175 .suspend = &r600_suspend,
1176 .resume = &r600_resume,
Alex Deucherf47299c2010-03-16 20:54:38 -04001177 .vga_set_state = &r600_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +00001178 .asic_reset = &r600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -05001179 .ioctl_wait_idle = r600_ioctl_wait_idle,
1180 .gui_idle = &r600_gui_idle,
1181 .mc_wait_for_idle = &r600_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001182 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001183 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001184 .gart = {
1185 .tlb_flush = &r600_pcie_gart_tlb_flush,
1186 .set_page = &rs600_gart_set_page,
1187 },
Christian König4c87bc22011-10-19 19:02:21 +02001188 .ring = {
1189 [RADEON_RING_TYPE_GFX_INDEX] = {
1190 .ib_execute = &r600_ring_ib_execute,
1191 .emit_fence = &r600_fence_ring_emit,
1192 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001193 .cs_parse = &r600_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001194 .ring_test = &r600_ring_test,
1195 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001196 .is_lockup = &r600_gfx_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001197 .get_rptr = &radeon_ring_generic_get_rptr,
1198 .get_wptr = &radeon_ring_generic_get_wptr,
1199 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher4d756582012-09-27 15:08:35 -04001200 },
1201 [R600_RING_TYPE_DMA_INDEX] = {
1202 .ib_execute = &r600_dma_ring_ib_execute,
1203 .emit_fence = &r600_dma_fence_ring_emit,
1204 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deuchercf4ccd02011-11-18 10:19:47 -05001205 .cs_parse = &r600_dma_cs_parse,
Alex Deucher4d756582012-09-27 15:08:35 -04001206 .ring_test = &r600_dma_ring_test,
1207 .ib_test = &r600_dma_ib_test,
1208 .is_lockup = &r600_dma_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001209 .get_rptr = &radeon_ring_generic_get_rptr,
1210 .get_wptr = &radeon_ring_generic_get_wptr,
1211 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +02001212 }
1213 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001214 .irq = {
1215 .set = &r600_irq_set,
1216 .process = &r600_irq_process,
1217 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001218 .display = {
1219 .bandwidth_update = &rs690_bandwidth_update,
1220 .get_vblank_counter = &rs600_get_vblank_counter,
1221 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001222 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001223 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001224 .hdmi_enable = &r600_hdmi_enable,
1225 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001226 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001227 .copy = {
1228 .blit = &r600_copy_blit,
1229 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher4d756582012-09-27 15:08:35 -04001230 .dma = &r600_copy_dma,
1231 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001232 .copy = &r600_copy_dma,
1233 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001234 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001235 .surface = {
1236 .set_reg = r600_set_surface_reg,
1237 .clear_reg = r600_clear_surface_reg,
1238 },
Alex Deucher901ea572012-02-23 17:53:39 -05001239 .hpd = {
1240 .init = &r600_hpd_init,
1241 .fini = &r600_hpd_fini,
1242 .sense = &r600_hpd_sense,
1243 .set_polarity = &r600_hpd_set_polarity,
1244 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001245 .pm = {
1246 .misc = &r600_pm_misc,
1247 .prepare = &rs600_pm_prepare,
1248 .finish = &rs600_pm_finish,
1249 .init_profile = &rs780_pm_init_profile,
1250 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001251 .get_engine_clock = &radeon_atom_get_engine_clock,
1252 .set_engine_clock = &radeon_atom_set_engine_clock,
1253 .get_memory_clock = NULL,
1254 .set_memory_clock = NULL,
1255 .get_pcie_lanes = NULL,
1256 .set_pcie_lanes = NULL,
1257 .set_clock_gating = NULL,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001258 .get_temperature = &rv6xx_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001259 },
Alex Deucher9d670062013-04-12 13:59:22 -04001260 .dpm = {
1261 .init = &rs780_dpm_init,
1262 .setup_asic = &rs780_dpm_setup_asic,
1263 .enable = &rs780_dpm_enable,
1264 .disable = &rs780_dpm_disable,
Alex Deucher98243912013-01-16 13:13:42 -05001265 .pre_set_power_state = &r600_dpm_pre_set_power_state,
Alex Deucher9d670062013-04-12 13:59:22 -04001266 .set_power_state = &rs780_dpm_set_power_state,
Alex Deucher98243912013-01-16 13:13:42 -05001267 .post_set_power_state = &r600_dpm_post_set_power_state,
Alex Deucher9d670062013-04-12 13:59:22 -04001268 .display_configuration_changed = &rs780_dpm_display_configuration_changed,
1269 .fini = &rs780_dpm_fini,
1270 .get_sclk = &rs780_dpm_get_sclk,
1271 .get_mclk = &rs780_dpm_get_mclk,
1272 .print_power_state = &rs780_dpm_print_power_state,
1273 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001274 .pflip = {
1275 .pre_page_flip = &rs600_pre_page_flip,
1276 .page_flip = &rs600_page_flip,
1277 .post_page_flip = &rs600_post_page_flip,
1278 },
Alex Deucherf47299c2010-03-16 20:54:38 -04001279};
1280
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001281static struct radeon_asic rv770_asic = {
1282 .init = &rv770_init,
1283 .fini = &rv770_fini,
1284 .suspend = &rv770_suspend,
1285 .resume = &rv770_resume,
Jerome Glissea2d07b72010-03-09 14:45:11 +00001286 .asic_reset = &r600_asic_reset,
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001287 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001288 .ioctl_wait_idle = r600_ioctl_wait_idle,
1289 .gui_idle = &r600_gui_idle,
1290 .mc_wait_for_idle = &r600_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001291 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001292 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001293 .gart = {
1294 .tlb_flush = &r600_pcie_gart_tlb_flush,
1295 .set_page = &rs600_gart_set_page,
1296 },
Christian König4c87bc22011-10-19 19:02:21 +02001297 .ring = {
1298 [RADEON_RING_TYPE_GFX_INDEX] = {
1299 .ib_execute = &r600_ring_ib_execute,
1300 .emit_fence = &r600_fence_ring_emit,
1301 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001302 .cs_parse = &r600_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001303 .ring_test = &r600_ring_test,
1304 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001305 .is_lockup = &r600_gfx_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001306 .get_rptr = &radeon_ring_generic_get_rptr,
1307 .get_wptr = &radeon_ring_generic_get_wptr,
1308 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher4d756582012-09-27 15:08:35 -04001309 },
1310 [R600_RING_TYPE_DMA_INDEX] = {
1311 .ib_execute = &r600_dma_ring_ib_execute,
1312 .emit_fence = &r600_dma_fence_ring_emit,
1313 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deuchercf4ccd02011-11-18 10:19:47 -05001314 .cs_parse = &r600_dma_cs_parse,
Alex Deucher4d756582012-09-27 15:08:35 -04001315 .ring_test = &r600_dma_ring_test,
1316 .ib_test = &r600_dma_ib_test,
1317 .is_lockup = &r600_dma_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001318 .get_rptr = &radeon_ring_generic_get_rptr,
1319 .get_wptr = &radeon_ring_generic_get_wptr,
1320 .set_wptr = &radeon_ring_generic_set_wptr,
Christian Königf2ba57b2013-04-08 12:41:29 +02001321 },
1322 [R600_RING_TYPE_UVD_INDEX] = {
1323 .ib_execute = &r600_uvd_ib_execute,
1324 .emit_fence = &r600_uvd_fence_emit,
1325 .emit_semaphore = &r600_uvd_semaphore_emit,
1326 .cs_parse = &radeon_uvd_cs_parse,
1327 .ring_test = &r600_uvd_ring_test,
1328 .ib_test = &r600_uvd_ib_test,
1329 .is_lockup = &radeon_ring_test_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001330 .get_rptr = &radeon_ring_generic_get_rptr,
1331 .get_wptr = &radeon_ring_generic_get_wptr,
1332 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +02001333 }
1334 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001335 .irq = {
1336 .set = &r600_irq_set,
1337 .process = &r600_irq_process,
1338 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001339 .display = {
1340 .bandwidth_update = &rv515_bandwidth_update,
1341 .get_vblank_counter = &rs600_get_vblank_counter,
1342 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001343 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001344 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001345 .hdmi_enable = &r600_hdmi_enable,
1346 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001347 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001348 .copy = {
1349 .blit = &r600_copy_blit,
1350 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher43fb7782013-01-04 09:24:18 -05001351 .dma = &rv770_copy_dma,
Alex Deucher4d756582012-09-27 15:08:35 -04001352 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher43fb7782013-01-04 09:24:18 -05001353 .copy = &rv770_copy_dma,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001354 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001355 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001356 .surface = {
1357 .set_reg = r600_set_surface_reg,
1358 .clear_reg = r600_clear_surface_reg,
1359 },
Alex Deucher901ea572012-02-23 17:53:39 -05001360 .hpd = {
1361 .init = &r600_hpd_init,
1362 .fini = &r600_hpd_fini,
1363 .sense = &r600_hpd_sense,
1364 .set_polarity = &r600_hpd_set_polarity,
1365 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001366 .pm = {
1367 .misc = &rv770_pm_misc,
1368 .prepare = &rs600_pm_prepare,
1369 .finish = &rs600_pm_finish,
1370 .init_profile = &r600_pm_init_profile,
1371 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001372 .get_engine_clock = &radeon_atom_get_engine_clock,
1373 .set_engine_clock = &radeon_atom_set_engine_clock,
1374 .get_memory_clock = &radeon_atom_get_memory_clock,
1375 .set_memory_clock = &radeon_atom_set_memory_clock,
1376 .get_pcie_lanes = &r600_get_pcie_lanes,
1377 .set_pcie_lanes = &r600_set_pcie_lanes,
1378 .set_clock_gating = &radeon_atom_set_clock_gating,
Christian Königef0e6e62013-04-08 12:41:35 +02001379 .set_uvd_clocks = &rv770_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001380 .get_temperature = &rv770_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001381 },
Alex Deucher66229b22013-06-26 00:11:19 -04001382 .dpm = {
1383 .init = &rv770_dpm_init,
1384 .setup_asic = &rv770_dpm_setup_asic,
1385 .enable = &rv770_dpm_enable,
1386 .disable = &rv770_dpm_disable,
Alex Deucher98243912013-01-16 13:13:42 -05001387 .pre_set_power_state = &r600_dpm_pre_set_power_state,
Alex Deucher66229b22013-06-26 00:11:19 -04001388 .set_power_state = &rv770_dpm_set_power_state,
Alex Deucher98243912013-01-16 13:13:42 -05001389 .post_set_power_state = &r600_dpm_post_set_power_state,
Alex Deucher66229b22013-06-26 00:11:19 -04001390 .display_configuration_changed = &rv770_dpm_display_configuration_changed,
1391 .fini = &rv770_dpm_fini,
1392 .get_sclk = &rv770_dpm_get_sclk,
1393 .get_mclk = &rv770_dpm_get_mclk,
1394 .print_power_state = &rv770_dpm_print_power_state,
Alex Deucherbd210d12013-06-28 10:06:26 -04001395 .debugfs_print_current_performance_level = &rv770_dpm_debugfs_print_current_performance_level,
Alex Deucher8b5e6b72013-07-02 18:40:35 -04001396 .force_performance_level = &rv770_dpm_force_performance_level,
Alex Deucher66229b22013-06-26 00:11:19 -04001397 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001398 .pflip = {
1399 .pre_page_flip = &rs600_pre_page_flip,
1400 .page_flip = &rv770_page_flip,
1401 .post_page_flip = &rs600_post_page_flip,
1402 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001403};
1404
1405static struct radeon_asic evergreen_asic = {
1406 .init = &evergreen_init,
1407 .fini = &evergreen_fini,
1408 .suspend = &evergreen_suspend,
1409 .resume = &evergreen_resume,
Jerome Glissea2d07b72010-03-09 14:45:11 +00001410 .asic_reset = &evergreen_asic_reset,
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001411 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001412 .ioctl_wait_idle = r600_ioctl_wait_idle,
1413 .gui_idle = &r600_gui_idle,
1414 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001415 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001416 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001417 .gart = {
1418 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1419 .set_page = &rs600_gart_set_page,
1420 },
Christian König4c87bc22011-10-19 19:02:21 +02001421 .ring = {
1422 [RADEON_RING_TYPE_GFX_INDEX] = {
1423 .ib_execute = &evergreen_ring_ib_execute,
1424 .emit_fence = &r600_fence_ring_emit,
1425 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001426 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001427 .ring_test = &r600_ring_test,
1428 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001429 .is_lockup = &evergreen_gfx_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001430 .get_rptr = &radeon_ring_generic_get_rptr,
1431 .get_wptr = &radeon_ring_generic_get_wptr,
1432 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001433 },
1434 [R600_RING_TYPE_DMA_INDEX] = {
1435 .ib_execute = &evergreen_dma_ring_ib_execute,
1436 .emit_fence = &evergreen_dma_fence_ring_emit,
1437 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001438 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001439 .ring_test = &r600_dma_ring_test,
1440 .ib_test = &r600_dma_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001441 .is_lockup = &evergreen_dma_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001442 .get_rptr = &radeon_ring_generic_get_rptr,
1443 .get_wptr = &radeon_ring_generic_get_wptr,
1444 .set_wptr = &radeon_ring_generic_set_wptr,
Christian Königf2ba57b2013-04-08 12:41:29 +02001445 },
1446 [R600_RING_TYPE_UVD_INDEX] = {
1447 .ib_execute = &r600_uvd_ib_execute,
1448 .emit_fence = &r600_uvd_fence_emit,
1449 .emit_semaphore = &r600_uvd_semaphore_emit,
1450 .cs_parse = &radeon_uvd_cs_parse,
1451 .ring_test = &r600_uvd_ring_test,
1452 .ib_test = &r600_uvd_ib_test,
1453 .is_lockup = &radeon_ring_test_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001454 .get_rptr = &radeon_ring_generic_get_rptr,
1455 .get_wptr = &radeon_ring_generic_get_wptr,
1456 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +02001457 }
1458 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001459 .irq = {
1460 .set = &evergreen_irq_set,
1461 .process = &evergreen_irq_process,
1462 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001463 .display = {
1464 .bandwidth_update = &evergreen_bandwidth_update,
1465 .get_vblank_counter = &evergreen_get_vblank_counter,
1466 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001467 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001468 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001469 .hdmi_enable = &evergreen_hdmi_enable,
1470 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001471 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001472 .copy = {
1473 .blit = &r600_copy_blit,
1474 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001475 .dma = &evergreen_copy_dma,
1476 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001477 .copy = &evergreen_copy_dma,
1478 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001479 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001480 .surface = {
1481 .set_reg = r600_set_surface_reg,
1482 .clear_reg = r600_clear_surface_reg,
1483 },
Alex Deucher901ea572012-02-23 17:53:39 -05001484 .hpd = {
1485 .init = &evergreen_hpd_init,
1486 .fini = &evergreen_hpd_fini,
1487 .sense = &evergreen_hpd_sense,
1488 .set_polarity = &evergreen_hpd_set_polarity,
1489 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001490 .pm = {
1491 .misc = &evergreen_pm_misc,
1492 .prepare = &evergreen_pm_prepare,
1493 .finish = &evergreen_pm_finish,
1494 .init_profile = &r600_pm_init_profile,
1495 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001496 .get_engine_clock = &radeon_atom_get_engine_clock,
1497 .set_engine_clock = &radeon_atom_set_engine_clock,
1498 .get_memory_clock = &radeon_atom_get_memory_clock,
1499 .set_memory_clock = &radeon_atom_set_memory_clock,
1500 .get_pcie_lanes = &r600_get_pcie_lanes,
1501 .set_pcie_lanes = &r600_set_pcie_lanes,
1502 .set_clock_gating = NULL,
Alex Deuchera8b49252013-04-08 12:41:33 +02001503 .set_uvd_clocks = &evergreen_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001504 .get_temperature = &evergreen_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001505 },
Alex Deucherdc50ba72013-06-26 00:33:35 -04001506 .dpm = {
1507 .init = &cypress_dpm_init,
1508 .setup_asic = &cypress_dpm_setup_asic,
1509 .enable = &cypress_dpm_enable,
1510 .disable = &cypress_dpm_disable,
Alex Deucher98243912013-01-16 13:13:42 -05001511 .pre_set_power_state = &r600_dpm_pre_set_power_state,
Alex Deucherdc50ba72013-06-26 00:33:35 -04001512 .set_power_state = &cypress_dpm_set_power_state,
Alex Deucher98243912013-01-16 13:13:42 -05001513 .post_set_power_state = &r600_dpm_post_set_power_state,
Alex Deucherdc50ba72013-06-26 00:33:35 -04001514 .display_configuration_changed = &cypress_dpm_display_configuration_changed,
1515 .fini = &cypress_dpm_fini,
1516 .get_sclk = &rv770_dpm_get_sclk,
1517 .get_mclk = &rv770_dpm_get_mclk,
1518 .print_power_state = &rv770_dpm_print_power_state,
Alex Deucherbd210d12013-06-28 10:06:26 -04001519 .debugfs_print_current_performance_level = &rv770_dpm_debugfs_print_current_performance_level,
Alex Deucher8b5e6b72013-07-02 18:40:35 -04001520 .force_performance_level = &rv770_dpm_force_performance_level,
Alex Deucherdc50ba72013-06-26 00:33:35 -04001521 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001522 .pflip = {
1523 .pre_page_flip = &evergreen_pre_page_flip,
1524 .page_flip = &evergreen_page_flip,
1525 .post_page_flip = &evergreen_post_page_flip,
1526 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001527};
1528
Alex Deucher958261d2010-11-22 17:56:30 -05001529static struct radeon_asic sumo_asic = {
1530 .init = &evergreen_init,
1531 .fini = &evergreen_fini,
1532 .suspend = &evergreen_suspend,
1533 .resume = &evergreen_resume,
Alex Deucher958261d2010-11-22 17:56:30 -05001534 .asic_reset = &evergreen_asic_reset,
1535 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001536 .ioctl_wait_idle = r600_ioctl_wait_idle,
1537 .gui_idle = &r600_gui_idle,
1538 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001539 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001540 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001541 .gart = {
1542 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1543 .set_page = &rs600_gart_set_page,
1544 },
Christian König4c87bc22011-10-19 19:02:21 +02001545 .ring = {
1546 [RADEON_RING_TYPE_GFX_INDEX] = {
1547 .ib_execute = &evergreen_ring_ib_execute,
1548 .emit_fence = &r600_fence_ring_emit,
1549 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001550 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001551 .ring_test = &r600_ring_test,
1552 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001553 .is_lockup = &evergreen_gfx_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001554 .get_rptr = &radeon_ring_generic_get_rptr,
1555 .get_wptr = &radeon_ring_generic_get_wptr,
1556 .set_wptr = &radeon_ring_generic_set_wptr,
Christian Königeb0c19c2012-02-23 15:18:44 +01001557 },
Alex Deucher233d1ad2012-12-04 15:25:59 -05001558 [R600_RING_TYPE_DMA_INDEX] = {
1559 .ib_execute = &evergreen_dma_ring_ib_execute,
1560 .emit_fence = &evergreen_dma_fence_ring_emit,
1561 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001562 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001563 .ring_test = &r600_dma_ring_test,
1564 .ib_test = &r600_dma_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001565 .is_lockup = &evergreen_dma_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001566 .get_rptr = &radeon_ring_generic_get_rptr,
1567 .get_wptr = &radeon_ring_generic_get_wptr,
1568 .set_wptr = &radeon_ring_generic_set_wptr,
Christian Königf2ba57b2013-04-08 12:41:29 +02001569 },
1570 [R600_RING_TYPE_UVD_INDEX] = {
1571 .ib_execute = &r600_uvd_ib_execute,
1572 .emit_fence = &r600_uvd_fence_emit,
1573 .emit_semaphore = &r600_uvd_semaphore_emit,
1574 .cs_parse = &radeon_uvd_cs_parse,
1575 .ring_test = &r600_uvd_ring_test,
1576 .ib_test = &r600_uvd_ib_test,
1577 .is_lockup = &radeon_ring_test_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001578 .get_rptr = &radeon_ring_generic_get_rptr,
1579 .get_wptr = &radeon_ring_generic_get_wptr,
1580 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001581 }
Christian König4c87bc22011-10-19 19:02:21 +02001582 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001583 .irq = {
1584 .set = &evergreen_irq_set,
1585 .process = &evergreen_irq_process,
1586 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001587 .display = {
1588 .bandwidth_update = &evergreen_bandwidth_update,
1589 .get_vblank_counter = &evergreen_get_vblank_counter,
1590 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001591 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001592 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001593 .hdmi_enable = &evergreen_hdmi_enable,
1594 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001595 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001596 .copy = {
1597 .blit = &r600_copy_blit,
1598 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001599 .dma = &evergreen_copy_dma,
1600 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001601 .copy = &evergreen_copy_dma,
1602 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001603 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001604 .surface = {
1605 .set_reg = r600_set_surface_reg,
1606 .clear_reg = r600_clear_surface_reg,
1607 },
Alex Deucher901ea572012-02-23 17:53:39 -05001608 .hpd = {
1609 .init = &evergreen_hpd_init,
1610 .fini = &evergreen_hpd_fini,
1611 .sense = &evergreen_hpd_sense,
1612 .set_polarity = &evergreen_hpd_set_polarity,
1613 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001614 .pm = {
1615 .misc = &evergreen_pm_misc,
1616 .prepare = &evergreen_pm_prepare,
1617 .finish = &evergreen_pm_finish,
1618 .init_profile = &sumo_pm_init_profile,
1619 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001620 .get_engine_clock = &radeon_atom_get_engine_clock,
1621 .set_engine_clock = &radeon_atom_set_engine_clock,
1622 .get_memory_clock = NULL,
1623 .set_memory_clock = NULL,
1624 .get_pcie_lanes = NULL,
1625 .set_pcie_lanes = NULL,
1626 .set_clock_gating = NULL,
Alex Deucher23d33ba2013-04-08 12:41:32 +02001627 .set_uvd_clocks = &sumo_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001628 .get_temperature = &sumo_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001629 },
Alex Deucher80ea2c12013-04-12 14:56:21 -04001630 .dpm = {
1631 .init = &sumo_dpm_init,
1632 .setup_asic = &sumo_dpm_setup_asic,
1633 .enable = &sumo_dpm_enable,
1634 .disable = &sumo_dpm_disable,
Alex Deucher422a56b2013-06-25 15:40:21 -04001635 .pre_set_power_state = &sumo_dpm_pre_set_power_state,
Alex Deucher80ea2c12013-04-12 14:56:21 -04001636 .set_power_state = &sumo_dpm_set_power_state,
Alex Deucher422a56b2013-06-25 15:40:21 -04001637 .post_set_power_state = &sumo_dpm_post_set_power_state,
Alex Deucher80ea2c12013-04-12 14:56:21 -04001638 .display_configuration_changed = &sumo_dpm_display_configuration_changed,
1639 .fini = &sumo_dpm_fini,
1640 .get_sclk = &sumo_dpm_get_sclk,
1641 .get_mclk = &sumo_dpm_get_mclk,
1642 .print_power_state = &sumo_dpm_print_power_state,
Alex Deucherfb701602013-06-28 10:47:56 -04001643 .debugfs_print_current_performance_level = &sumo_dpm_debugfs_print_current_performance_level,
Alex Deucher5d5e5592013-07-02 18:50:09 -04001644 .force_performance_level = &sumo_dpm_force_performance_level,
Alex Deucher80ea2c12013-04-12 14:56:21 -04001645 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001646 .pflip = {
1647 .pre_page_flip = &evergreen_pre_page_flip,
1648 .page_flip = &evergreen_page_flip,
1649 .post_page_flip = &evergreen_post_page_flip,
1650 },
Alex Deucher958261d2010-11-22 17:56:30 -05001651};
1652
Alex Deuchera43b7662011-01-06 21:19:33 -05001653static struct radeon_asic btc_asic = {
1654 .init = &evergreen_init,
1655 .fini = &evergreen_fini,
1656 .suspend = &evergreen_suspend,
1657 .resume = &evergreen_resume,
Alex Deuchera43b7662011-01-06 21:19:33 -05001658 .asic_reset = &evergreen_asic_reset,
1659 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001660 .ioctl_wait_idle = r600_ioctl_wait_idle,
1661 .gui_idle = &r600_gui_idle,
1662 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001663 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001664 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001665 .gart = {
1666 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1667 .set_page = &rs600_gart_set_page,
1668 },
Christian König4c87bc22011-10-19 19:02:21 +02001669 .ring = {
1670 [RADEON_RING_TYPE_GFX_INDEX] = {
1671 .ib_execute = &evergreen_ring_ib_execute,
1672 .emit_fence = &r600_fence_ring_emit,
1673 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001674 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001675 .ring_test = &r600_ring_test,
1676 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001677 .is_lockup = &evergreen_gfx_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001678 .get_rptr = &radeon_ring_generic_get_rptr,
1679 .get_wptr = &radeon_ring_generic_get_wptr,
1680 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001681 },
1682 [R600_RING_TYPE_DMA_INDEX] = {
1683 .ib_execute = &evergreen_dma_ring_ib_execute,
1684 .emit_fence = &evergreen_dma_fence_ring_emit,
1685 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001686 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001687 .ring_test = &r600_dma_ring_test,
1688 .ib_test = &r600_dma_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001689 .is_lockup = &evergreen_dma_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001690 .get_rptr = &radeon_ring_generic_get_rptr,
1691 .get_wptr = &radeon_ring_generic_get_wptr,
1692 .set_wptr = &radeon_ring_generic_set_wptr,
Christian Königf2ba57b2013-04-08 12:41:29 +02001693 },
1694 [R600_RING_TYPE_UVD_INDEX] = {
1695 .ib_execute = &r600_uvd_ib_execute,
1696 .emit_fence = &r600_uvd_fence_emit,
1697 .emit_semaphore = &r600_uvd_semaphore_emit,
1698 .cs_parse = &radeon_uvd_cs_parse,
1699 .ring_test = &r600_uvd_ring_test,
1700 .ib_test = &r600_uvd_ib_test,
1701 .is_lockup = &radeon_ring_test_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001702 .get_rptr = &radeon_ring_generic_get_rptr,
1703 .get_wptr = &radeon_ring_generic_get_wptr,
1704 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +02001705 }
1706 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001707 .irq = {
1708 .set = &evergreen_irq_set,
1709 .process = &evergreen_irq_process,
1710 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001711 .display = {
1712 .bandwidth_update = &evergreen_bandwidth_update,
1713 .get_vblank_counter = &evergreen_get_vblank_counter,
1714 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001715 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001716 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001717 .hdmi_enable = &evergreen_hdmi_enable,
1718 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001719 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001720 .copy = {
1721 .blit = &r600_copy_blit,
1722 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001723 .dma = &evergreen_copy_dma,
1724 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001725 .copy = &evergreen_copy_dma,
1726 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001727 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001728 .surface = {
1729 .set_reg = r600_set_surface_reg,
1730 .clear_reg = r600_clear_surface_reg,
1731 },
Alex Deucher901ea572012-02-23 17:53:39 -05001732 .hpd = {
1733 .init = &evergreen_hpd_init,
1734 .fini = &evergreen_hpd_fini,
1735 .sense = &evergreen_hpd_sense,
1736 .set_polarity = &evergreen_hpd_set_polarity,
1737 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001738 .pm = {
1739 .misc = &evergreen_pm_misc,
1740 .prepare = &evergreen_pm_prepare,
1741 .finish = &evergreen_pm_finish,
Alex Deucher27810fb2012-10-01 19:25:11 -04001742 .init_profile = &btc_pm_init_profile,
Alex Deuchera02fa392012-02-23 17:53:41 -05001743 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001744 .get_engine_clock = &radeon_atom_get_engine_clock,
1745 .set_engine_clock = &radeon_atom_set_engine_clock,
1746 .get_memory_clock = &radeon_atom_get_memory_clock,
1747 .set_memory_clock = &radeon_atom_set_memory_clock,
Alex Deucher55b615a2013-03-18 18:57:27 -04001748 .get_pcie_lanes = &r600_get_pcie_lanes,
1749 .set_pcie_lanes = &r600_set_pcie_lanes,
Alex Deucher798bcf72012-02-23 17:53:48 -05001750 .set_clock_gating = NULL,
Alex Deuchera8b49252013-04-08 12:41:33 +02001751 .set_uvd_clocks = &evergreen_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001752 .get_temperature = &evergreen_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001753 },
Alex Deucher6596afd2013-06-26 00:15:24 -04001754 .dpm = {
1755 .init = &btc_dpm_init,
1756 .setup_asic = &btc_dpm_setup_asic,
1757 .enable = &btc_dpm_enable,
1758 .disable = &btc_dpm_disable,
Alex Deuchere8a95392013-01-16 14:17:23 -05001759 .pre_set_power_state = &btc_dpm_pre_set_power_state,
Alex Deucher6596afd2013-06-26 00:15:24 -04001760 .set_power_state = &btc_dpm_set_power_state,
Alex Deuchere8a95392013-01-16 14:17:23 -05001761 .post_set_power_state = &btc_dpm_post_set_power_state,
Alex Deucher6596afd2013-06-26 00:15:24 -04001762 .display_configuration_changed = &cypress_dpm_display_configuration_changed,
1763 .fini = &btc_dpm_fini,
Alex Deuchere8a95392013-01-16 14:17:23 -05001764 .get_sclk = &btc_dpm_get_sclk,
1765 .get_mclk = &btc_dpm_get_mclk,
Alex Deucher6596afd2013-06-26 00:15:24 -04001766 .print_power_state = &rv770_dpm_print_power_state,
Alex Deucherbd210d12013-06-28 10:06:26 -04001767 .debugfs_print_current_performance_level = &rv770_dpm_debugfs_print_current_performance_level,
Alex Deucher8b5e6b72013-07-02 18:40:35 -04001768 .force_performance_level = &rv770_dpm_force_performance_level,
Alex Deucher6596afd2013-06-26 00:15:24 -04001769 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001770 .pflip = {
1771 .pre_page_flip = &evergreen_pre_page_flip,
1772 .page_flip = &evergreen_page_flip,
1773 .post_page_flip = &evergreen_post_page_flip,
1774 },
Alex Deuchera43b7662011-01-06 21:19:33 -05001775};
1776
Alex Deuchere3487622011-03-02 20:07:36 -05001777static struct radeon_asic cayman_asic = {
1778 .init = &cayman_init,
1779 .fini = &cayman_fini,
1780 .suspend = &cayman_suspend,
1781 .resume = &cayman_resume,
Alex Deuchere3487622011-03-02 20:07:36 -05001782 .asic_reset = &cayman_asic_reset,
1783 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001784 .ioctl_wait_idle = r600_ioctl_wait_idle,
1785 .gui_idle = &r600_gui_idle,
1786 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001787 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001788 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001789 .gart = {
1790 .tlb_flush = &cayman_pcie_gart_tlb_flush,
1791 .set_page = &rs600_gart_set_page,
1792 },
Christian König05b07142012-08-06 20:21:10 +02001793 .vm = {
1794 .init = &cayman_vm_init,
1795 .fini = &cayman_vm_fini,
Alex Deucherdf160042013-01-31 16:26:02 -05001796 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
Christian König05b07142012-08-06 20:21:10 +02001797 .set_page = &cayman_vm_set_page,
1798 },
Christian König4c87bc22011-10-19 19:02:21 +02001799 .ring = {
1800 [RADEON_RING_TYPE_GFX_INDEX] = {
Jerome Glisse721604a2012-01-05 22:11:05 -05001801 .ib_execute = &cayman_ring_ib_execute,
1802 .ib_parse = &evergreen_ib_parse,
Alex Deucherb40e7e12011-11-17 14:57:50 -05001803 .emit_fence = &cayman_fence_ring_emit,
Christian König4c87bc22011-10-19 19:02:21 +02001804 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001805 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001806 .ring_test = &r600_ring_test,
1807 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001808 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001809 .vm_flush = &cayman_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001810 .get_rptr = &radeon_ring_generic_get_rptr,
1811 .get_wptr = &radeon_ring_generic_get_wptr,
1812 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +02001813 },
1814 [CAYMAN_RING_TYPE_CP1_INDEX] = {
Jerome Glisse721604a2012-01-05 22:11:05 -05001815 .ib_execute = &cayman_ring_ib_execute,
1816 .ib_parse = &evergreen_ib_parse,
Alex Deucherb40e7e12011-11-17 14:57:50 -05001817 .emit_fence = &cayman_fence_ring_emit,
Christian König4c87bc22011-10-19 19:02:21 +02001818 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001819 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001820 .ring_test = &r600_ring_test,
1821 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001822 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001823 .vm_flush = &cayman_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001824 .get_rptr = &radeon_ring_generic_get_rptr,
1825 .get_wptr = &radeon_ring_generic_get_wptr,
1826 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +02001827 },
1828 [CAYMAN_RING_TYPE_CP2_INDEX] = {
Jerome Glisse721604a2012-01-05 22:11:05 -05001829 .ib_execute = &cayman_ring_ib_execute,
1830 .ib_parse = &evergreen_ib_parse,
Alex Deucherb40e7e12011-11-17 14:57:50 -05001831 .emit_fence = &cayman_fence_ring_emit,
Christian König4c87bc22011-10-19 19:02:21 +02001832 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001833 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001834 .ring_test = &r600_ring_test,
1835 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001836 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001837 .vm_flush = &cayman_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001838 .get_rptr = &radeon_ring_generic_get_rptr,
1839 .get_wptr = &radeon_ring_generic_get_wptr,
1840 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001841 },
1842 [R600_RING_TYPE_DMA_INDEX] = {
1843 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05001844 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001845 .emit_fence = &evergreen_dma_fence_ring_emit,
1846 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001847 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001848 .ring_test = &r600_dma_ring_test,
1849 .ib_test = &r600_dma_ib_test,
1850 .is_lockup = &cayman_dma_is_lockup,
1851 .vm_flush = &cayman_dma_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001852 .get_rptr = &radeon_ring_generic_get_rptr,
1853 .get_wptr = &radeon_ring_generic_get_wptr,
1854 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001855 },
1856 [CAYMAN_RING_TYPE_DMA1_INDEX] = {
1857 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05001858 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001859 .emit_fence = &evergreen_dma_fence_ring_emit,
1860 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001861 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001862 .ring_test = &r600_dma_ring_test,
1863 .ib_test = &r600_dma_ib_test,
1864 .is_lockup = &cayman_dma_is_lockup,
1865 .vm_flush = &cayman_dma_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001866 .get_rptr = &radeon_ring_generic_get_rptr,
1867 .get_wptr = &radeon_ring_generic_get_wptr,
1868 .set_wptr = &radeon_ring_generic_set_wptr,
Christian Königf2ba57b2013-04-08 12:41:29 +02001869 },
1870 [R600_RING_TYPE_UVD_INDEX] = {
1871 .ib_execute = &r600_uvd_ib_execute,
1872 .emit_fence = &r600_uvd_fence_emit,
1873 .emit_semaphore = &cayman_uvd_semaphore_emit,
1874 .cs_parse = &radeon_uvd_cs_parse,
1875 .ring_test = &r600_uvd_ring_test,
1876 .ib_test = &r600_uvd_ib_test,
1877 .is_lockup = &radeon_ring_test_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001878 .get_rptr = &radeon_ring_generic_get_rptr,
1879 .get_wptr = &radeon_ring_generic_get_wptr,
1880 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +02001881 }
1882 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001883 .irq = {
1884 .set = &evergreen_irq_set,
1885 .process = &evergreen_irq_process,
1886 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001887 .display = {
1888 .bandwidth_update = &evergreen_bandwidth_update,
1889 .get_vblank_counter = &evergreen_get_vblank_counter,
1890 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001891 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001892 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001893 .hdmi_enable = &evergreen_hdmi_enable,
1894 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001895 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001896 .copy = {
1897 .blit = &r600_copy_blit,
1898 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001899 .dma = &evergreen_copy_dma,
1900 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001901 .copy = &evergreen_copy_dma,
1902 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001903 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001904 .surface = {
1905 .set_reg = r600_set_surface_reg,
1906 .clear_reg = r600_clear_surface_reg,
1907 },
Alex Deucher901ea572012-02-23 17:53:39 -05001908 .hpd = {
1909 .init = &evergreen_hpd_init,
1910 .fini = &evergreen_hpd_fini,
1911 .sense = &evergreen_hpd_sense,
1912 .set_polarity = &evergreen_hpd_set_polarity,
1913 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001914 .pm = {
1915 .misc = &evergreen_pm_misc,
1916 .prepare = &evergreen_pm_prepare,
1917 .finish = &evergreen_pm_finish,
Alex Deucher27810fb2012-10-01 19:25:11 -04001918 .init_profile = &btc_pm_init_profile,
Alex Deuchera02fa392012-02-23 17:53:41 -05001919 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001920 .get_engine_clock = &radeon_atom_get_engine_clock,
1921 .set_engine_clock = &radeon_atom_set_engine_clock,
1922 .get_memory_clock = &radeon_atom_get_memory_clock,
1923 .set_memory_clock = &radeon_atom_set_memory_clock,
Alex Deucher55b615a2013-03-18 18:57:27 -04001924 .get_pcie_lanes = &r600_get_pcie_lanes,
1925 .set_pcie_lanes = &r600_set_pcie_lanes,
Alex Deucher798bcf72012-02-23 17:53:48 -05001926 .set_clock_gating = NULL,
Alex Deuchera8b49252013-04-08 12:41:33 +02001927 .set_uvd_clocks = &evergreen_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001928 .get_temperature = &evergreen_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001929 },
Alex Deucher69e0b572013-04-12 16:42:42 -04001930 .dpm = {
1931 .init = &ni_dpm_init,
1932 .setup_asic = &ni_dpm_setup_asic,
1933 .enable = &ni_dpm_enable,
1934 .disable = &ni_dpm_disable,
Alex Deucherfee3d742013-01-16 14:35:39 -05001935 .pre_set_power_state = &ni_dpm_pre_set_power_state,
Alex Deucher69e0b572013-04-12 16:42:42 -04001936 .set_power_state = &ni_dpm_set_power_state,
Alex Deucherfee3d742013-01-16 14:35:39 -05001937 .post_set_power_state = &ni_dpm_post_set_power_state,
Alex Deucher69e0b572013-04-12 16:42:42 -04001938 .display_configuration_changed = &cypress_dpm_display_configuration_changed,
1939 .fini = &ni_dpm_fini,
1940 .get_sclk = &ni_dpm_get_sclk,
1941 .get_mclk = &ni_dpm_get_mclk,
1942 .print_power_state = &ni_dpm_print_power_state,
Alex Deucherbdf0c4f2013-06-28 17:49:02 -04001943 .debugfs_print_current_performance_level = &ni_dpm_debugfs_print_current_performance_level,
Alex Deucher170a47f2013-07-02 18:43:53 -04001944 .force_performance_level = &ni_dpm_force_performance_level,
Alex Deucher69e0b572013-04-12 16:42:42 -04001945 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001946 .pflip = {
1947 .pre_page_flip = &evergreen_pre_page_flip,
1948 .page_flip = &evergreen_page_flip,
1949 .post_page_flip = &evergreen_post_page_flip,
1950 },
Alex Deuchere3487622011-03-02 20:07:36 -05001951};
1952
Alex Deucherbe63fe82012-03-20 17:18:40 -04001953static struct radeon_asic trinity_asic = {
1954 .init = &cayman_init,
1955 .fini = &cayman_fini,
1956 .suspend = &cayman_suspend,
1957 .resume = &cayman_resume,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001958 .asic_reset = &cayman_asic_reset,
1959 .vga_set_state = &r600_vga_set_state,
1960 .ioctl_wait_idle = r600_ioctl_wait_idle,
1961 .gui_idle = &r600_gui_idle,
1962 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001963 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001964 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001965 .gart = {
1966 .tlb_flush = &cayman_pcie_gart_tlb_flush,
1967 .set_page = &rs600_gart_set_page,
1968 },
Christian König05b07142012-08-06 20:21:10 +02001969 .vm = {
1970 .init = &cayman_vm_init,
1971 .fini = &cayman_vm_fini,
Alex Deucherdf160042013-01-31 16:26:02 -05001972 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
Christian König05b07142012-08-06 20:21:10 +02001973 .set_page = &cayman_vm_set_page,
1974 },
Alex Deucherbe63fe82012-03-20 17:18:40 -04001975 .ring = {
1976 [RADEON_RING_TYPE_GFX_INDEX] = {
1977 .ib_execute = &cayman_ring_ib_execute,
1978 .ib_parse = &evergreen_ib_parse,
1979 .emit_fence = &cayman_fence_ring_emit,
1980 .emit_semaphore = &r600_semaphore_ring_emit,
1981 .cs_parse = &evergreen_cs_parse,
1982 .ring_test = &r600_ring_test,
1983 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001984 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001985 .vm_flush = &cayman_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001986 .get_rptr = &radeon_ring_generic_get_rptr,
1987 .get_wptr = &radeon_ring_generic_get_wptr,
1988 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001989 },
1990 [CAYMAN_RING_TYPE_CP1_INDEX] = {
1991 .ib_execute = &cayman_ring_ib_execute,
1992 .ib_parse = &evergreen_ib_parse,
1993 .emit_fence = &cayman_fence_ring_emit,
1994 .emit_semaphore = &r600_semaphore_ring_emit,
1995 .cs_parse = &evergreen_cs_parse,
1996 .ring_test = &r600_ring_test,
1997 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001998 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001999 .vm_flush = &cayman_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002000 .get_rptr = &radeon_ring_generic_get_rptr,
2001 .get_wptr = &radeon_ring_generic_get_wptr,
2002 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucherbe63fe82012-03-20 17:18:40 -04002003 },
2004 [CAYMAN_RING_TYPE_CP2_INDEX] = {
2005 .ib_execute = &cayman_ring_ib_execute,
2006 .ib_parse = &evergreen_ib_parse,
2007 .emit_fence = &cayman_fence_ring_emit,
2008 .emit_semaphore = &r600_semaphore_ring_emit,
2009 .cs_parse = &evergreen_cs_parse,
2010 .ring_test = &r600_ring_test,
2011 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05002012 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02002013 .vm_flush = &cayman_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002014 .get_rptr = &radeon_ring_generic_get_rptr,
2015 .get_wptr = &radeon_ring_generic_get_wptr,
2016 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucherf60cbd12012-12-04 15:27:33 -05002017 },
2018 [R600_RING_TYPE_DMA_INDEX] = {
2019 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05002020 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05002021 .emit_fence = &evergreen_dma_fence_ring_emit,
2022 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05002023 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05002024 .ring_test = &r600_dma_ring_test,
2025 .ib_test = &r600_dma_ib_test,
2026 .is_lockup = &cayman_dma_is_lockup,
2027 .vm_flush = &cayman_dma_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002028 .get_rptr = &radeon_ring_generic_get_rptr,
2029 .get_wptr = &radeon_ring_generic_get_wptr,
2030 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucherf60cbd12012-12-04 15:27:33 -05002031 },
2032 [CAYMAN_RING_TYPE_DMA1_INDEX] = {
2033 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05002034 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05002035 .emit_fence = &evergreen_dma_fence_ring_emit,
2036 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05002037 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05002038 .ring_test = &r600_dma_ring_test,
2039 .ib_test = &r600_dma_ib_test,
2040 .is_lockup = &cayman_dma_is_lockup,
2041 .vm_flush = &cayman_dma_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002042 .get_rptr = &radeon_ring_generic_get_rptr,
2043 .get_wptr = &radeon_ring_generic_get_wptr,
2044 .set_wptr = &radeon_ring_generic_set_wptr,
Christian Königf2ba57b2013-04-08 12:41:29 +02002045 },
2046 [R600_RING_TYPE_UVD_INDEX] = {
2047 .ib_execute = &r600_uvd_ib_execute,
2048 .emit_fence = &r600_uvd_fence_emit,
2049 .emit_semaphore = &cayman_uvd_semaphore_emit,
2050 .cs_parse = &radeon_uvd_cs_parse,
2051 .ring_test = &r600_uvd_ring_test,
2052 .ib_test = &r600_uvd_ib_test,
2053 .is_lockup = &radeon_ring_test_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002054 .get_rptr = &radeon_ring_generic_get_rptr,
2055 .get_wptr = &radeon_ring_generic_get_wptr,
2056 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucherbe63fe82012-03-20 17:18:40 -04002057 }
2058 },
2059 .irq = {
2060 .set = &evergreen_irq_set,
2061 .process = &evergreen_irq_process,
2062 },
2063 .display = {
2064 .bandwidth_update = &dce6_bandwidth_update,
2065 .get_vblank_counter = &evergreen_get_vblank_counter,
2066 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04002067 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04002068 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherbe63fe82012-03-20 17:18:40 -04002069 },
2070 .copy = {
2071 .blit = &r600_copy_blit,
2072 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucherf60cbd12012-12-04 15:27:33 -05002073 .dma = &evergreen_copy_dma,
2074 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04002075 .copy = &evergreen_copy_dma,
2076 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucherbe63fe82012-03-20 17:18:40 -04002077 },
2078 .surface = {
2079 .set_reg = r600_set_surface_reg,
2080 .clear_reg = r600_clear_surface_reg,
2081 },
2082 .hpd = {
2083 .init = &evergreen_hpd_init,
2084 .fini = &evergreen_hpd_fini,
2085 .sense = &evergreen_hpd_sense,
2086 .set_polarity = &evergreen_hpd_set_polarity,
2087 },
2088 .pm = {
2089 .misc = &evergreen_pm_misc,
2090 .prepare = &evergreen_pm_prepare,
2091 .finish = &evergreen_pm_finish,
2092 .init_profile = &sumo_pm_init_profile,
2093 .get_dynpm_state = &r600_pm_get_dynpm_state,
2094 .get_engine_clock = &radeon_atom_get_engine_clock,
2095 .set_engine_clock = &radeon_atom_set_engine_clock,
2096 .get_memory_clock = NULL,
2097 .set_memory_clock = NULL,
2098 .get_pcie_lanes = NULL,
2099 .set_pcie_lanes = NULL,
2100 .set_clock_gating = NULL,
Alex Deucher23d33ba2013-04-08 12:41:32 +02002101 .set_uvd_clocks = &sumo_set_uvd_clocks,
Alex Deucher29a15222012-12-14 11:57:36 -05002102 .get_temperature = &tn_get_temp,
Alex Deucherbe63fe82012-03-20 17:18:40 -04002103 },
Alex Deucherd70229f2013-04-12 16:40:41 -04002104 .dpm = {
2105 .init = &trinity_dpm_init,
2106 .setup_asic = &trinity_dpm_setup_asic,
2107 .enable = &trinity_dpm_enable,
2108 .disable = &trinity_dpm_disable,
Alex Deuchera284c482013-01-16 13:53:40 -05002109 .pre_set_power_state = &trinity_dpm_pre_set_power_state,
Alex Deucherd70229f2013-04-12 16:40:41 -04002110 .set_power_state = &trinity_dpm_set_power_state,
Alex Deuchera284c482013-01-16 13:53:40 -05002111 .post_set_power_state = &trinity_dpm_post_set_power_state,
Alex Deucherd70229f2013-04-12 16:40:41 -04002112 .display_configuration_changed = &trinity_dpm_display_configuration_changed,
2113 .fini = &trinity_dpm_fini,
2114 .get_sclk = &trinity_dpm_get_sclk,
2115 .get_mclk = &trinity_dpm_get_mclk,
2116 .print_power_state = &trinity_dpm_print_power_state,
Alex Deucher490ab932013-06-28 12:01:38 -04002117 .debugfs_print_current_performance_level = &trinity_dpm_debugfs_print_current_performance_level,
Alex Deucher9b5de592013-07-02 18:52:10 -04002118 .force_performance_level = &trinity_dpm_force_performance_level,
Alex Deucherd70229f2013-04-12 16:40:41 -04002119 },
Alex Deucherbe63fe82012-03-20 17:18:40 -04002120 .pflip = {
2121 .pre_page_flip = &evergreen_pre_page_flip,
2122 .page_flip = &evergreen_page_flip,
2123 .post_page_flip = &evergreen_post_page_flip,
2124 },
2125};
2126
Alex Deucher02779c02012-03-20 17:18:25 -04002127static struct radeon_asic si_asic = {
2128 .init = &si_init,
2129 .fini = &si_fini,
2130 .suspend = &si_suspend,
2131 .resume = &si_resume,
Alex Deucher02779c02012-03-20 17:18:25 -04002132 .asic_reset = &si_asic_reset,
2133 .vga_set_state = &r600_vga_set_state,
2134 .ioctl_wait_idle = r600_ioctl_wait_idle,
2135 .gui_idle = &r600_gui_idle,
2136 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05002137 .get_xclk = &si_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05002138 .get_gpu_clock_counter = &si_get_gpu_clock_counter,
Alex Deucher02779c02012-03-20 17:18:25 -04002139 .gart = {
2140 .tlb_flush = &si_pcie_gart_tlb_flush,
2141 .set_page = &rs600_gart_set_page,
2142 },
Christian König05b07142012-08-06 20:21:10 +02002143 .vm = {
2144 .init = &si_vm_init,
2145 .fini = &si_vm_fini,
Alex Deucherdf160042013-01-31 16:26:02 -05002146 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher82ffd922012-10-02 14:47:46 -04002147 .set_page = &si_vm_set_page,
Christian König05b07142012-08-06 20:21:10 +02002148 },
Alex Deucher02779c02012-03-20 17:18:25 -04002149 .ring = {
2150 [RADEON_RING_TYPE_GFX_INDEX] = {
2151 .ib_execute = &si_ring_ib_execute,
2152 .ib_parse = &si_ib_parse,
2153 .emit_fence = &si_fence_ring_emit,
2154 .emit_semaphore = &r600_semaphore_ring_emit,
2155 .cs_parse = NULL,
2156 .ring_test = &r600_ring_test,
2157 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05002158 .is_lockup = &si_gfx_is_lockup,
Christian Königee60e292012-08-09 16:21:08 +02002159 .vm_flush = &si_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002160 .get_rptr = &radeon_ring_generic_get_rptr,
2161 .get_wptr = &radeon_ring_generic_get_wptr,
2162 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher02779c02012-03-20 17:18:25 -04002163 },
2164 [CAYMAN_RING_TYPE_CP1_INDEX] = {
2165 .ib_execute = &si_ring_ib_execute,
2166 .ib_parse = &si_ib_parse,
2167 .emit_fence = &si_fence_ring_emit,
2168 .emit_semaphore = &r600_semaphore_ring_emit,
2169 .cs_parse = NULL,
2170 .ring_test = &r600_ring_test,
2171 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05002172 .is_lockup = &si_gfx_is_lockup,
Christian Königee60e292012-08-09 16:21:08 +02002173 .vm_flush = &si_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002174 .get_rptr = &radeon_ring_generic_get_rptr,
2175 .get_wptr = &radeon_ring_generic_get_wptr,
2176 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher02779c02012-03-20 17:18:25 -04002177 },
2178 [CAYMAN_RING_TYPE_CP2_INDEX] = {
2179 .ib_execute = &si_ring_ib_execute,
2180 .ib_parse = &si_ib_parse,
2181 .emit_fence = &si_fence_ring_emit,
2182 .emit_semaphore = &r600_semaphore_ring_emit,
2183 .cs_parse = NULL,
2184 .ring_test = &r600_ring_test,
2185 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05002186 .is_lockup = &si_gfx_is_lockup,
Christian Königee60e292012-08-09 16:21:08 +02002187 .vm_flush = &si_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002188 .get_rptr = &radeon_ring_generic_get_rptr,
2189 .get_wptr = &radeon_ring_generic_get_wptr,
2190 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05002191 },
2192 [R600_RING_TYPE_DMA_INDEX] = {
2193 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05002194 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05002195 .emit_fence = &evergreen_dma_fence_ring_emit,
2196 .emit_semaphore = &r600_dma_semaphore_ring_emit,
2197 .cs_parse = NULL,
2198 .ring_test = &r600_dma_ring_test,
2199 .ib_test = &r600_dma_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05002200 .is_lockup = &si_dma_is_lockup,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05002201 .vm_flush = &si_dma_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002202 .get_rptr = &radeon_ring_generic_get_rptr,
2203 .get_wptr = &radeon_ring_generic_get_wptr,
2204 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05002205 },
2206 [CAYMAN_RING_TYPE_DMA1_INDEX] = {
2207 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05002208 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05002209 .emit_fence = &evergreen_dma_fence_ring_emit,
2210 .emit_semaphore = &r600_dma_semaphore_ring_emit,
2211 .cs_parse = NULL,
2212 .ring_test = &r600_dma_ring_test,
2213 .ib_test = &r600_dma_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05002214 .is_lockup = &si_dma_is_lockup,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05002215 .vm_flush = &si_dma_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002216 .get_rptr = &radeon_ring_generic_get_rptr,
2217 .get_wptr = &radeon_ring_generic_get_wptr,
2218 .set_wptr = &radeon_ring_generic_set_wptr,
Christian Königf2ba57b2013-04-08 12:41:29 +02002219 },
2220 [R600_RING_TYPE_UVD_INDEX] = {
2221 .ib_execute = &r600_uvd_ib_execute,
2222 .emit_fence = &r600_uvd_fence_emit,
2223 .emit_semaphore = &cayman_uvd_semaphore_emit,
2224 .cs_parse = &radeon_uvd_cs_parse,
2225 .ring_test = &r600_uvd_ring_test,
2226 .ib_test = &r600_uvd_ib_test,
2227 .is_lockup = &radeon_ring_test_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002228 .get_rptr = &radeon_ring_generic_get_rptr,
2229 .get_wptr = &radeon_ring_generic_get_wptr,
2230 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher02779c02012-03-20 17:18:25 -04002231 }
2232 },
2233 .irq = {
2234 .set = &si_irq_set,
2235 .process = &si_irq_process,
2236 },
2237 .display = {
2238 .bandwidth_update = &dce6_bandwidth_update,
2239 .get_vblank_counter = &evergreen_get_vblank_counter,
2240 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04002241 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04002242 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucher02779c02012-03-20 17:18:25 -04002243 },
2244 .copy = {
2245 .blit = NULL,
2246 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05002247 .dma = &si_copy_dma,
2248 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04002249 .copy = &si_copy_dma,
2250 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher02779c02012-03-20 17:18:25 -04002251 },
2252 .surface = {
2253 .set_reg = r600_set_surface_reg,
2254 .clear_reg = r600_clear_surface_reg,
2255 },
2256 .hpd = {
2257 .init = &evergreen_hpd_init,
2258 .fini = &evergreen_hpd_fini,
2259 .sense = &evergreen_hpd_sense,
2260 .set_polarity = &evergreen_hpd_set_polarity,
2261 },
2262 .pm = {
2263 .misc = &evergreen_pm_misc,
2264 .prepare = &evergreen_pm_prepare,
2265 .finish = &evergreen_pm_finish,
2266 .init_profile = &sumo_pm_init_profile,
2267 .get_dynpm_state = &r600_pm_get_dynpm_state,
2268 .get_engine_clock = &radeon_atom_get_engine_clock,
2269 .set_engine_clock = &radeon_atom_set_engine_clock,
2270 .get_memory_clock = &radeon_atom_get_memory_clock,
2271 .set_memory_clock = &radeon_atom_set_memory_clock,
Alex Deucher55b615a2013-03-18 18:57:27 -04002272 .get_pcie_lanes = &r600_get_pcie_lanes,
2273 .set_pcie_lanes = &r600_set_pcie_lanes,
Alex Deucher02779c02012-03-20 17:18:25 -04002274 .set_clock_gating = NULL,
Christian König2539eb02013-04-08 12:41:34 +02002275 .set_uvd_clocks = &si_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04002276 .get_temperature = &si_get_temp,
Alex Deucher02779c02012-03-20 17:18:25 -04002277 },
Alex Deuchera9e61412013-06-25 17:56:16 -04002278 .dpm = {
2279 .init = &si_dpm_init,
2280 .setup_asic = &si_dpm_setup_asic,
2281 .enable = &si_dpm_enable,
2282 .disable = &si_dpm_disable,
2283 .pre_set_power_state = &si_dpm_pre_set_power_state,
2284 .set_power_state = &si_dpm_set_power_state,
2285 .post_set_power_state = &si_dpm_post_set_power_state,
2286 .display_configuration_changed = &si_dpm_display_configuration_changed,
2287 .fini = &si_dpm_fini,
2288 .get_sclk = &ni_dpm_get_sclk,
2289 .get_mclk = &ni_dpm_get_mclk,
2290 .print_power_state = &ni_dpm_print_power_state,
Alex Deucher79821282013-06-28 18:02:19 -04002291 .debugfs_print_current_performance_level = &si_dpm_debugfs_print_current_performance_level,
Alex Deuchera160a6a2013-07-02 18:46:28 -04002292 .force_performance_level = &si_dpm_force_performance_level,
Alex Deuchera9e61412013-06-25 17:56:16 -04002293 },
Alex Deucher02779c02012-03-20 17:18:25 -04002294 .pflip = {
2295 .pre_page_flip = &evergreen_pre_page_flip,
2296 .page_flip = &evergreen_page_flip,
2297 .post_page_flip = &evergreen_post_page_flip,
2298 },
2299};
2300
Alex Deucher0672e272013-04-09 16:22:31 -04002301static struct radeon_asic ci_asic = {
2302 .init = &cik_init,
2303 .fini = &cik_fini,
2304 .suspend = &cik_suspend,
2305 .resume = &cik_resume,
2306 .asic_reset = &cik_asic_reset,
2307 .vga_set_state = &r600_vga_set_state,
2308 .ioctl_wait_idle = NULL,
2309 .gui_idle = &r600_gui_idle,
2310 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
2311 .get_xclk = &cik_get_xclk,
2312 .get_gpu_clock_counter = &cik_get_gpu_clock_counter,
2313 .gart = {
2314 .tlb_flush = &cik_pcie_gart_tlb_flush,
2315 .set_page = &rs600_gart_set_page,
2316 },
2317 .vm = {
2318 .init = &cik_vm_init,
2319 .fini = &cik_vm_fini,
2320 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
2321 .set_page = &cik_vm_set_page,
2322 },
2323 .ring = {
2324 [RADEON_RING_TYPE_GFX_INDEX] = {
2325 .ib_execute = &cik_ring_ib_execute,
2326 .ib_parse = &cik_ib_parse,
2327 .emit_fence = &cik_fence_gfx_ring_emit,
2328 .emit_semaphore = &cik_semaphore_ring_emit,
2329 .cs_parse = NULL,
2330 .ring_test = &cik_ring_test,
2331 .ib_test = &cik_ib_test,
2332 .is_lockup = &cik_gfx_is_lockup,
2333 .vm_flush = &cik_vm_flush,
2334 .get_rptr = &radeon_ring_generic_get_rptr,
2335 .get_wptr = &radeon_ring_generic_get_wptr,
2336 .set_wptr = &radeon_ring_generic_set_wptr,
2337 },
2338 [CAYMAN_RING_TYPE_CP1_INDEX] = {
2339 .ib_execute = &cik_ring_ib_execute,
2340 .ib_parse = &cik_ib_parse,
2341 .emit_fence = &cik_fence_compute_ring_emit,
2342 .emit_semaphore = &cik_semaphore_ring_emit,
2343 .cs_parse = NULL,
2344 .ring_test = &cik_ring_test,
2345 .ib_test = &cik_ib_test,
2346 .is_lockup = &cik_gfx_is_lockup,
2347 .vm_flush = &cik_vm_flush,
2348 .get_rptr = &cik_compute_ring_get_rptr,
2349 .get_wptr = &cik_compute_ring_get_wptr,
2350 .set_wptr = &cik_compute_ring_set_wptr,
2351 },
2352 [CAYMAN_RING_TYPE_CP2_INDEX] = {
2353 .ib_execute = &cik_ring_ib_execute,
2354 .ib_parse = &cik_ib_parse,
2355 .emit_fence = &cik_fence_compute_ring_emit,
2356 .emit_semaphore = &cik_semaphore_ring_emit,
2357 .cs_parse = NULL,
2358 .ring_test = &cik_ring_test,
2359 .ib_test = &cik_ib_test,
2360 .is_lockup = &cik_gfx_is_lockup,
2361 .vm_flush = &cik_vm_flush,
2362 .get_rptr = &cik_compute_ring_get_rptr,
2363 .get_wptr = &cik_compute_ring_get_wptr,
2364 .set_wptr = &cik_compute_ring_set_wptr,
2365 },
2366 [R600_RING_TYPE_DMA_INDEX] = {
2367 .ib_execute = &cik_sdma_ring_ib_execute,
2368 .ib_parse = &cik_ib_parse,
2369 .emit_fence = &cik_sdma_fence_ring_emit,
2370 .emit_semaphore = &cik_sdma_semaphore_ring_emit,
2371 .cs_parse = NULL,
2372 .ring_test = &cik_sdma_ring_test,
2373 .ib_test = &cik_sdma_ib_test,
2374 .is_lockup = &cik_sdma_is_lockup,
2375 .vm_flush = &cik_dma_vm_flush,
2376 .get_rptr = &radeon_ring_generic_get_rptr,
2377 .get_wptr = &radeon_ring_generic_get_wptr,
2378 .set_wptr = &radeon_ring_generic_set_wptr,
2379 },
2380 [CAYMAN_RING_TYPE_DMA1_INDEX] = {
2381 .ib_execute = &cik_sdma_ring_ib_execute,
2382 .ib_parse = &cik_ib_parse,
2383 .emit_fence = &cik_sdma_fence_ring_emit,
2384 .emit_semaphore = &cik_sdma_semaphore_ring_emit,
2385 .cs_parse = NULL,
2386 .ring_test = &cik_sdma_ring_test,
2387 .ib_test = &cik_sdma_ib_test,
2388 .is_lockup = &cik_sdma_is_lockup,
2389 .vm_flush = &cik_dma_vm_flush,
2390 .get_rptr = &radeon_ring_generic_get_rptr,
2391 .get_wptr = &radeon_ring_generic_get_wptr,
2392 .set_wptr = &radeon_ring_generic_set_wptr,
2393 },
2394 [R600_RING_TYPE_UVD_INDEX] = {
2395 .ib_execute = &r600_uvd_ib_execute,
2396 .emit_fence = &r600_uvd_fence_emit,
2397 .emit_semaphore = &cayman_uvd_semaphore_emit,
2398 .cs_parse = &radeon_uvd_cs_parse,
2399 .ring_test = &r600_uvd_ring_test,
2400 .ib_test = &r600_uvd_ib_test,
2401 .is_lockup = &radeon_ring_test_lockup,
2402 .get_rptr = &radeon_ring_generic_get_rptr,
2403 .get_wptr = &radeon_ring_generic_get_wptr,
2404 .set_wptr = &radeon_ring_generic_set_wptr,
2405 }
2406 },
2407 .irq = {
2408 .set = &cik_irq_set,
2409 .process = &cik_irq_process,
2410 },
2411 .display = {
2412 .bandwidth_update = &dce8_bandwidth_update,
2413 .get_vblank_counter = &evergreen_get_vblank_counter,
2414 .wait_for_vblank = &dce4_wait_for_vblank,
2415 },
2416 .copy = {
2417 .blit = NULL,
2418 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
2419 .dma = &cik_copy_dma,
2420 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
2421 .copy = &cik_copy_dma,
2422 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
2423 },
2424 .surface = {
2425 .set_reg = r600_set_surface_reg,
2426 .clear_reg = r600_clear_surface_reg,
2427 },
2428 .hpd = {
2429 .init = &evergreen_hpd_init,
2430 .fini = &evergreen_hpd_fini,
2431 .sense = &evergreen_hpd_sense,
2432 .set_polarity = &evergreen_hpd_set_polarity,
2433 },
2434 .pm = {
2435 .misc = &evergreen_pm_misc,
2436 .prepare = &evergreen_pm_prepare,
2437 .finish = &evergreen_pm_finish,
2438 .init_profile = &sumo_pm_init_profile,
2439 .get_dynpm_state = &r600_pm_get_dynpm_state,
2440 .get_engine_clock = &radeon_atom_get_engine_clock,
2441 .set_engine_clock = &radeon_atom_set_engine_clock,
2442 .get_memory_clock = &radeon_atom_get_memory_clock,
2443 .set_memory_clock = &radeon_atom_set_memory_clock,
2444 .get_pcie_lanes = NULL,
2445 .set_pcie_lanes = NULL,
2446 .set_clock_gating = NULL,
2447 .set_uvd_clocks = &cik_set_uvd_clocks,
2448 },
2449 .pflip = {
2450 .pre_page_flip = &evergreen_pre_page_flip,
2451 .page_flip = &evergreen_page_flip,
2452 .post_page_flip = &evergreen_post_page_flip,
2453 },
2454};
2455
2456static struct radeon_asic kv_asic = {
2457 .init = &cik_init,
2458 .fini = &cik_fini,
2459 .suspend = &cik_suspend,
2460 .resume = &cik_resume,
2461 .asic_reset = &cik_asic_reset,
2462 .vga_set_state = &r600_vga_set_state,
2463 .ioctl_wait_idle = NULL,
2464 .gui_idle = &r600_gui_idle,
2465 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
2466 .get_xclk = &cik_get_xclk,
2467 .get_gpu_clock_counter = &cik_get_gpu_clock_counter,
2468 .gart = {
2469 .tlb_flush = &cik_pcie_gart_tlb_flush,
2470 .set_page = &rs600_gart_set_page,
2471 },
2472 .vm = {
2473 .init = &cik_vm_init,
2474 .fini = &cik_vm_fini,
2475 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
2476 .set_page = &cik_vm_set_page,
2477 },
2478 .ring = {
2479 [RADEON_RING_TYPE_GFX_INDEX] = {
2480 .ib_execute = &cik_ring_ib_execute,
2481 .ib_parse = &cik_ib_parse,
2482 .emit_fence = &cik_fence_gfx_ring_emit,
2483 .emit_semaphore = &cik_semaphore_ring_emit,
2484 .cs_parse = NULL,
2485 .ring_test = &cik_ring_test,
2486 .ib_test = &cik_ib_test,
2487 .is_lockup = &cik_gfx_is_lockup,
2488 .vm_flush = &cik_vm_flush,
2489 .get_rptr = &radeon_ring_generic_get_rptr,
2490 .get_wptr = &radeon_ring_generic_get_wptr,
2491 .set_wptr = &radeon_ring_generic_set_wptr,
2492 },
2493 [CAYMAN_RING_TYPE_CP1_INDEX] = {
2494 .ib_execute = &cik_ring_ib_execute,
2495 .ib_parse = &cik_ib_parse,
2496 .emit_fence = &cik_fence_compute_ring_emit,
2497 .emit_semaphore = &cik_semaphore_ring_emit,
2498 .cs_parse = NULL,
2499 .ring_test = &cik_ring_test,
2500 .ib_test = &cik_ib_test,
2501 .is_lockup = &cik_gfx_is_lockup,
2502 .vm_flush = &cik_vm_flush,
2503 .get_rptr = &cik_compute_ring_get_rptr,
2504 .get_wptr = &cik_compute_ring_get_wptr,
2505 .set_wptr = &cik_compute_ring_set_wptr,
2506 },
2507 [CAYMAN_RING_TYPE_CP2_INDEX] = {
2508 .ib_execute = &cik_ring_ib_execute,
2509 .ib_parse = &cik_ib_parse,
2510 .emit_fence = &cik_fence_compute_ring_emit,
2511 .emit_semaphore = &cik_semaphore_ring_emit,
2512 .cs_parse = NULL,
2513 .ring_test = &cik_ring_test,
2514 .ib_test = &cik_ib_test,
2515 .is_lockup = &cik_gfx_is_lockup,
2516 .vm_flush = &cik_vm_flush,
2517 .get_rptr = &cik_compute_ring_get_rptr,
2518 .get_wptr = &cik_compute_ring_get_wptr,
2519 .set_wptr = &cik_compute_ring_set_wptr,
2520 },
2521 [R600_RING_TYPE_DMA_INDEX] = {
2522 .ib_execute = &cik_sdma_ring_ib_execute,
2523 .ib_parse = &cik_ib_parse,
2524 .emit_fence = &cik_sdma_fence_ring_emit,
2525 .emit_semaphore = &cik_sdma_semaphore_ring_emit,
2526 .cs_parse = NULL,
2527 .ring_test = &cik_sdma_ring_test,
2528 .ib_test = &cik_sdma_ib_test,
2529 .is_lockup = &cik_sdma_is_lockup,
2530 .vm_flush = &cik_dma_vm_flush,
2531 .get_rptr = &radeon_ring_generic_get_rptr,
2532 .get_wptr = &radeon_ring_generic_get_wptr,
2533 .set_wptr = &radeon_ring_generic_set_wptr,
2534 },
2535 [CAYMAN_RING_TYPE_DMA1_INDEX] = {
2536 .ib_execute = &cik_sdma_ring_ib_execute,
2537 .ib_parse = &cik_ib_parse,
2538 .emit_fence = &cik_sdma_fence_ring_emit,
2539 .emit_semaphore = &cik_sdma_semaphore_ring_emit,
2540 .cs_parse = NULL,
2541 .ring_test = &cik_sdma_ring_test,
2542 .ib_test = &cik_sdma_ib_test,
2543 .is_lockup = &cik_sdma_is_lockup,
2544 .vm_flush = &cik_dma_vm_flush,
2545 .get_rptr = &radeon_ring_generic_get_rptr,
2546 .get_wptr = &radeon_ring_generic_get_wptr,
2547 .set_wptr = &radeon_ring_generic_set_wptr,
2548 },
2549 [R600_RING_TYPE_UVD_INDEX] = {
2550 .ib_execute = &r600_uvd_ib_execute,
2551 .emit_fence = &r600_uvd_fence_emit,
2552 .emit_semaphore = &cayman_uvd_semaphore_emit,
2553 .cs_parse = &radeon_uvd_cs_parse,
2554 .ring_test = &r600_uvd_ring_test,
2555 .ib_test = &r600_uvd_ib_test,
2556 .is_lockup = &radeon_ring_test_lockup,
2557 .get_rptr = &radeon_ring_generic_get_rptr,
2558 .get_wptr = &radeon_ring_generic_get_wptr,
2559 .set_wptr = &radeon_ring_generic_set_wptr,
2560 }
2561 },
2562 .irq = {
2563 .set = &cik_irq_set,
2564 .process = &cik_irq_process,
2565 },
2566 .display = {
2567 .bandwidth_update = &dce8_bandwidth_update,
2568 .get_vblank_counter = &evergreen_get_vblank_counter,
2569 .wait_for_vblank = &dce4_wait_for_vblank,
2570 },
2571 .copy = {
2572 .blit = NULL,
2573 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
2574 .dma = &cik_copy_dma,
2575 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
2576 .copy = &cik_copy_dma,
2577 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
2578 },
2579 .surface = {
2580 .set_reg = r600_set_surface_reg,
2581 .clear_reg = r600_clear_surface_reg,
2582 },
2583 .hpd = {
2584 .init = &evergreen_hpd_init,
2585 .fini = &evergreen_hpd_fini,
2586 .sense = &evergreen_hpd_sense,
2587 .set_polarity = &evergreen_hpd_set_polarity,
2588 },
2589 .pm = {
2590 .misc = &evergreen_pm_misc,
2591 .prepare = &evergreen_pm_prepare,
2592 .finish = &evergreen_pm_finish,
2593 .init_profile = &sumo_pm_init_profile,
2594 .get_dynpm_state = &r600_pm_get_dynpm_state,
2595 .get_engine_clock = &radeon_atom_get_engine_clock,
2596 .set_engine_clock = &radeon_atom_set_engine_clock,
2597 .get_memory_clock = &radeon_atom_get_memory_clock,
2598 .set_memory_clock = &radeon_atom_set_memory_clock,
2599 .get_pcie_lanes = NULL,
2600 .set_pcie_lanes = NULL,
2601 .set_clock_gating = NULL,
2602 .set_uvd_clocks = &cik_set_uvd_clocks,
2603 },
2604 .pflip = {
2605 .pre_page_flip = &evergreen_pre_page_flip,
2606 .page_flip = &evergreen_page_flip,
2607 .post_page_flip = &evergreen_post_page_flip,
2608 },
2609};
2610
Alex Deucherabf1dc62012-07-17 14:02:36 -04002611/**
2612 * radeon_asic_init - register asic specific callbacks
2613 *
2614 * @rdev: radeon device pointer
2615 *
2616 * Registers the appropriate asic specific callbacks for each
2617 * chip family. Also sets other asics specific info like the number
2618 * of crtcs and the register aperture accessors (all asics).
2619 * Returns 0 for success.
2620 */
Daniel Vetter0a10c852010-03-11 21:19:14 +00002621int radeon_asic_init(struct radeon_device *rdev)
2622{
2623 radeon_register_accessor_init(rdev);
Alex Deucherba7e05e2011-06-16 18:14:22 +00002624
2625 /* set the number of crtcs */
2626 if (rdev->flags & RADEON_SINGLE_CRTC)
2627 rdev->num_crtc = 1;
2628 else
2629 rdev->num_crtc = 2;
2630
Alex Deucher948bee32013-05-14 12:08:35 -04002631 rdev->has_uvd = false;
2632
Daniel Vetter0a10c852010-03-11 21:19:14 +00002633 switch (rdev->family) {
2634 case CHIP_R100:
2635 case CHIP_RV100:
2636 case CHIP_RS100:
2637 case CHIP_RV200:
2638 case CHIP_RS200:
2639 rdev->asic = &r100_asic;
2640 break;
2641 case CHIP_R200:
2642 case CHIP_RV250:
2643 case CHIP_RS300:
2644 case CHIP_RV280:
2645 rdev->asic = &r200_asic;
2646 break;
2647 case CHIP_R300:
2648 case CHIP_R350:
2649 case CHIP_RV350:
2650 case CHIP_RV380:
2651 if (rdev->flags & RADEON_IS_PCIE)
2652 rdev->asic = &r300_asic_pcie;
2653 else
2654 rdev->asic = &r300_asic;
2655 break;
2656 case CHIP_R420:
2657 case CHIP_R423:
2658 case CHIP_RV410:
2659 rdev->asic = &r420_asic;
Alex Deucher07bb0842010-06-22 21:58:26 -04002660 /* handle macs */
2661 if (rdev->bios == NULL) {
Alex Deucher798bcf72012-02-23 17:53:48 -05002662 rdev->asic->pm.get_engine_clock = &radeon_legacy_get_engine_clock;
2663 rdev->asic->pm.set_engine_clock = &radeon_legacy_set_engine_clock;
2664 rdev->asic->pm.get_memory_clock = &radeon_legacy_get_memory_clock;
2665 rdev->asic->pm.set_memory_clock = NULL;
Alex Deucher37e9b6a2012-08-03 11:39:43 -04002666 rdev->asic->display.set_backlight_level = &radeon_legacy_set_backlight_level;
Alex Deucher07bb0842010-06-22 21:58:26 -04002667 }
Daniel Vetter0a10c852010-03-11 21:19:14 +00002668 break;
2669 case CHIP_RS400:
2670 case CHIP_RS480:
2671 rdev->asic = &rs400_asic;
2672 break;
2673 case CHIP_RS600:
2674 rdev->asic = &rs600_asic;
2675 break;
2676 case CHIP_RS690:
2677 case CHIP_RS740:
2678 rdev->asic = &rs690_asic;
2679 break;
2680 case CHIP_RV515:
2681 rdev->asic = &rv515_asic;
2682 break;
2683 case CHIP_R520:
2684 case CHIP_RV530:
2685 case CHIP_RV560:
2686 case CHIP_RV570:
2687 case CHIP_R580:
2688 rdev->asic = &r520_asic;
2689 break;
2690 case CHIP_R600:
Alex Deucherca361b62013-06-21 14:42:08 -04002691 rdev->asic = &r600_asic;
2692 break;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002693 case CHIP_RV610:
2694 case CHIP_RV630:
2695 case CHIP_RV620:
2696 case CHIP_RV635:
2697 case CHIP_RV670:
Alex Deucherca361b62013-06-21 14:42:08 -04002698 rdev->asic = &rv6xx_asic;
2699 rdev->has_uvd = true;
Alex Deucherf47299c2010-03-16 20:54:38 -04002700 break;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002701 case CHIP_RS780:
2702 case CHIP_RS880:
Alex Deucherf47299c2010-03-16 20:54:38 -04002703 rdev->asic = &rs780_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002704 rdev->has_uvd = true;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002705 break;
2706 case CHIP_RV770:
2707 case CHIP_RV730:
2708 case CHIP_RV710:
2709 case CHIP_RV740:
2710 rdev->asic = &rv770_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002711 rdev->has_uvd = true;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002712 break;
2713 case CHIP_CEDAR:
2714 case CHIP_REDWOOD:
2715 case CHIP_JUNIPER:
2716 case CHIP_CYPRESS:
2717 case CHIP_HEMLOCK:
Alex Deucherba7e05e2011-06-16 18:14:22 +00002718 /* set num crtcs */
2719 if (rdev->family == CHIP_CEDAR)
2720 rdev->num_crtc = 4;
2721 else
2722 rdev->num_crtc = 6;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002723 rdev->asic = &evergreen_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002724 rdev->has_uvd = true;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002725 break;
Alex Deucher958261d2010-11-22 17:56:30 -05002726 case CHIP_PALM:
Alex Deucher89da5a32011-05-31 15:42:47 -04002727 case CHIP_SUMO:
2728 case CHIP_SUMO2:
Alex Deucher958261d2010-11-22 17:56:30 -05002729 rdev->asic = &sumo_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002730 rdev->has_uvd = true;
Alex Deucher958261d2010-11-22 17:56:30 -05002731 break;
Alex Deuchera43b7662011-01-06 21:19:33 -05002732 case CHIP_BARTS:
2733 case CHIP_TURKS:
2734 case CHIP_CAICOS:
Alex Deucherba7e05e2011-06-16 18:14:22 +00002735 /* set num crtcs */
2736 if (rdev->family == CHIP_CAICOS)
2737 rdev->num_crtc = 4;
2738 else
2739 rdev->num_crtc = 6;
Alex Deuchera43b7662011-01-06 21:19:33 -05002740 rdev->asic = &btc_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002741 rdev->has_uvd = true;
Alex Deuchera43b7662011-01-06 21:19:33 -05002742 break;
Alex Deuchere3487622011-03-02 20:07:36 -05002743 case CHIP_CAYMAN:
2744 rdev->asic = &cayman_asic;
Alex Deucherba7e05e2011-06-16 18:14:22 +00002745 /* set num crtcs */
2746 rdev->num_crtc = 6;
Alex Deucher948bee32013-05-14 12:08:35 -04002747 rdev->has_uvd = true;
Alex Deuchere3487622011-03-02 20:07:36 -05002748 break;
Alex Deucherbe63fe82012-03-20 17:18:40 -04002749 case CHIP_ARUBA:
2750 rdev->asic = &trinity_asic;
2751 /* set num crtcs */
2752 rdev->num_crtc = 4;
Alex Deucher948bee32013-05-14 12:08:35 -04002753 rdev->has_uvd = true;
Alex Deucherbe63fe82012-03-20 17:18:40 -04002754 break;
Alex Deucher02779c02012-03-20 17:18:25 -04002755 case CHIP_TAHITI:
2756 case CHIP_PITCAIRN:
2757 case CHIP_VERDE:
Alex Deuchere737a142012-08-30 14:00:03 -04002758 case CHIP_OLAND:
Alex Deucher86a45ca2012-07-26 19:04:20 -04002759 case CHIP_HAINAN:
Alex Deucher02779c02012-03-20 17:18:25 -04002760 rdev->asic = &si_asic;
2761 /* set num crtcs */
Alex Deucher86a45ca2012-07-26 19:04:20 -04002762 if (rdev->family == CHIP_HAINAN)
2763 rdev->num_crtc = 0;
2764 else if (rdev->family == CHIP_OLAND)
Alex Deuchere737a142012-08-30 14:00:03 -04002765 rdev->num_crtc = 2;
2766 else
2767 rdev->num_crtc = 6;
Alex Deucher948bee32013-05-14 12:08:35 -04002768 if (rdev->family == CHIP_HAINAN)
2769 rdev->has_uvd = false;
2770 else
2771 rdev->has_uvd = true;
Alex Deucher02779c02012-03-20 17:18:25 -04002772 break;
Alex Deucher0672e272013-04-09 16:22:31 -04002773 case CHIP_BONAIRE:
2774 rdev->asic = &ci_asic;
2775 rdev->num_crtc = 6;
2776 break;
2777 case CHIP_KAVERI:
2778 case CHIP_KABINI:
2779 rdev->asic = &kv_asic;
2780 /* set num crtcs */
2781 if (rdev->family == CHIP_KAVERI)
2782 rdev->num_crtc = 4;
2783 else
2784 rdev->num_crtc = 2;
2785 break;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002786 default:
2787 /* FIXME: not supported yet */
2788 return -EINVAL;
2789 }
2790
2791 if (rdev->flags & RADEON_IS_IGP) {
Alex Deucher798bcf72012-02-23 17:53:48 -05002792 rdev->asic->pm.get_memory_clock = NULL;
2793 rdev->asic->pm.set_memory_clock = NULL;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002794 }
2795
Daniel Vetter0a10c852010-03-11 21:19:14 +00002796 return 0;
2797}
2798