blob: a2802b47ee958e230d754f105214070f91ef1f23 [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 Deucherb4df8be2011-04-12 13:40:18 -0400129 if (rdev->family >= CHIP_R600) {
Daniel Vetter0a10c852010-03-11 21:19:14 +0000130 rdev->pciep_rreg = &r600_pciep_rreg;
131 rdev->pciep_wreg = &r600_pciep_wreg;
132 }
133}
134
135
136/* helper to disable agp */
Alex Deucherabf1dc62012-07-17 14:02:36 -0400137/**
138 * radeon_agp_disable - AGP disable helper function
139 *
140 * @rdev: radeon device pointer
141 *
142 * Removes AGP flags and changes the gart callbacks on AGP
143 * cards when using the internal gart rather than AGP (all asics).
144 */
Daniel Vetter0a10c852010-03-11 21:19:14 +0000145void radeon_agp_disable(struct radeon_device *rdev)
146{
147 rdev->flags &= ~RADEON_IS_AGP;
148 if (rdev->family >= CHIP_R600) {
149 DRM_INFO("Forcing AGP to PCIE mode\n");
150 rdev->flags |= RADEON_IS_PCIE;
151 } else if (rdev->family >= CHIP_RV515 ||
152 rdev->family == CHIP_RV380 ||
153 rdev->family == CHIP_RV410 ||
154 rdev->family == CHIP_R423) {
155 DRM_INFO("Forcing AGP to PCIE mode\n");
156 rdev->flags |= RADEON_IS_PCIE;
Alex Deucherc5b3b852012-02-23 17:53:46 -0500157 rdev->asic->gart.tlb_flush = &rv370_pcie_gart_tlb_flush;
158 rdev->asic->gart.set_page = &rv370_pcie_gart_set_page;
Daniel Vetter0a10c852010-03-11 21:19:14 +0000159 } else {
160 DRM_INFO("Forcing AGP to PCI mode\n");
161 rdev->flags |= RADEON_IS_PCI;
Alex Deucherc5b3b852012-02-23 17:53:46 -0500162 rdev->asic->gart.tlb_flush = &r100_pci_gart_tlb_flush;
163 rdev->asic->gart.set_page = &r100_pci_gart_set_page;
Daniel Vetter0a10c852010-03-11 21:19:14 +0000164 }
165 rdev->mc.gtt_size = radeon_gart_size * 1024 * 1024;
166}
167
168/*
169 * ASIC
170 */
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000171static struct radeon_asic r100_asic = {
172 .init = &r100_init,
173 .fini = &r100_fini,
174 .suspend = &r100_suspend,
175 .resume = &r100_resume,
176 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000177 .asic_reset = &r100_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500178 .ioctl_wait_idle = NULL,
179 .gui_idle = &r100_gui_idle,
180 .mc_wait_for_idle = &r100_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500181 .gart = {
182 .tlb_flush = &r100_pci_gart_tlb_flush,
183 .set_page = &r100_pci_gart_set_page,
184 },
Christian König4c87bc22011-10-19 19:02:21 +0200185 .ring = {
186 [RADEON_RING_TYPE_GFX_INDEX] = {
187 .ib_execute = &r100_ring_ib_execute,
188 .emit_fence = &r100_fence_ring_emit,
189 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100190 .cs_parse = &r100_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500191 .ring_start = &r100_ring_start,
192 .ring_test = &r100_ring_test,
193 .ib_test = &r100_ib_test,
Christian König312c4a82012-05-02 15:11:09 +0200194 .is_lockup = &r100_gpu_is_lockup,
Christian König4c87bc22011-10-19 19:02:21 +0200195 }
196 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500197 .irq = {
198 .set = &r100_irq_set,
199 .process = &r100_irq_process,
200 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500201 .display = {
202 .bandwidth_update = &r100_bandwidth_update,
203 .get_vblank_counter = &r100_get_vblank_counter,
204 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400205 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400206 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500207 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500208 .copy = {
209 .blit = &r100_copy_blit,
210 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
211 .dma = NULL,
212 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
213 .copy = &r100_copy_blit,
214 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
215 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500216 .surface = {
217 .set_reg = r100_set_surface_reg,
218 .clear_reg = r100_clear_surface_reg,
219 },
Alex Deucher901ea572012-02-23 17:53:39 -0500220 .hpd = {
221 .init = &r100_hpd_init,
222 .fini = &r100_hpd_fini,
223 .sense = &r100_hpd_sense,
224 .set_polarity = &r100_hpd_set_polarity,
225 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500226 .pm = {
227 .misc = &r100_pm_misc,
228 .prepare = &r100_pm_prepare,
229 .finish = &r100_pm_finish,
230 .init_profile = &r100_pm_init_profile,
231 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500232 .get_engine_clock = &radeon_legacy_get_engine_clock,
233 .set_engine_clock = &radeon_legacy_set_engine_clock,
234 .get_memory_clock = &radeon_legacy_get_memory_clock,
235 .set_memory_clock = NULL,
236 .get_pcie_lanes = NULL,
237 .set_pcie_lanes = NULL,
238 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500239 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500240 .pflip = {
241 .pre_page_flip = &r100_pre_page_flip,
242 .page_flip = &r100_page_flip,
243 .post_page_flip = &r100_post_page_flip,
244 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000245};
246
247static struct radeon_asic r200_asic = {
248 .init = &r100_init,
249 .fini = &r100_fini,
250 .suspend = &r100_suspend,
251 .resume = &r100_resume,
252 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000253 .asic_reset = &r100_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500254 .ioctl_wait_idle = NULL,
255 .gui_idle = &r100_gui_idle,
256 .mc_wait_for_idle = &r100_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500257 .gart = {
258 .tlb_flush = &r100_pci_gart_tlb_flush,
259 .set_page = &r100_pci_gart_set_page,
260 },
Christian König4c87bc22011-10-19 19:02:21 +0200261 .ring = {
262 [RADEON_RING_TYPE_GFX_INDEX] = {
263 .ib_execute = &r100_ring_ib_execute,
264 .emit_fence = &r100_fence_ring_emit,
265 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100266 .cs_parse = &r100_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500267 .ring_start = &r100_ring_start,
268 .ring_test = &r100_ring_test,
269 .ib_test = &r100_ib_test,
Christian König312c4a82012-05-02 15:11:09 +0200270 .is_lockup = &r100_gpu_is_lockup,
Christian König4c87bc22011-10-19 19:02:21 +0200271 }
272 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500273 .irq = {
274 .set = &r100_irq_set,
275 .process = &r100_irq_process,
276 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500277 .display = {
278 .bandwidth_update = &r100_bandwidth_update,
279 .get_vblank_counter = &r100_get_vblank_counter,
280 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400281 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400282 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500283 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500284 .copy = {
285 .blit = &r100_copy_blit,
286 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
287 .dma = &r200_copy_dma,
288 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
289 .copy = &r100_copy_blit,
290 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
291 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500292 .surface = {
293 .set_reg = r100_set_surface_reg,
294 .clear_reg = r100_clear_surface_reg,
295 },
Alex Deucher901ea572012-02-23 17:53:39 -0500296 .hpd = {
297 .init = &r100_hpd_init,
298 .fini = &r100_hpd_fini,
299 .sense = &r100_hpd_sense,
300 .set_polarity = &r100_hpd_set_polarity,
301 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500302 .pm = {
303 .misc = &r100_pm_misc,
304 .prepare = &r100_pm_prepare,
305 .finish = &r100_pm_finish,
306 .init_profile = &r100_pm_init_profile,
307 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500308 .get_engine_clock = &radeon_legacy_get_engine_clock,
309 .set_engine_clock = &radeon_legacy_set_engine_clock,
310 .get_memory_clock = &radeon_legacy_get_memory_clock,
311 .set_memory_clock = NULL,
312 .get_pcie_lanes = NULL,
313 .set_pcie_lanes = NULL,
314 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500315 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500316 .pflip = {
317 .pre_page_flip = &r100_pre_page_flip,
318 .page_flip = &r100_page_flip,
319 .post_page_flip = &r100_post_page_flip,
320 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000321};
322
323static struct radeon_asic r300_asic = {
324 .init = &r300_init,
325 .fini = &r300_fini,
326 .suspend = &r300_suspend,
327 .resume = &r300_resume,
328 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000329 .asic_reset = &r300_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500330 .ioctl_wait_idle = NULL,
331 .gui_idle = &r100_gui_idle,
332 .mc_wait_for_idle = &r300_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500333 .gart = {
334 .tlb_flush = &r100_pci_gart_tlb_flush,
335 .set_page = &r100_pci_gart_set_page,
336 },
Christian König4c87bc22011-10-19 19:02:21 +0200337 .ring = {
338 [RADEON_RING_TYPE_GFX_INDEX] = {
339 .ib_execute = &r100_ring_ib_execute,
340 .emit_fence = &r300_fence_ring_emit,
341 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100342 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500343 .ring_start = &r300_ring_start,
344 .ring_test = &r100_ring_test,
345 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200346 .is_lockup = &r100_gpu_is_lockup,
Christian König4c87bc22011-10-19 19:02:21 +0200347 }
348 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500349 .irq = {
350 .set = &r100_irq_set,
351 .process = &r100_irq_process,
352 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500353 .display = {
354 .bandwidth_update = &r100_bandwidth_update,
355 .get_vblank_counter = &r100_get_vblank_counter,
356 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400357 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400358 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500359 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500360 .copy = {
361 .blit = &r100_copy_blit,
362 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
363 .dma = &r200_copy_dma,
364 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
365 .copy = &r100_copy_blit,
366 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
367 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500368 .surface = {
369 .set_reg = r100_set_surface_reg,
370 .clear_reg = r100_clear_surface_reg,
371 },
Alex Deucher901ea572012-02-23 17:53:39 -0500372 .hpd = {
373 .init = &r100_hpd_init,
374 .fini = &r100_hpd_fini,
375 .sense = &r100_hpd_sense,
376 .set_polarity = &r100_hpd_set_polarity,
377 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500378 .pm = {
379 .misc = &r100_pm_misc,
380 .prepare = &r100_pm_prepare,
381 .finish = &r100_pm_finish,
382 .init_profile = &r100_pm_init_profile,
383 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500384 .get_engine_clock = &radeon_legacy_get_engine_clock,
385 .set_engine_clock = &radeon_legacy_set_engine_clock,
386 .get_memory_clock = &radeon_legacy_get_memory_clock,
387 .set_memory_clock = NULL,
388 .get_pcie_lanes = &rv370_get_pcie_lanes,
389 .set_pcie_lanes = &rv370_set_pcie_lanes,
390 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500391 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500392 .pflip = {
393 .pre_page_flip = &r100_pre_page_flip,
394 .page_flip = &r100_page_flip,
395 .post_page_flip = &r100_post_page_flip,
396 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000397};
398
399static struct radeon_asic r300_asic_pcie = {
400 .init = &r300_init,
401 .fini = &r300_fini,
402 .suspend = &r300_suspend,
403 .resume = &r300_resume,
404 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000405 .asic_reset = &r300_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500406 .ioctl_wait_idle = NULL,
407 .gui_idle = &r100_gui_idle,
408 .mc_wait_for_idle = &r300_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500409 .gart = {
410 .tlb_flush = &rv370_pcie_gart_tlb_flush,
411 .set_page = &rv370_pcie_gart_set_page,
412 },
Christian König4c87bc22011-10-19 19:02:21 +0200413 .ring = {
414 [RADEON_RING_TYPE_GFX_INDEX] = {
415 .ib_execute = &r100_ring_ib_execute,
416 .emit_fence = &r300_fence_ring_emit,
417 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100418 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500419 .ring_start = &r300_ring_start,
420 .ring_test = &r100_ring_test,
421 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200422 .is_lockup = &r100_gpu_is_lockup,
Christian König4c87bc22011-10-19 19:02:21 +0200423 }
424 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500425 .irq = {
426 .set = &r100_irq_set,
427 .process = &r100_irq_process,
428 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500429 .display = {
430 .bandwidth_update = &r100_bandwidth_update,
431 .get_vblank_counter = &r100_get_vblank_counter,
432 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400433 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400434 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500435 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500436 .copy = {
437 .blit = &r100_copy_blit,
438 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
439 .dma = &r200_copy_dma,
440 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
441 .copy = &r100_copy_blit,
442 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
443 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500444 .surface = {
445 .set_reg = r100_set_surface_reg,
446 .clear_reg = r100_clear_surface_reg,
447 },
Alex Deucher901ea572012-02-23 17:53:39 -0500448 .hpd = {
449 .init = &r100_hpd_init,
450 .fini = &r100_hpd_fini,
451 .sense = &r100_hpd_sense,
452 .set_polarity = &r100_hpd_set_polarity,
453 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500454 .pm = {
455 .misc = &r100_pm_misc,
456 .prepare = &r100_pm_prepare,
457 .finish = &r100_pm_finish,
458 .init_profile = &r100_pm_init_profile,
459 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500460 .get_engine_clock = &radeon_legacy_get_engine_clock,
461 .set_engine_clock = &radeon_legacy_set_engine_clock,
462 .get_memory_clock = &radeon_legacy_get_memory_clock,
463 .set_memory_clock = NULL,
464 .get_pcie_lanes = &rv370_get_pcie_lanes,
465 .set_pcie_lanes = &rv370_set_pcie_lanes,
466 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500467 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500468 .pflip = {
469 .pre_page_flip = &r100_pre_page_flip,
470 .page_flip = &r100_page_flip,
471 .post_page_flip = &r100_post_page_flip,
472 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000473};
474
475static struct radeon_asic r420_asic = {
476 .init = &r420_init,
477 .fini = &r420_fini,
478 .suspend = &r420_suspend,
479 .resume = &r420_resume,
480 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000481 .asic_reset = &r300_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500482 .ioctl_wait_idle = NULL,
483 .gui_idle = &r100_gui_idle,
484 .mc_wait_for_idle = &r300_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500485 .gart = {
486 .tlb_flush = &rv370_pcie_gart_tlb_flush,
487 .set_page = &rv370_pcie_gart_set_page,
488 },
Christian König4c87bc22011-10-19 19:02:21 +0200489 .ring = {
490 [RADEON_RING_TYPE_GFX_INDEX] = {
491 .ib_execute = &r100_ring_ib_execute,
492 .emit_fence = &r300_fence_ring_emit,
493 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100494 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500495 .ring_start = &r300_ring_start,
496 .ring_test = &r100_ring_test,
497 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200498 .is_lockup = &r100_gpu_is_lockup,
Christian König4c87bc22011-10-19 19:02:21 +0200499 }
500 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500501 .irq = {
502 .set = &r100_irq_set,
503 .process = &r100_irq_process,
504 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500505 .display = {
506 .bandwidth_update = &r100_bandwidth_update,
507 .get_vblank_counter = &r100_get_vblank_counter,
508 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400509 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400510 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500511 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500512 .copy = {
513 .blit = &r100_copy_blit,
514 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
515 .dma = &r200_copy_dma,
516 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
517 .copy = &r100_copy_blit,
518 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
519 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500520 .surface = {
521 .set_reg = r100_set_surface_reg,
522 .clear_reg = r100_clear_surface_reg,
523 },
Alex Deucher901ea572012-02-23 17:53:39 -0500524 .hpd = {
525 .init = &r100_hpd_init,
526 .fini = &r100_hpd_fini,
527 .sense = &r100_hpd_sense,
528 .set_polarity = &r100_hpd_set_polarity,
529 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500530 .pm = {
531 .misc = &r100_pm_misc,
532 .prepare = &r100_pm_prepare,
533 .finish = &r100_pm_finish,
534 .init_profile = &r420_pm_init_profile,
535 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500536 .get_engine_clock = &radeon_atom_get_engine_clock,
537 .set_engine_clock = &radeon_atom_set_engine_clock,
538 .get_memory_clock = &radeon_atom_get_memory_clock,
539 .set_memory_clock = &radeon_atom_set_memory_clock,
540 .get_pcie_lanes = &rv370_get_pcie_lanes,
541 .set_pcie_lanes = &rv370_set_pcie_lanes,
542 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500543 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500544 .pflip = {
545 .pre_page_flip = &r100_pre_page_flip,
546 .page_flip = &r100_page_flip,
547 .post_page_flip = &r100_post_page_flip,
548 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000549};
550
551static struct radeon_asic rs400_asic = {
552 .init = &rs400_init,
553 .fini = &rs400_fini,
554 .suspend = &rs400_suspend,
555 .resume = &rs400_resume,
556 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000557 .asic_reset = &r300_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500558 .ioctl_wait_idle = NULL,
559 .gui_idle = &r100_gui_idle,
560 .mc_wait_for_idle = &rs400_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500561 .gart = {
562 .tlb_flush = &rs400_gart_tlb_flush,
563 .set_page = &rs400_gart_set_page,
564 },
Christian König4c87bc22011-10-19 19:02:21 +0200565 .ring = {
566 [RADEON_RING_TYPE_GFX_INDEX] = {
567 .ib_execute = &r100_ring_ib_execute,
568 .emit_fence = &r300_fence_ring_emit,
569 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100570 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500571 .ring_start = &r300_ring_start,
572 .ring_test = &r100_ring_test,
573 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200574 .is_lockup = &r100_gpu_is_lockup,
Christian König4c87bc22011-10-19 19:02:21 +0200575 }
576 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500577 .irq = {
578 .set = &r100_irq_set,
579 .process = &r100_irq_process,
580 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500581 .display = {
582 .bandwidth_update = &r100_bandwidth_update,
583 .get_vblank_counter = &r100_get_vblank_counter,
584 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400585 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400586 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500587 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500588 .copy = {
589 .blit = &r100_copy_blit,
590 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
591 .dma = &r200_copy_dma,
592 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
593 .copy = &r100_copy_blit,
594 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
595 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500596 .surface = {
597 .set_reg = r100_set_surface_reg,
598 .clear_reg = r100_clear_surface_reg,
599 },
Alex Deucher901ea572012-02-23 17:53:39 -0500600 .hpd = {
601 .init = &r100_hpd_init,
602 .fini = &r100_hpd_fini,
603 .sense = &r100_hpd_sense,
604 .set_polarity = &r100_hpd_set_polarity,
605 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500606 .pm = {
607 .misc = &r100_pm_misc,
608 .prepare = &r100_pm_prepare,
609 .finish = &r100_pm_finish,
610 .init_profile = &r100_pm_init_profile,
611 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500612 .get_engine_clock = &radeon_legacy_get_engine_clock,
613 .set_engine_clock = &radeon_legacy_set_engine_clock,
614 .get_memory_clock = &radeon_legacy_get_memory_clock,
615 .set_memory_clock = NULL,
616 .get_pcie_lanes = NULL,
617 .set_pcie_lanes = NULL,
618 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500619 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500620 .pflip = {
621 .pre_page_flip = &r100_pre_page_flip,
622 .page_flip = &r100_page_flip,
623 .post_page_flip = &r100_post_page_flip,
624 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000625};
626
627static struct radeon_asic rs600_asic = {
628 .init = &rs600_init,
629 .fini = &rs600_fini,
630 .suspend = &rs600_suspend,
631 .resume = &rs600_resume,
632 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000633 .asic_reset = &rs600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500634 .ioctl_wait_idle = NULL,
635 .gui_idle = &r100_gui_idle,
636 .mc_wait_for_idle = &rs600_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500637 .gart = {
638 .tlb_flush = &rs600_gart_tlb_flush,
639 .set_page = &rs600_gart_set_page,
640 },
Christian König4c87bc22011-10-19 19:02:21 +0200641 .ring = {
642 [RADEON_RING_TYPE_GFX_INDEX] = {
643 .ib_execute = &r100_ring_ib_execute,
644 .emit_fence = &r300_fence_ring_emit,
645 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100646 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500647 .ring_start = &r300_ring_start,
648 .ring_test = &r100_ring_test,
649 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200650 .is_lockup = &r100_gpu_is_lockup,
Christian König4c87bc22011-10-19 19:02:21 +0200651 }
652 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500653 .irq = {
654 .set = &rs600_irq_set,
655 .process = &rs600_irq_process,
656 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500657 .display = {
658 .bandwidth_update = &rs600_bandwidth_update,
659 .get_vblank_counter = &rs600_get_vblank_counter,
660 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400661 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400662 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -0400663 .hdmi_enable = &r600_hdmi_enable,
664 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500665 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500666 .copy = {
667 .blit = &r100_copy_blit,
668 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
669 .dma = &r200_copy_dma,
670 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
671 .copy = &r100_copy_blit,
672 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
673 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500674 .surface = {
675 .set_reg = r100_set_surface_reg,
676 .clear_reg = r100_clear_surface_reg,
677 },
Alex Deucher901ea572012-02-23 17:53:39 -0500678 .hpd = {
679 .init = &rs600_hpd_init,
680 .fini = &rs600_hpd_fini,
681 .sense = &rs600_hpd_sense,
682 .set_polarity = &rs600_hpd_set_polarity,
683 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500684 .pm = {
685 .misc = &rs600_pm_misc,
686 .prepare = &rs600_pm_prepare,
687 .finish = &rs600_pm_finish,
688 .init_profile = &r420_pm_init_profile,
689 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500690 .get_engine_clock = &radeon_atom_get_engine_clock,
691 .set_engine_clock = &radeon_atom_set_engine_clock,
692 .get_memory_clock = &radeon_atom_get_memory_clock,
693 .set_memory_clock = &radeon_atom_set_memory_clock,
694 .get_pcie_lanes = NULL,
695 .set_pcie_lanes = NULL,
696 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500697 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500698 .pflip = {
699 .pre_page_flip = &rs600_pre_page_flip,
700 .page_flip = &rs600_page_flip,
701 .post_page_flip = &rs600_post_page_flip,
702 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000703};
704
705static struct radeon_asic rs690_asic = {
706 .init = &rs690_init,
707 .fini = &rs690_fini,
708 .suspend = &rs690_suspend,
709 .resume = &rs690_resume,
710 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000711 .asic_reset = &rs600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500712 .ioctl_wait_idle = NULL,
713 .gui_idle = &r100_gui_idle,
714 .mc_wait_for_idle = &rs690_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500715 .gart = {
716 .tlb_flush = &rs400_gart_tlb_flush,
717 .set_page = &rs400_gart_set_page,
718 },
Christian König4c87bc22011-10-19 19:02:21 +0200719 .ring = {
720 [RADEON_RING_TYPE_GFX_INDEX] = {
721 .ib_execute = &r100_ring_ib_execute,
722 .emit_fence = &r300_fence_ring_emit,
723 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100724 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500725 .ring_start = &r300_ring_start,
726 .ring_test = &r100_ring_test,
727 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200728 .is_lockup = &r100_gpu_is_lockup,
Christian König4c87bc22011-10-19 19:02:21 +0200729 }
730 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500731 .irq = {
732 .set = &rs600_irq_set,
733 .process = &rs600_irq_process,
734 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500735 .display = {
736 .get_vblank_counter = &rs600_get_vblank_counter,
737 .bandwidth_update = &rs690_bandwidth_update,
738 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400739 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400740 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -0400741 .hdmi_enable = &r600_hdmi_enable,
742 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500743 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500744 .copy = {
745 .blit = &r100_copy_blit,
746 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
747 .dma = &r200_copy_dma,
748 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
749 .copy = &r200_copy_dma,
750 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
751 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500752 .surface = {
753 .set_reg = r100_set_surface_reg,
754 .clear_reg = r100_clear_surface_reg,
755 },
Alex Deucher901ea572012-02-23 17:53:39 -0500756 .hpd = {
757 .init = &rs600_hpd_init,
758 .fini = &rs600_hpd_fini,
759 .sense = &rs600_hpd_sense,
760 .set_polarity = &rs600_hpd_set_polarity,
761 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500762 .pm = {
763 .misc = &rs600_pm_misc,
764 .prepare = &rs600_pm_prepare,
765 .finish = &rs600_pm_finish,
766 .init_profile = &r420_pm_init_profile,
767 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500768 .get_engine_clock = &radeon_atom_get_engine_clock,
769 .set_engine_clock = &radeon_atom_set_engine_clock,
770 .get_memory_clock = &radeon_atom_get_memory_clock,
771 .set_memory_clock = &radeon_atom_set_memory_clock,
772 .get_pcie_lanes = NULL,
773 .set_pcie_lanes = NULL,
774 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500775 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500776 .pflip = {
777 .pre_page_flip = &rs600_pre_page_flip,
778 .page_flip = &rs600_page_flip,
779 .post_page_flip = &rs600_post_page_flip,
780 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000781};
782
783static struct radeon_asic rv515_asic = {
784 .init = &rv515_init,
785 .fini = &rv515_fini,
786 .suspend = &rv515_suspend,
787 .resume = &rv515_resume,
788 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000789 .asic_reset = &rs600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500790 .ioctl_wait_idle = NULL,
791 .gui_idle = &r100_gui_idle,
792 .mc_wait_for_idle = &rv515_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500793 .gart = {
794 .tlb_flush = &rv370_pcie_gart_tlb_flush,
795 .set_page = &rv370_pcie_gart_set_page,
796 },
Christian König4c87bc22011-10-19 19:02:21 +0200797 .ring = {
798 [RADEON_RING_TYPE_GFX_INDEX] = {
799 .ib_execute = &r100_ring_ib_execute,
800 .emit_fence = &r300_fence_ring_emit,
801 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100802 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500803 .ring_start = &rv515_ring_start,
804 .ring_test = &r100_ring_test,
805 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200806 .is_lockup = &r100_gpu_is_lockup,
Christian König4c87bc22011-10-19 19:02:21 +0200807 }
808 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500809 .irq = {
810 .set = &rs600_irq_set,
811 .process = &rs600_irq_process,
812 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500813 .display = {
814 .get_vblank_counter = &rs600_get_vblank_counter,
815 .bandwidth_update = &rv515_bandwidth_update,
816 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400817 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400818 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500819 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500820 .copy = {
821 .blit = &r100_copy_blit,
822 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
823 .dma = &r200_copy_dma,
824 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
825 .copy = &r100_copy_blit,
826 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
827 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500828 .surface = {
829 .set_reg = r100_set_surface_reg,
830 .clear_reg = r100_clear_surface_reg,
831 },
Alex Deucher901ea572012-02-23 17:53:39 -0500832 .hpd = {
833 .init = &rs600_hpd_init,
834 .fini = &rs600_hpd_fini,
835 .sense = &rs600_hpd_sense,
836 .set_polarity = &rs600_hpd_set_polarity,
837 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500838 .pm = {
839 .misc = &rs600_pm_misc,
840 .prepare = &rs600_pm_prepare,
841 .finish = &rs600_pm_finish,
842 .init_profile = &r420_pm_init_profile,
843 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500844 .get_engine_clock = &radeon_atom_get_engine_clock,
845 .set_engine_clock = &radeon_atom_set_engine_clock,
846 .get_memory_clock = &radeon_atom_get_memory_clock,
847 .set_memory_clock = &radeon_atom_set_memory_clock,
848 .get_pcie_lanes = &rv370_get_pcie_lanes,
849 .set_pcie_lanes = &rv370_set_pcie_lanes,
850 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500851 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500852 .pflip = {
853 .pre_page_flip = &rs600_pre_page_flip,
854 .page_flip = &rs600_page_flip,
855 .post_page_flip = &rs600_post_page_flip,
856 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000857};
858
859static struct radeon_asic r520_asic = {
860 .init = &r520_init,
861 .fini = &rv515_fini,
862 .suspend = &rv515_suspend,
863 .resume = &r520_resume,
864 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000865 .asic_reset = &rs600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500866 .ioctl_wait_idle = NULL,
867 .gui_idle = &r100_gui_idle,
868 .mc_wait_for_idle = &r520_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500869 .gart = {
870 .tlb_flush = &rv370_pcie_gart_tlb_flush,
871 .set_page = &rv370_pcie_gart_set_page,
872 },
Christian König4c87bc22011-10-19 19:02:21 +0200873 .ring = {
874 [RADEON_RING_TYPE_GFX_INDEX] = {
875 .ib_execute = &r100_ring_ib_execute,
876 .emit_fence = &r300_fence_ring_emit,
877 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100878 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500879 .ring_start = &rv515_ring_start,
880 .ring_test = &r100_ring_test,
881 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200882 .is_lockup = &r100_gpu_is_lockup,
Christian König4c87bc22011-10-19 19:02:21 +0200883 }
884 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500885 .irq = {
886 .set = &rs600_irq_set,
887 .process = &rs600_irq_process,
888 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500889 .display = {
890 .bandwidth_update = &rv515_bandwidth_update,
891 .get_vblank_counter = &rs600_get_vblank_counter,
892 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400893 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400894 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500895 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500896 .copy = {
897 .blit = &r100_copy_blit,
898 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
899 .dma = &r200_copy_dma,
900 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
901 .copy = &r100_copy_blit,
902 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
903 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500904 .surface = {
905 .set_reg = r100_set_surface_reg,
906 .clear_reg = r100_clear_surface_reg,
907 },
Alex Deucher901ea572012-02-23 17:53:39 -0500908 .hpd = {
909 .init = &rs600_hpd_init,
910 .fini = &rs600_hpd_fini,
911 .sense = &rs600_hpd_sense,
912 .set_polarity = &rs600_hpd_set_polarity,
913 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500914 .pm = {
915 .misc = &rs600_pm_misc,
916 .prepare = &rs600_pm_prepare,
917 .finish = &rs600_pm_finish,
918 .init_profile = &r420_pm_init_profile,
919 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500920 .get_engine_clock = &radeon_atom_get_engine_clock,
921 .set_engine_clock = &radeon_atom_set_engine_clock,
922 .get_memory_clock = &radeon_atom_get_memory_clock,
923 .set_memory_clock = &radeon_atom_set_memory_clock,
924 .get_pcie_lanes = &rv370_get_pcie_lanes,
925 .set_pcie_lanes = &rv370_set_pcie_lanes,
926 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500927 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500928 .pflip = {
929 .pre_page_flip = &rs600_pre_page_flip,
930 .page_flip = &rs600_page_flip,
931 .post_page_flip = &rs600_post_page_flip,
932 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000933};
934
935static struct radeon_asic r600_asic = {
936 .init = &r600_init,
937 .fini = &r600_fini,
938 .suspend = &r600_suspend,
939 .resume = &r600_resume,
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000940 .vga_set_state = &r600_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000941 .asic_reset = &r600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500942 .ioctl_wait_idle = r600_ioctl_wait_idle,
943 .gui_idle = &r600_gui_idle,
944 .mc_wait_for_idle = &r600_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -0500945 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -0500946 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500947 .gart = {
948 .tlb_flush = &r600_pcie_gart_tlb_flush,
949 .set_page = &rs600_gart_set_page,
950 },
Christian König4c87bc22011-10-19 19:02:21 +0200951 .ring = {
952 [RADEON_RING_TYPE_GFX_INDEX] = {
953 .ib_execute = &r600_ring_ib_execute,
954 .emit_fence = &r600_fence_ring_emit,
955 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100956 .cs_parse = &r600_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500957 .ring_test = &r600_ring_test,
958 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -0500959 .is_lockup = &r600_gfx_is_lockup,
Alex Deucher4d756582012-09-27 15:08:35 -0400960 },
961 [R600_RING_TYPE_DMA_INDEX] = {
962 .ib_execute = &r600_dma_ring_ib_execute,
963 .emit_fence = &r600_dma_fence_ring_emit,
964 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deuchercf4ccd02011-11-18 10:19:47 -0500965 .cs_parse = &r600_dma_cs_parse,
Alex Deucher4d756582012-09-27 15:08:35 -0400966 .ring_test = &r600_dma_ring_test,
967 .ib_test = &r600_dma_ib_test,
968 .is_lockup = &r600_dma_is_lockup,
Christian König4c87bc22011-10-19 19:02:21 +0200969 }
970 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500971 .irq = {
972 .set = &r600_irq_set,
973 .process = &r600_irq_process,
974 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500975 .display = {
976 .bandwidth_update = &rv515_bandwidth_update,
977 .get_vblank_counter = &rs600_get_vblank_counter,
978 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400979 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400980 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -0400981 .hdmi_enable = &r600_hdmi_enable,
982 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500983 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500984 .copy = {
985 .blit = &r600_copy_blit,
986 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher4d756582012-09-27 15:08:35 -0400987 .dma = &r600_copy_dma,
988 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -0400989 .copy = &r600_copy_dma,
990 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -0500991 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500992 .surface = {
993 .set_reg = r600_set_surface_reg,
994 .clear_reg = r600_clear_surface_reg,
995 },
Alex Deucher901ea572012-02-23 17:53:39 -0500996 .hpd = {
997 .init = &r600_hpd_init,
998 .fini = &r600_hpd_fini,
999 .sense = &r600_hpd_sense,
1000 .set_polarity = &r600_hpd_set_polarity,
1001 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001002 .pm = {
1003 .misc = &r600_pm_misc,
1004 .prepare = &rs600_pm_prepare,
1005 .finish = &rs600_pm_finish,
1006 .init_profile = &r600_pm_init_profile,
1007 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001008 .get_engine_clock = &radeon_atom_get_engine_clock,
1009 .set_engine_clock = &radeon_atom_set_engine_clock,
1010 .get_memory_clock = &radeon_atom_get_memory_clock,
1011 .set_memory_clock = &radeon_atom_set_memory_clock,
1012 .get_pcie_lanes = &r600_get_pcie_lanes,
1013 .set_pcie_lanes = &r600_set_pcie_lanes,
1014 .set_clock_gating = NULL,
Alex Deuchera02fa392012-02-23 17:53:41 -05001015 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001016 .pflip = {
1017 .pre_page_flip = &rs600_pre_page_flip,
1018 .page_flip = &rs600_page_flip,
1019 .post_page_flip = &rs600_post_page_flip,
1020 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001021};
1022
Alex Deucherf47299c2010-03-16 20:54:38 -04001023static struct radeon_asic rs780_asic = {
1024 .init = &r600_init,
1025 .fini = &r600_fini,
1026 .suspend = &r600_suspend,
1027 .resume = &r600_resume,
Alex Deucherf47299c2010-03-16 20:54:38 -04001028 .vga_set_state = &r600_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +00001029 .asic_reset = &r600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -05001030 .ioctl_wait_idle = r600_ioctl_wait_idle,
1031 .gui_idle = &r600_gui_idle,
1032 .mc_wait_for_idle = &r600_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001033 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001034 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001035 .gart = {
1036 .tlb_flush = &r600_pcie_gart_tlb_flush,
1037 .set_page = &rs600_gart_set_page,
1038 },
Christian König4c87bc22011-10-19 19:02:21 +02001039 .ring = {
1040 [RADEON_RING_TYPE_GFX_INDEX] = {
1041 .ib_execute = &r600_ring_ib_execute,
1042 .emit_fence = &r600_fence_ring_emit,
1043 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001044 .cs_parse = &r600_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001045 .ring_test = &r600_ring_test,
1046 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001047 .is_lockup = &r600_gfx_is_lockup,
Alex Deucher4d756582012-09-27 15:08:35 -04001048 },
1049 [R600_RING_TYPE_DMA_INDEX] = {
1050 .ib_execute = &r600_dma_ring_ib_execute,
1051 .emit_fence = &r600_dma_fence_ring_emit,
1052 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deuchercf4ccd02011-11-18 10:19:47 -05001053 .cs_parse = &r600_dma_cs_parse,
Alex Deucher4d756582012-09-27 15:08:35 -04001054 .ring_test = &r600_dma_ring_test,
1055 .ib_test = &r600_dma_ib_test,
1056 .is_lockup = &r600_dma_is_lockup,
Christian König4c87bc22011-10-19 19:02:21 +02001057 }
1058 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001059 .irq = {
1060 .set = &r600_irq_set,
1061 .process = &r600_irq_process,
1062 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001063 .display = {
1064 .bandwidth_update = &rs690_bandwidth_update,
1065 .get_vblank_counter = &rs600_get_vblank_counter,
1066 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001067 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001068 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001069 .hdmi_enable = &r600_hdmi_enable,
1070 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001071 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001072 .copy = {
1073 .blit = &r600_copy_blit,
1074 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher4d756582012-09-27 15:08:35 -04001075 .dma = &r600_copy_dma,
1076 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001077 .copy = &r600_copy_dma,
1078 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001079 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001080 .surface = {
1081 .set_reg = r600_set_surface_reg,
1082 .clear_reg = r600_clear_surface_reg,
1083 },
Alex Deucher901ea572012-02-23 17:53:39 -05001084 .hpd = {
1085 .init = &r600_hpd_init,
1086 .fini = &r600_hpd_fini,
1087 .sense = &r600_hpd_sense,
1088 .set_polarity = &r600_hpd_set_polarity,
1089 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001090 .pm = {
1091 .misc = &r600_pm_misc,
1092 .prepare = &rs600_pm_prepare,
1093 .finish = &rs600_pm_finish,
1094 .init_profile = &rs780_pm_init_profile,
1095 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001096 .get_engine_clock = &radeon_atom_get_engine_clock,
1097 .set_engine_clock = &radeon_atom_set_engine_clock,
1098 .get_memory_clock = NULL,
1099 .set_memory_clock = NULL,
1100 .get_pcie_lanes = NULL,
1101 .set_pcie_lanes = NULL,
1102 .set_clock_gating = NULL,
Alex Deuchera02fa392012-02-23 17:53:41 -05001103 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001104 .pflip = {
1105 .pre_page_flip = &rs600_pre_page_flip,
1106 .page_flip = &rs600_page_flip,
1107 .post_page_flip = &rs600_post_page_flip,
1108 },
Alex Deucherf47299c2010-03-16 20:54:38 -04001109};
1110
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001111static struct radeon_asic rv770_asic = {
1112 .init = &rv770_init,
1113 .fini = &rv770_fini,
1114 .suspend = &rv770_suspend,
1115 .resume = &rv770_resume,
Jerome Glissea2d07b72010-03-09 14:45:11 +00001116 .asic_reset = &r600_asic_reset,
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001117 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001118 .ioctl_wait_idle = r600_ioctl_wait_idle,
1119 .gui_idle = &r600_gui_idle,
1120 .mc_wait_for_idle = &r600_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001121 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001122 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001123 .gart = {
1124 .tlb_flush = &r600_pcie_gart_tlb_flush,
1125 .set_page = &rs600_gart_set_page,
1126 },
Christian König4c87bc22011-10-19 19:02:21 +02001127 .ring = {
1128 [RADEON_RING_TYPE_GFX_INDEX] = {
1129 .ib_execute = &r600_ring_ib_execute,
1130 .emit_fence = &r600_fence_ring_emit,
1131 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001132 .cs_parse = &r600_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001133 .ring_test = &r600_ring_test,
1134 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001135 .is_lockup = &r600_gfx_is_lockup,
Alex Deucher4d756582012-09-27 15:08:35 -04001136 },
1137 [R600_RING_TYPE_DMA_INDEX] = {
1138 .ib_execute = &r600_dma_ring_ib_execute,
1139 .emit_fence = &r600_dma_fence_ring_emit,
1140 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deuchercf4ccd02011-11-18 10:19:47 -05001141 .cs_parse = &r600_dma_cs_parse,
Alex Deucher4d756582012-09-27 15:08:35 -04001142 .ring_test = &r600_dma_ring_test,
1143 .ib_test = &r600_dma_ib_test,
1144 .is_lockup = &r600_dma_is_lockup,
Christian Königf2ba57b2013-04-08 12:41:29 +02001145 },
1146 [R600_RING_TYPE_UVD_INDEX] = {
1147 .ib_execute = &r600_uvd_ib_execute,
1148 .emit_fence = &r600_uvd_fence_emit,
1149 .emit_semaphore = &r600_uvd_semaphore_emit,
1150 .cs_parse = &radeon_uvd_cs_parse,
1151 .ring_test = &r600_uvd_ring_test,
1152 .ib_test = &r600_uvd_ib_test,
1153 .is_lockup = &radeon_ring_test_lockup,
Christian König4c87bc22011-10-19 19:02:21 +02001154 }
1155 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001156 .irq = {
1157 .set = &r600_irq_set,
1158 .process = &r600_irq_process,
1159 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001160 .display = {
1161 .bandwidth_update = &rv515_bandwidth_update,
1162 .get_vblank_counter = &rs600_get_vblank_counter,
1163 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001164 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001165 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001166 .hdmi_enable = &r600_hdmi_enable,
1167 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001168 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001169 .copy = {
1170 .blit = &r600_copy_blit,
1171 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher43fb7782013-01-04 09:24:18 -05001172 .dma = &rv770_copy_dma,
Alex Deucher4d756582012-09-27 15:08:35 -04001173 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher43fb7782013-01-04 09:24:18 -05001174 .copy = &rv770_copy_dma,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001175 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001176 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001177 .surface = {
1178 .set_reg = r600_set_surface_reg,
1179 .clear_reg = r600_clear_surface_reg,
1180 },
Alex Deucher901ea572012-02-23 17:53:39 -05001181 .hpd = {
1182 .init = &r600_hpd_init,
1183 .fini = &r600_hpd_fini,
1184 .sense = &r600_hpd_sense,
1185 .set_polarity = &r600_hpd_set_polarity,
1186 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001187 .pm = {
1188 .misc = &rv770_pm_misc,
1189 .prepare = &rs600_pm_prepare,
1190 .finish = &rs600_pm_finish,
1191 .init_profile = &r600_pm_init_profile,
1192 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001193 .get_engine_clock = &radeon_atom_get_engine_clock,
1194 .set_engine_clock = &radeon_atom_set_engine_clock,
1195 .get_memory_clock = &radeon_atom_get_memory_clock,
1196 .set_memory_clock = &radeon_atom_set_memory_clock,
1197 .get_pcie_lanes = &r600_get_pcie_lanes,
1198 .set_pcie_lanes = &r600_set_pcie_lanes,
1199 .set_clock_gating = &radeon_atom_set_clock_gating,
Christian Königef0e6e62013-04-08 12:41:35 +02001200 .set_uvd_clocks = &rv770_set_uvd_clocks,
Alex Deuchera02fa392012-02-23 17:53:41 -05001201 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001202 .pflip = {
1203 .pre_page_flip = &rs600_pre_page_flip,
1204 .page_flip = &rv770_page_flip,
1205 .post_page_flip = &rs600_post_page_flip,
1206 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001207};
1208
1209static struct radeon_asic evergreen_asic = {
1210 .init = &evergreen_init,
1211 .fini = &evergreen_fini,
1212 .suspend = &evergreen_suspend,
1213 .resume = &evergreen_resume,
Jerome Glissea2d07b72010-03-09 14:45:11 +00001214 .asic_reset = &evergreen_asic_reset,
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001215 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001216 .ioctl_wait_idle = r600_ioctl_wait_idle,
1217 .gui_idle = &r600_gui_idle,
1218 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001219 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001220 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001221 .gart = {
1222 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1223 .set_page = &rs600_gart_set_page,
1224 },
Christian König4c87bc22011-10-19 19:02:21 +02001225 .ring = {
1226 [RADEON_RING_TYPE_GFX_INDEX] = {
1227 .ib_execute = &evergreen_ring_ib_execute,
1228 .emit_fence = &r600_fence_ring_emit,
1229 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001230 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001231 .ring_test = &r600_ring_test,
1232 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001233 .is_lockup = &evergreen_gfx_is_lockup,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001234 },
1235 [R600_RING_TYPE_DMA_INDEX] = {
1236 .ib_execute = &evergreen_dma_ring_ib_execute,
1237 .emit_fence = &evergreen_dma_fence_ring_emit,
1238 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001239 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001240 .ring_test = &r600_dma_ring_test,
1241 .ib_test = &r600_dma_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001242 .is_lockup = &evergreen_dma_is_lockup,
Christian Königf2ba57b2013-04-08 12:41:29 +02001243 },
1244 [R600_RING_TYPE_UVD_INDEX] = {
1245 .ib_execute = &r600_uvd_ib_execute,
1246 .emit_fence = &r600_uvd_fence_emit,
1247 .emit_semaphore = &r600_uvd_semaphore_emit,
1248 .cs_parse = &radeon_uvd_cs_parse,
1249 .ring_test = &r600_uvd_ring_test,
1250 .ib_test = &r600_uvd_ib_test,
1251 .is_lockup = &radeon_ring_test_lockup,
Christian König4c87bc22011-10-19 19:02:21 +02001252 }
1253 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001254 .irq = {
1255 .set = &evergreen_irq_set,
1256 .process = &evergreen_irq_process,
1257 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001258 .display = {
1259 .bandwidth_update = &evergreen_bandwidth_update,
1260 .get_vblank_counter = &evergreen_get_vblank_counter,
1261 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001262 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001263 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001264 .hdmi_enable = &evergreen_hdmi_enable,
1265 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001266 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001267 .copy = {
1268 .blit = &r600_copy_blit,
1269 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001270 .dma = &evergreen_copy_dma,
1271 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001272 .copy = &evergreen_copy_dma,
1273 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001274 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001275 .surface = {
1276 .set_reg = r600_set_surface_reg,
1277 .clear_reg = r600_clear_surface_reg,
1278 },
Alex Deucher901ea572012-02-23 17:53:39 -05001279 .hpd = {
1280 .init = &evergreen_hpd_init,
1281 .fini = &evergreen_hpd_fini,
1282 .sense = &evergreen_hpd_sense,
1283 .set_polarity = &evergreen_hpd_set_polarity,
1284 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001285 .pm = {
1286 .misc = &evergreen_pm_misc,
1287 .prepare = &evergreen_pm_prepare,
1288 .finish = &evergreen_pm_finish,
1289 .init_profile = &r600_pm_init_profile,
1290 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001291 .get_engine_clock = &radeon_atom_get_engine_clock,
1292 .set_engine_clock = &radeon_atom_set_engine_clock,
1293 .get_memory_clock = &radeon_atom_get_memory_clock,
1294 .set_memory_clock = &radeon_atom_set_memory_clock,
1295 .get_pcie_lanes = &r600_get_pcie_lanes,
1296 .set_pcie_lanes = &r600_set_pcie_lanes,
1297 .set_clock_gating = NULL,
Alex Deuchera8b49252013-04-08 12:41:33 +02001298 .set_uvd_clocks = &evergreen_set_uvd_clocks,
Alex Deuchera02fa392012-02-23 17:53:41 -05001299 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001300 .pflip = {
1301 .pre_page_flip = &evergreen_pre_page_flip,
1302 .page_flip = &evergreen_page_flip,
1303 .post_page_flip = &evergreen_post_page_flip,
1304 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001305};
1306
Alex Deucher958261d2010-11-22 17:56:30 -05001307static struct radeon_asic sumo_asic = {
1308 .init = &evergreen_init,
1309 .fini = &evergreen_fini,
1310 .suspend = &evergreen_suspend,
1311 .resume = &evergreen_resume,
Alex Deucher958261d2010-11-22 17:56:30 -05001312 .asic_reset = &evergreen_asic_reset,
1313 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001314 .ioctl_wait_idle = r600_ioctl_wait_idle,
1315 .gui_idle = &r600_gui_idle,
1316 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001317 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001318 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001319 .gart = {
1320 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1321 .set_page = &rs600_gart_set_page,
1322 },
Christian König4c87bc22011-10-19 19:02:21 +02001323 .ring = {
1324 [RADEON_RING_TYPE_GFX_INDEX] = {
1325 .ib_execute = &evergreen_ring_ib_execute,
1326 .emit_fence = &r600_fence_ring_emit,
1327 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001328 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001329 .ring_test = &r600_ring_test,
1330 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001331 .is_lockup = &evergreen_gfx_is_lockup,
Christian Königeb0c19c2012-02-23 15:18:44 +01001332 },
Alex Deucher233d1ad2012-12-04 15:25:59 -05001333 [R600_RING_TYPE_DMA_INDEX] = {
1334 .ib_execute = &evergreen_dma_ring_ib_execute,
1335 .emit_fence = &evergreen_dma_fence_ring_emit,
1336 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001337 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001338 .ring_test = &r600_dma_ring_test,
1339 .ib_test = &r600_dma_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001340 .is_lockup = &evergreen_dma_is_lockup,
Christian Königf2ba57b2013-04-08 12:41:29 +02001341 },
1342 [R600_RING_TYPE_UVD_INDEX] = {
1343 .ib_execute = &r600_uvd_ib_execute,
1344 .emit_fence = &r600_uvd_fence_emit,
1345 .emit_semaphore = &r600_uvd_semaphore_emit,
1346 .cs_parse = &radeon_uvd_cs_parse,
1347 .ring_test = &r600_uvd_ring_test,
1348 .ib_test = &r600_uvd_ib_test,
1349 .is_lockup = &radeon_ring_test_lockup,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001350 }
Christian König4c87bc22011-10-19 19:02:21 +02001351 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001352 .irq = {
1353 .set = &evergreen_irq_set,
1354 .process = &evergreen_irq_process,
1355 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001356 .display = {
1357 .bandwidth_update = &evergreen_bandwidth_update,
1358 .get_vblank_counter = &evergreen_get_vblank_counter,
1359 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001360 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001361 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001362 .hdmi_enable = &evergreen_hdmi_enable,
1363 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001364 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001365 .copy = {
1366 .blit = &r600_copy_blit,
1367 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001368 .dma = &evergreen_copy_dma,
1369 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001370 .copy = &evergreen_copy_dma,
1371 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001372 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001373 .surface = {
1374 .set_reg = r600_set_surface_reg,
1375 .clear_reg = r600_clear_surface_reg,
1376 },
Alex Deucher901ea572012-02-23 17:53:39 -05001377 .hpd = {
1378 .init = &evergreen_hpd_init,
1379 .fini = &evergreen_hpd_fini,
1380 .sense = &evergreen_hpd_sense,
1381 .set_polarity = &evergreen_hpd_set_polarity,
1382 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001383 .pm = {
1384 .misc = &evergreen_pm_misc,
1385 .prepare = &evergreen_pm_prepare,
1386 .finish = &evergreen_pm_finish,
1387 .init_profile = &sumo_pm_init_profile,
1388 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001389 .get_engine_clock = &radeon_atom_get_engine_clock,
1390 .set_engine_clock = &radeon_atom_set_engine_clock,
1391 .get_memory_clock = NULL,
1392 .set_memory_clock = NULL,
1393 .get_pcie_lanes = NULL,
1394 .set_pcie_lanes = NULL,
1395 .set_clock_gating = NULL,
Alex Deucher23d33ba2013-04-08 12:41:32 +02001396 .set_uvd_clocks = &sumo_set_uvd_clocks,
Alex Deuchera02fa392012-02-23 17:53:41 -05001397 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001398 .pflip = {
1399 .pre_page_flip = &evergreen_pre_page_flip,
1400 .page_flip = &evergreen_page_flip,
1401 .post_page_flip = &evergreen_post_page_flip,
1402 },
Alex Deucher958261d2010-11-22 17:56:30 -05001403};
1404
Alex Deuchera43b7662011-01-06 21:19:33 -05001405static struct radeon_asic btc_asic = {
1406 .init = &evergreen_init,
1407 .fini = &evergreen_fini,
1408 .suspend = &evergreen_suspend,
1409 .resume = &evergreen_resume,
Alex Deuchera43b7662011-01-06 21:19:33 -05001410 .asic_reset = &evergreen_asic_reset,
1411 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001412 .ioctl_wait_idle = r600_ioctl_wait_idle,
1413 .gui_idle = &r600_gui_idle,
1414 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001415 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001416 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001417 .gart = {
1418 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1419 .set_page = &rs600_gart_set_page,
1420 },
Christian König4c87bc22011-10-19 19:02:21 +02001421 .ring = {
1422 [RADEON_RING_TYPE_GFX_INDEX] = {
1423 .ib_execute = &evergreen_ring_ib_execute,
1424 .emit_fence = &r600_fence_ring_emit,
1425 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001426 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001427 .ring_test = &r600_ring_test,
1428 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001429 .is_lockup = &evergreen_gfx_is_lockup,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001430 },
1431 [R600_RING_TYPE_DMA_INDEX] = {
1432 .ib_execute = &evergreen_dma_ring_ib_execute,
1433 .emit_fence = &evergreen_dma_fence_ring_emit,
1434 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001435 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001436 .ring_test = &r600_dma_ring_test,
1437 .ib_test = &r600_dma_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001438 .is_lockup = &evergreen_dma_is_lockup,
Christian Königf2ba57b2013-04-08 12:41:29 +02001439 },
1440 [R600_RING_TYPE_UVD_INDEX] = {
1441 .ib_execute = &r600_uvd_ib_execute,
1442 .emit_fence = &r600_uvd_fence_emit,
1443 .emit_semaphore = &r600_uvd_semaphore_emit,
1444 .cs_parse = &radeon_uvd_cs_parse,
1445 .ring_test = &r600_uvd_ring_test,
1446 .ib_test = &r600_uvd_ib_test,
1447 .is_lockup = &radeon_ring_test_lockup,
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,
Alex Deucher27810fb2012-10-01 19:25:11 -04001485 .init_profile = &btc_pm_init_profile,
Alex Deuchera02fa392012-02-23 17:53:41 -05001486 .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,
Alex Deucher55b615a2013-03-18 18:57:27 -04001491 .get_pcie_lanes = &r600_get_pcie_lanes,
1492 .set_pcie_lanes = &r600_set_pcie_lanes,
Alex Deucher798bcf72012-02-23 17:53:48 -05001493 .set_clock_gating = NULL,
Alex Deuchera8b49252013-04-08 12:41:33 +02001494 .set_uvd_clocks = &evergreen_set_uvd_clocks,
Alex Deuchera02fa392012-02-23 17:53:41 -05001495 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001496 .pflip = {
1497 .pre_page_flip = &evergreen_pre_page_flip,
1498 .page_flip = &evergreen_page_flip,
1499 .post_page_flip = &evergreen_post_page_flip,
1500 },
Alex Deuchera43b7662011-01-06 21:19:33 -05001501};
1502
Alex Deuchere3487622011-03-02 20:07:36 -05001503static struct radeon_asic cayman_asic = {
1504 .init = &cayman_init,
1505 .fini = &cayman_fini,
1506 .suspend = &cayman_suspend,
1507 .resume = &cayman_resume,
Alex Deuchere3487622011-03-02 20:07:36 -05001508 .asic_reset = &cayman_asic_reset,
1509 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001510 .ioctl_wait_idle = r600_ioctl_wait_idle,
1511 .gui_idle = &r600_gui_idle,
1512 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001513 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001514 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001515 .gart = {
1516 .tlb_flush = &cayman_pcie_gart_tlb_flush,
1517 .set_page = &rs600_gart_set_page,
1518 },
Christian König05b07142012-08-06 20:21:10 +02001519 .vm = {
1520 .init = &cayman_vm_init,
1521 .fini = &cayman_vm_fini,
Alex Deucherdf160042013-01-31 16:26:02 -05001522 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
Christian König05b07142012-08-06 20:21:10 +02001523 .set_page = &cayman_vm_set_page,
1524 },
Christian König4c87bc22011-10-19 19:02:21 +02001525 .ring = {
1526 [RADEON_RING_TYPE_GFX_INDEX] = {
Jerome Glisse721604a2012-01-05 22:11:05 -05001527 .ib_execute = &cayman_ring_ib_execute,
1528 .ib_parse = &evergreen_ib_parse,
Alex Deucherb40e7e12011-11-17 14:57:50 -05001529 .emit_fence = &cayman_fence_ring_emit,
Christian König4c87bc22011-10-19 19:02:21 +02001530 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001531 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001532 .ring_test = &r600_ring_test,
1533 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001534 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001535 .vm_flush = &cayman_vm_flush,
Christian König4c87bc22011-10-19 19:02:21 +02001536 },
1537 [CAYMAN_RING_TYPE_CP1_INDEX] = {
Jerome Glisse721604a2012-01-05 22:11:05 -05001538 .ib_execute = &cayman_ring_ib_execute,
1539 .ib_parse = &evergreen_ib_parse,
Alex Deucherb40e7e12011-11-17 14:57:50 -05001540 .emit_fence = &cayman_fence_ring_emit,
Christian König4c87bc22011-10-19 19:02:21 +02001541 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001542 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001543 .ring_test = &r600_ring_test,
1544 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001545 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001546 .vm_flush = &cayman_vm_flush,
Christian König4c87bc22011-10-19 19:02:21 +02001547 },
1548 [CAYMAN_RING_TYPE_CP2_INDEX] = {
Jerome Glisse721604a2012-01-05 22:11:05 -05001549 .ib_execute = &cayman_ring_ib_execute,
1550 .ib_parse = &evergreen_ib_parse,
Alex Deucherb40e7e12011-11-17 14:57:50 -05001551 .emit_fence = &cayman_fence_ring_emit,
Christian König4c87bc22011-10-19 19:02:21 +02001552 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001553 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001554 .ring_test = &r600_ring_test,
1555 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001556 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001557 .vm_flush = &cayman_vm_flush,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001558 },
1559 [R600_RING_TYPE_DMA_INDEX] = {
1560 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05001561 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001562 .emit_fence = &evergreen_dma_fence_ring_emit,
1563 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001564 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001565 .ring_test = &r600_dma_ring_test,
1566 .ib_test = &r600_dma_ib_test,
1567 .is_lockup = &cayman_dma_is_lockup,
1568 .vm_flush = &cayman_dma_vm_flush,
1569 },
1570 [CAYMAN_RING_TYPE_DMA1_INDEX] = {
1571 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05001572 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001573 .emit_fence = &evergreen_dma_fence_ring_emit,
1574 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001575 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001576 .ring_test = &r600_dma_ring_test,
1577 .ib_test = &r600_dma_ib_test,
1578 .is_lockup = &cayman_dma_is_lockup,
1579 .vm_flush = &cayman_dma_vm_flush,
Christian Königf2ba57b2013-04-08 12:41:29 +02001580 },
1581 [R600_RING_TYPE_UVD_INDEX] = {
1582 .ib_execute = &r600_uvd_ib_execute,
1583 .emit_fence = &r600_uvd_fence_emit,
1584 .emit_semaphore = &cayman_uvd_semaphore_emit,
1585 .cs_parse = &radeon_uvd_cs_parse,
1586 .ring_test = &r600_uvd_ring_test,
1587 .ib_test = &r600_uvd_ib_test,
1588 .is_lockup = &radeon_ring_test_lockup,
Christian König4c87bc22011-10-19 19:02:21 +02001589 }
1590 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001591 .irq = {
1592 .set = &evergreen_irq_set,
1593 .process = &evergreen_irq_process,
1594 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001595 .display = {
1596 .bandwidth_update = &evergreen_bandwidth_update,
1597 .get_vblank_counter = &evergreen_get_vblank_counter,
1598 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001599 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001600 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001601 .hdmi_enable = &evergreen_hdmi_enable,
1602 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001603 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001604 .copy = {
1605 .blit = &r600_copy_blit,
1606 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001607 .dma = &evergreen_copy_dma,
1608 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001609 .copy = &evergreen_copy_dma,
1610 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001611 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001612 .surface = {
1613 .set_reg = r600_set_surface_reg,
1614 .clear_reg = r600_clear_surface_reg,
1615 },
Alex Deucher901ea572012-02-23 17:53:39 -05001616 .hpd = {
1617 .init = &evergreen_hpd_init,
1618 .fini = &evergreen_hpd_fini,
1619 .sense = &evergreen_hpd_sense,
1620 .set_polarity = &evergreen_hpd_set_polarity,
1621 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001622 .pm = {
1623 .misc = &evergreen_pm_misc,
1624 .prepare = &evergreen_pm_prepare,
1625 .finish = &evergreen_pm_finish,
Alex Deucher27810fb2012-10-01 19:25:11 -04001626 .init_profile = &btc_pm_init_profile,
Alex Deuchera02fa392012-02-23 17:53:41 -05001627 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001628 .get_engine_clock = &radeon_atom_get_engine_clock,
1629 .set_engine_clock = &radeon_atom_set_engine_clock,
1630 .get_memory_clock = &radeon_atom_get_memory_clock,
1631 .set_memory_clock = &radeon_atom_set_memory_clock,
Alex Deucher55b615a2013-03-18 18:57:27 -04001632 .get_pcie_lanes = &r600_get_pcie_lanes,
1633 .set_pcie_lanes = &r600_set_pcie_lanes,
Alex Deucher798bcf72012-02-23 17:53:48 -05001634 .set_clock_gating = NULL,
Alex Deuchera8b49252013-04-08 12:41:33 +02001635 .set_uvd_clocks = &evergreen_set_uvd_clocks,
Alex Deuchera02fa392012-02-23 17:53:41 -05001636 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001637 .pflip = {
1638 .pre_page_flip = &evergreen_pre_page_flip,
1639 .page_flip = &evergreen_page_flip,
1640 .post_page_flip = &evergreen_post_page_flip,
1641 },
Alex Deuchere3487622011-03-02 20:07:36 -05001642};
1643
Alex Deucherbe63fe82012-03-20 17:18:40 -04001644static struct radeon_asic trinity_asic = {
1645 .init = &cayman_init,
1646 .fini = &cayman_fini,
1647 .suspend = &cayman_suspend,
1648 .resume = &cayman_resume,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001649 .asic_reset = &cayman_asic_reset,
1650 .vga_set_state = &r600_vga_set_state,
1651 .ioctl_wait_idle = r600_ioctl_wait_idle,
1652 .gui_idle = &r600_gui_idle,
1653 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001654 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001655 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001656 .gart = {
1657 .tlb_flush = &cayman_pcie_gart_tlb_flush,
1658 .set_page = &rs600_gart_set_page,
1659 },
Christian König05b07142012-08-06 20:21:10 +02001660 .vm = {
1661 .init = &cayman_vm_init,
1662 .fini = &cayman_vm_fini,
Alex Deucherdf160042013-01-31 16:26:02 -05001663 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
Christian König05b07142012-08-06 20:21:10 +02001664 .set_page = &cayman_vm_set_page,
1665 },
Alex Deucherbe63fe82012-03-20 17:18:40 -04001666 .ring = {
1667 [RADEON_RING_TYPE_GFX_INDEX] = {
1668 .ib_execute = &cayman_ring_ib_execute,
1669 .ib_parse = &evergreen_ib_parse,
1670 .emit_fence = &cayman_fence_ring_emit,
1671 .emit_semaphore = &r600_semaphore_ring_emit,
1672 .cs_parse = &evergreen_cs_parse,
1673 .ring_test = &r600_ring_test,
1674 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001675 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001676 .vm_flush = &cayman_vm_flush,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001677 },
1678 [CAYMAN_RING_TYPE_CP1_INDEX] = {
1679 .ib_execute = &cayman_ring_ib_execute,
1680 .ib_parse = &evergreen_ib_parse,
1681 .emit_fence = &cayman_fence_ring_emit,
1682 .emit_semaphore = &r600_semaphore_ring_emit,
1683 .cs_parse = &evergreen_cs_parse,
1684 .ring_test = &r600_ring_test,
1685 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001686 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001687 .vm_flush = &cayman_vm_flush,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001688 },
1689 [CAYMAN_RING_TYPE_CP2_INDEX] = {
1690 .ib_execute = &cayman_ring_ib_execute,
1691 .ib_parse = &evergreen_ib_parse,
1692 .emit_fence = &cayman_fence_ring_emit,
1693 .emit_semaphore = &r600_semaphore_ring_emit,
1694 .cs_parse = &evergreen_cs_parse,
1695 .ring_test = &r600_ring_test,
1696 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001697 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001698 .vm_flush = &cayman_vm_flush,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001699 },
1700 [R600_RING_TYPE_DMA_INDEX] = {
1701 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05001702 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001703 .emit_fence = &evergreen_dma_fence_ring_emit,
1704 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001705 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001706 .ring_test = &r600_dma_ring_test,
1707 .ib_test = &r600_dma_ib_test,
1708 .is_lockup = &cayman_dma_is_lockup,
1709 .vm_flush = &cayman_dma_vm_flush,
1710 },
1711 [CAYMAN_RING_TYPE_DMA1_INDEX] = {
1712 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05001713 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001714 .emit_fence = &evergreen_dma_fence_ring_emit,
1715 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001716 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001717 .ring_test = &r600_dma_ring_test,
1718 .ib_test = &r600_dma_ib_test,
1719 .is_lockup = &cayman_dma_is_lockup,
1720 .vm_flush = &cayman_dma_vm_flush,
Christian Königf2ba57b2013-04-08 12:41:29 +02001721 },
1722 [R600_RING_TYPE_UVD_INDEX] = {
1723 .ib_execute = &r600_uvd_ib_execute,
1724 .emit_fence = &r600_uvd_fence_emit,
1725 .emit_semaphore = &cayman_uvd_semaphore_emit,
1726 .cs_parse = &radeon_uvd_cs_parse,
1727 .ring_test = &r600_uvd_ring_test,
1728 .ib_test = &r600_uvd_ib_test,
1729 .is_lockup = &radeon_ring_test_lockup,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001730 }
1731 },
1732 .irq = {
1733 .set = &evergreen_irq_set,
1734 .process = &evergreen_irq_process,
1735 },
1736 .display = {
1737 .bandwidth_update = &dce6_bandwidth_update,
1738 .get_vblank_counter = &evergreen_get_vblank_counter,
1739 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001740 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001741 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001742 },
1743 .copy = {
1744 .blit = &r600_copy_blit,
1745 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001746 .dma = &evergreen_copy_dma,
1747 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001748 .copy = &evergreen_copy_dma,
1749 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001750 },
1751 .surface = {
1752 .set_reg = r600_set_surface_reg,
1753 .clear_reg = r600_clear_surface_reg,
1754 },
1755 .hpd = {
1756 .init = &evergreen_hpd_init,
1757 .fini = &evergreen_hpd_fini,
1758 .sense = &evergreen_hpd_sense,
1759 .set_polarity = &evergreen_hpd_set_polarity,
1760 },
1761 .pm = {
1762 .misc = &evergreen_pm_misc,
1763 .prepare = &evergreen_pm_prepare,
1764 .finish = &evergreen_pm_finish,
1765 .init_profile = &sumo_pm_init_profile,
1766 .get_dynpm_state = &r600_pm_get_dynpm_state,
1767 .get_engine_clock = &radeon_atom_get_engine_clock,
1768 .set_engine_clock = &radeon_atom_set_engine_clock,
1769 .get_memory_clock = NULL,
1770 .set_memory_clock = NULL,
1771 .get_pcie_lanes = NULL,
1772 .set_pcie_lanes = NULL,
1773 .set_clock_gating = NULL,
Alex Deucher23d33ba2013-04-08 12:41:32 +02001774 .set_uvd_clocks = &sumo_set_uvd_clocks,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001775 },
1776 .pflip = {
1777 .pre_page_flip = &evergreen_pre_page_flip,
1778 .page_flip = &evergreen_page_flip,
1779 .post_page_flip = &evergreen_post_page_flip,
1780 },
1781};
1782
Alex Deucher02779c02012-03-20 17:18:25 -04001783static struct radeon_asic si_asic = {
1784 .init = &si_init,
1785 .fini = &si_fini,
1786 .suspend = &si_suspend,
1787 .resume = &si_resume,
Alex Deucher02779c02012-03-20 17:18:25 -04001788 .asic_reset = &si_asic_reset,
1789 .vga_set_state = &r600_vga_set_state,
1790 .ioctl_wait_idle = r600_ioctl_wait_idle,
1791 .gui_idle = &r600_gui_idle,
1792 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001793 .get_xclk = &si_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001794 .get_gpu_clock_counter = &si_get_gpu_clock_counter,
Alex Deucher02779c02012-03-20 17:18:25 -04001795 .gart = {
1796 .tlb_flush = &si_pcie_gart_tlb_flush,
1797 .set_page = &rs600_gart_set_page,
1798 },
Christian König05b07142012-08-06 20:21:10 +02001799 .vm = {
1800 .init = &si_vm_init,
1801 .fini = &si_vm_fini,
Alex Deucherdf160042013-01-31 16:26:02 -05001802 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher82ffd922012-10-02 14:47:46 -04001803 .set_page = &si_vm_set_page,
Christian König05b07142012-08-06 20:21:10 +02001804 },
Alex Deucher02779c02012-03-20 17:18:25 -04001805 .ring = {
1806 [RADEON_RING_TYPE_GFX_INDEX] = {
1807 .ib_execute = &si_ring_ib_execute,
1808 .ib_parse = &si_ib_parse,
1809 .emit_fence = &si_fence_ring_emit,
1810 .emit_semaphore = &r600_semaphore_ring_emit,
1811 .cs_parse = NULL,
1812 .ring_test = &r600_ring_test,
1813 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001814 .is_lockup = &si_gfx_is_lockup,
Christian Königee60e292012-08-09 16:21:08 +02001815 .vm_flush = &si_vm_flush,
Alex Deucher02779c02012-03-20 17:18:25 -04001816 },
1817 [CAYMAN_RING_TYPE_CP1_INDEX] = {
1818 .ib_execute = &si_ring_ib_execute,
1819 .ib_parse = &si_ib_parse,
1820 .emit_fence = &si_fence_ring_emit,
1821 .emit_semaphore = &r600_semaphore_ring_emit,
1822 .cs_parse = NULL,
1823 .ring_test = &r600_ring_test,
1824 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001825 .is_lockup = &si_gfx_is_lockup,
Christian Königee60e292012-08-09 16:21:08 +02001826 .vm_flush = &si_vm_flush,
Alex Deucher02779c02012-03-20 17:18:25 -04001827 },
1828 [CAYMAN_RING_TYPE_CP2_INDEX] = {
1829 .ib_execute = &si_ring_ib_execute,
1830 .ib_parse = &si_ib_parse,
1831 .emit_fence = &si_fence_ring_emit,
1832 .emit_semaphore = &r600_semaphore_ring_emit,
1833 .cs_parse = NULL,
1834 .ring_test = &r600_ring_test,
1835 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001836 .is_lockup = &si_gfx_is_lockup,
Christian Königee60e292012-08-09 16:21:08 +02001837 .vm_flush = &si_vm_flush,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05001838 },
1839 [R600_RING_TYPE_DMA_INDEX] = {
1840 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05001841 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05001842 .emit_fence = &evergreen_dma_fence_ring_emit,
1843 .emit_semaphore = &r600_dma_semaphore_ring_emit,
1844 .cs_parse = NULL,
1845 .ring_test = &r600_dma_ring_test,
1846 .ib_test = &r600_dma_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001847 .is_lockup = &si_dma_is_lockup,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05001848 .vm_flush = &si_dma_vm_flush,
1849 },
1850 [CAYMAN_RING_TYPE_DMA1_INDEX] = {
1851 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05001852 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05001853 .emit_fence = &evergreen_dma_fence_ring_emit,
1854 .emit_semaphore = &r600_dma_semaphore_ring_emit,
1855 .cs_parse = NULL,
1856 .ring_test = &r600_dma_ring_test,
1857 .ib_test = &r600_dma_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001858 .is_lockup = &si_dma_is_lockup,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05001859 .vm_flush = &si_dma_vm_flush,
Christian Königf2ba57b2013-04-08 12:41:29 +02001860 },
1861 [R600_RING_TYPE_UVD_INDEX] = {
1862 .ib_execute = &r600_uvd_ib_execute,
1863 .emit_fence = &r600_uvd_fence_emit,
1864 .emit_semaphore = &cayman_uvd_semaphore_emit,
1865 .cs_parse = &radeon_uvd_cs_parse,
1866 .ring_test = &r600_uvd_ring_test,
1867 .ib_test = &r600_uvd_ib_test,
1868 .is_lockup = &radeon_ring_test_lockup,
Alex Deucher02779c02012-03-20 17:18:25 -04001869 }
1870 },
1871 .irq = {
1872 .set = &si_irq_set,
1873 .process = &si_irq_process,
1874 },
1875 .display = {
1876 .bandwidth_update = &dce6_bandwidth_update,
1877 .get_vblank_counter = &evergreen_get_vblank_counter,
1878 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001879 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001880 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucher02779c02012-03-20 17:18:25 -04001881 },
1882 .copy = {
1883 .blit = NULL,
1884 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05001885 .dma = &si_copy_dma,
1886 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001887 .copy = &si_copy_dma,
1888 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher02779c02012-03-20 17:18:25 -04001889 },
1890 .surface = {
1891 .set_reg = r600_set_surface_reg,
1892 .clear_reg = r600_clear_surface_reg,
1893 },
1894 .hpd = {
1895 .init = &evergreen_hpd_init,
1896 .fini = &evergreen_hpd_fini,
1897 .sense = &evergreen_hpd_sense,
1898 .set_polarity = &evergreen_hpd_set_polarity,
1899 },
1900 .pm = {
1901 .misc = &evergreen_pm_misc,
1902 .prepare = &evergreen_pm_prepare,
1903 .finish = &evergreen_pm_finish,
1904 .init_profile = &sumo_pm_init_profile,
1905 .get_dynpm_state = &r600_pm_get_dynpm_state,
1906 .get_engine_clock = &radeon_atom_get_engine_clock,
1907 .set_engine_clock = &radeon_atom_set_engine_clock,
1908 .get_memory_clock = &radeon_atom_get_memory_clock,
1909 .set_memory_clock = &radeon_atom_set_memory_clock,
Alex Deucher55b615a2013-03-18 18:57:27 -04001910 .get_pcie_lanes = &r600_get_pcie_lanes,
1911 .set_pcie_lanes = &r600_set_pcie_lanes,
Alex Deucher02779c02012-03-20 17:18:25 -04001912 .set_clock_gating = NULL,
Christian König2539eb02013-04-08 12:41:34 +02001913 .set_uvd_clocks = &si_set_uvd_clocks,
Alex Deucher02779c02012-03-20 17:18:25 -04001914 },
1915 .pflip = {
1916 .pre_page_flip = &evergreen_pre_page_flip,
1917 .page_flip = &evergreen_page_flip,
1918 .post_page_flip = &evergreen_post_page_flip,
1919 },
1920};
1921
Alex Deucherabf1dc62012-07-17 14:02:36 -04001922/**
1923 * radeon_asic_init - register asic specific callbacks
1924 *
1925 * @rdev: radeon device pointer
1926 *
1927 * Registers the appropriate asic specific callbacks for each
1928 * chip family. Also sets other asics specific info like the number
1929 * of crtcs and the register aperture accessors (all asics).
1930 * Returns 0 for success.
1931 */
Daniel Vetter0a10c852010-03-11 21:19:14 +00001932int radeon_asic_init(struct radeon_device *rdev)
1933{
1934 radeon_register_accessor_init(rdev);
Alex Deucherba7e05e2011-06-16 18:14:22 +00001935
1936 /* set the number of crtcs */
1937 if (rdev->flags & RADEON_SINGLE_CRTC)
1938 rdev->num_crtc = 1;
1939 else
1940 rdev->num_crtc = 2;
1941
Alex Deucher948bee32013-05-14 12:08:35 -04001942 rdev->has_uvd = false;
1943
Daniel Vetter0a10c852010-03-11 21:19:14 +00001944 switch (rdev->family) {
1945 case CHIP_R100:
1946 case CHIP_RV100:
1947 case CHIP_RS100:
1948 case CHIP_RV200:
1949 case CHIP_RS200:
1950 rdev->asic = &r100_asic;
1951 break;
1952 case CHIP_R200:
1953 case CHIP_RV250:
1954 case CHIP_RS300:
1955 case CHIP_RV280:
1956 rdev->asic = &r200_asic;
1957 break;
1958 case CHIP_R300:
1959 case CHIP_R350:
1960 case CHIP_RV350:
1961 case CHIP_RV380:
1962 if (rdev->flags & RADEON_IS_PCIE)
1963 rdev->asic = &r300_asic_pcie;
1964 else
1965 rdev->asic = &r300_asic;
1966 break;
1967 case CHIP_R420:
1968 case CHIP_R423:
1969 case CHIP_RV410:
1970 rdev->asic = &r420_asic;
Alex Deucher07bb0842010-06-22 21:58:26 -04001971 /* handle macs */
1972 if (rdev->bios == NULL) {
Alex Deucher798bcf72012-02-23 17:53:48 -05001973 rdev->asic->pm.get_engine_clock = &radeon_legacy_get_engine_clock;
1974 rdev->asic->pm.set_engine_clock = &radeon_legacy_set_engine_clock;
1975 rdev->asic->pm.get_memory_clock = &radeon_legacy_get_memory_clock;
1976 rdev->asic->pm.set_memory_clock = NULL;
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001977 rdev->asic->display.set_backlight_level = &radeon_legacy_set_backlight_level;
Alex Deucher07bb0842010-06-22 21:58:26 -04001978 }
Daniel Vetter0a10c852010-03-11 21:19:14 +00001979 break;
1980 case CHIP_RS400:
1981 case CHIP_RS480:
1982 rdev->asic = &rs400_asic;
1983 break;
1984 case CHIP_RS600:
1985 rdev->asic = &rs600_asic;
1986 break;
1987 case CHIP_RS690:
1988 case CHIP_RS740:
1989 rdev->asic = &rs690_asic;
1990 break;
1991 case CHIP_RV515:
1992 rdev->asic = &rv515_asic;
1993 break;
1994 case CHIP_R520:
1995 case CHIP_RV530:
1996 case CHIP_RV560:
1997 case CHIP_RV570:
1998 case CHIP_R580:
1999 rdev->asic = &r520_asic;
2000 break;
2001 case CHIP_R600:
2002 case CHIP_RV610:
2003 case CHIP_RV630:
2004 case CHIP_RV620:
2005 case CHIP_RV635:
2006 case CHIP_RV670:
Alex Deucherf47299c2010-03-16 20:54:38 -04002007 rdev->asic = &r600_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002008 if (rdev->family == CHIP_R600)
2009 rdev->has_uvd = false;
2010 else
2011 rdev->has_uvd = true;
Alex Deucherf47299c2010-03-16 20:54:38 -04002012 break;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002013 case CHIP_RS780:
2014 case CHIP_RS880:
Alex Deucherf47299c2010-03-16 20:54:38 -04002015 rdev->asic = &rs780_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002016 rdev->has_uvd = true;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002017 break;
2018 case CHIP_RV770:
2019 case CHIP_RV730:
2020 case CHIP_RV710:
2021 case CHIP_RV740:
2022 rdev->asic = &rv770_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002023 rdev->has_uvd = true;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002024 break;
2025 case CHIP_CEDAR:
2026 case CHIP_REDWOOD:
2027 case CHIP_JUNIPER:
2028 case CHIP_CYPRESS:
2029 case CHIP_HEMLOCK:
Alex Deucherba7e05e2011-06-16 18:14:22 +00002030 /* set num crtcs */
2031 if (rdev->family == CHIP_CEDAR)
2032 rdev->num_crtc = 4;
2033 else
2034 rdev->num_crtc = 6;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002035 rdev->asic = &evergreen_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002036 rdev->has_uvd = true;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002037 break;
Alex Deucher958261d2010-11-22 17:56:30 -05002038 case CHIP_PALM:
Alex Deucher89da5a32011-05-31 15:42:47 -04002039 case CHIP_SUMO:
2040 case CHIP_SUMO2:
Alex Deucher958261d2010-11-22 17:56:30 -05002041 rdev->asic = &sumo_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002042 rdev->has_uvd = true;
Alex Deucher958261d2010-11-22 17:56:30 -05002043 break;
Alex Deuchera43b7662011-01-06 21:19:33 -05002044 case CHIP_BARTS:
2045 case CHIP_TURKS:
2046 case CHIP_CAICOS:
Alex Deucherba7e05e2011-06-16 18:14:22 +00002047 /* set num crtcs */
2048 if (rdev->family == CHIP_CAICOS)
2049 rdev->num_crtc = 4;
2050 else
2051 rdev->num_crtc = 6;
Alex Deuchera43b7662011-01-06 21:19:33 -05002052 rdev->asic = &btc_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002053 rdev->has_uvd = true;
Alex Deuchera43b7662011-01-06 21:19:33 -05002054 break;
Alex Deuchere3487622011-03-02 20:07:36 -05002055 case CHIP_CAYMAN:
2056 rdev->asic = &cayman_asic;
Alex Deucherba7e05e2011-06-16 18:14:22 +00002057 /* set num crtcs */
2058 rdev->num_crtc = 6;
Alex Deucher948bee32013-05-14 12:08:35 -04002059 rdev->has_uvd = true;
Alex Deuchere3487622011-03-02 20:07:36 -05002060 break;
Alex Deucherbe63fe82012-03-20 17:18:40 -04002061 case CHIP_ARUBA:
2062 rdev->asic = &trinity_asic;
2063 /* set num crtcs */
2064 rdev->num_crtc = 4;
Alex Deucher948bee32013-05-14 12:08:35 -04002065 rdev->has_uvd = true;
Alex Deucherbe63fe82012-03-20 17:18:40 -04002066 break;
Alex Deucher02779c02012-03-20 17:18:25 -04002067 case CHIP_TAHITI:
2068 case CHIP_PITCAIRN:
2069 case CHIP_VERDE:
Alex Deuchere737a142012-08-30 14:00:03 -04002070 case CHIP_OLAND:
Alex Deucher86a45ca2012-07-26 19:04:20 -04002071 case CHIP_HAINAN:
Alex Deucher02779c02012-03-20 17:18:25 -04002072 rdev->asic = &si_asic;
2073 /* set num crtcs */
Alex Deucher86a45ca2012-07-26 19:04:20 -04002074 if (rdev->family == CHIP_HAINAN)
2075 rdev->num_crtc = 0;
2076 else if (rdev->family == CHIP_OLAND)
Alex Deuchere737a142012-08-30 14:00:03 -04002077 rdev->num_crtc = 2;
2078 else
2079 rdev->num_crtc = 6;
Alex Deucher948bee32013-05-14 12:08:35 -04002080 if (rdev->family == CHIP_HAINAN)
2081 rdev->has_uvd = false;
2082 else
2083 rdev->has_uvd = true;
Alex Deucher02779c02012-03-20 17:18:25 -04002084 break;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002085 default:
2086 /* FIXME: not supported yet */
2087 return -EINVAL;
2088 }
2089
2090 if (rdev->flags & RADEON_IS_IGP) {
Alex Deucher798bcf72012-02-23 17:53:48 -05002091 rdev->asic->pm.get_memory_clock = NULL;
2092 rdev->asic->pm.set_memory_clock = NULL;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002093 }
2094
Daniel Vetter0a10c852010-03-11 21:19:14 +00002095 return 0;
2096}
2097