blob: 7c6e1930fa38662462a013a13772d234c867ce7d [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 */
Christian König76a0df82013-08-13 11:56:50 +0200175
176static struct radeon_asic_ring r100_gfx_ring = {
177 .ib_execute = &r100_ring_ib_execute,
178 .emit_fence = &r100_fence_ring_emit,
179 .emit_semaphore = &r100_semaphore_ring_emit,
180 .cs_parse = &r100_cs_parse,
181 .ring_start = &r100_ring_start,
182 .ring_test = &r100_ring_test,
183 .ib_test = &r100_ib_test,
184 .is_lockup = &r100_gpu_is_lockup,
Alex Deucherea31bf62013-12-09 19:44:30 -0500185 .get_rptr = &r100_gfx_get_rptr,
186 .get_wptr = &r100_gfx_get_wptr,
187 .set_wptr = &r100_gfx_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +0200188};
189
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000190static struct radeon_asic r100_asic = {
191 .init = &r100_init,
192 .fini = &r100_fini,
193 .suspend = &r100_suspend,
194 .resume = &r100_resume,
195 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000196 .asic_reset = &r100_asic_reset,
Michel Dänzer124764f2014-07-31 18:43:48 +0900197 .mmio_hdp_flush = NULL,
Alex Deucher54e88e02012-02-23 18:10:29 -0500198 .gui_idle = &r100_gui_idle,
199 .mc_wait_for_idle = &r100_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500200 .gart = {
201 .tlb_flush = &r100_pci_gart_tlb_flush,
202 .set_page = &r100_pci_gart_set_page,
203 },
Christian König4c87bc22011-10-19 19:02:21 +0200204 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200205 [RADEON_RING_TYPE_GFX_INDEX] = &r100_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200206 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500207 .irq = {
208 .set = &r100_irq_set,
209 .process = &r100_irq_process,
210 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500211 .display = {
212 .bandwidth_update = &r100_bandwidth_update,
213 .get_vblank_counter = &r100_get_vblank_counter,
214 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400215 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400216 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500217 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500218 .copy = {
219 .blit = &r100_copy_blit,
220 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
221 .dma = NULL,
222 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
223 .copy = &r100_copy_blit,
224 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
225 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500226 .surface = {
227 .set_reg = r100_set_surface_reg,
228 .clear_reg = r100_clear_surface_reg,
229 },
Alex Deucher901ea572012-02-23 17:53:39 -0500230 .hpd = {
231 .init = &r100_hpd_init,
232 .fini = &r100_hpd_fini,
233 .sense = &r100_hpd_sense,
234 .set_polarity = &r100_hpd_set_polarity,
235 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500236 .pm = {
237 .misc = &r100_pm_misc,
238 .prepare = &r100_pm_prepare,
239 .finish = &r100_pm_finish,
240 .init_profile = &r100_pm_init_profile,
241 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500242 .get_engine_clock = &radeon_legacy_get_engine_clock,
243 .set_engine_clock = &radeon_legacy_set_engine_clock,
244 .get_memory_clock = &radeon_legacy_get_memory_clock,
245 .set_memory_clock = NULL,
246 .get_pcie_lanes = NULL,
247 .set_pcie_lanes = NULL,
248 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500249 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500250 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500251 .page_flip = &r100_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200252 .page_flip_pending = &r100_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500253 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000254};
255
256static struct radeon_asic r200_asic = {
257 .init = &r100_init,
258 .fini = &r100_fini,
259 .suspend = &r100_suspend,
260 .resume = &r100_resume,
261 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000262 .asic_reset = &r100_asic_reset,
Michel Dänzer124764f2014-07-31 18:43:48 +0900263 .mmio_hdp_flush = NULL,
Alex Deucher54e88e02012-02-23 18:10:29 -0500264 .gui_idle = &r100_gui_idle,
265 .mc_wait_for_idle = &r100_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500266 .gart = {
267 .tlb_flush = &r100_pci_gart_tlb_flush,
268 .set_page = &r100_pci_gart_set_page,
269 },
Christian König4c87bc22011-10-19 19:02:21 +0200270 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200271 [RADEON_RING_TYPE_GFX_INDEX] = &r100_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200272 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500273 .irq = {
274 .set = &r100_irq_set,
275 .process = &r100_irq_process,
276 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500277 .display = {
278 .bandwidth_update = &r100_bandwidth_update,
279 .get_vblank_counter = &r100_get_vblank_counter,
280 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400281 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400282 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500283 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500284 .copy = {
285 .blit = &r100_copy_blit,
286 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
287 .dma = &r200_copy_dma,
288 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
289 .copy = &r100_copy_blit,
290 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
291 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500292 .surface = {
293 .set_reg = r100_set_surface_reg,
294 .clear_reg = r100_clear_surface_reg,
295 },
Alex Deucher901ea572012-02-23 17:53:39 -0500296 .hpd = {
297 .init = &r100_hpd_init,
298 .fini = &r100_hpd_fini,
299 .sense = &r100_hpd_sense,
300 .set_polarity = &r100_hpd_set_polarity,
301 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500302 .pm = {
303 .misc = &r100_pm_misc,
304 .prepare = &r100_pm_prepare,
305 .finish = &r100_pm_finish,
306 .init_profile = &r100_pm_init_profile,
307 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500308 .get_engine_clock = &radeon_legacy_get_engine_clock,
309 .set_engine_clock = &radeon_legacy_set_engine_clock,
310 .get_memory_clock = &radeon_legacy_get_memory_clock,
311 .set_memory_clock = NULL,
312 .get_pcie_lanes = NULL,
313 .set_pcie_lanes = NULL,
314 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500315 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500316 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500317 .page_flip = &r100_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200318 .page_flip_pending = &r100_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500319 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000320};
321
Christian König76a0df82013-08-13 11:56:50 +0200322static struct radeon_asic_ring r300_gfx_ring = {
323 .ib_execute = &r100_ring_ib_execute,
324 .emit_fence = &r300_fence_ring_emit,
325 .emit_semaphore = &r100_semaphore_ring_emit,
326 .cs_parse = &r300_cs_parse,
327 .ring_start = &r300_ring_start,
328 .ring_test = &r100_ring_test,
329 .ib_test = &r100_ib_test,
330 .is_lockup = &r100_gpu_is_lockup,
Alex Deucherea31bf62013-12-09 19:44:30 -0500331 .get_rptr = &r100_gfx_get_rptr,
332 .get_wptr = &r100_gfx_get_wptr,
333 .set_wptr = &r100_gfx_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +0200334};
335
Alex Deucherd8a74e12015-01-15 10:52:33 -0500336static struct radeon_asic_ring rv515_gfx_ring = {
337 .ib_execute = &r100_ring_ib_execute,
338 .emit_fence = &r300_fence_ring_emit,
339 .emit_semaphore = &r100_semaphore_ring_emit,
340 .cs_parse = &r300_cs_parse,
341 .ring_start = &rv515_ring_start,
342 .ring_test = &r100_ring_test,
343 .ib_test = &r100_ib_test,
344 .is_lockup = &r100_gpu_is_lockup,
345 .get_rptr = &r100_gfx_get_rptr,
346 .get_wptr = &r100_gfx_get_wptr,
347 .set_wptr = &r100_gfx_set_wptr,
348};
349
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000350static struct radeon_asic r300_asic = {
351 .init = &r300_init,
352 .fini = &r300_fini,
353 .suspend = &r300_suspend,
354 .resume = &r300_resume,
355 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000356 .asic_reset = &r300_asic_reset,
Michel Dänzer124764f2014-07-31 18:43:48 +0900357 .mmio_hdp_flush = NULL,
Alex Deucher54e88e02012-02-23 18:10:29 -0500358 .gui_idle = &r100_gui_idle,
359 .mc_wait_for_idle = &r300_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500360 .gart = {
361 .tlb_flush = &r100_pci_gart_tlb_flush,
362 .set_page = &r100_pci_gart_set_page,
363 },
Christian König4c87bc22011-10-19 19:02:21 +0200364 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200365 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200366 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500367 .irq = {
368 .set = &r100_irq_set,
369 .process = &r100_irq_process,
370 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500371 .display = {
372 .bandwidth_update = &r100_bandwidth_update,
373 .get_vblank_counter = &r100_get_vblank_counter,
374 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400375 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400376 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500377 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500378 .copy = {
379 .blit = &r100_copy_blit,
380 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
381 .dma = &r200_copy_dma,
382 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
383 .copy = &r100_copy_blit,
384 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
385 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500386 .surface = {
387 .set_reg = r100_set_surface_reg,
388 .clear_reg = r100_clear_surface_reg,
389 },
Alex Deucher901ea572012-02-23 17:53:39 -0500390 .hpd = {
391 .init = &r100_hpd_init,
392 .fini = &r100_hpd_fini,
393 .sense = &r100_hpd_sense,
394 .set_polarity = &r100_hpd_set_polarity,
395 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500396 .pm = {
397 .misc = &r100_pm_misc,
398 .prepare = &r100_pm_prepare,
399 .finish = &r100_pm_finish,
400 .init_profile = &r100_pm_init_profile,
401 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500402 .get_engine_clock = &radeon_legacy_get_engine_clock,
403 .set_engine_clock = &radeon_legacy_set_engine_clock,
404 .get_memory_clock = &radeon_legacy_get_memory_clock,
405 .set_memory_clock = NULL,
406 .get_pcie_lanes = &rv370_get_pcie_lanes,
407 .set_pcie_lanes = &rv370_set_pcie_lanes,
408 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500409 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500410 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500411 .page_flip = &r100_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200412 .page_flip_pending = &r100_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500413 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000414};
415
416static struct radeon_asic r300_asic_pcie = {
417 .init = &r300_init,
418 .fini = &r300_fini,
419 .suspend = &r300_suspend,
420 .resume = &r300_resume,
421 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000422 .asic_reset = &r300_asic_reset,
Michel Dänzer124764f2014-07-31 18:43:48 +0900423 .mmio_hdp_flush = NULL,
Alex Deucher54e88e02012-02-23 18:10:29 -0500424 .gui_idle = &r100_gui_idle,
425 .mc_wait_for_idle = &r300_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500426 .gart = {
427 .tlb_flush = &rv370_pcie_gart_tlb_flush,
428 .set_page = &rv370_pcie_gart_set_page,
429 },
Christian König4c87bc22011-10-19 19:02:21 +0200430 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200431 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200432 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500433 .irq = {
434 .set = &r100_irq_set,
435 .process = &r100_irq_process,
436 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500437 .display = {
438 .bandwidth_update = &r100_bandwidth_update,
439 .get_vblank_counter = &r100_get_vblank_counter,
440 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400441 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400442 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500443 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500444 .copy = {
445 .blit = &r100_copy_blit,
446 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
447 .dma = &r200_copy_dma,
448 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
449 .copy = &r100_copy_blit,
450 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
451 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500452 .surface = {
453 .set_reg = r100_set_surface_reg,
454 .clear_reg = r100_clear_surface_reg,
455 },
Alex Deucher901ea572012-02-23 17:53:39 -0500456 .hpd = {
457 .init = &r100_hpd_init,
458 .fini = &r100_hpd_fini,
459 .sense = &r100_hpd_sense,
460 .set_polarity = &r100_hpd_set_polarity,
461 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500462 .pm = {
463 .misc = &r100_pm_misc,
464 .prepare = &r100_pm_prepare,
465 .finish = &r100_pm_finish,
466 .init_profile = &r100_pm_init_profile,
467 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500468 .get_engine_clock = &radeon_legacy_get_engine_clock,
469 .set_engine_clock = &radeon_legacy_set_engine_clock,
470 .get_memory_clock = &radeon_legacy_get_memory_clock,
471 .set_memory_clock = NULL,
472 .get_pcie_lanes = &rv370_get_pcie_lanes,
473 .set_pcie_lanes = &rv370_set_pcie_lanes,
474 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500475 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500476 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500477 .page_flip = &r100_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200478 .page_flip_pending = &r100_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500479 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000480};
481
482static struct radeon_asic r420_asic = {
483 .init = &r420_init,
484 .fini = &r420_fini,
485 .suspend = &r420_suspend,
486 .resume = &r420_resume,
487 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000488 .asic_reset = &r300_asic_reset,
Michel Dänzer124764f2014-07-31 18:43:48 +0900489 .mmio_hdp_flush = NULL,
Alex Deucher54e88e02012-02-23 18:10:29 -0500490 .gui_idle = &r100_gui_idle,
491 .mc_wait_for_idle = &r300_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500492 .gart = {
493 .tlb_flush = &rv370_pcie_gart_tlb_flush,
494 .set_page = &rv370_pcie_gart_set_page,
495 },
Christian König4c87bc22011-10-19 19:02:21 +0200496 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200497 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200498 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500499 .irq = {
500 .set = &r100_irq_set,
501 .process = &r100_irq_process,
502 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500503 .display = {
504 .bandwidth_update = &r100_bandwidth_update,
505 .get_vblank_counter = &r100_get_vblank_counter,
506 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400507 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400508 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500509 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500510 .copy = {
511 .blit = &r100_copy_blit,
512 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
513 .dma = &r200_copy_dma,
514 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
515 .copy = &r100_copy_blit,
516 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
517 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500518 .surface = {
519 .set_reg = r100_set_surface_reg,
520 .clear_reg = r100_clear_surface_reg,
521 },
Alex Deucher901ea572012-02-23 17:53:39 -0500522 .hpd = {
523 .init = &r100_hpd_init,
524 .fini = &r100_hpd_fini,
525 .sense = &r100_hpd_sense,
526 .set_polarity = &r100_hpd_set_polarity,
527 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500528 .pm = {
529 .misc = &r100_pm_misc,
530 .prepare = &r100_pm_prepare,
531 .finish = &r100_pm_finish,
532 .init_profile = &r420_pm_init_profile,
533 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500534 .get_engine_clock = &radeon_atom_get_engine_clock,
535 .set_engine_clock = &radeon_atom_set_engine_clock,
536 .get_memory_clock = &radeon_atom_get_memory_clock,
537 .set_memory_clock = &radeon_atom_set_memory_clock,
538 .get_pcie_lanes = &rv370_get_pcie_lanes,
539 .set_pcie_lanes = &rv370_set_pcie_lanes,
540 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500541 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500542 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500543 .page_flip = &r100_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200544 .page_flip_pending = &r100_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500545 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000546};
547
548static struct radeon_asic rs400_asic = {
549 .init = &rs400_init,
550 .fini = &rs400_fini,
551 .suspend = &rs400_suspend,
552 .resume = &rs400_resume,
553 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000554 .asic_reset = &r300_asic_reset,
Michel Dänzer124764f2014-07-31 18:43:48 +0900555 .mmio_hdp_flush = NULL,
Alex Deucher54e88e02012-02-23 18:10:29 -0500556 .gui_idle = &r100_gui_idle,
557 .mc_wait_for_idle = &rs400_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500558 .gart = {
559 .tlb_flush = &rs400_gart_tlb_flush,
560 .set_page = &rs400_gart_set_page,
561 },
Christian König4c87bc22011-10-19 19:02:21 +0200562 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200563 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200564 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500565 .irq = {
566 .set = &r100_irq_set,
567 .process = &r100_irq_process,
568 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500569 .display = {
570 .bandwidth_update = &r100_bandwidth_update,
571 .get_vblank_counter = &r100_get_vblank_counter,
572 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400573 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400574 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500575 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500576 .copy = {
577 .blit = &r100_copy_blit,
578 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
579 .dma = &r200_copy_dma,
580 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
581 .copy = &r100_copy_blit,
582 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
583 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500584 .surface = {
585 .set_reg = r100_set_surface_reg,
586 .clear_reg = r100_clear_surface_reg,
587 },
Alex Deucher901ea572012-02-23 17:53:39 -0500588 .hpd = {
589 .init = &r100_hpd_init,
590 .fini = &r100_hpd_fini,
591 .sense = &r100_hpd_sense,
592 .set_polarity = &r100_hpd_set_polarity,
593 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500594 .pm = {
595 .misc = &r100_pm_misc,
596 .prepare = &r100_pm_prepare,
597 .finish = &r100_pm_finish,
598 .init_profile = &r100_pm_init_profile,
599 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500600 .get_engine_clock = &radeon_legacy_get_engine_clock,
601 .set_engine_clock = &radeon_legacy_set_engine_clock,
602 .get_memory_clock = &radeon_legacy_get_memory_clock,
603 .set_memory_clock = NULL,
604 .get_pcie_lanes = NULL,
605 .set_pcie_lanes = NULL,
606 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500607 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500608 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500609 .page_flip = &r100_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200610 .page_flip_pending = &r100_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500611 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000612};
613
614static struct radeon_asic rs600_asic = {
615 .init = &rs600_init,
616 .fini = &rs600_fini,
617 .suspend = &rs600_suspend,
618 .resume = &rs600_resume,
619 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000620 .asic_reset = &rs600_asic_reset,
Michel Dänzer124764f2014-07-31 18:43:48 +0900621 .mmio_hdp_flush = NULL,
Alex Deucher54e88e02012-02-23 18:10:29 -0500622 .gui_idle = &r100_gui_idle,
623 .mc_wait_for_idle = &rs600_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500624 .gart = {
625 .tlb_flush = &rs600_gart_tlb_flush,
626 .set_page = &rs600_gart_set_page,
627 },
Christian König4c87bc22011-10-19 19:02:21 +0200628 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200629 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200630 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500631 .irq = {
632 .set = &rs600_irq_set,
633 .process = &rs600_irq_process,
634 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500635 .display = {
636 .bandwidth_update = &rs600_bandwidth_update,
637 .get_vblank_counter = &rs600_get_vblank_counter,
638 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400639 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400640 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -0400641 .hdmi_enable = &r600_hdmi_enable,
642 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500643 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500644 .copy = {
645 .blit = &r100_copy_blit,
646 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
647 .dma = &r200_copy_dma,
648 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
649 .copy = &r100_copy_blit,
650 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
651 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500652 .surface = {
653 .set_reg = r100_set_surface_reg,
654 .clear_reg = r100_clear_surface_reg,
655 },
Alex Deucher901ea572012-02-23 17:53:39 -0500656 .hpd = {
657 .init = &rs600_hpd_init,
658 .fini = &rs600_hpd_fini,
659 .sense = &rs600_hpd_sense,
660 .set_polarity = &rs600_hpd_set_polarity,
661 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500662 .pm = {
663 .misc = &rs600_pm_misc,
664 .prepare = &rs600_pm_prepare,
665 .finish = &rs600_pm_finish,
666 .init_profile = &r420_pm_init_profile,
667 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500668 .get_engine_clock = &radeon_atom_get_engine_clock,
669 .set_engine_clock = &radeon_atom_set_engine_clock,
670 .get_memory_clock = &radeon_atom_get_memory_clock,
671 .set_memory_clock = &radeon_atom_set_memory_clock,
672 .get_pcie_lanes = NULL,
673 .set_pcie_lanes = NULL,
674 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500675 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500676 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500677 .page_flip = &rs600_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200678 .page_flip_pending = &rs600_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500679 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000680};
681
682static struct radeon_asic rs690_asic = {
683 .init = &rs690_init,
684 .fini = &rs690_fini,
685 .suspend = &rs690_suspend,
686 .resume = &rs690_resume,
687 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000688 .asic_reset = &rs600_asic_reset,
Michel Dänzer124764f2014-07-31 18:43:48 +0900689 .mmio_hdp_flush = NULL,
Alex Deucher54e88e02012-02-23 18:10:29 -0500690 .gui_idle = &r100_gui_idle,
691 .mc_wait_for_idle = &rs690_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500692 .gart = {
693 .tlb_flush = &rs400_gart_tlb_flush,
694 .set_page = &rs400_gart_set_page,
695 },
Christian König4c87bc22011-10-19 19:02:21 +0200696 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200697 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200698 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500699 .irq = {
700 .set = &rs600_irq_set,
701 .process = &rs600_irq_process,
702 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500703 .display = {
704 .get_vblank_counter = &rs600_get_vblank_counter,
705 .bandwidth_update = &rs690_bandwidth_update,
706 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400707 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400708 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -0400709 .hdmi_enable = &r600_hdmi_enable,
710 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500711 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500712 .copy = {
713 .blit = &r100_copy_blit,
714 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
715 .dma = &r200_copy_dma,
716 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
717 .copy = &r200_copy_dma,
718 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
719 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500720 .surface = {
721 .set_reg = r100_set_surface_reg,
722 .clear_reg = r100_clear_surface_reg,
723 },
Alex Deucher901ea572012-02-23 17:53:39 -0500724 .hpd = {
725 .init = &rs600_hpd_init,
726 .fini = &rs600_hpd_fini,
727 .sense = &rs600_hpd_sense,
728 .set_polarity = &rs600_hpd_set_polarity,
729 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500730 .pm = {
731 .misc = &rs600_pm_misc,
732 .prepare = &rs600_pm_prepare,
733 .finish = &rs600_pm_finish,
734 .init_profile = &r420_pm_init_profile,
735 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500736 .get_engine_clock = &radeon_atom_get_engine_clock,
737 .set_engine_clock = &radeon_atom_set_engine_clock,
738 .get_memory_clock = &radeon_atom_get_memory_clock,
739 .set_memory_clock = &radeon_atom_set_memory_clock,
740 .get_pcie_lanes = NULL,
741 .set_pcie_lanes = NULL,
742 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500743 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500744 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500745 .page_flip = &rs600_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200746 .page_flip_pending = &rs600_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500747 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000748};
749
750static struct radeon_asic rv515_asic = {
751 .init = &rv515_init,
752 .fini = &rv515_fini,
753 .suspend = &rv515_suspend,
754 .resume = &rv515_resume,
755 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000756 .asic_reset = &rs600_asic_reset,
Michel Dänzer124764f2014-07-31 18:43:48 +0900757 .mmio_hdp_flush = NULL,
Alex Deucher54e88e02012-02-23 18:10:29 -0500758 .gui_idle = &r100_gui_idle,
759 .mc_wait_for_idle = &rv515_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500760 .gart = {
761 .tlb_flush = &rv370_pcie_gart_tlb_flush,
762 .set_page = &rv370_pcie_gart_set_page,
763 },
Christian König4c87bc22011-10-19 19:02:21 +0200764 .ring = {
Alex Deucherd8a74e12015-01-15 10:52:33 -0500765 [RADEON_RING_TYPE_GFX_INDEX] = &rv515_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200766 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500767 .irq = {
768 .set = &rs600_irq_set,
769 .process = &rs600_irq_process,
770 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500771 .display = {
772 .get_vblank_counter = &rs600_get_vblank_counter,
773 .bandwidth_update = &rv515_bandwidth_update,
774 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400775 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400776 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500777 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500778 .copy = {
779 .blit = &r100_copy_blit,
780 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
781 .dma = &r200_copy_dma,
782 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
783 .copy = &r100_copy_blit,
784 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
785 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500786 .surface = {
787 .set_reg = r100_set_surface_reg,
788 .clear_reg = r100_clear_surface_reg,
789 },
Alex Deucher901ea572012-02-23 17:53:39 -0500790 .hpd = {
791 .init = &rs600_hpd_init,
792 .fini = &rs600_hpd_fini,
793 .sense = &rs600_hpd_sense,
794 .set_polarity = &rs600_hpd_set_polarity,
795 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500796 .pm = {
797 .misc = &rs600_pm_misc,
798 .prepare = &rs600_pm_prepare,
799 .finish = &rs600_pm_finish,
800 .init_profile = &r420_pm_init_profile,
801 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500802 .get_engine_clock = &radeon_atom_get_engine_clock,
803 .set_engine_clock = &radeon_atom_set_engine_clock,
804 .get_memory_clock = &radeon_atom_get_memory_clock,
805 .set_memory_clock = &radeon_atom_set_memory_clock,
806 .get_pcie_lanes = &rv370_get_pcie_lanes,
807 .set_pcie_lanes = &rv370_set_pcie_lanes,
808 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500809 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500810 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500811 .page_flip = &rs600_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200812 .page_flip_pending = &rs600_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500813 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000814};
815
816static struct radeon_asic r520_asic = {
817 .init = &r520_init,
818 .fini = &rv515_fini,
819 .suspend = &rv515_suspend,
820 .resume = &r520_resume,
821 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000822 .asic_reset = &rs600_asic_reset,
Michel Dänzer124764f2014-07-31 18:43:48 +0900823 .mmio_hdp_flush = NULL,
Alex Deucher54e88e02012-02-23 18:10:29 -0500824 .gui_idle = &r100_gui_idle,
825 .mc_wait_for_idle = &r520_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500826 .gart = {
827 .tlb_flush = &rv370_pcie_gart_tlb_flush,
828 .set_page = &rv370_pcie_gart_set_page,
829 },
Christian König4c87bc22011-10-19 19:02:21 +0200830 .ring = {
Alex Deucherd8a74e12015-01-15 10:52:33 -0500831 [RADEON_RING_TYPE_GFX_INDEX] = &rv515_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200832 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500833 .irq = {
834 .set = &rs600_irq_set,
835 .process = &rs600_irq_process,
836 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500837 .display = {
838 .bandwidth_update = &rv515_bandwidth_update,
839 .get_vblank_counter = &rs600_get_vblank_counter,
840 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400841 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400842 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500843 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500844 .copy = {
845 .blit = &r100_copy_blit,
846 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
847 .dma = &r200_copy_dma,
848 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
849 .copy = &r100_copy_blit,
850 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
851 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500852 .surface = {
853 .set_reg = r100_set_surface_reg,
854 .clear_reg = r100_clear_surface_reg,
855 },
Alex Deucher901ea572012-02-23 17:53:39 -0500856 .hpd = {
857 .init = &rs600_hpd_init,
858 .fini = &rs600_hpd_fini,
859 .sense = &rs600_hpd_sense,
860 .set_polarity = &rs600_hpd_set_polarity,
861 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500862 .pm = {
863 .misc = &rs600_pm_misc,
864 .prepare = &rs600_pm_prepare,
865 .finish = &rs600_pm_finish,
866 .init_profile = &r420_pm_init_profile,
867 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500868 .get_engine_clock = &radeon_atom_get_engine_clock,
869 .set_engine_clock = &radeon_atom_set_engine_clock,
870 .get_memory_clock = &radeon_atom_get_memory_clock,
871 .set_memory_clock = &radeon_atom_set_memory_clock,
872 .get_pcie_lanes = &rv370_get_pcie_lanes,
873 .set_pcie_lanes = &rv370_set_pcie_lanes,
874 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500875 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500876 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500877 .page_flip = &rs600_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200878 .page_flip_pending = &rs600_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500879 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000880};
881
Christian König76a0df82013-08-13 11:56:50 +0200882static struct radeon_asic_ring r600_gfx_ring = {
883 .ib_execute = &r600_ring_ib_execute,
884 .emit_fence = &r600_fence_ring_emit,
885 .emit_semaphore = &r600_semaphore_ring_emit,
886 .cs_parse = &r600_cs_parse,
887 .ring_test = &r600_ring_test,
888 .ib_test = &r600_ib_test,
889 .is_lockup = &r600_gfx_is_lockup,
Alex Deucherea31bf62013-12-09 19:44:30 -0500890 .get_rptr = &r600_gfx_get_rptr,
891 .get_wptr = &r600_gfx_get_wptr,
892 .set_wptr = &r600_gfx_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +0200893};
894
895static struct radeon_asic_ring r600_dma_ring = {
896 .ib_execute = &r600_dma_ring_ib_execute,
897 .emit_fence = &r600_dma_fence_ring_emit,
898 .emit_semaphore = &r600_dma_semaphore_ring_emit,
899 .cs_parse = &r600_dma_cs_parse,
900 .ring_test = &r600_dma_ring_test,
901 .ib_test = &r600_dma_ib_test,
902 .is_lockup = &r600_dma_is_lockup,
Christian König2e1e6da2013-08-13 11:56:52 +0200903 .get_rptr = &r600_dma_get_rptr,
904 .get_wptr = &r600_dma_get_wptr,
905 .set_wptr = &r600_dma_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +0200906};
907
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000908static struct radeon_asic r600_asic = {
909 .init = &r600_init,
910 .fini = &r600_fini,
911 .suspend = &r600_suspend,
912 .resume = &r600_resume,
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000913 .vga_set_state = &r600_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000914 .asic_reset = &r600_asic_reset,
Michel Dänzer124764f2014-07-31 18:43:48 +0900915 .mmio_hdp_flush = r600_mmio_hdp_flush,
Alex Deucher54e88e02012-02-23 18:10:29 -0500916 .gui_idle = &r600_gui_idle,
917 .mc_wait_for_idle = &r600_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -0500918 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -0500919 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500920 .gart = {
921 .tlb_flush = &r600_pcie_gart_tlb_flush,
922 .set_page = &rs600_gart_set_page,
923 },
Christian König4c87bc22011-10-19 19:02:21 +0200924 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200925 [RADEON_RING_TYPE_GFX_INDEX] = &r600_gfx_ring,
926 [R600_RING_TYPE_DMA_INDEX] = &r600_dma_ring,
Christian König4c87bc22011-10-19 19:02:21 +0200927 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500928 .irq = {
929 .set = &r600_irq_set,
930 .process = &r600_irq_process,
931 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500932 .display = {
933 .bandwidth_update = &rv515_bandwidth_update,
934 .get_vblank_counter = &rs600_get_vblank_counter,
935 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400936 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400937 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -0400938 .hdmi_enable = &r600_hdmi_enable,
939 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500940 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500941 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -0400942 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -0500943 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher4d756582012-09-27 15:08:35 -0400944 .dma = &r600_copy_dma,
945 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucherbfea6a62013-07-11 14:53:34 -0400946 .copy = &r600_copy_cpdma,
Alex Deucheraeea40c2013-07-11 14:20:11 -0400947 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -0500948 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500949 .surface = {
950 .set_reg = r600_set_surface_reg,
951 .clear_reg = r600_clear_surface_reg,
952 },
Alex Deucher901ea572012-02-23 17:53:39 -0500953 .hpd = {
954 .init = &r600_hpd_init,
955 .fini = &r600_hpd_fini,
956 .sense = &r600_hpd_sense,
957 .set_polarity = &r600_hpd_set_polarity,
958 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500959 .pm = {
960 .misc = &r600_pm_misc,
961 .prepare = &rs600_pm_prepare,
962 .finish = &rs600_pm_finish,
963 .init_profile = &r600_pm_init_profile,
964 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500965 .get_engine_clock = &radeon_atom_get_engine_clock,
966 .set_engine_clock = &radeon_atom_set_engine_clock,
967 .get_memory_clock = &radeon_atom_get_memory_clock,
968 .set_memory_clock = &radeon_atom_set_memory_clock,
969 .get_pcie_lanes = &r600_get_pcie_lanes,
970 .set_pcie_lanes = &r600_set_pcie_lanes,
971 .set_clock_gating = NULL,
Alex Deucher6bd1c382013-06-21 14:38:03 -0400972 .get_temperature = &rv6xx_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -0500973 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500974 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500975 .page_flip = &rs600_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200976 .page_flip_pending = &rs600_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500977 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000978};
979
Christian König856754c2013-04-16 22:11:22 +0200980static struct radeon_asic_ring rv6xx_uvd_ring = {
981 .ib_execute = &uvd_v1_0_ib_execute,
982 .emit_fence = &uvd_v1_0_fence_emit,
983 .emit_semaphore = &uvd_v1_0_semaphore_emit,
984 .cs_parse = &radeon_uvd_cs_parse,
985 .ring_test = &uvd_v1_0_ring_test,
986 .ib_test = &uvd_v1_0_ib_test,
987 .is_lockup = &radeon_ring_test_lockup,
988 .get_rptr = &uvd_v1_0_get_rptr,
989 .get_wptr = &uvd_v1_0_get_wptr,
990 .set_wptr = &uvd_v1_0_set_wptr,
991};
992
Alex Deucherca361b62013-06-21 14:42:08 -0400993static struct radeon_asic rv6xx_asic = {
994 .init = &r600_init,
995 .fini = &r600_fini,
996 .suspend = &r600_suspend,
997 .resume = &r600_resume,
998 .vga_set_state = &r600_vga_set_state,
999 .asic_reset = &r600_asic_reset,
Michel Dänzer124764f2014-07-31 18:43:48 +09001000 .mmio_hdp_flush = r600_mmio_hdp_flush,
Alex Deucherca361b62013-06-21 14:42:08 -04001001 .gui_idle = &r600_gui_idle,
1002 .mc_wait_for_idle = &r600_mc_wait_for_idle,
1003 .get_xclk = &r600_get_xclk,
1004 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
1005 .gart = {
1006 .tlb_flush = &r600_pcie_gart_tlb_flush,
1007 .set_page = &rs600_gart_set_page,
1008 },
1009 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001010 [RADEON_RING_TYPE_GFX_INDEX] = &r600_gfx_ring,
1011 [R600_RING_TYPE_DMA_INDEX] = &r600_dma_ring,
Christian König856754c2013-04-16 22:11:22 +02001012 [R600_RING_TYPE_UVD_INDEX] = &rv6xx_uvd_ring,
Alex Deucherca361b62013-06-21 14:42:08 -04001013 },
1014 .irq = {
1015 .set = &r600_irq_set,
1016 .process = &r600_irq_process,
1017 },
1018 .display = {
1019 .bandwidth_update = &rv515_bandwidth_update,
1020 .get_vblank_counter = &rs600_get_vblank_counter,
1021 .wait_for_vblank = &avivo_wait_for_vblank,
1022 .set_backlight_level = &atombios_set_backlight_level,
1023 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucher99d79aa2013-09-23 15:47:08 -04001024 .hdmi_enable = &r600_hdmi_enable,
1025 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherca361b62013-06-21 14:42:08 -04001026 },
1027 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001028 .blit = &r600_copy_cpdma,
Alex Deucherca361b62013-06-21 14:42:08 -04001029 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
1030 .dma = &r600_copy_dma,
1031 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucherbfea6a62013-07-11 14:53:34 -04001032 .copy = &r600_copy_cpdma,
Alex Deucheraeea40c2013-07-11 14:20:11 -04001033 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucherca361b62013-06-21 14:42:08 -04001034 },
1035 .surface = {
1036 .set_reg = r600_set_surface_reg,
1037 .clear_reg = r600_clear_surface_reg,
1038 },
1039 .hpd = {
1040 .init = &r600_hpd_init,
1041 .fini = &r600_hpd_fini,
1042 .sense = &r600_hpd_sense,
1043 .set_polarity = &r600_hpd_set_polarity,
1044 },
1045 .pm = {
1046 .misc = &r600_pm_misc,
1047 .prepare = &rs600_pm_prepare,
1048 .finish = &rs600_pm_finish,
1049 .init_profile = &r600_pm_init_profile,
1050 .get_dynpm_state = &r600_pm_get_dynpm_state,
1051 .get_engine_clock = &radeon_atom_get_engine_clock,
1052 .set_engine_clock = &radeon_atom_set_engine_clock,
1053 .get_memory_clock = &radeon_atom_get_memory_clock,
1054 .set_memory_clock = &radeon_atom_set_memory_clock,
1055 .get_pcie_lanes = &r600_get_pcie_lanes,
1056 .set_pcie_lanes = &r600_set_pcie_lanes,
1057 .set_clock_gating = NULL,
1058 .get_temperature = &rv6xx_get_temp,
Alex Deucher1b9ba702013-09-05 09:52:37 -04001059 .set_uvd_clocks = &r600_set_uvd_clocks,
Alex Deucherca361b62013-06-21 14:42:08 -04001060 },
Alex Deucher4a6369e2013-04-12 14:04:10 -04001061 .dpm = {
1062 .init = &rv6xx_dpm_init,
1063 .setup_asic = &rv6xx_setup_asic,
1064 .enable = &rv6xx_dpm_enable,
Alex Deuchera4643ba2013-12-19 12:18:13 -05001065 .late_enable = &r600_dpm_late_enable,
Alex Deucher4a6369e2013-04-12 14:04:10 -04001066 .disable = &rv6xx_dpm_disable,
Alex Deucher98243912013-01-16 13:13:42 -05001067 .pre_set_power_state = &r600_dpm_pre_set_power_state,
Alex Deucher4a6369e2013-04-12 14:04:10 -04001068 .set_power_state = &rv6xx_dpm_set_power_state,
Alex Deucher98243912013-01-16 13:13:42 -05001069 .post_set_power_state = &r600_dpm_post_set_power_state,
Alex Deucher4a6369e2013-04-12 14:04:10 -04001070 .display_configuration_changed = &rv6xx_dpm_display_configuration_changed,
1071 .fini = &rv6xx_dpm_fini,
1072 .get_sclk = &rv6xx_dpm_get_sclk,
1073 .get_mclk = &rv6xx_dpm_get_mclk,
1074 .print_power_state = &rv6xx_dpm_print_power_state,
Alex Deucher242916a2013-06-28 14:20:53 -04001075 .debugfs_print_current_performance_level = &rv6xx_dpm_debugfs_print_current_performance_level,
Alex Deucherf4f85a82013-07-25 20:07:25 -04001076 .force_performance_level = &rv6xx_dpm_force_performance_level,
Alex Deucher4a6369e2013-04-12 14:04:10 -04001077 },
Alex Deucherca361b62013-06-21 14:42:08 -04001078 .pflip = {
Alex Deucherca361b62013-06-21 14:42:08 -04001079 .page_flip = &rs600_page_flip,
Christian König157fa142014-05-27 16:49:20 +02001080 .page_flip_pending = &rs600_page_flip_pending,
Alex Deucherca361b62013-06-21 14:42:08 -04001081 },
1082};
1083
Alex Deucherf47299c2010-03-16 20:54:38 -04001084static struct radeon_asic rs780_asic = {
1085 .init = &r600_init,
1086 .fini = &r600_fini,
1087 .suspend = &r600_suspend,
1088 .resume = &r600_resume,
Alex Deucherf47299c2010-03-16 20:54:38 -04001089 .vga_set_state = &r600_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +00001090 .asic_reset = &r600_asic_reset,
Michel Dänzer124764f2014-07-31 18:43:48 +09001091 .mmio_hdp_flush = r600_mmio_hdp_flush,
Alex Deucher54e88e02012-02-23 18:10:29 -05001092 .gui_idle = &r600_gui_idle,
1093 .mc_wait_for_idle = &r600_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001094 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001095 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001096 .gart = {
1097 .tlb_flush = &r600_pcie_gart_tlb_flush,
1098 .set_page = &rs600_gart_set_page,
1099 },
Christian König4c87bc22011-10-19 19:02:21 +02001100 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001101 [RADEON_RING_TYPE_GFX_INDEX] = &r600_gfx_ring,
1102 [R600_RING_TYPE_DMA_INDEX] = &r600_dma_ring,
Christian König856754c2013-04-16 22:11:22 +02001103 [R600_RING_TYPE_UVD_INDEX] = &rv6xx_uvd_ring,
Christian König4c87bc22011-10-19 19:02:21 +02001104 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001105 .irq = {
1106 .set = &r600_irq_set,
1107 .process = &r600_irq_process,
1108 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001109 .display = {
1110 .bandwidth_update = &rs690_bandwidth_update,
1111 .get_vblank_counter = &rs600_get_vblank_counter,
1112 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001113 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001114 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001115 .hdmi_enable = &r600_hdmi_enable,
1116 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001117 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001118 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001119 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -05001120 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher4d756582012-09-27 15:08:35 -04001121 .dma = &r600_copy_dma,
1122 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucherbfea6a62013-07-11 14:53:34 -04001123 .copy = &r600_copy_cpdma,
Alex Deucheraeea40c2013-07-11 14:20:11 -04001124 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001125 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001126 .surface = {
1127 .set_reg = r600_set_surface_reg,
1128 .clear_reg = r600_clear_surface_reg,
1129 },
Alex Deucher901ea572012-02-23 17:53:39 -05001130 .hpd = {
1131 .init = &r600_hpd_init,
1132 .fini = &r600_hpd_fini,
1133 .sense = &r600_hpd_sense,
1134 .set_polarity = &r600_hpd_set_polarity,
1135 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001136 .pm = {
1137 .misc = &r600_pm_misc,
1138 .prepare = &rs600_pm_prepare,
1139 .finish = &rs600_pm_finish,
1140 .init_profile = &rs780_pm_init_profile,
1141 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001142 .get_engine_clock = &radeon_atom_get_engine_clock,
1143 .set_engine_clock = &radeon_atom_set_engine_clock,
1144 .get_memory_clock = NULL,
1145 .set_memory_clock = NULL,
1146 .get_pcie_lanes = NULL,
1147 .set_pcie_lanes = NULL,
1148 .set_clock_gating = NULL,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001149 .get_temperature = &rv6xx_get_temp,
Alex Deucher1b9ba702013-09-05 09:52:37 -04001150 .set_uvd_clocks = &r600_set_uvd_clocks,
Alex Deuchera02fa392012-02-23 17:53:41 -05001151 },
Alex Deucher9d670062013-04-12 13:59:22 -04001152 .dpm = {
1153 .init = &rs780_dpm_init,
1154 .setup_asic = &rs780_dpm_setup_asic,
1155 .enable = &rs780_dpm_enable,
Alex Deuchera4643ba2013-12-19 12:18:13 -05001156 .late_enable = &r600_dpm_late_enable,
Alex Deucher9d670062013-04-12 13:59:22 -04001157 .disable = &rs780_dpm_disable,
Alex Deucher98243912013-01-16 13:13:42 -05001158 .pre_set_power_state = &r600_dpm_pre_set_power_state,
Alex Deucher9d670062013-04-12 13:59:22 -04001159 .set_power_state = &rs780_dpm_set_power_state,
Alex Deucher98243912013-01-16 13:13:42 -05001160 .post_set_power_state = &r600_dpm_post_set_power_state,
Alex Deucher9d670062013-04-12 13:59:22 -04001161 .display_configuration_changed = &rs780_dpm_display_configuration_changed,
1162 .fini = &rs780_dpm_fini,
1163 .get_sclk = &rs780_dpm_get_sclk,
1164 .get_mclk = &rs780_dpm_get_mclk,
1165 .print_power_state = &rs780_dpm_print_power_state,
Alex Deucher444bddc2013-07-02 13:05:23 -04001166 .debugfs_print_current_performance_level = &rs780_dpm_debugfs_print_current_performance_level,
Anthoine Bourgeois63580c32013-09-03 13:52:19 -04001167 .force_performance_level = &rs780_dpm_force_performance_level,
Alex Deucher9d670062013-04-12 13:59:22 -04001168 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001169 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -05001170 .page_flip = &rs600_page_flip,
Christian König157fa142014-05-27 16:49:20 +02001171 .page_flip_pending = &rs600_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -05001172 },
Alex Deucherf47299c2010-03-16 20:54:38 -04001173};
1174
Christian König76a0df82013-08-13 11:56:50 +02001175static struct radeon_asic_ring rv770_uvd_ring = {
Christian Könige409b122013-08-13 11:56:53 +02001176 .ib_execute = &uvd_v1_0_ib_execute,
1177 .emit_fence = &uvd_v2_2_fence_emit,
1178 .emit_semaphore = &uvd_v1_0_semaphore_emit,
Christian König76a0df82013-08-13 11:56:50 +02001179 .cs_parse = &radeon_uvd_cs_parse,
Christian Könige409b122013-08-13 11:56:53 +02001180 .ring_test = &uvd_v1_0_ring_test,
1181 .ib_test = &uvd_v1_0_ib_test,
Christian König76a0df82013-08-13 11:56:50 +02001182 .is_lockup = &radeon_ring_test_lockup,
Christian Könige409b122013-08-13 11:56:53 +02001183 .get_rptr = &uvd_v1_0_get_rptr,
1184 .get_wptr = &uvd_v1_0_get_wptr,
1185 .set_wptr = &uvd_v1_0_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001186};
1187
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001188static struct radeon_asic rv770_asic = {
1189 .init = &rv770_init,
1190 .fini = &rv770_fini,
1191 .suspend = &rv770_suspend,
1192 .resume = &rv770_resume,
Jerome Glissea2d07b72010-03-09 14:45:11 +00001193 .asic_reset = &r600_asic_reset,
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001194 .vga_set_state = &r600_vga_set_state,
Michel Dänzer124764f2014-07-31 18:43:48 +09001195 .mmio_hdp_flush = r600_mmio_hdp_flush,
Alex Deucher54e88e02012-02-23 18:10:29 -05001196 .gui_idle = &r600_gui_idle,
1197 .mc_wait_for_idle = &r600_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001198 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001199 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001200 .gart = {
1201 .tlb_flush = &r600_pcie_gart_tlb_flush,
1202 .set_page = &rs600_gart_set_page,
1203 },
Christian König4c87bc22011-10-19 19:02:21 +02001204 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001205 [RADEON_RING_TYPE_GFX_INDEX] = &r600_gfx_ring,
1206 [R600_RING_TYPE_DMA_INDEX] = &r600_dma_ring,
1207 [R600_RING_TYPE_UVD_INDEX] = &rv770_uvd_ring,
Christian König4c87bc22011-10-19 19:02:21 +02001208 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001209 .irq = {
1210 .set = &r600_irq_set,
1211 .process = &r600_irq_process,
1212 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001213 .display = {
1214 .bandwidth_update = &rv515_bandwidth_update,
1215 .get_vblank_counter = &rs600_get_vblank_counter,
1216 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001217 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001218 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001219 .hdmi_enable = &r600_hdmi_enable,
Rafał Miłecki8f33a152014-05-16 11:36:24 +02001220 .hdmi_setmode = &dce3_1_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001221 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001222 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001223 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -05001224 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher43fb7782013-01-04 09:24:18 -05001225 .dma = &rv770_copy_dma,
Alex Deucher4d756582012-09-27 15:08:35 -04001226 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher43fb7782013-01-04 09:24:18 -05001227 .copy = &rv770_copy_dma,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001228 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001229 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001230 .surface = {
1231 .set_reg = r600_set_surface_reg,
1232 .clear_reg = r600_clear_surface_reg,
1233 },
Alex Deucher901ea572012-02-23 17:53:39 -05001234 .hpd = {
1235 .init = &r600_hpd_init,
1236 .fini = &r600_hpd_fini,
1237 .sense = &r600_hpd_sense,
1238 .set_polarity = &r600_hpd_set_polarity,
1239 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001240 .pm = {
1241 .misc = &rv770_pm_misc,
1242 .prepare = &rs600_pm_prepare,
1243 .finish = &rs600_pm_finish,
1244 .init_profile = &r600_pm_init_profile,
1245 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001246 .get_engine_clock = &radeon_atom_get_engine_clock,
1247 .set_engine_clock = &radeon_atom_set_engine_clock,
1248 .get_memory_clock = &radeon_atom_get_memory_clock,
1249 .set_memory_clock = &radeon_atom_set_memory_clock,
1250 .get_pcie_lanes = &r600_get_pcie_lanes,
1251 .set_pcie_lanes = &r600_set_pcie_lanes,
1252 .set_clock_gating = &radeon_atom_set_clock_gating,
Christian Königef0e6e62013-04-08 12:41:35 +02001253 .set_uvd_clocks = &rv770_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001254 .get_temperature = &rv770_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001255 },
Alex Deucher66229b22013-06-26 00:11:19 -04001256 .dpm = {
1257 .init = &rv770_dpm_init,
1258 .setup_asic = &rv770_dpm_setup_asic,
1259 .enable = &rv770_dpm_enable,
Alex Deuchera3f11242013-12-19 13:48:36 -05001260 .late_enable = &rv770_dpm_late_enable,
Alex Deucher66229b22013-06-26 00:11:19 -04001261 .disable = &rv770_dpm_disable,
Alex Deucher98243912013-01-16 13:13:42 -05001262 .pre_set_power_state = &r600_dpm_pre_set_power_state,
Alex Deucher66229b22013-06-26 00:11:19 -04001263 .set_power_state = &rv770_dpm_set_power_state,
Alex Deucher98243912013-01-16 13:13:42 -05001264 .post_set_power_state = &r600_dpm_post_set_power_state,
Alex Deucher66229b22013-06-26 00:11:19 -04001265 .display_configuration_changed = &rv770_dpm_display_configuration_changed,
1266 .fini = &rv770_dpm_fini,
1267 .get_sclk = &rv770_dpm_get_sclk,
1268 .get_mclk = &rv770_dpm_get_mclk,
1269 .print_power_state = &rv770_dpm_print_power_state,
Alex Deucherbd210d12013-06-28 10:06:26 -04001270 .debugfs_print_current_performance_level = &rv770_dpm_debugfs_print_current_performance_level,
Alex Deucher8b5e6b72013-07-02 18:40:35 -04001271 .force_performance_level = &rv770_dpm_force_performance_level,
Alex Deucherb06195d2013-07-08 11:49:48 -04001272 .vblank_too_short = &rv770_dpm_vblank_too_short,
Alex Deucher66229b22013-06-26 00:11:19 -04001273 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001274 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -05001275 .page_flip = &rv770_page_flip,
Christian König157fa142014-05-27 16:49:20 +02001276 .page_flip_pending = &rv770_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -05001277 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001278};
1279
Christian König76a0df82013-08-13 11:56:50 +02001280static struct radeon_asic_ring evergreen_gfx_ring = {
1281 .ib_execute = &evergreen_ring_ib_execute,
1282 .emit_fence = &r600_fence_ring_emit,
1283 .emit_semaphore = &r600_semaphore_ring_emit,
1284 .cs_parse = &evergreen_cs_parse,
1285 .ring_test = &r600_ring_test,
1286 .ib_test = &r600_ib_test,
1287 .is_lockup = &evergreen_gfx_is_lockup,
Alex Deucherea31bf62013-12-09 19:44:30 -05001288 .get_rptr = &r600_gfx_get_rptr,
1289 .get_wptr = &r600_gfx_get_wptr,
1290 .set_wptr = &r600_gfx_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001291};
1292
1293static struct radeon_asic_ring evergreen_dma_ring = {
1294 .ib_execute = &evergreen_dma_ring_ib_execute,
1295 .emit_fence = &evergreen_dma_fence_ring_emit,
1296 .emit_semaphore = &r600_dma_semaphore_ring_emit,
1297 .cs_parse = &evergreen_dma_cs_parse,
1298 .ring_test = &r600_dma_ring_test,
1299 .ib_test = &r600_dma_ib_test,
1300 .is_lockup = &evergreen_dma_is_lockup,
Christian König2e1e6da2013-08-13 11:56:52 +02001301 .get_rptr = &r600_dma_get_rptr,
1302 .get_wptr = &r600_dma_get_wptr,
1303 .set_wptr = &r600_dma_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001304};
1305
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001306static struct radeon_asic evergreen_asic = {
1307 .init = &evergreen_init,
1308 .fini = &evergreen_fini,
1309 .suspend = &evergreen_suspend,
1310 .resume = &evergreen_resume,
Jerome Glissea2d07b72010-03-09 14:45:11 +00001311 .asic_reset = &evergreen_asic_reset,
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001312 .vga_set_state = &r600_vga_set_state,
Michel Dänzer124764f2014-07-31 18:43:48 +09001313 .mmio_hdp_flush = r600_mmio_hdp_flush,
Alex Deucher54e88e02012-02-23 18:10:29 -05001314 .gui_idle = &r600_gui_idle,
1315 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001316 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001317 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001318 .gart = {
1319 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1320 .set_page = &rs600_gart_set_page,
1321 },
Christian König4c87bc22011-10-19 19:02:21 +02001322 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001323 [RADEON_RING_TYPE_GFX_INDEX] = &evergreen_gfx_ring,
1324 [R600_RING_TYPE_DMA_INDEX] = &evergreen_dma_ring,
1325 [R600_RING_TYPE_UVD_INDEX] = &rv770_uvd_ring,
Christian König4c87bc22011-10-19 19:02:21 +02001326 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001327 .irq = {
1328 .set = &evergreen_irq_set,
1329 .process = &evergreen_irq_process,
1330 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001331 .display = {
1332 .bandwidth_update = &evergreen_bandwidth_update,
1333 .get_vblank_counter = &evergreen_get_vblank_counter,
1334 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001335 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001336 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001337 .hdmi_enable = &evergreen_hdmi_enable,
1338 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001339 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001340 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001341 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -05001342 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001343 .dma = &evergreen_copy_dma,
1344 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001345 .copy = &evergreen_copy_dma,
1346 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001347 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001348 .surface = {
1349 .set_reg = r600_set_surface_reg,
1350 .clear_reg = r600_clear_surface_reg,
1351 },
Alex Deucher901ea572012-02-23 17:53:39 -05001352 .hpd = {
1353 .init = &evergreen_hpd_init,
1354 .fini = &evergreen_hpd_fini,
1355 .sense = &evergreen_hpd_sense,
1356 .set_polarity = &evergreen_hpd_set_polarity,
1357 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001358 .pm = {
1359 .misc = &evergreen_pm_misc,
1360 .prepare = &evergreen_pm_prepare,
1361 .finish = &evergreen_pm_finish,
1362 .init_profile = &r600_pm_init_profile,
1363 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001364 .get_engine_clock = &radeon_atom_get_engine_clock,
1365 .set_engine_clock = &radeon_atom_set_engine_clock,
1366 .get_memory_clock = &radeon_atom_get_memory_clock,
1367 .set_memory_clock = &radeon_atom_set_memory_clock,
1368 .get_pcie_lanes = &r600_get_pcie_lanes,
1369 .set_pcie_lanes = &r600_set_pcie_lanes,
1370 .set_clock_gating = NULL,
Alex Deuchera8b49252013-04-08 12:41:33 +02001371 .set_uvd_clocks = &evergreen_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001372 .get_temperature = &evergreen_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001373 },
Alex Deucherdc50ba72013-06-26 00:33:35 -04001374 .dpm = {
1375 .init = &cypress_dpm_init,
1376 .setup_asic = &cypress_dpm_setup_asic,
1377 .enable = &cypress_dpm_enable,
Alex Deuchera3f11242013-12-19 13:48:36 -05001378 .late_enable = &rv770_dpm_late_enable,
Alex Deucherdc50ba72013-06-26 00:33:35 -04001379 .disable = &cypress_dpm_disable,
Alex Deucher98243912013-01-16 13:13:42 -05001380 .pre_set_power_state = &r600_dpm_pre_set_power_state,
Alex Deucherdc50ba72013-06-26 00:33:35 -04001381 .set_power_state = &cypress_dpm_set_power_state,
Alex Deucher98243912013-01-16 13:13:42 -05001382 .post_set_power_state = &r600_dpm_post_set_power_state,
Alex Deucherdc50ba72013-06-26 00:33:35 -04001383 .display_configuration_changed = &cypress_dpm_display_configuration_changed,
1384 .fini = &cypress_dpm_fini,
1385 .get_sclk = &rv770_dpm_get_sclk,
1386 .get_mclk = &rv770_dpm_get_mclk,
1387 .print_power_state = &rv770_dpm_print_power_state,
Alex Deucherbd210d12013-06-28 10:06:26 -04001388 .debugfs_print_current_performance_level = &rv770_dpm_debugfs_print_current_performance_level,
Alex Deucher8b5e6b72013-07-02 18:40:35 -04001389 .force_performance_level = &rv770_dpm_force_performance_level,
Alex Deucherd0b54bd2013-07-08 11:56:09 -04001390 .vblank_too_short = &cypress_dpm_vblank_too_short,
Alex Deucherdc50ba72013-06-26 00:33:35 -04001391 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001392 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -05001393 .page_flip = &evergreen_page_flip,
Christian König157fa142014-05-27 16:49:20 +02001394 .page_flip_pending = &evergreen_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -05001395 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001396};
1397
Alex Deucher958261d2010-11-22 17:56:30 -05001398static struct radeon_asic sumo_asic = {
1399 .init = &evergreen_init,
1400 .fini = &evergreen_fini,
1401 .suspend = &evergreen_suspend,
1402 .resume = &evergreen_resume,
Alex Deucher958261d2010-11-22 17:56:30 -05001403 .asic_reset = &evergreen_asic_reset,
1404 .vga_set_state = &r600_vga_set_state,
Michel Dänzer124764f2014-07-31 18:43:48 +09001405 .mmio_hdp_flush = r600_mmio_hdp_flush,
Alex Deucher54e88e02012-02-23 18:10:29 -05001406 .gui_idle = &r600_gui_idle,
1407 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001408 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001409 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001410 .gart = {
1411 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1412 .set_page = &rs600_gart_set_page,
1413 },
Christian König4c87bc22011-10-19 19:02:21 +02001414 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001415 [RADEON_RING_TYPE_GFX_INDEX] = &evergreen_gfx_ring,
1416 [R600_RING_TYPE_DMA_INDEX] = &evergreen_dma_ring,
1417 [R600_RING_TYPE_UVD_INDEX] = &rv770_uvd_ring,
Christian König4c87bc22011-10-19 19:02:21 +02001418 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001419 .irq = {
1420 .set = &evergreen_irq_set,
1421 .process = &evergreen_irq_process,
1422 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001423 .display = {
1424 .bandwidth_update = &evergreen_bandwidth_update,
1425 .get_vblank_counter = &evergreen_get_vblank_counter,
1426 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001427 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001428 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001429 .hdmi_enable = &evergreen_hdmi_enable,
1430 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001431 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001432 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001433 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -05001434 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001435 .dma = &evergreen_copy_dma,
1436 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001437 .copy = &evergreen_copy_dma,
1438 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001439 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001440 .surface = {
1441 .set_reg = r600_set_surface_reg,
1442 .clear_reg = r600_clear_surface_reg,
1443 },
Alex Deucher901ea572012-02-23 17:53:39 -05001444 .hpd = {
1445 .init = &evergreen_hpd_init,
1446 .fini = &evergreen_hpd_fini,
1447 .sense = &evergreen_hpd_sense,
1448 .set_polarity = &evergreen_hpd_set_polarity,
1449 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001450 .pm = {
1451 .misc = &evergreen_pm_misc,
1452 .prepare = &evergreen_pm_prepare,
1453 .finish = &evergreen_pm_finish,
1454 .init_profile = &sumo_pm_init_profile,
1455 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001456 .get_engine_clock = &radeon_atom_get_engine_clock,
1457 .set_engine_clock = &radeon_atom_set_engine_clock,
1458 .get_memory_clock = NULL,
1459 .set_memory_clock = NULL,
1460 .get_pcie_lanes = NULL,
1461 .set_pcie_lanes = NULL,
1462 .set_clock_gating = NULL,
Alex Deucher23d33ba2013-04-08 12:41:32 +02001463 .set_uvd_clocks = &sumo_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001464 .get_temperature = &sumo_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001465 },
Alex Deucher80ea2c12013-04-12 14:56:21 -04001466 .dpm = {
1467 .init = &sumo_dpm_init,
1468 .setup_asic = &sumo_dpm_setup_asic,
1469 .enable = &sumo_dpm_enable,
Alex Deucher14ec9fa2013-12-19 11:56:52 -05001470 .late_enable = &sumo_dpm_late_enable,
Alex Deucher80ea2c12013-04-12 14:56:21 -04001471 .disable = &sumo_dpm_disable,
Alex Deucher422a56b2013-06-25 15:40:21 -04001472 .pre_set_power_state = &sumo_dpm_pre_set_power_state,
Alex Deucher80ea2c12013-04-12 14:56:21 -04001473 .set_power_state = &sumo_dpm_set_power_state,
Alex Deucher422a56b2013-06-25 15:40:21 -04001474 .post_set_power_state = &sumo_dpm_post_set_power_state,
Alex Deucher80ea2c12013-04-12 14:56:21 -04001475 .display_configuration_changed = &sumo_dpm_display_configuration_changed,
1476 .fini = &sumo_dpm_fini,
1477 .get_sclk = &sumo_dpm_get_sclk,
1478 .get_mclk = &sumo_dpm_get_mclk,
1479 .print_power_state = &sumo_dpm_print_power_state,
Alex Deucherfb701602013-06-28 10:47:56 -04001480 .debugfs_print_current_performance_level = &sumo_dpm_debugfs_print_current_performance_level,
Alex Deucher5d5e5592013-07-02 18:50:09 -04001481 .force_performance_level = &sumo_dpm_force_performance_level,
Alex Deucher80ea2c12013-04-12 14:56:21 -04001482 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001483 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -05001484 .page_flip = &evergreen_page_flip,
Christian König157fa142014-05-27 16:49:20 +02001485 .page_flip_pending = &evergreen_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -05001486 },
Alex Deucher958261d2010-11-22 17:56:30 -05001487};
1488
Alex Deuchera43b7662011-01-06 21:19:33 -05001489static struct radeon_asic btc_asic = {
1490 .init = &evergreen_init,
1491 .fini = &evergreen_fini,
1492 .suspend = &evergreen_suspend,
1493 .resume = &evergreen_resume,
Alex Deuchera43b7662011-01-06 21:19:33 -05001494 .asic_reset = &evergreen_asic_reset,
1495 .vga_set_state = &r600_vga_set_state,
Michel Dänzer124764f2014-07-31 18:43:48 +09001496 .mmio_hdp_flush = r600_mmio_hdp_flush,
Alex Deucher54e88e02012-02-23 18:10:29 -05001497 .gui_idle = &r600_gui_idle,
1498 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001499 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001500 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001501 .gart = {
1502 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1503 .set_page = &rs600_gart_set_page,
1504 },
Christian König4c87bc22011-10-19 19:02:21 +02001505 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001506 [RADEON_RING_TYPE_GFX_INDEX] = &evergreen_gfx_ring,
1507 [R600_RING_TYPE_DMA_INDEX] = &evergreen_dma_ring,
1508 [R600_RING_TYPE_UVD_INDEX] = &rv770_uvd_ring,
Christian König4c87bc22011-10-19 19:02:21 +02001509 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001510 .irq = {
1511 .set = &evergreen_irq_set,
1512 .process = &evergreen_irq_process,
1513 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001514 .display = {
1515 .bandwidth_update = &evergreen_bandwidth_update,
1516 .get_vblank_counter = &evergreen_get_vblank_counter,
1517 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001518 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001519 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001520 .hdmi_enable = &evergreen_hdmi_enable,
1521 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001522 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001523 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001524 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -05001525 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001526 .dma = &evergreen_copy_dma,
1527 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001528 .copy = &evergreen_copy_dma,
1529 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001530 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001531 .surface = {
1532 .set_reg = r600_set_surface_reg,
1533 .clear_reg = r600_clear_surface_reg,
1534 },
Alex Deucher901ea572012-02-23 17:53:39 -05001535 .hpd = {
1536 .init = &evergreen_hpd_init,
1537 .fini = &evergreen_hpd_fini,
1538 .sense = &evergreen_hpd_sense,
1539 .set_polarity = &evergreen_hpd_set_polarity,
1540 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001541 .pm = {
1542 .misc = &evergreen_pm_misc,
1543 .prepare = &evergreen_pm_prepare,
1544 .finish = &evergreen_pm_finish,
Alex Deucher27810fb2012-10-01 19:25:11 -04001545 .init_profile = &btc_pm_init_profile,
Alex Deuchera02fa392012-02-23 17:53:41 -05001546 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001547 .get_engine_clock = &radeon_atom_get_engine_clock,
1548 .set_engine_clock = &radeon_atom_set_engine_clock,
1549 .get_memory_clock = &radeon_atom_get_memory_clock,
1550 .set_memory_clock = &radeon_atom_set_memory_clock,
Alex Deucher55b615a2013-03-18 18:57:27 -04001551 .get_pcie_lanes = &r600_get_pcie_lanes,
1552 .set_pcie_lanes = &r600_set_pcie_lanes,
Alex Deucher798bcf72012-02-23 17:53:48 -05001553 .set_clock_gating = NULL,
Alex Deuchera8b49252013-04-08 12:41:33 +02001554 .set_uvd_clocks = &evergreen_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001555 .get_temperature = &evergreen_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001556 },
Alex Deucher6596afd2013-06-26 00:15:24 -04001557 .dpm = {
1558 .init = &btc_dpm_init,
1559 .setup_asic = &btc_dpm_setup_asic,
1560 .enable = &btc_dpm_enable,
Alex Deuchera3f11242013-12-19 13:48:36 -05001561 .late_enable = &rv770_dpm_late_enable,
Alex Deucher6596afd2013-06-26 00:15:24 -04001562 .disable = &btc_dpm_disable,
Alex Deuchere8a95392013-01-16 14:17:23 -05001563 .pre_set_power_state = &btc_dpm_pre_set_power_state,
Alex Deucher6596afd2013-06-26 00:15:24 -04001564 .set_power_state = &btc_dpm_set_power_state,
Alex Deuchere8a95392013-01-16 14:17:23 -05001565 .post_set_power_state = &btc_dpm_post_set_power_state,
Alex Deucher6596afd2013-06-26 00:15:24 -04001566 .display_configuration_changed = &cypress_dpm_display_configuration_changed,
1567 .fini = &btc_dpm_fini,
Alex Deuchere8a95392013-01-16 14:17:23 -05001568 .get_sclk = &btc_dpm_get_sclk,
1569 .get_mclk = &btc_dpm_get_mclk,
Alex Deucher6596afd2013-06-26 00:15:24 -04001570 .print_power_state = &rv770_dpm_print_power_state,
Alex Deucher9f3f63f2014-01-30 11:19:22 -05001571 .debugfs_print_current_performance_level = &btc_dpm_debugfs_print_current_performance_level,
Alex Deucher8b5e6b72013-07-02 18:40:35 -04001572 .force_performance_level = &rv770_dpm_force_performance_level,
Alex Deuchera84301c2013-07-08 12:03:55 -04001573 .vblank_too_short = &btc_dpm_vblank_too_short,
Alex Deucher6596afd2013-06-26 00:15:24 -04001574 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001575 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -05001576 .page_flip = &evergreen_page_flip,
Christian König157fa142014-05-27 16:49:20 +02001577 .page_flip_pending = &evergreen_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -05001578 },
Alex Deuchera43b7662011-01-06 21:19:33 -05001579};
1580
Christian König76a0df82013-08-13 11:56:50 +02001581static struct radeon_asic_ring cayman_gfx_ring = {
1582 .ib_execute = &cayman_ring_ib_execute,
1583 .ib_parse = &evergreen_ib_parse,
1584 .emit_fence = &cayman_fence_ring_emit,
1585 .emit_semaphore = &r600_semaphore_ring_emit,
1586 .cs_parse = &evergreen_cs_parse,
1587 .ring_test = &r600_ring_test,
1588 .ib_test = &r600_ib_test,
1589 .is_lockup = &cayman_gfx_is_lockup,
1590 .vm_flush = &cayman_vm_flush,
Alex Deucherea31bf62013-12-09 19:44:30 -05001591 .get_rptr = &cayman_gfx_get_rptr,
1592 .get_wptr = &cayman_gfx_get_wptr,
1593 .set_wptr = &cayman_gfx_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001594};
1595
1596static struct radeon_asic_ring cayman_dma_ring = {
1597 .ib_execute = &cayman_dma_ring_ib_execute,
1598 .ib_parse = &evergreen_dma_ib_parse,
1599 .emit_fence = &evergreen_dma_fence_ring_emit,
1600 .emit_semaphore = &r600_dma_semaphore_ring_emit,
1601 .cs_parse = &evergreen_dma_cs_parse,
1602 .ring_test = &r600_dma_ring_test,
1603 .ib_test = &r600_dma_ib_test,
1604 .is_lockup = &cayman_dma_is_lockup,
1605 .vm_flush = &cayman_dma_vm_flush,
Alex Deucherea31bf62013-12-09 19:44:30 -05001606 .get_rptr = &cayman_dma_get_rptr,
1607 .get_wptr = &cayman_dma_get_wptr,
1608 .set_wptr = &cayman_dma_set_wptr
Christian König76a0df82013-08-13 11:56:50 +02001609};
1610
1611static struct radeon_asic_ring cayman_uvd_ring = {
Christian Könige409b122013-08-13 11:56:53 +02001612 .ib_execute = &uvd_v1_0_ib_execute,
1613 .emit_fence = &uvd_v2_2_fence_emit,
1614 .emit_semaphore = &uvd_v3_1_semaphore_emit,
Christian König76a0df82013-08-13 11:56:50 +02001615 .cs_parse = &radeon_uvd_cs_parse,
Christian Könige409b122013-08-13 11:56:53 +02001616 .ring_test = &uvd_v1_0_ring_test,
1617 .ib_test = &uvd_v1_0_ib_test,
Christian König76a0df82013-08-13 11:56:50 +02001618 .is_lockup = &radeon_ring_test_lockup,
Christian Könige409b122013-08-13 11:56:53 +02001619 .get_rptr = &uvd_v1_0_get_rptr,
1620 .get_wptr = &uvd_v1_0_get_wptr,
1621 .set_wptr = &uvd_v1_0_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001622};
1623
Alex Deuchere3487622011-03-02 20:07:36 -05001624static struct radeon_asic cayman_asic = {
1625 .init = &cayman_init,
1626 .fini = &cayman_fini,
1627 .suspend = &cayman_suspend,
1628 .resume = &cayman_resume,
Alex Deuchere3487622011-03-02 20:07:36 -05001629 .asic_reset = &cayman_asic_reset,
1630 .vga_set_state = &r600_vga_set_state,
Michel Dänzer124764f2014-07-31 18:43:48 +09001631 .mmio_hdp_flush = r600_mmio_hdp_flush,
Alex Deucher54e88e02012-02-23 18:10:29 -05001632 .gui_idle = &r600_gui_idle,
1633 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001634 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001635 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001636 .gart = {
1637 .tlb_flush = &cayman_pcie_gart_tlb_flush,
1638 .set_page = &rs600_gart_set_page,
1639 },
Christian König05b07142012-08-06 20:21:10 +02001640 .vm = {
1641 .init = &cayman_vm_init,
1642 .fini = &cayman_vm_fini,
Christian König03f62ab2014-07-30 21:05:17 +02001643 .copy_pages = &cayman_dma_vm_copy_pages,
1644 .write_pages = &cayman_dma_vm_write_pages,
1645 .set_pages = &cayman_dma_vm_set_pages,
1646 .pad_ib = &cayman_dma_vm_pad_ib,
Christian König05b07142012-08-06 20:21:10 +02001647 },
Christian König4c87bc22011-10-19 19:02:21 +02001648 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001649 [RADEON_RING_TYPE_GFX_INDEX] = &cayman_gfx_ring,
1650 [CAYMAN_RING_TYPE_CP1_INDEX] = &cayman_gfx_ring,
1651 [CAYMAN_RING_TYPE_CP2_INDEX] = &cayman_gfx_ring,
1652 [R600_RING_TYPE_DMA_INDEX] = &cayman_dma_ring,
1653 [CAYMAN_RING_TYPE_DMA1_INDEX] = &cayman_dma_ring,
1654 [R600_RING_TYPE_UVD_INDEX] = &cayman_uvd_ring,
Christian König4c87bc22011-10-19 19:02:21 +02001655 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001656 .irq = {
1657 .set = &evergreen_irq_set,
1658 .process = &evergreen_irq_process,
1659 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001660 .display = {
1661 .bandwidth_update = &evergreen_bandwidth_update,
1662 .get_vblank_counter = &evergreen_get_vblank_counter,
1663 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001664 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001665 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001666 .hdmi_enable = &evergreen_hdmi_enable,
1667 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001668 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001669 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001670 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -05001671 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001672 .dma = &evergreen_copy_dma,
1673 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001674 .copy = &evergreen_copy_dma,
1675 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001676 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001677 .surface = {
1678 .set_reg = r600_set_surface_reg,
1679 .clear_reg = r600_clear_surface_reg,
1680 },
Alex Deucher901ea572012-02-23 17:53:39 -05001681 .hpd = {
1682 .init = &evergreen_hpd_init,
1683 .fini = &evergreen_hpd_fini,
1684 .sense = &evergreen_hpd_sense,
1685 .set_polarity = &evergreen_hpd_set_polarity,
1686 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001687 .pm = {
1688 .misc = &evergreen_pm_misc,
1689 .prepare = &evergreen_pm_prepare,
1690 .finish = &evergreen_pm_finish,
Alex Deucher27810fb2012-10-01 19:25:11 -04001691 .init_profile = &btc_pm_init_profile,
Alex Deuchera02fa392012-02-23 17:53:41 -05001692 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001693 .get_engine_clock = &radeon_atom_get_engine_clock,
1694 .set_engine_clock = &radeon_atom_set_engine_clock,
1695 .get_memory_clock = &radeon_atom_get_memory_clock,
1696 .set_memory_clock = &radeon_atom_set_memory_clock,
Alex Deucher55b615a2013-03-18 18:57:27 -04001697 .get_pcie_lanes = &r600_get_pcie_lanes,
1698 .set_pcie_lanes = &r600_set_pcie_lanes,
Alex Deucher798bcf72012-02-23 17:53:48 -05001699 .set_clock_gating = NULL,
Alex Deuchera8b49252013-04-08 12:41:33 +02001700 .set_uvd_clocks = &evergreen_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001701 .get_temperature = &evergreen_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001702 },
Alex Deucher69e0b572013-04-12 16:42:42 -04001703 .dpm = {
1704 .init = &ni_dpm_init,
1705 .setup_asic = &ni_dpm_setup_asic,
1706 .enable = &ni_dpm_enable,
Alex Deuchera3f11242013-12-19 13:48:36 -05001707 .late_enable = &rv770_dpm_late_enable,
Alex Deucher69e0b572013-04-12 16:42:42 -04001708 .disable = &ni_dpm_disable,
Alex Deucherfee3d742013-01-16 14:35:39 -05001709 .pre_set_power_state = &ni_dpm_pre_set_power_state,
Alex Deucher69e0b572013-04-12 16:42:42 -04001710 .set_power_state = &ni_dpm_set_power_state,
Alex Deucherfee3d742013-01-16 14:35:39 -05001711 .post_set_power_state = &ni_dpm_post_set_power_state,
Alex Deucher69e0b572013-04-12 16:42:42 -04001712 .display_configuration_changed = &cypress_dpm_display_configuration_changed,
1713 .fini = &ni_dpm_fini,
1714 .get_sclk = &ni_dpm_get_sclk,
1715 .get_mclk = &ni_dpm_get_mclk,
1716 .print_power_state = &ni_dpm_print_power_state,
Alex Deucherbdf0c4f2013-06-28 17:49:02 -04001717 .debugfs_print_current_performance_level = &ni_dpm_debugfs_print_current_performance_level,
Alex Deucher170a47f2013-07-02 18:43:53 -04001718 .force_performance_level = &ni_dpm_force_performance_level,
Alex Deucher76ad73e2013-07-08 12:09:41 -04001719 .vblank_too_short = &ni_dpm_vblank_too_short,
Alex Deucher69e0b572013-04-12 16:42:42 -04001720 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001721 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -05001722 .page_flip = &evergreen_page_flip,
Christian König157fa142014-05-27 16:49:20 +02001723 .page_flip_pending = &evergreen_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -05001724 },
Alex Deuchere3487622011-03-02 20:07:36 -05001725};
1726
Alex Deucherbe63fe82012-03-20 17:18:40 -04001727static struct radeon_asic trinity_asic = {
1728 .init = &cayman_init,
1729 .fini = &cayman_fini,
1730 .suspend = &cayman_suspend,
1731 .resume = &cayman_resume,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001732 .asic_reset = &cayman_asic_reset,
1733 .vga_set_state = &r600_vga_set_state,
Michel Dänzer124764f2014-07-31 18:43:48 +09001734 .mmio_hdp_flush = r600_mmio_hdp_flush,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001735 .gui_idle = &r600_gui_idle,
1736 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001737 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001738 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001739 .gart = {
1740 .tlb_flush = &cayman_pcie_gart_tlb_flush,
1741 .set_page = &rs600_gart_set_page,
1742 },
Christian König05b07142012-08-06 20:21:10 +02001743 .vm = {
1744 .init = &cayman_vm_init,
1745 .fini = &cayman_vm_fini,
Christian König03f62ab2014-07-30 21:05:17 +02001746 .copy_pages = &cayman_dma_vm_copy_pages,
1747 .write_pages = &cayman_dma_vm_write_pages,
1748 .set_pages = &cayman_dma_vm_set_pages,
1749 .pad_ib = &cayman_dma_vm_pad_ib,
Christian König05b07142012-08-06 20:21:10 +02001750 },
Alex Deucherbe63fe82012-03-20 17:18:40 -04001751 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001752 [RADEON_RING_TYPE_GFX_INDEX] = &cayman_gfx_ring,
1753 [CAYMAN_RING_TYPE_CP1_INDEX] = &cayman_gfx_ring,
1754 [CAYMAN_RING_TYPE_CP2_INDEX] = &cayman_gfx_ring,
1755 [R600_RING_TYPE_DMA_INDEX] = &cayman_dma_ring,
1756 [CAYMAN_RING_TYPE_DMA1_INDEX] = &cayman_dma_ring,
1757 [R600_RING_TYPE_UVD_INDEX] = &cayman_uvd_ring,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001758 },
1759 .irq = {
1760 .set = &evergreen_irq_set,
1761 .process = &evergreen_irq_process,
1762 },
1763 .display = {
1764 .bandwidth_update = &dce6_bandwidth_update,
1765 .get_vblank_counter = &evergreen_get_vblank_counter,
1766 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001767 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001768 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherb5306022013-07-31 16:51:33 -04001769 .hdmi_enable = &evergreen_hdmi_enable,
1770 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001771 },
1772 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001773 .blit = &r600_copy_cpdma,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001774 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001775 .dma = &evergreen_copy_dma,
1776 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001777 .copy = &evergreen_copy_dma,
1778 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001779 },
1780 .surface = {
1781 .set_reg = r600_set_surface_reg,
1782 .clear_reg = r600_clear_surface_reg,
1783 },
1784 .hpd = {
1785 .init = &evergreen_hpd_init,
1786 .fini = &evergreen_hpd_fini,
1787 .sense = &evergreen_hpd_sense,
1788 .set_polarity = &evergreen_hpd_set_polarity,
1789 },
1790 .pm = {
1791 .misc = &evergreen_pm_misc,
1792 .prepare = &evergreen_pm_prepare,
1793 .finish = &evergreen_pm_finish,
1794 .init_profile = &sumo_pm_init_profile,
1795 .get_dynpm_state = &r600_pm_get_dynpm_state,
1796 .get_engine_clock = &radeon_atom_get_engine_clock,
1797 .set_engine_clock = &radeon_atom_set_engine_clock,
1798 .get_memory_clock = NULL,
1799 .set_memory_clock = NULL,
1800 .get_pcie_lanes = NULL,
1801 .set_pcie_lanes = NULL,
1802 .set_clock_gating = NULL,
Alex Deucher23d33ba2013-04-08 12:41:32 +02001803 .set_uvd_clocks = &sumo_set_uvd_clocks,
Alex Deucher29a15222012-12-14 11:57:36 -05001804 .get_temperature = &tn_get_temp,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001805 },
Alex Deucherd70229f2013-04-12 16:40:41 -04001806 .dpm = {
1807 .init = &trinity_dpm_init,
1808 .setup_asic = &trinity_dpm_setup_asic,
1809 .enable = &trinity_dpm_enable,
Alex Deucherbda44c12013-12-19 12:03:35 -05001810 .late_enable = &trinity_dpm_late_enable,
Alex Deucherd70229f2013-04-12 16:40:41 -04001811 .disable = &trinity_dpm_disable,
Alex Deuchera284c482013-01-16 13:53:40 -05001812 .pre_set_power_state = &trinity_dpm_pre_set_power_state,
Alex Deucherd70229f2013-04-12 16:40:41 -04001813 .set_power_state = &trinity_dpm_set_power_state,
Alex Deuchera284c482013-01-16 13:53:40 -05001814 .post_set_power_state = &trinity_dpm_post_set_power_state,
Alex Deucherd70229f2013-04-12 16:40:41 -04001815 .display_configuration_changed = &trinity_dpm_display_configuration_changed,
1816 .fini = &trinity_dpm_fini,
1817 .get_sclk = &trinity_dpm_get_sclk,
1818 .get_mclk = &trinity_dpm_get_mclk,
1819 .print_power_state = &trinity_dpm_print_power_state,
Alex Deucher490ab932013-06-28 12:01:38 -04001820 .debugfs_print_current_performance_level = &trinity_dpm_debugfs_print_current_performance_level,
Alex Deucher9b5de592013-07-02 18:52:10 -04001821 .force_performance_level = &trinity_dpm_force_performance_level,
Alex Deucher11877062013-09-09 19:19:52 -04001822 .enable_bapm = &trinity_dpm_enable_bapm,
Alex Deucherd70229f2013-04-12 16:40:41 -04001823 },
Alex Deucherbe63fe82012-03-20 17:18:40 -04001824 .pflip = {
Alex Deucherbe63fe82012-03-20 17:18:40 -04001825 .page_flip = &evergreen_page_flip,
Christian König157fa142014-05-27 16:49:20 +02001826 .page_flip_pending = &evergreen_page_flip_pending,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001827 },
1828};
1829
Christian König76a0df82013-08-13 11:56:50 +02001830static struct radeon_asic_ring si_gfx_ring = {
1831 .ib_execute = &si_ring_ib_execute,
1832 .ib_parse = &si_ib_parse,
1833 .emit_fence = &si_fence_ring_emit,
1834 .emit_semaphore = &r600_semaphore_ring_emit,
1835 .cs_parse = NULL,
1836 .ring_test = &r600_ring_test,
1837 .ib_test = &r600_ib_test,
1838 .is_lockup = &si_gfx_is_lockup,
1839 .vm_flush = &si_vm_flush,
Alex Deucherea31bf62013-12-09 19:44:30 -05001840 .get_rptr = &cayman_gfx_get_rptr,
1841 .get_wptr = &cayman_gfx_get_wptr,
1842 .set_wptr = &cayman_gfx_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001843};
1844
1845static struct radeon_asic_ring si_dma_ring = {
1846 .ib_execute = &cayman_dma_ring_ib_execute,
1847 .ib_parse = &evergreen_dma_ib_parse,
1848 .emit_fence = &evergreen_dma_fence_ring_emit,
1849 .emit_semaphore = &r600_dma_semaphore_ring_emit,
1850 .cs_parse = NULL,
1851 .ring_test = &r600_dma_ring_test,
1852 .ib_test = &r600_dma_ib_test,
1853 .is_lockup = &si_dma_is_lockup,
1854 .vm_flush = &si_dma_vm_flush,
Alex Deucherea31bf62013-12-09 19:44:30 -05001855 .get_rptr = &cayman_dma_get_rptr,
1856 .get_wptr = &cayman_dma_get_wptr,
1857 .set_wptr = &cayman_dma_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001858};
1859
Alex Deucher02779c02012-03-20 17:18:25 -04001860static struct radeon_asic si_asic = {
1861 .init = &si_init,
1862 .fini = &si_fini,
1863 .suspend = &si_suspend,
1864 .resume = &si_resume,
Alex Deucher02779c02012-03-20 17:18:25 -04001865 .asic_reset = &si_asic_reset,
1866 .vga_set_state = &r600_vga_set_state,
Michel Dänzer124764f2014-07-31 18:43:48 +09001867 .mmio_hdp_flush = r600_mmio_hdp_flush,
Alex Deucher02779c02012-03-20 17:18:25 -04001868 .gui_idle = &r600_gui_idle,
1869 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001870 .get_xclk = &si_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001871 .get_gpu_clock_counter = &si_get_gpu_clock_counter,
Alex Deucher02779c02012-03-20 17:18:25 -04001872 .gart = {
1873 .tlb_flush = &si_pcie_gart_tlb_flush,
1874 .set_page = &rs600_gart_set_page,
1875 },
Christian König05b07142012-08-06 20:21:10 +02001876 .vm = {
1877 .init = &si_vm_init,
1878 .fini = &si_vm_fini,
Christian König03f62ab2014-07-30 21:05:17 +02001879 .copy_pages = &si_dma_vm_copy_pages,
1880 .write_pages = &si_dma_vm_write_pages,
1881 .set_pages = &si_dma_vm_set_pages,
1882 .pad_ib = &cayman_dma_vm_pad_ib,
Christian König05b07142012-08-06 20:21:10 +02001883 },
Alex Deucher02779c02012-03-20 17:18:25 -04001884 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001885 [RADEON_RING_TYPE_GFX_INDEX] = &si_gfx_ring,
1886 [CAYMAN_RING_TYPE_CP1_INDEX] = &si_gfx_ring,
1887 [CAYMAN_RING_TYPE_CP2_INDEX] = &si_gfx_ring,
1888 [R600_RING_TYPE_DMA_INDEX] = &si_dma_ring,
1889 [CAYMAN_RING_TYPE_DMA1_INDEX] = &si_dma_ring,
1890 [R600_RING_TYPE_UVD_INDEX] = &cayman_uvd_ring,
Alex Deucher02779c02012-03-20 17:18:25 -04001891 },
1892 .irq = {
1893 .set = &si_irq_set,
1894 .process = &si_irq_process,
1895 },
1896 .display = {
1897 .bandwidth_update = &dce6_bandwidth_update,
1898 .get_vblank_counter = &evergreen_get_vblank_counter,
1899 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001900 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001901 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherb5306022013-07-31 16:51:33 -04001902 .hdmi_enable = &evergreen_hdmi_enable,
1903 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucher02779c02012-03-20 17:18:25 -04001904 },
1905 .copy = {
Alex Deucher5c722732013-10-01 16:17:14 -04001906 .blit = &r600_copy_cpdma,
Alex Deucher02779c02012-03-20 17:18:25 -04001907 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05001908 .dma = &si_copy_dma,
1909 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001910 .copy = &si_copy_dma,
1911 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher02779c02012-03-20 17:18:25 -04001912 },
1913 .surface = {
1914 .set_reg = r600_set_surface_reg,
1915 .clear_reg = r600_clear_surface_reg,
1916 },
1917 .hpd = {
1918 .init = &evergreen_hpd_init,
1919 .fini = &evergreen_hpd_fini,
1920 .sense = &evergreen_hpd_sense,
1921 .set_polarity = &evergreen_hpd_set_polarity,
1922 },
1923 .pm = {
1924 .misc = &evergreen_pm_misc,
1925 .prepare = &evergreen_pm_prepare,
1926 .finish = &evergreen_pm_finish,
1927 .init_profile = &sumo_pm_init_profile,
1928 .get_dynpm_state = &r600_pm_get_dynpm_state,
1929 .get_engine_clock = &radeon_atom_get_engine_clock,
1930 .set_engine_clock = &radeon_atom_set_engine_clock,
1931 .get_memory_clock = &radeon_atom_get_memory_clock,
1932 .set_memory_clock = &radeon_atom_set_memory_clock,
Alex Deucher55b615a2013-03-18 18:57:27 -04001933 .get_pcie_lanes = &r600_get_pcie_lanes,
1934 .set_pcie_lanes = &r600_set_pcie_lanes,
Alex Deucher02779c02012-03-20 17:18:25 -04001935 .set_clock_gating = NULL,
Christian König2539eb02013-04-08 12:41:34 +02001936 .set_uvd_clocks = &si_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001937 .get_temperature = &si_get_temp,
Alex Deucher02779c02012-03-20 17:18:25 -04001938 },
Alex Deuchera9e61412013-06-25 17:56:16 -04001939 .dpm = {
1940 .init = &si_dpm_init,
1941 .setup_asic = &si_dpm_setup_asic,
1942 .enable = &si_dpm_enable,
Alex Deucher963c1152013-12-19 13:54:35 -05001943 .late_enable = &si_dpm_late_enable,
Alex Deuchera9e61412013-06-25 17:56:16 -04001944 .disable = &si_dpm_disable,
1945 .pre_set_power_state = &si_dpm_pre_set_power_state,
1946 .set_power_state = &si_dpm_set_power_state,
1947 .post_set_power_state = &si_dpm_post_set_power_state,
1948 .display_configuration_changed = &si_dpm_display_configuration_changed,
1949 .fini = &si_dpm_fini,
1950 .get_sclk = &ni_dpm_get_sclk,
1951 .get_mclk = &ni_dpm_get_mclk,
1952 .print_power_state = &ni_dpm_print_power_state,
Alex Deucher79821282013-06-28 18:02:19 -04001953 .debugfs_print_current_performance_level = &si_dpm_debugfs_print_current_performance_level,
Alex Deuchera160a6a2013-07-02 18:46:28 -04001954 .force_performance_level = &si_dpm_force_performance_level,
Alex Deucherf4dec312013-07-08 12:15:11 -04001955 .vblank_too_short = &ni_dpm_vblank_too_short,
Alex Deucher5e8150a2015-01-07 15:29:06 -05001956 .fan_ctrl_set_mode = &si_fan_ctrl_set_mode,
1957 .fan_ctrl_get_mode = &si_fan_ctrl_get_mode,
1958 .get_fan_speed_percent = &si_fan_ctrl_get_fan_speed_percent,
1959 .set_fan_speed_percent = &si_fan_ctrl_set_fan_speed_percent,
Alex Deuchera9e61412013-06-25 17:56:16 -04001960 },
Alex Deucher02779c02012-03-20 17:18:25 -04001961 .pflip = {
Alex Deucher02779c02012-03-20 17:18:25 -04001962 .page_flip = &evergreen_page_flip,
Christian König157fa142014-05-27 16:49:20 +02001963 .page_flip_pending = &evergreen_page_flip_pending,
Alex Deucher02779c02012-03-20 17:18:25 -04001964 },
1965};
1966
Christian König76a0df82013-08-13 11:56:50 +02001967static struct radeon_asic_ring ci_gfx_ring = {
1968 .ib_execute = &cik_ring_ib_execute,
1969 .ib_parse = &cik_ib_parse,
1970 .emit_fence = &cik_fence_gfx_ring_emit,
1971 .emit_semaphore = &cik_semaphore_ring_emit,
1972 .cs_parse = NULL,
1973 .ring_test = &cik_ring_test,
1974 .ib_test = &cik_ib_test,
1975 .is_lockup = &cik_gfx_is_lockup,
1976 .vm_flush = &cik_vm_flush,
Alex Deucherea31bf62013-12-09 19:44:30 -05001977 .get_rptr = &cik_gfx_get_rptr,
1978 .get_wptr = &cik_gfx_get_wptr,
1979 .set_wptr = &cik_gfx_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001980};
1981
1982static struct radeon_asic_ring ci_cp_ring = {
1983 .ib_execute = &cik_ring_ib_execute,
1984 .ib_parse = &cik_ib_parse,
1985 .emit_fence = &cik_fence_compute_ring_emit,
1986 .emit_semaphore = &cik_semaphore_ring_emit,
1987 .cs_parse = NULL,
1988 .ring_test = &cik_ring_test,
1989 .ib_test = &cik_ib_test,
1990 .is_lockup = &cik_gfx_is_lockup,
1991 .vm_flush = &cik_vm_flush,
Alex Deucherea31bf62013-12-09 19:44:30 -05001992 .get_rptr = &cik_compute_get_rptr,
1993 .get_wptr = &cik_compute_get_wptr,
1994 .set_wptr = &cik_compute_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001995};
1996
1997static struct radeon_asic_ring ci_dma_ring = {
1998 .ib_execute = &cik_sdma_ring_ib_execute,
1999 .ib_parse = &cik_ib_parse,
2000 .emit_fence = &cik_sdma_fence_ring_emit,
2001 .emit_semaphore = &cik_sdma_semaphore_ring_emit,
2002 .cs_parse = NULL,
2003 .ring_test = &cik_sdma_ring_test,
2004 .ib_test = &cik_sdma_ib_test,
2005 .is_lockup = &cik_sdma_is_lockup,
2006 .vm_flush = &cik_dma_vm_flush,
Alex Deucherea31bf62013-12-09 19:44:30 -05002007 .get_rptr = &cik_sdma_get_rptr,
2008 .get_wptr = &cik_sdma_get_wptr,
2009 .set_wptr = &cik_sdma_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02002010};
2011
Christian Königd93f7932013-05-23 12:10:04 +02002012static struct radeon_asic_ring ci_vce_ring = {
2013 .ib_execute = &radeon_vce_ib_execute,
2014 .emit_fence = &radeon_vce_fence_emit,
2015 .emit_semaphore = &radeon_vce_semaphore_emit,
2016 .cs_parse = &radeon_vce_cs_parse,
2017 .ring_test = &radeon_vce_ring_test,
2018 .ib_test = &radeon_vce_ib_test,
2019 .is_lockup = &radeon_ring_test_lockup,
2020 .get_rptr = &vce_v1_0_get_rptr,
2021 .get_wptr = &vce_v1_0_get_wptr,
2022 .set_wptr = &vce_v1_0_set_wptr,
2023};
2024
Alex Deucher0672e272013-04-09 16:22:31 -04002025static struct radeon_asic ci_asic = {
2026 .init = &cik_init,
2027 .fini = &cik_fini,
2028 .suspend = &cik_suspend,
2029 .resume = &cik_resume,
2030 .asic_reset = &cik_asic_reset,
2031 .vga_set_state = &r600_vga_set_state,
Michel Dänzer72a99872014-07-31 18:43:49 +09002032 .mmio_hdp_flush = &r600_mmio_hdp_flush,
Alex Deucher0672e272013-04-09 16:22:31 -04002033 .gui_idle = &r600_gui_idle,
2034 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
2035 .get_xclk = &cik_get_xclk,
2036 .get_gpu_clock_counter = &cik_get_gpu_clock_counter,
2037 .gart = {
2038 .tlb_flush = &cik_pcie_gart_tlb_flush,
2039 .set_page = &rs600_gart_set_page,
2040 },
2041 .vm = {
2042 .init = &cik_vm_init,
2043 .fini = &cik_vm_fini,
Christian König03f62ab2014-07-30 21:05:17 +02002044 .copy_pages = &cik_sdma_vm_copy_pages,
2045 .write_pages = &cik_sdma_vm_write_pages,
2046 .set_pages = &cik_sdma_vm_set_pages,
2047 .pad_ib = &cik_sdma_vm_pad_ib,
Alex Deucher0672e272013-04-09 16:22:31 -04002048 },
2049 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02002050 [RADEON_RING_TYPE_GFX_INDEX] = &ci_gfx_ring,
2051 [CAYMAN_RING_TYPE_CP1_INDEX] = &ci_cp_ring,
2052 [CAYMAN_RING_TYPE_CP2_INDEX] = &ci_cp_ring,
2053 [R600_RING_TYPE_DMA_INDEX] = &ci_dma_ring,
2054 [CAYMAN_RING_TYPE_DMA1_INDEX] = &ci_dma_ring,
2055 [R600_RING_TYPE_UVD_INDEX] = &cayman_uvd_ring,
Christian Königd93f7932013-05-23 12:10:04 +02002056 [TN_RING_TYPE_VCE1_INDEX] = &ci_vce_ring,
2057 [TN_RING_TYPE_VCE2_INDEX] = &ci_vce_ring,
Alex Deucher0672e272013-04-09 16:22:31 -04002058 },
2059 .irq = {
2060 .set = &cik_irq_set,
2061 .process = &cik_irq_process,
2062 },
2063 .display = {
2064 .bandwidth_update = &dce8_bandwidth_update,
2065 .get_vblank_counter = &evergreen_get_vblank_counter,
2066 .wait_for_vblank = &dce4_wait_for_vblank,
Samuel Li7272c9d2013-11-19 15:04:45 -05002067 .set_backlight_level = &atombios_set_backlight_level,
2068 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherb5306022013-07-31 16:51:33 -04002069 .hdmi_enable = &evergreen_hdmi_enable,
2070 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucher0672e272013-04-09 16:22:31 -04002071 },
2072 .copy = {
Alex Deucher78196782013-12-09 17:38:51 -05002073 .blit = &cik_copy_cpdma,
Alex Deucher0672e272013-04-09 16:22:31 -04002074 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
2075 .dma = &cik_copy_dma,
2076 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Christian Königb5be1a82014-06-04 15:29:58 +02002077 .copy = &cik_copy_dma,
2078 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher0672e272013-04-09 16:22:31 -04002079 },
2080 .surface = {
2081 .set_reg = r600_set_surface_reg,
2082 .clear_reg = r600_clear_surface_reg,
2083 },
2084 .hpd = {
2085 .init = &evergreen_hpd_init,
2086 .fini = &evergreen_hpd_fini,
2087 .sense = &evergreen_hpd_sense,
2088 .set_polarity = &evergreen_hpd_set_polarity,
2089 },
2090 .pm = {
2091 .misc = &evergreen_pm_misc,
2092 .prepare = &evergreen_pm_prepare,
2093 .finish = &evergreen_pm_finish,
2094 .init_profile = &sumo_pm_init_profile,
2095 .get_dynpm_state = &r600_pm_get_dynpm_state,
2096 .get_engine_clock = &radeon_atom_get_engine_clock,
2097 .set_engine_clock = &radeon_atom_set_engine_clock,
2098 .get_memory_clock = &radeon_atom_get_memory_clock,
2099 .set_memory_clock = &radeon_atom_set_memory_clock,
2100 .get_pcie_lanes = NULL,
2101 .set_pcie_lanes = NULL,
2102 .set_clock_gating = NULL,
2103 .set_uvd_clocks = &cik_set_uvd_clocks,
Alex Deucher5ad6bf92013-08-22 17:09:06 -04002104 .set_vce_clocks = &cik_set_vce_clocks,
Alex Deucher286d9cc2013-06-21 15:50:47 -04002105 .get_temperature = &ci_get_temp,
Alex Deucher0672e272013-04-09 16:22:31 -04002106 },
Alex Deuchercc8dbbb2013-08-14 01:03:41 -04002107 .dpm = {
2108 .init = &ci_dpm_init,
2109 .setup_asic = &ci_dpm_setup_asic,
2110 .enable = &ci_dpm_enable,
Alex Deucher90208422013-12-19 13:59:46 -05002111 .late_enable = &ci_dpm_late_enable,
Alex Deuchercc8dbbb2013-08-14 01:03:41 -04002112 .disable = &ci_dpm_disable,
2113 .pre_set_power_state = &ci_dpm_pre_set_power_state,
2114 .set_power_state = &ci_dpm_set_power_state,
2115 .post_set_power_state = &ci_dpm_post_set_power_state,
2116 .display_configuration_changed = &ci_dpm_display_configuration_changed,
2117 .fini = &ci_dpm_fini,
2118 .get_sclk = &ci_dpm_get_sclk,
2119 .get_mclk = &ci_dpm_get_mclk,
2120 .print_power_state = &ci_dpm_print_power_state,
Alex Deucher94b4adc2013-07-15 17:34:33 -04002121 .debugfs_print_current_performance_level = &ci_dpm_debugfs_print_current_performance_level,
Alex Deucher89536fd2013-07-15 18:14:24 -04002122 .force_performance_level = &ci_dpm_force_performance_level,
Alex Deucher54961312013-07-15 18:24:31 -04002123 .vblank_too_short = &ci_dpm_vblank_too_short,
Alex Deucher942bdf72013-08-09 10:05:24 -04002124 .powergate_uvd = &ci_dpm_powergate_uvd,
Oleg Chernovskiy36689e52014-12-08 00:10:46 +03002125 .fan_ctrl_set_mode = &ci_fan_ctrl_set_mode,
2126 .fan_ctrl_get_mode = &ci_fan_ctrl_get_mode,
2127 .get_fan_speed_percent = &ci_fan_ctrl_get_fan_speed_percent,
2128 .set_fan_speed_percent = &ci_fan_ctrl_set_fan_speed_percent,
Alex Deuchercc8dbbb2013-08-14 01:03:41 -04002129 },
Alex Deucher0672e272013-04-09 16:22:31 -04002130 .pflip = {
Alex Deucher0672e272013-04-09 16:22:31 -04002131 .page_flip = &evergreen_page_flip,
Christian König157fa142014-05-27 16:49:20 +02002132 .page_flip_pending = &evergreen_page_flip_pending,
Alex Deucher0672e272013-04-09 16:22:31 -04002133 },
2134};
2135
2136static struct radeon_asic kv_asic = {
2137 .init = &cik_init,
2138 .fini = &cik_fini,
2139 .suspend = &cik_suspend,
2140 .resume = &cik_resume,
2141 .asic_reset = &cik_asic_reset,
2142 .vga_set_state = &r600_vga_set_state,
Michel Dänzer72a99872014-07-31 18:43:49 +09002143 .mmio_hdp_flush = &r600_mmio_hdp_flush,
Alex Deucher0672e272013-04-09 16:22:31 -04002144 .gui_idle = &r600_gui_idle,
2145 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
2146 .get_xclk = &cik_get_xclk,
2147 .get_gpu_clock_counter = &cik_get_gpu_clock_counter,
2148 .gart = {
2149 .tlb_flush = &cik_pcie_gart_tlb_flush,
2150 .set_page = &rs600_gart_set_page,
2151 },
2152 .vm = {
2153 .init = &cik_vm_init,
2154 .fini = &cik_vm_fini,
Christian König03f62ab2014-07-30 21:05:17 +02002155 .copy_pages = &cik_sdma_vm_copy_pages,
2156 .write_pages = &cik_sdma_vm_write_pages,
2157 .set_pages = &cik_sdma_vm_set_pages,
2158 .pad_ib = &cik_sdma_vm_pad_ib,
Alex Deucher0672e272013-04-09 16:22:31 -04002159 },
2160 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02002161 [RADEON_RING_TYPE_GFX_INDEX] = &ci_gfx_ring,
2162 [CAYMAN_RING_TYPE_CP1_INDEX] = &ci_cp_ring,
2163 [CAYMAN_RING_TYPE_CP2_INDEX] = &ci_cp_ring,
2164 [R600_RING_TYPE_DMA_INDEX] = &ci_dma_ring,
2165 [CAYMAN_RING_TYPE_DMA1_INDEX] = &ci_dma_ring,
2166 [R600_RING_TYPE_UVD_INDEX] = &cayman_uvd_ring,
Christian Königd93f7932013-05-23 12:10:04 +02002167 [TN_RING_TYPE_VCE1_INDEX] = &ci_vce_ring,
2168 [TN_RING_TYPE_VCE2_INDEX] = &ci_vce_ring,
Alex Deucher0672e272013-04-09 16:22:31 -04002169 },
2170 .irq = {
2171 .set = &cik_irq_set,
2172 .process = &cik_irq_process,
2173 },
2174 .display = {
2175 .bandwidth_update = &dce8_bandwidth_update,
2176 .get_vblank_counter = &evergreen_get_vblank_counter,
2177 .wait_for_vblank = &dce4_wait_for_vblank,
Samuel Li7272c9d2013-11-19 15:04:45 -05002178 .set_backlight_level = &atombios_set_backlight_level,
2179 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherb5306022013-07-31 16:51:33 -04002180 .hdmi_enable = &evergreen_hdmi_enable,
2181 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucher0672e272013-04-09 16:22:31 -04002182 },
2183 .copy = {
Alex Deucher78196782013-12-09 17:38:51 -05002184 .blit = &cik_copy_cpdma,
Alex Deucher0672e272013-04-09 16:22:31 -04002185 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
2186 .dma = &cik_copy_dma,
2187 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
2188 .copy = &cik_copy_dma,
2189 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
2190 },
2191 .surface = {
2192 .set_reg = r600_set_surface_reg,
2193 .clear_reg = r600_clear_surface_reg,
2194 },
2195 .hpd = {
2196 .init = &evergreen_hpd_init,
2197 .fini = &evergreen_hpd_fini,
2198 .sense = &evergreen_hpd_sense,
2199 .set_polarity = &evergreen_hpd_set_polarity,
2200 },
2201 .pm = {
2202 .misc = &evergreen_pm_misc,
2203 .prepare = &evergreen_pm_prepare,
2204 .finish = &evergreen_pm_finish,
2205 .init_profile = &sumo_pm_init_profile,
2206 .get_dynpm_state = &r600_pm_get_dynpm_state,
2207 .get_engine_clock = &radeon_atom_get_engine_clock,
2208 .set_engine_clock = &radeon_atom_set_engine_clock,
2209 .get_memory_clock = &radeon_atom_get_memory_clock,
2210 .set_memory_clock = &radeon_atom_set_memory_clock,
2211 .get_pcie_lanes = NULL,
2212 .set_pcie_lanes = NULL,
2213 .set_clock_gating = NULL,
2214 .set_uvd_clocks = &cik_set_uvd_clocks,
Alex Deucher5ad6bf92013-08-22 17:09:06 -04002215 .set_vce_clocks = &cik_set_vce_clocks,
Alex Deucher286d9cc2013-06-21 15:50:47 -04002216 .get_temperature = &kv_get_temp,
Alex Deucher0672e272013-04-09 16:22:31 -04002217 },
Alex Deucher41a524a2013-08-14 01:01:40 -04002218 .dpm = {
2219 .init = &kv_dpm_init,
2220 .setup_asic = &kv_dpm_setup_asic,
2221 .enable = &kv_dpm_enable,
Alex Deucherd8852c32013-12-19 14:03:36 -05002222 .late_enable = &kv_dpm_late_enable,
Alex Deucher41a524a2013-08-14 01:01:40 -04002223 .disable = &kv_dpm_disable,
2224 .pre_set_power_state = &kv_dpm_pre_set_power_state,
2225 .set_power_state = &kv_dpm_set_power_state,
2226 .post_set_power_state = &kv_dpm_post_set_power_state,
2227 .display_configuration_changed = &kv_dpm_display_configuration_changed,
2228 .fini = &kv_dpm_fini,
2229 .get_sclk = &kv_dpm_get_sclk,
2230 .get_mclk = &kv_dpm_get_mclk,
2231 .print_power_state = &kv_dpm_print_power_state,
Alex Deucherae3e40e2013-07-18 16:39:53 -04002232 .debugfs_print_current_performance_level = &kv_dpm_debugfs_print_current_performance_level,
Alex Deucher2b4c8022013-07-18 16:48:46 -04002233 .force_performance_level = &kv_dpm_force_performance_level,
Alex Deucher77df5082013-08-09 10:02:40 -04002234 .powergate_uvd = &kv_dpm_powergate_uvd,
Alex Deucherb7a5ae92013-09-09 19:33:08 -04002235 .enable_bapm = &kv_dpm_enable_bapm,
Alex Deucher41a524a2013-08-14 01:01:40 -04002236 },
Alex Deucher0672e272013-04-09 16:22:31 -04002237 .pflip = {
Alex Deucher0672e272013-04-09 16:22:31 -04002238 .page_flip = &evergreen_page_flip,
Christian König157fa142014-05-27 16:49:20 +02002239 .page_flip_pending = &evergreen_page_flip_pending,
Alex Deucher0672e272013-04-09 16:22:31 -04002240 },
2241};
2242
Alex Deucherabf1dc62012-07-17 14:02:36 -04002243/**
2244 * radeon_asic_init - register asic specific callbacks
2245 *
2246 * @rdev: radeon device pointer
2247 *
2248 * Registers the appropriate asic specific callbacks for each
2249 * chip family. Also sets other asics specific info like the number
2250 * of crtcs and the register aperture accessors (all asics).
2251 * Returns 0 for success.
2252 */
Daniel Vetter0a10c852010-03-11 21:19:14 +00002253int radeon_asic_init(struct radeon_device *rdev)
2254{
2255 radeon_register_accessor_init(rdev);
Alex Deucherba7e05e2011-06-16 18:14:22 +00002256
2257 /* set the number of crtcs */
2258 if (rdev->flags & RADEON_SINGLE_CRTC)
2259 rdev->num_crtc = 1;
2260 else
2261 rdev->num_crtc = 2;
2262
Alex Deucher948bee32013-05-14 12:08:35 -04002263 rdev->has_uvd = false;
2264
Daniel Vetter0a10c852010-03-11 21:19:14 +00002265 switch (rdev->family) {
2266 case CHIP_R100:
2267 case CHIP_RV100:
2268 case CHIP_RS100:
2269 case CHIP_RV200:
2270 case CHIP_RS200:
2271 rdev->asic = &r100_asic;
2272 break;
2273 case CHIP_R200:
2274 case CHIP_RV250:
2275 case CHIP_RS300:
2276 case CHIP_RV280:
2277 rdev->asic = &r200_asic;
2278 break;
2279 case CHIP_R300:
2280 case CHIP_R350:
2281 case CHIP_RV350:
2282 case CHIP_RV380:
2283 if (rdev->flags & RADEON_IS_PCIE)
2284 rdev->asic = &r300_asic_pcie;
2285 else
2286 rdev->asic = &r300_asic;
2287 break;
2288 case CHIP_R420:
2289 case CHIP_R423:
2290 case CHIP_RV410:
2291 rdev->asic = &r420_asic;
Alex Deucher07bb0842010-06-22 21:58:26 -04002292 /* handle macs */
2293 if (rdev->bios == NULL) {
Alex Deucher798bcf72012-02-23 17:53:48 -05002294 rdev->asic->pm.get_engine_clock = &radeon_legacy_get_engine_clock;
2295 rdev->asic->pm.set_engine_clock = &radeon_legacy_set_engine_clock;
2296 rdev->asic->pm.get_memory_clock = &radeon_legacy_get_memory_clock;
2297 rdev->asic->pm.set_memory_clock = NULL;
Alex Deucher37e9b6a2012-08-03 11:39:43 -04002298 rdev->asic->display.set_backlight_level = &radeon_legacy_set_backlight_level;
Alex Deucher07bb0842010-06-22 21:58:26 -04002299 }
Daniel Vetter0a10c852010-03-11 21:19:14 +00002300 break;
2301 case CHIP_RS400:
2302 case CHIP_RS480:
2303 rdev->asic = &rs400_asic;
2304 break;
2305 case CHIP_RS600:
2306 rdev->asic = &rs600_asic;
2307 break;
2308 case CHIP_RS690:
2309 case CHIP_RS740:
2310 rdev->asic = &rs690_asic;
2311 break;
2312 case CHIP_RV515:
2313 rdev->asic = &rv515_asic;
2314 break;
2315 case CHIP_R520:
2316 case CHIP_RV530:
2317 case CHIP_RV560:
2318 case CHIP_RV570:
2319 case CHIP_R580:
2320 rdev->asic = &r520_asic;
2321 break;
2322 case CHIP_R600:
Alex Deucherca361b62013-06-21 14:42:08 -04002323 rdev->asic = &r600_asic;
2324 break;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002325 case CHIP_RV610:
2326 case CHIP_RV630:
2327 case CHIP_RV620:
2328 case CHIP_RV635:
2329 case CHIP_RV670:
Alex Deucherca361b62013-06-21 14:42:08 -04002330 rdev->asic = &rv6xx_asic;
2331 rdev->has_uvd = true;
Alex Deucherf47299c2010-03-16 20:54:38 -04002332 break;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002333 case CHIP_RS780:
2334 case CHIP_RS880:
Alex Deucherf47299c2010-03-16 20:54:38 -04002335 rdev->asic = &rs780_asic;
Alex Deucherbdc99722014-08-26 13:11:36 -04002336 /* 760G/780V/880V don't have UVD */
2337 if ((rdev->pdev->device == 0x9616)||
2338 (rdev->pdev->device == 0x9611)||
2339 (rdev->pdev->device == 0x9613)||
2340 (rdev->pdev->device == 0x9711)||
2341 (rdev->pdev->device == 0x9713))
2342 rdev->has_uvd = false;
2343 else
2344 rdev->has_uvd = true;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002345 break;
2346 case CHIP_RV770:
2347 case CHIP_RV730:
2348 case CHIP_RV710:
2349 case CHIP_RV740:
2350 rdev->asic = &rv770_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002351 rdev->has_uvd = true;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002352 break;
2353 case CHIP_CEDAR:
2354 case CHIP_REDWOOD:
2355 case CHIP_JUNIPER:
2356 case CHIP_CYPRESS:
2357 case CHIP_HEMLOCK:
Alex Deucherba7e05e2011-06-16 18:14:22 +00002358 /* set num crtcs */
2359 if (rdev->family == CHIP_CEDAR)
2360 rdev->num_crtc = 4;
2361 else
2362 rdev->num_crtc = 6;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002363 rdev->asic = &evergreen_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002364 rdev->has_uvd = true;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002365 break;
Alex Deucher958261d2010-11-22 17:56:30 -05002366 case CHIP_PALM:
Alex Deucher89da5a32011-05-31 15:42:47 -04002367 case CHIP_SUMO:
2368 case CHIP_SUMO2:
Alex Deucher958261d2010-11-22 17:56:30 -05002369 rdev->asic = &sumo_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002370 rdev->has_uvd = true;
Alex Deucher958261d2010-11-22 17:56:30 -05002371 break;
Alex Deuchera43b7662011-01-06 21:19:33 -05002372 case CHIP_BARTS:
2373 case CHIP_TURKS:
2374 case CHIP_CAICOS:
Alex Deucherba7e05e2011-06-16 18:14:22 +00002375 /* set num crtcs */
2376 if (rdev->family == CHIP_CAICOS)
2377 rdev->num_crtc = 4;
2378 else
2379 rdev->num_crtc = 6;
Alex Deuchera43b7662011-01-06 21:19:33 -05002380 rdev->asic = &btc_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002381 rdev->has_uvd = true;
Alex Deuchera43b7662011-01-06 21:19:33 -05002382 break;
Alex Deuchere3487622011-03-02 20:07:36 -05002383 case CHIP_CAYMAN:
2384 rdev->asic = &cayman_asic;
Alex Deucherba7e05e2011-06-16 18:14:22 +00002385 /* set num crtcs */
2386 rdev->num_crtc = 6;
Alex Deucher948bee32013-05-14 12:08:35 -04002387 rdev->has_uvd = true;
Alex Deuchere3487622011-03-02 20:07:36 -05002388 break;
Alex Deucherbe63fe82012-03-20 17:18:40 -04002389 case CHIP_ARUBA:
2390 rdev->asic = &trinity_asic;
2391 /* set num crtcs */
2392 rdev->num_crtc = 4;
Alex Deucher948bee32013-05-14 12:08:35 -04002393 rdev->has_uvd = true;
Alex Deucherbe63fe82012-03-20 17:18:40 -04002394 break;
Alex Deucher02779c02012-03-20 17:18:25 -04002395 case CHIP_TAHITI:
2396 case CHIP_PITCAIRN:
2397 case CHIP_VERDE:
Alex Deuchere737a142012-08-30 14:00:03 -04002398 case CHIP_OLAND:
Alex Deucher86a45ca2012-07-26 19:04:20 -04002399 case CHIP_HAINAN:
Alex Deucher02779c02012-03-20 17:18:25 -04002400 rdev->asic = &si_asic;
2401 /* set num crtcs */
Alex Deucher86a45ca2012-07-26 19:04:20 -04002402 if (rdev->family == CHIP_HAINAN)
2403 rdev->num_crtc = 0;
2404 else if (rdev->family == CHIP_OLAND)
Alex Deuchere737a142012-08-30 14:00:03 -04002405 rdev->num_crtc = 2;
2406 else
2407 rdev->num_crtc = 6;
Alex Deucher948bee32013-05-14 12:08:35 -04002408 if (rdev->family == CHIP_HAINAN)
2409 rdev->has_uvd = false;
2410 else
2411 rdev->has_uvd = true;
Alex Deucher0116e1e2013-08-08 18:00:10 -04002412 switch (rdev->family) {
2413 case CHIP_TAHITI:
2414 rdev->cg_flags =
Alex Deucher090f4b62013-08-14 18:53:56 -04002415 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher0116e1e2013-08-08 18:00:10 -04002416 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deuchere16866e2013-08-08 19:34:07 -04002417 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
Alex Deucher0116e1e2013-08-08 18:00:10 -04002418 RADEON_CG_SUPPORT_GFX_CGLS |
2419 RADEON_CG_SUPPORT_GFX_CGTS |
2420 RADEON_CG_SUPPORT_GFX_CP_LS |
2421 RADEON_CG_SUPPORT_MC_MGCG |
2422 RADEON_CG_SUPPORT_SDMA_MGCG |
2423 RADEON_CG_SUPPORT_BIF_LS |
2424 RADEON_CG_SUPPORT_VCE_MGCG |
2425 RADEON_CG_SUPPORT_UVD_MGCG |
2426 RADEON_CG_SUPPORT_HDP_LS |
2427 RADEON_CG_SUPPORT_HDP_MGCG;
2428 rdev->pg_flags = 0;
2429 break;
2430 case CHIP_PITCAIRN:
2431 rdev->cg_flags =
Alex Deucher090f4b62013-08-14 18:53:56 -04002432 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher0116e1e2013-08-08 18:00:10 -04002433 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deuchere16866e2013-08-08 19:34:07 -04002434 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
Alex Deucher0116e1e2013-08-08 18:00:10 -04002435 RADEON_CG_SUPPORT_GFX_CGLS |
2436 RADEON_CG_SUPPORT_GFX_CGTS |
2437 RADEON_CG_SUPPORT_GFX_CP_LS |
2438 RADEON_CG_SUPPORT_GFX_RLC_LS |
2439 RADEON_CG_SUPPORT_MC_LS |
2440 RADEON_CG_SUPPORT_MC_MGCG |
2441 RADEON_CG_SUPPORT_SDMA_MGCG |
2442 RADEON_CG_SUPPORT_BIF_LS |
2443 RADEON_CG_SUPPORT_VCE_MGCG |
2444 RADEON_CG_SUPPORT_UVD_MGCG |
2445 RADEON_CG_SUPPORT_HDP_LS |
2446 RADEON_CG_SUPPORT_HDP_MGCG;
2447 rdev->pg_flags = 0;
2448 break;
2449 case CHIP_VERDE:
2450 rdev->cg_flags =
Alex Deucher090f4b62013-08-14 18:53:56 -04002451 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher0116e1e2013-08-08 18:00:10 -04002452 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deuchere16866e2013-08-08 19:34:07 -04002453 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
Alex Deucher0116e1e2013-08-08 18:00:10 -04002454 RADEON_CG_SUPPORT_GFX_CGLS |
2455 RADEON_CG_SUPPORT_GFX_CGTS |
2456 RADEON_CG_SUPPORT_GFX_CP_LS |
2457 RADEON_CG_SUPPORT_GFX_RLC_LS |
2458 RADEON_CG_SUPPORT_MC_LS |
2459 RADEON_CG_SUPPORT_MC_MGCG |
2460 RADEON_CG_SUPPORT_SDMA_MGCG |
2461 RADEON_CG_SUPPORT_BIF_LS |
2462 RADEON_CG_SUPPORT_VCE_MGCG |
2463 RADEON_CG_SUPPORT_UVD_MGCG |
2464 RADEON_CG_SUPPORT_HDP_LS |
2465 RADEON_CG_SUPPORT_HDP_MGCG;
Alex Deucherca6ebb32013-08-13 13:18:37 -04002466 rdev->pg_flags = 0 |
Alex Deucher2b19d172013-09-04 16:58:29 -04002467 /*RADEON_PG_SUPPORT_GFX_PG | */
Alex Deucherca6ebb32013-08-13 13:18:37 -04002468 RADEON_PG_SUPPORT_SDMA;
Alex Deucher0116e1e2013-08-08 18:00:10 -04002469 break;
2470 case CHIP_OLAND:
2471 rdev->cg_flags =
Alex Deucher090f4b62013-08-14 18:53:56 -04002472 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher0116e1e2013-08-08 18:00:10 -04002473 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deuchere16866e2013-08-08 19:34:07 -04002474 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
Alex Deucher0116e1e2013-08-08 18:00:10 -04002475 RADEON_CG_SUPPORT_GFX_CGLS |
2476 RADEON_CG_SUPPORT_GFX_CGTS |
2477 RADEON_CG_SUPPORT_GFX_CP_LS |
2478 RADEON_CG_SUPPORT_GFX_RLC_LS |
2479 RADEON_CG_SUPPORT_MC_LS |
2480 RADEON_CG_SUPPORT_MC_MGCG |
2481 RADEON_CG_SUPPORT_SDMA_MGCG |
2482 RADEON_CG_SUPPORT_BIF_LS |
2483 RADEON_CG_SUPPORT_UVD_MGCG |
2484 RADEON_CG_SUPPORT_HDP_LS |
2485 RADEON_CG_SUPPORT_HDP_MGCG;
2486 rdev->pg_flags = 0;
2487 break;
2488 case CHIP_HAINAN:
2489 rdev->cg_flags =
Alex Deucher090f4b62013-08-14 18:53:56 -04002490 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher0116e1e2013-08-08 18:00:10 -04002491 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deuchere16866e2013-08-08 19:34:07 -04002492 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
Alex Deucher0116e1e2013-08-08 18:00:10 -04002493 RADEON_CG_SUPPORT_GFX_CGLS |
2494 RADEON_CG_SUPPORT_GFX_CGTS |
2495 RADEON_CG_SUPPORT_GFX_CP_LS |
2496 RADEON_CG_SUPPORT_GFX_RLC_LS |
2497 RADEON_CG_SUPPORT_MC_LS |
2498 RADEON_CG_SUPPORT_MC_MGCG |
2499 RADEON_CG_SUPPORT_SDMA_MGCG |
2500 RADEON_CG_SUPPORT_BIF_LS |
2501 RADEON_CG_SUPPORT_HDP_LS |
2502 RADEON_CG_SUPPORT_HDP_MGCG;
2503 rdev->pg_flags = 0;
2504 break;
2505 default:
2506 rdev->cg_flags = 0;
2507 rdev->pg_flags = 0;
2508 break;
2509 }
Alex Deucher02779c02012-03-20 17:18:25 -04002510 break;
Alex Deucher0672e272013-04-09 16:22:31 -04002511 case CHIP_BONAIRE:
Alex Deucher41971b32013-08-19 18:02:26 -04002512 case CHIP_HAWAII:
Alex Deucher0672e272013-04-09 16:22:31 -04002513 rdev->asic = &ci_asic;
2514 rdev->num_crtc = 6;
Alex Deucher22c775c2013-07-23 09:41:05 -04002515 rdev->has_uvd = true;
Alex Deucher41971b32013-08-19 18:02:26 -04002516 if (rdev->family == CHIP_BONAIRE) {
2517 rdev->cg_flags =
2518 RADEON_CG_SUPPORT_GFX_MGCG |
2519 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deucher69609482014-06-26 18:36:24 -04002520 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
Alex Deucher41971b32013-08-19 18:02:26 -04002521 RADEON_CG_SUPPORT_GFX_CGLS |
2522 RADEON_CG_SUPPORT_GFX_CGTS |
2523 RADEON_CG_SUPPORT_GFX_CGTS_LS |
2524 RADEON_CG_SUPPORT_GFX_CP_LS |
2525 RADEON_CG_SUPPORT_MC_LS |
2526 RADEON_CG_SUPPORT_MC_MGCG |
2527 RADEON_CG_SUPPORT_SDMA_MGCG |
2528 RADEON_CG_SUPPORT_SDMA_LS |
2529 RADEON_CG_SUPPORT_BIF_LS |
2530 RADEON_CG_SUPPORT_VCE_MGCG |
2531 RADEON_CG_SUPPORT_UVD_MGCG |
2532 RADEON_CG_SUPPORT_HDP_LS |
2533 RADEON_CG_SUPPORT_HDP_MGCG;
2534 rdev->pg_flags = 0;
2535 } else {
2536 rdev->cg_flags =
2537 RADEON_CG_SUPPORT_GFX_MGCG |
2538 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deucher69609482014-06-26 18:36:24 -04002539 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
Alex Deucher41971b32013-08-19 18:02:26 -04002540 RADEON_CG_SUPPORT_GFX_CGLS |
2541 RADEON_CG_SUPPORT_GFX_CGTS |
2542 RADEON_CG_SUPPORT_GFX_CP_LS |
2543 RADEON_CG_SUPPORT_MC_LS |
2544 RADEON_CG_SUPPORT_MC_MGCG |
2545 RADEON_CG_SUPPORT_SDMA_MGCG |
2546 RADEON_CG_SUPPORT_SDMA_LS |
2547 RADEON_CG_SUPPORT_BIF_LS |
2548 RADEON_CG_SUPPORT_VCE_MGCG |
2549 RADEON_CG_SUPPORT_UVD_MGCG |
2550 RADEON_CG_SUPPORT_HDP_LS |
2551 RADEON_CG_SUPPORT_HDP_MGCG;
2552 rdev->pg_flags = 0;
2553 }
Alex Deucher0672e272013-04-09 16:22:31 -04002554 break;
2555 case CHIP_KAVERI:
2556 case CHIP_KABINI:
Samuel Lib0a9f222014-04-30 18:40:48 -04002557 case CHIP_MULLINS:
Alex Deucher0672e272013-04-09 16:22:31 -04002558 rdev->asic = &kv_asic;
2559 /* set num crtcs */
Alex Deucher473359b2013-08-09 11:18:39 -04002560 if (rdev->family == CHIP_KAVERI) {
Alex Deucher0672e272013-04-09 16:22:31 -04002561 rdev->num_crtc = 4;
Alex Deucher473359b2013-08-09 11:18:39 -04002562 rdev->cg_flags =
Alex Deucher773dc102013-08-14 18:58:43 -04002563 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher473359b2013-08-09 11:18:39 -04002564 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deucher69609482014-06-26 18:36:24 -04002565 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
Alex Deucher473359b2013-08-09 11:18:39 -04002566 RADEON_CG_SUPPORT_GFX_CGLS |
2567 RADEON_CG_SUPPORT_GFX_CGTS |
2568 RADEON_CG_SUPPORT_GFX_CGTS_LS |
2569 RADEON_CG_SUPPORT_GFX_CP_LS |
2570 RADEON_CG_SUPPORT_SDMA_MGCG |
2571 RADEON_CG_SUPPORT_SDMA_LS |
2572 RADEON_CG_SUPPORT_BIF_LS |
2573 RADEON_CG_SUPPORT_VCE_MGCG |
2574 RADEON_CG_SUPPORT_UVD_MGCG |
2575 RADEON_CG_SUPPORT_HDP_LS |
2576 RADEON_CG_SUPPORT_HDP_MGCG;
2577 rdev->pg_flags = 0;
Alex Deucher2b19d172013-09-04 16:58:29 -04002578 /*RADEON_PG_SUPPORT_GFX_PG |
Alex Deucher473359b2013-08-09 11:18:39 -04002579 RADEON_PG_SUPPORT_GFX_SMG |
2580 RADEON_PG_SUPPORT_GFX_DMG |
2581 RADEON_PG_SUPPORT_UVD |
2582 RADEON_PG_SUPPORT_VCE |
2583 RADEON_PG_SUPPORT_CP |
2584 RADEON_PG_SUPPORT_GDS |
2585 RADEON_PG_SUPPORT_RLC_SMU_HS |
2586 RADEON_PG_SUPPORT_ACP |
2587 RADEON_PG_SUPPORT_SAMU;*/
2588 } else {
Alex Deucher0672e272013-04-09 16:22:31 -04002589 rdev->num_crtc = 2;
Alex Deucher473359b2013-08-09 11:18:39 -04002590 rdev->cg_flags =
Alex Deucher773dc102013-08-14 18:58:43 -04002591 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher473359b2013-08-09 11:18:39 -04002592 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deucher69609482014-06-26 18:36:24 -04002593 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
Alex Deucher473359b2013-08-09 11:18:39 -04002594 RADEON_CG_SUPPORT_GFX_CGLS |
2595 RADEON_CG_SUPPORT_GFX_CGTS |
2596 RADEON_CG_SUPPORT_GFX_CGTS_LS |
2597 RADEON_CG_SUPPORT_GFX_CP_LS |
2598 RADEON_CG_SUPPORT_SDMA_MGCG |
2599 RADEON_CG_SUPPORT_SDMA_LS |
2600 RADEON_CG_SUPPORT_BIF_LS |
2601 RADEON_CG_SUPPORT_VCE_MGCG |
2602 RADEON_CG_SUPPORT_UVD_MGCG |
2603 RADEON_CG_SUPPORT_HDP_LS |
2604 RADEON_CG_SUPPORT_HDP_MGCG;
2605 rdev->pg_flags = 0;
Alex Deucher2b19d172013-09-04 16:58:29 -04002606 /*RADEON_PG_SUPPORT_GFX_PG |
Alex Deucher473359b2013-08-09 11:18:39 -04002607 RADEON_PG_SUPPORT_GFX_SMG |
2608 RADEON_PG_SUPPORT_UVD |
2609 RADEON_PG_SUPPORT_VCE |
2610 RADEON_PG_SUPPORT_CP |
2611 RADEON_PG_SUPPORT_GDS |
2612 RADEON_PG_SUPPORT_RLC_SMU_HS |
2613 RADEON_PG_SUPPORT_SAMU;*/
2614 }
Alex Deucher22c775c2013-07-23 09:41:05 -04002615 rdev->has_uvd = true;
Alex Deucher0672e272013-04-09 16:22:31 -04002616 break;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002617 default:
2618 /* FIXME: not supported yet */
2619 return -EINVAL;
2620 }
2621
2622 if (rdev->flags & RADEON_IS_IGP) {
Alex Deucher798bcf72012-02-23 17:53:48 -05002623 rdev->asic->pm.get_memory_clock = NULL;
2624 rdev->asic->pm.set_memory_clock = NULL;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002625 }
2626
Daniel Vetter0a10c852010-03-11 21:19:14 +00002627 return 0;
2628}
2629