blob: eeeeabe09758ddccf2175ad48d9b9bd62e896e83 [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,
Michel Dänzer72a99872014-07-31 18:43:49 +0900188 .hdp_flush = &r100_ring_hdp_flush,
Christian König76a0df82013-08-13 11:56:50 +0200189};
190
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000191static struct radeon_asic r100_asic = {
192 .init = &r100_init,
193 .fini = &r100_fini,
194 .suspend = &r100_suspend,
195 .resume = &r100_resume,
196 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000197 .asic_reset = &r100_asic_reset,
Michel Dänzer124764f2014-07-31 18:43:48 +0900198 .mmio_hdp_flush = NULL,
Alex Deucher54e88e02012-02-23 18:10:29 -0500199 .gui_idle = &r100_gui_idle,
200 .mc_wait_for_idle = &r100_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500201 .gart = {
202 .tlb_flush = &r100_pci_gart_tlb_flush,
203 .set_page = &r100_pci_gart_set_page,
204 },
Christian König4c87bc22011-10-19 19:02:21 +0200205 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200206 [RADEON_RING_TYPE_GFX_INDEX] = &r100_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200207 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500208 .irq = {
209 .set = &r100_irq_set,
210 .process = &r100_irq_process,
211 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500212 .display = {
213 .bandwidth_update = &r100_bandwidth_update,
214 .get_vblank_counter = &r100_get_vblank_counter,
215 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400216 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400217 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500218 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500219 .copy = {
220 .blit = &r100_copy_blit,
221 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
222 .dma = NULL,
223 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
224 .copy = &r100_copy_blit,
225 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
226 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500227 .surface = {
228 .set_reg = r100_set_surface_reg,
229 .clear_reg = r100_clear_surface_reg,
230 },
Alex Deucher901ea572012-02-23 17:53:39 -0500231 .hpd = {
232 .init = &r100_hpd_init,
233 .fini = &r100_hpd_fini,
234 .sense = &r100_hpd_sense,
235 .set_polarity = &r100_hpd_set_polarity,
236 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500237 .pm = {
238 .misc = &r100_pm_misc,
239 .prepare = &r100_pm_prepare,
240 .finish = &r100_pm_finish,
241 .init_profile = &r100_pm_init_profile,
242 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500243 .get_engine_clock = &radeon_legacy_get_engine_clock,
244 .set_engine_clock = &radeon_legacy_set_engine_clock,
245 .get_memory_clock = &radeon_legacy_get_memory_clock,
246 .set_memory_clock = NULL,
247 .get_pcie_lanes = NULL,
248 .set_pcie_lanes = NULL,
249 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500250 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500251 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500252 .page_flip = &r100_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200253 .page_flip_pending = &r100_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500254 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000255};
256
257static struct radeon_asic r200_asic = {
258 .init = &r100_init,
259 .fini = &r100_fini,
260 .suspend = &r100_suspend,
261 .resume = &r100_resume,
262 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000263 .asic_reset = &r100_asic_reset,
Michel Dänzer124764f2014-07-31 18:43:48 +0900264 .mmio_hdp_flush = NULL,
Alex Deucher54e88e02012-02-23 18:10:29 -0500265 .gui_idle = &r100_gui_idle,
266 .mc_wait_for_idle = &r100_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500267 .gart = {
268 .tlb_flush = &r100_pci_gart_tlb_flush,
269 .set_page = &r100_pci_gart_set_page,
270 },
Christian König4c87bc22011-10-19 19:02:21 +0200271 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200272 [RADEON_RING_TYPE_GFX_INDEX] = &r100_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200273 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500274 .irq = {
275 .set = &r100_irq_set,
276 .process = &r100_irq_process,
277 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500278 .display = {
279 .bandwidth_update = &r100_bandwidth_update,
280 .get_vblank_counter = &r100_get_vblank_counter,
281 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400282 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400283 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500284 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500285 .copy = {
286 .blit = &r100_copy_blit,
287 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
288 .dma = &r200_copy_dma,
289 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
290 .copy = &r100_copy_blit,
291 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
292 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500293 .surface = {
294 .set_reg = r100_set_surface_reg,
295 .clear_reg = r100_clear_surface_reg,
296 },
Alex Deucher901ea572012-02-23 17:53:39 -0500297 .hpd = {
298 .init = &r100_hpd_init,
299 .fini = &r100_hpd_fini,
300 .sense = &r100_hpd_sense,
301 .set_polarity = &r100_hpd_set_polarity,
302 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500303 .pm = {
304 .misc = &r100_pm_misc,
305 .prepare = &r100_pm_prepare,
306 .finish = &r100_pm_finish,
307 .init_profile = &r100_pm_init_profile,
308 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500309 .get_engine_clock = &radeon_legacy_get_engine_clock,
310 .set_engine_clock = &radeon_legacy_set_engine_clock,
311 .get_memory_clock = &radeon_legacy_get_memory_clock,
312 .set_memory_clock = NULL,
313 .get_pcie_lanes = NULL,
314 .set_pcie_lanes = NULL,
315 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500316 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500317 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500318 .page_flip = &r100_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200319 .page_flip_pending = &r100_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500320 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000321};
322
Christian König76a0df82013-08-13 11:56:50 +0200323static struct radeon_asic_ring r300_gfx_ring = {
324 .ib_execute = &r100_ring_ib_execute,
325 .emit_fence = &r300_fence_ring_emit,
326 .emit_semaphore = &r100_semaphore_ring_emit,
327 .cs_parse = &r300_cs_parse,
328 .ring_start = &r300_ring_start,
329 .ring_test = &r100_ring_test,
330 .ib_test = &r100_ib_test,
331 .is_lockup = &r100_gpu_is_lockup,
Alex Deucherea31bf62013-12-09 19:44:30 -0500332 .get_rptr = &r100_gfx_get_rptr,
333 .get_wptr = &r100_gfx_get_wptr,
334 .set_wptr = &r100_gfx_set_wptr,
Michel Dänzer72a99872014-07-31 18:43:49 +0900335 .hdp_flush = &r100_ring_hdp_flush,
Christian König76a0df82013-08-13 11:56:50 +0200336};
337
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000338static struct radeon_asic r300_asic = {
339 .init = &r300_init,
340 .fini = &r300_fini,
341 .suspend = &r300_suspend,
342 .resume = &r300_resume,
343 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000344 .asic_reset = &r300_asic_reset,
Michel Dänzer124764f2014-07-31 18:43:48 +0900345 .mmio_hdp_flush = NULL,
Alex Deucher54e88e02012-02-23 18:10:29 -0500346 .gui_idle = &r100_gui_idle,
347 .mc_wait_for_idle = &r300_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500348 .gart = {
349 .tlb_flush = &r100_pci_gart_tlb_flush,
350 .set_page = &r100_pci_gart_set_page,
351 },
Christian König4c87bc22011-10-19 19:02:21 +0200352 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200353 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200354 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500355 .irq = {
356 .set = &r100_irq_set,
357 .process = &r100_irq_process,
358 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500359 .display = {
360 .bandwidth_update = &r100_bandwidth_update,
361 .get_vblank_counter = &r100_get_vblank_counter,
362 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400363 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400364 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500365 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500366 .copy = {
367 .blit = &r100_copy_blit,
368 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
369 .dma = &r200_copy_dma,
370 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
371 .copy = &r100_copy_blit,
372 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
373 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500374 .surface = {
375 .set_reg = r100_set_surface_reg,
376 .clear_reg = r100_clear_surface_reg,
377 },
Alex Deucher901ea572012-02-23 17:53:39 -0500378 .hpd = {
379 .init = &r100_hpd_init,
380 .fini = &r100_hpd_fini,
381 .sense = &r100_hpd_sense,
382 .set_polarity = &r100_hpd_set_polarity,
383 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500384 .pm = {
385 .misc = &r100_pm_misc,
386 .prepare = &r100_pm_prepare,
387 .finish = &r100_pm_finish,
388 .init_profile = &r100_pm_init_profile,
389 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500390 .get_engine_clock = &radeon_legacy_get_engine_clock,
391 .set_engine_clock = &radeon_legacy_set_engine_clock,
392 .get_memory_clock = &radeon_legacy_get_memory_clock,
393 .set_memory_clock = NULL,
394 .get_pcie_lanes = &rv370_get_pcie_lanes,
395 .set_pcie_lanes = &rv370_set_pcie_lanes,
396 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500397 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500398 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500399 .page_flip = &r100_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200400 .page_flip_pending = &r100_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500401 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000402};
403
404static struct radeon_asic r300_asic_pcie = {
405 .init = &r300_init,
406 .fini = &r300_fini,
407 .suspend = &r300_suspend,
408 .resume = &r300_resume,
409 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000410 .asic_reset = &r300_asic_reset,
Michel Dänzer124764f2014-07-31 18:43:48 +0900411 .mmio_hdp_flush = NULL,
Alex Deucher54e88e02012-02-23 18:10:29 -0500412 .gui_idle = &r100_gui_idle,
413 .mc_wait_for_idle = &r300_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500414 .gart = {
415 .tlb_flush = &rv370_pcie_gart_tlb_flush,
416 .set_page = &rv370_pcie_gart_set_page,
417 },
Christian König4c87bc22011-10-19 19:02:21 +0200418 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200419 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200420 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500421 .irq = {
422 .set = &r100_irq_set,
423 .process = &r100_irq_process,
424 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500425 .display = {
426 .bandwidth_update = &r100_bandwidth_update,
427 .get_vblank_counter = &r100_get_vblank_counter,
428 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400429 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400430 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500431 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500432 .copy = {
433 .blit = &r100_copy_blit,
434 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
435 .dma = &r200_copy_dma,
436 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
437 .copy = &r100_copy_blit,
438 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
439 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500440 .surface = {
441 .set_reg = r100_set_surface_reg,
442 .clear_reg = r100_clear_surface_reg,
443 },
Alex Deucher901ea572012-02-23 17:53:39 -0500444 .hpd = {
445 .init = &r100_hpd_init,
446 .fini = &r100_hpd_fini,
447 .sense = &r100_hpd_sense,
448 .set_polarity = &r100_hpd_set_polarity,
449 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500450 .pm = {
451 .misc = &r100_pm_misc,
452 .prepare = &r100_pm_prepare,
453 .finish = &r100_pm_finish,
454 .init_profile = &r100_pm_init_profile,
455 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500456 .get_engine_clock = &radeon_legacy_get_engine_clock,
457 .set_engine_clock = &radeon_legacy_set_engine_clock,
458 .get_memory_clock = &radeon_legacy_get_memory_clock,
459 .set_memory_clock = NULL,
460 .get_pcie_lanes = &rv370_get_pcie_lanes,
461 .set_pcie_lanes = &rv370_set_pcie_lanes,
462 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500463 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500464 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500465 .page_flip = &r100_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200466 .page_flip_pending = &r100_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500467 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000468};
469
470static struct radeon_asic r420_asic = {
471 .init = &r420_init,
472 .fini = &r420_fini,
473 .suspend = &r420_suspend,
474 .resume = &r420_resume,
475 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000476 .asic_reset = &r300_asic_reset,
Michel Dänzer124764f2014-07-31 18:43:48 +0900477 .mmio_hdp_flush = NULL,
Alex Deucher54e88e02012-02-23 18:10:29 -0500478 .gui_idle = &r100_gui_idle,
479 .mc_wait_for_idle = &r300_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500480 .gart = {
481 .tlb_flush = &rv370_pcie_gart_tlb_flush,
482 .set_page = &rv370_pcie_gart_set_page,
483 },
Christian König4c87bc22011-10-19 19:02:21 +0200484 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200485 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200486 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500487 .irq = {
488 .set = &r100_irq_set,
489 .process = &r100_irq_process,
490 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500491 .display = {
492 .bandwidth_update = &r100_bandwidth_update,
493 .get_vblank_counter = &r100_get_vblank_counter,
494 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400495 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400496 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500497 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500498 .copy = {
499 .blit = &r100_copy_blit,
500 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
501 .dma = &r200_copy_dma,
502 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
503 .copy = &r100_copy_blit,
504 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
505 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500506 .surface = {
507 .set_reg = r100_set_surface_reg,
508 .clear_reg = r100_clear_surface_reg,
509 },
Alex Deucher901ea572012-02-23 17:53:39 -0500510 .hpd = {
511 .init = &r100_hpd_init,
512 .fini = &r100_hpd_fini,
513 .sense = &r100_hpd_sense,
514 .set_polarity = &r100_hpd_set_polarity,
515 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500516 .pm = {
517 .misc = &r100_pm_misc,
518 .prepare = &r100_pm_prepare,
519 .finish = &r100_pm_finish,
520 .init_profile = &r420_pm_init_profile,
521 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500522 .get_engine_clock = &radeon_atom_get_engine_clock,
523 .set_engine_clock = &radeon_atom_set_engine_clock,
524 .get_memory_clock = &radeon_atom_get_memory_clock,
525 .set_memory_clock = &radeon_atom_set_memory_clock,
526 .get_pcie_lanes = &rv370_get_pcie_lanes,
527 .set_pcie_lanes = &rv370_set_pcie_lanes,
528 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500529 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500530 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500531 .page_flip = &r100_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200532 .page_flip_pending = &r100_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500533 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000534};
535
536static struct radeon_asic rs400_asic = {
537 .init = &rs400_init,
538 .fini = &rs400_fini,
539 .suspend = &rs400_suspend,
540 .resume = &rs400_resume,
541 .vga_set_state = &r100_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000542 .asic_reset = &r300_asic_reset,
Michel Dänzer124764f2014-07-31 18:43:48 +0900543 .mmio_hdp_flush = NULL,
Alex Deucher54e88e02012-02-23 18:10:29 -0500544 .gui_idle = &r100_gui_idle,
545 .mc_wait_for_idle = &rs400_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500546 .gart = {
547 .tlb_flush = &rs400_gart_tlb_flush,
548 .set_page = &rs400_gart_set_page,
549 },
Christian König4c87bc22011-10-19 19:02:21 +0200550 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200551 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200552 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500553 .irq = {
554 .set = &r100_irq_set,
555 .process = &r100_irq_process,
556 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500557 .display = {
558 .bandwidth_update = &r100_bandwidth_update,
559 .get_vblank_counter = &r100_get_vblank_counter,
560 .wait_for_vblank = &r100_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400561 .set_backlight_level = &radeon_legacy_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400562 .get_backlight_level = &radeon_legacy_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500563 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500564 .copy = {
565 .blit = &r100_copy_blit,
566 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
567 .dma = &r200_copy_dma,
568 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
569 .copy = &r100_copy_blit,
570 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
571 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500572 .surface = {
573 .set_reg = r100_set_surface_reg,
574 .clear_reg = r100_clear_surface_reg,
575 },
Alex Deucher901ea572012-02-23 17:53:39 -0500576 .hpd = {
577 .init = &r100_hpd_init,
578 .fini = &r100_hpd_fini,
579 .sense = &r100_hpd_sense,
580 .set_polarity = &r100_hpd_set_polarity,
581 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500582 .pm = {
583 .misc = &r100_pm_misc,
584 .prepare = &r100_pm_prepare,
585 .finish = &r100_pm_finish,
586 .init_profile = &r100_pm_init_profile,
587 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500588 .get_engine_clock = &radeon_legacy_get_engine_clock,
589 .set_engine_clock = &radeon_legacy_set_engine_clock,
590 .get_memory_clock = &radeon_legacy_get_memory_clock,
591 .set_memory_clock = NULL,
592 .get_pcie_lanes = NULL,
593 .set_pcie_lanes = NULL,
594 .set_clock_gating = &radeon_legacy_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500595 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500596 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500597 .page_flip = &r100_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200598 .page_flip_pending = &r100_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500599 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000600};
601
602static struct radeon_asic rs600_asic = {
603 .init = &rs600_init,
604 .fini = &rs600_fini,
605 .suspend = &rs600_suspend,
606 .resume = &rs600_resume,
607 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000608 .asic_reset = &rs600_asic_reset,
Michel Dänzer124764f2014-07-31 18:43:48 +0900609 .mmio_hdp_flush = NULL,
Alex Deucher54e88e02012-02-23 18:10:29 -0500610 .gui_idle = &r100_gui_idle,
611 .mc_wait_for_idle = &rs600_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500612 .gart = {
613 .tlb_flush = &rs600_gart_tlb_flush,
614 .set_page = &rs600_gart_set_page,
615 },
Christian König4c87bc22011-10-19 19:02:21 +0200616 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200617 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200618 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500619 .irq = {
620 .set = &rs600_irq_set,
621 .process = &rs600_irq_process,
622 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500623 .display = {
624 .bandwidth_update = &rs600_bandwidth_update,
625 .get_vblank_counter = &rs600_get_vblank_counter,
626 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400627 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400628 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -0400629 .hdmi_enable = &r600_hdmi_enable,
630 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500631 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500632 .copy = {
633 .blit = &r100_copy_blit,
634 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
635 .dma = &r200_copy_dma,
636 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
637 .copy = &r100_copy_blit,
638 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
639 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500640 .surface = {
641 .set_reg = r100_set_surface_reg,
642 .clear_reg = r100_clear_surface_reg,
643 },
Alex Deucher901ea572012-02-23 17:53:39 -0500644 .hpd = {
645 .init = &rs600_hpd_init,
646 .fini = &rs600_hpd_fini,
647 .sense = &rs600_hpd_sense,
648 .set_polarity = &rs600_hpd_set_polarity,
649 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500650 .pm = {
651 .misc = &rs600_pm_misc,
652 .prepare = &rs600_pm_prepare,
653 .finish = &rs600_pm_finish,
654 .init_profile = &r420_pm_init_profile,
655 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500656 .get_engine_clock = &radeon_atom_get_engine_clock,
657 .set_engine_clock = &radeon_atom_set_engine_clock,
658 .get_memory_clock = &radeon_atom_get_memory_clock,
659 .set_memory_clock = &radeon_atom_set_memory_clock,
660 .get_pcie_lanes = NULL,
661 .set_pcie_lanes = NULL,
662 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500663 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500664 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500665 .page_flip = &rs600_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200666 .page_flip_pending = &rs600_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500667 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000668};
669
670static struct radeon_asic rs690_asic = {
671 .init = &rs690_init,
672 .fini = &rs690_fini,
673 .suspend = &rs690_suspend,
674 .resume = &rs690_resume,
675 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000676 .asic_reset = &rs600_asic_reset,
Michel Dänzer124764f2014-07-31 18:43:48 +0900677 .mmio_hdp_flush = NULL,
Alex Deucher54e88e02012-02-23 18:10:29 -0500678 .gui_idle = &r100_gui_idle,
679 .mc_wait_for_idle = &rs690_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500680 .gart = {
681 .tlb_flush = &rs400_gart_tlb_flush,
682 .set_page = &rs400_gart_set_page,
683 },
Christian König4c87bc22011-10-19 19:02:21 +0200684 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200685 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200686 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500687 .irq = {
688 .set = &rs600_irq_set,
689 .process = &rs600_irq_process,
690 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500691 .display = {
692 .get_vblank_counter = &rs600_get_vblank_counter,
693 .bandwidth_update = &rs690_bandwidth_update,
694 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400695 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400696 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -0400697 .hdmi_enable = &r600_hdmi_enable,
698 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500699 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500700 .copy = {
701 .blit = &r100_copy_blit,
702 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
703 .dma = &r200_copy_dma,
704 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
705 .copy = &r200_copy_dma,
706 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
707 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500708 .surface = {
709 .set_reg = r100_set_surface_reg,
710 .clear_reg = r100_clear_surface_reg,
711 },
Alex Deucher901ea572012-02-23 17:53:39 -0500712 .hpd = {
713 .init = &rs600_hpd_init,
714 .fini = &rs600_hpd_fini,
715 .sense = &rs600_hpd_sense,
716 .set_polarity = &rs600_hpd_set_polarity,
717 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500718 .pm = {
719 .misc = &rs600_pm_misc,
720 .prepare = &rs600_pm_prepare,
721 .finish = &rs600_pm_finish,
722 .init_profile = &r420_pm_init_profile,
723 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500724 .get_engine_clock = &radeon_atom_get_engine_clock,
725 .set_engine_clock = &radeon_atom_set_engine_clock,
726 .get_memory_clock = &radeon_atom_get_memory_clock,
727 .set_memory_clock = &radeon_atom_set_memory_clock,
728 .get_pcie_lanes = NULL,
729 .set_pcie_lanes = NULL,
730 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500731 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500732 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500733 .page_flip = &rs600_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200734 .page_flip_pending = &rs600_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500735 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000736};
737
738static struct radeon_asic rv515_asic = {
739 .init = &rv515_init,
740 .fini = &rv515_fini,
741 .suspend = &rv515_suspend,
742 .resume = &rv515_resume,
743 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000744 .asic_reset = &rs600_asic_reset,
Michel Dänzer124764f2014-07-31 18:43:48 +0900745 .mmio_hdp_flush = NULL,
Alex Deucher54e88e02012-02-23 18:10:29 -0500746 .gui_idle = &r100_gui_idle,
747 .mc_wait_for_idle = &rv515_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500748 .gart = {
749 .tlb_flush = &rv370_pcie_gart_tlb_flush,
750 .set_page = &rv370_pcie_gart_set_page,
751 },
Christian König4c87bc22011-10-19 19:02:21 +0200752 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200753 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200754 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500755 .irq = {
756 .set = &rs600_irq_set,
757 .process = &rs600_irq_process,
758 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500759 .display = {
760 .get_vblank_counter = &rs600_get_vblank_counter,
761 .bandwidth_update = &rv515_bandwidth_update,
762 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400763 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400764 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500765 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500766 .copy = {
767 .blit = &r100_copy_blit,
768 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
769 .dma = &r200_copy_dma,
770 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
771 .copy = &r100_copy_blit,
772 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
773 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500774 .surface = {
775 .set_reg = r100_set_surface_reg,
776 .clear_reg = r100_clear_surface_reg,
777 },
Alex Deucher901ea572012-02-23 17:53:39 -0500778 .hpd = {
779 .init = &rs600_hpd_init,
780 .fini = &rs600_hpd_fini,
781 .sense = &rs600_hpd_sense,
782 .set_polarity = &rs600_hpd_set_polarity,
783 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500784 .pm = {
785 .misc = &rs600_pm_misc,
786 .prepare = &rs600_pm_prepare,
787 .finish = &rs600_pm_finish,
788 .init_profile = &r420_pm_init_profile,
789 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500790 .get_engine_clock = &radeon_atom_get_engine_clock,
791 .set_engine_clock = &radeon_atom_set_engine_clock,
792 .get_memory_clock = &radeon_atom_get_memory_clock,
793 .set_memory_clock = &radeon_atom_set_memory_clock,
794 .get_pcie_lanes = &rv370_get_pcie_lanes,
795 .set_pcie_lanes = &rv370_set_pcie_lanes,
796 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500797 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500798 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500799 .page_flip = &rs600_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200800 .page_flip_pending = &rs600_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500801 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000802};
803
804static struct radeon_asic r520_asic = {
805 .init = &r520_init,
806 .fini = &rv515_fini,
807 .suspend = &rv515_suspend,
808 .resume = &r520_resume,
809 .vga_set_state = &r100_vga_set_state,
Jerome Glisse90aca4d2010-03-09 14:45:12 +0000810 .asic_reset = &rs600_asic_reset,
Michel Dänzer124764f2014-07-31 18:43:48 +0900811 .mmio_hdp_flush = NULL,
Alex Deucher54e88e02012-02-23 18:10:29 -0500812 .gui_idle = &r100_gui_idle,
813 .mc_wait_for_idle = &r520_mc_wait_for_idle,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500814 .gart = {
815 .tlb_flush = &rv370_pcie_gart_tlb_flush,
816 .set_page = &rv370_pcie_gart_set_page,
817 },
Christian König4c87bc22011-10-19 19:02:21 +0200818 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200819 [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring
Christian König4c87bc22011-10-19 19:02:21 +0200820 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500821 .irq = {
822 .set = &rs600_irq_set,
823 .process = &rs600_irq_process,
824 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500825 .display = {
826 .bandwidth_update = &rv515_bandwidth_update,
827 .get_vblank_counter = &rs600_get_vblank_counter,
828 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400829 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400830 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500831 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500832 .copy = {
833 .blit = &r100_copy_blit,
834 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
835 .dma = &r200_copy_dma,
836 .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX,
837 .copy = &r100_copy_blit,
838 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
839 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500840 .surface = {
841 .set_reg = r100_set_surface_reg,
842 .clear_reg = r100_clear_surface_reg,
843 },
Alex Deucher901ea572012-02-23 17:53:39 -0500844 .hpd = {
845 .init = &rs600_hpd_init,
846 .fini = &rs600_hpd_fini,
847 .sense = &rs600_hpd_sense,
848 .set_polarity = &rs600_hpd_set_polarity,
849 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500850 .pm = {
851 .misc = &rs600_pm_misc,
852 .prepare = &rs600_pm_prepare,
853 .finish = &rs600_pm_finish,
854 .init_profile = &r420_pm_init_profile,
855 .get_dynpm_state = &r100_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500856 .get_engine_clock = &radeon_atom_get_engine_clock,
857 .set_engine_clock = &radeon_atom_set_engine_clock,
858 .get_memory_clock = &radeon_atom_get_memory_clock,
859 .set_memory_clock = &radeon_atom_set_memory_clock,
860 .get_pcie_lanes = &rv370_get_pcie_lanes,
861 .set_pcie_lanes = &rv370_set_pcie_lanes,
862 .set_clock_gating = &radeon_atom_set_clock_gating,
Alex Deuchera02fa392012-02-23 17:53:41 -0500863 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500864 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500865 .page_flip = &rs600_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200866 .page_flip_pending = &rs600_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500867 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000868};
869
Christian König76a0df82013-08-13 11:56:50 +0200870static struct radeon_asic_ring r600_gfx_ring = {
871 .ib_execute = &r600_ring_ib_execute,
872 .emit_fence = &r600_fence_ring_emit,
873 .emit_semaphore = &r600_semaphore_ring_emit,
874 .cs_parse = &r600_cs_parse,
875 .ring_test = &r600_ring_test,
876 .ib_test = &r600_ib_test,
877 .is_lockup = &r600_gfx_is_lockup,
Alex Deucherea31bf62013-12-09 19:44:30 -0500878 .get_rptr = &r600_gfx_get_rptr,
879 .get_wptr = &r600_gfx_get_wptr,
880 .set_wptr = &r600_gfx_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +0200881};
882
883static struct radeon_asic_ring r600_dma_ring = {
884 .ib_execute = &r600_dma_ring_ib_execute,
885 .emit_fence = &r600_dma_fence_ring_emit,
886 .emit_semaphore = &r600_dma_semaphore_ring_emit,
887 .cs_parse = &r600_dma_cs_parse,
888 .ring_test = &r600_dma_ring_test,
889 .ib_test = &r600_dma_ib_test,
890 .is_lockup = &r600_dma_is_lockup,
Christian König2e1e6da2013-08-13 11:56:52 +0200891 .get_rptr = &r600_dma_get_rptr,
892 .get_wptr = &r600_dma_get_wptr,
893 .set_wptr = &r600_dma_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +0200894};
895
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000896static struct radeon_asic r600_asic = {
897 .init = &r600_init,
898 .fini = &r600_fini,
899 .suspend = &r600_suspend,
900 .resume = &r600_resume,
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000901 .vga_set_state = &r600_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +0000902 .asic_reset = &r600_asic_reset,
Michel Dänzer124764f2014-07-31 18:43:48 +0900903 .mmio_hdp_flush = r600_mmio_hdp_flush,
Alex Deucher54e88e02012-02-23 18:10:29 -0500904 .gui_idle = &r600_gui_idle,
905 .mc_wait_for_idle = &r600_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -0500906 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -0500907 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -0500908 .gart = {
909 .tlb_flush = &r600_pcie_gart_tlb_flush,
910 .set_page = &rs600_gart_set_page,
911 },
Christian König4c87bc22011-10-19 19:02:21 +0200912 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200913 [RADEON_RING_TYPE_GFX_INDEX] = &r600_gfx_ring,
914 [R600_RING_TYPE_DMA_INDEX] = &r600_dma_ring,
Christian König4c87bc22011-10-19 19:02:21 +0200915 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -0500916 .irq = {
917 .set = &r600_irq_set,
918 .process = &r600_irq_process,
919 },
Alex Deucherc79a49c2012-02-23 17:53:47 -0500920 .display = {
921 .bandwidth_update = &rv515_bandwidth_update,
922 .get_vblank_counter = &rs600_get_vblank_counter,
923 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -0400924 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -0400925 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -0400926 .hdmi_enable = &r600_hdmi_enable,
927 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -0500928 },
Alex Deucher27cd7762012-02-23 17:53:42 -0500929 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -0400930 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -0500931 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher4d756582012-09-27 15:08:35 -0400932 .dma = &r600_copy_dma,
933 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucherbfea6a62013-07-11 14:53:34 -0400934 .copy = &r600_copy_cpdma,
Alex Deucheraeea40c2013-07-11 14:20:11 -0400935 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -0500936 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -0500937 .surface = {
938 .set_reg = r600_set_surface_reg,
939 .clear_reg = r600_clear_surface_reg,
940 },
Alex Deucher901ea572012-02-23 17:53:39 -0500941 .hpd = {
942 .init = &r600_hpd_init,
943 .fini = &r600_hpd_fini,
944 .sense = &r600_hpd_sense,
945 .set_polarity = &r600_hpd_set_polarity,
946 },
Alex Deuchera02fa392012-02-23 17:53:41 -0500947 .pm = {
948 .misc = &r600_pm_misc,
949 .prepare = &rs600_pm_prepare,
950 .finish = &rs600_pm_finish,
951 .init_profile = &r600_pm_init_profile,
952 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -0500953 .get_engine_clock = &radeon_atom_get_engine_clock,
954 .set_engine_clock = &radeon_atom_set_engine_clock,
955 .get_memory_clock = &radeon_atom_get_memory_clock,
956 .set_memory_clock = &radeon_atom_set_memory_clock,
957 .get_pcie_lanes = &r600_get_pcie_lanes,
958 .set_pcie_lanes = &r600_set_pcie_lanes,
959 .set_clock_gating = NULL,
Alex Deucher6bd1c382013-06-21 14:38:03 -0400960 .get_temperature = &rv6xx_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -0500961 },
Alex Deucher0f9e0062012-02-23 17:53:40 -0500962 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -0500963 .page_flip = &rs600_page_flip,
Christian König157fa142014-05-27 16:49:20 +0200964 .page_flip_pending = &rs600_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -0500965 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +0000966};
967
Alex Deucherca361b62013-06-21 14:42:08 -0400968static struct radeon_asic rv6xx_asic = {
969 .init = &r600_init,
970 .fini = &r600_fini,
971 .suspend = &r600_suspend,
972 .resume = &r600_resume,
973 .vga_set_state = &r600_vga_set_state,
974 .asic_reset = &r600_asic_reset,
Michel Dänzer124764f2014-07-31 18:43:48 +0900975 .mmio_hdp_flush = r600_mmio_hdp_flush,
Alex Deucherca361b62013-06-21 14:42:08 -0400976 .gui_idle = &r600_gui_idle,
977 .mc_wait_for_idle = &r600_mc_wait_for_idle,
978 .get_xclk = &r600_get_xclk,
979 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
980 .gart = {
981 .tlb_flush = &r600_pcie_gart_tlb_flush,
982 .set_page = &rs600_gart_set_page,
983 },
984 .ring = {
Christian König76a0df82013-08-13 11:56:50 +0200985 [RADEON_RING_TYPE_GFX_INDEX] = &r600_gfx_ring,
986 [R600_RING_TYPE_DMA_INDEX] = &r600_dma_ring,
Alex Deucherca361b62013-06-21 14:42:08 -0400987 },
988 .irq = {
989 .set = &r600_irq_set,
990 .process = &r600_irq_process,
991 },
992 .display = {
993 .bandwidth_update = &rv515_bandwidth_update,
994 .get_vblank_counter = &rs600_get_vblank_counter,
995 .wait_for_vblank = &avivo_wait_for_vblank,
996 .set_backlight_level = &atombios_set_backlight_level,
997 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucher99d79aa2013-09-23 15:47:08 -0400998 .hdmi_enable = &r600_hdmi_enable,
999 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherca361b62013-06-21 14:42:08 -04001000 },
1001 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001002 .blit = &r600_copy_cpdma,
Alex Deucherca361b62013-06-21 14:42:08 -04001003 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
1004 .dma = &r600_copy_dma,
1005 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucherbfea6a62013-07-11 14:53:34 -04001006 .copy = &r600_copy_cpdma,
Alex Deucheraeea40c2013-07-11 14:20:11 -04001007 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucherca361b62013-06-21 14:42:08 -04001008 },
1009 .surface = {
1010 .set_reg = r600_set_surface_reg,
1011 .clear_reg = r600_clear_surface_reg,
1012 },
1013 .hpd = {
1014 .init = &r600_hpd_init,
1015 .fini = &r600_hpd_fini,
1016 .sense = &r600_hpd_sense,
1017 .set_polarity = &r600_hpd_set_polarity,
1018 },
1019 .pm = {
1020 .misc = &r600_pm_misc,
1021 .prepare = &rs600_pm_prepare,
1022 .finish = &rs600_pm_finish,
1023 .init_profile = &r600_pm_init_profile,
1024 .get_dynpm_state = &r600_pm_get_dynpm_state,
1025 .get_engine_clock = &radeon_atom_get_engine_clock,
1026 .set_engine_clock = &radeon_atom_set_engine_clock,
1027 .get_memory_clock = &radeon_atom_get_memory_clock,
1028 .set_memory_clock = &radeon_atom_set_memory_clock,
1029 .get_pcie_lanes = &r600_get_pcie_lanes,
1030 .set_pcie_lanes = &r600_set_pcie_lanes,
1031 .set_clock_gating = NULL,
1032 .get_temperature = &rv6xx_get_temp,
Alex Deucher1b9ba702013-09-05 09:52:37 -04001033 .set_uvd_clocks = &r600_set_uvd_clocks,
Alex Deucherca361b62013-06-21 14:42:08 -04001034 },
Alex Deucher4a6369e2013-04-12 14:04:10 -04001035 .dpm = {
1036 .init = &rv6xx_dpm_init,
1037 .setup_asic = &rv6xx_setup_asic,
1038 .enable = &rv6xx_dpm_enable,
Alex Deuchera4643ba2013-12-19 12:18:13 -05001039 .late_enable = &r600_dpm_late_enable,
Alex Deucher4a6369e2013-04-12 14:04:10 -04001040 .disable = &rv6xx_dpm_disable,
Alex Deucher98243912013-01-16 13:13:42 -05001041 .pre_set_power_state = &r600_dpm_pre_set_power_state,
Alex Deucher4a6369e2013-04-12 14:04:10 -04001042 .set_power_state = &rv6xx_dpm_set_power_state,
Alex Deucher98243912013-01-16 13:13:42 -05001043 .post_set_power_state = &r600_dpm_post_set_power_state,
Alex Deucher4a6369e2013-04-12 14:04:10 -04001044 .display_configuration_changed = &rv6xx_dpm_display_configuration_changed,
1045 .fini = &rv6xx_dpm_fini,
1046 .get_sclk = &rv6xx_dpm_get_sclk,
1047 .get_mclk = &rv6xx_dpm_get_mclk,
1048 .print_power_state = &rv6xx_dpm_print_power_state,
Alex Deucher242916a2013-06-28 14:20:53 -04001049 .debugfs_print_current_performance_level = &rv6xx_dpm_debugfs_print_current_performance_level,
Alex Deucherf4f85a82013-07-25 20:07:25 -04001050 .force_performance_level = &rv6xx_dpm_force_performance_level,
Alex Deucher4a6369e2013-04-12 14:04:10 -04001051 },
Alex Deucherca361b62013-06-21 14:42:08 -04001052 .pflip = {
Alex Deucherca361b62013-06-21 14:42:08 -04001053 .page_flip = &rs600_page_flip,
Christian König157fa142014-05-27 16:49:20 +02001054 .page_flip_pending = &rs600_page_flip_pending,
Alex Deucherca361b62013-06-21 14:42:08 -04001055 },
1056};
1057
Alex Deucherf47299c2010-03-16 20:54:38 -04001058static struct radeon_asic rs780_asic = {
1059 .init = &r600_init,
1060 .fini = &r600_fini,
1061 .suspend = &r600_suspend,
1062 .resume = &r600_resume,
Alex Deucherf47299c2010-03-16 20:54:38 -04001063 .vga_set_state = &r600_vga_set_state,
Jerome Glissea2d07b72010-03-09 14:45:11 +00001064 .asic_reset = &r600_asic_reset,
Michel Dänzer124764f2014-07-31 18:43:48 +09001065 .mmio_hdp_flush = r600_mmio_hdp_flush,
Alex Deucher54e88e02012-02-23 18:10:29 -05001066 .gui_idle = &r600_gui_idle,
1067 .mc_wait_for_idle = &r600_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001068 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001069 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001070 .gart = {
1071 .tlb_flush = &r600_pcie_gart_tlb_flush,
1072 .set_page = &rs600_gart_set_page,
1073 },
Christian König4c87bc22011-10-19 19:02:21 +02001074 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001075 [RADEON_RING_TYPE_GFX_INDEX] = &r600_gfx_ring,
1076 [R600_RING_TYPE_DMA_INDEX] = &r600_dma_ring,
Christian König4c87bc22011-10-19 19:02:21 +02001077 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001078 .irq = {
1079 .set = &r600_irq_set,
1080 .process = &r600_irq_process,
1081 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001082 .display = {
1083 .bandwidth_update = &rs690_bandwidth_update,
1084 .get_vblank_counter = &rs600_get_vblank_counter,
1085 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001086 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001087 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001088 .hdmi_enable = &r600_hdmi_enable,
1089 .hdmi_setmode = &r600_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001090 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001091 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001092 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -05001093 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher4d756582012-09-27 15:08:35 -04001094 .dma = &r600_copy_dma,
1095 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucherbfea6a62013-07-11 14:53:34 -04001096 .copy = &r600_copy_cpdma,
Alex Deucheraeea40c2013-07-11 14:20:11 -04001097 .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001098 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001099 .surface = {
1100 .set_reg = r600_set_surface_reg,
1101 .clear_reg = r600_clear_surface_reg,
1102 },
Alex Deucher901ea572012-02-23 17:53:39 -05001103 .hpd = {
1104 .init = &r600_hpd_init,
1105 .fini = &r600_hpd_fini,
1106 .sense = &r600_hpd_sense,
1107 .set_polarity = &r600_hpd_set_polarity,
1108 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001109 .pm = {
1110 .misc = &r600_pm_misc,
1111 .prepare = &rs600_pm_prepare,
1112 .finish = &rs600_pm_finish,
1113 .init_profile = &rs780_pm_init_profile,
1114 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001115 .get_engine_clock = &radeon_atom_get_engine_clock,
1116 .set_engine_clock = &radeon_atom_set_engine_clock,
1117 .get_memory_clock = NULL,
1118 .set_memory_clock = NULL,
1119 .get_pcie_lanes = NULL,
1120 .set_pcie_lanes = NULL,
1121 .set_clock_gating = NULL,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001122 .get_temperature = &rv6xx_get_temp,
Alex Deucher1b9ba702013-09-05 09:52:37 -04001123 .set_uvd_clocks = &r600_set_uvd_clocks,
Alex Deuchera02fa392012-02-23 17:53:41 -05001124 },
Alex Deucher9d670062013-04-12 13:59:22 -04001125 .dpm = {
1126 .init = &rs780_dpm_init,
1127 .setup_asic = &rs780_dpm_setup_asic,
1128 .enable = &rs780_dpm_enable,
Alex Deuchera4643ba2013-12-19 12:18:13 -05001129 .late_enable = &r600_dpm_late_enable,
Alex Deucher9d670062013-04-12 13:59:22 -04001130 .disable = &rs780_dpm_disable,
Alex Deucher98243912013-01-16 13:13:42 -05001131 .pre_set_power_state = &r600_dpm_pre_set_power_state,
Alex Deucher9d670062013-04-12 13:59:22 -04001132 .set_power_state = &rs780_dpm_set_power_state,
Alex Deucher98243912013-01-16 13:13:42 -05001133 .post_set_power_state = &r600_dpm_post_set_power_state,
Alex Deucher9d670062013-04-12 13:59:22 -04001134 .display_configuration_changed = &rs780_dpm_display_configuration_changed,
1135 .fini = &rs780_dpm_fini,
1136 .get_sclk = &rs780_dpm_get_sclk,
1137 .get_mclk = &rs780_dpm_get_mclk,
1138 .print_power_state = &rs780_dpm_print_power_state,
Alex Deucher444bddc2013-07-02 13:05:23 -04001139 .debugfs_print_current_performance_level = &rs780_dpm_debugfs_print_current_performance_level,
Anthoine Bourgeois63580c32013-09-03 13:52:19 -04001140 .force_performance_level = &rs780_dpm_force_performance_level,
Alex Deucher9d670062013-04-12 13:59:22 -04001141 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001142 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -05001143 .page_flip = &rs600_page_flip,
Christian König157fa142014-05-27 16:49:20 +02001144 .page_flip_pending = &rs600_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -05001145 },
Alex Deucherf47299c2010-03-16 20:54:38 -04001146};
1147
Christian König76a0df82013-08-13 11:56:50 +02001148static struct radeon_asic_ring rv770_uvd_ring = {
Christian Könige409b122013-08-13 11:56:53 +02001149 .ib_execute = &uvd_v1_0_ib_execute,
1150 .emit_fence = &uvd_v2_2_fence_emit,
1151 .emit_semaphore = &uvd_v1_0_semaphore_emit,
Christian König76a0df82013-08-13 11:56:50 +02001152 .cs_parse = &radeon_uvd_cs_parse,
Christian Könige409b122013-08-13 11:56:53 +02001153 .ring_test = &uvd_v1_0_ring_test,
1154 .ib_test = &uvd_v1_0_ib_test,
Christian König76a0df82013-08-13 11:56:50 +02001155 .is_lockup = &radeon_ring_test_lockup,
Christian Könige409b122013-08-13 11:56:53 +02001156 .get_rptr = &uvd_v1_0_get_rptr,
1157 .get_wptr = &uvd_v1_0_get_wptr,
1158 .set_wptr = &uvd_v1_0_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001159};
1160
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001161static struct radeon_asic rv770_asic = {
1162 .init = &rv770_init,
1163 .fini = &rv770_fini,
1164 .suspend = &rv770_suspend,
1165 .resume = &rv770_resume,
Jerome Glissea2d07b72010-03-09 14:45:11 +00001166 .asic_reset = &r600_asic_reset,
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001167 .vga_set_state = &r600_vga_set_state,
Michel Dänzer124764f2014-07-31 18:43:48 +09001168 .mmio_hdp_flush = r600_mmio_hdp_flush,
Alex Deucher54e88e02012-02-23 18:10:29 -05001169 .gui_idle = &r600_gui_idle,
1170 .mc_wait_for_idle = &r600_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001171 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001172 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001173 .gart = {
1174 .tlb_flush = &r600_pcie_gart_tlb_flush,
1175 .set_page = &rs600_gart_set_page,
1176 },
Christian König4c87bc22011-10-19 19:02:21 +02001177 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001178 [RADEON_RING_TYPE_GFX_INDEX] = &r600_gfx_ring,
1179 [R600_RING_TYPE_DMA_INDEX] = &r600_dma_ring,
1180 [R600_RING_TYPE_UVD_INDEX] = &rv770_uvd_ring,
Christian König4c87bc22011-10-19 19:02:21 +02001181 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001182 .irq = {
1183 .set = &r600_irq_set,
1184 .process = &r600_irq_process,
1185 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001186 .display = {
1187 .bandwidth_update = &rv515_bandwidth_update,
1188 .get_vblank_counter = &rs600_get_vblank_counter,
1189 .wait_for_vblank = &avivo_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001190 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001191 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001192 .hdmi_enable = &r600_hdmi_enable,
Rafał Miłecki8f33a152014-05-16 11:36:24 +02001193 .hdmi_setmode = &dce3_1_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001194 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001195 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001196 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -05001197 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher43fb7782013-01-04 09:24:18 -05001198 .dma = &rv770_copy_dma,
Alex Deucher4d756582012-09-27 15:08:35 -04001199 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher43fb7782013-01-04 09:24:18 -05001200 .copy = &rv770_copy_dma,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001201 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001202 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001203 .surface = {
1204 .set_reg = r600_set_surface_reg,
1205 .clear_reg = r600_clear_surface_reg,
1206 },
Alex Deucher901ea572012-02-23 17:53:39 -05001207 .hpd = {
1208 .init = &r600_hpd_init,
1209 .fini = &r600_hpd_fini,
1210 .sense = &r600_hpd_sense,
1211 .set_polarity = &r600_hpd_set_polarity,
1212 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001213 .pm = {
1214 .misc = &rv770_pm_misc,
1215 .prepare = &rs600_pm_prepare,
1216 .finish = &rs600_pm_finish,
1217 .init_profile = &r600_pm_init_profile,
1218 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001219 .get_engine_clock = &radeon_atom_get_engine_clock,
1220 .set_engine_clock = &radeon_atom_set_engine_clock,
1221 .get_memory_clock = &radeon_atom_get_memory_clock,
1222 .set_memory_clock = &radeon_atom_set_memory_clock,
1223 .get_pcie_lanes = &r600_get_pcie_lanes,
1224 .set_pcie_lanes = &r600_set_pcie_lanes,
1225 .set_clock_gating = &radeon_atom_set_clock_gating,
Christian Königef0e6e62013-04-08 12:41:35 +02001226 .set_uvd_clocks = &rv770_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001227 .get_temperature = &rv770_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001228 },
Alex Deucher66229b22013-06-26 00:11:19 -04001229 .dpm = {
1230 .init = &rv770_dpm_init,
1231 .setup_asic = &rv770_dpm_setup_asic,
1232 .enable = &rv770_dpm_enable,
Alex Deuchera3f11242013-12-19 13:48:36 -05001233 .late_enable = &rv770_dpm_late_enable,
Alex Deucher66229b22013-06-26 00:11:19 -04001234 .disable = &rv770_dpm_disable,
Alex Deucher98243912013-01-16 13:13:42 -05001235 .pre_set_power_state = &r600_dpm_pre_set_power_state,
Alex Deucher66229b22013-06-26 00:11:19 -04001236 .set_power_state = &rv770_dpm_set_power_state,
Alex Deucher98243912013-01-16 13:13:42 -05001237 .post_set_power_state = &r600_dpm_post_set_power_state,
Alex Deucher66229b22013-06-26 00:11:19 -04001238 .display_configuration_changed = &rv770_dpm_display_configuration_changed,
1239 .fini = &rv770_dpm_fini,
1240 .get_sclk = &rv770_dpm_get_sclk,
1241 .get_mclk = &rv770_dpm_get_mclk,
1242 .print_power_state = &rv770_dpm_print_power_state,
Alex Deucherbd210d12013-06-28 10:06:26 -04001243 .debugfs_print_current_performance_level = &rv770_dpm_debugfs_print_current_performance_level,
Alex Deucher8b5e6b72013-07-02 18:40:35 -04001244 .force_performance_level = &rv770_dpm_force_performance_level,
Alex Deucherb06195d2013-07-08 11:49:48 -04001245 .vblank_too_short = &rv770_dpm_vblank_too_short,
Alex Deucher66229b22013-06-26 00:11:19 -04001246 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001247 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -05001248 .page_flip = &rv770_page_flip,
Christian König157fa142014-05-27 16:49:20 +02001249 .page_flip_pending = &rv770_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -05001250 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001251};
1252
Christian König76a0df82013-08-13 11:56:50 +02001253static struct radeon_asic_ring evergreen_gfx_ring = {
1254 .ib_execute = &evergreen_ring_ib_execute,
1255 .emit_fence = &r600_fence_ring_emit,
1256 .emit_semaphore = &r600_semaphore_ring_emit,
1257 .cs_parse = &evergreen_cs_parse,
1258 .ring_test = &r600_ring_test,
1259 .ib_test = &r600_ib_test,
1260 .is_lockup = &evergreen_gfx_is_lockup,
Alex Deucherea31bf62013-12-09 19:44:30 -05001261 .get_rptr = &r600_gfx_get_rptr,
1262 .get_wptr = &r600_gfx_get_wptr,
1263 .set_wptr = &r600_gfx_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001264};
1265
1266static struct radeon_asic_ring evergreen_dma_ring = {
1267 .ib_execute = &evergreen_dma_ring_ib_execute,
1268 .emit_fence = &evergreen_dma_fence_ring_emit,
1269 .emit_semaphore = &r600_dma_semaphore_ring_emit,
1270 .cs_parse = &evergreen_dma_cs_parse,
1271 .ring_test = &r600_dma_ring_test,
1272 .ib_test = &r600_dma_ib_test,
1273 .is_lockup = &evergreen_dma_is_lockup,
Christian König2e1e6da2013-08-13 11:56:52 +02001274 .get_rptr = &r600_dma_get_rptr,
1275 .get_wptr = &r600_dma_get_wptr,
1276 .set_wptr = &r600_dma_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001277};
1278
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001279static struct radeon_asic evergreen_asic = {
1280 .init = &evergreen_init,
1281 .fini = &evergreen_fini,
1282 .suspend = &evergreen_suspend,
1283 .resume = &evergreen_resume,
Jerome Glissea2d07b72010-03-09 14:45:11 +00001284 .asic_reset = &evergreen_asic_reset,
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001285 .vga_set_state = &r600_vga_set_state,
Michel Dänzer124764f2014-07-31 18:43:48 +09001286 .mmio_hdp_flush = r600_mmio_hdp_flush,
Alex Deucher54e88e02012-02-23 18:10:29 -05001287 .gui_idle = &r600_gui_idle,
1288 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001289 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001290 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001291 .gart = {
1292 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1293 .set_page = &rs600_gart_set_page,
1294 },
Christian König4c87bc22011-10-19 19:02:21 +02001295 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001296 [RADEON_RING_TYPE_GFX_INDEX] = &evergreen_gfx_ring,
1297 [R600_RING_TYPE_DMA_INDEX] = &evergreen_dma_ring,
1298 [R600_RING_TYPE_UVD_INDEX] = &rv770_uvd_ring,
Christian König4c87bc22011-10-19 19:02:21 +02001299 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001300 .irq = {
1301 .set = &evergreen_irq_set,
1302 .process = &evergreen_irq_process,
1303 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001304 .display = {
1305 .bandwidth_update = &evergreen_bandwidth_update,
1306 .get_vblank_counter = &evergreen_get_vblank_counter,
1307 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001308 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001309 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001310 .hdmi_enable = &evergreen_hdmi_enable,
1311 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001312 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001313 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001314 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -05001315 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001316 .dma = &evergreen_copy_dma,
1317 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001318 .copy = &evergreen_copy_dma,
1319 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001320 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001321 .surface = {
1322 .set_reg = r600_set_surface_reg,
1323 .clear_reg = r600_clear_surface_reg,
1324 },
Alex Deucher901ea572012-02-23 17:53:39 -05001325 .hpd = {
1326 .init = &evergreen_hpd_init,
1327 .fini = &evergreen_hpd_fini,
1328 .sense = &evergreen_hpd_sense,
1329 .set_polarity = &evergreen_hpd_set_polarity,
1330 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001331 .pm = {
1332 .misc = &evergreen_pm_misc,
1333 .prepare = &evergreen_pm_prepare,
1334 .finish = &evergreen_pm_finish,
1335 .init_profile = &r600_pm_init_profile,
1336 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001337 .get_engine_clock = &radeon_atom_get_engine_clock,
1338 .set_engine_clock = &radeon_atom_set_engine_clock,
1339 .get_memory_clock = &radeon_atom_get_memory_clock,
1340 .set_memory_clock = &radeon_atom_set_memory_clock,
1341 .get_pcie_lanes = &r600_get_pcie_lanes,
1342 .set_pcie_lanes = &r600_set_pcie_lanes,
1343 .set_clock_gating = NULL,
Alex Deuchera8b49252013-04-08 12:41:33 +02001344 .set_uvd_clocks = &evergreen_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001345 .get_temperature = &evergreen_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001346 },
Alex Deucherdc50ba72013-06-26 00:33:35 -04001347 .dpm = {
1348 .init = &cypress_dpm_init,
1349 .setup_asic = &cypress_dpm_setup_asic,
1350 .enable = &cypress_dpm_enable,
Alex Deuchera3f11242013-12-19 13:48:36 -05001351 .late_enable = &rv770_dpm_late_enable,
Alex Deucherdc50ba72013-06-26 00:33:35 -04001352 .disable = &cypress_dpm_disable,
Alex Deucher98243912013-01-16 13:13:42 -05001353 .pre_set_power_state = &r600_dpm_pre_set_power_state,
Alex Deucherdc50ba72013-06-26 00:33:35 -04001354 .set_power_state = &cypress_dpm_set_power_state,
Alex Deucher98243912013-01-16 13:13:42 -05001355 .post_set_power_state = &r600_dpm_post_set_power_state,
Alex Deucherdc50ba72013-06-26 00:33:35 -04001356 .display_configuration_changed = &cypress_dpm_display_configuration_changed,
1357 .fini = &cypress_dpm_fini,
1358 .get_sclk = &rv770_dpm_get_sclk,
1359 .get_mclk = &rv770_dpm_get_mclk,
1360 .print_power_state = &rv770_dpm_print_power_state,
Alex Deucherbd210d12013-06-28 10:06:26 -04001361 .debugfs_print_current_performance_level = &rv770_dpm_debugfs_print_current_performance_level,
Alex Deucher8b5e6b72013-07-02 18:40:35 -04001362 .force_performance_level = &rv770_dpm_force_performance_level,
Alex Deucherd0b54bd2013-07-08 11:56:09 -04001363 .vblank_too_short = &cypress_dpm_vblank_too_short,
Alex Deucherdc50ba72013-06-26 00:33:35 -04001364 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001365 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -05001366 .page_flip = &evergreen_page_flip,
Christian König157fa142014-05-27 16:49:20 +02001367 .page_flip_pending = &evergreen_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -05001368 },
Daniel Vetter48e7a5f2010-03-11 21:19:15 +00001369};
1370
Alex Deucher958261d2010-11-22 17:56:30 -05001371static struct radeon_asic sumo_asic = {
1372 .init = &evergreen_init,
1373 .fini = &evergreen_fini,
1374 .suspend = &evergreen_suspend,
1375 .resume = &evergreen_resume,
Alex Deucher958261d2010-11-22 17:56:30 -05001376 .asic_reset = &evergreen_asic_reset,
1377 .vga_set_state = &r600_vga_set_state,
Michel Dänzer124764f2014-07-31 18:43:48 +09001378 .mmio_hdp_flush = r600_mmio_hdp_flush,
Alex Deucher54e88e02012-02-23 18:10:29 -05001379 .gui_idle = &r600_gui_idle,
1380 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001381 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001382 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001383 .gart = {
1384 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1385 .set_page = &rs600_gart_set_page,
1386 },
Christian König4c87bc22011-10-19 19:02:21 +02001387 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001388 [RADEON_RING_TYPE_GFX_INDEX] = &evergreen_gfx_ring,
1389 [R600_RING_TYPE_DMA_INDEX] = &evergreen_dma_ring,
1390 [R600_RING_TYPE_UVD_INDEX] = &rv770_uvd_ring,
Christian König4c87bc22011-10-19 19:02:21 +02001391 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001392 .irq = {
1393 .set = &evergreen_irq_set,
1394 .process = &evergreen_irq_process,
1395 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001396 .display = {
1397 .bandwidth_update = &evergreen_bandwidth_update,
1398 .get_vblank_counter = &evergreen_get_vblank_counter,
1399 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001400 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001401 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001402 .hdmi_enable = &evergreen_hdmi_enable,
1403 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001404 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001405 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001406 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -05001407 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001408 .dma = &evergreen_copy_dma,
1409 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001410 .copy = &evergreen_copy_dma,
1411 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001412 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001413 .surface = {
1414 .set_reg = r600_set_surface_reg,
1415 .clear_reg = r600_clear_surface_reg,
1416 },
Alex Deucher901ea572012-02-23 17:53:39 -05001417 .hpd = {
1418 .init = &evergreen_hpd_init,
1419 .fini = &evergreen_hpd_fini,
1420 .sense = &evergreen_hpd_sense,
1421 .set_polarity = &evergreen_hpd_set_polarity,
1422 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001423 .pm = {
1424 .misc = &evergreen_pm_misc,
1425 .prepare = &evergreen_pm_prepare,
1426 .finish = &evergreen_pm_finish,
1427 .init_profile = &sumo_pm_init_profile,
1428 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001429 .get_engine_clock = &radeon_atom_get_engine_clock,
1430 .set_engine_clock = &radeon_atom_set_engine_clock,
1431 .get_memory_clock = NULL,
1432 .set_memory_clock = NULL,
1433 .get_pcie_lanes = NULL,
1434 .set_pcie_lanes = NULL,
1435 .set_clock_gating = NULL,
Alex Deucher23d33ba2013-04-08 12:41:32 +02001436 .set_uvd_clocks = &sumo_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001437 .get_temperature = &sumo_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001438 },
Alex Deucher80ea2c12013-04-12 14:56:21 -04001439 .dpm = {
1440 .init = &sumo_dpm_init,
1441 .setup_asic = &sumo_dpm_setup_asic,
1442 .enable = &sumo_dpm_enable,
Alex Deucher14ec9fa2013-12-19 11:56:52 -05001443 .late_enable = &sumo_dpm_late_enable,
Alex Deucher80ea2c12013-04-12 14:56:21 -04001444 .disable = &sumo_dpm_disable,
Alex Deucher422a56b2013-06-25 15:40:21 -04001445 .pre_set_power_state = &sumo_dpm_pre_set_power_state,
Alex Deucher80ea2c12013-04-12 14:56:21 -04001446 .set_power_state = &sumo_dpm_set_power_state,
Alex Deucher422a56b2013-06-25 15:40:21 -04001447 .post_set_power_state = &sumo_dpm_post_set_power_state,
Alex Deucher80ea2c12013-04-12 14:56:21 -04001448 .display_configuration_changed = &sumo_dpm_display_configuration_changed,
1449 .fini = &sumo_dpm_fini,
1450 .get_sclk = &sumo_dpm_get_sclk,
1451 .get_mclk = &sumo_dpm_get_mclk,
1452 .print_power_state = &sumo_dpm_print_power_state,
Alex Deucherfb701602013-06-28 10:47:56 -04001453 .debugfs_print_current_performance_level = &sumo_dpm_debugfs_print_current_performance_level,
Alex Deucher5d5e5592013-07-02 18:50:09 -04001454 .force_performance_level = &sumo_dpm_force_performance_level,
Alex Deucher80ea2c12013-04-12 14:56:21 -04001455 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001456 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -05001457 .page_flip = &evergreen_page_flip,
Christian König157fa142014-05-27 16:49:20 +02001458 .page_flip_pending = &evergreen_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -05001459 },
Alex Deucher958261d2010-11-22 17:56:30 -05001460};
1461
Alex Deuchera43b7662011-01-06 21:19:33 -05001462static struct radeon_asic btc_asic = {
1463 .init = &evergreen_init,
1464 .fini = &evergreen_fini,
1465 .suspend = &evergreen_suspend,
1466 .resume = &evergreen_resume,
Alex Deuchera43b7662011-01-06 21:19:33 -05001467 .asic_reset = &evergreen_asic_reset,
1468 .vga_set_state = &r600_vga_set_state,
Michel Dänzer124764f2014-07-31 18:43:48 +09001469 .mmio_hdp_flush = r600_mmio_hdp_flush,
Alex Deucher54e88e02012-02-23 18:10:29 -05001470 .gui_idle = &r600_gui_idle,
1471 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001472 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001473 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001474 .gart = {
1475 .tlb_flush = &evergreen_pcie_gart_tlb_flush,
1476 .set_page = &rs600_gart_set_page,
1477 },
Christian König4c87bc22011-10-19 19:02:21 +02001478 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001479 [RADEON_RING_TYPE_GFX_INDEX] = &evergreen_gfx_ring,
1480 [R600_RING_TYPE_DMA_INDEX] = &evergreen_dma_ring,
1481 [R600_RING_TYPE_UVD_INDEX] = &rv770_uvd_ring,
Christian König4c87bc22011-10-19 19:02:21 +02001482 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001483 .irq = {
1484 .set = &evergreen_irq_set,
1485 .process = &evergreen_irq_process,
1486 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001487 .display = {
1488 .bandwidth_update = &evergreen_bandwidth_update,
1489 .get_vblank_counter = &evergreen_get_vblank_counter,
1490 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001491 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001492 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001493 .hdmi_enable = &evergreen_hdmi_enable,
1494 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001495 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001496 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001497 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -05001498 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher233d1ad2012-12-04 15:25:59 -05001499 .dma = &evergreen_copy_dma,
1500 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001501 .copy = &evergreen_copy_dma,
1502 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001503 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001504 .surface = {
1505 .set_reg = r600_set_surface_reg,
1506 .clear_reg = r600_clear_surface_reg,
1507 },
Alex Deucher901ea572012-02-23 17:53:39 -05001508 .hpd = {
1509 .init = &evergreen_hpd_init,
1510 .fini = &evergreen_hpd_fini,
1511 .sense = &evergreen_hpd_sense,
1512 .set_polarity = &evergreen_hpd_set_polarity,
1513 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001514 .pm = {
1515 .misc = &evergreen_pm_misc,
1516 .prepare = &evergreen_pm_prepare,
1517 .finish = &evergreen_pm_finish,
Alex Deucher27810fb2012-10-01 19:25:11 -04001518 .init_profile = &btc_pm_init_profile,
Alex Deuchera02fa392012-02-23 17:53:41 -05001519 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001520 .get_engine_clock = &radeon_atom_get_engine_clock,
1521 .set_engine_clock = &radeon_atom_set_engine_clock,
1522 .get_memory_clock = &radeon_atom_get_memory_clock,
1523 .set_memory_clock = &radeon_atom_set_memory_clock,
Alex Deucher55b615a2013-03-18 18:57:27 -04001524 .get_pcie_lanes = &r600_get_pcie_lanes,
1525 .set_pcie_lanes = &r600_set_pcie_lanes,
Alex Deucher798bcf72012-02-23 17:53:48 -05001526 .set_clock_gating = NULL,
Alex Deuchera8b49252013-04-08 12:41:33 +02001527 .set_uvd_clocks = &evergreen_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001528 .get_temperature = &evergreen_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001529 },
Alex Deucher6596afd2013-06-26 00:15:24 -04001530 .dpm = {
1531 .init = &btc_dpm_init,
1532 .setup_asic = &btc_dpm_setup_asic,
1533 .enable = &btc_dpm_enable,
Alex Deuchera3f11242013-12-19 13:48:36 -05001534 .late_enable = &rv770_dpm_late_enable,
Alex Deucher6596afd2013-06-26 00:15:24 -04001535 .disable = &btc_dpm_disable,
Alex Deuchere8a95392013-01-16 14:17:23 -05001536 .pre_set_power_state = &btc_dpm_pre_set_power_state,
Alex Deucher6596afd2013-06-26 00:15:24 -04001537 .set_power_state = &btc_dpm_set_power_state,
Alex Deuchere8a95392013-01-16 14:17:23 -05001538 .post_set_power_state = &btc_dpm_post_set_power_state,
Alex Deucher6596afd2013-06-26 00:15:24 -04001539 .display_configuration_changed = &cypress_dpm_display_configuration_changed,
1540 .fini = &btc_dpm_fini,
Alex Deuchere8a95392013-01-16 14:17:23 -05001541 .get_sclk = &btc_dpm_get_sclk,
1542 .get_mclk = &btc_dpm_get_mclk,
Alex Deucher6596afd2013-06-26 00:15:24 -04001543 .print_power_state = &rv770_dpm_print_power_state,
Alex Deucher9f3f63f2014-01-30 11:19:22 -05001544 .debugfs_print_current_performance_level = &btc_dpm_debugfs_print_current_performance_level,
Alex Deucher8b5e6b72013-07-02 18:40:35 -04001545 .force_performance_level = &rv770_dpm_force_performance_level,
Alex Deuchera84301c2013-07-08 12:03:55 -04001546 .vblank_too_short = &btc_dpm_vblank_too_short,
Alex Deucher6596afd2013-06-26 00:15:24 -04001547 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001548 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -05001549 .page_flip = &evergreen_page_flip,
Christian König157fa142014-05-27 16:49:20 +02001550 .page_flip_pending = &evergreen_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -05001551 },
Alex Deuchera43b7662011-01-06 21:19:33 -05001552};
1553
Christian König76a0df82013-08-13 11:56:50 +02001554static struct radeon_asic_ring cayman_gfx_ring = {
1555 .ib_execute = &cayman_ring_ib_execute,
1556 .ib_parse = &evergreen_ib_parse,
1557 .emit_fence = &cayman_fence_ring_emit,
1558 .emit_semaphore = &r600_semaphore_ring_emit,
1559 .cs_parse = &evergreen_cs_parse,
1560 .ring_test = &r600_ring_test,
1561 .ib_test = &r600_ib_test,
1562 .is_lockup = &cayman_gfx_is_lockup,
1563 .vm_flush = &cayman_vm_flush,
Alex Deucherea31bf62013-12-09 19:44:30 -05001564 .get_rptr = &cayman_gfx_get_rptr,
1565 .get_wptr = &cayman_gfx_get_wptr,
1566 .set_wptr = &cayman_gfx_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001567};
1568
1569static struct radeon_asic_ring cayman_dma_ring = {
1570 .ib_execute = &cayman_dma_ring_ib_execute,
1571 .ib_parse = &evergreen_dma_ib_parse,
1572 .emit_fence = &evergreen_dma_fence_ring_emit,
1573 .emit_semaphore = &r600_dma_semaphore_ring_emit,
1574 .cs_parse = &evergreen_dma_cs_parse,
1575 .ring_test = &r600_dma_ring_test,
1576 .ib_test = &r600_dma_ib_test,
1577 .is_lockup = &cayman_dma_is_lockup,
1578 .vm_flush = &cayman_dma_vm_flush,
Alex Deucherea31bf62013-12-09 19:44:30 -05001579 .get_rptr = &cayman_dma_get_rptr,
1580 .get_wptr = &cayman_dma_get_wptr,
1581 .set_wptr = &cayman_dma_set_wptr
Christian König76a0df82013-08-13 11:56:50 +02001582};
1583
1584static struct radeon_asic_ring cayman_uvd_ring = {
Christian Könige409b122013-08-13 11:56:53 +02001585 .ib_execute = &uvd_v1_0_ib_execute,
1586 .emit_fence = &uvd_v2_2_fence_emit,
1587 .emit_semaphore = &uvd_v3_1_semaphore_emit,
Christian König76a0df82013-08-13 11:56:50 +02001588 .cs_parse = &radeon_uvd_cs_parse,
Christian Könige409b122013-08-13 11:56:53 +02001589 .ring_test = &uvd_v1_0_ring_test,
1590 .ib_test = &uvd_v1_0_ib_test,
Christian König76a0df82013-08-13 11:56:50 +02001591 .is_lockup = &radeon_ring_test_lockup,
Christian Könige409b122013-08-13 11:56:53 +02001592 .get_rptr = &uvd_v1_0_get_rptr,
1593 .get_wptr = &uvd_v1_0_get_wptr,
1594 .set_wptr = &uvd_v1_0_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001595};
1596
Alex Deuchere3487622011-03-02 20:07:36 -05001597static struct radeon_asic cayman_asic = {
1598 .init = &cayman_init,
1599 .fini = &cayman_fini,
1600 .suspend = &cayman_suspend,
1601 .resume = &cayman_resume,
Alex Deuchere3487622011-03-02 20:07:36 -05001602 .asic_reset = &cayman_asic_reset,
1603 .vga_set_state = &r600_vga_set_state,
Michel Dänzer124764f2014-07-31 18:43:48 +09001604 .mmio_hdp_flush = r600_mmio_hdp_flush,
Alex Deucher54e88e02012-02-23 18:10:29 -05001605 .gui_idle = &r600_gui_idle,
1606 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001607 .get_xclk = &rv770_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001608 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherc5b3b852012-02-23 17:53:46 -05001609 .gart = {
1610 .tlb_flush = &cayman_pcie_gart_tlb_flush,
1611 .set_page = &rs600_gart_set_page,
1612 },
Christian König05b07142012-08-06 20:21:10 +02001613 .vm = {
1614 .init = &cayman_vm_init,
1615 .fini = &cayman_vm_fini,
Christian König03f62ab2014-07-30 21:05:17 +02001616 .copy_pages = &cayman_dma_vm_copy_pages,
1617 .write_pages = &cayman_dma_vm_write_pages,
1618 .set_pages = &cayman_dma_vm_set_pages,
1619 .pad_ib = &cayman_dma_vm_pad_ib,
Christian König05b07142012-08-06 20:21:10 +02001620 },
Christian König4c87bc22011-10-19 19:02:21 +02001621 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001622 [RADEON_RING_TYPE_GFX_INDEX] = &cayman_gfx_ring,
1623 [CAYMAN_RING_TYPE_CP1_INDEX] = &cayman_gfx_ring,
1624 [CAYMAN_RING_TYPE_CP2_INDEX] = &cayman_gfx_ring,
1625 [R600_RING_TYPE_DMA_INDEX] = &cayman_dma_ring,
1626 [CAYMAN_RING_TYPE_DMA1_INDEX] = &cayman_dma_ring,
1627 [R600_RING_TYPE_UVD_INDEX] = &cayman_uvd_ring,
Christian König4c87bc22011-10-19 19:02:21 +02001628 },
Alex Deucherb35ea4a2012-02-23 17:53:43 -05001629 .irq = {
1630 .set = &evergreen_irq_set,
1631 .process = &evergreen_irq_process,
1632 },
Alex Deucherc79a49c2012-02-23 17:53:47 -05001633 .display = {
1634 .bandwidth_update = &evergreen_bandwidth_update,
1635 .get_vblank_counter = &evergreen_get_vblank_counter,
1636 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001637 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001638 .get_backlight_level = &atombios_get_backlight_level,
Alex Deuchera973bea2013-04-18 11:32:16 -04001639 .hdmi_enable = &evergreen_hdmi_enable,
1640 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherc79a49c2012-02-23 17:53:47 -05001641 },
Alex Deucher27cd7762012-02-23 17:53:42 -05001642 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001643 .blit = &r600_copy_cpdma,
Alex Deucher27cd7762012-02-23 17:53:42 -05001644 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001645 .dma = &evergreen_copy_dma,
1646 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001647 .copy = &evergreen_copy_dma,
1648 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher27cd7762012-02-23 17:53:42 -05001649 },
Alex Deucher9e6f3d02012-02-23 17:53:49 -05001650 .surface = {
1651 .set_reg = r600_set_surface_reg,
1652 .clear_reg = r600_clear_surface_reg,
1653 },
Alex Deucher901ea572012-02-23 17:53:39 -05001654 .hpd = {
1655 .init = &evergreen_hpd_init,
1656 .fini = &evergreen_hpd_fini,
1657 .sense = &evergreen_hpd_sense,
1658 .set_polarity = &evergreen_hpd_set_polarity,
1659 },
Alex Deuchera02fa392012-02-23 17:53:41 -05001660 .pm = {
1661 .misc = &evergreen_pm_misc,
1662 .prepare = &evergreen_pm_prepare,
1663 .finish = &evergreen_pm_finish,
Alex Deucher27810fb2012-10-01 19:25:11 -04001664 .init_profile = &btc_pm_init_profile,
Alex Deuchera02fa392012-02-23 17:53:41 -05001665 .get_dynpm_state = &r600_pm_get_dynpm_state,
Alex Deucher798bcf72012-02-23 17:53:48 -05001666 .get_engine_clock = &radeon_atom_get_engine_clock,
1667 .set_engine_clock = &radeon_atom_set_engine_clock,
1668 .get_memory_clock = &radeon_atom_get_memory_clock,
1669 .set_memory_clock = &radeon_atom_set_memory_clock,
Alex Deucher55b615a2013-03-18 18:57:27 -04001670 .get_pcie_lanes = &r600_get_pcie_lanes,
1671 .set_pcie_lanes = &r600_set_pcie_lanes,
Alex Deucher798bcf72012-02-23 17:53:48 -05001672 .set_clock_gating = NULL,
Alex Deuchera8b49252013-04-08 12:41:33 +02001673 .set_uvd_clocks = &evergreen_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001674 .get_temperature = &evergreen_get_temp,
Alex Deuchera02fa392012-02-23 17:53:41 -05001675 },
Alex Deucher69e0b572013-04-12 16:42:42 -04001676 .dpm = {
1677 .init = &ni_dpm_init,
1678 .setup_asic = &ni_dpm_setup_asic,
1679 .enable = &ni_dpm_enable,
Alex Deuchera3f11242013-12-19 13:48:36 -05001680 .late_enable = &rv770_dpm_late_enable,
Alex Deucher69e0b572013-04-12 16:42:42 -04001681 .disable = &ni_dpm_disable,
Alex Deucherfee3d742013-01-16 14:35:39 -05001682 .pre_set_power_state = &ni_dpm_pre_set_power_state,
Alex Deucher69e0b572013-04-12 16:42:42 -04001683 .set_power_state = &ni_dpm_set_power_state,
Alex Deucherfee3d742013-01-16 14:35:39 -05001684 .post_set_power_state = &ni_dpm_post_set_power_state,
Alex Deucher69e0b572013-04-12 16:42:42 -04001685 .display_configuration_changed = &cypress_dpm_display_configuration_changed,
1686 .fini = &ni_dpm_fini,
1687 .get_sclk = &ni_dpm_get_sclk,
1688 .get_mclk = &ni_dpm_get_mclk,
1689 .print_power_state = &ni_dpm_print_power_state,
Alex Deucherbdf0c4f2013-06-28 17:49:02 -04001690 .debugfs_print_current_performance_level = &ni_dpm_debugfs_print_current_performance_level,
Alex Deucher170a47f2013-07-02 18:43:53 -04001691 .force_performance_level = &ni_dpm_force_performance_level,
Alex Deucher76ad73e2013-07-08 12:09:41 -04001692 .vblank_too_short = &ni_dpm_vblank_too_short,
Alex Deucher69e0b572013-04-12 16:42:42 -04001693 },
Alex Deucher0f9e0062012-02-23 17:53:40 -05001694 .pflip = {
Alex Deucher0f9e0062012-02-23 17:53:40 -05001695 .page_flip = &evergreen_page_flip,
Christian König157fa142014-05-27 16:49:20 +02001696 .page_flip_pending = &evergreen_page_flip_pending,
Alex Deucher0f9e0062012-02-23 17:53:40 -05001697 },
Alex Deuchere3487622011-03-02 20:07:36 -05001698};
1699
Alex Deucherbe63fe82012-03-20 17:18:40 -04001700static struct radeon_asic trinity_asic = {
1701 .init = &cayman_init,
1702 .fini = &cayman_fini,
1703 .suspend = &cayman_suspend,
1704 .resume = &cayman_resume,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001705 .asic_reset = &cayman_asic_reset,
1706 .vga_set_state = &r600_vga_set_state,
Michel Dänzer124764f2014-07-31 18:43:48 +09001707 .mmio_hdp_flush = r600_mmio_hdp_flush,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001708 .gui_idle = &r600_gui_idle,
1709 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001710 .get_xclk = &r600_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001711 .get_gpu_clock_counter = &r600_get_gpu_clock_counter,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001712 .gart = {
1713 .tlb_flush = &cayman_pcie_gart_tlb_flush,
1714 .set_page = &rs600_gart_set_page,
1715 },
Christian König05b07142012-08-06 20:21:10 +02001716 .vm = {
1717 .init = &cayman_vm_init,
1718 .fini = &cayman_vm_fini,
Christian König03f62ab2014-07-30 21:05:17 +02001719 .copy_pages = &cayman_dma_vm_copy_pages,
1720 .write_pages = &cayman_dma_vm_write_pages,
1721 .set_pages = &cayman_dma_vm_set_pages,
1722 .pad_ib = &cayman_dma_vm_pad_ib,
Christian König05b07142012-08-06 20:21:10 +02001723 },
Alex Deucherbe63fe82012-03-20 17:18:40 -04001724 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001725 [RADEON_RING_TYPE_GFX_INDEX] = &cayman_gfx_ring,
1726 [CAYMAN_RING_TYPE_CP1_INDEX] = &cayman_gfx_ring,
1727 [CAYMAN_RING_TYPE_CP2_INDEX] = &cayman_gfx_ring,
1728 [R600_RING_TYPE_DMA_INDEX] = &cayman_dma_ring,
1729 [CAYMAN_RING_TYPE_DMA1_INDEX] = &cayman_dma_ring,
1730 [R600_RING_TYPE_UVD_INDEX] = &cayman_uvd_ring,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001731 },
1732 .irq = {
1733 .set = &evergreen_irq_set,
1734 .process = &evergreen_irq_process,
1735 },
1736 .display = {
1737 .bandwidth_update = &dce6_bandwidth_update,
1738 .get_vblank_counter = &evergreen_get_vblank_counter,
1739 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001740 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001741 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherb5306022013-07-31 16:51:33 -04001742 .hdmi_enable = &evergreen_hdmi_enable,
1743 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001744 },
1745 .copy = {
Alex Deucher8dddb992013-07-12 14:52:30 -04001746 .blit = &r600_copy_cpdma,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001747 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucherf60cbd12012-12-04 15:27:33 -05001748 .dma = &evergreen_copy_dma,
1749 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001750 .copy = &evergreen_copy_dma,
1751 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001752 },
1753 .surface = {
1754 .set_reg = r600_set_surface_reg,
1755 .clear_reg = r600_clear_surface_reg,
1756 },
1757 .hpd = {
1758 .init = &evergreen_hpd_init,
1759 .fini = &evergreen_hpd_fini,
1760 .sense = &evergreen_hpd_sense,
1761 .set_polarity = &evergreen_hpd_set_polarity,
1762 },
1763 .pm = {
1764 .misc = &evergreen_pm_misc,
1765 .prepare = &evergreen_pm_prepare,
1766 .finish = &evergreen_pm_finish,
1767 .init_profile = &sumo_pm_init_profile,
1768 .get_dynpm_state = &r600_pm_get_dynpm_state,
1769 .get_engine_clock = &radeon_atom_get_engine_clock,
1770 .set_engine_clock = &radeon_atom_set_engine_clock,
1771 .get_memory_clock = NULL,
1772 .set_memory_clock = NULL,
1773 .get_pcie_lanes = NULL,
1774 .set_pcie_lanes = NULL,
1775 .set_clock_gating = NULL,
Alex Deucher23d33ba2013-04-08 12:41:32 +02001776 .set_uvd_clocks = &sumo_set_uvd_clocks,
Alex Deucher29a15222012-12-14 11:57:36 -05001777 .get_temperature = &tn_get_temp,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001778 },
Alex Deucherd70229f2013-04-12 16:40:41 -04001779 .dpm = {
1780 .init = &trinity_dpm_init,
1781 .setup_asic = &trinity_dpm_setup_asic,
1782 .enable = &trinity_dpm_enable,
Alex Deucherbda44c12013-12-19 12:03:35 -05001783 .late_enable = &trinity_dpm_late_enable,
Alex Deucherd70229f2013-04-12 16:40:41 -04001784 .disable = &trinity_dpm_disable,
Alex Deuchera284c482013-01-16 13:53:40 -05001785 .pre_set_power_state = &trinity_dpm_pre_set_power_state,
Alex Deucherd70229f2013-04-12 16:40:41 -04001786 .set_power_state = &trinity_dpm_set_power_state,
Alex Deuchera284c482013-01-16 13:53:40 -05001787 .post_set_power_state = &trinity_dpm_post_set_power_state,
Alex Deucherd70229f2013-04-12 16:40:41 -04001788 .display_configuration_changed = &trinity_dpm_display_configuration_changed,
1789 .fini = &trinity_dpm_fini,
1790 .get_sclk = &trinity_dpm_get_sclk,
1791 .get_mclk = &trinity_dpm_get_mclk,
1792 .print_power_state = &trinity_dpm_print_power_state,
Alex Deucher490ab932013-06-28 12:01:38 -04001793 .debugfs_print_current_performance_level = &trinity_dpm_debugfs_print_current_performance_level,
Alex Deucher9b5de592013-07-02 18:52:10 -04001794 .force_performance_level = &trinity_dpm_force_performance_level,
Alex Deucher11877062013-09-09 19:19:52 -04001795 .enable_bapm = &trinity_dpm_enable_bapm,
Alex Deucherd70229f2013-04-12 16:40:41 -04001796 },
Alex Deucherbe63fe82012-03-20 17:18:40 -04001797 .pflip = {
Alex Deucherbe63fe82012-03-20 17:18:40 -04001798 .page_flip = &evergreen_page_flip,
Christian König157fa142014-05-27 16:49:20 +02001799 .page_flip_pending = &evergreen_page_flip_pending,
Alex Deucherbe63fe82012-03-20 17:18:40 -04001800 },
1801};
1802
Christian König76a0df82013-08-13 11:56:50 +02001803static struct radeon_asic_ring si_gfx_ring = {
1804 .ib_execute = &si_ring_ib_execute,
1805 .ib_parse = &si_ib_parse,
1806 .emit_fence = &si_fence_ring_emit,
1807 .emit_semaphore = &r600_semaphore_ring_emit,
1808 .cs_parse = NULL,
1809 .ring_test = &r600_ring_test,
1810 .ib_test = &r600_ib_test,
1811 .is_lockup = &si_gfx_is_lockup,
1812 .vm_flush = &si_vm_flush,
Alex Deucherea31bf62013-12-09 19:44:30 -05001813 .get_rptr = &cayman_gfx_get_rptr,
1814 .get_wptr = &cayman_gfx_get_wptr,
1815 .set_wptr = &cayman_gfx_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001816};
1817
1818static struct radeon_asic_ring si_dma_ring = {
1819 .ib_execute = &cayman_dma_ring_ib_execute,
1820 .ib_parse = &evergreen_dma_ib_parse,
1821 .emit_fence = &evergreen_dma_fence_ring_emit,
1822 .emit_semaphore = &r600_dma_semaphore_ring_emit,
1823 .cs_parse = NULL,
1824 .ring_test = &r600_dma_ring_test,
1825 .ib_test = &r600_dma_ib_test,
1826 .is_lockup = &si_dma_is_lockup,
1827 .vm_flush = &si_dma_vm_flush,
Alex Deucherea31bf62013-12-09 19:44:30 -05001828 .get_rptr = &cayman_dma_get_rptr,
1829 .get_wptr = &cayman_dma_get_wptr,
1830 .set_wptr = &cayman_dma_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001831};
1832
Alex Deucher02779c02012-03-20 17:18:25 -04001833static struct radeon_asic si_asic = {
1834 .init = &si_init,
1835 .fini = &si_fini,
1836 .suspend = &si_suspend,
1837 .resume = &si_resume,
Alex Deucher02779c02012-03-20 17:18:25 -04001838 .asic_reset = &si_asic_reset,
1839 .vga_set_state = &r600_vga_set_state,
Michel Dänzer124764f2014-07-31 18:43:48 +09001840 .mmio_hdp_flush = r600_mmio_hdp_flush,
Alex Deucher02779c02012-03-20 17:18:25 -04001841 .gui_idle = &r600_gui_idle,
1842 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
Alex Deucher454d2e22013-02-14 10:04:02 -05001843 .get_xclk = &si_get_xclk,
Alex Deucherd0418892013-01-24 10:35:23 -05001844 .get_gpu_clock_counter = &si_get_gpu_clock_counter,
Alex Deucher02779c02012-03-20 17:18:25 -04001845 .gart = {
1846 .tlb_flush = &si_pcie_gart_tlb_flush,
1847 .set_page = &rs600_gart_set_page,
1848 },
Christian König05b07142012-08-06 20:21:10 +02001849 .vm = {
1850 .init = &si_vm_init,
1851 .fini = &si_vm_fini,
Christian König03f62ab2014-07-30 21:05:17 +02001852 .copy_pages = &si_dma_vm_copy_pages,
1853 .write_pages = &si_dma_vm_write_pages,
1854 .set_pages = &si_dma_vm_set_pages,
1855 .pad_ib = &cayman_dma_vm_pad_ib,
Christian König05b07142012-08-06 20:21:10 +02001856 },
Alex Deucher02779c02012-03-20 17:18:25 -04001857 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02001858 [RADEON_RING_TYPE_GFX_INDEX] = &si_gfx_ring,
1859 [CAYMAN_RING_TYPE_CP1_INDEX] = &si_gfx_ring,
1860 [CAYMAN_RING_TYPE_CP2_INDEX] = &si_gfx_ring,
1861 [R600_RING_TYPE_DMA_INDEX] = &si_dma_ring,
1862 [CAYMAN_RING_TYPE_DMA1_INDEX] = &si_dma_ring,
1863 [R600_RING_TYPE_UVD_INDEX] = &cayman_uvd_ring,
Alex Deucher02779c02012-03-20 17:18:25 -04001864 },
1865 .irq = {
1866 .set = &si_irq_set,
1867 .process = &si_irq_process,
1868 },
1869 .display = {
1870 .bandwidth_update = &dce6_bandwidth_update,
1871 .get_vblank_counter = &evergreen_get_vblank_counter,
1872 .wait_for_vblank = &dce4_wait_for_vblank,
Alex Deucher37e9b6a2012-08-03 11:39:43 -04001873 .set_backlight_level = &atombios_set_backlight_level,
Alex Deucher6d92f812012-09-14 09:59:26 -04001874 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherb5306022013-07-31 16:51:33 -04001875 .hdmi_enable = &evergreen_hdmi_enable,
1876 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucher02779c02012-03-20 17:18:25 -04001877 },
1878 .copy = {
Alex Deucher5c722732013-10-01 16:17:14 -04001879 .blit = &r600_copy_cpdma,
Alex Deucher02779c02012-03-20 17:18:25 -04001880 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
Alex Deucher8c5fd7e2012-12-04 15:28:18 -05001881 .dma = &si_copy_dma,
1882 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher2d6cc722012-07-20 13:49:49 -04001883 .copy = &si_copy_dma,
1884 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher02779c02012-03-20 17:18:25 -04001885 },
1886 .surface = {
1887 .set_reg = r600_set_surface_reg,
1888 .clear_reg = r600_clear_surface_reg,
1889 },
1890 .hpd = {
1891 .init = &evergreen_hpd_init,
1892 .fini = &evergreen_hpd_fini,
1893 .sense = &evergreen_hpd_sense,
1894 .set_polarity = &evergreen_hpd_set_polarity,
1895 },
1896 .pm = {
1897 .misc = &evergreen_pm_misc,
1898 .prepare = &evergreen_pm_prepare,
1899 .finish = &evergreen_pm_finish,
1900 .init_profile = &sumo_pm_init_profile,
1901 .get_dynpm_state = &r600_pm_get_dynpm_state,
1902 .get_engine_clock = &radeon_atom_get_engine_clock,
1903 .set_engine_clock = &radeon_atom_set_engine_clock,
1904 .get_memory_clock = &radeon_atom_get_memory_clock,
1905 .set_memory_clock = &radeon_atom_set_memory_clock,
Alex Deucher55b615a2013-03-18 18:57:27 -04001906 .get_pcie_lanes = &r600_get_pcie_lanes,
1907 .set_pcie_lanes = &r600_set_pcie_lanes,
Alex Deucher02779c02012-03-20 17:18:25 -04001908 .set_clock_gating = NULL,
Christian König2539eb02013-04-08 12:41:34 +02001909 .set_uvd_clocks = &si_set_uvd_clocks,
Alex Deucher6bd1c382013-06-21 14:38:03 -04001910 .get_temperature = &si_get_temp,
Alex Deucher02779c02012-03-20 17:18:25 -04001911 },
Alex Deuchera9e61412013-06-25 17:56:16 -04001912 .dpm = {
1913 .init = &si_dpm_init,
1914 .setup_asic = &si_dpm_setup_asic,
1915 .enable = &si_dpm_enable,
Alex Deucher963c1152013-12-19 13:54:35 -05001916 .late_enable = &si_dpm_late_enable,
Alex Deuchera9e61412013-06-25 17:56:16 -04001917 .disable = &si_dpm_disable,
1918 .pre_set_power_state = &si_dpm_pre_set_power_state,
1919 .set_power_state = &si_dpm_set_power_state,
1920 .post_set_power_state = &si_dpm_post_set_power_state,
1921 .display_configuration_changed = &si_dpm_display_configuration_changed,
1922 .fini = &si_dpm_fini,
1923 .get_sclk = &ni_dpm_get_sclk,
1924 .get_mclk = &ni_dpm_get_mclk,
1925 .print_power_state = &ni_dpm_print_power_state,
Alex Deucher79821282013-06-28 18:02:19 -04001926 .debugfs_print_current_performance_level = &si_dpm_debugfs_print_current_performance_level,
Alex Deuchera160a6a2013-07-02 18:46:28 -04001927 .force_performance_level = &si_dpm_force_performance_level,
Alex Deucherf4dec312013-07-08 12:15:11 -04001928 .vblank_too_short = &ni_dpm_vblank_too_short,
Alex Deuchera9e61412013-06-25 17:56:16 -04001929 },
Alex Deucher02779c02012-03-20 17:18:25 -04001930 .pflip = {
Alex Deucher02779c02012-03-20 17:18:25 -04001931 .page_flip = &evergreen_page_flip,
Christian König157fa142014-05-27 16:49:20 +02001932 .page_flip_pending = &evergreen_page_flip_pending,
Alex Deucher02779c02012-03-20 17:18:25 -04001933 },
1934};
1935
Christian König76a0df82013-08-13 11:56:50 +02001936static struct radeon_asic_ring ci_gfx_ring = {
1937 .ib_execute = &cik_ring_ib_execute,
1938 .ib_parse = &cik_ib_parse,
1939 .emit_fence = &cik_fence_gfx_ring_emit,
1940 .emit_semaphore = &cik_semaphore_ring_emit,
1941 .cs_parse = NULL,
1942 .ring_test = &cik_ring_test,
1943 .ib_test = &cik_ib_test,
1944 .is_lockup = &cik_gfx_is_lockup,
1945 .vm_flush = &cik_vm_flush,
Alex Deucherea31bf62013-12-09 19:44:30 -05001946 .get_rptr = &cik_gfx_get_rptr,
1947 .get_wptr = &cik_gfx_get_wptr,
1948 .set_wptr = &cik_gfx_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001949};
1950
1951static struct radeon_asic_ring ci_cp_ring = {
1952 .ib_execute = &cik_ring_ib_execute,
1953 .ib_parse = &cik_ib_parse,
1954 .emit_fence = &cik_fence_compute_ring_emit,
1955 .emit_semaphore = &cik_semaphore_ring_emit,
1956 .cs_parse = NULL,
1957 .ring_test = &cik_ring_test,
1958 .ib_test = &cik_ib_test,
1959 .is_lockup = &cik_gfx_is_lockup,
1960 .vm_flush = &cik_vm_flush,
Alex Deucherea31bf62013-12-09 19:44:30 -05001961 .get_rptr = &cik_compute_get_rptr,
1962 .get_wptr = &cik_compute_get_wptr,
1963 .set_wptr = &cik_compute_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001964};
1965
1966static struct radeon_asic_ring ci_dma_ring = {
1967 .ib_execute = &cik_sdma_ring_ib_execute,
1968 .ib_parse = &cik_ib_parse,
1969 .emit_fence = &cik_sdma_fence_ring_emit,
1970 .emit_semaphore = &cik_sdma_semaphore_ring_emit,
1971 .cs_parse = NULL,
1972 .ring_test = &cik_sdma_ring_test,
1973 .ib_test = &cik_sdma_ib_test,
1974 .is_lockup = &cik_sdma_is_lockup,
1975 .vm_flush = &cik_dma_vm_flush,
Alex Deucherea31bf62013-12-09 19:44:30 -05001976 .get_rptr = &cik_sdma_get_rptr,
1977 .get_wptr = &cik_sdma_get_wptr,
1978 .set_wptr = &cik_sdma_set_wptr,
Christian König76a0df82013-08-13 11:56:50 +02001979};
1980
Christian Königd93f7932013-05-23 12:10:04 +02001981static struct radeon_asic_ring ci_vce_ring = {
1982 .ib_execute = &radeon_vce_ib_execute,
1983 .emit_fence = &radeon_vce_fence_emit,
1984 .emit_semaphore = &radeon_vce_semaphore_emit,
1985 .cs_parse = &radeon_vce_cs_parse,
1986 .ring_test = &radeon_vce_ring_test,
1987 .ib_test = &radeon_vce_ib_test,
1988 .is_lockup = &radeon_ring_test_lockup,
1989 .get_rptr = &vce_v1_0_get_rptr,
1990 .get_wptr = &vce_v1_0_get_wptr,
1991 .set_wptr = &vce_v1_0_set_wptr,
1992};
1993
Alex Deucher0672e272013-04-09 16:22:31 -04001994static struct radeon_asic ci_asic = {
1995 .init = &cik_init,
1996 .fini = &cik_fini,
1997 .suspend = &cik_suspend,
1998 .resume = &cik_resume,
1999 .asic_reset = &cik_asic_reset,
2000 .vga_set_state = &r600_vga_set_state,
Michel Dänzer72a99872014-07-31 18:43:49 +09002001 .mmio_hdp_flush = &r600_mmio_hdp_flush,
Alex Deucher0672e272013-04-09 16:22:31 -04002002 .gui_idle = &r600_gui_idle,
2003 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
2004 .get_xclk = &cik_get_xclk,
2005 .get_gpu_clock_counter = &cik_get_gpu_clock_counter,
2006 .gart = {
2007 .tlb_flush = &cik_pcie_gart_tlb_flush,
2008 .set_page = &rs600_gart_set_page,
2009 },
2010 .vm = {
2011 .init = &cik_vm_init,
2012 .fini = &cik_vm_fini,
Christian König03f62ab2014-07-30 21:05:17 +02002013 .copy_pages = &cik_sdma_vm_copy_pages,
2014 .write_pages = &cik_sdma_vm_write_pages,
2015 .set_pages = &cik_sdma_vm_set_pages,
2016 .pad_ib = &cik_sdma_vm_pad_ib,
Alex Deucher0672e272013-04-09 16:22:31 -04002017 },
2018 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02002019 [RADEON_RING_TYPE_GFX_INDEX] = &ci_gfx_ring,
2020 [CAYMAN_RING_TYPE_CP1_INDEX] = &ci_cp_ring,
2021 [CAYMAN_RING_TYPE_CP2_INDEX] = &ci_cp_ring,
2022 [R600_RING_TYPE_DMA_INDEX] = &ci_dma_ring,
2023 [CAYMAN_RING_TYPE_DMA1_INDEX] = &ci_dma_ring,
2024 [R600_RING_TYPE_UVD_INDEX] = &cayman_uvd_ring,
Christian Königd93f7932013-05-23 12:10:04 +02002025 [TN_RING_TYPE_VCE1_INDEX] = &ci_vce_ring,
2026 [TN_RING_TYPE_VCE2_INDEX] = &ci_vce_ring,
Alex Deucher0672e272013-04-09 16:22:31 -04002027 },
2028 .irq = {
2029 .set = &cik_irq_set,
2030 .process = &cik_irq_process,
2031 },
2032 .display = {
2033 .bandwidth_update = &dce8_bandwidth_update,
2034 .get_vblank_counter = &evergreen_get_vblank_counter,
2035 .wait_for_vblank = &dce4_wait_for_vblank,
Samuel Li7272c9d2013-11-19 15:04:45 -05002036 .set_backlight_level = &atombios_set_backlight_level,
2037 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherb5306022013-07-31 16:51:33 -04002038 .hdmi_enable = &evergreen_hdmi_enable,
2039 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucher0672e272013-04-09 16:22:31 -04002040 },
2041 .copy = {
Alex Deucher78196782013-12-09 17:38:51 -05002042 .blit = &cik_copy_cpdma,
Alex Deucher0672e272013-04-09 16:22:31 -04002043 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
2044 .dma = &cik_copy_dma,
2045 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
Christian Königb5be1a82014-06-04 15:29:58 +02002046 .copy = &cik_copy_dma,
2047 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
Alex Deucher0672e272013-04-09 16:22:31 -04002048 },
2049 .surface = {
2050 .set_reg = r600_set_surface_reg,
2051 .clear_reg = r600_clear_surface_reg,
2052 },
2053 .hpd = {
2054 .init = &evergreen_hpd_init,
2055 .fini = &evergreen_hpd_fini,
2056 .sense = &evergreen_hpd_sense,
2057 .set_polarity = &evergreen_hpd_set_polarity,
2058 },
2059 .pm = {
2060 .misc = &evergreen_pm_misc,
2061 .prepare = &evergreen_pm_prepare,
2062 .finish = &evergreen_pm_finish,
2063 .init_profile = &sumo_pm_init_profile,
2064 .get_dynpm_state = &r600_pm_get_dynpm_state,
2065 .get_engine_clock = &radeon_atom_get_engine_clock,
2066 .set_engine_clock = &radeon_atom_set_engine_clock,
2067 .get_memory_clock = &radeon_atom_get_memory_clock,
2068 .set_memory_clock = &radeon_atom_set_memory_clock,
2069 .get_pcie_lanes = NULL,
2070 .set_pcie_lanes = NULL,
2071 .set_clock_gating = NULL,
2072 .set_uvd_clocks = &cik_set_uvd_clocks,
Alex Deucher5ad6bf92013-08-22 17:09:06 -04002073 .set_vce_clocks = &cik_set_vce_clocks,
Alex Deucher286d9cc2013-06-21 15:50:47 -04002074 .get_temperature = &ci_get_temp,
Alex Deucher0672e272013-04-09 16:22:31 -04002075 },
Alex Deuchercc8dbbb2013-08-14 01:03:41 -04002076 .dpm = {
2077 .init = &ci_dpm_init,
2078 .setup_asic = &ci_dpm_setup_asic,
2079 .enable = &ci_dpm_enable,
Alex Deucher90208422013-12-19 13:59:46 -05002080 .late_enable = &ci_dpm_late_enable,
Alex Deuchercc8dbbb2013-08-14 01:03:41 -04002081 .disable = &ci_dpm_disable,
2082 .pre_set_power_state = &ci_dpm_pre_set_power_state,
2083 .set_power_state = &ci_dpm_set_power_state,
2084 .post_set_power_state = &ci_dpm_post_set_power_state,
2085 .display_configuration_changed = &ci_dpm_display_configuration_changed,
2086 .fini = &ci_dpm_fini,
2087 .get_sclk = &ci_dpm_get_sclk,
2088 .get_mclk = &ci_dpm_get_mclk,
2089 .print_power_state = &ci_dpm_print_power_state,
Alex Deucher94b4adc2013-07-15 17:34:33 -04002090 .debugfs_print_current_performance_level = &ci_dpm_debugfs_print_current_performance_level,
Alex Deucher89536fd2013-07-15 18:14:24 -04002091 .force_performance_level = &ci_dpm_force_performance_level,
Alex Deucher54961312013-07-15 18:24:31 -04002092 .vblank_too_short = &ci_dpm_vblank_too_short,
Alex Deucher942bdf72013-08-09 10:05:24 -04002093 .powergate_uvd = &ci_dpm_powergate_uvd,
Alex Deuchercc8dbbb2013-08-14 01:03:41 -04002094 },
Alex Deucher0672e272013-04-09 16:22:31 -04002095 .pflip = {
Alex Deucher0672e272013-04-09 16:22:31 -04002096 .page_flip = &evergreen_page_flip,
Christian König157fa142014-05-27 16:49:20 +02002097 .page_flip_pending = &evergreen_page_flip_pending,
Alex Deucher0672e272013-04-09 16:22:31 -04002098 },
2099};
2100
2101static struct radeon_asic kv_asic = {
2102 .init = &cik_init,
2103 .fini = &cik_fini,
2104 .suspend = &cik_suspend,
2105 .resume = &cik_resume,
2106 .asic_reset = &cik_asic_reset,
2107 .vga_set_state = &r600_vga_set_state,
Michel Dänzer72a99872014-07-31 18:43:49 +09002108 .mmio_hdp_flush = &r600_mmio_hdp_flush,
Alex Deucher0672e272013-04-09 16:22:31 -04002109 .gui_idle = &r600_gui_idle,
2110 .mc_wait_for_idle = &evergreen_mc_wait_for_idle,
2111 .get_xclk = &cik_get_xclk,
2112 .get_gpu_clock_counter = &cik_get_gpu_clock_counter,
2113 .gart = {
2114 .tlb_flush = &cik_pcie_gart_tlb_flush,
2115 .set_page = &rs600_gart_set_page,
2116 },
2117 .vm = {
2118 .init = &cik_vm_init,
2119 .fini = &cik_vm_fini,
Christian König03f62ab2014-07-30 21:05:17 +02002120 .copy_pages = &cik_sdma_vm_copy_pages,
2121 .write_pages = &cik_sdma_vm_write_pages,
2122 .set_pages = &cik_sdma_vm_set_pages,
2123 .pad_ib = &cik_sdma_vm_pad_ib,
Alex Deucher0672e272013-04-09 16:22:31 -04002124 },
2125 .ring = {
Christian König76a0df82013-08-13 11:56:50 +02002126 [RADEON_RING_TYPE_GFX_INDEX] = &ci_gfx_ring,
2127 [CAYMAN_RING_TYPE_CP1_INDEX] = &ci_cp_ring,
2128 [CAYMAN_RING_TYPE_CP2_INDEX] = &ci_cp_ring,
2129 [R600_RING_TYPE_DMA_INDEX] = &ci_dma_ring,
2130 [CAYMAN_RING_TYPE_DMA1_INDEX] = &ci_dma_ring,
2131 [R600_RING_TYPE_UVD_INDEX] = &cayman_uvd_ring,
Christian Königd93f7932013-05-23 12:10:04 +02002132 [TN_RING_TYPE_VCE1_INDEX] = &ci_vce_ring,
2133 [TN_RING_TYPE_VCE2_INDEX] = &ci_vce_ring,
Alex Deucher0672e272013-04-09 16:22:31 -04002134 },
2135 .irq = {
2136 .set = &cik_irq_set,
2137 .process = &cik_irq_process,
2138 },
2139 .display = {
2140 .bandwidth_update = &dce8_bandwidth_update,
2141 .get_vblank_counter = &evergreen_get_vblank_counter,
2142 .wait_for_vblank = &dce4_wait_for_vblank,
Samuel Li7272c9d2013-11-19 15:04:45 -05002143 .set_backlight_level = &atombios_set_backlight_level,
2144 .get_backlight_level = &atombios_get_backlight_level,
Alex Deucherb5306022013-07-31 16:51:33 -04002145 .hdmi_enable = &evergreen_hdmi_enable,
2146 .hdmi_setmode = &evergreen_hdmi_setmode,
Alex Deucher0672e272013-04-09 16:22:31 -04002147 },
2148 .copy = {
Alex Deucher78196782013-12-09 17:38:51 -05002149 .blit = &cik_copy_cpdma,
Alex Deucher0672e272013-04-09 16:22:31 -04002150 .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX,
2151 .dma = &cik_copy_dma,
2152 .dma_ring_index = R600_RING_TYPE_DMA_INDEX,
2153 .copy = &cik_copy_dma,
2154 .copy_ring_index = R600_RING_TYPE_DMA_INDEX,
2155 },
2156 .surface = {
2157 .set_reg = r600_set_surface_reg,
2158 .clear_reg = r600_clear_surface_reg,
2159 },
2160 .hpd = {
2161 .init = &evergreen_hpd_init,
2162 .fini = &evergreen_hpd_fini,
2163 .sense = &evergreen_hpd_sense,
2164 .set_polarity = &evergreen_hpd_set_polarity,
2165 },
2166 .pm = {
2167 .misc = &evergreen_pm_misc,
2168 .prepare = &evergreen_pm_prepare,
2169 .finish = &evergreen_pm_finish,
2170 .init_profile = &sumo_pm_init_profile,
2171 .get_dynpm_state = &r600_pm_get_dynpm_state,
2172 .get_engine_clock = &radeon_atom_get_engine_clock,
2173 .set_engine_clock = &radeon_atom_set_engine_clock,
2174 .get_memory_clock = &radeon_atom_get_memory_clock,
2175 .set_memory_clock = &radeon_atom_set_memory_clock,
2176 .get_pcie_lanes = NULL,
2177 .set_pcie_lanes = NULL,
2178 .set_clock_gating = NULL,
2179 .set_uvd_clocks = &cik_set_uvd_clocks,
Alex Deucher5ad6bf92013-08-22 17:09:06 -04002180 .set_vce_clocks = &cik_set_vce_clocks,
Alex Deucher286d9cc2013-06-21 15:50:47 -04002181 .get_temperature = &kv_get_temp,
Alex Deucher0672e272013-04-09 16:22:31 -04002182 },
Alex Deucher41a524a2013-08-14 01:01:40 -04002183 .dpm = {
2184 .init = &kv_dpm_init,
2185 .setup_asic = &kv_dpm_setup_asic,
2186 .enable = &kv_dpm_enable,
Alex Deucherd8852c32013-12-19 14:03:36 -05002187 .late_enable = &kv_dpm_late_enable,
Alex Deucher41a524a2013-08-14 01:01:40 -04002188 .disable = &kv_dpm_disable,
2189 .pre_set_power_state = &kv_dpm_pre_set_power_state,
2190 .set_power_state = &kv_dpm_set_power_state,
2191 .post_set_power_state = &kv_dpm_post_set_power_state,
2192 .display_configuration_changed = &kv_dpm_display_configuration_changed,
2193 .fini = &kv_dpm_fini,
2194 .get_sclk = &kv_dpm_get_sclk,
2195 .get_mclk = &kv_dpm_get_mclk,
2196 .print_power_state = &kv_dpm_print_power_state,
Alex Deucherae3e40e2013-07-18 16:39:53 -04002197 .debugfs_print_current_performance_level = &kv_dpm_debugfs_print_current_performance_level,
Alex Deucher2b4c8022013-07-18 16:48:46 -04002198 .force_performance_level = &kv_dpm_force_performance_level,
Alex Deucher77df5082013-08-09 10:02:40 -04002199 .powergate_uvd = &kv_dpm_powergate_uvd,
Alex Deucherb7a5ae92013-09-09 19:33:08 -04002200 .enable_bapm = &kv_dpm_enable_bapm,
Alex Deucher41a524a2013-08-14 01:01:40 -04002201 },
Alex Deucher0672e272013-04-09 16:22:31 -04002202 .pflip = {
Alex Deucher0672e272013-04-09 16:22:31 -04002203 .page_flip = &evergreen_page_flip,
Christian König157fa142014-05-27 16:49:20 +02002204 .page_flip_pending = &evergreen_page_flip_pending,
Alex Deucher0672e272013-04-09 16:22:31 -04002205 },
2206};
2207
Alex Deucherabf1dc62012-07-17 14:02:36 -04002208/**
2209 * radeon_asic_init - register asic specific callbacks
2210 *
2211 * @rdev: radeon device pointer
2212 *
2213 * Registers the appropriate asic specific callbacks for each
2214 * chip family. Also sets other asics specific info like the number
2215 * of crtcs and the register aperture accessors (all asics).
2216 * Returns 0 for success.
2217 */
Daniel Vetter0a10c852010-03-11 21:19:14 +00002218int radeon_asic_init(struct radeon_device *rdev)
2219{
2220 radeon_register_accessor_init(rdev);
Alex Deucherba7e05e2011-06-16 18:14:22 +00002221
2222 /* set the number of crtcs */
2223 if (rdev->flags & RADEON_SINGLE_CRTC)
2224 rdev->num_crtc = 1;
2225 else
2226 rdev->num_crtc = 2;
2227
Alex Deucher948bee32013-05-14 12:08:35 -04002228 rdev->has_uvd = false;
2229
Daniel Vetter0a10c852010-03-11 21:19:14 +00002230 switch (rdev->family) {
2231 case CHIP_R100:
2232 case CHIP_RV100:
2233 case CHIP_RS100:
2234 case CHIP_RV200:
2235 case CHIP_RS200:
2236 rdev->asic = &r100_asic;
2237 break;
2238 case CHIP_R200:
2239 case CHIP_RV250:
2240 case CHIP_RS300:
2241 case CHIP_RV280:
2242 rdev->asic = &r200_asic;
2243 break;
2244 case CHIP_R300:
2245 case CHIP_R350:
2246 case CHIP_RV350:
2247 case CHIP_RV380:
2248 if (rdev->flags & RADEON_IS_PCIE)
2249 rdev->asic = &r300_asic_pcie;
2250 else
2251 rdev->asic = &r300_asic;
2252 break;
2253 case CHIP_R420:
2254 case CHIP_R423:
2255 case CHIP_RV410:
2256 rdev->asic = &r420_asic;
Alex Deucher07bb0842010-06-22 21:58:26 -04002257 /* handle macs */
2258 if (rdev->bios == NULL) {
Alex Deucher798bcf72012-02-23 17:53:48 -05002259 rdev->asic->pm.get_engine_clock = &radeon_legacy_get_engine_clock;
2260 rdev->asic->pm.set_engine_clock = &radeon_legacy_set_engine_clock;
2261 rdev->asic->pm.get_memory_clock = &radeon_legacy_get_memory_clock;
2262 rdev->asic->pm.set_memory_clock = NULL;
Alex Deucher37e9b6a2012-08-03 11:39:43 -04002263 rdev->asic->display.set_backlight_level = &radeon_legacy_set_backlight_level;
Alex Deucher07bb0842010-06-22 21:58:26 -04002264 }
Daniel Vetter0a10c852010-03-11 21:19:14 +00002265 break;
2266 case CHIP_RS400:
2267 case CHIP_RS480:
2268 rdev->asic = &rs400_asic;
2269 break;
2270 case CHIP_RS600:
2271 rdev->asic = &rs600_asic;
2272 break;
2273 case CHIP_RS690:
2274 case CHIP_RS740:
2275 rdev->asic = &rs690_asic;
2276 break;
2277 case CHIP_RV515:
2278 rdev->asic = &rv515_asic;
2279 break;
2280 case CHIP_R520:
2281 case CHIP_RV530:
2282 case CHIP_RV560:
2283 case CHIP_RV570:
2284 case CHIP_R580:
2285 rdev->asic = &r520_asic;
2286 break;
2287 case CHIP_R600:
Alex Deucherca361b62013-06-21 14:42:08 -04002288 rdev->asic = &r600_asic;
2289 break;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002290 case CHIP_RV610:
2291 case CHIP_RV630:
2292 case CHIP_RV620:
2293 case CHIP_RV635:
2294 case CHIP_RV670:
Alex Deucherca361b62013-06-21 14:42:08 -04002295 rdev->asic = &rv6xx_asic;
2296 rdev->has_uvd = true;
Alex Deucherf47299c2010-03-16 20:54:38 -04002297 break;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002298 case CHIP_RS780:
2299 case CHIP_RS880:
Alex Deucherf47299c2010-03-16 20:54:38 -04002300 rdev->asic = &rs780_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002301 rdev->has_uvd = true;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002302 break;
2303 case CHIP_RV770:
2304 case CHIP_RV730:
2305 case CHIP_RV710:
2306 case CHIP_RV740:
2307 rdev->asic = &rv770_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002308 rdev->has_uvd = true;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002309 break;
2310 case CHIP_CEDAR:
2311 case CHIP_REDWOOD:
2312 case CHIP_JUNIPER:
2313 case CHIP_CYPRESS:
2314 case CHIP_HEMLOCK:
Alex Deucherba7e05e2011-06-16 18:14:22 +00002315 /* set num crtcs */
2316 if (rdev->family == CHIP_CEDAR)
2317 rdev->num_crtc = 4;
2318 else
2319 rdev->num_crtc = 6;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002320 rdev->asic = &evergreen_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002321 rdev->has_uvd = true;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002322 break;
Alex Deucher958261d2010-11-22 17:56:30 -05002323 case CHIP_PALM:
Alex Deucher89da5a32011-05-31 15:42:47 -04002324 case CHIP_SUMO:
2325 case CHIP_SUMO2:
Alex Deucher958261d2010-11-22 17:56:30 -05002326 rdev->asic = &sumo_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002327 rdev->has_uvd = true;
Alex Deucher958261d2010-11-22 17:56:30 -05002328 break;
Alex Deuchera43b7662011-01-06 21:19:33 -05002329 case CHIP_BARTS:
2330 case CHIP_TURKS:
2331 case CHIP_CAICOS:
Alex Deucherba7e05e2011-06-16 18:14:22 +00002332 /* set num crtcs */
2333 if (rdev->family == CHIP_CAICOS)
2334 rdev->num_crtc = 4;
2335 else
2336 rdev->num_crtc = 6;
Alex Deuchera43b7662011-01-06 21:19:33 -05002337 rdev->asic = &btc_asic;
Alex Deucher948bee32013-05-14 12:08:35 -04002338 rdev->has_uvd = true;
Alex Deuchera43b7662011-01-06 21:19:33 -05002339 break;
Alex Deuchere3487622011-03-02 20:07:36 -05002340 case CHIP_CAYMAN:
2341 rdev->asic = &cayman_asic;
Alex Deucherba7e05e2011-06-16 18:14:22 +00002342 /* set num crtcs */
2343 rdev->num_crtc = 6;
Alex Deucher948bee32013-05-14 12:08:35 -04002344 rdev->has_uvd = true;
Alex Deuchere3487622011-03-02 20:07:36 -05002345 break;
Alex Deucherbe63fe82012-03-20 17:18:40 -04002346 case CHIP_ARUBA:
2347 rdev->asic = &trinity_asic;
2348 /* set num crtcs */
2349 rdev->num_crtc = 4;
Alex Deucher948bee32013-05-14 12:08:35 -04002350 rdev->has_uvd = true;
Alex Deucherbe63fe82012-03-20 17:18:40 -04002351 break;
Alex Deucher02779c02012-03-20 17:18:25 -04002352 case CHIP_TAHITI:
2353 case CHIP_PITCAIRN:
2354 case CHIP_VERDE:
Alex Deuchere737a142012-08-30 14:00:03 -04002355 case CHIP_OLAND:
Alex Deucher86a45ca2012-07-26 19:04:20 -04002356 case CHIP_HAINAN:
Alex Deucher02779c02012-03-20 17:18:25 -04002357 rdev->asic = &si_asic;
2358 /* set num crtcs */
Alex Deucher86a45ca2012-07-26 19:04:20 -04002359 if (rdev->family == CHIP_HAINAN)
2360 rdev->num_crtc = 0;
2361 else if (rdev->family == CHIP_OLAND)
Alex Deuchere737a142012-08-30 14:00:03 -04002362 rdev->num_crtc = 2;
2363 else
2364 rdev->num_crtc = 6;
Alex Deucher948bee32013-05-14 12:08:35 -04002365 if (rdev->family == CHIP_HAINAN)
2366 rdev->has_uvd = false;
2367 else
2368 rdev->has_uvd = true;
Alex Deucher0116e1e2013-08-08 18:00:10 -04002369 switch (rdev->family) {
2370 case CHIP_TAHITI:
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_MC_MGCG |
2379 RADEON_CG_SUPPORT_SDMA_MGCG |
2380 RADEON_CG_SUPPORT_BIF_LS |
2381 RADEON_CG_SUPPORT_VCE_MGCG |
2382 RADEON_CG_SUPPORT_UVD_MGCG |
2383 RADEON_CG_SUPPORT_HDP_LS |
2384 RADEON_CG_SUPPORT_HDP_MGCG;
2385 rdev->pg_flags = 0;
2386 break;
2387 case CHIP_PITCAIRN:
2388 rdev->cg_flags =
Alex Deucher090f4b62013-08-14 18:53:56 -04002389 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher0116e1e2013-08-08 18:00:10 -04002390 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deuchere16866e2013-08-08 19:34:07 -04002391 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
Alex Deucher0116e1e2013-08-08 18:00:10 -04002392 RADEON_CG_SUPPORT_GFX_CGLS |
2393 RADEON_CG_SUPPORT_GFX_CGTS |
2394 RADEON_CG_SUPPORT_GFX_CP_LS |
2395 RADEON_CG_SUPPORT_GFX_RLC_LS |
2396 RADEON_CG_SUPPORT_MC_LS |
2397 RADEON_CG_SUPPORT_MC_MGCG |
2398 RADEON_CG_SUPPORT_SDMA_MGCG |
2399 RADEON_CG_SUPPORT_BIF_LS |
2400 RADEON_CG_SUPPORT_VCE_MGCG |
2401 RADEON_CG_SUPPORT_UVD_MGCG |
2402 RADEON_CG_SUPPORT_HDP_LS |
2403 RADEON_CG_SUPPORT_HDP_MGCG;
2404 rdev->pg_flags = 0;
2405 break;
2406 case CHIP_VERDE:
2407 rdev->cg_flags =
Alex Deucher090f4b62013-08-14 18:53:56 -04002408 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher0116e1e2013-08-08 18:00:10 -04002409 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deuchere16866e2013-08-08 19:34:07 -04002410 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
Alex Deucher0116e1e2013-08-08 18:00:10 -04002411 RADEON_CG_SUPPORT_GFX_CGLS |
2412 RADEON_CG_SUPPORT_GFX_CGTS |
2413 RADEON_CG_SUPPORT_GFX_CP_LS |
2414 RADEON_CG_SUPPORT_GFX_RLC_LS |
2415 RADEON_CG_SUPPORT_MC_LS |
2416 RADEON_CG_SUPPORT_MC_MGCG |
2417 RADEON_CG_SUPPORT_SDMA_MGCG |
2418 RADEON_CG_SUPPORT_BIF_LS |
2419 RADEON_CG_SUPPORT_VCE_MGCG |
2420 RADEON_CG_SUPPORT_UVD_MGCG |
2421 RADEON_CG_SUPPORT_HDP_LS |
2422 RADEON_CG_SUPPORT_HDP_MGCG;
Alex Deucherca6ebb32013-08-13 13:18:37 -04002423 rdev->pg_flags = 0 |
Alex Deucher2b19d172013-09-04 16:58:29 -04002424 /*RADEON_PG_SUPPORT_GFX_PG | */
Alex Deucherca6ebb32013-08-13 13:18:37 -04002425 RADEON_PG_SUPPORT_SDMA;
Alex Deucher0116e1e2013-08-08 18:00:10 -04002426 break;
2427 case CHIP_OLAND:
2428 rdev->cg_flags =
Alex Deucher090f4b62013-08-14 18:53:56 -04002429 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher0116e1e2013-08-08 18:00:10 -04002430 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deuchere16866e2013-08-08 19:34:07 -04002431 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
Alex Deucher0116e1e2013-08-08 18:00:10 -04002432 RADEON_CG_SUPPORT_GFX_CGLS |
2433 RADEON_CG_SUPPORT_GFX_CGTS |
2434 RADEON_CG_SUPPORT_GFX_CP_LS |
2435 RADEON_CG_SUPPORT_GFX_RLC_LS |
2436 RADEON_CG_SUPPORT_MC_LS |
2437 RADEON_CG_SUPPORT_MC_MGCG |
2438 RADEON_CG_SUPPORT_SDMA_MGCG |
2439 RADEON_CG_SUPPORT_BIF_LS |
2440 RADEON_CG_SUPPORT_UVD_MGCG |
2441 RADEON_CG_SUPPORT_HDP_LS |
2442 RADEON_CG_SUPPORT_HDP_MGCG;
2443 rdev->pg_flags = 0;
2444 break;
2445 case CHIP_HAINAN:
2446 rdev->cg_flags =
Alex Deucher090f4b62013-08-14 18:53:56 -04002447 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher0116e1e2013-08-08 18:00:10 -04002448 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deuchere16866e2013-08-08 19:34:07 -04002449 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
Alex Deucher0116e1e2013-08-08 18:00:10 -04002450 RADEON_CG_SUPPORT_GFX_CGLS |
2451 RADEON_CG_SUPPORT_GFX_CGTS |
2452 RADEON_CG_SUPPORT_GFX_CP_LS |
2453 RADEON_CG_SUPPORT_GFX_RLC_LS |
2454 RADEON_CG_SUPPORT_MC_LS |
2455 RADEON_CG_SUPPORT_MC_MGCG |
2456 RADEON_CG_SUPPORT_SDMA_MGCG |
2457 RADEON_CG_SUPPORT_BIF_LS |
2458 RADEON_CG_SUPPORT_HDP_LS |
2459 RADEON_CG_SUPPORT_HDP_MGCG;
2460 rdev->pg_flags = 0;
2461 break;
2462 default:
2463 rdev->cg_flags = 0;
2464 rdev->pg_flags = 0;
2465 break;
2466 }
Alex Deucher02779c02012-03-20 17:18:25 -04002467 break;
Alex Deucher0672e272013-04-09 16:22:31 -04002468 case CHIP_BONAIRE:
Alex Deucher41971b32013-08-19 18:02:26 -04002469 case CHIP_HAWAII:
Alex Deucher0672e272013-04-09 16:22:31 -04002470 rdev->asic = &ci_asic;
2471 rdev->num_crtc = 6;
Alex Deucher22c775c2013-07-23 09:41:05 -04002472 rdev->has_uvd = true;
Alex Deucher41971b32013-08-19 18:02:26 -04002473 if (rdev->family == CHIP_BONAIRE) {
2474 rdev->cg_flags =
2475 RADEON_CG_SUPPORT_GFX_MGCG |
2476 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deucher69609482014-06-26 18:36:24 -04002477 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
Alex Deucher41971b32013-08-19 18:02:26 -04002478 RADEON_CG_SUPPORT_GFX_CGLS |
2479 RADEON_CG_SUPPORT_GFX_CGTS |
2480 RADEON_CG_SUPPORT_GFX_CGTS_LS |
2481 RADEON_CG_SUPPORT_GFX_CP_LS |
2482 RADEON_CG_SUPPORT_MC_LS |
2483 RADEON_CG_SUPPORT_MC_MGCG |
2484 RADEON_CG_SUPPORT_SDMA_MGCG |
2485 RADEON_CG_SUPPORT_SDMA_LS |
2486 RADEON_CG_SUPPORT_BIF_LS |
2487 RADEON_CG_SUPPORT_VCE_MGCG |
2488 RADEON_CG_SUPPORT_UVD_MGCG |
2489 RADEON_CG_SUPPORT_HDP_LS |
2490 RADEON_CG_SUPPORT_HDP_MGCG;
2491 rdev->pg_flags = 0;
2492 } else {
2493 rdev->cg_flags =
2494 RADEON_CG_SUPPORT_GFX_MGCG |
2495 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deucher69609482014-06-26 18:36:24 -04002496 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
Alex Deucher41971b32013-08-19 18:02:26 -04002497 RADEON_CG_SUPPORT_GFX_CGLS |
2498 RADEON_CG_SUPPORT_GFX_CGTS |
2499 RADEON_CG_SUPPORT_GFX_CP_LS |
2500 RADEON_CG_SUPPORT_MC_LS |
2501 RADEON_CG_SUPPORT_MC_MGCG |
2502 RADEON_CG_SUPPORT_SDMA_MGCG |
2503 RADEON_CG_SUPPORT_SDMA_LS |
2504 RADEON_CG_SUPPORT_BIF_LS |
2505 RADEON_CG_SUPPORT_VCE_MGCG |
2506 RADEON_CG_SUPPORT_UVD_MGCG |
2507 RADEON_CG_SUPPORT_HDP_LS |
2508 RADEON_CG_SUPPORT_HDP_MGCG;
2509 rdev->pg_flags = 0;
2510 }
Alex Deucher0672e272013-04-09 16:22:31 -04002511 break;
2512 case CHIP_KAVERI:
2513 case CHIP_KABINI:
Samuel Lib0a9f222014-04-30 18:40:48 -04002514 case CHIP_MULLINS:
Alex Deucher0672e272013-04-09 16:22:31 -04002515 rdev->asic = &kv_asic;
2516 /* set num crtcs */
Alex Deucher473359b2013-08-09 11:18:39 -04002517 if (rdev->family == CHIP_KAVERI) {
Alex Deucher0672e272013-04-09 16:22:31 -04002518 rdev->num_crtc = 4;
Alex Deucher473359b2013-08-09 11:18:39 -04002519 rdev->cg_flags =
Alex Deucher773dc102013-08-14 18:58:43 -04002520 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher473359b2013-08-09 11:18:39 -04002521 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deucher69609482014-06-26 18:36:24 -04002522 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
Alex Deucher473359b2013-08-09 11:18:39 -04002523 RADEON_CG_SUPPORT_GFX_CGLS |
2524 RADEON_CG_SUPPORT_GFX_CGTS |
2525 RADEON_CG_SUPPORT_GFX_CGTS_LS |
2526 RADEON_CG_SUPPORT_GFX_CP_LS |
2527 RADEON_CG_SUPPORT_SDMA_MGCG |
2528 RADEON_CG_SUPPORT_SDMA_LS |
2529 RADEON_CG_SUPPORT_BIF_LS |
2530 RADEON_CG_SUPPORT_VCE_MGCG |
2531 RADEON_CG_SUPPORT_UVD_MGCG |
2532 RADEON_CG_SUPPORT_HDP_LS |
2533 RADEON_CG_SUPPORT_HDP_MGCG;
2534 rdev->pg_flags = 0;
Alex Deucher2b19d172013-09-04 16:58:29 -04002535 /*RADEON_PG_SUPPORT_GFX_PG |
Alex Deucher473359b2013-08-09 11:18:39 -04002536 RADEON_PG_SUPPORT_GFX_SMG |
2537 RADEON_PG_SUPPORT_GFX_DMG |
2538 RADEON_PG_SUPPORT_UVD |
2539 RADEON_PG_SUPPORT_VCE |
2540 RADEON_PG_SUPPORT_CP |
2541 RADEON_PG_SUPPORT_GDS |
2542 RADEON_PG_SUPPORT_RLC_SMU_HS |
2543 RADEON_PG_SUPPORT_ACP |
2544 RADEON_PG_SUPPORT_SAMU;*/
2545 } else {
Alex Deucher0672e272013-04-09 16:22:31 -04002546 rdev->num_crtc = 2;
Alex Deucher473359b2013-08-09 11:18:39 -04002547 rdev->cg_flags =
Alex Deucher773dc102013-08-14 18:58:43 -04002548 RADEON_CG_SUPPORT_GFX_MGCG |
Alex Deucher473359b2013-08-09 11:18:39 -04002549 RADEON_CG_SUPPORT_GFX_MGLS |
Alex Deucher69609482014-06-26 18:36:24 -04002550 /*RADEON_CG_SUPPORT_GFX_CGCG |*/
Alex Deucher473359b2013-08-09 11:18:39 -04002551 RADEON_CG_SUPPORT_GFX_CGLS |
2552 RADEON_CG_SUPPORT_GFX_CGTS |
2553 RADEON_CG_SUPPORT_GFX_CGTS_LS |
2554 RADEON_CG_SUPPORT_GFX_CP_LS |
2555 RADEON_CG_SUPPORT_SDMA_MGCG |
2556 RADEON_CG_SUPPORT_SDMA_LS |
2557 RADEON_CG_SUPPORT_BIF_LS |
2558 RADEON_CG_SUPPORT_VCE_MGCG |
2559 RADEON_CG_SUPPORT_UVD_MGCG |
2560 RADEON_CG_SUPPORT_HDP_LS |
2561 RADEON_CG_SUPPORT_HDP_MGCG;
2562 rdev->pg_flags = 0;
Alex Deucher2b19d172013-09-04 16:58:29 -04002563 /*RADEON_PG_SUPPORT_GFX_PG |
Alex Deucher473359b2013-08-09 11:18:39 -04002564 RADEON_PG_SUPPORT_GFX_SMG |
2565 RADEON_PG_SUPPORT_UVD |
2566 RADEON_PG_SUPPORT_VCE |
2567 RADEON_PG_SUPPORT_CP |
2568 RADEON_PG_SUPPORT_GDS |
2569 RADEON_PG_SUPPORT_RLC_SMU_HS |
2570 RADEON_PG_SUPPORT_SAMU;*/
2571 }
Alex Deucher22c775c2013-07-23 09:41:05 -04002572 rdev->has_uvd = true;
Alex Deucher0672e272013-04-09 16:22:31 -04002573 break;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002574 default:
2575 /* FIXME: not supported yet */
2576 return -EINVAL;
2577 }
2578
2579 if (rdev->flags & RADEON_IS_IGP) {
Alex Deucher798bcf72012-02-23 17:53:48 -05002580 rdev->asic->pm.get_memory_clock = NULL;
2581 rdev->asic->pm.set_memory_clock = NULL;
Daniel Vetter0a10c852010-03-11 21:19:14 +00002582 }
2583
Daniel Vetter0a10c852010-03-11 21:19:14 +00002584 return 0;
2585}
2586