blob: c3df589715a04b7ec1a4f091ecd4e35200d6331f [file] [log] [blame]
Daniel Vetter0a10c852010-03-11 21:19:14 +00001/*
2 * Copyright 2008 Advanced Micro Devices, Inc.
3 * Copyright 2008 Red Hat Inc.
4 * Copyright 2009 Jerome Glisse.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
23 *
24 * Authors: Dave Airlie
25 * Alex Deucher
26 * Jerome Glisse
27 */
28
29#include <linux/console.h>
30#include <drm/drmP.h>
31#include <drm/drm_crtc_helper.h>
32#include <drm/radeon_drm.h>
33#include <linux/vgaarb.h>
34#include <linux/vga_switcheroo.h>
35#include "radeon_reg.h"
36#include "radeon.h"
37#include "radeon_asic.h"
38#include "atom.h"
39
40/*
41 * Registers accessors functions.
42 */
Alex Deucherabf1dc62012-07-17 14:02:36 -040043/**
44 * radeon_invalid_rreg - dummy reg read function
45 *
46 * @rdev: radeon device pointer
47 * @reg: offset of register
48 *
49 * Dummy register read function. Used for register blocks
50 * that certain asics don't have (all asics).
51 * Returns the value in the register.
52 */
Daniel Vetter0a10c852010-03-11 21:19:14 +000053static uint32_t radeon_invalid_rreg(struct radeon_device *rdev, uint32_t reg)
54{
55 DRM_ERROR("Invalid callback to read register 0x%04X\n", reg);
56 BUG_ON(1);
57 return 0;
58}
59
Alex Deucherabf1dc62012-07-17 14:02:36 -040060/**
61 * radeon_invalid_wreg - dummy reg write function
62 *
63 * @rdev: radeon device pointer
64 * @reg: offset of register
65 * @v: value to write to the register
66 *
67 * Dummy register read function. Used for register blocks
68 * that certain asics don't have (all asics).
69 */
Daniel Vetter0a10c852010-03-11 21:19:14 +000070static void radeon_invalid_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
71{
72 DRM_ERROR("Invalid callback to write register 0x%04X with 0x%08X\n",
73 reg, v);
74 BUG_ON(1);
75}
76
Alex Deucherabf1dc62012-07-17 14:02:36 -040077/**
78 * radeon_register_accessor_init - sets up the register accessor callbacks
79 *
80 * @rdev: radeon device pointer
81 *
82 * Sets up the register accessor callbacks for various register
83 * apertures. Not all asics have all apertures (all asics).
84 */
Daniel Vetter0a10c852010-03-11 21:19:14 +000085static void radeon_register_accessor_init(struct radeon_device *rdev)
86{
87 rdev->mc_rreg = &radeon_invalid_rreg;
88 rdev->mc_wreg = &radeon_invalid_wreg;
89 rdev->pll_rreg = &radeon_invalid_rreg;
90 rdev->pll_wreg = &radeon_invalid_wreg;
91 rdev->pciep_rreg = &radeon_invalid_rreg;
92 rdev->pciep_wreg = &radeon_invalid_wreg;
93
94 /* Don't change order as we are overridding accessor. */
95 if (rdev->family < CHIP_RV515) {
96 rdev->pcie_reg_mask = 0xff;
97 } else {
98 rdev->pcie_reg_mask = 0x7ff;
99 }
100 /* FIXME: not sure here */
101 if (rdev->family <= CHIP_R580) {
102 rdev->pll_rreg = &r100_pll_rreg;
103 rdev->pll_wreg = &r100_pll_wreg;
104 }
105 if (rdev->family >= CHIP_R420) {
106 rdev->mc_rreg = &r420_mc_rreg;
107 rdev->mc_wreg = &r420_mc_wreg;
108 }
109 if (rdev->family >= CHIP_RV515) {
110 rdev->mc_rreg = &rv515_mc_rreg;
111 rdev->mc_wreg = &rv515_mc_wreg;
112 }
113 if (rdev->family == CHIP_RS400 || rdev->family == CHIP_RS480) {
114 rdev->mc_rreg = &rs400_mc_rreg;
115 rdev->mc_wreg = &rs400_mc_wreg;
116 }
117 if (rdev->family == CHIP_RS690 || rdev->family == CHIP_RS740) {
118 rdev->mc_rreg = &rs690_mc_rreg;
119 rdev->mc_wreg = &rs690_mc_wreg;
120 }
121 if (rdev->family == CHIP_RS600) {
122 rdev->mc_rreg = &rs600_mc_rreg;
123 rdev->mc_wreg = &rs600_mc_wreg;
124 }
Samuel Li65337e62013-04-05 17:50:53 -0400125 if (rdev->family == CHIP_RS780 || rdev->family == CHIP_RS880) {
126 rdev->mc_rreg = &rs780_mc_rreg;
127 rdev->mc_wreg = &rs780_mc_wreg;
128 }
Alex Deucher6e2c3c02013-04-03 19:28:32 -0400129
130 if (rdev->family >= CHIP_BONAIRE) {
131 rdev->pciep_rreg = &cik_pciep_rreg;
132 rdev->pciep_wreg = &cik_pciep_wreg;
133 } else if (rdev->family >= CHIP_R600) {
Daniel Vetter0a10c852010-03-11 21:19:14 +0000134 rdev->pciep_rreg = &r600_pciep_rreg;
135 rdev->pciep_wreg = &r600_pciep_wreg;
136 }
137}
138
139
140/* helper to disable agp */
Alex Deucherabf1dc62012-07-17 14:02:36 -0400141/**
142 * radeon_agp_disable - AGP disable helper function
143 *
144 * @rdev: radeon device pointer
145 *
146 * Removes AGP flags and changes the gart callbacks on AGP
147 * cards when using the internal gart rather than AGP (all asics).
148 */
Daniel Vetter0a10c852010-03-11 21:19:14 +0000149void radeon_agp_disable(struct radeon_device *rdev)
150{
151 rdev->flags &= ~RADEON_IS_AGP;
152 if (rdev->family >= CHIP_R600) {
153 DRM_INFO("Forcing AGP to PCIE mode\n");
154 rdev->flags |= RADEON_IS_PCIE;
155 } else if (rdev->family >= CHIP_RV515 ||
156 rdev->family == CHIP_RV380 ||
157 rdev->family == CHIP_RV410 ||
158 rdev->family == CHIP_R423) {
159 DRM_INFO("Forcing AGP to PCIE mode\n");
160 rdev->flags |= RADEON_IS_PCIE;
Alex Deucherc5b3b852012-02-23 17:53:46 -0500161 rdev->asic->gart.tlb_flush = &rv370_pcie_gart_tlb_flush;
162 rdev->asic->gart.set_page = &rv370_pcie_gart_set_page;
Daniel Vetter0a10c852010-03-11 21:19:14 +0000163 } else {
164 DRM_INFO("Forcing AGP to PCI mode\n");
165 rdev->flags |= RADEON_IS_PCI;
Alex Deucherc5b3b852012-02-23 17:53:46 -0500166 rdev->asic->gart.tlb_flush = &r100_pci_gart_tlb_flush;
167 rdev->asic->gart.set_page = &r100_pci_gart_set_page;
Daniel Vetter0a10c852010-03-11 21:19:14 +0000168 }
169 rdev->mc.gtt_size = radeon_gart_size * 1024 * 1024;
170}
171
172/*
173 * ASIC
174 */
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000175static struct radeon_asic r100_asic = {
176 .init = &r100_init,
177 .fini = &r100_fini,
178 .suspend = &r100_suspend,
179 .resume = &r100_resume,
180 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000181 .asic_reset = &r100_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500182 .ioctl_wait_idle = NULL,
183 .gui_idle = &r100_gui_idle,
184 .mc_wait_for_idle = &r100_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500185 .gart = {
186 .tlb_flush = &r100_pci_gart_tlb_flush,
187 .set_page = &r100_pci_gart_set_page,
188 },
Christian König4c87bc22011-10-19 19:02:21 +0200189 .ring = {
190 [RADEON_RING_TYPE_GFX_INDEX] = {
191 .ib_execute = &r100_ring_ib_execute,
192 .emit_fence = &r100_fence_ring_emit,
193 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100194 .cs_parse = &r100_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500195 .ring_start = &r100_ring_start,
196 .ring_test = &r100_ring_test,
197 .ib_test = &r100_ib_test,
Christian König312c4a82012-05-02 15:11:09 +0200198 .is_lockup = &r100_gpu_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -0500199 .get_rptr = &radeon_ring_generic_get_rptr,
200 .get_wptr = &radeon_ring_generic_get_wptr,
201 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +0200202 }
203 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500204 .irq = {
205 .set = &r100_irq_set,
206 .process = &r100_irq_process,
207 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500208 .display = {
209 .bandwidth_update = &r100_bandwidth_update,
210 .get_vblank_counter = &r100_get_vblank_counter,
211 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400212 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400213 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500214 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500215 .copy = {
216 .blit = &r100_copy_blit,
217 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
218 .dma = NULL,
219 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
220 .copy = &r100_copy_blit,
221 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
222 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500223 .surface = {
224 .set_reg = r100_set_surface_reg,
225 .clear_reg = r100_clear_surface_reg,
226 },
Alex Deucher901ea572012-02-23 17:53:39 -0500227 .hpd = {
228 .init = &r100_hpd_init,
229 .fini = &r100_hpd_fini,
230 .sense = &r100_hpd_sense,
231 .set_polarity = &r100_hpd_set_polarity,
232 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500233 .pm = {
234 .misc = &r100_pm_misc,
235 .prepare = &r100_pm_prepare,
236 .finish = &r100_pm_finish,
237 .init_profile = &r100_pm_init_profile,
238 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500239 .get_engine_clock = &radeon_legacy_get_engine_clock,
240 .set_engine_clock = &radeon_legacy_set_engine_clock,
241 .get_memory_clock = &radeon_legacy_get_memory_clock,
242 .set_memory_clock = NULL,
243 .get_pcie_lanes = NULL,
244 .set_pcie_lanes = NULL,
245 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500246 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500247 .pflip = {
248 .pre_page_flip = &r100_pre_page_flip,
249 .page_flip = &r100_page_flip,
250 .post_page_flip = &r100_post_page_flip,
251 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000252};
253
254static struct radeon_asic r200_asic = {
255 .init = &r100_init,
256 .fini = &r100_fini,
257 .suspend = &r100_suspend,
258 .resume = &r100_resume,
259 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000260 .asic_reset = &r100_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500261 .ioctl_wait_idle = NULL,
262 .gui_idle = &r100_gui_idle,
263 .mc_wait_for_idle = &r100_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500264 .gart = {
265 .tlb_flush = &r100_pci_gart_tlb_flush,
266 .set_page = &r100_pci_gart_set_page,
267 },
Christian König4c87bc22011-10-19 19:02:21 +0200268 .ring = {
269 [RADEON_RING_TYPE_GFX_INDEX] = {
270 .ib_execute = &r100_ring_ib_execute,
271 .emit_fence = &r100_fence_ring_emit,
272 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100273 .cs_parse = &r100_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500274 .ring_start = &r100_ring_start,
275 .ring_test = &r100_ring_test,
276 .ib_test = &r100_ib_test,
Christian König312c4a82012-05-02 15:11:09 +0200277 .is_lockup = &r100_gpu_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -0500278 .get_rptr = &radeon_ring_generic_get_rptr,
279 .get_wptr = &radeon_ring_generic_get_wptr,
280 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +0200281 }
282 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500283 .irq = {
284 .set = &r100_irq_set,
285 .process = &r100_irq_process,
286 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500287 .display = {
288 .bandwidth_update = &r100_bandwidth_update,
289 .get_vblank_counter = &r100_get_vblank_counter,
290 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400291 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400292 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500293 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500294 .copy = {
295 .blit = &r100_copy_blit,
296 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
297 .dma = &r200_copy_dma,
298 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
299 .copy = &r100_copy_blit,
300 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
301 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500302 .surface = {
303 .set_reg = r100_set_surface_reg,
304 .clear_reg = r100_clear_surface_reg,
305 },
Alex Deucher901ea572012-02-23 17:53:39 -0500306 .hpd = {
307 .init = &r100_hpd_init,
308 .fini = &r100_hpd_fini,
309 .sense = &r100_hpd_sense,
310 .set_polarity = &r100_hpd_set_polarity,
311 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500312 .pm = {
313 .misc = &r100_pm_misc,
314 .prepare = &r100_pm_prepare,
315 .finish = &r100_pm_finish,
316 .init_profile = &r100_pm_init_profile,
317 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500318 .get_engine_clock = &radeon_legacy_get_engine_clock,
319 .set_engine_clock = &radeon_legacy_set_engine_clock,
320 .get_memory_clock = &radeon_legacy_get_memory_clock,
321 .set_memory_clock = NULL,
322 .get_pcie_lanes = NULL,
323 .set_pcie_lanes = NULL,
324 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500325 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500326 .pflip = {
327 .pre_page_flip = &r100_pre_page_flip,
328 .page_flip = &r100_page_flip,
329 .post_page_flip = &r100_post_page_flip,
330 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000331};
332
333static struct radeon_asic r300_asic = {
334 .init = &r300_init,
335 .fini = &r300_fini,
336 .suspend = &r300_suspend,
337 .resume = &r300_resume,
338 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000339 .asic_reset = &r300_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500340 .ioctl_wait_idle = NULL,
341 .gui_idle = &r100_gui_idle,
342 .mc_wait_for_idle = &r300_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500343 .gart = {
344 .tlb_flush = &r100_pci_gart_tlb_flush,
345 .set_page = &r100_pci_gart_set_page,
346 },
Christian König4c87bc22011-10-19 19:02:21 +0200347 .ring = {
348 [RADEON_RING_TYPE_GFX_INDEX] = {
349 .ib_execute = &r100_ring_ib_execute,
350 .emit_fence = &r300_fence_ring_emit,
351 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100352 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500353 .ring_start = &r300_ring_start,
354 .ring_test = &r100_ring_test,
355 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200356 .is_lockup = &r100_gpu_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -0500357 .get_rptr = &radeon_ring_generic_get_rptr,
358 .get_wptr = &radeon_ring_generic_get_wptr,
359 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +0200360 }
361 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500362 .irq = {
363 .set = &r100_irq_set,
364 .process = &r100_irq_process,
365 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500366 .display = {
367 .bandwidth_update = &r100_bandwidth_update,
368 .get_vblank_counter = &r100_get_vblank_counter,
369 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400370 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400371 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500372 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500373 .copy = {
374 .blit = &r100_copy_blit,
375 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
376 .dma = &r200_copy_dma,
377 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
378 .copy = &r100_copy_blit,
379 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
380 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500381 .surface = {
382 .set_reg = r100_set_surface_reg,
383 .clear_reg = r100_clear_surface_reg,
384 },
Alex Deucher901ea572012-02-23 17:53:39 -0500385 .hpd = {
386 .init = &r100_hpd_init,
387 .fini = &r100_hpd_fini,
388 .sense = &r100_hpd_sense,
389 .set_polarity = &r100_hpd_set_polarity,
390 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500391 .pm = {
392 .misc = &r100_pm_misc,
393 .prepare = &r100_pm_prepare,
394 .finish = &r100_pm_finish,
395 .init_profile = &r100_pm_init_profile,
396 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500397 .get_engine_clock = &radeon_legacy_get_engine_clock,
398 .set_engine_clock = &radeon_legacy_set_engine_clock,
399 .get_memory_clock = &radeon_legacy_get_memory_clock,
400 .set_memory_clock = NULL,
401 .get_pcie_lanes = &rv370_get_pcie_lanes,
402 .set_pcie_lanes = &rv370_set_pcie_lanes,
403 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500404 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500405 .pflip = {
406 .pre_page_flip = &r100_pre_page_flip,
407 .page_flip = &r100_page_flip,
408 .post_page_flip = &r100_post_page_flip,
409 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000410};
411
412static struct radeon_asic r300_asic_pcie = {
413 .init = &r300_init,
414 .fini = &r300_fini,
415 .suspend = &r300_suspend,
416 .resume = &r300_resume,
417 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000418 .asic_reset = &r300_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500419 .ioctl_wait_idle = NULL,
420 .gui_idle = &r100_gui_idle,
421 .mc_wait_for_idle = &r300_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500422 .gart = {
423 .tlb_flush = &rv370_pcie_gart_tlb_flush,
424 .set_page = &rv370_pcie_gart_set_page,
425 },
Christian König4c87bc22011-10-19 19:02:21 +0200426 .ring = {
427 [RADEON_RING_TYPE_GFX_INDEX] = {
428 .ib_execute = &r100_ring_ib_execute,
429 .emit_fence = &r300_fence_ring_emit,
430 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100431 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500432 .ring_start = &r300_ring_start,
433 .ring_test = &r100_ring_test,
434 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200435 .is_lockup = &r100_gpu_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -0500436 .get_rptr = &radeon_ring_generic_get_rptr,
437 .get_wptr = &radeon_ring_generic_get_wptr,
438 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +0200439 }
440 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500441 .irq = {
442 .set = &r100_irq_set,
443 .process = &r100_irq_process,
444 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500445 .display = {
446 .bandwidth_update = &r100_bandwidth_update,
447 .get_vblank_counter = &r100_get_vblank_counter,
448 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400449 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400450 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500451 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500452 .copy = {
453 .blit = &r100_copy_blit,
454 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
455 .dma = &r200_copy_dma,
456 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
457 .copy = &r100_copy_blit,
458 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
459 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500460 .surface = {
461 .set_reg = r100_set_surface_reg,
462 .clear_reg = r100_clear_surface_reg,
463 },
Alex Deucher901ea572012-02-23 17:53:39 -0500464 .hpd = {
465 .init = &r100_hpd_init,
466 .fini = &r100_hpd_fini,
467 .sense = &r100_hpd_sense,
468 .set_polarity = &r100_hpd_set_polarity,
469 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500470 .pm = {
471 .misc = &r100_pm_misc,
472 .prepare = &r100_pm_prepare,
473 .finish = &r100_pm_finish,
474 .init_profile = &r100_pm_init_profile,
475 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500476 .get_engine_clock = &radeon_legacy_get_engine_clock,
477 .set_engine_clock = &radeon_legacy_set_engine_clock,
478 .get_memory_clock = &radeon_legacy_get_memory_clock,
479 .set_memory_clock = NULL,
480 .get_pcie_lanes = &rv370_get_pcie_lanes,
481 .set_pcie_lanes = &rv370_set_pcie_lanes,
482 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500483 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500484 .pflip = {
485 .pre_page_flip = &r100_pre_page_flip,
486 .page_flip = &r100_page_flip,
487 .post_page_flip = &r100_post_page_flip,
488 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000489};
490
491static struct radeon_asic r420_asic = {
492 .init = &r420_init,
493 .fini = &r420_fini,
494 .suspend = &r420_suspend,
495 .resume = &r420_resume,
496 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000497 .asic_reset = &r300_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500498 .ioctl_wait_idle = NULL,
499 .gui_idle = &r100_gui_idle,
500 .mc_wait_for_idle = &r300_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500501 .gart = {
502 .tlb_flush = &rv370_pcie_gart_tlb_flush,
503 .set_page = &rv370_pcie_gart_set_page,
504 },
Christian König4c87bc22011-10-19 19:02:21 +0200505 .ring = {
506 [RADEON_RING_TYPE_GFX_INDEX] = {
507 .ib_execute = &r100_ring_ib_execute,
508 .emit_fence = &r300_fence_ring_emit,
509 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100510 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500511 .ring_start = &r300_ring_start,
512 .ring_test = &r100_ring_test,
513 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200514 .is_lockup = &r100_gpu_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -0500515 .get_rptr = &radeon_ring_generic_get_rptr,
516 .get_wptr = &radeon_ring_generic_get_wptr,
517 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +0200518 }
519 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500520 .irq = {
521 .set = &r100_irq_set,
522 .process = &r100_irq_process,
523 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500524 .display = {
525 .bandwidth_update = &r100_bandwidth_update,
526 .get_vblank_counter = &r100_get_vblank_counter,
527 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400528 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400529 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500530 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500531 .copy = {
532 .blit = &r100_copy_blit,
533 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
534 .dma = &r200_copy_dma,
535 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
536 .copy = &r100_copy_blit,
537 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
538 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500539 .surface = {
540 .set_reg = r100_set_surface_reg,
541 .clear_reg = r100_clear_surface_reg,
542 },
Alex Deucher901ea572012-02-23 17:53:39 -0500543 .hpd = {
544 .init = &r100_hpd_init,
545 .fini = &r100_hpd_fini,
546 .sense = &r100_hpd_sense,
547 .set_polarity = &r100_hpd_set_polarity,
548 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500549 .pm = {
550 .misc = &r100_pm_misc,
551 .prepare = &r100_pm_prepare,
552 .finish = &r100_pm_finish,
553 .init_profile = &r420_pm_init_profile,
554 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500555 .get_engine_clock = &radeon_atom_get_engine_clock,
556 .set_engine_clock = &radeon_atom_set_engine_clock,
557 .get_memory_clock = &radeon_atom_get_memory_clock,
558 .set_memory_clock = &radeon_atom_set_memory_clock,
559 .get_pcie_lanes = &rv370_get_pcie_lanes,
560 .set_pcie_lanes = &rv370_set_pcie_lanes,
561 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500562 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500563 .pflip = {
564 .pre_page_flip = &r100_pre_page_flip,
565 .page_flip = &r100_page_flip,
566 .post_page_flip = &r100_post_page_flip,
567 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000568};
569
570static struct radeon_asic rs400_asic = {
571 .init = &rs400_init,
572 .fini = &rs400_fini,
573 .suspend = &rs400_suspend,
574 .resume = &rs400_resume,
575 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000576 .asic_reset = &r300_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500577 .ioctl_wait_idle = NULL,
578 .gui_idle = &r100_gui_idle,
579 .mc_wait_for_idle = &rs400_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500580 .gart = {
581 .tlb_flush = &rs400_gart_tlb_flush,
582 .set_page = &rs400_gart_set_page,
583 },
Christian König4c87bc22011-10-19 19:02:21 +0200584 .ring = {
585 [RADEON_RING_TYPE_GFX_INDEX] = {
586 .ib_execute = &r100_ring_ib_execute,
587 .emit_fence = &r300_fence_ring_emit,
588 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100589 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500590 .ring_start = &r300_ring_start,
591 .ring_test = &r100_ring_test,
592 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200593 .is_lockup = &r100_gpu_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -0500594 .get_rptr = &radeon_ring_generic_get_rptr,
595 .get_wptr = &radeon_ring_generic_get_wptr,
596 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +0200597 }
598 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500599 .irq = {
600 .set = &r100_irq_set,
601 .process = &r100_irq_process,
602 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500603 .display = {
604 .bandwidth_update = &r100_bandwidth_update,
605 .get_vblank_counter = &r100_get_vblank_counter,
606 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400607 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400608 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500609 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500610 .copy = {
611 .blit = &r100_copy_blit,
612 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
613 .dma = &r200_copy_dma,
614 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
615 .copy = &r100_copy_blit,
616 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
617 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500618 .surface = {
619 .set_reg = r100_set_surface_reg,
620 .clear_reg = r100_clear_surface_reg,
621 },
Alex Deucher901ea572012-02-23 17:53:39 -0500622 .hpd = {
623 .init = &r100_hpd_init,
624 .fini = &r100_hpd_fini,
625 .sense = &r100_hpd_sense,
626 .set_polarity = &r100_hpd_set_polarity,
627 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500628 .pm = {
629 .misc = &r100_pm_misc,
630 .prepare = &r100_pm_prepare,
631 .finish = &r100_pm_finish,
632 .init_profile = &r100_pm_init_profile,
633 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500634 .get_engine_clock = &radeon_legacy_get_engine_clock,
635 .set_engine_clock = &radeon_legacy_set_engine_clock,
636 .get_memory_clock = &radeon_legacy_get_memory_clock,
637 .set_memory_clock = NULL,
638 .get_pcie_lanes = NULL,
639 .set_pcie_lanes = NULL,
640 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500641 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500642 .pflip = {
643 .pre_page_flip = &r100_pre_page_flip,
644 .page_flip = &r100_page_flip,
645 .post_page_flip = &r100_post_page_flip,
646 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000647};
648
649static struct radeon_asic rs600_asic = {
650 .init = &rs600_init,
651 .fini = &rs600_fini,
652 .suspend = &rs600_suspend,
653 .resume = &rs600_resume,
654 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000655 .asic_reset = &rs600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500656 .ioctl_wait_idle = NULL,
657 .gui_idle = &r100_gui_idle,
658 .mc_wait_for_idle = &rs600_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500659 .gart = {
660 .tlb_flush = &rs600_gart_tlb_flush,
661 .set_page = &rs600_gart_set_page,
662 },
Christian König4c87bc22011-10-19 19:02:21 +0200663 .ring = {
664 [RADEON_RING_TYPE_GFX_INDEX] = {
665 .ib_execute = &r100_ring_ib_execute,
666 .emit_fence = &r300_fence_ring_emit,
667 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100668 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500669 .ring_start = &r300_ring_start,
670 .ring_test = &r100_ring_test,
671 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200672 .is_lockup = &r100_gpu_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -0500673 .get_rptr = &radeon_ring_generic_get_rptr,
674 .get_wptr = &radeon_ring_generic_get_wptr,
675 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +0200676 }
677 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500678 .irq = {
679 .set = &rs600_irq_set,
680 .process = &rs600_irq_process,
681 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500682 .display = {
683 .bandwidth_update = &rs600_bandwidth_update,
684 .get_vblank_counter = &rs600_get_vblank_counter,
685 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400686 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400687 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -0400688 .hdmi_enable = &r600_hdmi_enable,
689 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500690 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500691 .copy = {
692 .blit = &r100_copy_blit,
693 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
694 .dma = &r200_copy_dma,
695 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
696 .copy = &r100_copy_blit,
697 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
698 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500699 .surface = {
700 .set_reg = r100_set_surface_reg,
701 .clear_reg = r100_clear_surface_reg,
702 },
Alex Deucher901ea572012-02-23 17:53:39 -0500703 .hpd = {
704 .init = &rs600_hpd_init,
705 .fini = &rs600_hpd_fini,
706 .sense = &rs600_hpd_sense,
707 .set_polarity = &rs600_hpd_set_polarity,
708 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500709 .pm = {
710 .misc = &rs600_pm_misc,
711 .prepare = &rs600_pm_prepare,
712 .finish = &rs600_pm_finish,
713 .init_profile = &r420_pm_init_profile,
714 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500715 .get_engine_clock = &radeon_atom_get_engine_clock,
716 .set_engine_clock = &radeon_atom_set_engine_clock,
717 .get_memory_clock = &radeon_atom_get_memory_clock,
718 .set_memory_clock = &radeon_atom_set_memory_clock,
719 .get_pcie_lanes = NULL,
720 .set_pcie_lanes = NULL,
721 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500722 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500723 .pflip = {
724 .pre_page_flip = &rs600_pre_page_flip,
725 .page_flip = &rs600_page_flip,
726 .post_page_flip = &rs600_post_page_flip,
727 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000728};
729
730static struct radeon_asic rs690_asic = {
731 .init = &rs690_init,
732 .fini = &rs690_fini,
733 .suspend = &rs690_suspend,
734 .resume = &rs690_resume,
735 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000736 .asic_reset = &rs600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500737 .ioctl_wait_idle = NULL,
738 .gui_idle = &r100_gui_idle,
739 .mc_wait_for_idle = &rs690_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500740 .gart = {
741 .tlb_flush = &rs400_gart_tlb_flush,
742 .set_page = &rs400_gart_set_page,
743 },
Christian König4c87bc22011-10-19 19:02:21 +0200744 .ring = {
745 [RADEON_RING_TYPE_GFX_INDEX] = {
746 .ib_execute = &r100_ring_ib_execute,
747 .emit_fence = &r300_fence_ring_emit,
748 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100749 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500750 .ring_start = &r300_ring_start,
751 .ring_test = &r100_ring_test,
752 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200753 .is_lockup = &r100_gpu_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -0500754 .get_rptr = &radeon_ring_generic_get_rptr,
755 .get_wptr = &radeon_ring_generic_get_wptr,
756 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +0200757 }
758 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500759 .irq = {
760 .set = &rs600_irq_set,
761 .process = &rs600_irq_process,
762 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500763 .display = {
764 .get_vblank_counter = &rs600_get_vblank_counter,
765 .bandwidth_update = &rs690_bandwidth_update,
766 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400767 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400768 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -0400769 .hdmi_enable = &r600_hdmi_enable,
770 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500771 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500772 .copy = {
773 .blit = &r100_copy_blit,
774 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
775 .dma = &r200_copy_dma,
776 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
777 .copy = &r200_copy_dma,
778 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
779 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500780 .surface = {
781 .set_reg = r100_set_surface_reg,
782 .clear_reg = r100_clear_surface_reg,
783 },
Alex Deucher901ea572012-02-23 17:53:39 -0500784 .hpd = {
785 .init = &rs600_hpd_init,
786 .fini = &rs600_hpd_fini,
787 .sense = &rs600_hpd_sense,
788 .set_polarity = &rs600_hpd_set_polarity,
789 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500790 .pm = {
791 .misc = &rs600_pm_misc,
792 .prepare = &rs600_pm_prepare,
793 .finish = &rs600_pm_finish,
794 .init_profile = &r420_pm_init_profile,
795 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500796 .get_engine_clock = &radeon_atom_get_engine_clock,
797 .set_engine_clock = &radeon_atom_set_engine_clock,
798 .get_memory_clock = &radeon_atom_get_memory_clock,
799 .set_memory_clock = &radeon_atom_set_memory_clock,
800 .get_pcie_lanes = NULL,
801 .set_pcie_lanes = NULL,
802 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500803 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500804 .pflip = {
805 .pre_page_flip = &rs600_pre_page_flip,
806 .page_flip = &rs600_page_flip,
807 .post_page_flip = &rs600_post_page_flip,
808 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000809};
810
811static struct radeon_asic rv515_asic = {
812 .init = &rv515_init,
813 .fini = &rv515_fini,
814 .suspend = &rv515_suspend,
815 .resume = &rv515_resume,
816 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000817 .asic_reset = &rs600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500818 .ioctl_wait_idle = NULL,
819 .gui_idle = &r100_gui_idle,
820 .mc_wait_for_idle = &rv515_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500821 .gart = {
822 .tlb_flush = &rv370_pcie_gart_tlb_flush,
823 .set_page = &rv370_pcie_gart_set_page,
824 },
Christian König4c87bc22011-10-19 19:02:21 +0200825 .ring = {
826 [RADEON_RING_TYPE_GFX_INDEX] = {
827 .ib_execute = &r100_ring_ib_execute,
828 .emit_fence = &r300_fence_ring_emit,
829 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100830 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500831 .ring_start = &rv515_ring_start,
832 .ring_test = &r100_ring_test,
833 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200834 .is_lockup = &r100_gpu_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -0500835 .get_rptr = &radeon_ring_generic_get_rptr,
836 .get_wptr = &radeon_ring_generic_get_wptr,
837 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +0200838 }
839 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500840 .irq = {
841 .set = &rs600_irq_set,
842 .process = &rs600_irq_process,
843 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500844 .display = {
845 .get_vblank_counter = &rs600_get_vblank_counter,
846 .bandwidth_update = &rv515_bandwidth_update,
847 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400848 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400849 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500850 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500851 .copy = {
852 .blit = &r100_copy_blit,
853 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
854 .dma = &r200_copy_dma,
855 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
856 .copy = &r100_copy_blit,
857 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
858 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500859 .surface = {
860 .set_reg = r100_set_surface_reg,
861 .clear_reg = r100_clear_surface_reg,
862 },
Alex Deucher901ea572012-02-23 17:53:39 -0500863 .hpd = {
864 .init = &rs600_hpd_init,
865 .fini = &rs600_hpd_fini,
866 .sense = &rs600_hpd_sense,
867 .set_polarity = &rs600_hpd_set_polarity,
868 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500869 .pm = {
870 .misc = &rs600_pm_misc,
871 .prepare = &rs600_pm_prepare,
872 .finish = &rs600_pm_finish,
873 .init_profile = &r420_pm_init_profile,
874 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500875 .get_engine_clock = &radeon_atom_get_engine_clock,
876 .set_engine_clock = &radeon_atom_set_engine_clock,
877 .get_memory_clock = &radeon_atom_get_memory_clock,
878 .set_memory_clock = &radeon_atom_set_memory_clock,
879 .get_pcie_lanes = &rv370_get_pcie_lanes,
880 .set_pcie_lanes = &rv370_set_pcie_lanes,
881 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500882 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500883 .pflip = {
884 .pre_page_flip = &rs600_pre_page_flip,
885 .page_flip = &rs600_page_flip,
886 .post_page_flip = &rs600_post_page_flip,
887 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000888};
889
890static struct radeon_asic r520_asic = {
891 .init = &r520_init,
892 .fini = &rv515_fini,
893 .suspend = &rv515_suspend,
894 .resume = &r520_resume,
895 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000896 .asic_reset = &rs600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500897 .ioctl_wait_idle = NULL,
898 .gui_idle = &r100_gui_idle,
899 .mc_wait_for_idle = &r520_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500900 .gart = {
901 .tlb_flush = &rv370_pcie_gart_tlb_flush,
902 .set_page = &rv370_pcie_gart_set_page,
903 },
Christian König4c87bc22011-10-19 19:02:21 +0200904 .ring = {
905 [RADEON_RING_TYPE_GFX_INDEX] = {
906 .ib_execute = &r100_ring_ib_execute,
907 .emit_fence = &r300_fence_ring_emit,
908 .emit_semaphore = &r100_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100909 .cs_parse = &r300_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500910 .ring_start = &rv515_ring_start,
911 .ring_test = &r100_ring_test,
912 .ib_test = &r100_ib_test,
Christian König8ba957b52012-05-02 15:11:24 +0200913 .is_lockup = &r100_gpu_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -0500914 .get_rptr = &radeon_ring_generic_get_rptr,
915 .get_wptr = &radeon_ring_generic_get_wptr,
916 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +0200917 }
918 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500919 .irq = {
920 .set = &rs600_irq_set,
921 .process = &rs600_irq_process,
922 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500923 .display = {
924 .bandwidth_update = &rv515_bandwidth_update,
925 .get_vblank_counter = &rs600_get_vblank_counter,
926 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400927 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400928 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500929 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500930 .copy = {
931 .blit = &r100_copy_blit,
932 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
933 .dma = &r200_copy_dma,
934 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
935 .copy = &r100_copy_blit,
936 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
937 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500938 .surface = {
939 .set_reg = r100_set_surface_reg,
940 .clear_reg = r100_clear_surface_reg,
941 },
Alex Deucher901ea572012-02-23 17:53:39 -0500942 .hpd = {
943 .init = &rs600_hpd_init,
944 .fini = &rs600_hpd_fini,
945 .sense = &rs600_hpd_sense,
946 .set_polarity = &rs600_hpd_set_polarity,
947 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500948 .pm = {
949 .misc = &rs600_pm_misc,
950 .prepare = &rs600_pm_prepare,
951 .finish = &rs600_pm_finish,
952 .init_profile = &r420_pm_init_profile,
953 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500954 .get_engine_clock = &radeon_atom_get_engine_clock,
955 .set_engine_clock = &radeon_atom_set_engine_clock,
956 .get_memory_clock = &radeon_atom_get_memory_clock,
957 .set_memory_clock = &radeon_atom_set_memory_clock,
958 .get_pcie_lanes = &rv370_get_pcie_lanes,
959 .set_pcie_lanes = &rv370_set_pcie_lanes,
960 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500961 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500962 .pflip = {
963 .pre_page_flip = &rs600_pre_page_flip,
964 .page_flip = &rs600_page_flip,
965 .post_page_flip = &rs600_post_page_flip,
966 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000967};
968
969static struct radeon_asic r600_asic = {
970 .init = &r600_init,
971 .fini = &r600_fini,
972 .suspend = &r600_suspend,
973 .resume = &r600_resume,
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000974 .vga_set_state = &r600_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000975 .asic_reset = &r600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500976 .ioctl_wait_idle = r600_ioctl_wait_idle,
977 .gui_idle = &r600_gui_idle,
978 .mc_wait_for_idle = &r600_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -0500979 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -0500980 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500981 .gart = {
982 .tlb_flush = &r600_pcie_gart_tlb_flush,
983 .set_page = &rs600_gart_set_page,
984 },
Christian König4c87bc22011-10-19 19:02:21 +0200985 .ring = {
986 [RADEON_RING_TYPE_GFX_INDEX] = {
987 .ib_execute = &r600_ring_ib_execute,
988 .emit_fence = &r600_fence_ring_emit,
989 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +0100990 .cs_parse = &r600_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -0500991 .ring_test = &r600_ring_test,
992 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -0500993 .is_lockup = &r600_gfx_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -0500994 .get_rptr = &radeon_ring_generic_get_rptr,
995 .get_wptr = &radeon_ring_generic_get_wptr,
996 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher4d756582012-09-27 15:08:35 -0400997 },
998 [R600_RING_TYPE_DMA_INDEX] = {
999 .ib_execute = &r600_dma_ring_ib_execute,
1000 .emit_fence = &r600_dma_fence_ring_emit,
1001 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deuchercf4ccd02011-11-18 10:19:47 -05001002 .cs_parse = &r600_dma_cs_parse,
Alex Deucher4d756582012-09-27 15:08:35 -04001003 .ring_test = &r600_dma_ring_test,
1004 .ib_test = &r600_dma_ib_test,
1005 .is_lockup = &r600_dma_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001006 .get_rptr = &radeon_ring_generic_get_rptr,
1007 .get_wptr = &radeon_ring_generic_get_wptr,
1008 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +02001009 }
1010 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001011 .irq = {
1012 .set = &r600_irq_set,
1013 .process = &r600_irq_process,
1014 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001015 .display = {
1016 .bandwidth_update = &rv515_bandwidth_update,
1017 .get_vblank_counter = &rs600_get_vblank_counter,
1018 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001019 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001020 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001021 .hdmi_enable = &r600_hdmi_enable,
1022 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001023 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001024 .copy = {
1025 .blit = &r600_copy_blit,
1026 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher4d756582012-09-27 15:08:35 -04001027 .dma = &r600_copy_dma,
1028 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001029 .copy = &r600_copy_dma,
1030 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001031 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001032 .surface = {
1033 .set_reg = r600_set_surface_reg,
1034 .clear_reg = r600_clear_surface_reg,
1035 },
Alex Deucher901ea572012-02-23 17:53:39 -05001036 .hpd = {
1037 .init = &r600_hpd_init,
1038 .fini = &r600_hpd_fini,
1039 .sense = &r600_hpd_sense,
1040 .set_polarity = &r600_hpd_set_polarity,
1041 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001042 .pm = {
1043 .misc = &r600_pm_misc,
1044 .prepare = &rs600_pm_prepare,
1045 .finish = &rs600_pm_finish,
1046 .init_profile = &r600_pm_init_profile,
1047 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001048 .get_engine_clock = &radeon_atom_get_engine_clock,
1049 .set_engine_clock = &radeon_atom_set_engine_clock,
1050 .get_memory_clock = &radeon_atom_get_memory_clock,
1051 .set_memory_clock = &radeon_atom_set_memory_clock,
1052 .get_pcie_lanes = &r600_get_pcie_lanes,
1053 .set_pcie_lanes = &r600_set_pcie_lanes,
1054 .set_clock_gating = NULL,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001055 .get_temperature = &rv6xx_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001056 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001057 .pflip = {
1058 .pre_page_flip = &rs600_pre_page_flip,
1059 .page_flip = &rs600_page_flip,
1060 .post_page_flip = &rs600_post_page_flip,
1061 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001062};
1063
Alex Deucherca361b62013-06-21 14:42:08 -04001064static struct radeon_asic rv6xx_asic = {
1065 .init = &r600_init,
1066 .fini = &r600_fini,
1067 .suspend = &r600_suspend,
1068 .resume = &r600_resume,
1069 .vga_set_state = &r600_vga_set_state,
1070 .asic_reset = &r600_asic_reset,
1071 .ioctl_wait_idle = r600_ioctl_wait_idle,
1072 .gui_idle = &r600_gui_idle,
1073 .mc_wait_for_idle = &r600_mc_wait_for_idle,
1074 .get_xclk = &r600_get_xclk,
1075 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
1076 .gart = {
1077 .tlb_flush = &r600_pcie_gart_tlb_flush,
1078 .set_page = &rs600_gart_set_page,
1079 },
1080 .ring = {
1081 [RADEON_RING_TYPE_GFX_INDEX] = {
1082 .ib_execute = &r600_ring_ib_execute,
1083 .emit_fence = &r600_fence_ring_emit,
1084 .emit_semaphore = &r600_semaphore_ring_emit,
1085 .cs_parse = &r600_cs_parse,
1086 .ring_test = &r600_ring_test,
1087 .ib_test = &r600_ib_test,
1088 .is_lockup = &r600_gfx_is_lockup,
1089 .get_rptr = &radeon_ring_generic_get_rptr,
1090 .get_wptr = &radeon_ring_generic_get_wptr,
1091 .set_wptr = &radeon_ring_generic_set_wptr,
1092 },
1093 [R600_RING_TYPE_DMA_INDEX] = {
1094 .ib_execute = &r600_dma_ring_ib_execute,
1095 .emit_fence = &r600_dma_fence_ring_emit,
1096 .emit_semaphore = &r600_dma_semaphore_ring_emit,
1097 .cs_parse = &r600_dma_cs_parse,
1098 .ring_test = &r600_dma_ring_test,
1099 .ib_test = &r600_dma_ib_test,
1100 .is_lockup = &r600_dma_is_lockup,
1101 .get_rptr = &radeon_ring_generic_get_rptr,
1102 .get_wptr = &radeon_ring_generic_get_wptr,
1103 .set_wptr = &radeon_ring_generic_set_wptr,
1104 }
1105 },
1106 .irq = {
1107 .set = &r600_irq_set,
1108 .process = &r600_irq_process,
1109 },
1110 .display = {
1111 .bandwidth_update = &rv515_bandwidth_update,
1112 .get_vblank_counter = &rs600_get_vblank_counter,
1113 .wait_for_vblank = &avivo_wait_for_vblank,
1114 .set_backlight_level = &atombios_set_backlight_level,
1115 .get_backlight_level = &atombios_get_backlight_level,
1116 },
1117 .copy = {
1118 .blit = &r600_copy_blit,
1119 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
1120 .dma = &r600_copy_dma,
1121 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
1122 .copy = &r600_copy_dma,
1123 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
1124 },
1125 .surface = {
1126 .set_reg = r600_set_surface_reg,
1127 .clear_reg = r600_clear_surface_reg,
1128 },
1129 .hpd = {
1130 .init = &r600_hpd_init,
1131 .fini = &r600_hpd_fini,
1132 .sense = &r600_hpd_sense,
1133 .set_polarity = &r600_hpd_set_polarity,
1134 },
1135 .pm = {
1136 .misc = &r600_pm_misc,
1137 .prepare = &rs600_pm_prepare,
1138 .finish = &rs600_pm_finish,
1139 .init_profile = &r600_pm_init_profile,
1140 .get_dynpm_state = &r600_pm_get_dynpm_state,
1141 .get_engine_clock = &radeon_atom_get_engine_clock,
1142 .set_engine_clock = &radeon_atom_set_engine_clock,
1143 .get_memory_clock = &radeon_atom_get_memory_clock,
1144 .set_memory_clock = &radeon_atom_set_memory_clock,
1145 .get_pcie_lanes = &r600_get_pcie_lanes,
1146 .set_pcie_lanes = &r600_set_pcie_lanes,
1147 .set_clock_gating = NULL,
1148 .get_temperature = &rv6xx_get_temp,
1149 },
Alex Deucher4a6369e2013-04-12 14:04:10 -04001150 .dpm = {
1151 .init = &rv6xx_dpm_init,
1152 .setup_asic = &rv6xx_setup_asic,
1153 .enable = &rv6xx_dpm_enable,
1154 .disable = &rv6xx_dpm_disable,
Alex Deucher98243912013-01-16 13:13:42 -05001155 .pre_set_power_state = &r600_dpm_pre_set_power_state,
Alex Deucher4a6369e2013-04-12 14:04:10 -04001156 .set_power_state = &rv6xx_dpm_set_power_state,
Alex Deucher98243912013-01-16 13:13:42 -05001157 .post_set_power_state = &r600_dpm_post_set_power_state,
Alex Deucher4a6369e2013-04-12 14:04:10 -04001158 .display_configuration_changed = &rv6xx_dpm_display_configuration_changed,
1159 .fini = &rv6xx_dpm_fini,
1160 .get_sclk = &rv6xx_dpm_get_sclk,
1161 .get_mclk = &rv6xx_dpm_get_mclk,
1162 .print_power_state = &rv6xx_dpm_print_power_state,
1163 },
Alex Deucherca361b62013-06-21 14:42:08 -04001164 .pflip = {
1165 .pre_page_flip = &rs600_pre_page_flip,
1166 .page_flip = &rs600_page_flip,
1167 .post_page_flip = &rs600_post_page_flip,
1168 },
1169};
1170
Alex Deucherf47299c2010-03-16 20:54:38 -04001171static struct radeon_asic rs780_asic = {
1172 .init = &r600_init,
1173 .fini = &r600_fini,
1174 .suspend = &r600_suspend,
1175 .resume = &r600_resume,
Alex Deucherf47299c2010-03-16 20:54:38 -04001176 .vga_set_state = &r600_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +00001177 .asic_reset = &r600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -05001178 .ioctl_wait_idle = r600_ioctl_wait_idle,
1179 .gui_idle = &r600_gui_idle,
1180 .mc_wait_for_idle = &r600_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001181 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001182 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001183 .gart = {
1184 .tlb_flush = &r600_pcie_gart_tlb_flush,
1185 .set_page = &rs600_gart_set_page,
1186 },
Christian König4c87bc22011-10-19 19:02:21 +02001187 .ring = {
1188 [RADEON_RING_TYPE_GFX_INDEX] = {
1189 .ib_execute = &r600_ring_ib_execute,
1190 .emit_fence = &r600_fence_ring_emit,
1191 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001192 .cs_parse = &r600_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001193 .ring_test = &r600_ring_test,
1194 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001195 .is_lockup = &r600_gfx_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001196 .get_rptr = &radeon_ring_generic_get_rptr,
1197 .get_wptr = &radeon_ring_generic_get_wptr,
1198 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher4d756582012-09-27 15:08:35 -04001199 },
1200 [R600_RING_TYPE_DMA_INDEX] = {
1201 .ib_execute = &r600_dma_ring_ib_execute,
1202 .emit_fence = &r600_dma_fence_ring_emit,
1203 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deuchercf4ccd02011-11-18 10:19:47 -05001204 .cs_parse = &r600_dma_cs_parse,
Alex Deucher4d756582012-09-27 15:08:35 -04001205 .ring_test = &r600_dma_ring_test,
1206 .ib_test = &r600_dma_ib_test,
1207 .is_lockup = &r600_dma_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001208 .get_rptr = &radeon_ring_generic_get_rptr,
1209 .get_wptr = &radeon_ring_generic_get_wptr,
1210 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +02001211 }
1212 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001213 .irq = {
1214 .set = &r600_irq_set,
1215 .process = &r600_irq_process,
1216 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001217 .display = {
1218 .bandwidth_update = &rs690_bandwidth_update,
1219 .get_vblank_counter = &rs600_get_vblank_counter,
1220 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001221 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001222 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001223 .hdmi_enable = &r600_hdmi_enable,
1224 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001225 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001226 .copy = {
1227 .blit = &r600_copy_blit,
1228 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher4d756582012-09-27 15:08:35 -04001229 .dma = &r600_copy_dma,
1230 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001231 .copy = &r600_copy_dma,
1232 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001233 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001234 .surface = {
1235 .set_reg = r600_set_surface_reg,
1236 .clear_reg = r600_clear_surface_reg,
1237 },
Alex Deucher901ea572012-02-23 17:53:39 -05001238 .hpd = {
1239 .init = &r600_hpd_init,
1240 .fini = &r600_hpd_fini,
1241 .sense = &r600_hpd_sense,
1242 .set_polarity = &r600_hpd_set_polarity,
1243 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001244 .pm = {
1245 .misc = &r600_pm_misc,
1246 .prepare = &rs600_pm_prepare,
1247 .finish = &rs600_pm_finish,
1248 .init_profile = &rs780_pm_init_profile,
1249 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001250 .get_engine_clock = &radeon_atom_get_engine_clock,
1251 .set_engine_clock = &radeon_atom_set_engine_clock,
1252 .get_memory_clock = NULL,
1253 .set_memory_clock = NULL,
1254 .get_pcie_lanes = NULL,
1255 .set_pcie_lanes = NULL,
1256 .set_clock_gating = NULL,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001257 .get_temperature = &rv6xx_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001258 },
Alex Deucher9d670062013-04-12 13:59:22 -04001259 .dpm = {
1260 .init = &rs780_dpm_init,
1261 .setup_asic = &rs780_dpm_setup_asic,
1262 .enable = &rs780_dpm_enable,
1263 .disable = &rs780_dpm_disable,
Alex Deucher98243912013-01-16 13:13:42 -05001264 .pre_set_power_state = &r600_dpm_pre_set_power_state,
Alex Deucher9d670062013-04-12 13:59:22 -04001265 .set_power_state = &rs780_dpm_set_power_state,
Alex Deucher98243912013-01-16 13:13:42 -05001266 .post_set_power_state = &r600_dpm_post_set_power_state,
Alex Deucher9d670062013-04-12 13:59:22 -04001267 .display_configuration_changed = &rs780_dpm_display_configuration_changed,
1268 .fini = &rs780_dpm_fini,
1269 .get_sclk = &rs780_dpm_get_sclk,
1270 .get_mclk = &rs780_dpm_get_mclk,
1271 .print_power_state = &rs780_dpm_print_power_state,
1272 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001273 .pflip = {
1274 .pre_page_flip = &rs600_pre_page_flip,
1275 .page_flip = &rs600_page_flip,
1276 .post_page_flip = &rs600_post_page_flip,
1277 },
Alex Deucherf47299c2010-03-16 20:54:38 -04001278};
1279
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001280static struct radeon_asic rv770_asic = {
1281 .init = &rv770_init,
1282 .fini = &rv770_fini,
1283 .suspend = &rv770_suspend,
1284 .resume = &rv770_resume,
Jerome Glissea2d07b72010-03-09 14:45:11 +00001285 .asic_reset = &r600_asic_reset,
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001286 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001287 .ioctl_wait_idle = r600_ioctl_wait_idle,
1288 .gui_idle = &r600_gui_idle,
1289 .mc_wait_for_idle = &r600_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001290 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001291 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001292 .gart = {
1293 .tlb_flush = &r600_pcie_gart_tlb_flush,
1294 .set_page = &rs600_gart_set_page,
1295 },
Christian König4c87bc22011-10-19 19:02:21 +02001296 .ring = {
1297 [RADEON_RING_TYPE_GFX_INDEX] = {
1298 .ib_execute = &r600_ring_ib_execute,
1299 .emit_fence = &r600_fence_ring_emit,
1300 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001301 .cs_parse = &r600_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001302 .ring_test = &r600_ring_test,
1303 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001304 .is_lockup = &r600_gfx_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001305 .get_rptr = &radeon_ring_generic_get_rptr,
1306 .get_wptr = &radeon_ring_generic_get_wptr,
1307 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher4d756582012-09-27 15:08:35 -04001308 },
1309 [R600_RING_TYPE_DMA_INDEX] = {
1310 .ib_execute = &r600_dma_ring_ib_execute,
1311 .emit_fence = &r600_dma_fence_ring_emit,
1312 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deuchercf4ccd02011-11-18 10:19:47 -05001313 .cs_parse = &r600_dma_cs_parse,
Alex Deucher4d756582012-09-27 15:08:35 -04001314 .ring_test = &r600_dma_ring_test,
1315 .ib_test = &r600_dma_ib_test,
1316 .is_lockup = &r600_dma_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001317 .get_rptr = &radeon_ring_generic_get_rptr,
1318 .get_wptr = &radeon_ring_generic_get_wptr,
1319 .set_wptr = &radeon_ring_generic_set_wptr,
Christian Königf2ba57b2013-04-08 12:41:29 +02001320 },
1321 [R600_RING_TYPE_UVD_INDEX] = {
1322 .ib_execute = &r600_uvd_ib_execute,
1323 .emit_fence = &r600_uvd_fence_emit,
1324 .emit_semaphore = &r600_uvd_semaphore_emit,
1325 .cs_parse = &radeon_uvd_cs_parse,
1326 .ring_test = &r600_uvd_ring_test,
1327 .ib_test = &r600_uvd_ib_test,
1328 .is_lockup = &radeon_ring_test_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001329 .get_rptr = &radeon_ring_generic_get_rptr,
1330 .get_wptr = &radeon_ring_generic_get_wptr,
1331 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +02001332 }
1333 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001334 .irq = {
1335 .set = &r600_irq_set,
1336 .process = &r600_irq_process,
1337 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001338 .display = {
1339 .bandwidth_update = &rv515_bandwidth_update,
1340 .get_vblank_counter = &rs600_get_vblank_counter,
1341 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001342 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001343 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001344 .hdmi_enable = &r600_hdmi_enable,
1345 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001346 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001347 .copy = {
1348 .blit = &r600_copy_blit,
1349 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher43fb7782013-01-04 09:24:18 -05001350 .dma = &rv770_copy_dma,
Alex Deucher4d756582012-09-27 15:08:35 -04001351 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher43fb7782013-01-04 09:24:18 -05001352 .copy = &rv770_copy_dma,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001353 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001354 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001355 .surface = {
1356 .set_reg = r600_set_surface_reg,
1357 .clear_reg = r600_clear_surface_reg,
1358 },
Alex Deucher901ea572012-02-23 17:53:39 -05001359 .hpd = {
1360 .init = &r600_hpd_init,
1361 .fini = &r600_hpd_fini,
1362 .sense = &r600_hpd_sense,
1363 .set_polarity = &r600_hpd_set_polarity,
1364 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001365 .pm = {
1366 .misc = &rv770_pm_misc,
1367 .prepare = &rs600_pm_prepare,
1368 .finish = &rs600_pm_finish,
1369 .init_profile = &r600_pm_init_profile,
1370 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001371 .get_engine_clock = &radeon_atom_get_engine_clock,
1372 .set_engine_clock = &radeon_atom_set_engine_clock,
1373 .get_memory_clock = &radeon_atom_get_memory_clock,
1374 .set_memory_clock = &radeon_atom_set_memory_clock,
1375 .get_pcie_lanes = &r600_get_pcie_lanes,
1376 .set_pcie_lanes = &r600_set_pcie_lanes,
1377 .set_clock_gating = &radeon_atom_set_clock_gating,
Christian Königef0e6e62013-04-08 12:41:35 +02001378 .set_uvd_clocks = &rv770_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001379 .get_temperature = &rv770_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001380 },
Alex Deucher66229b22013-06-26 00:11:19 -04001381 .dpm = {
1382 .init = &rv770_dpm_init,
1383 .setup_asic = &rv770_dpm_setup_asic,
1384 .enable = &rv770_dpm_enable,
1385 .disable = &rv770_dpm_disable,
Alex Deucher98243912013-01-16 13:13:42 -05001386 .pre_set_power_state = &r600_dpm_pre_set_power_state,
Alex Deucher66229b22013-06-26 00:11:19 -04001387 .set_power_state = &rv770_dpm_set_power_state,
Alex Deucher98243912013-01-16 13:13:42 -05001388 .post_set_power_state = &r600_dpm_post_set_power_state,
Alex Deucher66229b22013-06-26 00:11:19 -04001389 .display_configuration_changed = &rv770_dpm_display_configuration_changed,
1390 .fini = &rv770_dpm_fini,
1391 .get_sclk = &rv770_dpm_get_sclk,
1392 .get_mclk = &rv770_dpm_get_mclk,
1393 .print_power_state = &rv770_dpm_print_power_state,
1394 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001395 .pflip = {
1396 .pre_page_flip = &rs600_pre_page_flip,
1397 .page_flip = &rv770_page_flip,
1398 .post_page_flip = &rs600_post_page_flip,
1399 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001400};
1401
1402static struct radeon_asic evergreen_asic = {
1403 .init = &evergreen_init,
1404 .fini = &evergreen_fini,
1405 .suspend = &evergreen_suspend,
1406 .resume = &evergreen_resume,
Jerome Glissea2d07b72010-03-09 14:45:11 +00001407 .asic_reset = &evergreen_asic_reset,
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001408 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001409 .ioctl_wait_idle = r600_ioctl_wait_idle,
1410 .gui_idle = &r600_gui_idle,
1411 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001412 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001413 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001414 .gart = {
1415 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1416 .set_page = &rs600_gart_set_page,
1417 },
Christian König4c87bc22011-10-19 19:02:21 +02001418 .ring = {
1419 [RADEON_RING_TYPE_GFX_INDEX] = {
1420 .ib_execute = &evergreen_ring_ib_execute,
1421 .emit_fence = &r600_fence_ring_emit,
1422 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001423 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001424 .ring_test = &r600_ring_test,
1425 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001426 .is_lockup = &evergreen_gfx_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001427 .get_rptr = &radeon_ring_generic_get_rptr,
1428 .get_wptr = &radeon_ring_generic_get_wptr,
1429 .set_wptr = &radeon_ring_generic_set_wptr,
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,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001439 .get_rptr = &radeon_ring_generic_get_rptr,
1440 .get_wptr = &radeon_ring_generic_get_wptr,
1441 .set_wptr = &radeon_ring_generic_set_wptr,
Christian Königf2ba57b2013-04-08 12:41:29 +02001442 },
1443 [R600_RING_TYPE_UVD_INDEX] = {
1444 .ib_execute = &r600_uvd_ib_execute,
1445 .emit_fence = &r600_uvd_fence_emit,
1446 .emit_semaphore = &r600_uvd_semaphore_emit,
1447 .cs_parse = &radeon_uvd_cs_parse,
1448 .ring_test = &r600_uvd_ring_test,
1449 .ib_test = &r600_uvd_ib_test,
1450 .is_lockup = &radeon_ring_test_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001451 .get_rptr = &radeon_ring_generic_get_rptr,
1452 .get_wptr = &radeon_ring_generic_get_wptr,
1453 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +02001454 }
1455 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001456 .irq = {
1457 .set = &evergreen_irq_set,
1458 .process = &evergreen_irq_process,
1459 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001460 .display = {
1461 .bandwidth_update = &evergreen_bandwidth_update,
1462 .get_vblank_counter = &evergreen_get_vblank_counter,
1463 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001464 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001465 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001466 .hdmi_enable = &evergreen_hdmi_enable,
1467 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001468 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001469 .copy = {
1470 .blit = &r600_copy_blit,
1471 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001472 .dma = &evergreen_copy_dma,
1473 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001474 .copy = &evergreen_copy_dma,
1475 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001476 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001477 .surface = {
1478 .set_reg = r600_set_surface_reg,
1479 .clear_reg = r600_clear_surface_reg,
1480 },
Alex Deucher901ea572012-02-23 17:53:39 -05001481 .hpd = {
1482 .init = &evergreen_hpd_init,
1483 .fini = &evergreen_hpd_fini,
1484 .sense = &evergreen_hpd_sense,
1485 .set_polarity = &evergreen_hpd_set_polarity,
1486 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001487 .pm = {
1488 .misc = &evergreen_pm_misc,
1489 .prepare = &evergreen_pm_prepare,
1490 .finish = &evergreen_pm_finish,
1491 .init_profile = &r600_pm_init_profile,
1492 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001493 .get_engine_clock = &radeon_atom_get_engine_clock,
1494 .set_engine_clock = &radeon_atom_set_engine_clock,
1495 .get_memory_clock = &radeon_atom_get_memory_clock,
1496 .set_memory_clock = &radeon_atom_set_memory_clock,
1497 .get_pcie_lanes = &r600_get_pcie_lanes,
1498 .set_pcie_lanes = &r600_set_pcie_lanes,
1499 .set_clock_gating = NULL,
Alex Deuchera8b49252013-04-08 12:41:33 +02001500 .set_uvd_clocks = &evergreen_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001501 .get_temperature = &evergreen_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001502 },
Alex Deucherdc50ba72013-06-26 00:33:35 -04001503 .dpm = {
1504 .init = &cypress_dpm_init,
1505 .setup_asic = &cypress_dpm_setup_asic,
1506 .enable = &cypress_dpm_enable,
1507 .disable = &cypress_dpm_disable,
Alex Deucher98243912013-01-16 13:13:42 -05001508 .pre_set_power_state = &r600_dpm_pre_set_power_state,
Alex Deucherdc50ba72013-06-26 00:33:35 -04001509 .set_power_state = &cypress_dpm_set_power_state,
Alex Deucher98243912013-01-16 13:13:42 -05001510 .post_set_power_state = &r600_dpm_post_set_power_state,
Alex Deucherdc50ba72013-06-26 00:33:35 -04001511 .display_configuration_changed = &cypress_dpm_display_configuration_changed,
1512 .fini = &cypress_dpm_fini,
1513 .get_sclk = &rv770_dpm_get_sclk,
1514 .get_mclk = &rv770_dpm_get_mclk,
1515 .print_power_state = &rv770_dpm_print_power_state,
1516 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001517 .pflip = {
1518 .pre_page_flip = &evergreen_pre_page_flip,
1519 .page_flip = &evergreen_page_flip,
1520 .post_page_flip = &evergreen_post_page_flip,
1521 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001522};
1523
Alex Deucher958261d2010-11-22 17:56:30 -05001524static struct radeon_asic sumo_asic = {
1525 .init = &evergreen_init,
1526 .fini = &evergreen_fini,
1527 .suspend = &evergreen_suspend,
1528 .resume = &evergreen_resume,
Alex Deucher958261d2010-11-22 17:56:30 -05001529 .asic_reset = &evergreen_asic_reset,
1530 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001531 .ioctl_wait_idle = r600_ioctl_wait_idle,
1532 .gui_idle = &r600_gui_idle,
1533 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001534 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001535 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001536 .gart = {
1537 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1538 .set_page = &rs600_gart_set_page,
1539 },
Christian König4c87bc22011-10-19 19:02:21 +02001540 .ring = {
1541 [RADEON_RING_TYPE_GFX_INDEX] = {
1542 .ib_execute = &evergreen_ring_ib_execute,
1543 .emit_fence = &r600_fence_ring_emit,
1544 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001545 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001546 .ring_test = &r600_ring_test,
1547 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001548 .is_lockup = &evergreen_gfx_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001549 .get_rptr = &radeon_ring_generic_get_rptr,
1550 .get_wptr = &radeon_ring_generic_get_wptr,
1551 .set_wptr = &radeon_ring_generic_set_wptr,
Christian Königeb0c19c2012-02-23 15:18:44 +01001552 },
Alex Deucher233d1ad2012-12-04 15:25:59 -05001553 [R600_RING_TYPE_DMA_INDEX] = {
1554 .ib_execute = &evergreen_dma_ring_ib_execute,
1555 .emit_fence = &evergreen_dma_fence_ring_emit,
1556 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001557 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001558 .ring_test = &r600_dma_ring_test,
1559 .ib_test = &r600_dma_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001560 .is_lockup = &evergreen_dma_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001561 .get_rptr = &radeon_ring_generic_get_rptr,
1562 .get_wptr = &radeon_ring_generic_get_wptr,
1563 .set_wptr = &radeon_ring_generic_set_wptr,
Christian Königf2ba57b2013-04-08 12:41:29 +02001564 },
1565 [R600_RING_TYPE_UVD_INDEX] = {
1566 .ib_execute = &r600_uvd_ib_execute,
1567 .emit_fence = &r600_uvd_fence_emit,
1568 .emit_semaphore = &r600_uvd_semaphore_emit,
1569 .cs_parse = &radeon_uvd_cs_parse,
1570 .ring_test = &r600_uvd_ring_test,
1571 .ib_test = &r600_uvd_ib_test,
1572 .is_lockup = &radeon_ring_test_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001573 .get_rptr = &radeon_ring_generic_get_rptr,
1574 .get_wptr = &radeon_ring_generic_get_wptr,
1575 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001576 }
Christian König4c87bc22011-10-19 19:02:21 +02001577 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001578 .irq = {
1579 .set = &evergreen_irq_set,
1580 .process = &evergreen_irq_process,
1581 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001582 .display = {
1583 .bandwidth_update = &evergreen_bandwidth_update,
1584 .get_vblank_counter = &evergreen_get_vblank_counter,
1585 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001586 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001587 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001588 .hdmi_enable = &evergreen_hdmi_enable,
1589 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001590 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001591 .copy = {
1592 .blit = &r600_copy_blit,
1593 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001594 .dma = &evergreen_copy_dma,
1595 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001596 .copy = &evergreen_copy_dma,
1597 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001598 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001599 .surface = {
1600 .set_reg = r600_set_surface_reg,
1601 .clear_reg = r600_clear_surface_reg,
1602 },
Alex Deucher901ea572012-02-23 17:53:39 -05001603 .hpd = {
1604 .init = &evergreen_hpd_init,
1605 .fini = &evergreen_hpd_fini,
1606 .sense = &evergreen_hpd_sense,
1607 .set_polarity = &evergreen_hpd_set_polarity,
1608 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001609 .pm = {
1610 .misc = &evergreen_pm_misc,
1611 .prepare = &evergreen_pm_prepare,
1612 .finish = &evergreen_pm_finish,
1613 .init_profile = &sumo_pm_init_profile,
1614 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001615 .get_engine_clock = &radeon_atom_get_engine_clock,
1616 .set_engine_clock = &radeon_atom_set_engine_clock,
1617 .get_memory_clock = NULL,
1618 .set_memory_clock = NULL,
1619 .get_pcie_lanes = NULL,
1620 .set_pcie_lanes = NULL,
1621 .set_clock_gating = NULL,
Alex Deucher23d33ba2013-04-08 12:41:32 +02001622 .set_uvd_clocks = &sumo_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001623 .get_temperature = &sumo_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001624 },
Alex Deucher80ea2c12013-04-12 14:56:21 -04001625 .dpm = {
1626 .init = &sumo_dpm_init,
1627 .setup_asic = &sumo_dpm_setup_asic,
1628 .enable = &sumo_dpm_enable,
1629 .disable = &sumo_dpm_disable,
Alex Deucher422a56b2013-06-25 15:40:21 -04001630 .pre_set_power_state = &sumo_dpm_pre_set_power_state,
Alex Deucher80ea2c12013-04-12 14:56:21 -04001631 .set_power_state = &sumo_dpm_set_power_state,
Alex Deucher422a56b2013-06-25 15:40:21 -04001632 .post_set_power_state = &sumo_dpm_post_set_power_state,
Alex Deucher80ea2c12013-04-12 14:56:21 -04001633 .display_configuration_changed = &sumo_dpm_display_configuration_changed,
1634 .fini = &sumo_dpm_fini,
1635 .get_sclk = &sumo_dpm_get_sclk,
1636 .get_mclk = &sumo_dpm_get_mclk,
1637 .print_power_state = &sumo_dpm_print_power_state,
1638 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001639 .pflip = {
1640 .pre_page_flip = &evergreen_pre_page_flip,
1641 .page_flip = &evergreen_page_flip,
1642 .post_page_flip = &evergreen_post_page_flip,
1643 },
Alex Deucher958261d2010-11-22 17:56:30 -05001644};
1645
Alex Deuchera43b7662011-01-06 21:19:33 -05001646static struct radeon_asic btc_asic = {
1647 .init = &evergreen_init,
1648 .fini = &evergreen_fini,
1649 .suspend = &evergreen_suspend,
1650 .resume = &evergreen_resume,
Alex Deuchera43b7662011-01-06 21:19:33 -05001651 .asic_reset = &evergreen_asic_reset,
1652 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001653 .ioctl_wait_idle = r600_ioctl_wait_idle,
1654 .gui_idle = &r600_gui_idle,
1655 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001656 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001657 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001658 .gart = {
1659 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1660 .set_page = &rs600_gart_set_page,
1661 },
Christian König4c87bc22011-10-19 19:02:21 +02001662 .ring = {
1663 [RADEON_RING_TYPE_GFX_INDEX] = {
1664 .ib_execute = &evergreen_ring_ib_execute,
1665 .emit_fence = &r600_fence_ring_emit,
1666 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001667 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001668 .ring_test = &r600_ring_test,
1669 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001670 .is_lockup = &evergreen_gfx_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001671 .get_rptr = &radeon_ring_generic_get_rptr,
1672 .get_wptr = &radeon_ring_generic_get_wptr,
1673 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001674 },
1675 [R600_RING_TYPE_DMA_INDEX] = {
1676 .ib_execute = &evergreen_dma_ring_ib_execute,
1677 .emit_fence = &evergreen_dma_fence_ring_emit,
1678 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001679 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001680 .ring_test = &r600_dma_ring_test,
1681 .ib_test = &r600_dma_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001682 .is_lockup = &evergreen_dma_is_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001683 .get_rptr = &radeon_ring_generic_get_rptr,
1684 .get_wptr = &radeon_ring_generic_get_wptr,
1685 .set_wptr = &radeon_ring_generic_set_wptr,
Christian Königf2ba57b2013-04-08 12:41:29 +02001686 },
1687 [R600_RING_TYPE_UVD_INDEX] = {
1688 .ib_execute = &r600_uvd_ib_execute,
1689 .emit_fence = &r600_uvd_fence_emit,
1690 .emit_semaphore = &r600_uvd_semaphore_emit,
1691 .cs_parse = &radeon_uvd_cs_parse,
1692 .ring_test = &r600_uvd_ring_test,
1693 .ib_test = &r600_uvd_ib_test,
1694 .is_lockup = &radeon_ring_test_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001695 .get_rptr = &radeon_ring_generic_get_rptr,
1696 .get_wptr = &radeon_ring_generic_get_wptr,
1697 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +02001698 }
1699 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001700 .irq = {
1701 .set = &evergreen_irq_set,
1702 .process = &evergreen_irq_process,
1703 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001704 .display = {
1705 .bandwidth_update = &evergreen_bandwidth_update,
1706 .get_vblank_counter = &evergreen_get_vblank_counter,
1707 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001708 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001709 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001710 .hdmi_enable = &evergreen_hdmi_enable,
1711 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001712 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001713 .copy = {
1714 .blit = &r600_copy_blit,
1715 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001716 .dma = &evergreen_copy_dma,
1717 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001718 .copy = &evergreen_copy_dma,
1719 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001720 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001721 .surface = {
1722 .set_reg = r600_set_surface_reg,
1723 .clear_reg = r600_clear_surface_reg,
1724 },
Alex Deucher901ea572012-02-23 17:53:39 -05001725 .hpd = {
1726 .init = &evergreen_hpd_init,
1727 .fini = &evergreen_hpd_fini,
1728 .sense = &evergreen_hpd_sense,
1729 .set_polarity = &evergreen_hpd_set_polarity,
1730 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001731 .pm = {
1732 .misc = &evergreen_pm_misc,
1733 .prepare = &evergreen_pm_prepare,
1734 .finish = &evergreen_pm_finish,
Alex Deucher27810fb2012-10-01 19:25:11 -04001735 .init_profile = &btc_pm_init_profile,
Alex Deuchera02fa392012-02-23 17:53:41 -05001736 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001737 .get_engine_clock = &radeon_atom_get_engine_clock,
1738 .set_engine_clock = &radeon_atom_set_engine_clock,
1739 .get_memory_clock = &radeon_atom_get_memory_clock,
1740 .set_memory_clock = &radeon_atom_set_memory_clock,
Alex Deucher55b615a2013-03-18 18:57:27 -04001741 .get_pcie_lanes = &r600_get_pcie_lanes,
1742 .set_pcie_lanes = &r600_set_pcie_lanes,
Alex Deucher798bcf72012-02-23 17:53:48 -05001743 .set_clock_gating = NULL,
Alex Deuchera8b49252013-04-08 12:41:33 +02001744 .set_uvd_clocks = &evergreen_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001745 .get_temperature = &evergreen_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001746 },
Alex Deucher6596afd2013-06-26 00:15:24 -04001747 .dpm = {
1748 .init = &btc_dpm_init,
1749 .setup_asic = &btc_dpm_setup_asic,
1750 .enable = &btc_dpm_enable,
1751 .disable = &btc_dpm_disable,
Alex Deuchere8a95392013-01-16 14:17:23 -05001752 .pre_set_power_state = &btc_dpm_pre_set_power_state,
Alex Deucher6596afd2013-06-26 00:15:24 -04001753 .set_power_state = &btc_dpm_set_power_state,
Alex Deuchere8a95392013-01-16 14:17:23 -05001754 .post_set_power_state = &btc_dpm_post_set_power_state,
Alex Deucher6596afd2013-06-26 00:15:24 -04001755 .display_configuration_changed = &cypress_dpm_display_configuration_changed,
1756 .fini = &btc_dpm_fini,
Alex Deuchere8a95392013-01-16 14:17:23 -05001757 .get_sclk = &btc_dpm_get_sclk,
1758 .get_mclk = &btc_dpm_get_mclk,
Alex Deucher6596afd2013-06-26 00:15:24 -04001759 .print_power_state = &rv770_dpm_print_power_state,
1760 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001761 .pflip = {
1762 .pre_page_flip = &evergreen_pre_page_flip,
1763 .page_flip = &evergreen_page_flip,
1764 .post_page_flip = &evergreen_post_page_flip,
1765 },
Alex Deuchera43b7662011-01-06 21:19:33 -05001766};
1767
Alex Deuchere3487622011-03-02 20:07:36 -05001768static struct radeon_asic cayman_asic = {
1769 .init = &cayman_init,
1770 .fini = &cayman_fini,
1771 .suspend = &cayman_suspend,
1772 .resume = &cayman_resume,
Alex Deuchere3487622011-03-02 20:07:36 -05001773 .asic_reset = &cayman_asic_reset,
1774 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001775 .ioctl_wait_idle = r600_ioctl_wait_idle,
1776 .gui_idle = &r600_gui_idle,
1777 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001778 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001779 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001780 .gart = {
1781 .tlb_flush = &cayman_pcie_gart_tlb_flush,
1782 .set_page = &rs600_gart_set_page,
1783 },
Christian König05b07142012-08-06 20:21:10 +02001784 .vm = {
1785 .init = &cayman_vm_init,
1786 .fini = &cayman_vm_fini,
Alex Deucherdf160042013-01-31 16:26:02 -05001787 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
Christian König05b07142012-08-06 20:21:10 +02001788 .set_page = &cayman_vm_set_page,
1789 },
Christian König4c87bc22011-10-19 19:02:21 +02001790 .ring = {
1791 [RADEON_RING_TYPE_GFX_INDEX] = {
Jerome Glisse721604a2012-01-05 22:11:05 -05001792 .ib_execute = &cayman_ring_ib_execute,
1793 .ib_parse = &evergreen_ib_parse,
Alex Deucherb40e7e12011-11-17 14:57:50 -05001794 .emit_fence = &cayman_fence_ring_emit,
Christian König4c87bc22011-10-19 19:02:21 +02001795 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001796 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001797 .ring_test = &r600_ring_test,
1798 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001799 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001800 .vm_flush = &cayman_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001801 .get_rptr = &radeon_ring_generic_get_rptr,
1802 .get_wptr = &radeon_ring_generic_get_wptr,
1803 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +02001804 },
1805 [CAYMAN_RING_TYPE_CP1_INDEX] = {
Jerome Glisse721604a2012-01-05 22:11:05 -05001806 .ib_execute = &cayman_ring_ib_execute,
1807 .ib_parse = &evergreen_ib_parse,
Alex Deucherb40e7e12011-11-17 14:57:50 -05001808 .emit_fence = &cayman_fence_ring_emit,
Christian König4c87bc22011-10-19 19:02:21 +02001809 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001810 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001811 .ring_test = &r600_ring_test,
1812 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001813 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001814 .vm_flush = &cayman_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001815 .get_rptr = &radeon_ring_generic_get_rptr,
1816 .get_wptr = &radeon_ring_generic_get_wptr,
1817 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +02001818 },
1819 [CAYMAN_RING_TYPE_CP2_INDEX] = {
Jerome Glisse721604a2012-01-05 22:11:05 -05001820 .ib_execute = &cayman_ring_ib_execute,
1821 .ib_parse = &evergreen_ib_parse,
Alex Deucherb40e7e12011-11-17 14:57:50 -05001822 .emit_fence = &cayman_fence_ring_emit,
Christian König4c87bc22011-10-19 19:02:21 +02001823 .emit_semaphore = &r600_semaphore_ring_emit,
Christian Königeb0c19c2012-02-23 15:18:44 +01001824 .cs_parse = &evergreen_cs_parse,
Alex Deucherf7128122012-02-23 17:53:45 -05001825 .ring_test = &r600_ring_test,
1826 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001827 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001828 .vm_flush = &cayman_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001829 .get_rptr = &radeon_ring_generic_get_rptr,
1830 .get_wptr = &radeon_ring_generic_get_wptr,
1831 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001832 },
1833 [R600_RING_TYPE_DMA_INDEX] = {
1834 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05001835 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001836 .emit_fence = &evergreen_dma_fence_ring_emit,
1837 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001838 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001839 .ring_test = &r600_dma_ring_test,
1840 .ib_test = &r600_dma_ib_test,
1841 .is_lockup = &cayman_dma_is_lockup,
1842 .vm_flush = &cayman_dma_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001843 .get_rptr = &radeon_ring_generic_get_rptr,
1844 .get_wptr = &radeon_ring_generic_get_wptr,
1845 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001846 },
1847 [CAYMAN_RING_TYPE_DMA1_INDEX] = {
1848 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05001849 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001850 .emit_fence = &evergreen_dma_fence_ring_emit,
1851 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05001852 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001853 .ring_test = &r600_dma_ring_test,
1854 .ib_test = &r600_dma_ib_test,
1855 .is_lockup = &cayman_dma_is_lockup,
1856 .vm_flush = &cayman_dma_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001857 .get_rptr = &radeon_ring_generic_get_rptr,
1858 .get_wptr = &radeon_ring_generic_get_wptr,
1859 .set_wptr = &radeon_ring_generic_set_wptr,
Christian Kö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 Deucherf93bdef2013-01-29 14:10:56 -05001869 .get_rptr = &radeon_ring_generic_get_rptr,
1870 .get_wptr = &radeon_ring_generic_get_wptr,
1871 .set_wptr = &radeon_ring_generic_set_wptr,
Christian König4c87bc22011-10-19 19:02:21 +02001872 }
1873 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001874 .irq = {
1875 .set = &evergreen_irq_set,
1876 .process = &evergreen_irq_process,
1877 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001878 .display = {
1879 .bandwidth_update = &evergreen_bandwidth_update,
1880 .get_vblank_counter = &evergreen_get_vblank_counter,
1881 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001882 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001883 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001884 .hdmi_enable = &evergreen_hdmi_enable,
1885 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001886 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001887 .copy = {
1888 .blit = &r600_copy_blit,
1889 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001890 .dma = &evergreen_copy_dma,
1891 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001892 .copy = &evergreen_copy_dma,
1893 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001894 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001895 .surface = {
1896 .set_reg = r600_set_surface_reg,
1897 .clear_reg = r600_clear_surface_reg,
1898 },
Alex Deucher901ea572012-02-23 17:53:39 -05001899 .hpd = {
1900 .init = &evergreen_hpd_init,
1901 .fini = &evergreen_hpd_fini,
1902 .sense = &evergreen_hpd_sense,
1903 .set_polarity = &evergreen_hpd_set_polarity,
1904 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001905 .pm = {
1906 .misc = &evergreen_pm_misc,
1907 .prepare = &evergreen_pm_prepare,
1908 .finish = &evergreen_pm_finish,
Alex Deucher27810fb2012-10-01 19:25:11 -04001909 .init_profile = &btc_pm_init_profile,
Alex Deuchera02fa392012-02-23 17:53:41 -05001910 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001911 .get_engine_clock = &radeon_atom_get_engine_clock,
1912 .set_engine_clock = &radeon_atom_set_engine_clock,
1913 .get_memory_clock = &radeon_atom_get_memory_clock,
1914 .set_memory_clock = &radeon_atom_set_memory_clock,
Alex Deucher55b615a2013-03-18 18:57:27 -04001915 .get_pcie_lanes = &r600_get_pcie_lanes,
1916 .set_pcie_lanes = &r600_set_pcie_lanes,
Alex Deucher798bcf72012-02-23 17:53:48 -05001917 .set_clock_gating = NULL,
Alex Deuchera8b49252013-04-08 12:41:33 +02001918 .set_uvd_clocks = &evergreen_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001919 .get_temperature = &evergreen_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001920 },
Alex Deucher69e0b572013-04-12 16:42:42 -04001921 .dpm = {
1922 .init = &ni_dpm_init,
1923 .setup_asic = &ni_dpm_setup_asic,
1924 .enable = &ni_dpm_enable,
1925 .disable = &ni_dpm_disable,
Alex Deucherfee3d742013-01-16 14:35:39 -05001926 .pre_set_power_state = &ni_dpm_pre_set_power_state,
Alex Deucher69e0b572013-04-12 16:42:42 -04001927 .set_power_state = &ni_dpm_set_power_state,
Alex Deucherfee3d742013-01-16 14:35:39 -05001928 .post_set_power_state = &ni_dpm_post_set_power_state,
Alex Deucher69e0b572013-04-12 16:42:42 -04001929 .display_configuration_changed = &cypress_dpm_display_configuration_changed,
1930 .fini = &ni_dpm_fini,
1931 .get_sclk = &ni_dpm_get_sclk,
1932 .get_mclk = &ni_dpm_get_mclk,
1933 .print_power_state = &ni_dpm_print_power_state,
1934 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001935 .pflip = {
1936 .pre_page_flip = &evergreen_pre_page_flip,
1937 .page_flip = &evergreen_page_flip,
1938 .post_page_flip = &evergreen_post_page_flip,
1939 },
Alex Deuchere3487622011-03-02 20:07:36 -05001940};
1941
Alex Deucherbe63fe82012-03-20 17:18:40 -04001942static struct radeon_asic trinity_asic = {
1943 .init = &cayman_init,
1944 .fini = &cayman_fini,
1945 .suspend = &cayman_suspend,
1946 .resume = &cayman_resume,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001947 .asic_reset = &cayman_asic_reset,
1948 .vga_set_state = &r600_vga_set_state,
1949 .ioctl_wait_idle = r600_ioctl_wait_idle,
1950 .gui_idle = &r600_gui_idle,
1951 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001952 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001953 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001954 .gart = {
1955 .tlb_flush = &cayman_pcie_gart_tlb_flush,
1956 .set_page = &rs600_gart_set_page,
1957 },
Christian König05b07142012-08-06 20:21:10 +02001958 .vm = {
1959 .init = &cayman_vm_init,
1960 .fini = &cayman_vm_fini,
Alex Deucherdf160042013-01-31 16:26:02 -05001961 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
Christian König05b07142012-08-06 20:21:10 +02001962 .set_page = &cayman_vm_set_page,
1963 },
Alex Deucherbe63fe82012-03-20 17:18:40 -04001964 .ring = {
1965 [RADEON_RING_TYPE_GFX_INDEX] = {
1966 .ib_execute = &cayman_ring_ib_execute,
1967 .ib_parse = &evergreen_ib_parse,
1968 .emit_fence = &cayman_fence_ring_emit,
1969 .emit_semaphore = &r600_semaphore_ring_emit,
1970 .cs_parse = &evergreen_cs_parse,
1971 .ring_test = &r600_ring_test,
1972 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001973 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001974 .vm_flush = &cayman_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001975 .get_rptr = &radeon_ring_generic_get_rptr,
1976 .get_wptr = &radeon_ring_generic_get_wptr,
1977 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001978 },
1979 [CAYMAN_RING_TYPE_CP1_INDEX] = {
1980 .ib_execute = &cayman_ring_ib_execute,
1981 .ib_parse = &evergreen_ib_parse,
1982 .emit_fence = &cayman_fence_ring_emit,
1983 .emit_semaphore = &r600_semaphore_ring_emit,
1984 .cs_parse = &evergreen_cs_parse,
1985 .ring_test = &r600_ring_test,
1986 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05001987 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02001988 .vm_flush = &cayman_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05001989 .get_rptr = &radeon_ring_generic_get_rptr,
1990 .get_wptr = &radeon_ring_generic_get_wptr,
1991 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001992 },
1993 [CAYMAN_RING_TYPE_CP2_INDEX] = {
1994 .ib_execute = &cayman_ring_ib_execute,
1995 .ib_parse = &evergreen_ib_parse,
1996 .emit_fence = &cayman_fence_ring_emit,
1997 .emit_semaphore = &r600_semaphore_ring_emit,
1998 .cs_parse = &evergreen_cs_parse,
1999 .ring_test = &r600_ring_test,
2000 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05002001 .is_lockup = &cayman_gfx_is_lockup,
Christian König9b40e5d2012-08-08 12:22:43 +02002002 .vm_flush = &cayman_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002003 .get_rptr = &radeon_ring_generic_get_rptr,
2004 .get_wptr = &radeon_ring_generic_get_wptr,
2005 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucherf60cbd12012-12-04 15:27:33 -05002006 },
2007 [R600_RING_TYPE_DMA_INDEX] = {
2008 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05002009 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05002010 .emit_fence = &evergreen_dma_fence_ring_emit,
2011 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05002012 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05002013 .ring_test = &r600_dma_ring_test,
2014 .ib_test = &r600_dma_ib_test,
2015 .is_lockup = &cayman_dma_is_lockup,
2016 .vm_flush = &cayman_dma_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002017 .get_rptr = &radeon_ring_generic_get_rptr,
2018 .get_wptr = &radeon_ring_generic_get_wptr,
2019 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucherf60cbd12012-12-04 15:27:33 -05002020 },
2021 [CAYMAN_RING_TYPE_DMA1_INDEX] = {
2022 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05002023 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05002024 .emit_fence = &evergreen_dma_fence_ring_emit,
2025 .emit_semaphore = &r600_dma_semaphore_ring_emit,
Alex Deucherd2ead3e2012-12-13 09:55:45 -05002026 .cs_parse = &evergreen_dma_cs_parse,
Alex Deucherf60cbd12012-12-04 15:27:33 -05002027 .ring_test = &r600_dma_ring_test,
2028 .ib_test = &r600_dma_ib_test,
2029 .is_lockup = &cayman_dma_is_lockup,
2030 .vm_flush = &cayman_dma_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002031 .get_rptr = &radeon_ring_generic_get_rptr,
2032 .get_wptr = &radeon_ring_generic_get_wptr,
2033 .set_wptr = &radeon_ring_generic_set_wptr,
Christian Königf2ba57b2013-04-08 12:41:29 +02002034 },
2035 [R600_RING_TYPE_UVD_INDEX] = {
2036 .ib_execute = &r600_uvd_ib_execute,
2037 .emit_fence = &r600_uvd_fence_emit,
2038 .emit_semaphore = &cayman_uvd_semaphore_emit,
2039 .cs_parse = &radeon_uvd_cs_parse,
2040 .ring_test = &r600_uvd_ring_test,
2041 .ib_test = &r600_uvd_ib_test,
2042 .is_lockup = &radeon_ring_test_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002043 .get_rptr = &radeon_ring_generic_get_rptr,
2044 .get_wptr = &radeon_ring_generic_get_wptr,
2045 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucherbe63fe82012-03-20 17:18:40 -04002046 }
2047 },
2048 .irq = {
2049 .set = &evergreen_irq_set,
2050 .process = &evergreen_irq_process,
2051 },
2052 .display = {
2053 .bandwidth_update = &dce6_bandwidth_update,
2054 .get_vblank_counter = &evergreen_get_vblank_counter,
2055 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04002056 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04002057 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherbe63fe82012-03-20 17:18:40 -04002058 },
2059 .copy = {
2060 .blit = &r600_copy_blit,
2061 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucherf60cbd12012-12-04 15:27:33 -05002062 .dma = &evergreen_copy_dma,
2063 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04002064 .copy = &evergreen_copy_dma,
2065 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucherbe63fe82012-03-20 17:18:40 -04002066 },
2067 .surface = {
2068 .set_reg = r600_set_surface_reg,
2069 .clear_reg = r600_clear_surface_reg,
2070 },
2071 .hpd = {
2072 .init = &evergreen_hpd_init,
2073 .fini = &evergreen_hpd_fini,
2074 .sense = &evergreen_hpd_sense,
2075 .set_polarity = &evergreen_hpd_set_polarity,
2076 },
2077 .pm = {
2078 .misc = &evergreen_pm_misc,
2079 .prepare = &evergreen_pm_prepare,
2080 .finish = &evergreen_pm_finish,
2081 .init_profile = &sumo_pm_init_profile,
2082 .get_dynpm_state = &r600_pm_get_dynpm_state,
2083 .get_engine_clock = &radeon_atom_get_engine_clock,
2084 .set_engine_clock = &radeon_atom_set_engine_clock,
2085 .get_memory_clock = NULL,
2086 .set_memory_clock = NULL,
2087 .get_pcie_lanes = NULL,
2088 .set_pcie_lanes = NULL,
2089 .set_clock_gating = NULL,
Alex Deucher23d33ba2013-04-08 12:41:32 +02002090 .set_uvd_clocks = &sumo_set_uvd_clocks,
Alex Deucher29a15222012-12-14 11:57:36 -05002091 .get_temperature = &tn_get_temp,
Alex Deucherbe63fe82012-03-20 17:18:40 -04002092 },
Alex Deucherd70229f2013-04-12 16:40:41 -04002093 .dpm = {
2094 .init = &trinity_dpm_init,
2095 .setup_asic = &trinity_dpm_setup_asic,
2096 .enable = &trinity_dpm_enable,
2097 .disable = &trinity_dpm_disable,
Alex Deuchera284c482013-01-16 13:53:40 -05002098 .pre_set_power_state = &trinity_dpm_pre_set_power_state,
Alex Deucherd70229f2013-04-12 16:40:41 -04002099 .set_power_state = &trinity_dpm_set_power_state,
Alex Deuchera284c482013-01-16 13:53:40 -05002100 .post_set_power_state = &trinity_dpm_post_set_power_state,
Alex Deucherd70229f2013-04-12 16:40:41 -04002101 .display_configuration_changed = &trinity_dpm_display_configuration_changed,
2102 .fini = &trinity_dpm_fini,
2103 .get_sclk = &trinity_dpm_get_sclk,
2104 .get_mclk = &trinity_dpm_get_mclk,
2105 .print_power_state = &trinity_dpm_print_power_state,
2106 },
Alex Deucherbe63fe82012-03-20 17:18:40 -04002107 .pflip = {
2108 .pre_page_flip = &evergreen_pre_page_flip,
2109 .page_flip = &evergreen_page_flip,
2110 .post_page_flip = &evergreen_post_page_flip,
2111 },
2112};
2113
Alex Deucher02779c02012-03-20 17:18:25 -04002114static struct radeon_asic si_asic = {
2115 .init = &si_init,
2116 .fini = &si_fini,
2117 .suspend = &si_suspend,
2118 .resume = &si_resume,
Alex Deucher02779c02012-03-20 17:18:25 -04002119 .asic_reset = &si_asic_reset,
2120 .vga_set_state = &r600_vga_set_state,
2121 .ioctl_wait_idle = r600_ioctl_wait_idle,
2122 .gui_idle = &r600_gui_idle,
2123 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05002124 .get_xclk = &si_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05002125 .get_gpu_clock_counter = &si_get_gpu_clock_counter,
Alex Deucher02779c02012-03-20 17:18:25 -04002126 .gart = {
2127 .tlb_flush = &si_pcie_gart_tlb_flush,
2128 .set_page = &rs600_gart_set_page,
2129 },
Christian König05b07142012-08-06 20:21:10 +02002130 .vm = {
2131 .init = &si_vm_init,
2132 .fini = &si_vm_fini,
Alex Deucherdf160042013-01-31 16:26:02 -05002133 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher82ffd922012-10-02 14:47:46 -04002134 .set_page = &si_vm_set_page,
Christian König05b07142012-08-06 20:21:10 +02002135 },
Alex Deucher02779c02012-03-20 17:18:25 -04002136 .ring = {
2137 [RADEON_RING_TYPE_GFX_INDEX] = {
2138 .ib_execute = &si_ring_ib_execute,
2139 .ib_parse = &si_ib_parse,
2140 .emit_fence = &si_fence_ring_emit,
2141 .emit_semaphore = &r600_semaphore_ring_emit,
2142 .cs_parse = NULL,
2143 .ring_test = &r600_ring_test,
2144 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05002145 .is_lockup = &si_gfx_is_lockup,
Christian Königee60e292012-08-09 16:21:08 +02002146 .vm_flush = &si_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002147 .get_rptr = &radeon_ring_generic_get_rptr,
2148 .get_wptr = &radeon_ring_generic_get_wptr,
2149 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher02779c02012-03-20 17:18:25 -04002150 },
2151 [CAYMAN_RING_TYPE_CP1_INDEX] = {
2152 .ib_execute = &si_ring_ib_execute,
2153 .ib_parse = &si_ib_parse,
2154 .emit_fence = &si_fence_ring_emit,
2155 .emit_semaphore = &r600_semaphore_ring_emit,
2156 .cs_parse = NULL,
2157 .ring_test = &r600_ring_test,
2158 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05002159 .is_lockup = &si_gfx_is_lockup,
Christian Königee60e292012-08-09 16:21:08 +02002160 .vm_flush = &si_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002161 .get_rptr = &radeon_ring_generic_get_rptr,
2162 .get_wptr = &radeon_ring_generic_get_wptr,
2163 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher02779c02012-03-20 17:18:25 -04002164 },
2165 [CAYMAN_RING_TYPE_CP2_INDEX] = {
2166 .ib_execute = &si_ring_ib_execute,
2167 .ib_parse = &si_ib_parse,
2168 .emit_fence = &si_fence_ring_emit,
2169 .emit_semaphore = &r600_semaphore_ring_emit,
2170 .cs_parse = NULL,
2171 .ring_test = &r600_ring_test,
2172 .ib_test = &r600_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05002173 .is_lockup = &si_gfx_is_lockup,
Christian Königee60e292012-08-09 16:21:08 +02002174 .vm_flush = &si_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002175 .get_rptr = &radeon_ring_generic_get_rptr,
2176 .get_wptr = &radeon_ring_generic_get_wptr,
2177 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05002178 },
2179 [R600_RING_TYPE_DMA_INDEX] = {
2180 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05002181 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05002182 .emit_fence = &evergreen_dma_fence_ring_emit,
2183 .emit_semaphore = &r600_dma_semaphore_ring_emit,
2184 .cs_parse = NULL,
2185 .ring_test = &r600_dma_ring_test,
2186 .ib_test = &r600_dma_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05002187 .is_lockup = &si_dma_is_lockup,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05002188 .vm_flush = &si_dma_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002189 .get_rptr = &radeon_ring_generic_get_rptr,
2190 .get_wptr = &radeon_ring_generic_get_wptr,
2191 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05002192 },
2193 [CAYMAN_RING_TYPE_DMA1_INDEX] = {
2194 .ib_execute = &cayman_dma_ring_ib_execute,
Alex Deuchercd459e52012-12-13 12:17:38 -05002195 .ib_parse = &evergreen_dma_ib_parse,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05002196 .emit_fence = &evergreen_dma_fence_ring_emit,
2197 .emit_semaphore = &r600_dma_semaphore_ring_emit,
2198 .cs_parse = NULL,
2199 .ring_test = &r600_dma_ring_test,
2200 .ib_test = &r600_dma_ib_test,
Alex Deucher123bc182013-01-24 11:37:19 -05002201 .is_lockup = &si_dma_is_lockup,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05002202 .vm_flush = &si_dma_vm_flush,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002203 .get_rptr = &radeon_ring_generic_get_rptr,
2204 .get_wptr = &radeon_ring_generic_get_wptr,
2205 .set_wptr = &radeon_ring_generic_set_wptr,
Christian Königf2ba57b2013-04-08 12:41:29 +02002206 },
2207 [R600_RING_TYPE_UVD_INDEX] = {
2208 .ib_execute = &r600_uvd_ib_execute,
2209 .emit_fence = &r600_uvd_fence_emit,
2210 .emit_semaphore = &cayman_uvd_semaphore_emit,
2211 .cs_parse = &radeon_uvd_cs_parse,
2212 .ring_test = &r600_uvd_ring_test,
2213 .ib_test = &r600_uvd_ib_test,
2214 .is_lockup = &radeon_ring_test_lockup,
Alex Deucherf93bdef2013-01-29 14:10:56 -05002215 .get_rptr = &radeon_ring_generic_get_rptr,
2216 .get_wptr = &radeon_ring_generic_get_wptr,
2217 .set_wptr = &radeon_ring_generic_set_wptr,
Alex Deucher02779c02012-03-20 17:18:25 -04002218 }
2219 },
2220 .irq = {
2221 .set = &si_irq_set,
2222 .process = &si_irq_process,
2223 },
2224 .display = {
2225 .bandwidth_update = &dce6_bandwidth_update,
2226 .get_vblank_counter = &evergreen_get_vblank_counter,
2227 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04002228 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04002229 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucher02779c02012-03-20 17:18:25 -04002230 },
2231 .copy = {
2232 .blit = NULL,
2233 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05002234 .dma = &si_copy_dma,
2235 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04002236 .copy = &si_copy_dma,
2237 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher02779c02012-03-20 17:18:25 -04002238 },
2239 .surface = {
2240 .set_reg = r600_set_surface_reg,
2241 .clear_reg = r600_clear_surface_reg,
2242 },
2243 .hpd = {
2244 .init = &evergreen_hpd_init,
2245 .fini = &evergreen_hpd_fini,
2246 .sense = &evergreen_hpd_sense,
2247 .set_polarity = &evergreen_hpd_set_polarity,
2248 },
2249 .pm = {
2250 .misc = &evergreen_pm_misc,
2251 .prepare = &evergreen_pm_prepare,
2252 .finish = &evergreen_pm_finish,
2253 .init_profile = &sumo_pm_init_profile,
2254 .get_dynpm_state = &r600_pm_get_dynpm_state,
2255 .get_engine_clock = &radeon_atom_get_engine_clock,
2256 .set_engine_clock = &radeon_atom_set_engine_clock,
2257 .get_memory_clock = &radeon_atom_get_memory_clock,
2258 .set_memory_clock = &radeon_atom_set_memory_clock,
Alex Deucher55b615a2013-03-18 18:57:27 -04002259 .get_pcie_lanes = &r600_get_pcie_lanes,
2260 .set_pcie_lanes = &r600_set_pcie_lanes,
Alex Deucher02779c02012-03-20 17:18:25 -04002261 .set_clock_gating = NULL,
Christian König2539eb02013-04-08 12:41:34 +02002262 .set_uvd_clocks = &si_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04002263 .get_temperature = &si_get_temp,
Alex Deucher02779c02012-03-20 17:18:25 -04002264 },
Alex Deuchera9e61412013-06-25 17:56:16 -04002265 .dpm = {
2266 .init = &si_dpm_init,
2267 .setup_asic = &si_dpm_setup_asic,
2268 .enable = &si_dpm_enable,
2269 .disable = &si_dpm_disable,
2270 .pre_set_power_state = &si_dpm_pre_set_power_state,
2271 .set_power_state = &si_dpm_set_power_state,
2272 .post_set_power_state = &si_dpm_post_set_power_state,
2273 .display_configuration_changed = &si_dpm_display_configuration_changed,
2274 .fini = &si_dpm_fini,
2275 .get_sclk = &ni_dpm_get_sclk,
2276 .get_mclk = &ni_dpm_get_mclk,
2277 .print_power_state = &ni_dpm_print_power_state,
2278 },
Alex Deucher02779c02012-03-20 17:18:25 -04002279 .pflip = {
2280 .pre_page_flip = &evergreen_pre_page_flip,
2281 .page_flip = &evergreen_page_flip,
2282 .post_page_flip = &evergreen_post_page_flip,
2283 },
2284};
2285
Alex Deucher0672e272013-04-09 16:22:31 -04002286static struct radeon_asic ci_asic = {
2287 .init = &cik_init,
2288 .fini = &cik_fini,
2289 .suspend = &cik_suspend,
2290 .resume = &cik_resume,
2291 .asic_reset = &cik_asic_reset,
2292 .vga_set_state = &r600_vga_set_state,
2293 .ioctl_wait_idle = NULL,
2294 .gui_idle = &r600_gui_idle,
2295 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
2296 .get_xclk = &cik_get_xclk,
2297 .get_gpu_clock_counter = &cik_get_gpu_clock_counter,
2298 .gart = {
2299 .tlb_flush = &cik_pcie_gart_tlb_flush,
2300 .set_page = &rs600_gart_set_page,
2301 },
2302 .vm = {
2303 .init = &cik_vm_init,
2304 .fini = &cik_vm_fini,
2305 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
2306 .set_page = &cik_vm_set_page,
2307 },
2308 .ring = {
2309 [RADEON_RING_TYPE_GFX_INDEX] = {
2310 .ib_execute = &cik_ring_ib_execute,
2311 .ib_parse = &cik_ib_parse,
2312 .emit_fence = &cik_fence_gfx_ring_emit,
2313 .emit_semaphore = &cik_semaphore_ring_emit,
2314 .cs_parse = NULL,
2315 .ring_test = &cik_ring_test,
2316 .ib_test = &cik_ib_test,
2317 .is_lockup = &cik_gfx_is_lockup,
2318 .vm_flush = &cik_vm_flush,
2319 .get_rptr = &radeon_ring_generic_get_rptr,
2320 .get_wptr = &radeon_ring_generic_get_wptr,
2321 .set_wptr = &radeon_ring_generic_set_wptr,
2322 },
2323 [CAYMAN_RING_TYPE_CP1_INDEX] = {
2324 .ib_execute = &cik_ring_ib_execute,
2325 .ib_parse = &cik_ib_parse,
2326 .emit_fence = &cik_fence_compute_ring_emit,
2327 .emit_semaphore = &cik_semaphore_ring_emit,
2328 .cs_parse = NULL,
2329 .ring_test = &cik_ring_test,
2330 .ib_test = &cik_ib_test,
2331 .is_lockup = &cik_gfx_is_lockup,
2332 .vm_flush = &cik_vm_flush,
2333 .get_rptr = &cik_compute_ring_get_rptr,
2334 .get_wptr = &cik_compute_ring_get_wptr,
2335 .set_wptr = &cik_compute_ring_set_wptr,
2336 },
2337 [CAYMAN_RING_TYPE_CP2_INDEX] = {
2338 .ib_execute = &cik_ring_ib_execute,
2339 .ib_parse = &cik_ib_parse,
2340 .emit_fence = &cik_fence_compute_ring_emit,
2341 .emit_semaphore = &cik_semaphore_ring_emit,
2342 .cs_parse = NULL,
2343 .ring_test = &cik_ring_test,
2344 .ib_test = &cik_ib_test,
2345 .is_lockup = &cik_gfx_is_lockup,
2346 .vm_flush = &cik_vm_flush,
2347 .get_rptr = &cik_compute_ring_get_rptr,
2348 .get_wptr = &cik_compute_ring_get_wptr,
2349 .set_wptr = &cik_compute_ring_set_wptr,
2350 },
2351 [R600_RING_TYPE_DMA_INDEX] = {
2352 .ib_execute = &cik_sdma_ring_ib_execute,
2353 .ib_parse = &cik_ib_parse,
2354 .emit_fence = &cik_sdma_fence_ring_emit,
2355 .emit_semaphore = &cik_sdma_semaphore_ring_emit,
2356 .cs_parse = NULL,
2357 .ring_test = &cik_sdma_ring_test,
2358 .ib_test = &cik_sdma_ib_test,
2359 .is_lockup = &cik_sdma_is_lockup,
2360 .vm_flush = &cik_dma_vm_flush,
2361 .get_rptr = &radeon_ring_generic_get_rptr,
2362 .get_wptr = &radeon_ring_generic_get_wptr,
2363 .set_wptr = &radeon_ring_generic_set_wptr,
2364 },
2365 [CAYMAN_RING_TYPE_DMA1_INDEX] = {
2366 .ib_execute = &cik_sdma_ring_ib_execute,
2367 .ib_parse = &cik_ib_parse,
2368 .emit_fence = &cik_sdma_fence_ring_emit,
2369 .emit_semaphore = &cik_sdma_semaphore_ring_emit,
2370 .cs_parse = NULL,
2371 .ring_test = &cik_sdma_ring_test,
2372 .ib_test = &cik_sdma_ib_test,
2373 .is_lockup = &cik_sdma_is_lockup,
2374 .vm_flush = &cik_dma_vm_flush,
2375 .get_rptr = &radeon_ring_generic_get_rptr,
2376 .get_wptr = &radeon_ring_generic_get_wptr,
2377 .set_wptr = &radeon_ring_generic_set_wptr,
2378 },
2379 [R600_RING_TYPE_UVD_INDEX] = {
2380 .ib_execute = &r600_uvd_ib_execute,
2381 .emit_fence = &r600_uvd_fence_emit,
2382 .emit_semaphore = &cayman_uvd_semaphore_emit,
2383 .cs_parse = &radeon_uvd_cs_parse,
2384 .ring_test = &r600_uvd_ring_test,
2385 .ib_test = &r600_uvd_ib_test,
2386 .is_lockup = &radeon_ring_test_lockup,
2387 .get_rptr = &radeon_ring_generic_get_rptr,
2388 .get_wptr = &radeon_ring_generic_get_wptr,
2389 .set_wptr = &radeon_ring_generic_set_wptr,
2390 }
2391 },
2392 .irq = {
2393 .set = &cik_irq_set,
2394 .process = &cik_irq_process,
2395 },
2396 .display = {
2397 .bandwidth_update = &dce8_bandwidth_update,
2398 .get_vblank_counter = &evergreen_get_vblank_counter,
2399 .wait_for_vblank = &dce4_wait_for_vblank,
2400 },
2401 .copy = {
2402 .blit = NULL,
2403 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
2404 .dma = &cik_copy_dma,
2405 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
2406 .copy = &cik_copy_dma,
2407 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
2408 },
2409 .surface = {
2410 .set_reg = r600_set_surface_reg,
2411 .clear_reg = r600_clear_surface_reg,
2412 },
2413 .hpd = {
2414 .init = &evergreen_hpd_init,
2415 .fini = &evergreen_hpd_fini,
2416 .sense = &evergreen_hpd_sense,
2417 .set_polarity = &evergreen_hpd_set_polarity,
2418 },
2419 .pm = {
2420 .misc = &evergreen_pm_misc,
2421 .prepare = &evergreen_pm_prepare,
2422 .finish = &evergreen_pm_finish,
2423 .init_profile = &sumo_pm_init_profile,
2424 .get_dynpm_state = &r600_pm_get_dynpm_state,
2425 .get_engine_clock = &radeon_atom_get_engine_clock,
2426 .set_engine_clock = &radeon_atom_set_engine_clock,
2427 .get_memory_clock = &radeon_atom_get_memory_clock,
2428 .set_memory_clock = &radeon_atom_set_memory_clock,
2429 .get_pcie_lanes = NULL,
2430 .set_pcie_lanes = NULL,
2431 .set_clock_gating = NULL,
2432 .set_uvd_clocks = &cik_set_uvd_clocks,
2433 },
2434 .pflip = {
2435 .pre_page_flip = &evergreen_pre_page_flip,
2436 .page_flip = &evergreen_page_flip,
2437 .post_page_flip = &evergreen_post_page_flip,
2438 },
2439};
2440
2441static struct radeon_asic kv_asic = {
2442 .init = &cik_init,
2443 .fini = &cik_fini,
2444 .suspend = &cik_suspend,
2445 .resume = &cik_resume,
2446 .asic_reset = &cik_asic_reset,
2447 .vga_set_state = &r600_vga_set_state,
2448 .ioctl_wait_idle = NULL,
2449 .gui_idle = &r600_gui_idle,
2450 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
2451 .get_xclk = &cik_get_xclk,
2452 .get_gpu_clock_counter = &cik_get_gpu_clock_counter,
2453 .gart = {
2454 .tlb_flush = &cik_pcie_gart_tlb_flush,
2455 .set_page = &rs600_gart_set_page,
2456 },
2457 .vm = {
2458 .init = &cik_vm_init,
2459 .fini = &cik_vm_fini,
2460 .pt_ring_index = R600_RING_TYPE_DMA_INDEX,
2461 .set_page = &cik_vm_set_page,
2462 },
2463 .ring = {
2464 [RADEON_RING_TYPE_GFX_INDEX] = {
2465 .ib_execute = &cik_ring_ib_execute,
2466 .ib_parse = &cik_ib_parse,
2467 .emit_fence = &cik_fence_gfx_ring_emit,
2468 .emit_semaphore = &cik_semaphore_ring_emit,
2469 .cs_parse = NULL,
2470 .ring_test = &cik_ring_test,
2471 .ib_test = &cik_ib_test,
2472 .is_lockup = &cik_gfx_is_lockup,
2473 .vm_flush = &cik_vm_flush,
2474 .get_rptr = &radeon_ring_generic_get_rptr,
2475 .get_wptr = &radeon_ring_generic_get_wptr,
2476 .set_wptr = &radeon_ring_generic_set_wptr,
2477 },
2478 [CAYMAN_RING_TYPE_CP1_INDEX] = {
2479 .ib_execute = &cik_ring_ib_execute,
2480 .ib_parse = &cik_ib_parse,
2481 .emit_fence = &cik_fence_compute_ring_emit,
2482 .emit_semaphore = &cik_semaphore_ring_emit,
2483 .cs_parse = NULL,
2484 .ring_test = &cik_ring_test,
2485 .ib_test = &cik_ib_test,
2486 .is_lockup = &cik_gfx_is_lockup,
2487 .vm_flush = &cik_vm_flush,
2488 .get_rptr = &cik_compute_ring_get_rptr,
2489 .get_wptr = &cik_compute_ring_get_wptr,
2490 .set_wptr = &cik_compute_ring_set_wptr,
2491 },
2492 [CAYMAN_RING_TYPE_CP2_INDEX] = {
2493 .ib_execute = &cik_ring_ib_execute,
2494 .ib_parse = &cik_ib_parse,
2495 .emit_fence = &cik_fence_compute_ring_emit,
2496 .emit_semaphore = &cik_semaphore_ring_emit,
2497 .cs_parse = NULL,
2498 .ring_test = &cik_ring_test,
2499 .ib_test = &cik_ib_test,
2500 .is_lockup = &cik_gfx_is_lockup,
2501 .vm_flush = &cik_vm_flush,
2502 .get_rptr = &cik_compute_ring_get_rptr,
2503 .get_wptr = &cik_compute_ring_get_wptr,
2504 .set_wptr = &cik_compute_ring_set_wptr,
2505 },
2506 [R600_RING_TYPE_DMA_INDEX] = {
2507 .ib_execute = &cik_sdma_ring_ib_execute,
2508 .ib_parse = &cik_ib_parse,
2509 .emit_fence = &cik_sdma_fence_ring_emit,
2510 .emit_semaphore = &cik_sdma_semaphore_ring_emit,
2511 .cs_parse = NULL,
2512 .ring_test = &cik_sdma_ring_test,
2513 .ib_test = &cik_sdma_ib_test,
2514 .is_lockup = &cik_sdma_is_lockup,
2515 .vm_flush = &cik_dma_vm_flush,
2516 .get_rptr = &radeon_ring_generic_get_rptr,
2517 .get_wptr = &radeon_ring_generic_get_wptr,
2518 .set_wptr = &radeon_ring_generic_set_wptr,
2519 },
2520 [CAYMAN_RING_TYPE_DMA1_INDEX] = {
2521 .ib_execute = &cik_sdma_ring_ib_execute,
2522 .ib_parse = &cik_ib_parse,
2523 .emit_fence = &cik_sdma_fence_ring_emit,
2524 .emit_semaphore = &cik_sdma_semaphore_ring_emit,
2525 .cs_parse = NULL,
2526 .ring_test = &cik_sdma_ring_test,
2527 .ib_test = &cik_sdma_ib_test,
2528 .is_lockup = &cik_sdma_is_lockup,
2529 .vm_flush = &cik_dma_vm_flush,
2530 .get_rptr = &radeon_ring_generic_get_rptr,
2531 .get_wptr = &radeon_ring_generic_get_wptr,
2532 .set_wptr = &radeon_ring_generic_set_wptr,
2533 },
2534 [R600_RING_TYPE_UVD_INDEX] = {
2535 .ib_execute = &r600_uvd_ib_execute,
2536 .emit_fence = &r600_uvd_fence_emit,
2537 .emit_semaphore = &cayman_uvd_semaphore_emit,
2538 .cs_parse = &radeon_uvd_cs_parse,
2539 .ring_test = &r600_uvd_ring_test,
2540 .ib_test = &r600_uvd_ib_test,
2541 .is_lockup = &radeon_ring_test_lockup,
2542 .get_rptr = &radeon_ring_generic_get_rptr,
2543 .get_wptr = &radeon_ring_generic_get_wptr,
2544 .set_wptr = &radeon_ring_generic_set_wptr,
2545 }
2546 },
2547 .irq = {
2548 .set = &cik_irq_set,
2549 .process = &cik_irq_process,
2550 },
2551 .display = {
2552 .bandwidth_update = &dce8_bandwidth_update,
2553 .get_vblank_counter = &evergreen_get_vblank_counter,
2554 .wait_for_vblank = &dce4_wait_for_vblank,
2555 },
2556 .copy = {
2557 .blit = NULL,
2558 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
2559 .dma = &cik_copy_dma,
2560 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
2561 .copy = &cik_copy_dma,
2562 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
2563 },
2564 .surface = {
2565 .set_reg = r600_set_surface_reg,
2566 .clear_reg = r600_clear_surface_reg,
2567 },
2568 .hpd = {
2569 .init = &evergreen_hpd_init,
2570 .fini = &evergreen_hpd_fini,
2571 .sense = &evergreen_hpd_sense,
2572 .set_polarity = &evergreen_hpd_set_polarity,
2573 },
2574 .pm = {
2575 .misc = &evergreen_pm_misc,
2576 .prepare = &evergreen_pm_prepare,
2577 .finish = &evergreen_pm_finish,
2578 .init_profile = &sumo_pm_init_profile,
2579 .get_dynpm_state = &r600_pm_get_dynpm_state,
2580 .get_engine_clock = &radeon_atom_get_engine_clock,
2581 .set_engine_clock = &radeon_atom_set_engine_clock,
2582 .get_memory_clock = &radeon_atom_get_memory_clock,
2583 .set_memory_clock = &radeon_atom_set_memory_clock,
2584 .get_pcie_lanes = NULL,
2585 .set_pcie_lanes = NULL,
2586 .set_clock_gating = NULL,
2587 .set_uvd_clocks = &cik_set_uvd_clocks,
2588 },
2589 .pflip = {
2590 .pre_page_flip = &evergreen_pre_page_flip,
2591 .page_flip = &evergreen_page_flip,
2592 .post_page_flip = &evergreen_post_page_flip,
2593 },
2594};
2595
Alex Deucherabf1dc62012-07-17 14:02:36 -04002596/**
2597 * radeon_asic_init - register asic specific callbacks
2598 *
2599 * @rdev: radeon device pointer
2600 *
2601 * Registers the appropriate asic specific callbacks for each
2602 * chip family. Also sets other asics specific info like the number
2603 * of crtcs and the register aperture accessors (all asics).
2604 * Returns 0 for success.
2605 */
Daniel Vetter0a10c852010-03-11 21:19:14 +00002606int radeon_asic_init(struct radeon_device *rdev)
2607{
2608 radeon_register_accessor_init(rdev);
Alex Deucherba7e05e2011-06-16 18:14:22 +00002609
2610 /* set the number of crtcs */
2611 if (rdev->flags & RADEON_SINGLE_CRTC)
2612 rdev->num_crtc = 1;
2613 else
2614 rdev->num_crtc = 2;
2615
Alex Deucher948bee32013-05-14 12:08:35 -04002616 rdev->has_uvd = false;
2617
Daniel Vetter0a10c852010-03-11 21:19:14 +00002618 switch (rdev->family) {
2619 case CHIP_R100:
2620 case CHIP_RV100:
2621 case CHIP_RS100:
2622 case CHIP_RV200:
2623 case CHIP_RS200:
2624 rdev->asic = &r100_asic;
2625 break;
2626 case CHIP_R200:
2627 case CHIP_RV250:
2628 case CHIP_RS300:
2629 case CHIP_RV280:
2630 rdev->asic = &r200_asic;
2631 break;
2632 case CHIP_R300:
2633 case CHIP_R350:
2634 case CHIP_RV350:
2635 case CHIP_RV380:
2636 if (rdev->flags & RADEON_IS_PCIE)
2637 rdev->asic = &r300_asic_pcie;
2638 else
2639 rdev->asic = &r300_asic;
2640 break;
2641 case CHIP_R420:
2642 case CHIP_R423:
2643 case CHIP_RV410:
2644 rdev->asic = &r420_asic;
Alex Deucher07bb0842010-06-22 21:58:26 -04002645 /* handle macs */
2646 if (rdev->bios == NULL) {
Alex Deucher798bcf72012-02-23 17:53:48 -05002647 rdev->asic->pm.get_engine_clock = &radeon_legacy_get_engine_clock;
2648 rdev->asic->pm.set_engine_clock = &radeon_legacy_set_engine_clock;
2649 rdev->asic->pm.get_memory_clock = &radeon_legacy_get_memory_clock;
2650 rdev->asic->pm.set_memory_clock = NULL;
Alex Deucher37e9b6a2012-08-03 11:39:43 -04002651 rdev->asic->display.set_backlight_level = &radeon_legacy_set_backlight_level;
Alex Deucher07bb0842010-06-22 21:58:26 -04002652 }
Daniel Vetter0a10c852010-03-11 21:19:14 +00002653 break;
2654 case CHIP_RS400:
2655 case CHIP_RS480:
2656 rdev->asic = &rs400_asic;
2657 break;
2658 case CHIP_RS600:
2659 rdev->asic = &rs600_asic;
2660 break;
2661 case CHIP_RS690:
2662 case CHIP_RS740:
2663 rdev->asic = &rs690_asic;
2664 break;
2665 case CHIP_RV515:
2666 rdev->asic = &rv515_asic;
2667 break;
2668 case CHIP_R520:
2669 case CHIP_RV530:
2670 case CHIP_RV560:
2671 case CHIP_RV570:
2672 case CHIP_R580:
2673 rdev->asic = &r520_asic;
2674 break;
2675 case CHIP_R600:
Alex Deucherca361b62013-06-21 14:42:08 -04002676 rdev->asic = &r600_asic;
2677 break;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002678 case CHIP_RV610:
2679 case CHIP_RV630:
2680 case CHIP_RV620:
2681 case CHIP_RV635:
2682 case CHIP_RV670:
Alex Deucherca361b62013-06-21 14:42:08 -04002683 rdev->asic = &rv6xx_asic;
2684 rdev->has_uvd = true;
Alex Deucherf47299c2010-03-16 20:54:38 -04002685 break;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002686 case CHIP_RS780:
2687 case CHIP_RS880:
Alex Deucherf47299c2010-03-16 20:54:38 -04002688 rdev->asic = &rs780_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002689 rdev->has_uvd = true;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002690 break;
2691 case CHIP_RV770:
2692 case CHIP_RV730:
2693 case CHIP_RV710:
2694 case CHIP_RV740:
2695 rdev->asic = &rv770_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002696 rdev->has_uvd = true;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002697 break;
2698 case CHIP_CEDAR:
2699 case CHIP_REDWOOD:
2700 case CHIP_JUNIPER:
2701 case CHIP_CYPRESS:
2702 case CHIP_HEMLOCK:
Alex Deucherba7e05e2011-06-16 18:14:22 +00002703 /* set num crtcs */
2704 if (rdev->family == CHIP_CEDAR)
2705 rdev->num_crtc = 4;
2706 else
2707 rdev->num_crtc = 6;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002708 rdev->asic = &evergreen_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002709 rdev->has_uvd = true;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002710 break;
Alex Deucher958261d2010-11-22 17:56:30 -05002711 case CHIP_PALM:
Alex Deucher89da5a32011-05-31 15:42:47 -04002712 case CHIP_SUMO:
2713 case CHIP_SUMO2:
Alex Deucher958261d2010-11-22 17:56:30 -05002714 rdev->asic = &sumo_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002715 rdev->has_uvd = true;
Alex Deucher958261d2010-11-22 17:56:30 -05002716 break;
Alex Deuchera43b7662011-01-06 21:19:33 -05002717 case CHIP_BARTS:
2718 case CHIP_TURKS:
2719 case CHIP_CAICOS:
Alex Deucherba7e05e2011-06-16 18:14:22 +00002720 /* set num crtcs */
2721 if (rdev->family == CHIP_CAICOS)
2722 rdev->num_crtc = 4;
2723 else
2724 rdev->num_crtc = 6;
Alex Deuchera43b7662011-01-06 21:19:33 -05002725 rdev->asic = &btc_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002726 rdev->has_uvd = true;
Alex Deuchera43b7662011-01-06 21:19:33 -05002727 break;
Alex Deuchere3487622011-03-02 20:07:36 -05002728 case CHIP_CAYMAN:
2729 rdev->asic = &cayman_asic;
Alex Deucherba7e05e2011-06-16 18:14:22 +00002730 /* set num crtcs */
2731 rdev->num_crtc = 6;
Alex Deucher948bee32013-05-14 12:08:35 -04002732 rdev->has_uvd = true;
Alex Deuchere3487622011-03-02 20:07:36 -05002733 break;
Alex Deucherbe63fe82012-03-20 17:18:40 -04002734 case CHIP_ARUBA:
2735 rdev->asic = &trinity_asic;
2736 /* set num crtcs */
2737 rdev->num_crtc = 4;
Alex Deucher948bee32013-05-14 12:08:35 -04002738 rdev->has_uvd = true;
Alex Deucherbe63fe82012-03-20 17:18:40 -04002739 break;
Alex Deucher02779c02012-03-20 17:18:25 -04002740 case CHIP_TAHITI:
2741 case CHIP_PITCAIRN:
2742 case CHIP_VERDE:
Alex Deuchere737a142012-08-30 14:00:03 -04002743 case CHIP_OLAND:
Alex Deucher86a45ca2012-07-26 19:04:20 -04002744 case CHIP_HAINAN:
Alex Deucher02779c02012-03-20 17:18:25 -04002745 rdev->asic = &si_asic;
2746 /* set num crtcs */
Alex Deucher86a45ca2012-07-26 19:04:20 -04002747 if (rdev->family == CHIP_HAINAN)
2748 rdev->num_crtc = 0;
2749 else if (rdev->family == CHIP_OLAND)
Alex Deuchere737a142012-08-30 14:00:03 -04002750 rdev->num_crtc = 2;
2751 else
2752 rdev->num_crtc = 6;
Alex Deucher948bee32013-05-14 12:08:35 -04002753 if (rdev->family == CHIP_HAINAN)
2754 rdev->has_uvd = false;
2755 else
2756 rdev->has_uvd = true;
Alex Deucher02779c02012-03-20 17:18:25 -04002757 break;
Alex Deucher0672e272013-04-09 16:22:31 -04002758 case CHIP_BONAIRE:
2759 rdev->asic = &ci_asic;
2760 rdev->num_crtc = 6;
2761 break;
2762 case CHIP_KAVERI:
2763 case CHIP_KABINI:
2764 rdev->asic = &kv_asic;
2765 /* set num crtcs */
2766 if (rdev->family == CHIP_KAVERI)
2767 rdev->num_crtc = 4;
2768 else
2769 rdev->num_crtc = 2;
2770 break;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002771 default:
2772 /* FIXME: not supported yet */
2773 return -EINVAL;
2774 }
2775
2776 if (rdev->flags & RADEON_IS_IGP) {
Alex Deucher798bcf72012-02-23 17:53:48 -05002777 rdev->asic->pm.get_memory_clock = NULL;
2778 rdev->asic->pm.set_memory_clock = NULL;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002779 }
2780
Daniel Vetter0a10c852010-03-11 21:19:14 +00002781 return 0;
2782}
2783