blob: 1419eddf5e1d660e8430268746dbbd8246aaf673 [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,
1155 .set_power_state = &rv6xx_dpm_set_power_state,
1156 .display_configuration_changed = &rv6xx_dpm_display_configuration_changed,
1157 .fini = &rv6xx_dpm_fini,
1158 .get_sclk = &rv6xx_dpm_get_sclk,
1159 .get_mclk = &rv6xx_dpm_get_mclk,
1160 .print_power_state = &rv6xx_dpm_print_power_state,
1161 },
Alex Deucherca361b62013-06-21 14:42:08 -04001162 .pflip = {
1163 .pre_page_flip = &rs600_pre_page_flip,
1164 .page_flip = &rs600_page_flip,
1165 .post_page_flip = &rs600_post_page_flip,
1166 },
1167};
1168
Alex Deucherf47299c2010-03-16 20:54:38 -04001169static struct radeon_asic rs780_asic = {
1170 .init = &r600_init,
1171 .fini = &r600_fini,
1172 .suspend = &r600_suspend,
1173 .resume = &r600_resume,
Alex Deucherf47299c2010-03-16 20:54:38 -04001174 .vga_set_state = &r600_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +00001175 .asic_reset = &r600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -05001176 .ioctl_wait_idle = r600_ioctl_wait_idle,
1177 .gui_idle = &r600_gui_idle,
1178 .mc_wait_for_idle = &r600_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001179 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001180 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001181 .gart = {
1182 .tlb_flush = &r600_pcie_gart_tlb_flush,
1183 .set_page = &rs600_gart_set_page,
1184 },
Christian König4c87bc22011-10-19 19:02:21 +02001185 .ring = {
1186 [RADEON_RING_TYPE_GFX_INDEX] = {
1187 .ib_execute = &r600_ring_ib_execute,
1188 .emit_fence = &r600_fence_ring_emit,
1189 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001190 .cs_parse = &r600_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001191 .ring_test = &r600_ring_test,
1192 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001193 .is_lockup = &r600_gfx_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001194 .get_rptr = &radeon_ring_generic_get_rptr,
1195 .get_wptr = &radeon_ring_generic_get_wptr,
1196 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher4d756582012-09-27 15:08:35 -04001197 },
1198 [R600_RING_TYPE_DMA_INDEX] = {
1199 .ib_execute = &r600_dma_ring_ib_execute,
1200 .emit_fence = &r600_dma_fence_ring_emit,
1201 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deuchercf4ccd02011-11-18 10:19:47 -05001202 .cs_parse = &r600_dma_cs_parse,
Alex Deucher4d756582012-09-27 15:08:35 -04001203 .ring_test = &r600_dma_ring_test,
1204 .ib_test = &r600_dma_ib_test,
1205 .is_lockup = &r600_dma_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001206 .get_rptr = &radeon_ring_generic_get_rptr,
1207 .get_wptr = &radeon_ring_generic_get_wptr,
1208 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +02001209 }
1210 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001211 .irq = {
1212 .set = &r600_irq_set,
1213 .process = &r600_irq_process,
1214 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001215 .display = {
1216 .bandwidth_update = &rs690_bandwidth_update,
1217 .get_vblank_counter = &rs600_get_vblank_counter,
1218 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001219 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001220 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001221 .hdmi_enable = &r600_hdmi_enable,
1222 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001223 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001224 .copy = {
1225 .blit = &r600_copy_blit,
1226 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher4d756582012-09-27 15:08:35 -04001227 .dma = &r600_copy_dma,
1228 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001229 .copy = &r600_copy_dma,
1230 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001231 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001232 .surface = {
1233 .set_reg = r600_set_surface_reg,
1234 .clear_reg = r600_clear_surface_reg,
1235 },
Alex Deucher901ea572012-02-23 17:53:39 -05001236 .hpd = {
1237 .init = &r600_hpd_init,
1238 .fini = &r600_hpd_fini,
1239 .sense = &r600_hpd_sense,
1240 .set_polarity = &r600_hpd_set_polarity,
1241 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001242 .pm = {
1243 .misc = &r600_pm_misc,
1244 .prepare = &rs600_pm_prepare,
1245 .finish = &rs600_pm_finish,
1246 .init_profile = &rs780_pm_init_profile,
1247 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001248 .get_engine_clock = &radeon_atom_get_engine_clock,
1249 .set_engine_clock = &radeon_atom_set_engine_clock,
1250 .get_memory_clock = NULL,
1251 .set_memory_clock = NULL,
1252 .get_pcie_lanes = NULL,
1253 .set_pcie_lanes = NULL,
1254 .set_clock_gating = NULL,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001255 .get_temperature = &rv6xx_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001256 },
Alex Deucher9d670062013-04-12 13:59:22 -04001257 .dpm = {
1258 .init = &rs780_dpm_init,
1259 .setup_asic = &rs780_dpm_setup_asic,
1260 .enable = &rs780_dpm_enable,
1261 .disable = &rs780_dpm_disable,
1262 .set_power_state = &rs780_dpm_set_power_state,
1263 .display_configuration_changed = &rs780_dpm_display_configuration_changed,
1264 .fini = &rs780_dpm_fini,
1265 .get_sclk = &rs780_dpm_get_sclk,
1266 .get_mclk = &rs780_dpm_get_mclk,
1267 .print_power_state = &rs780_dpm_print_power_state,
1268 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001269 .pflip = {
1270 .pre_page_flip = &rs600_pre_page_flip,
1271 .page_flip = &rs600_page_flip,
1272 .post_page_flip = &rs600_post_page_flip,
1273 },
Alex Deucherf47299c2010-03-16 20:54:38 -04001274};
1275
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001276static struct radeon_asic rv770_asic = {
1277 .init = &rv770_init,
1278 .fini = &rv770_fini,
1279 .suspend = &rv770_suspend,
1280 .resume = &rv770_resume,
Jerome Glissea2d07b72010-03-09 14:45:11 +00001281 .asic_reset = &r600_asic_reset,
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001282 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001283 .ioctl_wait_idle = r600_ioctl_wait_idle,
1284 .gui_idle = &r600_gui_idle,
1285 .mc_wait_for_idle = &r600_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001286 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001287 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001288 .gart = {
1289 .tlb_flush = &r600_pcie_gart_tlb_flush,
1290 .set_page = &rs600_gart_set_page,
1291 },
Christian König4c87bc22011-10-19 19:02:21 +02001292 .ring = {
1293 [RADEON_RING_TYPE_GFX_INDEX] = {
1294 .ib_execute = &r600_ring_ib_execute,
1295 .emit_fence = &r600_fence_ring_emit,
1296 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001297 .cs_parse = &r600_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001298 .ring_test = &r600_ring_test,
1299 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001300 .is_lockup = &r600_gfx_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001301 .get_rptr = &radeon_ring_generic_get_rptr,
1302 .get_wptr = &radeon_ring_generic_get_wptr,
1303 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher4d756582012-09-27 15:08:35 -04001304 },
1305 [R600_RING_TYPE_DMA_INDEX] = {
1306 .ib_execute = &r600_dma_ring_ib_execute,
1307 .emit_fence = &r600_dma_fence_ring_emit,
1308 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deuchercf4ccd02011-11-18 10:19:47 -05001309 .cs_parse = &r600_dma_cs_parse,
Alex Deucher4d756582012-09-27 15:08:35 -04001310 .ring_test = &r600_dma_ring_test,
1311 .ib_test = &r600_dma_ib_test,
1312 .is_lockup = &r600_dma_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001313 .get_rptr = &radeon_ring_generic_get_rptr,
1314 .get_wptr = &radeon_ring_generic_get_wptr,
1315 .set_wptr = &radeon_ring_generic_set_wptr,
Christian Königf2ba57b2013-04-08 12:41:29 +02001316 },
1317 [R600_RING_TYPE_UVD_INDEX] = {
1318 .ib_execute = &r600_uvd_ib_execute,
1319 .emit_fence = &r600_uvd_fence_emit,
1320 .emit_semaphore = &r600_uvd_semaphore_emit,
1321 .cs_parse = &radeon_uvd_cs_parse,
1322 .ring_test = &r600_uvd_ring_test,
1323 .ib_test = &r600_uvd_ib_test,
1324 .is_lockup = &radeon_ring_test_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001325 .get_rptr = &radeon_ring_generic_get_rptr,
1326 .get_wptr = &radeon_ring_generic_get_wptr,
1327 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +02001328 }
1329 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001330 .irq = {
1331 .set = &r600_irq_set,
1332 .process = &r600_irq_process,
1333 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001334 .display = {
1335 .bandwidth_update = &rv515_bandwidth_update,
1336 .get_vblank_counter = &rs600_get_vblank_counter,
1337 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001338 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001339 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001340 .hdmi_enable = &r600_hdmi_enable,
1341 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001342 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001343 .copy = {
1344 .blit = &r600_copy_blit,
1345 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher43fb7782013-01-04 09:24:18 -05001346 .dma = &rv770_copy_dma,
Alex Deucher4d756582012-09-27 15:08:35 -04001347 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher43fb7782013-01-04 09:24:18 -05001348 .copy = &rv770_copy_dma,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001349 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001350 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001351 .surface = {
1352 .set_reg = r600_set_surface_reg,
1353 .clear_reg = r600_clear_surface_reg,
1354 },
Alex Deucher901ea572012-02-23 17:53:39 -05001355 .hpd = {
1356 .init = &r600_hpd_init,
1357 .fini = &r600_hpd_fini,
1358 .sense = &r600_hpd_sense,
1359 .set_polarity = &r600_hpd_set_polarity,
1360 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001361 .pm = {
1362 .misc = &rv770_pm_misc,
1363 .prepare = &rs600_pm_prepare,
1364 .finish = &rs600_pm_finish,
1365 .init_profile = &r600_pm_init_profile,
1366 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001367 .get_engine_clock = &radeon_atom_get_engine_clock,
1368 .set_engine_clock = &radeon_atom_set_engine_clock,
1369 .get_memory_clock = &radeon_atom_get_memory_clock,
1370 .set_memory_clock = &radeon_atom_set_memory_clock,
1371 .get_pcie_lanes = &r600_get_pcie_lanes,
1372 .set_pcie_lanes = &r600_set_pcie_lanes,
1373 .set_clock_gating = &radeon_atom_set_clock_gating,
Christian Königef0e6e62013-04-08 12:41:35 +02001374 .set_uvd_clocks = &rv770_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001375 .get_temperature = &rv770_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001376 },
Alex Deucher66229b22013-06-26 00:11:19 -04001377 .dpm = {
1378 .init = &rv770_dpm_init,
1379 .setup_asic = &rv770_dpm_setup_asic,
1380 .enable = &rv770_dpm_enable,
1381 .disable = &rv770_dpm_disable,
1382 .set_power_state = &rv770_dpm_set_power_state,
1383 .display_configuration_changed = &rv770_dpm_display_configuration_changed,
1384 .fini = &rv770_dpm_fini,
1385 .get_sclk = &rv770_dpm_get_sclk,
1386 .get_mclk = &rv770_dpm_get_mclk,
1387 .print_power_state = &rv770_dpm_print_power_state,
1388 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001389 .pflip = {
1390 .pre_page_flip = &rs600_pre_page_flip,
1391 .page_flip = &rv770_page_flip,
1392 .post_page_flip = &rs600_post_page_flip,
1393 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001394};
1395
1396static struct radeon_asic evergreen_asic = {
1397 .init = &evergreen_init,
1398 .fini = &evergreen_fini,
1399 .suspend = &evergreen_suspend,
1400 .resume = &evergreen_resume,
Jerome Glissea2d07b72010-03-09 14:45:11 +00001401 .asic_reset = &evergreen_asic_reset,
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001402 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001403 .ioctl_wait_idle = r600_ioctl_wait_idle,
1404 .gui_idle = &r600_gui_idle,
1405 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001406 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001407 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001408 .gart = {
1409 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1410 .set_page = &rs600_gart_set_page,
1411 },
Christian König4c87bc22011-10-19 19:02:21 +02001412 .ring = {
1413 [RADEON_RING_TYPE_GFX_INDEX] = {
1414 .ib_execute = &evergreen_ring_ib_execute,
1415 .emit_fence = &r600_fence_ring_emit,
1416 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001417 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001418 .ring_test = &r600_ring_test,
1419 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001420 .is_lockup = &evergreen_gfx_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001421 .get_rptr = &radeon_ring_generic_get_rptr,
1422 .get_wptr = &radeon_ring_generic_get_wptr,
1423 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001424 },
1425 [R600_RING_TYPE_DMA_INDEX] = {
1426 .ib_execute = &evergreen_dma_ring_ib_execute,
1427 .emit_fence = &evergreen_dma_fence_ring_emit,
1428 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001429 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001430 .ring_test = &r600_dma_ring_test,
1431 .ib_test = &r600_dma_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001432 .is_lockup = &evergreen_dma_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001433 .get_rptr = &radeon_ring_generic_get_rptr,
1434 .get_wptr = &radeon_ring_generic_get_wptr,
1435 .set_wptr = &radeon_ring_generic_set_wptr,
Christian Königf2ba57b2013-04-08 12:41:29 +02001436 },
1437 [R600_RING_TYPE_UVD_INDEX] = {
1438 .ib_execute = &r600_uvd_ib_execute,
1439 .emit_fence = &r600_uvd_fence_emit,
1440 .emit_semaphore = &r600_uvd_semaphore_emit,
1441 .cs_parse = &radeon_uvd_cs_parse,
1442 .ring_test = &r600_uvd_ring_test,
1443 .ib_test = &r600_uvd_ib_test,
1444 .is_lockup = &radeon_ring_test_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001445 .get_rptr = &radeon_ring_generic_get_rptr,
1446 .get_wptr = &radeon_ring_generic_get_wptr,
1447 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +02001448 }
1449 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001450 .irq = {
1451 .set = &evergreen_irq_set,
1452 .process = &evergreen_irq_process,
1453 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001454 .display = {
1455 .bandwidth_update = &evergreen_bandwidth_update,
1456 .get_vblank_counter = &evergreen_get_vblank_counter,
1457 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001458 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001459 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001460 .hdmi_enable = &evergreen_hdmi_enable,
1461 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001462 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001463 .copy = {
1464 .blit = &r600_copy_blit,
1465 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001466 .dma = &evergreen_copy_dma,
1467 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001468 .copy = &evergreen_copy_dma,
1469 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001470 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001471 .surface = {
1472 .set_reg = r600_set_surface_reg,
1473 .clear_reg = r600_clear_surface_reg,
1474 },
Alex Deucher901ea572012-02-23 17:53:39 -05001475 .hpd = {
1476 .init = &evergreen_hpd_init,
1477 .fini = &evergreen_hpd_fini,
1478 .sense = &evergreen_hpd_sense,
1479 .set_polarity = &evergreen_hpd_set_polarity,
1480 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001481 .pm = {
1482 .misc = &evergreen_pm_misc,
1483 .prepare = &evergreen_pm_prepare,
1484 .finish = &evergreen_pm_finish,
1485 .init_profile = &r600_pm_init_profile,
1486 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001487 .get_engine_clock = &radeon_atom_get_engine_clock,
1488 .set_engine_clock = &radeon_atom_set_engine_clock,
1489 .get_memory_clock = &radeon_atom_get_memory_clock,
1490 .set_memory_clock = &radeon_atom_set_memory_clock,
1491 .get_pcie_lanes = &r600_get_pcie_lanes,
1492 .set_pcie_lanes = &r600_set_pcie_lanes,
1493 .set_clock_gating = NULL,
Alex Deuchera8b49252013-04-08 12:41:33 +02001494 .set_uvd_clocks = &evergreen_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001495 .get_temperature = &evergreen_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001496 },
Alex Deucherdc50ba72013-06-26 00:33:35 -04001497 .dpm = {
1498 .init = &cypress_dpm_init,
1499 .setup_asic = &cypress_dpm_setup_asic,
1500 .enable = &cypress_dpm_enable,
1501 .disable = &cypress_dpm_disable,
1502 .set_power_state = &cypress_dpm_set_power_state,
1503 .display_configuration_changed = &cypress_dpm_display_configuration_changed,
1504 .fini = &cypress_dpm_fini,
1505 .get_sclk = &rv770_dpm_get_sclk,
1506 .get_mclk = &rv770_dpm_get_mclk,
1507 .print_power_state = &rv770_dpm_print_power_state,
1508 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001509 .pflip = {
1510 .pre_page_flip = &evergreen_pre_page_flip,
1511 .page_flip = &evergreen_page_flip,
1512 .post_page_flip = &evergreen_post_page_flip,
1513 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001514};
1515
Alex Deucher958261d2010-11-22 17:56:30 -05001516static struct radeon_asic sumo_asic = {
1517 .init = &evergreen_init,
1518 .fini = &evergreen_fini,
1519 .suspend = &evergreen_suspend,
1520 .resume = &evergreen_resume,
Alex Deucher958261d2010-11-22 17:56:30 -05001521 .asic_reset = &evergreen_asic_reset,
1522 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001523 .ioctl_wait_idle = r600_ioctl_wait_idle,
1524 .gui_idle = &r600_gui_idle,
1525 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001526 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001527 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001528 .gart = {
1529 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1530 .set_page = &rs600_gart_set_page,
1531 },
Christian König4c87bc22011-10-19 19:02:21 +02001532 .ring = {
1533 [RADEON_RING_TYPE_GFX_INDEX] = {
1534 .ib_execute = &evergreen_ring_ib_execute,
1535 .emit_fence = &r600_fence_ring_emit,
1536 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001537 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001538 .ring_test = &r600_ring_test,
1539 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001540 .is_lockup = &evergreen_gfx_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001541 .get_rptr = &radeon_ring_generic_get_rptr,
1542 .get_wptr = &radeon_ring_generic_get_wptr,
1543 .set_wptr = &radeon_ring_generic_set_wptr,
Christian Königeb0c19c2012-02-23 15:18:44 +01001544 },
Alex Deucher233d1ad2012-12-04 15:25:59 -05001545 [R600_RING_TYPE_DMA_INDEX] = {
1546 .ib_execute = &evergreen_dma_ring_ib_execute,
1547 .emit_fence = &evergreen_dma_fence_ring_emit,
1548 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001549 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001550 .ring_test = &r600_dma_ring_test,
1551 .ib_test = &r600_dma_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001552 .is_lockup = &evergreen_dma_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001553 .get_rptr = &radeon_ring_generic_get_rptr,
1554 .get_wptr = &radeon_ring_generic_get_wptr,
1555 .set_wptr = &radeon_ring_generic_set_wptr,
Christian Königf2ba57b2013-04-08 12:41:29 +02001556 },
1557 [R600_RING_TYPE_UVD_INDEX] = {
1558 .ib_execute = &r600_uvd_ib_execute,
1559 .emit_fence = &r600_uvd_fence_emit,
1560 .emit_semaphore = &r600_uvd_semaphore_emit,
1561 .cs_parse = &radeon_uvd_cs_parse,
1562 .ring_test = &r600_uvd_ring_test,
1563 .ib_test = &r600_uvd_ib_test,
1564 .is_lockup = &radeon_ring_test_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001565 .get_rptr = &radeon_ring_generic_get_rptr,
1566 .get_wptr = &radeon_ring_generic_get_wptr,
1567 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001568 }
Christian König4c87bc22011-10-19 19:02:21 +02001569 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001570 .irq = {
1571 .set = &evergreen_irq_set,
1572 .process = &evergreen_irq_process,
1573 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001574 .display = {
1575 .bandwidth_update = &evergreen_bandwidth_update,
1576 .get_vblank_counter = &evergreen_get_vblank_counter,
1577 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001578 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001579 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001580 .hdmi_enable = &evergreen_hdmi_enable,
1581 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001582 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001583 .copy = {
1584 .blit = &r600_copy_blit,
1585 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001586 .dma = &evergreen_copy_dma,
1587 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001588 .copy = &evergreen_copy_dma,
1589 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001590 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001591 .surface = {
1592 .set_reg = r600_set_surface_reg,
1593 .clear_reg = r600_clear_surface_reg,
1594 },
Alex Deucher901ea572012-02-23 17:53:39 -05001595 .hpd = {
1596 .init = &evergreen_hpd_init,
1597 .fini = &evergreen_hpd_fini,
1598 .sense = &evergreen_hpd_sense,
1599 .set_polarity = &evergreen_hpd_set_polarity,
1600 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001601 .pm = {
1602 .misc = &evergreen_pm_misc,
1603 .prepare = &evergreen_pm_prepare,
1604 .finish = &evergreen_pm_finish,
1605 .init_profile = &sumo_pm_init_profile,
1606 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001607 .get_engine_clock = &radeon_atom_get_engine_clock,
1608 .set_engine_clock = &radeon_atom_set_engine_clock,
1609 .get_memory_clock = NULL,
1610 .set_memory_clock = NULL,
1611 .get_pcie_lanes = NULL,
1612 .set_pcie_lanes = NULL,
1613 .set_clock_gating = NULL,
Alex Deucher23d33ba2013-04-08 12:41:32 +02001614 .set_uvd_clocks = &sumo_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001615 .get_temperature = &sumo_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001616 },
Alex Deucher80ea2c12013-04-12 14:56:21 -04001617 .dpm = {
1618 .init = &sumo_dpm_init,
1619 .setup_asic = &sumo_dpm_setup_asic,
1620 .enable = &sumo_dpm_enable,
1621 .disable = &sumo_dpm_disable,
1622 .set_power_state = &sumo_dpm_set_power_state,
1623 .display_configuration_changed = &sumo_dpm_display_configuration_changed,
1624 .fini = &sumo_dpm_fini,
1625 .get_sclk = &sumo_dpm_get_sclk,
1626 .get_mclk = &sumo_dpm_get_mclk,
1627 .print_power_state = &sumo_dpm_print_power_state,
1628 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001629 .pflip = {
1630 .pre_page_flip = &evergreen_pre_page_flip,
1631 .page_flip = &evergreen_page_flip,
1632 .post_page_flip = &evergreen_post_page_flip,
1633 },
Alex Deucher958261d2010-11-22 17:56:30 -05001634};
1635
Alex Deuchera43b7662011-01-06 21:19:33 -05001636static struct radeon_asic btc_asic = {
1637 .init = &evergreen_init,
1638 .fini = &evergreen_fini,
1639 .suspend = &evergreen_suspend,
1640 .resume = &evergreen_resume,
Alex Deuchera43b7662011-01-06 21:19:33 -05001641 .asic_reset = &evergreen_asic_reset,
1642 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001643 .ioctl_wait_idle = r600_ioctl_wait_idle,
1644 .gui_idle = &r600_gui_idle,
1645 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001646 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001647 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001648 .gart = {
1649 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1650 .set_page = &rs600_gart_set_page,
1651 },
Christian König4c87bc22011-10-19 19:02:21 +02001652 .ring = {
1653 [RADEON_RING_TYPE_GFX_INDEX] = {
1654 .ib_execute = &evergreen_ring_ib_execute,
1655 .emit_fence = &r600_fence_ring_emit,
1656 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001657 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001658 .ring_test = &r600_ring_test,
1659 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001660 .is_lockup = &evergreen_gfx_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001661 .get_rptr = &radeon_ring_generic_get_rptr,
1662 .get_wptr = &radeon_ring_generic_get_wptr,
1663 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001664 },
1665 [R600_RING_TYPE_DMA_INDEX] = {
1666 .ib_execute = &evergreen_dma_ring_ib_execute,
1667 .emit_fence = &evergreen_dma_fence_ring_emit,
1668 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001669 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001670 .ring_test = &r600_dma_ring_test,
1671 .ib_test = &r600_dma_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001672 .is_lockup = &evergreen_dma_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001673 .get_rptr = &radeon_ring_generic_get_rptr,
1674 .get_wptr = &radeon_ring_generic_get_wptr,
1675 .set_wptr = &radeon_ring_generic_set_wptr,
Christian Königf2ba57b2013-04-08 12:41:29 +02001676 },
1677 [R600_RING_TYPE_UVD_INDEX] = {
1678 .ib_execute = &r600_uvd_ib_execute,
1679 .emit_fence = &r600_uvd_fence_emit,
1680 .emit_semaphore = &r600_uvd_semaphore_emit,
1681 .cs_parse = &radeon_uvd_cs_parse,
1682 .ring_test = &r600_uvd_ring_test,
1683 .ib_test = &r600_uvd_ib_test,
1684 .is_lockup = &radeon_ring_test_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001685 .get_rptr = &radeon_ring_generic_get_rptr,
1686 .get_wptr = &radeon_ring_generic_get_wptr,
1687 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +02001688 }
1689 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001690 .irq = {
1691 .set = &evergreen_irq_set,
1692 .process = &evergreen_irq_process,
1693 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001694 .display = {
1695 .bandwidth_update = &evergreen_bandwidth_update,
1696 .get_vblank_counter = &evergreen_get_vblank_counter,
1697 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001698 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001699 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001700 .hdmi_enable = &evergreen_hdmi_enable,
1701 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001702 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001703 .copy = {
1704 .blit = &r600_copy_blit,
1705 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001706 .dma = &evergreen_copy_dma,
1707 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001708 .copy = &evergreen_copy_dma,
1709 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001710 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001711 .surface = {
1712 .set_reg = r600_set_surface_reg,
1713 .clear_reg = r600_clear_surface_reg,
1714 },
Alex Deucher901ea572012-02-23 17:53:39 -05001715 .hpd = {
1716 .init = &evergreen_hpd_init,
1717 .fini = &evergreen_hpd_fini,
1718 .sense = &evergreen_hpd_sense,
1719 .set_polarity = &evergreen_hpd_set_polarity,
1720 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001721 .pm = {
1722 .misc = &evergreen_pm_misc,
1723 .prepare = &evergreen_pm_prepare,
1724 .finish = &evergreen_pm_finish,
Alex Deucher27810fb2012-10-01 19:25:11 -04001725 .init_profile = &btc_pm_init_profile,
Alex Deuchera02fa392012-02-23 17:53:41 -05001726 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001727 .get_engine_clock = &radeon_atom_get_engine_clock,
1728 .set_engine_clock = &radeon_atom_set_engine_clock,
1729 .get_memory_clock = &radeon_atom_get_memory_clock,
1730 .set_memory_clock = &radeon_atom_set_memory_clock,
Alex Deucher55b615a2013-03-18 18:57:27 -04001731 .get_pcie_lanes = &r600_get_pcie_lanes,
1732 .set_pcie_lanes = &r600_set_pcie_lanes,
Alex Deucher798bcf72012-02-23 17:53:48 -05001733 .set_clock_gating = NULL,
Alex Deuchera8b49252013-04-08 12:41:33 +02001734 .set_uvd_clocks = &evergreen_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001735 .get_temperature = &evergreen_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001736 },
Alex Deucher6596afd2013-06-26 00:15:24 -04001737 .dpm = {
1738 .init = &btc_dpm_init,
1739 .setup_asic = &btc_dpm_setup_asic,
1740 .enable = &btc_dpm_enable,
1741 .disable = &btc_dpm_disable,
1742 .set_power_state = &btc_dpm_set_power_state,
1743 .display_configuration_changed = &cypress_dpm_display_configuration_changed,
1744 .fini = &btc_dpm_fini,
1745 .get_sclk = &rv770_dpm_get_sclk,
1746 .get_mclk = &rv770_dpm_get_mclk,
1747 .print_power_state = &rv770_dpm_print_power_state,
1748 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001749 .pflip = {
1750 .pre_page_flip = &evergreen_pre_page_flip,
1751 .page_flip = &evergreen_page_flip,
1752 .post_page_flip = &evergreen_post_page_flip,
1753 },
Alex Deuchera43b7662011-01-06 21:19:33 -05001754};
1755
Alex Deuchere3487622011-03-02 20:07:36 -05001756static struct radeon_asic cayman_asic = {
1757 .init = &cayman_init,
1758 .fini = &cayman_fini,
1759 .suspend = &cayman_suspend,
1760 .resume = &cayman_resume,
Alex Deuchere3487622011-03-02 20:07:36 -05001761 .asic_reset = &cayman_asic_reset,
1762 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001763 .ioctl_wait_idle = r600_ioctl_wait_idle,
1764 .gui_idle = &r600_gui_idle,
1765 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001766 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001767 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001768 .gart = {
1769 .tlb_flush = &cayman_pcie_gart_tlb_flush,
1770 .set_page = &rs600_gart_set_page,
1771 },
Christian König05b07142012-08-06 20:21:10 +02001772 .vm = {
1773 .init = &cayman_vm_init,
1774 .fini = &cayman_vm_fini,
Alex Deucherdf160042013-01-31 16:26:02 -05001775 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
Christian König05b07142012-08-06 20:21:10 +02001776 .set_page = &cayman_vm_set_page,
1777 },
Christian König4c87bc22011-10-19 19:02:21 +02001778 .ring = {
1779 [RADEON_RING_TYPE_GFX_INDEX] = {
Jerome Glisse721604a2012-01-05 22:11:05 -05001780 .ib_execute = &cayman_ring_ib_execute,
1781 .ib_parse = &evergreen_ib_parse,
Alex Deucherb40e7e12011-11-17 14:57:50 -05001782 .emit_fence = &cayman_fence_ring_emit,
Christian König4c87bc22011-10-19 19:02:21 +02001783 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001784 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001785 .ring_test = &r600_ring_test,
1786 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001787 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001788 .vm_flush = &cayman_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001789 .get_rptr = &radeon_ring_generic_get_rptr,
1790 .get_wptr = &radeon_ring_generic_get_wptr,
1791 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +02001792 },
1793 [CAYMAN_RING_TYPE_CP1_INDEX] = {
Jerome Glisse721604a2012-01-05 22:11:05 -05001794 .ib_execute = &cayman_ring_ib_execute,
1795 .ib_parse = &evergreen_ib_parse,
Alex Deucherb40e7e12011-11-17 14:57:50 -05001796 .emit_fence = &cayman_fence_ring_emit,
Christian König4c87bc22011-10-19 19:02:21 +02001797 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001798 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001799 .ring_test = &r600_ring_test,
1800 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001801 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001802 .vm_flush = &cayman_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001803 .get_rptr = &radeon_ring_generic_get_rptr,
1804 .get_wptr = &radeon_ring_generic_get_wptr,
1805 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +02001806 },
1807 [CAYMAN_RING_TYPE_CP2_INDEX] = {
Jerome Glisse721604a2012-01-05 22:11:05 -05001808 .ib_execute = &cayman_ring_ib_execute,
1809 .ib_parse = &evergreen_ib_parse,
Alex Deucherb40e7e12011-11-17 14:57:50 -05001810 .emit_fence = &cayman_fence_ring_emit,
Christian König4c87bc22011-10-19 19:02:21 +02001811 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001812 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001813 .ring_test = &r600_ring_test,
1814 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001815 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001816 .vm_flush = &cayman_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001817 .get_rptr = &radeon_ring_generic_get_rptr,
1818 .get_wptr = &radeon_ring_generic_get_wptr,
1819 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001820 },
1821 [R600_RING_TYPE_DMA_INDEX] = {
1822 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05001823 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001824 .emit_fence = &evergreen_dma_fence_ring_emit,
1825 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001826 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001827 .ring_test = &r600_dma_ring_test,
1828 .ib_test = &r600_dma_ib_test,
1829 .is_lockup = &cayman_dma_is_lockup,
1830 .vm_flush = &cayman_dma_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001831 .get_rptr = &radeon_ring_generic_get_rptr,
1832 .get_wptr = &radeon_ring_generic_get_wptr,
1833 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001834 },
1835 [CAYMAN_RING_TYPE_DMA1_INDEX] = {
1836 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05001837 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001838 .emit_fence = &evergreen_dma_fence_ring_emit,
1839 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001840 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001841 .ring_test = &r600_dma_ring_test,
1842 .ib_test = &r600_dma_ib_test,
1843 .is_lockup = &cayman_dma_is_lockup,
1844 .vm_flush = &cayman_dma_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001845 .get_rptr = &radeon_ring_generic_get_rptr,
1846 .get_wptr = &radeon_ring_generic_get_wptr,
1847 .set_wptr = &radeon_ring_generic_set_wptr,
Christian Königf2ba57b2013-04-08 12:41:29 +02001848 },
1849 [R600_RING_TYPE_UVD_INDEX] = {
1850 .ib_execute = &r600_uvd_ib_execute,
1851 .emit_fence = &r600_uvd_fence_emit,
1852 .emit_semaphore = &cayman_uvd_semaphore_emit,
1853 .cs_parse = &radeon_uvd_cs_parse,
1854 .ring_test = &r600_uvd_ring_test,
1855 .ib_test = &r600_uvd_ib_test,
1856 .is_lockup = &radeon_ring_test_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001857 .get_rptr = &radeon_ring_generic_get_rptr,
1858 .get_wptr = &radeon_ring_generic_get_wptr,
1859 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +02001860 }
1861 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001862 .irq = {
1863 .set = &evergreen_irq_set,
1864 .process = &evergreen_irq_process,
1865 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001866 .display = {
1867 .bandwidth_update = &evergreen_bandwidth_update,
1868 .get_vblank_counter = &evergreen_get_vblank_counter,
1869 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001870 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001871 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001872 .hdmi_enable = &evergreen_hdmi_enable,
1873 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001874 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001875 .copy = {
1876 .blit = &r600_copy_blit,
1877 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001878 .dma = &evergreen_copy_dma,
1879 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001880 .copy = &evergreen_copy_dma,
1881 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001882 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001883 .surface = {
1884 .set_reg = r600_set_surface_reg,
1885 .clear_reg = r600_clear_surface_reg,
1886 },
Alex Deucher901ea572012-02-23 17:53:39 -05001887 .hpd = {
1888 .init = &evergreen_hpd_init,
1889 .fini = &evergreen_hpd_fini,
1890 .sense = &evergreen_hpd_sense,
1891 .set_polarity = &evergreen_hpd_set_polarity,
1892 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001893 .pm = {
1894 .misc = &evergreen_pm_misc,
1895 .prepare = &evergreen_pm_prepare,
1896 .finish = &evergreen_pm_finish,
Alex Deucher27810fb2012-10-01 19:25:11 -04001897 .init_profile = &btc_pm_init_profile,
Alex Deuchera02fa392012-02-23 17:53:41 -05001898 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001899 .get_engine_clock = &radeon_atom_get_engine_clock,
1900 .set_engine_clock = &radeon_atom_set_engine_clock,
1901 .get_memory_clock = &radeon_atom_get_memory_clock,
1902 .set_memory_clock = &radeon_atom_set_memory_clock,
Alex Deucher55b615a2013-03-18 18:57:27 -04001903 .get_pcie_lanes = &r600_get_pcie_lanes,
1904 .set_pcie_lanes = &r600_set_pcie_lanes,
Alex Deucher798bcf72012-02-23 17:53:48 -05001905 .set_clock_gating = NULL,
Alex Deuchera8b49252013-04-08 12:41:33 +02001906 .set_uvd_clocks = &evergreen_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001907 .get_temperature = &evergreen_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001908 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001909 .pflip = {
1910 .pre_page_flip = &evergreen_pre_page_flip,
1911 .page_flip = &evergreen_page_flip,
1912 .post_page_flip = &evergreen_post_page_flip,
1913 },
Alex Deuchere3487622011-03-02 20:07:36 -05001914};
1915
Alex Deucherbe63fe82012-03-20 17:18:40 -04001916static struct radeon_asic trinity_asic = {
1917 .init = &cayman_init,
1918 .fini = &cayman_fini,
1919 .suspend = &cayman_suspend,
1920 .resume = &cayman_resume,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001921 .asic_reset = &cayman_asic_reset,
1922 .vga_set_state = &r600_vga_set_state,
1923 .ioctl_wait_idle = r600_ioctl_wait_idle,
1924 .gui_idle = &r600_gui_idle,
1925 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001926 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001927 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001928 .gart = {
1929 .tlb_flush = &cayman_pcie_gart_tlb_flush,
1930 .set_page = &rs600_gart_set_page,
1931 },
Christian König05b07142012-08-06 20:21:10 +02001932 .vm = {
1933 .init = &cayman_vm_init,
1934 .fini = &cayman_vm_fini,
Alex Deucherdf160042013-01-31 16:26:02 -05001935 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
Christian König05b07142012-08-06 20:21:10 +02001936 .set_page = &cayman_vm_set_page,
1937 },
Alex Deucherbe63fe82012-03-20 17:18:40 -04001938 .ring = {
1939 [RADEON_RING_TYPE_GFX_INDEX] = {
1940 .ib_execute = &cayman_ring_ib_execute,
1941 .ib_parse = &evergreen_ib_parse,
1942 .emit_fence = &cayman_fence_ring_emit,
1943 .emit_semaphore = &r600_semaphore_ring_emit,
1944 .cs_parse = &evergreen_cs_parse,
1945 .ring_test = &r600_ring_test,
1946 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001947 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001948 .vm_flush = &cayman_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001949 .get_rptr = &radeon_ring_generic_get_rptr,
1950 .get_wptr = &radeon_ring_generic_get_wptr,
1951 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001952 },
1953 [CAYMAN_RING_TYPE_CP1_INDEX] = {
1954 .ib_execute = &cayman_ring_ib_execute,
1955 .ib_parse = &evergreen_ib_parse,
1956 .emit_fence = &cayman_fence_ring_emit,
1957 .emit_semaphore = &r600_semaphore_ring_emit,
1958 .cs_parse = &evergreen_cs_parse,
1959 .ring_test = &r600_ring_test,
1960 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001961 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001962 .vm_flush = &cayman_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001963 .get_rptr = &radeon_ring_generic_get_rptr,
1964 .get_wptr = &radeon_ring_generic_get_wptr,
1965 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001966 },
1967 [CAYMAN_RING_TYPE_CP2_INDEX] = {
1968 .ib_execute = &cayman_ring_ib_execute,
1969 .ib_parse = &evergreen_ib_parse,
1970 .emit_fence = &cayman_fence_ring_emit,
1971 .emit_semaphore = &r600_semaphore_ring_emit,
1972 .cs_parse = &evergreen_cs_parse,
1973 .ring_test = &r600_ring_test,
1974 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001975 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001976 .vm_flush = &cayman_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001977 .get_rptr = &radeon_ring_generic_get_rptr,
1978 .get_wptr = &radeon_ring_generic_get_wptr,
1979 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001980 },
1981 [R600_RING_TYPE_DMA_INDEX] = {
1982 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05001983 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001984 .emit_fence = &evergreen_dma_fence_ring_emit,
1985 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001986 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001987 .ring_test = &r600_dma_ring_test,
1988 .ib_test = &r600_dma_ib_test,
1989 .is_lockup = &cayman_dma_is_lockup,
1990 .vm_flush = &cayman_dma_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001991 .get_rptr = &radeon_ring_generic_get_rptr,
1992 .get_wptr = &radeon_ring_generic_get_wptr,
1993 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001994 },
1995 [CAYMAN_RING_TYPE_DMA1_INDEX] = {
1996 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05001997 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001998 .emit_fence = &evergreen_dma_fence_ring_emit,
1999 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05002000 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05002001 .ring_test = &r600_dma_ring_test,
2002 .ib_test = &r600_dma_ib_test,
2003 .is_lockup = &cayman_dma_is_lockup,
2004 .vm_flush = &cayman_dma_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002005 .get_rptr = &radeon_ring_generic_get_rptr,
2006 .get_wptr = &radeon_ring_generic_get_wptr,
2007 .set_wptr = &radeon_ring_generic_set_wptr,
Christian Königf2ba57b2013-04-08 12:41:29 +02002008 },
2009 [R600_RING_TYPE_UVD_INDEX] = {
2010 .ib_execute = &r600_uvd_ib_execute,
2011 .emit_fence = &r600_uvd_fence_emit,
2012 .emit_semaphore = &cayman_uvd_semaphore_emit,
2013 .cs_parse = &radeon_uvd_cs_parse,
2014 .ring_test = &r600_uvd_ring_test,
2015 .ib_test = &r600_uvd_ib_test,
2016 .is_lockup = &radeon_ring_test_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002017 .get_rptr = &radeon_ring_generic_get_rptr,
2018 .get_wptr = &radeon_ring_generic_get_wptr,
2019 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucherbe63fe82012-03-20 17:18:40 -04002020 }
2021 },
2022 .irq = {
2023 .set = &evergreen_irq_set,
2024 .process = &evergreen_irq_process,
2025 },
2026 .display = {
2027 .bandwidth_update = &dce6_bandwidth_update,
2028 .get_vblank_counter = &evergreen_get_vblank_counter,
2029 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04002030 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04002031 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherbe63fe82012-03-20 17:18:40 -04002032 },
2033 .copy = {
2034 .blit = &r600_copy_blit,
2035 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucherf60cbd12012-12-04 15:27:33 -05002036 .dma = &evergreen_copy_dma,
2037 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04002038 .copy = &evergreen_copy_dma,
2039 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucherbe63fe82012-03-20 17:18:40 -04002040 },
2041 .surface = {
2042 .set_reg = r600_set_surface_reg,
2043 .clear_reg = r600_clear_surface_reg,
2044 },
2045 .hpd = {
2046 .init = &evergreen_hpd_init,
2047 .fini = &evergreen_hpd_fini,
2048 .sense = &evergreen_hpd_sense,
2049 .set_polarity = &evergreen_hpd_set_polarity,
2050 },
2051 .pm = {
2052 .misc = &evergreen_pm_misc,
2053 .prepare = &evergreen_pm_prepare,
2054 .finish = &evergreen_pm_finish,
2055 .init_profile = &sumo_pm_init_profile,
2056 .get_dynpm_state = &r600_pm_get_dynpm_state,
2057 .get_engine_clock = &radeon_atom_get_engine_clock,
2058 .set_engine_clock = &radeon_atom_set_engine_clock,
2059 .get_memory_clock = NULL,
2060 .set_memory_clock = NULL,
2061 .get_pcie_lanes = NULL,
2062 .set_pcie_lanes = NULL,
2063 .set_clock_gating = NULL,
Alex Deucher23d33ba2013-04-08 12:41:32 +02002064 .set_uvd_clocks = &sumo_set_uvd_clocks,
Alex Deucher29a15222012-12-14 11:57:36 -05002065 .get_temperature = &tn_get_temp,
Alex Deucherbe63fe82012-03-20 17:18:40 -04002066 },
2067 .pflip = {
2068 .pre_page_flip = &evergreen_pre_page_flip,
2069 .page_flip = &evergreen_page_flip,
2070 .post_page_flip = &evergreen_post_page_flip,
2071 },
2072};
2073
Alex Deucher02779c02012-03-20 17:18:25 -04002074static struct radeon_asic si_asic = {
2075 .init = &si_init,
2076 .fini = &si_fini,
2077 .suspend = &si_suspend,
2078 .resume = &si_resume,
Alex Deucher02779c02012-03-20 17:18:25 -04002079 .asic_reset = &si_asic_reset,
2080 .vga_set_state = &r600_vga_set_state,
2081 .ioctl_wait_idle = r600_ioctl_wait_idle,
2082 .gui_idle = &r600_gui_idle,
2083 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05002084 .get_xclk = &si_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05002085 .get_gpu_clock_counter = &si_get_gpu_clock_counter,
Alex Deucher02779c02012-03-20 17:18:25 -04002086 .gart = {
2087 .tlb_flush = &si_pcie_gart_tlb_flush,
2088 .set_page = &rs600_gart_set_page,
2089 },
Christian König05b07142012-08-06 20:21:10 +02002090 .vm = {
2091 .init = &si_vm_init,
2092 .fini = &si_vm_fini,
Alex Deucherdf160042013-01-31 16:26:02 -05002093 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher82ffd922012-10-02 14:47:46 -04002094 .set_page = &si_vm_set_page,
Christian König05b07142012-08-06 20:21:10 +02002095 },
Alex Deucher02779c02012-03-20 17:18:25 -04002096 .ring = {
2097 [RADEON_RING_TYPE_GFX_INDEX] = {
2098 .ib_execute = &si_ring_ib_execute,
2099 .ib_parse = &si_ib_parse,
2100 .emit_fence = &si_fence_ring_emit,
2101 .emit_semaphore = &r600_semaphore_ring_emit,
2102 .cs_parse = NULL,
2103 .ring_test = &r600_ring_test,
2104 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05002105 .is_lockup = &si_gfx_is_lockup,
Christian Königee60e292012-08-09 16:21:08 +02002106 .vm_flush = &si_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002107 .get_rptr = &radeon_ring_generic_get_rptr,
2108 .get_wptr = &radeon_ring_generic_get_wptr,
2109 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher02779c02012-03-20 17:18:25 -04002110 },
2111 [CAYMAN_RING_TYPE_CP1_INDEX] = {
2112 .ib_execute = &si_ring_ib_execute,
2113 .ib_parse = &si_ib_parse,
2114 .emit_fence = &si_fence_ring_emit,
2115 .emit_semaphore = &r600_semaphore_ring_emit,
2116 .cs_parse = NULL,
2117 .ring_test = &r600_ring_test,
2118 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05002119 .is_lockup = &si_gfx_is_lockup,
Christian Königee60e292012-08-09 16:21:08 +02002120 .vm_flush = &si_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002121 .get_rptr = &radeon_ring_generic_get_rptr,
2122 .get_wptr = &radeon_ring_generic_get_wptr,
2123 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher02779c02012-03-20 17:18:25 -04002124 },
2125 [CAYMAN_RING_TYPE_CP2_INDEX] = {
2126 .ib_execute = &si_ring_ib_execute,
2127 .ib_parse = &si_ib_parse,
2128 .emit_fence = &si_fence_ring_emit,
2129 .emit_semaphore = &r600_semaphore_ring_emit,
2130 .cs_parse = NULL,
2131 .ring_test = &r600_ring_test,
2132 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05002133 .is_lockup = &si_gfx_is_lockup,
Christian Königee60e292012-08-09 16:21:08 +02002134 .vm_flush = &si_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002135 .get_rptr = &radeon_ring_generic_get_rptr,
2136 .get_wptr = &radeon_ring_generic_get_wptr,
2137 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05002138 },
2139 [R600_RING_TYPE_DMA_INDEX] = {
2140 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05002141 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05002142 .emit_fence = &evergreen_dma_fence_ring_emit,
2143 .emit_semaphore = &r600_dma_semaphore_ring_emit,
2144 .cs_parse = NULL,
2145 .ring_test = &r600_dma_ring_test,
2146 .ib_test = &r600_dma_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05002147 .is_lockup = &si_dma_is_lockup,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05002148 .vm_flush = &si_dma_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002149 .get_rptr = &radeon_ring_generic_get_rptr,
2150 .get_wptr = &radeon_ring_generic_get_wptr,
2151 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05002152 },
2153 [CAYMAN_RING_TYPE_DMA1_INDEX] = {
2154 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05002155 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05002156 .emit_fence = &evergreen_dma_fence_ring_emit,
2157 .emit_semaphore = &r600_dma_semaphore_ring_emit,
2158 .cs_parse = NULL,
2159 .ring_test = &r600_dma_ring_test,
2160 .ib_test = &r600_dma_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05002161 .is_lockup = &si_dma_is_lockup,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05002162 .vm_flush = &si_dma_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002163 .get_rptr = &radeon_ring_generic_get_rptr,
2164 .get_wptr = &radeon_ring_generic_get_wptr,
2165 .set_wptr = &radeon_ring_generic_set_wptr,
Christian Königf2ba57b2013-04-08 12:41:29 +02002166 },
2167 [R600_RING_TYPE_UVD_INDEX] = {
2168 .ib_execute = &r600_uvd_ib_execute,
2169 .emit_fence = &r600_uvd_fence_emit,
2170 .emit_semaphore = &cayman_uvd_semaphore_emit,
2171 .cs_parse = &radeon_uvd_cs_parse,
2172 .ring_test = &r600_uvd_ring_test,
2173 .ib_test = &r600_uvd_ib_test,
2174 .is_lockup = &radeon_ring_test_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002175 .get_rptr = &radeon_ring_generic_get_rptr,
2176 .get_wptr = &radeon_ring_generic_get_wptr,
2177 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher02779c02012-03-20 17:18:25 -04002178 }
2179 },
2180 .irq = {
2181 .set = &si_irq_set,
2182 .process = &si_irq_process,
2183 },
2184 .display = {
2185 .bandwidth_update = &dce6_bandwidth_update,
2186 .get_vblank_counter = &evergreen_get_vblank_counter,
2187 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04002188 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04002189 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucher02779c02012-03-20 17:18:25 -04002190 },
2191 .copy = {
2192 .blit = NULL,
2193 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05002194 .dma = &si_copy_dma,
2195 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04002196 .copy = &si_copy_dma,
2197 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher02779c02012-03-20 17:18:25 -04002198 },
2199 .surface = {
2200 .set_reg = r600_set_surface_reg,
2201 .clear_reg = r600_clear_surface_reg,
2202 },
2203 .hpd = {
2204 .init = &evergreen_hpd_init,
2205 .fini = &evergreen_hpd_fini,
2206 .sense = &evergreen_hpd_sense,
2207 .set_polarity = &evergreen_hpd_set_polarity,
2208 },
2209 .pm = {
2210 .misc = &evergreen_pm_misc,
2211 .prepare = &evergreen_pm_prepare,
2212 .finish = &evergreen_pm_finish,
2213 .init_profile = &sumo_pm_init_profile,
2214 .get_dynpm_state = &r600_pm_get_dynpm_state,
2215 .get_engine_clock = &radeon_atom_get_engine_clock,
2216 .set_engine_clock = &radeon_atom_set_engine_clock,
2217 .get_memory_clock = &radeon_atom_get_memory_clock,
2218 .set_memory_clock = &radeon_atom_set_memory_clock,
Alex Deucher55b615a2013-03-18 18:57:27 -04002219 .get_pcie_lanes = &r600_get_pcie_lanes,
2220 .set_pcie_lanes = &r600_set_pcie_lanes,
Alex Deucher02779c02012-03-20 17:18:25 -04002221 .set_clock_gating = NULL,
Christian König2539eb02013-04-08 12:41:34 +02002222 .set_uvd_clocks = &si_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04002223 .get_temperature = &si_get_temp,
Alex Deucher02779c02012-03-20 17:18:25 -04002224 },
2225 .pflip = {
2226 .pre_page_flip = &evergreen_pre_page_flip,
2227 .page_flip = &evergreen_page_flip,
2228 .post_page_flip = &evergreen_post_page_flip,
2229 },
2230};
2231
Alex Deucher0672e272013-04-09 16:22:31 -04002232static struct radeon_asic ci_asic = {
2233 .init = &cik_init,
2234 .fini = &cik_fini,
2235 .suspend = &cik_suspend,
2236 .resume = &cik_resume,
2237 .asic_reset = &cik_asic_reset,
2238 .vga_set_state = &r600_vga_set_state,
2239 .ioctl_wait_idle = NULL,
2240 .gui_idle = &r600_gui_idle,
2241 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
2242 .get_xclk = &cik_get_xclk,
2243 .get_gpu_clock_counter = &cik_get_gpu_clock_counter,
2244 .gart = {
2245 .tlb_flush = &cik_pcie_gart_tlb_flush,
2246 .set_page = &rs600_gart_set_page,
2247 },
2248 .vm = {
2249 .init = &cik_vm_init,
2250 .fini = &cik_vm_fini,
2251 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
2252 .set_page = &cik_vm_set_page,
2253 },
2254 .ring = {
2255 [RADEON_RING_TYPE_GFX_INDEX] = {
2256 .ib_execute = &cik_ring_ib_execute,
2257 .ib_parse = &cik_ib_parse,
2258 .emit_fence = &cik_fence_gfx_ring_emit,
2259 .emit_semaphore = &cik_semaphore_ring_emit,
2260 .cs_parse = NULL,
2261 .ring_test = &cik_ring_test,
2262 .ib_test = &cik_ib_test,
2263 .is_lockup = &cik_gfx_is_lockup,
2264 .vm_flush = &cik_vm_flush,
2265 .get_rptr = &radeon_ring_generic_get_rptr,
2266 .get_wptr = &radeon_ring_generic_get_wptr,
2267 .set_wptr = &radeon_ring_generic_set_wptr,
2268 },
2269 [CAYMAN_RING_TYPE_CP1_INDEX] = {
2270 .ib_execute = &cik_ring_ib_execute,
2271 .ib_parse = &cik_ib_parse,
2272 .emit_fence = &cik_fence_compute_ring_emit,
2273 .emit_semaphore = &cik_semaphore_ring_emit,
2274 .cs_parse = NULL,
2275 .ring_test = &cik_ring_test,
2276 .ib_test = &cik_ib_test,
2277 .is_lockup = &cik_gfx_is_lockup,
2278 .vm_flush = &cik_vm_flush,
2279 .get_rptr = &cik_compute_ring_get_rptr,
2280 .get_wptr = &cik_compute_ring_get_wptr,
2281 .set_wptr = &cik_compute_ring_set_wptr,
2282 },
2283 [CAYMAN_RING_TYPE_CP2_INDEX] = {
2284 .ib_execute = &cik_ring_ib_execute,
2285 .ib_parse = &cik_ib_parse,
2286 .emit_fence = &cik_fence_compute_ring_emit,
2287 .emit_semaphore = &cik_semaphore_ring_emit,
2288 .cs_parse = NULL,
2289 .ring_test = &cik_ring_test,
2290 .ib_test = &cik_ib_test,
2291 .is_lockup = &cik_gfx_is_lockup,
2292 .vm_flush = &cik_vm_flush,
2293 .get_rptr = &cik_compute_ring_get_rptr,
2294 .get_wptr = &cik_compute_ring_get_wptr,
2295 .set_wptr = &cik_compute_ring_set_wptr,
2296 },
2297 [R600_RING_TYPE_DMA_INDEX] = {
2298 .ib_execute = &cik_sdma_ring_ib_execute,
2299 .ib_parse = &cik_ib_parse,
2300 .emit_fence = &cik_sdma_fence_ring_emit,
2301 .emit_semaphore = &cik_sdma_semaphore_ring_emit,
2302 .cs_parse = NULL,
2303 .ring_test = &cik_sdma_ring_test,
2304 .ib_test = &cik_sdma_ib_test,
2305 .is_lockup = &cik_sdma_is_lockup,
2306 .vm_flush = &cik_dma_vm_flush,
2307 .get_rptr = &radeon_ring_generic_get_rptr,
2308 .get_wptr = &radeon_ring_generic_get_wptr,
2309 .set_wptr = &radeon_ring_generic_set_wptr,
2310 },
2311 [CAYMAN_RING_TYPE_DMA1_INDEX] = {
2312 .ib_execute = &cik_sdma_ring_ib_execute,
2313 .ib_parse = &cik_ib_parse,
2314 .emit_fence = &cik_sdma_fence_ring_emit,
2315 .emit_semaphore = &cik_sdma_semaphore_ring_emit,
2316 .cs_parse = NULL,
2317 .ring_test = &cik_sdma_ring_test,
2318 .ib_test = &cik_sdma_ib_test,
2319 .is_lockup = &cik_sdma_is_lockup,
2320 .vm_flush = &cik_dma_vm_flush,
2321 .get_rptr = &radeon_ring_generic_get_rptr,
2322 .get_wptr = &radeon_ring_generic_get_wptr,
2323 .set_wptr = &radeon_ring_generic_set_wptr,
2324 },
2325 [R600_RING_TYPE_UVD_INDEX] = {
2326 .ib_execute = &r600_uvd_ib_execute,
2327 .emit_fence = &r600_uvd_fence_emit,
2328 .emit_semaphore = &cayman_uvd_semaphore_emit,
2329 .cs_parse = &radeon_uvd_cs_parse,
2330 .ring_test = &r600_uvd_ring_test,
2331 .ib_test = &r600_uvd_ib_test,
2332 .is_lockup = &radeon_ring_test_lockup,
2333 .get_rptr = &radeon_ring_generic_get_rptr,
2334 .get_wptr = &radeon_ring_generic_get_wptr,
2335 .set_wptr = &radeon_ring_generic_set_wptr,
2336 }
2337 },
2338 .irq = {
2339 .set = &cik_irq_set,
2340 .process = &cik_irq_process,
2341 },
2342 .display = {
2343 .bandwidth_update = &dce8_bandwidth_update,
2344 .get_vblank_counter = &evergreen_get_vblank_counter,
2345 .wait_for_vblank = &dce4_wait_for_vblank,
2346 },
2347 .copy = {
2348 .blit = NULL,
2349 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
2350 .dma = &cik_copy_dma,
2351 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
2352 .copy = &cik_copy_dma,
2353 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
2354 },
2355 .surface = {
2356 .set_reg = r600_set_surface_reg,
2357 .clear_reg = r600_clear_surface_reg,
2358 },
2359 .hpd = {
2360 .init = &evergreen_hpd_init,
2361 .fini = &evergreen_hpd_fini,
2362 .sense = &evergreen_hpd_sense,
2363 .set_polarity = &evergreen_hpd_set_polarity,
2364 },
2365 .pm = {
2366 .misc = &evergreen_pm_misc,
2367 .prepare = &evergreen_pm_prepare,
2368 .finish = &evergreen_pm_finish,
2369 .init_profile = &sumo_pm_init_profile,
2370 .get_dynpm_state = &r600_pm_get_dynpm_state,
2371 .get_engine_clock = &radeon_atom_get_engine_clock,
2372 .set_engine_clock = &radeon_atom_set_engine_clock,
2373 .get_memory_clock = &radeon_atom_get_memory_clock,
2374 .set_memory_clock = &radeon_atom_set_memory_clock,
2375 .get_pcie_lanes = NULL,
2376 .set_pcie_lanes = NULL,
2377 .set_clock_gating = NULL,
2378 .set_uvd_clocks = &cik_set_uvd_clocks,
2379 },
2380 .pflip = {
2381 .pre_page_flip = &evergreen_pre_page_flip,
2382 .page_flip = &evergreen_page_flip,
2383 .post_page_flip = &evergreen_post_page_flip,
2384 },
2385};
2386
2387static struct radeon_asic kv_asic = {
2388 .init = &cik_init,
2389 .fini = &cik_fini,
2390 .suspend = &cik_suspend,
2391 .resume = &cik_resume,
2392 .asic_reset = &cik_asic_reset,
2393 .vga_set_state = &r600_vga_set_state,
2394 .ioctl_wait_idle = NULL,
2395 .gui_idle = &r600_gui_idle,
2396 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
2397 .get_xclk = &cik_get_xclk,
2398 .get_gpu_clock_counter = &cik_get_gpu_clock_counter,
2399 .gart = {
2400 .tlb_flush = &cik_pcie_gart_tlb_flush,
2401 .set_page = &rs600_gart_set_page,
2402 },
2403 .vm = {
2404 .init = &cik_vm_init,
2405 .fini = &cik_vm_fini,
2406 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
2407 .set_page = &cik_vm_set_page,
2408 },
2409 .ring = {
2410 [RADEON_RING_TYPE_GFX_INDEX] = {
2411 .ib_execute = &cik_ring_ib_execute,
2412 .ib_parse = &cik_ib_parse,
2413 .emit_fence = &cik_fence_gfx_ring_emit,
2414 .emit_semaphore = &cik_semaphore_ring_emit,
2415 .cs_parse = NULL,
2416 .ring_test = &cik_ring_test,
2417 .ib_test = &cik_ib_test,
2418 .is_lockup = &cik_gfx_is_lockup,
2419 .vm_flush = &cik_vm_flush,
2420 .get_rptr = &radeon_ring_generic_get_rptr,
2421 .get_wptr = &radeon_ring_generic_get_wptr,
2422 .set_wptr = &radeon_ring_generic_set_wptr,
2423 },
2424 [CAYMAN_RING_TYPE_CP1_INDEX] = {
2425 .ib_execute = &cik_ring_ib_execute,
2426 .ib_parse = &cik_ib_parse,
2427 .emit_fence = &cik_fence_compute_ring_emit,
2428 .emit_semaphore = &cik_semaphore_ring_emit,
2429 .cs_parse = NULL,
2430 .ring_test = &cik_ring_test,
2431 .ib_test = &cik_ib_test,
2432 .is_lockup = &cik_gfx_is_lockup,
2433 .vm_flush = &cik_vm_flush,
2434 .get_rptr = &cik_compute_ring_get_rptr,
2435 .get_wptr = &cik_compute_ring_get_wptr,
2436 .set_wptr = &cik_compute_ring_set_wptr,
2437 },
2438 [CAYMAN_RING_TYPE_CP2_INDEX] = {
2439 .ib_execute = &cik_ring_ib_execute,
2440 .ib_parse = &cik_ib_parse,
2441 .emit_fence = &cik_fence_compute_ring_emit,
2442 .emit_semaphore = &cik_semaphore_ring_emit,
2443 .cs_parse = NULL,
2444 .ring_test = &cik_ring_test,
2445 .ib_test = &cik_ib_test,
2446 .is_lockup = &cik_gfx_is_lockup,
2447 .vm_flush = &cik_vm_flush,
2448 .get_rptr = &cik_compute_ring_get_rptr,
2449 .get_wptr = &cik_compute_ring_get_wptr,
2450 .set_wptr = &cik_compute_ring_set_wptr,
2451 },
2452 [R600_RING_TYPE_DMA_INDEX] = {
2453 .ib_execute = &cik_sdma_ring_ib_execute,
2454 .ib_parse = &cik_ib_parse,
2455 .emit_fence = &cik_sdma_fence_ring_emit,
2456 .emit_semaphore = &cik_sdma_semaphore_ring_emit,
2457 .cs_parse = NULL,
2458 .ring_test = &cik_sdma_ring_test,
2459 .ib_test = &cik_sdma_ib_test,
2460 .is_lockup = &cik_sdma_is_lockup,
2461 .vm_flush = &cik_dma_vm_flush,
2462 .get_rptr = &radeon_ring_generic_get_rptr,
2463 .get_wptr = &radeon_ring_generic_get_wptr,
2464 .set_wptr = &radeon_ring_generic_set_wptr,
2465 },
2466 [CAYMAN_RING_TYPE_DMA1_INDEX] = {
2467 .ib_execute = &cik_sdma_ring_ib_execute,
2468 .ib_parse = &cik_ib_parse,
2469 .emit_fence = &cik_sdma_fence_ring_emit,
2470 .emit_semaphore = &cik_sdma_semaphore_ring_emit,
2471 .cs_parse = NULL,
2472 .ring_test = &cik_sdma_ring_test,
2473 .ib_test = &cik_sdma_ib_test,
2474 .is_lockup = &cik_sdma_is_lockup,
2475 .vm_flush = &cik_dma_vm_flush,
2476 .get_rptr = &radeon_ring_generic_get_rptr,
2477 .get_wptr = &radeon_ring_generic_get_wptr,
2478 .set_wptr = &radeon_ring_generic_set_wptr,
2479 },
2480 [R600_RING_TYPE_UVD_INDEX] = {
2481 .ib_execute = &r600_uvd_ib_execute,
2482 .emit_fence = &r600_uvd_fence_emit,
2483 .emit_semaphore = &cayman_uvd_semaphore_emit,
2484 .cs_parse = &radeon_uvd_cs_parse,
2485 .ring_test = &r600_uvd_ring_test,
2486 .ib_test = &r600_uvd_ib_test,
2487 .is_lockup = &radeon_ring_test_lockup,
2488 .get_rptr = &radeon_ring_generic_get_rptr,
2489 .get_wptr = &radeon_ring_generic_get_wptr,
2490 .set_wptr = &radeon_ring_generic_set_wptr,
2491 }
2492 },
2493 .irq = {
2494 .set = &cik_irq_set,
2495 .process = &cik_irq_process,
2496 },
2497 .display = {
2498 .bandwidth_update = &dce8_bandwidth_update,
2499 .get_vblank_counter = &evergreen_get_vblank_counter,
2500 .wait_for_vblank = &dce4_wait_for_vblank,
2501 },
2502 .copy = {
2503 .blit = NULL,
2504 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
2505 .dma = &cik_copy_dma,
2506 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
2507 .copy = &cik_copy_dma,
2508 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
2509 },
2510 .surface = {
2511 .set_reg = r600_set_surface_reg,
2512 .clear_reg = r600_clear_surface_reg,
2513 },
2514 .hpd = {
2515 .init = &evergreen_hpd_init,
2516 .fini = &evergreen_hpd_fini,
2517 .sense = &evergreen_hpd_sense,
2518 .set_polarity = &evergreen_hpd_set_polarity,
2519 },
2520 .pm = {
2521 .misc = &evergreen_pm_misc,
2522 .prepare = &evergreen_pm_prepare,
2523 .finish = &evergreen_pm_finish,
2524 .init_profile = &sumo_pm_init_profile,
2525 .get_dynpm_state = &r600_pm_get_dynpm_state,
2526 .get_engine_clock = &radeon_atom_get_engine_clock,
2527 .set_engine_clock = &radeon_atom_set_engine_clock,
2528 .get_memory_clock = &radeon_atom_get_memory_clock,
2529 .set_memory_clock = &radeon_atom_set_memory_clock,
2530 .get_pcie_lanes = NULL,
2531 .set_pcie_lanes = NULL,
2532 .set_clock_gating = NULL,
2533 .set_uvd_clocks = &cik_set_uvd_clocks,
2534 },
2535 .pflip = {
2536 .pre_page_flip = &evergreen_pre_page_flip,
2537 .page_flip = &evergreen_page_flip,
2538 .post_page_flip = &evergreen_post_page_flip,
2539 },
2540};
2541
Alex Deucherabf1dc62012-07-17 14:02:36 -04002542/**
2543 * radeon_asic_init - register asic specific callbacks
2544 *
2545 * @rdev: radeon device pointer
2546 *
2547 * Registers the appropriate asic specific callbacks for each
2548 * chip family. Also sets other asics specific info like the number
2549 * of crtcs and the register aperture accessors (all asics).
2550 * Returns 0 for success.
2551 */
Daniel Vetter0a10c852010-03-11 21:19:14 +00002552int radeon_asic_init(struct radeon_device *rdev)
2553{
2554 radeon_register_accessor_init(rdev);
Alex Deucherba7e05e2011-06-16 18:14:22 +00002555
2556 /* set the number of crtcs */
2557 if (rdev->flags & RADEON_SINGLE_CRTC)
2558 rdev->num_crtc = 1;
2559 else
2560 rdev->num_crtc = 2;
2561
Alex Deucher948bee32013-05-14 12:08:35 -04002562 rdev->has_uvd = false;
2563
Daniel Vetter0a10c852010-03-11 21:19:14 +00002564 switch (rdev->family) {
2565 case CHIP_R100:
2566 case CHIP_RV100:
2567 case CHIP_RS100:
2568 case CHIP_RV200:
2569 case CHIP_RS200:
2570 rdev->asic = &r100_asic;
2571 break;
2572 case CHIP_R200:
2573 case CHIP_RV250:
2574 case CHIP_RS300:
2575 case CHIP_RV280:
2576 rdev->asic = &r200_asic;
2577 break;
2578 case CHIP_R300:
2579 case CHIP_R350:
2580 case CHIP_RV350:
2581 case CHIP_RV380:
2582 if (rdev->flags & RADEON_IS_PCIE)
2583 rdev->asic = &r300_asic_pcie;
2584 else
2585 rdev->asic = &r300_asic;
2586 break;
2587 case CHIP_R420:
2588 case CHIP_R423:
2589 case CHIP_RV410:
2590 rdev->asic = &r420_asic;
Alex Deucher07bb0842010-06-22 21:58:26 -04002591 /* handle macs */
2592 if (rdev->bios == NULL) {
Alex Deucher798bcf72012-02-23 17:53:48 -05002593 rdev->asic->pm.get_engine_clock = &radeon_legacy_get_engine_clock;
2594 rdev->asic->pm.set_engine_clock = &radeon_legacy_set_engine_clock;
2595 rdev->asic->pm.get_memory_clock = &radeon_legacy_get_memory_clock;
2596 rdev->asic->pm.set_memory_clock = NULL;
Alex Deucher37e9b6a2012-08-03 11:39:43 -04002597 rdev->asic->display.set_backlight_level = &radeon_legacy_set_backlight_level;
Alex Deucher07bb0842010-06-22 21:58:26 -04002598 }
Daniel Vetter0a10c852010-03-11 21:19:14 +00002599 break;
2600 case CHIP_RS400:
2601 case CHIP_RS480:
2602 rdev->asic = &rs400_asic;
2603 break;
2604 case CHIP_RS600:
2605 rdev->asic = &rs600_asic;
2606 break;
2607 case CHIP_RS690:
2608 case CHIP_RS740:
2609 rdev->asic = &rs690_asic;
2610 break;
2611 case CHIP_RV515:
2612 rdev->asic = &rv515_asic;
2613 break;
2614 case CHIP_R520:
2615 case CHIP_RV530:
2616 case CHIP_RV560:
2617 case CHIP_RV570:
2618 case CHIP_R580:
2619 rdev->asic = &r520_asic;
2620 break;
2621 case CHIP_R600:
Alex Deucherca361b62013-06-21 14:42:08 -04002622 rdev->asic = &r600_asic;
2623 break;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002624 case CHIP_RV610:
2625 case CHIP_RV630:
2626 case CHIP_RV620:
2627 case CHIP_RV635:
2628 case CHIP_RV670:
Alex Deucherca361b62013-06-21 14:42:08 -04002629 rdev->asic = &rv6xx_asic;
2630 rdev->has_uvd = true;
Alex Deucherf47299c2010-03-16 20:54:38 -04002631 break;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002632 case CHIP_RS780:
2633 case CHIP_RS880:
Alex Deucherf47299c2010-03-16 20:54:38 -04002634 rdev->asic = &rs780_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002635 rdev->has_uvd = true;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002636 break;
2637 case CHIP_RV770:
2638 case CHIP_RV730:
2639 case CHIP_RV710:
2640 case CHIP_RV740:
2641 rdev->asic = &rv770_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002642 rdev->has_uvd = true;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002643 break;
2644 case CHIP_CEDAR:
2645 case CHIP_REDWOOD:
2646 case CHIP_JUNIPER:
2647 case CHIP_CYPRESS:
2648 case CHIP_HEMLOCK:
Alex Deucherba7e05e2011-06-16 18:14:22 +00002649 /* set num crtcs */
2650 if (rdev->family == CHIP_CEDAR)
2651 rdev->num_crtc = 4;
2652 else
2653 rdev->num_crtc = 6;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002654 rdev->asic = &evergreen_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002655 rdev->has_uvd = true;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002656 break;
Alex Deucher958261d2010-11-22 17:56:30 -05002657 case CHIP_PALM:
Alex Deucher89da5a32011-05-31 15:42:47 -04002658 case CHIP_SUMO:
2659 case CHIP_SUMO2:
Alex Deucher958261d2010-11-22 17:56:30 -05002660 rdev->asic = &sumo_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002661 rdev->has_uvd = true;
Alex Deucher958261d2010-11-22 17:56:30 -05002662 break;
Alex Deuchera43b7662011-01-06 21:19:33 -05002663 case CHIP_BARTS:
2664 case CHIP_TURKS:
2665 case CHIP_CAICOS:
Alex Deucherba7e05e2011-06-16 18:14:22 +00002666 /* set num crtcs */
2667 if (rdev->family == CHIP_CAICOS)
2668 rdev->num_crtc = 4;
2669 else
2670 rdev->num_crtc = 6;
Alex Deuchera43b7662011-01-06 21:19:33 -05002671 rdev->asic = &btc_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002672 rdev->has_uvd = true;
Alex Deuchera43b7662011-01-06 21:19:33 -05002673 break;
Alex Deuchere3487622011-03-02 20:07:36 -05002674 case CHIP_CAYMAN:
2675 rdev->asic = &cayman_asic;
Alex Deucherba7e05e2011-06-16 18:14:22 +00002676 /* set num crtcs */
2677 rdev->num_crtc = 6;
Alex Deucher948bee32013-05-14 12:08:35 -04002678 rdev->has_uvd = true;
Alex Deuchere3487622011-03-02 20:07:36 -05002679 break;
Alex Deucherbe63fe82012-03-20 17:18:40 -04002680 case CHIP_ARUBA:
2681 rdev->asic = &trinity_asic;
2682 /* set num crtcs */
2683 rdev->num_crtc = 4;
Alex Deucher948bee32013-05-14 12:08:35 -04002684 rdev->has_uvd = true;
Alex Deucherbe63fe82012-03-20 17:18:40 -04002685 break;
Alex Deucher02779c02012-03-20 17:18:25 -04002686 case CHIP_TAHITI:
2687 case CHIP_PITCAIRN:
2688 case CHIP_VERDE:
Alex Deuchere737a142012-08-30 14:00:03 -04002689 case CHIP_OLAND:
Alex Deucher86a45ca2012-07-26 19:04:20 -04002690 case CHIP_HAINAN:
Alex Deucher02779c02012-03-20 17:18:25 -04002691 rdev->asic = &si_asic;
2692 /* set num crtcs */
Alex Deucher86a45ca2012-07-26 19:04:20 -04002693 if (rdev->family == CHIP_HAINAN)
2694 rdev->num_crtc = 0;
2695 else if (rdev->family == CHIP_OLAND)
Alex Deuchere737a142012-08-30 14:00:03 -04002696 rdev->num_crtc = 2;
2697 else
2698 rdev->num_crtc = 6;
Alex Deucher948bee32013-05-14 12:08:35 -04002699 if (rdev->family == CHIP_HAINAN)
2700 rdev->has_uvd = false;
2701 else
2702 rdev->has_uvd = true;
Alex Deucher02779c02012-03-20 17:18:25 -04002703 break;
Alex Deucher0672e272013-04-09 16:22:31 -04002704 case CHIP_BONAIRE:
2705 rdev->asic = &ci_asic;
2706 rdev->num_crtc = 6;
2707 break;
2708 case CHIP_KAVERI:
2709 case CHIP_KABINI:
2710 rdev->asic = &kv_asic;
2711 /* set num crtcs */
2712 if (rdev->family == CHIP_KAVERI)
2713 rdev->num_crtc = 4;
2714 else
2715 rdev->num_crtc = 2;
2716 break;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002717 default:
2718 /* FIXME: not supported yet */
2719 return -EINVAL;
2720 }
2721
2722 if (rdev->flags & RADEON_IS_IGP) {
Alex Deucher798bcf72012-02-23 17:53:48 -05002723 rdev->asic->pm.get_memory_clock = NULL;
2724 rdev->asic->pm.set_memory_clock = NULL;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002725 }
2726
Daniel Vetter0a10c852010-03-11 21:19:14 +00002727 return 0;
2728}
2729