blob: 34b9aa9e3c0603d52589ffc89f8885c9af9a733d [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,
Alex Deucher54e88e02012-02-23 18:10:29 -0500197 .ioctl_wait_idle = NULL,
198 .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,
Alex Deucher54e88e02012-02-23 18:10:29 -0500263 .ioctl_wait_idle = NULL,
264 .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
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000336static struct radeon_asic r300_asic = {
337 .init = &r300_init,
338 .fini = &r300_fini,
339 .suspend = &r300_suspend,
340 .resume = &r300_resume,
341 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000342 .asic_reset = &r300_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500343 .ioctl_wait_idle = NULL,
344 .gui_idle = &r100_gui_idle,
345 .mc_wait_for_idle = &r300_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500346 .gart = {
347 .tlb_flush = &r100_pci_gart_tlb_flush,
348 .set_page = &r100_pci_gart_set_page,
349 },
Christian König4c87bc22011-10-19 19:02:21 +0200350 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200351 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200352 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500353 .irq = {
354 .set = &r100_irq_set,
355 .process = &r100_irq_process,
356 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500357 .display = {
358 .bandwidth_update = &r100_bandwidth_update,
359 .get_vblank_counter = &r100_get_vblank_counter,
360 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400361 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400362 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500363 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500364 .copy = {
365 .blit = &r100_copy_blit,
366 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
367 .dma = &r200_copy_dma,
368 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
369 .copy = &r100_copy_blit,
370 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
371 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500372 .surface = {
373 .set_reg = r100_set_surface_reg,
374 .clear_reg = r100_clear_surface_reg,
375 },
Alex Deucher901ea572012-02-23 17:53:39 -0500376 .hpd = {
377 .init = &r100_hpd_init,
378 .fini = &r100_hpd_fini,
379 .sense = &r100_hpd_sense,
380 .set_polarity = &r100_hpd_set_polarity,
381 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500382 .pm = {
383 .misc = &r100_pm_misc,
384 .prepare = &r100_pm_prepare,
385 .finish = &r100_pm_finish,
386 .init_profile = &r100_pm_init_profile,
387 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500388 .get_engine_clock = &radeon_legacy_get_engine_clock,
389 .set_engine_clock = &radeon_legacy_set_engine_clock,
390 .get_memory_clock = &radeon_legacy_get_memory_clock,
391 .set_memory_clock = NULL,
392 .get_pcie_lanes = &rv370_get_pcie_lanes,
393 .set_pcie_lanes = &rv370_set_pcie_lanes,
394 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500395 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500396 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500397 .page_flip = &r100_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200398 .page_flip_pending = &r100_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500399 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000400};
401
402static struct radeon_asic r300_asic_pcie = {
403 .init = &r300_init,
404 .fini = &r300_fini,
405 .suspend = &r300_suspend,
406 .resume = &r300_resume,
407 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000408 .asic_reset = &r300_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500409 .ioctl_wait_idle = NULL,
410 .gui_idle = &r100_gui_idle,
411 .mc_wait_for_idle = &r300_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500412 .gart = {
413 .tlb_flush = &rv370_pcie_gart_tlb_flush,
414 .set_page = &rv370_pcie_gart_set_page,
415 },
Christian König4c87bc22011-10-19 19:02:21 +0200416 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200417 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200418 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500419 .irq = {
420 .set = &r100_irq_set,
421 .process = &r100_irq_process,
422 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500423 .display = {
424 .bandwidth_update = &r100_bandwidth_update,
425 .get_vblank_counter = &r100_get_vblank_counter,
426 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400427 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400428 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500429 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500430 .copy = {
431 .blit = &r100_copy_blit,
432 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
433 .dma = &r200_copy_dma,
434 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
435 .copy = &r100_copy_blit,
436 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
437 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500438 .surface = {
439 .set_reg = r100_set_surface_reg,
440 .clear_reg = r100_clear_surface_reg,
441 },
Alex Deucher901ea572012-02-23 17:53:39 -0500442 .hpd = {
443 .init = &r100_hpd_init,
444 .fini = &r100_hpd_fini,
445 .sense = &r100_hpd_sense,
446 .set_polarity = &r100_hpd_set_polarity,
447 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500448 .pm = {
449 .misc = &r100_pm_misc,
450 .prepare = &r100_pm_prepare,
451 .finish = &r100_pm_finish,
452 .init_profile = &r100_pm_init_profile,
453 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500454 .get_engine_clock = &radeon_legacy_get_engine_clock,
455 .set_engine_clock = &radeon_legacy_set_engine_clock,
456 .get_memory_clock = &radeon_legacy_get_memory_clock,
457 .set_memory_clock = NULL,
458 .get_pcie_lanes = &rv370_get_pcie_lanes,
459 .set_pcie_lanes = &rv370_set_pcie_lanes,
460 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500461 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500462 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500463 .page_flip = &r100_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200464 .page_flip_pending = &r100_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500465 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000466};
467
468static struct radeon_asic r420_asic = {
469 .init = &r420_init,
470 .fini = &r420_fini,
471 .suspend = &r420_suspend,
472 .resume = &r420_resume,
473 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000474 .asic_reset = &r300_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500475 .ioctl_wait_idle = NULL,
476 .gui_idle = &r100_gui_idle,
477 .mc_wait_for_idle = &r300_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500478 .gart = {
479 .tlb_flush = &rv370_pcie_gart_tlb_flush,
480 .set_page = &rv370_pcie_gart_set_page,
481 },
Christian König4c87bc22011-10-19 19:02:21 +0200482 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200483 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200484 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500485 .irq = {
486 .set = &r100_irq_set,
487 .process = &r100_irq_process,
488 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500489 .display = {
490 .bandwidth_update = &r100_bandwidth_update,
491 .get_vblank_counter = &r100_get_vblank_counter,
492 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400493 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400494 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500495 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500496 .copy = {
497 .blit = &r100_copy_blit,
498 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
499 .dma = &r200_copy_dma,
500 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
501 .copy = &r100_copy_blit,
502 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
503 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500504 .surface = {
505 .set_reg = r100_set_surface_reg,
506 .clear_reg = r100_clear_surface_reg,
507 },
Alex Deucher901ea572012-02-23 17:53:39 -0500508 .hpd = {
509 .init = &r100_hpd_init,
510 .fini = &r100_hpd_fini,
511 .sense = &r100_hpd_sense,
512 .set_polarity = &r100_hpd_set_polarity,
513 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500514 .pm = {
515 .misc = &r100_pm_misc,
516 .prepare = &r100_pm_prepare,
517 .finish = &r100_pm_finish,
518 .init_profile = &r420_pm_init_profile,
519 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500520 .get_engine_clock = &radeon_atom_get_engine_clock,
521 .set_engine_clock = &radeon_atom_set_engine_clock,
522 .get_memory_clock = &radeon_atom_get_memory_clock,
523 .set_memory_clock = &radeon_atom_set_memory_clock,
524 .get_pcie_lanes = &rv370_get_pcie_lanes,
525 .set_pcie_lanes = &rv370_set_pcie_lanes,
526 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500527 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500528 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500529 .page_flip = &r100_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200530 .page_flip_pending = &r100_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500531 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000532};
533
534static struct radeon_asic rs400_asic = {
535 .init = &rs400_init,
536 .fini = &rs400_fini,
537 .suspend = &rs400_suspend,
538 .resume = &rs400_resume,
539 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000540 .asic_reset = &r300_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500541 .ioctl_wait_idle = NULL,
542 .gui_idle = &r100_gui_idle,
543 .mc_wait_for_idle = &rs400_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500544 .gart = {
545 .tlb_flush = &rs400_gart_tlb_flush,
546 .set_page = &rs400_gart_set_page,
547 },
Christian König4c87bc22011-10-19 19:02:21 +0200548 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200549 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200550 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500551 .irq = {
552 .set = &r100_irq_set,
553 .process = &r100_irq_process,
554 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500555 .display = {
556 .bandwidth_update = &r100_bandwidth_update,
557 .get_vblank_counter = &r100_get_vblank_counter,
558 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400559 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400560 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500561 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500562 .copy = {
563 .blit = &r100_copy_blit,
564 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
565 .dma = &r200_copy_dma,
566 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
567 .copy = &r100_copy_blit,
568 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
569 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500570 .surface = {
571 .set_reg = r100_set_surface_reg,
572 .clear_reg = r100_clear_surface_reg,
573 },
Alex Deucher901ea572012-02-23 17:53:39 -0500574 .hpd = {
575 .init = &r100_hpd_init,
576 .fini = &r100_hpd_fini,
577 .sense = &r100_hpd_sense,
578 .set_polarity = &r100_hpd_set_polarity,
579 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500580 .pm = {
581 .misc = &r100_pm_misc,
582 .prepare = &r100_pm_prepare,
583 .finish = &r100_pm_finish,
584 .init_profile = &r100_pm_init_profile,
585 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500586 .get_engine_clock = &radeon_legacy_get_engine_clock,
587 .set_engine_clock = &radeon_legacy_set_engine_clock,
588 .get_memory_clock = &radeon_legacy_get_memory_clock,
589 .set_memory_clock = NULL,
590 .get_pcie_lanes = NULL,
591 .set_pcie_lanes = NULL,
592 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500593 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500594 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500595 .page_flip = &r100_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200596 .page_flip_pending = &r100_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500597 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000598};
599
600static struct radeon_asic rs600_asic = {
601 .init = &rs600_init,
602 .fini = &rs600_fini,
603 .suspend = &rs600_suspend,
604 .resume = &rs600_resume,
605 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000606 .asic_reset = &rs600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500607 .ioctl_wait_idle = NULL,
608 .gui_idle = &r100_gui_idle,
609 .mc_wait_for_idle = &rs600_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500610 .gart = {
611 .tlb_flush = &rs600_gart_tlb_flush,
612 .set_page = &rs600_gart_set_page,
613 },
Christian König4c87bc22011-10-19 19:02:21 +0200614 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200615 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200616 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500617 .irq = {
618 .set = &rs600_irq_set,
619 .process = &rs600_irq_process,
620 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500621 .display = {
622 .bandwidth_update = &rs600_bandwidth_update,
623 .get_vblank_counter = &rs600_get_vblank_counter,
624 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400625 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400626 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -0400627 .hdmi_enable = &r600_hdmi_enable,
628 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500629 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500630 .copy = {
631 .blit = &r100_copy_blit,
632 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
633 .dma = &r200_copy_dma,
634 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
635 .copy = &r100_copy_blit,
636 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
637 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500638 .surface = {
639 .set_reg = r100_set_surface_reg,
640 .clear_reg = r100_clear_surface_reg,
641 },
Alex Deucher901ea572012-02-23 17:53:39 -0500642 .hpd = {
643 .init = &rs600_hpd_init,
644 .fini = &rs600_hpd_fini,
645 .sense = &rs600_hpd_sense,
646 .set_polarity = &rs600_hpd_set_polarity,
647 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500648 .pm = {
649 .misc = &rs600_pm_misc,
650 .prepare = &rs600_pm_prepare,
651 .finish = &rs600_pm_finish,
652 .init_profile = &r420_pm_init_profile,
653 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500654 .get_engine_clock = &radeon_atom_get_engine_clock,
655 .set_engine_clock = &radeon_atom_set_engine_clock,
656 .get_memory_clock = &radeon_atom_get_memory_clock,
657 .set_memory_clock = &radeon_atom_set_memory_clock,
658 .get_pcie_lanes = NULL,
659 .set_pcie_lanes = NULL,
660 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500661 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500662 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500663 .page_flip = &rs600_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200664 .page_flip_pending = &rs600_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500665 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000666};
667
668static struct radeon_asic rs690_asic = {
669 .init = &rs690_init,
670 .fini = &rs690_fini,
671 .suspend = &rs690_suspend,
672 .resume = &rs690_resume,
673 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000674 .asic_reset = &rs600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500675 .ioctl_wait_idle = NULL,
676 .gui_idle = &r100_gui_idle,
677 .mc_wait_for_idle = &rs690_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500678 .gart = {
679 .tlb_flush = &rs400_gart_tlb_flush,
680 .set_page = &rs400_gart_set_page,
681 },
Christian König4c87bc22011-10-19 19:02:21 +0200682 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200683 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200684 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500685 .irq = {
686 .set = &rs600_irq_set,
687 .process = &rs600_irq_process,
688 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500689 .display = {
690 .get_vblank_counter = &rs600_get_vblank_counter,
691 .bandwidth_update = &rs690_bandwidth_update,
692 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400693 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400694 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -0400695 .hdmi_enable = &r600_hdmi_enable,
696 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500697 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500698 .copy = {
699 .blit = &r100_copy_blit,
700 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
701 .dma = &r200_copy_dma,
702 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
703 .copy = &r200_copy_dma,
704 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
705 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500706 .surface = {
707 .set_reg = r100_set_surface_reg,
708 .clear_reg = r100_clear_surface_reg,
709 },
Alex Deucher901ea572012-02-23 17:53:39 -0500710 .hpd = {
711 .init = &rs600_hpd_init,
712 .fini = &rs600_hpd_fini,
713 .sense = &rs600_hpd_sense,
714 .set_polarity = &rs600_hpd_set_polarity,
715 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500716 .pm = {
717 .misc = &rs600_pm_misc,
718 .prepare = &rs600_pm_prepare,
719 .finish = &rs600_pm_finish,
720 .init_profile = &r420_pm_init_profile,
721 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500722 .get_engine_clock = &radeon_atom_get_engine_clock,
723 .set_engine_clock = &radeon_atom_set_engine_clock,
724 .get_memory_clock = &radeon_atom_get_memory_clock,
725 .set_memory_clock = &radeon_atom_set_memory_clock,
726 .get_pcie_lanes = NULL,
727 .set_pcie_lanes = NULL,
728 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500729 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500730 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500731 .page_flip = &rs600_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200732 .page_flip_pending = &rs600_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500733 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000734};
735
736static struct radeon_asic rv515_asic = {
737 .init = &rv515_init,
738 .fini = &rv515_fini,
739 .suspend = &rv515_suspend,
740 .resume = &rv515_resume,
741 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000742 .asic_reset = &rs600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500743 .ioctl_wait_idle = NULL,
744 .gui_idle = &r100_gui_idle,
745 .mc_wait_for_idle = &rv515_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500746 .gart = {
747 .tlb_flush = &rv370_pcie_gart_tlb_flush,
748 .set_page = &rv370_pcie_gart_set_page,
749 },
Christian König4c87bc22011-10-19 19:02:21 +0200750 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200751 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200752 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500753 .irq = {
754 .set = &rs600_irq_set,
755 .process = &rs600_irq_process,
756 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500757 .display = {
758 .get_vblank_counter = &rs600_get_vblank_counter,
759 .bandwidth_update = &rv515_bandwidth_update,
760 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400761 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400762 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500763 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500764 .copy = {
765 .blit = &r100_copy_blit,
766 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
767 .dma = &r200_copy_dma,
768 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
769 .copy = &r100_copy_blit,
770 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
771 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500772 .surface = {
773 .set_reg = r100_set_surface_reg,
774 .clear_reg = r100_clear_surface_reg,
775 },
Alex Deucher901ea572012-02-23 17:53:39 -0500776 .hpd = {
777 .init = &rs600_hpd_init,
778 .fini = &rs600_hpd_fini,
779 .sense = &rs600_hpd_sense,
780 .set_polarity = &rs600_hpd_set_polarity,
781 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500782 .pm = {
783 .misc = &rs600_pm_misc,
784 .prepare = &rs600_pm_prepare,
785 .finish = &rs600_pm_finish,
786 .init_profile = &r420_pm_init_profile,
787 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500788 .get_engine_clock = &radeon_atom_get_engine_clock,
789 .set_engine_clock = &radeon_atom_set_engine_clock,
790 .get_memory_clock = &radeon_atom_get_memory_clock,
791 .set_memory_clock = &radeon_atom_set_memory_clock,
792 .get_pcie_lanes = &rv370_get_pcie_lanes,
793 .set_pcie_lanes = &rv370_set_pcie_lanes,
794 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500795 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500796 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500797 .page_flip = &rs600_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200798 .page_flip_pending = &rs600_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500799 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000800};
801
802static struct radeon_asic r520_asic = {
803 .init = &r520_init,
804 .fini = &rv515_fini,
805 .suspend = &rv515_suspend,
806 .resume = &r520_resume,
807 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000808 .asic_reset = &rs600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500809 .ioctl_wait_idle = NULL,
810 .gui_idle = &r100_gui_idle,
811 .mc_wait_for_idle = &r520_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500812 .gart = {
813 .tlb_flush = &rv370_pcie_gart_tlb_flush,
814 .set_page = &rv370_pcie_gart_set_page,
815 },
Christian König4c87bc22011-10-19 19:02:21 +0200816 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200817 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200818 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500819 .irq = {
820 .set = &rs600_irq_set,
821 .process = &rs600_irq_process,
822 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500823 .display = {
824 .bandwidth_update = &rv515_bandwidth_update,
825 .get_vblank_counter = &rs600_get_vblank_counter,
826 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400827 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400828 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500829 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500830 .copy = {
831 .blit = &r100_copy_blit,
832 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
833 .dma = &r200_copy_dma,
834 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
835 .copy = &r100_copy_blit,
836 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
837 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500838 .surface = {
839 .set_reg = r100_set_surface_reg,
840 .clear_reg = r100_clear_surface_reg,
841 },
Alex Deucher901ea572012-02-23 17:53:39 -0500842 .hpd = {
843 .init = &rs600_hpd_init,
844 .fini = &rs600_hpd_fini,
845 .sense = &rs600_hpd_sense,
846 .set_polarity = &rs600_hpd_set_polarity,
847 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500848 .pm = {
849 .misc = &rs600_pm_misc,
850 .prepare = &rs600_pm_prepare,
851 .finish = &rs600_pm_finish,
852 .init_profile = &r420_pm_init_profile,
853 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500854 .get_engine_clock = &radeon_atom_get_engine_clock,
855 .set_engine_clock = &radeon_atom_set_engine_clock,
856 .get_memory_clock = &radeon_atom_get_memory_clock,
857 .set_memory_clock = &radeon_atom_set_memory_clock,
858 .get_pcie_lanes = &rv370_get_pcie_lanes,
859 .set_pcie_lanes = &rv370_set_pcie_lanes,
860 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500861 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500862 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500863 .page_flip = &rs600_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200864 .page_flip_pending = &rs600_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500865 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000866};
867
Christian König76a0df82013-08-13 11:56:50 +0200868static struct radeon_asic_ring r600_gfx_ring = {
869 .ib_execute = &r600_ring_ib_execute,
870 .emit_fence = &r600_fence_ring_emit,
871 .emit_semaphore = &r600_semaphore_ring_emit,
872 .cs_parse = &r600_cs_parse,
873 .ring_test = &r600_ring_test,
874 .ib_test = &r600_ib_test,
875 .is_lockup = &r600_gfx_is_lockup,
Alex Deucherea31bf62013-12-09 19:44:30 -0500876 .get_rptr = &r600_gfx_get_rptr,
877 .get_wptr = &r600_gfx_get_wptr,
878 .set_wptr = &r600_gfx_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +0200879};
880
881static struct radeon_asic_ring r600_dma_ring = {
882 .ib_execute = &r600_dma_ring_ib_execute,
883 .emit_fence = &r600_dma_fence_ring_emit,
884 .emit_semaphore = &r600_dma_semaphore_ring_emit,
885 .cs_parse = &r600_dma_cs_parse,
886 .ring_test = &r600_dma_ring_test,
887 .ib_test = &r600_dma_ib_test,
888 .is_lockup = &r600_dma_is_lockup,
Christian König2e1e6da2013-08-13 11:56:52 +0200889 .get_rptr = &r600_dma_get_rptr,
890 .get_wptr = &r600_dma_get_wptr,
891 .set_wptr = &r600_dma_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +0200892};
893
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000894static struct radeon_asic r600_asic = {
895 .init = &r600_init,
896 .fini = &r600_fini,
897 .suspend = &r600_suspend,
898 .resume = &r600_resume,
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000899 .vga_set_state = &r600_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000900 .asic_reset = &r600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -0500901 .ioctl_wait_idle = r600_ioctl_wait_idle,
902 .gui_idle = &r600_gui_idle,
903 .mc_wait_for_idle = &r600_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -0500904 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -0500905 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500906 .gart = {
907 .tlb_flush = &r600_pcie_gart_tlb_flush,
908 .set_page = &rs600_gart_set_page,
909 },
Christian König4c87bc22011-10-19 19:02:21 +0200910 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200911 [RADEON_RING_TYPE_GFX_INDEX] = &r600_gfx_ring,
912 [R600_RING_TYPE_DMA_INDEX] = &r600_dma_ring,
Christian König4c87bc22011-10-19 19:02:21 +0200913 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500914 .irq = {
915 .set = &r600_irq_set,
916 .process = &r600_irq_process,
917 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500918 .display = {
919 .bandwidth_update = &rv515_bandwidth_update,
920 .get_vblank_counter = &rs600_get_vblank_counter,
921 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400922 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400923 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -0400924 .hdmi_enable = &r600_hdmi_enable,
925 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500926 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500927 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -0400928 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -0500929 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher4d756582012-09-27 15:08:35 -0400930 .dma = &r600_copy_dma,
931 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucherbfea6a62013-07-11 14:53:34 -0400932 .copy = &r600_copy_cpdma,
Alex Deucheraeea40c2013-07-11 14:20:11 -0400933 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -0500934 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500935 .surface = {
936 .set_reg = r600_set_surface_reg,
937 .clear_reg = r600_clear_surface_reg,
938 },
Alex Deucher901ea572012-02-23 17:53:39 -0500939 .hpd = {
940 .init = &r600_hpd_init,
941 .fini = &r600_hpd_fini,
942 .sense = &r600_hpd_sense,
943 .set_polarity = &r600_hpd_set_polarity,
944 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500945 .pm = {
946 .misc = &r600_pm_misc,
947 .prepare = &rs600_pm_prepare,
948 .finish = &rs600_pm_finish,
949 .init_profile = &r600_pm_init_profile,
950 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500951 .get_engine_clock = &radeon_atom_get_engine_clock,
952 .set_engine_clock = &radeon_atom_set_engine_clock,
953 .get_memory_clock = &radeon_atom_get_memory_clock,
954 .set_memory_clock = &radeon_atom_set_memory_clock,
955 .get_pcie_lanes = &r600_get_pcie_lanes,
956 .set_pcie_lanes = &r600_set_pcie_lanes,
957 .set_clock_gating = NULL,
Alex Deucher6bd1c382013-06-21 14:38:03 -0400958 .get_temperature = &rv6xx_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -0500959 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500960 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500961 .page_flip = &rs600_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200962 .page_flip_pending = &rs600_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500963 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000964};
965
Alex Deucherca361b62013-06-21 14:42:08 -0400966static struct radeon_asic rv6xx_asic = {
967 .init = &r600_init,
968 .fini = &r600_fini,
969 .suspend = &r600_suspend,
970 .resume = &r600_resume,
971 .vga_set_state = &r600_vga_set_state,
972 .asic_reset = &r600_asic_reset,
973 .ioctl_wait_idle = r600_ioctl_wait_idle,
974 .gui_idle = &r600_gui_idle,
975 .mc_wait_for_idle = &r600_mc_wait_for_idle,
976 .get_xclk = &r600_get_xclk,
977 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
978 .gart = {
979 .tlb_flush = &r600_pcie_gart_tlb_flush,
980 .set_page = &rs600_gart_set_page,
981 },
982 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200983 [RADEON_RING_TYPE_GFX_INDEX] = &r600_gfx_ring,
984 [R600_RING_TYPE_DMA_INDEX] = &r600_dma_ring,
Alex Deucherca361b62013-06-21 14:42:08 -0400985 },
986 .irq = {
987 .set = &r600_irq_set,
988 .process = &r600_irq_process,
989 },
990 .display = {
991 .bandwidth_update = &rv515_bandwidth_update,
992 .get_vblank_counter = &rs600_get_vblank_counter,
993 .wait_for_vblank = &avivo_wait_for_vblank,
994 .set_backlight_level = &atombios_set_backlight_level,
995 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucher99d79aa2013-09-23 15:47:08 -0400996 .hdmi_enable = &r600_hdmi_enable,
997 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherca361b62013-06-21 14:42:08 -0400998 },
999 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001000 .blit = &r600_copy_cpdma,
Alex Deucherca361b62013-06-21 14:42:08 -04001001 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
1002 .dma = &r600_copy_dma,
1003 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucherbfea6a62013-07-11 14:53:34 -04001004 .copy = &r600_copy_cpdma,
Alex Deucheraeea40c2013-07-11 14:20:11 -04001005 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucherca361b62013-06-21 14:42:08 -04001006 },
1007 .surface = {
1008 .set_reg = r600_set_surface_reg,
1009 .clear_reg = r600_clear_surface_reg,
1010 },
1011 .hpd = {
1012 .init = &r600_hpd_init,
1013 .fini = &r600_hpd_fini,
1014 .sense = &r600_hpd_sense,
1015 .set_polarity = &r600_hpd_set_polarity,
1016 },
1017 .pm = {
1018 .misc = &r600_pm_misc,
1019 .prepare = &rs600_pm_prepare,
1020 .finish = &rs600_pm_finish,
1021 .init_profile = &r600_pm_init_profile,
1022 .get_dynpm_state = &r600_pm_get_dynpm_state,
1023 .get_engine_clock = &radeon_atom_get_engine_clock,
1024 .set_engine_clock = &radeon_atom_set_engine_clock,
1025 .get_memory_clock = &radeon_atom_get_memory_clock,
1026 .set_memory_clock = &radeon_atom_set_memory_clock,
1027 .get_pcie_lanes = &r600_get_pcie_lanes,
1028 .set_pcie_lanes = &r600_set_pcie_lanes,
1029 .set_clock_gating = NULL,
1030 .get_temperature = &rv6xx_get_temp,
Alex Deucher1b9ba702013-09-05 09:52:37 -04001031 .set_uvd_clocks = &r600_set_uvd_clocks,
Alex Deucherca361b62013-06-21 14:42:08 -04001032 },
Alex Deucher4a6369e2013-04-12 14:04:10 -04001033 .dpm = {
1034 .init = &rv6xx_dpm_init,
1035 .setup_asic = &rv6xx_setup_asic,
1036 .enable = &rv6xx_dpm_enable,
Alex Deuchera4643ba2013-12-19 12:18:13 -05001037 .late_enable = &r600_dpm_late_enable,
Alex Deucher4a6369e2013-04-12 14:04:10 -04001038 .disable = &rv6xx_dpm_disable,
Alex Deucher98243912013-01-16 13:13:42 -05001039 .pre_set_power_state = &r600_dpm_pre_set_power_state,
Alex Deucher4a6369e2013-04-12 14:04:10 -04001040 .set_power_state = &rv6xx_dpm_set_power_state,
Alex Deucher98243912013-01-16 13:13:42 -05001041 .post_set_power_state = &r600_dpm_post_set_power_state,
Alex Deucher4a6369e2013-04-12 14:04:10 -04001042 .display_configuration_changed = &rv6xx_dpm_display_configuration_changed,
1043 .fini = &rv6xx_dpm_fini,
1044 .get_sclk = &rv6xx_dpm_get_sclk,
1045 .get_mclk = &rv6xx_dpm_get_mclk,
1046 .print_power_state = &rv6xx_dpm_print_power_state,
Alex Deucher242916a2013-06-28 14:20:53 -04001047 .debugfs_print_current_performance_level = &rv6xx_dpm_debugfs_print_current_performance_level,
Alex Deucherf4f85a82013-07-25 20:07:25 -04001048 .force_performance_level = &rv6xx_dpm_force_performance_level,
Alex Deucher4a6369e2013-04-12 14:04:10 -04001049 },
Alex Deucherca361b62013-06-21 14:42:08 -04001050 .pflip = {
Alex Deucherca361b62013-06-21 14:42:08 -04001051 .page_flip = &rs600_page_flip,
Christian König157fa142014-05-27 16:49:20 +02001052 .page_flip_pending = &rs600_page_flip_pending,
Alex Deucherca361b62013-06-21 14:42:08 -04001053 },
1054};
1055
Alex Deucherf47299c2010-03-16 20:54:38 -04001056static struct radeon_asic rs780_asic = {
1057 .init = &r600_init,
1058 .fini = &r600_fini,
1059 .suspend = &r600_suspend,
1060 .resume = &r600_resume,
Alex Deucherf47299c2010-03-16 20:54:38 -04001061 .vga_set_state = &r600_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +00001062 .asic_reset = &r600_asic_reset,
Alex Deucher54e88e02012-02-23 18:10:29 -05001063 .ioctl_wait_idle = r600_ioctl_wait_idle,
1064 .gui_idle = &r600_gui_idle,
1065 .mc_wait_for_idle = &r600_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001066 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001067 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001068 .gart = {
1069 .tlb_flush = &r600_pcie_gart_tlb_flush,
1070 .set_page = &rs600_gart_set_page,
1071 },
Christian König4c87bc22011-10-19 19:02:21 +02001072 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001073 [RADEON_RING_TYPE_GFX_INDEX] = &r600_gfx_ring,
1074 [R600_RING_TYPE_DMA_INDEX] = &r600_dma_ring,
Christian König4c87bc22011-10-19 19:02:21 +02001075 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001076 .irq = {
1077 .set = &r600_irq_set,
1078 .process = &r600_irq_process,
1079 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001080 .display = {
1081 .bandwidth_update = &rs690_bandwidth_update,
1082 .get_vblank_counter = &rs600_get_vblank_counter,
1083 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001084 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001085 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001086 .hdmi_enable = &r600_hdmi_enable,
1087 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001088 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001089 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001090 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -05001091 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher4d756582012-09-27 15:08:35 -04001092 .dma = &r600_copy_dma,
1093 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucherbfea6a62013-07-11 14:53:34 -04001094 .copy = &r600_copy_cpdma,
Alex Deucheraeea40c2013-07-11 14:20:11 -04001095 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001096 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001097 .surface = {
1098 .set_reg = r600_set_surface_reg,
1099 .clear_reg = r600_clear_surface_reg,
1100 },
Alex Deucher901ea572012-02-23 17:53:39 -05001101 .hpd = {
1102 .init = &r600_hpd_init,
1103 .fini = &r600_hpd_fini,
1104 .sense = &r600_hpd_sense,
1105 .set_polarity = &r600_hpd_set_polarity,
1106 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001107 .pm = {
1108 .misc = &r600_pm_misc,
1109 .prepare = &rs600_pm_prepare,
1110 .finish = &rs600_pm_finish,
1111 .init_profile = &rs780_pm_init_profile,
1112 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001113 .get_engine_clock = &radeon_atom_get_engine_clock,
1114 .set_engine_clock = &radeon_atom_set_engine_clock,
1115 .get_memory_clock = NULL,
1116 .set_memory_clock = NULL,
1117 .get_pcie_lanes = NULL,
1118 .set_pcie_lanes = NULL,
1119 .set_clock_gating = NULL,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001120 .get_temperature = &rv6xx_get_temp,
Alex Deucher1b9ba702013-09-05 09:52:37 -04001121 .set_uvd_clocks = &r600_set_uvd_clocks,
Alex Deuchera02fa392012-02-23 17:53:41 -05001122 },
Alex Deucher9d670062013-04-12 13:59:22 -04001123 .dpm = {
1124 .init = &rs780_dpm_init,
1125 .setup_asic = &rs780_dpm_setup_asic,
1126 .enable = &rs780_dpm_enable,
Alex Deuchera4643ba2013-12-19 12:18:13 -05001127 .late_enable = &r600_dpm_late_enable,
Alex Deucher9d670062013-04-12 13:59:22 -04001128 .disable = &rs780_dpm_disable,
Alex Deucher98243912013-01-16 13:13:42 -05001129 .pre_set_power_state = &r600_dpm_pre_set_power_state,
Alex Deucher9d670062013-04-12 13:59:22 -04001130 .set_power_state = &rs780_dpm_set_power_state,
Alex Deucher98243912013-01-16 13:13:42 -05001131 .post_set_power_state = &r600_dpm_post_set_power_state,
Alex Deucher9d670062013-04-12 13:59:22 -04001132 .display_configuration_changed = &rs780_dpm_display_configuration_changed,
1133 .fini = &rs780_dpm_fini,
1134 .get_sclk = &rs780_dpm_get_sclk,
1135 .get_mclk = &rs780_dpm_get_mclk,
1136 .print_power_state = &rs780_dpm_print_power_state,
Alex Deucher444bddc2013-07-02 13:05:23 -04001137 .debugfs_print_current_performance_level = &rs780_dpm_debugfs_print_current_performance_level,
Anthoine Bourgeois63580c32013-09-03 13:52:19 -04001138 .force_performance_level = &rs780_dpm_force_performance_level,
Alex Deucher9d670062013-04-12 13:59:22 -04001139 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001140 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -05001141 .page_flip = &rs600_page_flip,
Christian König157fa142014-05-27 16:49:20 +02001142 .page_flip_pending = &rs600_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -05001143 },
Alex Deucherf47299c2010-03-16 20:54:38 -04001144};
1145
Christian König76a0df82013-08-13 11:56:50 +02001146static struct radeon_asic_ring rv770_uvd_ring = {
Christian Könige409b122013-08-13 11:56:53 +02001147 .ib_execute = &uvd_v1_0_ib_execute,
1148 .emit_fence = &uvd_v2_2_fence_emit,
1149 .emit_semaphore = &uvd_v1_0_semaphore_emit,
Christian König76a0df82013-08-13 11:56:50 +02001150 .cs_parse = &radeon_uvd_cs_parse,
Christian Könige409b122013-08-13 11:56:53 +02001151 .ring_test = &uvd_v1_0_ring_test,
1152 .ib_test = &uvd_v1_0_ib_test,
Christian König76a0df82013-08-13 11:56:50 +02001153 .is_lockup = &radeon_ring_test_lockup,
Christian Könige409b122013-08-13 11:56:53 +02001154 .get_rptr = &uvd_v1_0_get_rptr,
1155 .get_wptr = &uvd_v1_0_get_wptr,
1156 .set_wptr = &uvd_v1_0_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001157};
1158
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001159static struct radeon_asic rv770_asic = {
1160 .init = &rv770_init,
1161 .fini = &rv770_fini,
1162 .suspend = &rv770_suspend,
1163 .resume = &rv770_resume,
Jerome Glissea2d07b72010-03-09 14:45:11 +00001164 .asic_reset = &r600_asic_reset,
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001165 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001166 .ioctl_wait_idle = r600_ioctl_wait_idle,
1167 .gui_idle = &r600_gui_idle,
1168 .mc_wait_for_idle = &r600_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001169 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001170 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001171 .gart = {
1172 .tlb_flush = &r600_pcie_gart_tlb_flush,
1173 .set_page = &rs600_gart_set_page,
1174 },
Christian König4c87bc22011-10-19 19:02:21 +02001175 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001176 [RADEON_RING_TYPE_GFX_INDEX] = &r600_gfx_ring,
1177 [R600_RING_TYPE_DMA_INDEX] = &r600_dma_ring,
1178 [R600_RING_TYPE_UVD_INDEX] = &rv770_uvd_ring,
Christian König4c87bc22011-10-19 19:02:21 +02001179 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001180 .irq = {
1181 .set = &r600_irq_set,
1182 .process = &r600_irq_process,
1183 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001184 .display = {
1185 .bandwidth_update = &rv515_bandwidth_update,
1186 .get_vblank_counter = &rs600_get_vblank_counter,
1187 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001188 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001189 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001190 .hdmi_enable = &r600_hdmi_enable,
Rafał Miłecki8f33a152014-05-16 11:36:24 +02001191 .hdmi_setmode = &dce3_1_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001192 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001193 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001194 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -05001195 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher43fb7782013-01-04 09:24:18 -05001196 .dma = &rv770_copy_dma,
Alex Deucher4d756582012-09-27 15:08:35 -04001197 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher43fb7782013-01-04 09:24:18 -05001198 .copy = &rv770_copy_dma,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001199 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001200 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001201 .surface = {
1202 .set_reg = r600_set_surface_reg,
1203 .clear_reg = r600_clear_surface_reg,
1204 },
Alex Deucher901ea572012-02-23 17:53:39 -05001205 .hpd = {
1206 .init = &r600_hpd_init,
1207 .fini = &r600_hpd_fini,
1208 .sense = &r600_hpd_sense,
1209 .set_polarity = &r600_hpd_set_polarity,
1210 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001211 .pm = {
1212 .misc = &rv770_pm_misc,
1213 .prepare = &rs600_pm_prepare,
1214 .finish = &rs600_pm_finish,
1215 .init_profile = &r600_pm_init_profile,
1216 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001217 .get_engine_clock = &radeon_atom_get_engine_clock,
1218 .set_engine_clock = &radeon_atom_set_engine_clock,
1219 .get_memory_clock = &radeon_atom_get_memory_clock,
1220 .set_memory_clock = &radeon_atom_set_memory_clock,
1221 .get_pcie_lanes = &r600_get_pcie_lanes,
1222 .set_pcie_lanes = &r600_set_pcie_lanes,
1223 .set_clock_gating = &radeon_atom_set_clock_gating,
Christian Königef0e6e62013-04-08 12:41:35 +02001224 .set_uvd_clocks = &rv770_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001225 .get_temperature = &rv770_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001226 },
Alex Deucher66229b22013-06-26 00:11:19 -04001227 .dpm = {
1228 .init = &rv770_dpm_init,
1229 .setup_asic = &rv770_dpm_setup_asic,
1230 .enable = &rv770_dpm_enable,
Alex Deuchera3f11242013-12-19 13:48:36 -05001231 .late_enable = &rv770_dpm_late_enable,
Alex Deucher66229b22013-06-26 00:11:19 -04001232 .disable = &rv770_dpm_disable,
Alex Deucher98243912013-01-16 13:13:42 -05001233 .pre_set_power_state = &r600_dpm_pre_set_power_state,
Alex Deucher66229b22013-06-26 00:11:19 -04001234 .set_power_state = &rv770_dpm_set_power_state,
Alex Deucher98243912013-01-16 13:13:42 -05001235 .post_set_power_state = &r600_dpm_post_set_power_state,
Alex Deucher66229b22013-06-26 00:11:19 -04001236 .display_configuration_changed = &rv770_dpm_display_configuration_changed,
1237 .fini = &rv770_dpm_fini,
1238 .get_sclk = &rv770_dpm_get_sclk,
1239 .get_mclk = &rv770_dpm_get_mclk,
1240 .print_power_state = &rv770_dpm_print_power_state,
Alex Deucherbd210d12013-06-28 10:06:26 -04001241 .debugfs_print_current_performance_level = &rv770_dpm_debugfs_print_current_performance_level,
Alex Deucher8b5e6b72013-07-02 18:40:35 -04001242 .force_performance_level = &rv770_dpm_force_performance_level,
Alex Deucherb06195d2013-07-08 11:49:48 -04001243 .vblank_too_short = &rv770_dpm_vblank_too_short,
Alex Deucher66229b22013-06-26 00:11:19 -04001244 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001245 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -05001246 .page_flip = &rv770_page_flip,
Christian König157fa142014-05-27 16:49:20 +02001247 .page_flip_pending = &rv770_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -05001248 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001249};
1250
Christian König76a0df82013-08-13 11:56:50 +02001251static struct radeon_asic_ring evergreen_gfx_ring = {
1252 .ib_execute = &evergreen_ring_ib_execute,
1253 .emit_fence = &r600_fence_ring_emit,
1254 .emit_semaphore = &r600_semaphore_ring_emit,
1255 .cs_parse = &evergreen_cs_parse,
1256 .ring_test = &r600_ring_test,
1257 .ib_test = &r600_ib_test,
1258 .is_lockup = &evergreen_gfx_is_lockup,
Alex Deucherea31bf62013-12-09 19:44:30 -05001259 .get_rptr = &r600_gfx_get_rptr,
1260 .get_wptr = &r600_gfx_get_wptr,
1261 .set_wptr = &r600_gfx_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001262};
1263
1264static struct radeon_asic_ring evergreen_dma_ring = {
1265 .ib_execute = &evergreen_dma_ring_ib_execute,
1266 .emit_fence = &evergreen_dma_fence_ring_emit,
1267 .emit_semaphore = &r600_dma_semaphore_ring_emit,
1268 .cs_parse = &evergreen_dma_cs_parse,
1269 .ring_test = &r600_dma_ring_test,
1270 .ib_test = &r600_dma_ib_test,
1271 .is_lockup = &evergreen_dma_is_lockup,
Christian König2e1e6da2013-08-13 11:56:52 +02001272 .get_rptr = &r600_dma_get_rptr,
1273 .get_wptr = &r600_dma_get_wptr,
1274 .set_wptr = &r600_dma_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001275};
1276
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001277static struct radeon_asic evergreen_asic = {
1278 .init = &evergreen_init,
1279 .fini = &evergreen_fini,
1280 .suspend = &evergreen_suspend,
1281 .resume = &evergreen_resume,
Jerome Glissea2d07b72010-03-09 14:45:11 +00001282 .asic_reset = &evergreen_asic_reset,
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001283 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001284 .ioctl_wait_idle = r600_ioctl_wait_idle,
1285 .gui_idle = &r600_gui_idle,
1286 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001287 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001288 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001289 .gart = {
1290 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1291 .set_page = &rs600_gart_set_page,
1292 },
Christian König4c87bc22011-10-19 19:02:21 +02001293 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001294 [RADEON_RING_TYPE_GFX_INDEX] = &evergreen_gfx_ring,
1295 [R600_RING_TYPE_DMA_INDEX] = &evergreen_dma_ring,
1296 [R600_RING_TYPE_UVD_INDEX] = &rv770_uvd_ring,
Christian König4c87bc22011-10-19 19:02:21 +02001297 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001298 .irq = {
1299 .set = &evergreen_irq_set,
1300 .process = &evergreen_irq_process,
1301 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001302 .display = {
1303 .bandwidth_update = &evergreen_bandwidth_update,
1304 .get_vblank_counter = &evergreen_get_vblank_counter,
1305 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001306 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001307 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001308 .hdmi_enable = &evergreen_hdmi_enable,
1309 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001310 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001311 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001312 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -05001313 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001314 .dma = &evergreen_copy_dma,
1315 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001316 .copy = &evergreen_copy_dma,
1317 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001318 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001319 .surface = {
1320 .set_reg = r600_set_surface_reg,
1321 .clear_reg = r600_clear_surface_reg,
1322 },
Alex Deucher901ea572012-02-23 17:53:39 -05001323 .hpd = {
1324 .init = &evergreen_hpd_init,
1325 .fini = &evergreen_hpd_fini,
1326 .sense = &evergreen_hpd_sense,
1327 .set_polarity = &evergreen_hpd_set_polarity,
1328 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001329 .pm = {
1330 .misc = &evergreen_pm_misc,
1331 .prepare = &evergreen_pm_prepare,
1332 .finish = &evergreen_pm_finish,
1333 .init_profile = &r600_pm_init_profile,
1334 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001335 .get_engine_clock = &radeon_atom_get_engine_clock,
1336 .set_engine_clock = &radeon_atom_set_engine_clock,
1337 .get_memory_clock = &radeon_atom_get_memory_clock,
1338 .set_memory_clock = &radeon_atom_set_memory_clock,
1339 .get_pcie_lanes = &r600_get_pcie_lanes,
1340 .set_pcie_lanes = &r600_set_pcie_lanes,
1341 .set_clock_gating = NULL,
Alex Deuchera8b49252013-04-08 12:41:33 +02001342 .set_uvd_clocks = &evergreen_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001343 .get_temperature = &evergreen_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001344 },
Alex Deucherdc50ba72013-06-26 00:33:35 -04001345 .dpm = {
1346 .init = &cypress_dpm_init,
1347 .setup_asic = &cypress_dpm_setup_asic,
1348 .enable = &cypress_dpm_enable,
Alex Deuchera3f11242013-12-19 13:48:36 -05001349 .late_enable = &rv770_dpm_late_enable,
Alex Deucherdc50ba72013-06-26 00:33:35 -04001350 .disable = &cypress_dpm_disable,
Alex Deucher98243912013-01-16 13:13:42 -05001351 .pre_set_power_state = &r600_dpm_pre_set_power_state,
Alex Deucherdc50ba72013-06-26 00:33:35 -04001352 .set_power_state = &cypress_dpm_set_power_state,
Alex Deucher98243912013-01-16 13:13:42 -05001353 .post_set_power_state = &r600_dpm_post_set_power_state,
Alex Deucherdc50ba72013-06-26 00:33:35 -04001354 .display_configuration_changed = &cypress_dpm_display_configuration_changed,
1355 .fini = &cypress_dpm_fini,
1356 .get_sclk = &rv770_dpm_get_sclk,
1357 .get_mclk = &rv770_dpm_get_mclk,
1358 .print_power_state = &rv770_dpm_print_power_state,
Alex Deucherbd210d12013-06-28 10:06:26 -04001359 .debugfs_print_current_performance_level = &rv770_dpm_debugfs_print_current_performance_level,
Alex Deucher8b5e6b72013-07-02 18:40:35 -04001360 .force_performance_level = &rv770_dpm_force_performance_level,
Alex Deucherd0b54bd2013-07-08 11:56:09 -04001361 .vblank_too_short = &cypress_dpm_vblank_too_short,
Alex Deucherdc50ba72013-06-26 00:33:35 -04001362 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001363 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -05001364 .page_flip = &evergreen_page_flip,
Christian König157fa142014-05-27 16:49:20 +02001365 .page_flip_pending = &evergreen_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -05001366 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001367};
1368
Alex Deucher958261d2010-11-22 17:56:30 -05001369static struct radeon_asic sumo_asic = {
1370 .init = &evergreen_init,
1371 .fini = &evergreen_fini,
1372 .suspend = &evergreen_suspend,
1373 .resume = &evergreen_resume,
Alex Deucher958261d2010-11-22 17:56:30 -05001374 .asic_reset = &evergreen_asic_reset,
1375 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001376 .ioctl_wait_idle = r600_ioctl_wait_idle,
1377 .gui_idle = &r600_gui_idle,
1378 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001379 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001380 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001381 .gart = {
1382 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1383 .set_page = &rs600_gart_set_page,
1384 },
Christian König4c87bc22011-10-19 19:02:21 +02001385 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001386 [RADEON_RING_TYPE_GFX_INDEX] = &evergreen_gfx_ring,
1387 [R600_RING_TYPE_DMA_INDEX] = &evergreen_dma_ring,
1388 [R600_RING_TYPE_UVD_INDEX] = &rv770_uvd_ring,
Christian König4c87bc22011-10-19 19:02:21 +02001389 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001390 .irq = {
1391 .set = &evergreen_irq_set,
1392 .process = &evergreen_irq_process,
1393 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001394 .display = {
1395 .bandwidth_update = &evergreen_bandwidth_update,
1396 .get_vblank_counter = &evergreen_get_vblank_counter,
1397 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001398 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001399 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001400 .hdmi_enable = &evergreen_hdmi_enable,
1401 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001402 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001403 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001404 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -05001405 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001406 .dma = &evergreen_copy_dma,
1407 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001408 .copy = &evergreen_copy_dma,
1409 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001410 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001411 .surface = {
1412 .set_reg = r600_set_surface_reg,
1413 .clear_reg = r600_clear_surface_reg,
1414 },
Alex Deucher901ea572012-02-23 17:53:39 -05001415 .hpd = {
1416 .init = &evergreen_hpd_init,
1417 .fini = &evergreen_hpd_fini,
1418 .sense = &evergreen_hpd_sense,
1419 .set_polarity = &evergreen_hpd_set_polarity,
1420 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001421 .pm = {
1422 .misc = &evergreen_pm_misc,
1423 .prepare = &evergreen_pm_prepare,
1424 .finish = &evergreen_pm_finish,
1425 .init_profile = &sumo_pm_init_profile,
1426 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001427 .get_engine_clock = &radeon_atom_get_engine_clock,
1428 .set_engine_clock = &radeon_atom_set_engine_clock,
1429 .get_memory_clock = NULL,
1430 .set_memory_clock = NULL,
1431 .get_pcie_lanes = NULL,
1432 .set_pcie_lanes = NULL,
1433 .set_clock_gating = NULL,
Alex Deucher23d33ba2013-04-08 12:41:32 +02001434 .set_uvd_clocks = &sumo_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001435 .get_temperature = &sumo_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001436 },
Alex Deucher80ea2c12013-04-12 14:56:21 -04001437 .dpm = {
1438 .init = &sumo_dpm_init,
1439 .setup_asic = &sumo_dpm_setup_asic,
1440 .enable = &sumo_dpm_enable,
Alex Deucher14ec9fa2013-12-19 11:56:52 -05001441 .late_enable = &sumo_dpm_late_enable,
Alex Deucher80ea2c12013-04-12 14:56:21 -04001442 .disable = &sumo_dpm_disable,
Alex Deucher422a56b2013-06-25 15:40:21 -04001443 .pre_set_power_state = &sumo_dpm_pre_set_power_state,
Alex Deucher80ea2c12013-04-12 14:56:21 -04001444 .set_power_state = &sumo_dpm_set_power_state,
Alex Deucher422a56b2013-06-25 15:40:21 -04001445 .post_set_power_state = &sumo_dpm_post_set_power_state,
Alex Deucher80ea2c12013-04-12 14:56:21 -04001446 .display_configuration_changed = &sumo_dpm_display_configuration_changed,
1447 .fini = &sumo_dpm_fini,
1448 .get_sclk = &sumo_dpm_get_sclk,
1449 .get_mclk = &sumo_dpm_get_mclk,
1450 .print_power_state = &sumo_dpm_print_power_state,
Alex Deucherfb701602013-06-28 10:47:56 -04001451 .debugfs_print_current_performance_level = &sumo_dpm_debugfs_print_current_performance_level,
Alex Deucher5d5e5592013-07-02 18:50:09 -04001452 .force_performance_level = &sumo_dpm_force_performance_level,
Alex Deucher80ea2c12013-04-12 14:56:21 -04001453 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001454 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -05001455 .page_flip = &evergreen_page_flip,
Christian König157fa142014-05-27 16:49:20 +02001456 .page_flip_pending = &evergreen_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -05001457 },
Alex Deucher958261d2010-11-22 17:56:30 -05001458};
1459
Alex Deuchera43b7662011-01-06 21:19:33 -05001460static struct radeon_asic btc_asic = {
1461 .init = &evergreen_init,
1462 .fini = &evergreen_fini,
1463 .suspend = &evergreen_suspend,
1464 .resume = &evergreen_resume,
Alex Deuchera43b7662011-01-06 21:19:33 -05001465 .asic_reset = &evergreen_asic_reset,
1466 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001467 .ioctl_wait_idle = r600_ioctl_wait_idle,
1468 .gui_idle = &r600_gui_idle,
1469 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001470 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001471 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001472 .gart = {
1473 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1474 .set_page = &rs600_gart_set_page,
1475 },
Christian König4c87bc22011-10-19 19:02:21 +02001476 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001477 [RADEON_RING_TYPE_GFX_INDEX] = &evergreen_gfx_ring,
1478 [R600_RING_TYPE_DMA_INDEX] = &evergreen_dma_ring,
1479 [R600_RING_TYPE_UVD_INDEX] = &rv770_uvd_ring,
Christian König4c87bc22011-10-19 19:02:21 +02001480 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001481 .irq = {
1482 .set = &evergreen_irq_set,
1483 .process = &evergreen_irq_process,
1484 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001485 .display = {
1486 .bandwidth_update = &evergreen_bandwidth_update,
1487 .get_vblank_counter = &evergreen_get_vblank_counter,
1488 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001489 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001490 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001491 .hdmi_enable = &evergreen_hdmi_enable,
1492 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001493 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001494 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001495 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -05001496 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001497 .dma = &evergreen_copy_dma,
1498 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001499 .copy = &evergreen_copy_dma,
1500 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001501 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001502 .surface = {
1503 .set_reg = r600_set_surface_reg,
1504 .clear_reg = r600_clear_surface_reg,
1505 },
Alex Deucher901ea572012-02-23 17:53:39 -05001506 .hpd = {
1507 .init = &evergreen_hpd_init,
1508 .fini = &evergreen_hpd_fini,
1509 .sense = &evergreen_hpd_sense,
1510 .set_polarity = &evergreen_hpd_set_polarity,
1511 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001512 .pm = {
1513 .misc = &evergreen_pm_misc,
1514 .prepare = &evergreen_pm_prepare,
1515 .finish = &evergreen_pm_finish,
Alex Deucher27810fb2012-10-01 19:25:11 -04001516 .init_profile = &btc_pm_init_profile,
Alex Deuchera02fa392012-02-23 17:53:41 -05001517 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001518 .get_engine_clock = &radeon_atom_get_engine_clock,
1519 .set_engine_clock = &radeon_atom_set_engine_clock,
1520 .get_memory_clock = &radeon_atom_get_memory_clock,
1521 .set_memory_clock = &radeon_atom_set_memory_clock,
Alex Deucher55b615a2013-03-18 18:57:27 -04001522 .get_pcie_lanes = &r600_get_pcie_lanes,
1523 .set_pcie_lanes = &r600_set_pcie_lanes,
Alex Deucher798bcf72012-02-23 17:53:48 -05001524 .set_clock_gating = NULL,
Alex Deuchera8b49252013-04-08 12:41:33 +02001525 .set_uvd_clocks = &evergreen_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001526 .get_temperature = &evergreen_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001527 },
Alex Deucher6596afd2013-06-26 00:15:24 -04001528 .dpm = {
1529 .init = &btc_dpm_init,
1530 .setup_asic = &btc_dpm_setup_asic,
1531 .enable = &btc_dpm_enable,
Alex Deuchera3f11242013-12-19 13:48:36 -05001532 .late_enable = &rv770_dpm_late_enable,
Alex Deucher6596afd2013-06-26 00:15:24 -04001533 .disable = &btc_dpm_disable,
Alex Deuchere8a95392013-01-16 14:17:23 -05001534 .pre_set_power_state = &btc_dpm_pre_set_power_state,
Alex Deucher6596afd2013-06-26 00:15:24 -04001535 .set_power_state = &btc_dpm_set_power_state,
Alex Deuchere8a95392013-01-16 14:17:23 -05001536 .post_set_power_state = &btc_dpm_post_set_power_state,
Alex Deucher6596afd2013-06-26 00:15:24 -04001537 .display_configuration_changed = &cypress_dpm_display_configuration_changed,
1538 .fini = &btc_dpm_fini,
Alex Deuchere8a95392013-01-16 14:17:23 -05001539 .get_sclk = &btc_dpm_get_sclk,
1540 .get_mclk = &btc_dpm_get_mclk,
Alex Deucher6596afd2013-06-26 00:15:24 -04001541 .print_power_state = &rv770_dpm_print_power_state,
Alex Deucher9f3f63f2014-01-30 11:19:22 -05001542 .debugfs_print_current_performance_level = &btc_dpm_debugfs_print_current_performance_level,
Alex Deucher8b5e6b72013-07-02 18:40:35 -04001543 .force_performance_level = &rv770_dpm_force_performance_level,
Alex Deuchera84301c2013-07-08 12:03:55 -04001544 .vblank_too_short = &btc_dpm_vblank_too_short,
Alex Deucher6596afd2013-06-26 00:15:24 -04001545 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001546 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -05001547 .page_flip = &evergreen_page_flip,
Christian König157fa142014-05-27 16:49:20 +02001548 .page_flip_pending = &evergreen_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -05001549 },
Alex Deuchera43b7662011-01-06 21:19:33 -05001550};
1551
Christian König76a0df82013-08-13 11:56:50 +02001552static struct radeon_asic_ring cayman_gfx_ring = {
1553 .ib_execute = &cayman_ring_ib_execute,
1554 .ib_parse = &evergreen_ib_parse,
1555 .emit_fence = &cayman_fence_ring_emit,
1556 .emit_semaphore = &r600_semaphore_ring_emit,
1557 .cs_parse = &evergreen_cs_parse,
1558 .ring_test = &r600_ring_test,
1559 .ib_test = &r600_ib_test,
1560 .is_lockup = &cayman_gfx_is_lockup,
1561 .vm_flush = &cayman_vm_flush,
Alex Deucherea31bf62013-12-09 19:44:30 -05001562 .get_rptr = &cayman_gfx_get_rptr,
1563 .get_wptr = &cayman_gfx_get_wptr,
1564 .set_wptr = &cayman_gfx_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001565};
1566
1567static struct radeon_asic_ring cayman_dma_ring = {
1568 .ib_execute = &cayman_dma_ring_ib_execute,
1569 .ib_parse = &evergreen_dma_ib_parse,
1570 .emit_fence = &evergreen_dma_fence_ring_emit,
1571 .emit_semaphore = &r600_dma_semaphore_ring_emit,
1572 .cs_parse = &evergreen_dma_cs_parse,
1573 .ring_test = &r600_dma_ring_test,
1574 .ib_test = &r600_dma_ib_test,
1575 .is_lockup = &cayman_dma_is_lockup,
1576 .vm_flush = &cayman_dma_vm_flush,
Alex Deucherea31bf62013-12-09 19:44:30 -05001577 .get_rptr = &cayman_dma_get_rptr,
1578 .get_wptr = &cayman_dma_get_wptr,
1579 .set_wptr = &cayman_dma_set_wptr
Christian König76a0df82013-08-13 11:56:50 +02001580};
1581
1582static struct radeon_asic_ring cayman_uvd_ring = {
Christian Könige409b122013-08-13 11:56:53 +02001583 .ib_execute = &uvd_v1_0_ib_execute,
1584 .emit_fence = &uvd_v2_2_fence_emit,
1585 .emit_semaphore = &uvd_v3_1_semaphore_emit,
Christian König76a0df82013-08-13 11:56:50 +02001586 .cs_parse = &radeon_uvd_cs_parse,
Christian Könige409b122013-08-13 11:56:53 +02001587 .ring_test = &uvd_v1_0_ring_test,
1588 .ib_test = &uvd_v1_0_ib_test,
Christian König76a0df82013-08-13 11:56:50 +02001589 .is_lockup = &radeon_ring_test_lockup,
Christian Könige409b122013-08-13 11:56:53 +02001590 .get_rptr = &uvd_v1_0_get_rptr,
1591 .get_wptr = &uvd_v1_0_get_wptr,
1592 .set_wptr = &uvd_v1_0_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001593};
1594
Alex Deuchere3487622011-03-02 20:07:36 -05001595static struct radeon_asic cayman_asic = {
1596 .init = &cayman_init,
1597 .fini = &cayman_fini,
1598 .suspend = &cayman_suspend,
1599 .resume = &cayman_resume,
Alex Deuchere3487622011-03-02 20:07:36 -05001600 .asic_reset = &cayman_asic_reset,
1601 .vga_set_state = &r600_vga_set_state,
Alex Deucher54e88e02012-02-23 18:10:29 -05001602 .ioctl_wait_idle = r600_ioctl_wait_idle,
1603 .gui_idle = &r600_gui_idle,
1604 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001605 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001606 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001607 .gart = {
1608 .tlb_flush = &cayman_pcie_gart_tlb_flush,
1609 .set_page = &rs600_gart_set_page,
1610 },
Christian König05b07142012-08-06 20:21:10 +02001611 .vm = {
1612 .init = &cayman_vm_init,
1613 .fini = &cayman_vm_fini,
Christian König24c16432013-10-30 11:51:09 -04001614 .set_page = &cayman_dma_vm_set_page,
Christian König05b07142012-08-06 20:21:10 +02001615 },
Christian König4c87bc22011-10-19 19:02:21 +02001616 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001617 [RADEON_RING_TYPE_GFX_INDEX] = &cayman_gfx_ring,
1618 [CAYMAN_RING_TYPE_CP1_INDEX] = &cayman_gfx_ring,
1619 [CAYMAN_RING_TYPE_CP2_INDEX] = &cayman_gfx_ring,
1620 [R600_RING_TYPE_DMA_INDEX] = &cayman_dma_ring,
1621 [CAYMAN_RING_TYPE_DMA1_INDEX] = &cayman_dma_ring,
1622 [R600_RING_TYPE_UVD_INDEX] = &cayman_uvd_ring,
Christian König4c87bc22011-10-19 19:02:21 +02001623 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001624 .irq = {
1625 .set = &evergreen_irq_set,
1626 .process = &evergreen_irq_process,
1627 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001628 .display = {
1629 .bandwidth_update = &evergreen_bandwidth_update,
1630 .get_vblank_counter = &evergreen_get_vblank_counter,
1631 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001632 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001633 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001634 .hdmi_enable = &evergreen_hdmi_enable,
1635 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001636 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001637 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001638 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -05001639 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001640 .dma = &evergreen_copy_dma,
1641 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001642 .copy = &evergreen_copy_dma,
1643 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001644 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001645 .surface = {
1646 .set_reg = r600_set_surface_reg,
1647 .clear_reg = r600_clear_surface_reg,
1648 },
Alex Deucher901ea572012-02-23 17:53:39 -05001649 .hpd = {
1650 .init = &evergreen_hpd_init,
1651 .fini = &evergreen_hpd_fini,
1652 .sense = &evergreen_hpd_sense,
1653 .set_polarity = &evergreen_hpd_set_polarity,
1654 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001655 .pm = {
1656 .misc = &evergreen_pm_misc,
1657 .prepare = &evergreen_pm_prepare,
1658 .finish = &evergreen_pm_finish,
Alex Deucher27810fb2012-10-01 19:25:11 -04001659 .init_profile = &btc_pm_init_profile,
Alex Deuchera02fa392012-02-23 17:53:41 -05001660 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001661 .get_engine_clock = &radeon_atom_get_engine_clock,
1662 .set_engine_clock = &radeon_atom_set_engine_clock,
1663 .get_memory_clock = &radeon_atom_get_memory_clock,
1664 .set_memory_clock = &radeon_atom_set_memory_clock,
Alex Deucher55b615a2013-03-18 18:57:27 -04001665 .get_pcie_lanes = &r600_get_pcie_lanes,
1666 .set_pcie_lanes = &r600_set_pcie_lanes,
Alex Deucher798bcf72012-02-23 17:53:48 -05001667 .set_clock_gating = NULL,
Alex Deuchera8b49252013-04-08 12:41:33 +02001668 .set_uvd_clocks = &evergreen_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001669 .get_temperature = &evergreen_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001670 },
Alex Deucher69e0b572013-04-12 16:42:42 -04001671 .dpm = {
1672 .init = &ni_dpm_init,
1673 .setup_asic = &ni_dpm_setup_asic,
1674 .enable = &ni_dpm_enable,
Alex Deuchera3f11242013-12-19 13:48:36 -05001675 .late_enable = &rv770_dpm_late_enable,
Alex Deucher69e0b572013-04-12 16:42:42 -04001676 .disable = &ni_dpm_disable,
Alex Deucherfee3d742013-01-16 14:35:39 -05001677 .pre_set_power_state = &ni_dpm_pre_set_power_state,
Alex Deucher69e0b572013-04-12 16:42:42 -04001678 .set_power_state = &ni_dpm_set_power_state,
Alex Deucherfee3d742013-01-16 14:35:39 -05001679 .post_set_power_state = &ni_dpm_post_set_power_state,
Alex Deucher69e0b572013-04-12 16:42:42 -04001680 .display_configuration_changed = &cypress_dpm_display_configuration_changed,
1681 .fini = &ni_dpm_fini,
1682 .get_sclk = &ni_dpm_get_sclk,
1683 .get_mclk = &ni_dpm_get_mclk,
1684 .print_power_state = &ni_dpm_print_power_state,
Alex Deucherbdf0c4f2013-06-28 17:49:02 -04001685 .debugfs_print_current_performance_level = &ni_dpm_debugfs_print_current_performance_level,
Alex Deucher170a47f2013-07-02 18:43:53 -04001686 .force_performance_level = &ni_dpm_force_performance_level,
Alex Deucher76ad73e2013-07-08 12:09:41 -04001687 .vblank_too_short = &ni_dpm_vblank_too_short,
Alex Deucher69e0b572013-04-12 16:42:42 -04001688 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001689 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -05001690 .page_flip = &evergreen_page_flip,
Christian König157fa142014-05-27 16:49:20 +02001691 .page_flip_pending = &evergreen_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -05001692 },
Alex Deuchere3487622011-03-02 20:07:36 -05001693};
1694
Alex Deucherbe63fe82012-03-20 17:18:40 -04001695static struct radeon_asic trinity_asic = {
1696 .init = &cayman_init,
1697 .fini = &cayman_fini,
1698 .suspend = &cayman_suspend,
1699 .resume = &cayman_resume,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001700 .asic_reset = &cayman_asic_reset,
1701 .vga_set_state = &r600_vga_set_state,
1702 .ioctl_wait_idle = r600_ioctl_wait_idle,
1703 .gui_idle = &r600_gui_idle,
1704 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001705 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001706 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001707 .gart = {
1708 .tlb_flush = &cayman_pcie_gart_tlb_flush,
1709 .set_page = &rs600_gart_set_page,
1710 },
Christian König05b07142012-08-06 20:21:10 +02001711 .vm = {
1712 .init = &cayman_vm_init,
1713 .fini = &cayman_vm_fini,
Christian König24c16432013-10-30 11:51:09 -04001714 .set_page = &cayman_dma_vm_set_page,
Christian König05b07142012-08-06 20:21:10 +02001715 },
Alex Deucherbe63fe82012-03-20 17:18:40 -04001716 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001717 [RADEON_RING_TYPE_GFX_INDEX] = &cayman_gfx_ring,
1718 [CAYMAN_RING_TYPE_CP1_INDEX] = &cayman_gfx_ring,
1719 [CAYMAN_RING_TYPE_CP2_INDEX] = &cayman_gfx_ring,
1720 [R600_RING_TYPE_DMA_INDEX] = &cayman_dma_ring,
1721 [CAYMAN_RING_TYPE_DMA1_INDEX] = &cayman_dma_ring,
1722 [R600_RING_TYPE_UVD_INDEX] = &cayman_uvd_ring,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001723 },
1724 .irq = {
1725 .set = &evergreen_irq_set,
1726 .process = &evergreen_irq_process,
1727 },
1728 .display = {
1729 .bandwidth_update = &dce6_bandwidth_update,
1730 .get_vblank_counter = &evergreen_get_vblank_counter,
1731 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001732 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001733 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherb5306022013-07-31 16:51:33 -04001734 .hdmi_enable = &evergreen_hdmi_enable,
1735 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001736 },
1737 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001738 .blit = &r600_copy_cpdma,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001739 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001740 .dma = &evergreen_copy_dma,
1741 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001742 .copy = &evergreen_copy_dma,
1743 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001744 },
1745 .surface = {
1746 .set_reg = r600_set_surface_reg,
1747 .clear_reg = r600_clear_surface_reg,
1748 },
1749 .hpd = {
1750 .init = &evergreen_hpd_init,
1751 .fini = &evergreen_hpd_fini,
1752 .sense = &evergreen_hpd_sense,
1753 .set_polarity = &evergreen_hpd_set_polarity,
1754 },
1755 .pm = {
1756 .misc = &evergreen_pm_misc,
1757 .prepare = &evergreen_pm_prepare,
1758 .finish = &evergreen_pm_finish,
1759 .init_profile = &sumo_pm_init_profile,
1760 .get_dynpm_state = &r600_pm_get_dynpm_state,
1761 .get_engine_clock = &radeon_atom_get_engine_clock,
1762 .set_engine_clock = &radeon_atom_set_engine_clock,
1763 .get_memory_clock = NULL,
1764 .set_memory_clock = NULL,
1765 .get_pcie_lanes = NULL,
1766 .set_pcie_lanes = NULL,
1767 .set_clock_gating = NULL,
Alex Deucher23d33ba2013-04-08 12:41:32 +02001768 .set_uvd_clocks = &sumo_set_uvd_clocks,
Alex Deucher29a15222012-12-14 11:57:36 -05001769 .get_temperature = &tn_get_temp,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001770 },
Alex Deucherd70229f2013-04-12 16:40:41 -04001771 .dpm = {
1772 .init = &trinity_dpm_init,
1773 .setup_asic = &trinity_dpm_setup_asic,
1774 .enable = &trinity_dpm_enable,
Alex Deucherbda44c12013-12-19 12:03:35 -05001775 .late_enable = &trinity_dpm_late_enable,
Alex Deucherd70229f2013-04-12 16:40:41 -04001776 .disable = &trinity_dpm_disable,
Alex Deuchera284c482013-01-16 13:53:40 -05001777 .pre_set_power_state = &trinity_dpm_pre_set_power_state,
Alex Deucherd70229f2013-04-12 16:40:41 -04001778 .set_power_state = &trinity_dpm_set_power_state,
Alex Deuchera284c482013-01-16 13:53:40 -05001779 .post_set_power_state = &trinity_dpm_post_set_power_state,
Alex Deucherd70229f2013-04-12 16:40:41 -04001780 .display_configuration_changed = &trinity_dpm_display_configuration_changed,
1781 .fini = &trinity_dpm_fini,
1782 .get_sclk = &trinity_dpm_get_sclk,
1783 .get_mclk = &trinity_dpm_get_mclk,
1784 .print_power_state = &trinity_dpm_print_power_state,
Alex Deucher490ab932013-06-28 12:01:38 -04001785 .debugfs_print_current_performance_level = &trinity_dpm_debugfs_print_current_performance_level,
Alex Deucher9b5de592013-07-02 18:52:10 -04001786 .force_performance_level = &trinity_dpm_force_performance_level,
Alex Deucher11877062013-09-09 19:19:52 -04001787 .enable_bapm = &trinity_dpm_enable_bapm,
Alex Deucherd70229f2013-04-12 16:40:41 -04001788 },
Alex Deucherbe63fe82012-03-20 17:18:40 -04001789 .pflip = {
Alex Deucherbe63fe82012-03-20 17:18:40 -04001790 .page_flip = &evergreen_page_flip,
Christian König157fa142014-05-27 16:49:20 +02001791 .page_flip_pending = &evergreen_page_flip_pending,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001792 },
1793};
1794
Christian König76a0df82013-08-13 11:56:50 +02001795static struct radeon_asic_ring si_gfx_ring = {
1796 .ib_execute = &si_ring_ib_execute,
1797 .ib_parse = &si_ib_parse,
1798 .emit_fence = &si_fence_ring_emit,
1799 .emit_semaphore = &r600_semaphore_ring_emit,
1800 .cs_parse = NULL,
1801 .ring_test = &r600_ring_test,
1802 .ib_test = &r600_ib_test,
1803 .is_lockup = &si_gfx_is_lockup,
1804 .vm_flush = &si_vm_flush,
Alex Deucherea31bf62013-12-09 19:44:30 -05001805 .get_rptr = &cayman_gfx_get_rptr,
1806 .get_wptr = &cayman_gfx_get_wptr,
1807 .set_wptr = &cayman_gfx_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001808};
1809
1810static struct radeon_asic_ring si_dma_ring = {
1811 .ib_execute = &cayman_dma_ring_ib_execute,
1812 .ib_parse = &evergreen_dma_ib_parse,
1813 .emit_fence = &evergreen_dma_fence_ring_emit,
1814 .emit_semaphore = &r600_dma_semaphore_ring_emit,
1815 .cs_parse = NULL,
1816 .ring_test = &r600_dma_ring_test,
1817 .ib_test = &r600_dma_ib_test,
1818 .is_lockup = &si_dma_is_lockup,
1819 .vm_flush = &si_dma_vm_flush,
Alex Deucherea31bf62013-12-09 19:44:30 -05001820 .get_rptr = &cayman_dma_get_rptr,
1821 .get_wptr = &cayman_dma_get_wptr,
1822 .set_wptr = &cayman_dma_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001823};
1824
Alex Deucher02779c02012-03-20 17:18:25 -04001825static struct radeon_asic si_asic = {
1826 .init = &si_init,
1827 .fini = &si_fini,
1828 .suspend = &si_suspend,
1829 .resume = &si_resume,
Alex Deucher02779c02012-03-20 17:18:25 -04001830 .asic_reset = &si_asic_reset,
1831 .vga_set_state = &r600_vga_set_state,
1832 .ioctl_wait_idle = r600_ioctl_wait_idle,
1833 .gui_idle = &r600_gui_idle,
1834 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001835 .get_xclk = &si_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001836 .get_gpu_clock_counter = &si_get_gpu_clock_counter,
Alex Deucher02779c02012-03-20 17:18:25 -04001837 .gart = {
1838 .tlb_flush = &si_pcie_gart_tlb_flush,
1839 .set_page = &rs600_gart_set_page,
1840 },
Christian König05b07142012-08-06 20:21:10 +02001841 .vm = {
1842 .init = &si_vm_init,
1843 .fini = &si_vm_fini,
Christian König24c16432013-10-30 11:51:09 -04001844 .set_page = &si_dma_vm_set_page,
Christian König05b07142012-08-06 20:21:10 +02001845 },
Alex Deucher02779c02012-03-20 17:18:25 -04001846 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001847 [RADEON_RING_TYPE_GFX_INDEX] = &si_gfx_ring,
1848 [CAYMAN_RING_TYPE_CP1_INDEX] = &si_gfx_ring,
1849 [CAYMAN_RING_TYPE_CP2_INDEX] = &si_gfx_ring,
1850 [R600_RING_TYPE_DMA_INDEX] = &si_dma_ring,
1851 [CAYMAN_RING_TYPE_DMA1_INDEX] = &si_dma_ring,
1852 [R600_RING_TYPE_UVD_INDEX] = &cayman_uvd_ring,
Alex Deucher02779c02012-03-20 17:18:25 -04001853 },
1854 .irq = {
1855 .set = &si_irq_set,
1856 .process = &si_irq_process,
1857 },
1858 .display = {
1859 .bandwidth_update = &dce6_bandwidth_update,
1860 .get_vblank_counter = &evergreen_get_vblank_counter,
1861 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001862 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001863 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherb5306022013-07-31 16:51:33 -04001864 .hdmi_enable = &evergreen_hdmi_enable,
1865 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucher02779c02012-03-20 17:18:25 -04001866 },
1867 .copy = {
Alex Deucher5c722732013-10-01 16:17:14 -04001868 .blit = &r600_copy_cpdma,
Alex Deucher02779c02012-03-20 17:18:25 -04001869 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05001870 .dma = &si_copy_dma,
1871 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001872 .copy = &si_copy_dma,
1873 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher02779c02012-03-20 17:18:25 -04001874 },
1875 .surface = {
1876 .set_reg = r600_set_surface_reg,
1877 .clear_reg = r600_clear_surface_reg,
1878 },
1879 .hpd = {
1880 .init = &evergreen_hpd_init,
1881 .fini = &evergreen_hpd_fini,
1882 .sense = &evergreen_hpd_sense,
1883 .set_polarity = &evergreen_hpd_set_polarity,
1884 },
1885 .pm = {
1886 .misc = &evergreen_pm_misc,
1887 .prepare = &evergreen_pm_prepare,
1888 .finish = &evergreen_pm_finish,
1889 .init_profile = &sumo_pm_init_profile,
1890 .get_dynpm_state = &r600_pm_get_dynpm_state,
1891 .get_engine_clock = &radeon_atom_get_engine_clock,
1892 .set_engine_clock = &radeon_atom_set_engine_clock,
1893 .get_memory_clock = &radeon_atom_get_memory_clock,
1894 .set_memory_clock = &radeon_atom_set_memory_clock,
Alex Deucher55b615a2013-03-18 18:57:27 -04001895 .get_pcie_lanes = &r600_get_pcie_lanes,
1896 .set_pcie_lanes = &r600_set_pcie_lanes,
Alex Deucher02779c02012-03-20 17:18:25 -04001897 .set_clock_gating = NULL,
Christian König2539eb02013-04-08 12:41:34 +02001898 .set_uvd_clocks = &si_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001899 .get_temperature = &si_get_temp,
Alex Deucher02779c02012-03-20 17:18:25 -04001900 },
Alex Deuchera9e61412013-06-25 17:56:16 -04001901 .dpm = {
1902 .init = &si_dpm_init,
1903 .setup_asic = &si_dpm_setup_asic,
1904 .enable = &si_dpm_enable,
Alex Deucher963c1152013-12-19 13:54:35 -05001905 .late_enable = &si_dpm_late_enable,
Alex Deuchera9e61412013-06-25 17:56:16 -04001906 .disable = &si_dpm_disable,
1907 .pre_set_power_state = &si_dpm_pre_set_power_state,
1908 .set_power_state = &si_dpm_set_power_state,
1909 .post_set_power_state = &si_dpm_post_set_power_state,
1910 .display_configuration_changed = &si_dpm_display_configuration_changed,
1911 .fini = &si_dpm_fini,
1912 .get_sclk = &ni_dpm_get_sclk,
1913 .get_mclk = &ni_dpm_get_mclk,
1914 .print_power_state = &ni_dpm_print_power_state,
Alex Deucher79821282013-06-28 18:02:19 -04001915 .debugfs_print_current_performance_level = &si_dpm_debugfs_print_current_performance_level,
Alex Deuchera160a6a2013-07-02 18:46:28 -04001916 .force_performance_level = &si_dpm_force_performance_level,
Alex Deucherf4dec312013-07-08 12:15:11 -04001917 .vblank_too_short = &ni_dpm_vblank_too_short,
Alex Deuchera9e61412013-06-25 17:56:16 -04001918 },
Alex Deucher02779c02012-03-20 17:18:25 -04001919 .pflip = {
Alex Deucher02779c02012-03-20 17:18:25 -04001920 .page_flip = &evergreen_page_flip,
Christian König157fa142014-05-27 16:49:20 +02001921 .page_flip_pending = &evergreen_page_flip_pending,
Alex Deucher02779c02012-03-20 17:18:25 -04001922 },
1923};
1924
Christian König76a0df82013-08-13 11:56:50 +02001925static struct radeon_asic_ring ci_gfx_ring = {
1926 .ib_execute = &cik_ring_ib_execute,
1927 .ib_parse = &cik_ib_parse,
1928 .emit_fence = &cik_fence_gfx_ring_emit,
1929 .emit_semaphore = &cik_semaphore_ring_emit,
1930 .cs_parse = NULL,
1931 .ring_test = &cik_ring_test,
1932 .ib_test = &cik_ib_test,
1933 .is_lockup = &cik_gfx_is_lockup,
1934 .vm_flush = &cik_vm_flush,
Alex Deucherea31bf62013-12-09 19:44:30 -05001935 .get_rptr = &cik_gfx_get_rptr,
1936 .get_wptr = &cik_gfx_get_wptr,
1937 .set_wptr = &cik_gfx_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001938};
1939
1940static struct radeon_asic_ring ci_cp_ring = {
1941 .ib_execute = &cik_ring_ib_execute,
1942 .ib_parse = &cik_ib_parse,
1943 .emit_fence = &cik_fence_compute_ring_emit,
1944 .emit_semaphore = &cik_semaphore_ring_emit,
1945 .cs_parse = NULL,
1946 .ring_test = &cik_ring_test,
1947 .ib_test = &cik_ib_test,
1948 .is_lockup = &cik_gfx_is_lockup,
1949 .vm_flush = &cik_vm_flush,
Alex Deucherea31bf62013-12-09 19:44:30 -05001950 .get_rptr = &cik_compute_get_rptr,
1951 .get_wptr = &cik_compute_get_wptr,
1952 .set_wptr = &cik_compute_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001953};
1954
1955static struct radeon_asic_ring ci_dma_ring = {
1956 .ib_execute = &cik_sdma_ring_ib_execute,
1957 .ib_parse = &cik_ib_parse,
1958 .emit_fence = &cik_sdma_fence_ring_emit,
1959 .emit_semaphore = &cik_sdma_semaphore_ring_emit,
1960 .cs_parse = NULL,
1961 .ring_test = &cik_sdma_ring_test,
1962 .ib_test = &cik_sdma_ib_test,
1963 .is_lockup = &cik_sdma_is_lockup,
1964 .vm_flush = &cik_dma_vm_flush,
Alex Deucherea31bf62013-12-09 19:44:30 -05001965 .get_rptr = &cik_sdma_get_rptr,
1966 .get_wptr = &cik_sdma_get_wptr,
1967 .set_wptr = &cik_sdma_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001968};
1969
Christian Königd93f7932013-05-23 12:10:04 +02001970static struct radeon_asic_ring ci_vce_ring = {
1971 .ib_execute = &radeon_vce_ib_execute,
1972 .emit_fence = &radeon_vce_fence_emit,
1973 .emit_semaphore = &radeon_vce_semaphore_emit,
1974 .cs_parse = &radeon_vce_cs_parse,
1975 .ring_test = &radeon_vce_ring_test,
1976 .ib_test = &radeon_vce_ib_test,
1977 .is_lockup = &radeon_ring_test_lockup,
1978 .get_rptr = &vce_v1_0_get_rptr,
1979 .get_wptr = &vce_v1_0_get_wptr,
1980 .set_wptr = &vce_v1_0_set_wptr,
1981};
1982
Alex Deucher0672e272013-04-09 16:22:31 -04001983static struct radeon_asic ci_asic = {
1984 .init = &cik_init,
1985 .fini = &cik_fini,
1986 .suspend = &cik_suspend,
1987 .resume = &cik_resume,
1988 .asic_reset = &cik_asic_reset,
1989 .vga_set_state = &r600_vga_set_state,
1990 .ioctl_wait_idle = NULL,
1991 .gui_idle = &r600_gui_idle,
1992 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
1993 .get_xclk = &cik_get_xclk,
1994 .get_gpu_clock_counter = &cik_get_gpu_clock_counter,
1995 .gart = {
1996 .tlb_flush = &cik_pcie_gart_tlb_flush,
1997 .set_page = &rs600_gart_set_page,
1998 },
1999 .vm = {
2000 .init = &cik_vm_init,
2001 .fini = &cik_vm_fini,
Christian König24c16432013-10-30 11:51:09 -04002002 .set_page = &cik_sdma_vm_set_page,
Alex Deucher0672e272013-04-09 16:22:31 -04002003 },
2004 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02002005 [RADEON_RING_TYPE_GFX_INDEX] = &ci_gfx_ring,
2006 [CAYMAN_RING_TYPE_CP1_INDEX] = &ci_cp_ring,
2007 [CAYMAN_RING_TYPE_CP2_INDEX] = &ci_cp_ring,
2008 [R600_RING_TYPE_DMA_INDEX] = &ci_dma_ring,
2009 [CAYMAN_RING_TYPE_DMA1_INDEX] = &ci_dma_ring,
2010 [R600_RING_TYPE_UVD_INDEX] = &cayman_uvd_ring,
Christian Königd93f7932013-05-23 12:10:04 +02002011 [TN_RING_TYPE_VCE1_INDEX] = &ci_vce_ring,
2012 [TN_RING_TYPE_VCE2_INDEX] = &ci_vce_ring,
Alex Deucher0672e272013-04-09 16:22:31 -04002013 },
2014 .irq = {
2015 .set = &cik_irq_set,
2016 .process = &cik_irq_process,
2017 },
2018 .display = {
2019 .bandwidth_update = &dce8_bandwidth_update,
2020 .get_vblank_counter = &evergreen_get_vblank_counter,
2021 .wait_for_vblank = &dce4_wait_for_vblank,
Samuel Li7272c9d2013-11-19 15:04:45 -05002022 .set_backlight_level = &atombios_set_backlight_level,
2023 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherb5306022013-07-31 16:51:33 -04002024 .hdmi_enable = &evergreen_hdmi_enable,
2025 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucher0672e272013-04-09 16:22:31 -04002026 },
2027 .copy = {
Alex Deucher78196782013-12-09 17:38:51 -05002028 .blit = &cik_copy_cpdma,
Alex Deucher0672e272013-04-09 16:22:31 -04002029 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
2030 .dma = &cik_copy_dma,
2031 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Christian Königb5be1a82014-06-04 15:29:58 +02002032 .copy = &cik_copy_dma,
2033 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher0672e272013-04-09 16:22:31 -04002034 },
2035 .surface = {
2036 .set_reg = r600_set_surface_reg,
2037 .clear_reg = r600_clear_surface_reg,
2038 },
2039 .hpd = {
2040 .init = &evergreen_hpd_init,
2041 .fini = &evergreen_hpd_fini,
2042 .sense = &evergreen_hpd_sense,
2043 .set_polarity = &evergreen_hpd_set_polarity,
2044 },
2045 .pm = {
2046 .misc = &evergreen_pm_misc,
2047 .prepare = &evergreen_pm_prepare,
2048 .finish = &evergreen_pm_finish,
2049 .init_profile = &sumo_pm_init_profile,
2050 .get_dynpm_state = &r600_pm_get_dynpm_state,
2051 .get_engine_clock = &radeon_atom_get_engine_clock,
2052 .set_engine_clock = &radeon_atom_set_engine_clock,
2053 .get_memory_clock = &radeon_atom_get_memory_clock,
2054 .set_memory_clock = &radeon_atom_set_memory_clock,
2055 .get_pcie_lanes = NULL,
2056 .set_pcie_lanes = NULL,
2057 .set_clock_gating = NULL,
2058 .set_uvd_clocks = &cik_set_uvd_clocks,
Alex Deucher5ad6bf92013-08-22 17:09:06 -04002059 .set_vce_clocks = &cik_set_vce_clocks,
Alex Deucher286d9cc2013-06-21 15:50:47 -04002060 .get_temperature = &ci_get_temp,
Alex Deucher0672e272013-04-09 16:22:31 -04002061 },
Alex Deuchercc8dbbb2013-08-14 01:03:41 -04002062 .dpm = {
2063 .init = &ci_dpm_init,
2064 .setup_asic = &ci_dpm_setup_asic,
2065 .enable = &ci_dpm_enable,
Alex Deucher90208422013-12-19 13:59:46 -05002066 .late_enable = &ci_dpm_late_enable,
Alex Deuchercc8dbbb2013-08-14 01:03:41 -04002067 .disable = &ci_dpm_disable,
2068 .pre_set_power_state = &ci_dpm_pre_set_power_state,
2069 .set_power_state = &ci_dpm_set_power_state,
2070 .post_set_power_state = &ci_dpm_post_set_power_state,
2071 .display_configuration_changed = &ci_dpm_display_configuration_changed,
2072 .fini = &ci_dpm_fini,
2073 .get_sclk = &ci_dpm_get_sclk,
2074 .get_mclk = &ci_dpm_get_mclk,
2075 .print_power_state = &ci_dpm_print_power_state,
Alex Deucher94b4adc2013-07-15 17:34:33 -04002076 .debugfs_print_current_performance_level = &ci_dpm_debugfs_print_current_performance_level,
Alex Deucher89536fd2013-07-15 18:14:24 -04002077 .force_performance_level = &ci_dpm_force_performance_level,
Alex Deucher54961312013-07-15 18:24:31 -04002078 .vblank_too_short = &ci_dpm_vblank_too_short,
Alex Deucher942bdf72013-08-09 10:05:24 -04002079 .powergate_uvd = &ci_dpm_powergate_uvd,
Alex Deuchercc8dbbb2013-08-14 01:03:41 -04002080 },
Alex Deucher0672e272013-04-09 16:22:31 -04002081 .pflip = {
Alex Deucher0672e272013-04-09 16:22:31 -04002082 .page_flip = &evergreen_page_flip,
Christian König157fa142014-05-27 16:49:20 +02002083 .page_flip_pending = &evergreen_page_flip_pending,
Alex Deucher0672e272013-04-09 16:22:31 -04002084 },
2085};
2086
2087static struct radeon_asic kv_asic = {
2088 .init = &cik_init,
2089 .fini = &cik_fini,
2090 .suspend = &cik_suspend,
2091 .resume = &cik_resume,
2092 .asic_reset = &cik_asic_reset,
2093 .vga_set_state = &r600_vga_set_state,
2094 .ioctl_wait_idle = NULL,
2095 .gui_idle = &r600_gui_idle,
2096 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
2097 .get_xclk = &cik_get_xclk,
2098 .get_gpu_clock_counter = &cik_get_gpu_clock_counter,
2099 .gart = {
2100 .tlb_flush = &cik_pcie_gart_tlb_flush,
2101 .set_page = &rs600_gart_set_page,
2102 },
2103 .vm = {
2104 .init = &cik_vm_init,
2105 .fini = &cik_vm_fini,
Christian König24c16432013-10-30 11:51:09 -04002106 .set_page = &cik_sdma_vm_set_page,
Alex Deucher0672e272013-04-09 16:22:31 -04002107 },
2108 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02002109 [RADEON_RING_TYPE_GFX_INDEX] = &ci_gfx_ring,
2110 [CAYMAN_RING_TYPE_CP1_INDEX] = &ci_cp_ring,
2111 [CAYMAN_RING_TYPE_CP2_INDEX] = &ci_cp_ring,
2112 [R600_RING_TYPE_DMA_INDEX] = &ci_dma_ring,
2113 [CAYMAN_RING_TYPE_DMA1_INDEX] = &ci_dma_ring,
2114 [R600_RING_TYPE_UVD_INDEX] = &cayman_uvd_ring,
Christian Königd93f7932013-05-23 12:10:04 +02002115 [TN_RING_TYPE_VCE1_INDEX] = &ci_vce_ring,
2116 [TN_RING_TYPE_VCE2_INDEX] = &ci_vce_ring,
Alex Deucher0672e272013-04-09 16:22:31 -04002117 },
2118 .irq = {
2119 .set = &cik_irq_set,
2120 .process = &cik_irq_process,
2121 },
2122 .display = {
2123 .bandwidth_update = &dce8_bandwidth_update,
2124 .get_vblank_counter = &evergreen_get_vblank_counter,
2125 .wait_for_vblank = &dce4_wait_for_vblank,
Samuel Li7272c9d2013-11-19 15:04:45 -05002126 .set_backlight_level = &atombios_set_backlight_level,
2127 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherb5306022013-07-31 16:51:33 -04002128 .hdmi_enable = &evergreen_hdmi_enable,
2129 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucher0672e272013-04-09 16:22:31 -04002130 },
2131 .copy = {
Alex Deucher78196782013-12-09 17:38:51 -05002132 .blit = &cik_copy_cpdma,
Alex Deucher0672e272013-04-09 16:22:31 -04002133 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
2134 .dma = &cik_copy_dma,
2135 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
2136 .copy = &cik_copy_dma,
2137 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
2138 },
2139 .surface = {
2140 .set_reg = r600_set_surface_reg,
2141 .clear_reg = r600_clear_surface_reg,
2142 },
2143 .hpd = {
2144 .init = &evergreen_hpd_init,
2145 .fini = &evergreen_hpd_fini,
2146 .sense = &evergreen_hpd_sense,
2147 .set_polarity = &evergreen_hpd_set_polarity,
2148 },
2149 .pm = {
2150 .misc = &evergreen_pm_misc,
2151 .prepare = &evergreen_pm_prepare,
2152 .finish = &evergreen_pm_finish,
2153 .init_profile = &sumo_pm_init_profile,
2154 .get_dynpm_state = &r600_pm_get_dynpm_state,
2155 .get_engine_clock = &radeon_atom_get_engine_clock,
2156 .set_engine_clock = &radeon_atom_set_engine_clock,
2157 .get_memory_clock = &radeon_atom_get_memory_clock,
2158 .set_memory_clock = &radeon_atom_set_memory_clock,
2159 .get_pcie_lanes = NULL,
2160 .set_pcie_lanes = NULL,
2161 .set_clock_gating = NULL,
2162 .set_uvd_clocks = &cik_set_uvd_clocks,
Alex Deucher5ad6bf92013-08-22 17:09:06 -04002163 .set_vce_clocks = &cik_set_vce_clocks,
Alex Deucher286d9cc2013-06-21 15:50:47 -04002164 .get_temperature = &kv_get_temp,
Alex Deucher0672e272013-04-09 16:22:31 -04002165 },
Alex Deucher41a524a2013-08-14 01:01:40 -04002166 .dpm = {
2167 .init = &kv_dpm_init,
2168 .setup_asic = &kv_dpm_setup_asic,
2169 .enable = &kv_dpm_enable,
Alex Deucherd8852c32013-12-19 14:03:36 -05002170 .late_enable = &kv_dpm_late_enable,
Alex Deucher41a524a2013-08-14 01:01:40 -04002171 .disable = &kv_dpm_disable,
2172 .pre_set_power_state = &kv_dpm_pre_set_power_state,
2173 .set_power_state = &kv_dpm_set_power_state,
2174 .post_set_power_state = &kv_dpm_post_set_power_state,
2175 .display_configuration_changed = &kv_dpm_display_configuration_changed,
2176 .fini = &kv_dpm_fini,
2177 .get_sclk = &kv_dpm_get_sclk,
2178 .get_mclk = &kv_dpm_get_mclk,
2179 .print_power_state = &kv_dpm_print_power_state,
Alex Deucherae3e40e2013-07-18 16:39:53 -04002180 .debugfs_print_current_performance_level = &kv_dpm_debugfs_print_current_performance_level,
Alex Deucher2b4c8022013-07-18 16:48:46 -04002181 .force_performance_level = &kv_dpm_force_performance_level,
Alex Deucher77df5082013-08-09 10:02:40 -04002182 .powergate_uvd = &kv_dpm_powergate_uvd,
Alex Deucherb7a5ae92013-09-09 19:33:08 -04002183 .enable_bapm = &kv_dpm_enable_bapm,
Alex Deucher41a524a2013-08-14 01:01:40 -04002184 },
Alex Deucher0672e272013-04-09 16:22:31 -04002185 .pflip = {
Alex Deucher0672e272013-04-09 16:22:31 -04002186 .page_flip = &evergreen_page_flip,
Christian König157fa142014-05-27 16:49:20 +02002187 .page_flip_pending = &evergreen_page_flip_pending,
Alex Deucher0672e272013-04-09 16:22:31 -04002188 },
2189};
2190
Alex Deucherabf1dc62012-07-17 14:02:36 -04002191/**
2192 * radeon_asic_init - register asic specific callbacks
2193 *
2194 * @rdev: radeon device pointer
2195 *
2196 * Registers the appropriate asic specific callbacks for each
2197 * chip family. Also sets other asics specific info like the number
2198 * of crtcs and the register aperture accessors (all asics).
2199 * Returns 0 for success.
2200 */
Daniel Vetter0a10c852010-03-11 21:19:14 +00002201int radeon_asic_init(struct radeon_device *rdev)
2202{
2203 radeon_register_accessor_init(rdev);
Alex Deucherba7e05e2011-06-16 18:14:22 +00002204
2205 /* set the number of crtcs */
2206 if (rdev->flags & RADEON_SINGLE_CRTC)
2207 rdev->num_crtc = 1;
2208 else
2209 rdev->num_crtc = 2;
2210
Alex Deucher948bee32013-05-14 12:08:35 -04002211 rdev->has_uvd = false;
2212
Daniel Vetter0a10c852010-03-11 21:19:14 +00002213 switch (rdev->family) {
2214 case CHIP_R100:
2215 case CHIP_RV100:
2216 case CHIP_RS100:
2217 case CHIP_RV200:
2218 case CHIP_RS200:
2219 rdev->asic = &r100_asic;
2220 break;
2221 case CHIP_R200:
2222 case CHIP_RV250:
2223 case CHIP_RS300:
2224 case CHIP_RV280:
2225 rdev->asic = &r200_asic;
2226 break;
2227 case CHIP_R300:
2228 case CHIP_R350:
2229 case CHIP_RV350:
2230 case CHIP_RV380:
2231 if (rdev->flags & RADEON_IS_PCIE)
2232 rdev->asic = &r300_asic_pcie;
2233 else
2234 rdev->asic = &r300_asic;
2235 break;
2236 case CHIP_R420:
2237 case CHIP_R423:
2238 case CHIP_RV410:
2239 rdev->asic = &r420_asic;
Alex Deucher07bb0842010-06-22 21:58:26 -04002240 /* handle macs */
2241 if (rdev->bios == NULL) {
Alex Deucher798bcf72012-02-23 17:53:48 -05002242 rdev->asic->pm.get_engine_clock = &radeon_legacy_get_engine_clock;
2243 rdev->asic->pm.set_engine_clock = &radeon_legacy_set_engine_clock;
2244 rdev->asic->pm.get_memory_clock = &radeon_legacy_get_memory_clock;
2245 rdev->asic->pm.set_memory_clock = NULL;
Alex Deucher37e9b6a2012-08-03 11:39:43 -04002246 rdev->asic->display.set_backlight_level = &radeon_legacy_set_backlight_level;
Alex Deucher07bb0842010-06-22 21:58:26 -04002247 }
Daniel Vetter0a10c852010-03-11 21:19:14 +00002248 break;
2249 case CHIP_RS400:
2250 case CHIP_RS480:
2251 rdev->asic = &rs400_asic;
2252 break;
2253 case CHIP_RS600:
2254 rdev->asic = &rs600_asic;
2255 break;
2256 case CHIP_RS690:
2257 case CHIP_RS740:
2258 rdev->asic = &rs690_asic;
2259 break;
2260 case CHIP_RV515:
2261 rdev->asic = &rv515_asic;
2262 break;
2263 case CHIP_R520:
2264 case CHIP_RV530:
2265 case CHIP_RV560:
2266 case CHIP_RV570:
2267 case CHIP_R580:
2268 rdev->asic = &r520_asic;
2269 break;
2270 case CHIP_R600:
Alex Deucherca361b62013-06-21 14:42:08 -04002271 rdev->asic = &r600_asic;
2272 break;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002273 case CHIP_RV610:
2274 case CHIP_RV630:
2275 case CHIP_RV620:
2276 case CHIP_RV635:
2277 case CHIP_RV670:
Alex Deucherca361b62013-06-21 14:42:08 -04002278 rdev->asic = &rv6xx_asic;
2279 rdev->has_uvd = true;
Alex Deucherf47299c2010-03-16 20:54:38 -04002280 break;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002281 case CHIP_RS780:
2282 case CHIP_RS880:
Alex Deucherf47299c2010-03-16 20:54:38 -04002283 rdev->asic = &rs780_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002284 rdev->has_uvd = true;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002285 break;
2286 case CHIP_RV770:
2287 case CHIP_RV730:
2288 case CHIP_RV710:
2289 case CHIP_RV740:
2290 rdev->asic = &rv770_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002291 rdev->has_uvd = true;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002292 break;
2293 case CHIP_CEDAR:
2294 case CHIP_REDWOOD:
2295 case CHIP_JUNIPER:
2296 case CHIP_CYPRESS:
2297 case CHIP_HEMLOCK:
Alex Deucherba7e05e2011-06-16 18:14:22 +00002298 /* set num crtcs */
2299 if (rdev->family == CHIP_CEDAR)
2300 rdev->num_crtc = 4;
2301 else
2302 rdev->num_crtc = 6;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002303 rdev->asic = &evergreen_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002304 rdev->has_uvd = true;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002305 break;
Alex Deucher958261d2010-11-22 17:56:30 -05002306 case CHIP_PALM:
Alex Deucher89da5a32011-05-31 15:42:47 -04002307 case CHIP_SUMO:
2308 case CHIP_SUMO2:
Alex Deucher958261d2010-11-22 17:56:30 -05002309 rdev->asic = &sumo_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002310 rdev->has_uvd = true;
Alex Deucher958261d2010-11-22 17:56:30 -05002311 break;
Alex Deuchera43b7662011-01-06 21:19:33 -05002312 case CHIP_BARTS:
2313 case CHIP_TURKS:
2314 case CHIP_CAICOS:
Alex Deucherba7e05e2011-06-16 18:14:22 +00002315 /* set num crtcs */
2316 if (rdev->family == CHIP_CAICOS)
2317 rdev->num_crtc = 4;
2318 else
2319 rdev->num_crtc = 6;
Alex Deuchera43b7662011-01-06 21:19:33 -05002320 rdev->asic = &btc_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002321 rdev->has_uvd = true;
Alex Deuchera43b7662011-01-06 21:19:33 -05002322 break;
Alex Deuchere3487622011-03-02 20:07:36 -05002323 case CHIP_CAYMAN:
2324 rdev->asic = &cayman_asic;
Alex Deucherba7e05e2011-06-16 18:14:22 +00002325 /* set num crtcs */
2326 rdev->num_crtc = 6;
Alex Deucher948bee32013-05-14 12:08:35 -04002327 rdev->has_uvd = true;
Alex Deuchere3487622011-03-02 20:07:36 -05002328 break;
Alex Deucherbe63fe82012-03-20 17:18:40 -04002329 case CHIP_ARUBA:
2330 rdev->asic = &trinity_asic;
2331 /* set num crtcs */
2332 rdev->num_crtc = 4;
Alex Deucher948bee32013-05-14 12:08:35 -04002333 rdev->has_uvd = true;
Alex Deucherbe63fe82012-03-20 17:18:40 -04002334 break;
Alex Deucher02779c02012-03-20 17:18:25 -04002335 case CHIP_TAHITI:
2336 case CHIP_PITCAIRN:
2337 case CHIP_VERDE:
Alex Deuchere737a142012-08-30 14:00:03 -04002338 case CHIP_OLAND:
Alex Deucher86a45ca2012-07-26 19:04:20 -04002339 case CHIP_HAINAN:
Alex Deucher02779c02012-03-20 17:18:25 -04002340 rdev->asic = &si_asic;
2341 /* set num crtcs */
Alex Deucher86a45ca2012-07-26 19:04:20 -04002342 if (rdev->family == CHIP_HAINAN)
2343 rdev->num_crtc = 0;
2344 else if (rdev->family == CHIP_OLAND)
Alex Deuchere737a142012-08-30 14:00:03 -04002345 rdev->num_crtc = 2;
2346 else
2347 rdev->num_crtc = 6;
Alex Deucher948bee32013-05-14 12:08:35 -04002348 if (rdev->family == CHIP_HAINAN)
2349 rdev->has_uvd = false;
2350 else
2351 rdev->has_uvd = true;
Alex Deucher0116e1e2013-08-08 18:00:10 -04002352 switch (rdev->family) {
2353 case CHIP_TAHITI:
2354 rdev->cg_flags =
Alex Deucher090f4b62013-08-14 18:53:56 -04002355 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher0116e1e2013-08-08 18:00:10 -04002356 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deuchere16866e2013-08-08 19:34:07 -04002357 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
Alex Deucher0116e1e2013-08-08 18:00:10 -04002358 RADEON_CG_SUPPORT_GFX_CGLS |
2359 RADEON_CG_SUPPORT_GFX_CGTS |
2360 RADEON_CG_SUPPORT_GFX_CP_LS |
2361 RADEON_CG_SUPPORT_MC_MGCG |
2362 RADEON_CG_SUPPORT_SDMA_MGCG |
2363 RADEON_CG_SUPPORT_BIF_LS |
2364 RADEON_CG_SUPPORT_VCE_MGCG |
2365 RADEON_CG_SUPPORT_UVD_MGCG |
2366 RADEON_CG_SUPPORT_HDP_LS |
2367 RADEON_CG_SUPPORT_HDP_MGCG;
2368 rdev->pg_flags = 0;
2369 break;
2370 case CHIP_PITCAIRN:
2371 rdev->cg_flags =
Alex Deucher090f4b62013-08-14 18:53:56 -04002372 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher0116e1e2013-08-08 18:00:10 -04002373 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deuchere16866e2013-08-08 19:34:07 -04002374 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
Alex Deucher0116e1e2013-08-08 18:00:10 -04002375 RADEON_CG_SUPPORT_GFX_CGLS |
2376 RADEON_CG_SUPPORT_GFX_CGTS |
2377 RADEON_CG_SUPPORT_GFX_CP_LS |
2378 RADEON_CG_SUPPORT_GFX_RLC_LS |
2379 RADEON_CG_SUPPORT_MC_LS |
2380 RADEON_CG_SUPPORT_MC_MGCG |
2381 RADEON_CG_SUPPORT_SDMA_MGCG |
2382 RADEON_CG_SUPPORT_BIF_LS |
2383 RADEON_CG_SUPPORT_VCE_MGCG |
2384 RADEON_CG_SUPPORT_UVD_MGCG |
2385 RADEON_CG_SUPPORT_HDP_LS |
2386 RADEON_CG_SUPPORT_HDP_MGCG;
2387 rdev->pg_flags = 0;
2388 break;
2389 case CHIP_VERDE:
2390 rdev->cg_flags =
Alex Deucher090f4b62013-08-14 18:53:56 -04002391 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher0116e1e2013-08-08 18:00:10 -04002392 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deuchere16866e2013-08-08 19:34:07 -04002393 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
Alex Deucher0116e1e2013-08-08 18:00:10 -04002394 RADEON_CG_SUPPORT_GFX_CGLS |
2395 RADEON_CG_SUPPORT_GFX_CGTS |
2396 RADEON_CG_SUPPORT_GFX_CP_LS |
2397 RADEON_CG_SUPPORT_GFX_RLC_LS |
2398 RADEON_CG_SUPPORT_MC_LS |
2399 RADEON_CG_SUPPORT_MC_MGCG |
2400 RADEON_CG_SUPPORT_SDMA_MGCG |
2401 RADEON_CG_SUPPORT_BIF_LS |
2402 RADEON_CG_SUPPORT_VCE_MGCG |
2403 RADEON_CG_SUPPORT_UVD_MGCG |
2404 RADEON_CG_SUPPORT_HDP_LS |
2405 RADEON_CG_SUPPORT_HDP_MGCG;
Alex Deucherca6ebb32013-08-13 13:18:37 -04002406 rdev->pg_flags = 0 |
Alex Deucher2b19d172013-09-04 16:58:29 -04002407 /*RADEON_PG_SUPPORT_GFX_PG | */
Alex Deucherca6ebb32013-08-13 13:18:37 -04002408 RADEON_PG_SUPPORT_SDMA;
Alex Deucher0116e1e2013-08-08 18:00:10 -04002409 break;
2410 case CHIP_OLAND:
2411 rdev->cg_flags =
Alex Deucher090f4b62013-08-14 18:53:56 -04002412 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher0116e1e2013-08-08 18:00:10 -04002413 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deuchere16866e2013-08-08 19:34:07 -04002414 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
Alex Deucher0116e1e2013-08-08 18:00:10 -04002415 RADEON_CG_SUPPORT_GFX_CGLS |
2416 RADEON_CG_SUPPORT_GFX_CGTS |
2417 RADEON_CG_SUPPORT_GFX_CP_LS |
2418 RADEON_CG_SUPPORT_GFX_RLC_LS |
2419 RADEON_CG_SUPPORT_MC_LS |
2420 RADEON_CG_SUPPORT_MC_MGCG |
2421 RADEON_CG_SUPPORT_SDMA_MGCG |
2422 RADEON_CG_SUPPORT_BIF_LS |
2423 RADEON_CG_SUPPORT_UVD_MGCG |
2424 RADEON_CG_SUPPORT_HDP_LS |
2425 RADEON_CG_SUPPORT_HDP_MGCG;
2426 rdev->pg_flags = 0;
2427 break;
2428 case CHIP_HAINAN:
2429 rdev->cg_flags =
Alex Deucher090f4b62013-08-14 18:53:56 -04002430 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher0116e1e2013-08-08 18:00:10 -04002431 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deuchere16866e2013-08-08 19:34:07 -04002432 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
Alex Deucher0116e1e2013-08-08 18:00:10 -04002433 RADEON_CG_SUPPORT_GFX_CGLS |
2434 RADEON_CG_SUPPORT_GFX_CGTS |
2435 RADEON_CG_SUPPORT_GFX_CP_LS |
2436 RADEON_CG_SUPPORT_GFX_RLC_LS |
2437 RADEON_CG_SUPPORT_MC_LS |
2438 RADEON_CG_SUPPORT_MC_MGCG |
2439 RADEON_CG_SUPPORT_SDMA_MGCG |
2440 RADEON_CG_SUPPORT_BIF_LS |
2441 RADEON_CG_SUPPORT_HDP_LS |
2442 RADEON_CG_SUPPORT_HDP_MGCG;
2443 rdev->pg_flags = 0;
2444 break;
2445 default:
2446 rdev->cg_flags = 0;
2447 rdev->pg_flags = 0;
2448 break;
2449 }
Alex Deucher02779c02012-03-20 17:18:25 -04002450 break;
Alex Deucher0672e272013-04-09 16:22:31 -04002451 case CHIP_BONAIRE:
Alex Deucher41971b32013-08-19 18:02:26 -04002452 case CHIP_HAWAII:
Alex Deucher0672e272013-04-09 16:22:31 -04002453 rdev->asic = &ci_asic;
2454 rdev->num_crtc = 6;
Alex Deucher22c775c2013-07-23 09:41:05 -04002455 rdev->has_uvd = true;
Alex Deucher41971b32013-08-19 18:02:26 -04002456 if (rdev->family == CHIP_BONAIRE) {
2457 rdev->cg_flags =
2458 RADEON_CG_SUPPORT_GFX_MGCG |
2459 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deucher92598db2013-12-19 09:13:30 -05002460 RADEON_CG_SUPPORT_GFX_CGCG |
Alex Deucher41971b32013-08-19 18:02:26 -04002461 RADEON_CG_SUPPORT_GFX_CGLS |
2462 RADEON_CG_SUPPORT_GFX_CGTS |
2463 RADEON_CG_SUPPORT_GFX_CGTS_LS |
2464 RADEON_CG_SUPPORT_GFX_CP_LS |
2465 RADEON_CG_SUPPORT_MC_LS |
2466 RADEON_CG_SUPPORT_MC_MGCG |
2467 RADEON_CG_SUPPORT_SDMA_MGCG |
2468 RADEON_CG_SUPPORT_SDMA_LS |
2469 RADEON_CG_SUPPORT_BIF_LS |
2470 RADEON_CG_SUPPORT_VCE_MGCG |
2471 RADEON_CG_SUPPORT_UVD_MGCG |
2472 RADEON_CG_SUPPORT_HDP_LS |
2473 RADEON_CG_SUPPORT_HDP_MGCG;
2474 rdev->pg_flags = 0;
2475 } else {
2476 rdev->cg_flags =
2477 RADEON_CG_SUPPORT_GFX_MGCG |
2478 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deucher92598db2013-12-19 09:13:30 -05002479 RADEON_CG_SUPPORT_GFX_CGCG |
Alex Deucher41971b32013-08-19 18:02:26 -04002480 RADEON_CG_SUPPORT_GFX_CGLS |
2481 RADEON_CG_SUPPORT_GFX_CGTS |
2482 RADEON_CG_SUPPORT_GFX_CP_LS |
2483 RADEON_CG_SUPPORT_MC_LS |
2484 RADEON_CG_SUPPORT_MC_MGCG |
2485 RADEON_CG_SUPPORT_SDMA_MGCG |
2486 RADEON_CG_SUPPORT_SDMA_LS |
2487 RADEON_CG_SUPPORT_BIF_LS |
2488 RADEON_CG_SUPPORT_VCE_MGCG |
2489 RADEON_CG_SUPPORT_UVD_MGCG |
2490 RADEON_CG_SUPPORT_HDP_LS |
2491 RADEON_CG_SUPPORT_HDP_MGCG;
2492 rdev->pg_flags = 0;
2493 }
Alex Deucher0672e272013-04-09 16:22:31 -04002494 break;
2495 case CHIP_KAVERI:
2496 case CHIP_KABINI:
Samuel Lib0a9f222014-04-30 18:40:48 -04002497 case CHIP_MULLINS:
Alex Deucher0672e272013-04-09 16:22:31 -04002498 rdev->asic = &kv_asic;
2499 /* set num crtcs */
Alex Deucher473359b2013-08-09 11:18:39 -04002500 if (rdev->family == CHIP_KAVERI) {
Alex Deucher0672e272013-04-09 16:22:31 -04002501 rdev->num_crtc = 4;
Alex Deucher473359b2013-08-09 11:18:39 -04002502 rdev->cg_flags =
Alex Deucher773dc102013-08-14 18:58:43 -04002503 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher473359b2013-08-09 11:18:39 -04002504 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deucher0042fca2013-12-19 09:15:24 -05002505 RADEON_CG_SUPPORT_GFX_CGCG |
Alex Deucher473359b2013-08-09 11:18:39 -04002506 RADEON_CG_SUPPORT_GFX_CGLS |
2507 RADEON_CG_SUPPORT_GFX_CGTS |
2508 RADEON_CG_SUPPORT_GFX_CGTS_LS |
2509 RADEON_CG_SUPPORT_GFX_CP_LS |
2510 RADEON_CG_SUPPORT_SDMA_MGCG |
2511 RADEON_CG_SUPPORT_SDMA_LS |
2512 RADEON_CG_SUPPORT_BIF_LS |
2513 RADEON_CG_SUPPORT_VCE_MGCG |
2514 RADEON_CG_SUPPORT_UVD_MGCG |
2515 RADEON_CG_SUPPORT_HDP_LS |
2516 RADEON_CG_SUPPORT_HDP_MGCG;
2517 rdev->pg_flags = 0;
Alex Deucher2b19d172013-09-04 16:58:29 -04002518 /*RADEON_PG_SUPPORT_GFX_PG |
Alex Deucher473359b2013-08-09 11:18:39 -04002519 RADEON_PG_SUPPORT_GFX_SMG |
2520 RADEON_PG_SUPPORT_GFX_DMG |
2521 RADEON_PG_SUPPORT_UVD |
2522 RADEON_PG_SUPPORT_VCE |
2523 RADEON_PG_SUPPORT_CP |
2524 RADEON_PG_SUPPORT_GDS |
2525 RADEON_PG_SUPPORT_RLC_SMU_HS |
2526 RADEON_PG_SUPPORT_ACP |
2527 RADEON_PG_SUPPORT_SAMU;*/
2528 } else {
Alex Deucher0672e272013-04-09 16:22:31 -04002529 rdev->num_crtc = 2;
Alex Deucher473359b2013-08-09 11:18:39 -04002530 rdev->cg_flags =
Alex Deucher773dc102013-08-14 18:58:43 -04002531 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher473359b2013-08-09 11:18:39 -04002532 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deucher0042fca2013-12-19 09:15:24 -05002533 RADEON_CG_SUPPORT_GFX_CGCG |
Alex Deucher473359b2013-08-09 11:18:39 -04002534 RADEON_CG_SUPPORT_GFX_CGLS |
2535 RADEON_CG_SUPPORT_GFX_CGTS |
2536 RADEON_CG_SUPPORT_GFX_CGTS_LS |
2537 RADEON_CG_SUPPORT_GFX_CP_LS |
2538 RADEON_CG_SUPPORT_SDMA_MGCG |
2539 RADEON_CG_SUPPORT_SDMA_LS |
2540 RADEON_CG_SUPPORT_BIF_LS |
2541 RADEON_CG_SUPPORT_VCE_MGCG |
2542 RADEON_CG_SUPPORT_UVD_MGCG |
2543 RADEON_CG_SUPPORT_HDP_LS |
2544 RADEON_CG_SUPPORT_HDP_MGCG;
2545 rdev->pg_flags = 0;
Alex Deucher2b19d172013-09-04 16:58:29 -04002546 /*RADEON_PG_SUPPORT_GFX_PG |
Alex Deucher473359b2013-08-09 11:18:39 -04002547 RADEON_PG_SUPPORT_GFX_SMG |
2548 RADEON_PG_SUPPORT_UVD |
2549 RADEON_PG_SUPPORT_VCE |
2550 RADEON_PG_SUPPORT_CP |
2551 RADEON_PG_SUPPORT_GDS |
2552 RADEON_PG_SUPPORT_RLC_SMU_HS |
2553 RADEON_PG_SUPPORT_SAMU;*/
2554 }
Alex Deucher22c775c2013-07-23 09:41:05 -04002555 rdev->has_uvd = true;
Alex Deucher0672e272013-04-09 16:22:31 -04002556 break;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002557 default:
2558 /* FIXME: not supported yet */
2559 return -EINVAL;
2560 }
2561
2562 if (rdev->flags & RADEON_IS_IGP) {
Alex Deucher798bcf72012-02-23 17:53:48 -05002563 rdev->asic->pm.get_memory_clock = NULL;
2564 rdev->asic->pm.set_memory_clock = NULL;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002565 }
2566
Daniel Vetter0a10c852010-03-11 21:19:14 +00002567 return 0;
2568}
2569