Daniel Vetter | 0a10c85 | 2010-03-11 21:19:14 +0000 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 43 | static uint32_t radeon_invalid_rreg(struct radeon_device *rdev, uint32_t reg) |
| 44 | { |
| 45 | DRM_ERROR("Invalid callback to read register 0x%04X\n", reg); |
| 46 | BUG_ON(1); |
| 47 | return 0; |
| 48 | } |
| 49 | |
| 50 | static void radeon_invalid_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v) |
| 51 | { |
| 52 | DRM_ERROR("Invalid callback to write register 0x%04X with 0x%08X\n", |
| 53 | reg, v); |
| 54 | BUG_ON(1); |
| 55 | } |
| 56 | |
| 57 | static void radeon_register_accessor_init(struct radeon_device *rdev) |
| 58 | { |
| 59 | rdev->mc_rreg = &radeon_invalid_rreg; |
| 60 | rdev->mc_wreg = &radeon_invalid_wreg; |
| 61 | rdev->pll_rreg = &radeon_invalid_rreg; |
| 62 | rdev->pll_wreg = &radeon_invalid_wreg; |
| 63 | rdev->pciep_rreg = &radeon_invalid_rreg; |
| 64 | rdev->pciep_wreg = &radeon_invalid_wreg; |
| 65 | |
| 66 | /* Don't change order as we are overridding accessor. */ |
| 67 | if (rdev->family < CHIP_RV515) { |
| 68 | rdev->pcie_reg_mask = 0xff; |
| 69 | } else { |
| 70 | rdev->pcie_reg_mask = 0x7ff; |
| 71 | } |
| 72 | /* FIXME: not sure here */ |
| 73 | if (rdev->family <= CHIP_R580) { |
| 74 | rdev->pll_rreg = &r100_pll_rreg; |
| 75 | rdev->pll_wreg = &r100_pll_wreg; |
| 76 | } |
| 77 | if (rdev->family >= CHIP_R420) { |
| 78 | rdev->mc_rreg = &r420_mc_rreg; |
| 79 | rdev->mc_wreg = &r420_mc_wreg; |
| 80 | } |
| 81 | if (rdev->family >= CHIP_RV515) { |
| 82 | rdev->mc_rreg = &rv515_mc_rreg; |
| 83 | rdev->mc_wreg = &rv515_mc_wreg; |
| 84 | } |
| 85 | if (rdev->family == CHIP_RS400 || rdev->family == CHIP_RS480) { |
| 86 | rdev->mc_rreg = &rs400_mc_rreg; |
| 87 | rdev->mc_wreg = &rs400_mc_wreg; |
| 88 | } |
| 89 | if (rdev->family == CHIP_RS690 || rdev->family == CHIP_RS740) { |
| 90 | rdev->mc_rreg = &rs690_mc_rreg; |
| 91 | rdev->mc_wreg = &rs690_mc_wreg; |
| 92 | } |
| 93 | if (rdev->family == CHIP_RS600) { |
| 94 | rdev->mc_rreg = &rs600_mc_rreg; |
| 95 | rdev->mc_wreg = &rs600_mc_wreg; |
| 96 | } |
Alex Deucher | b4df8be | 2011-04-12 13:40:18 -0400 | [diff] [blame] | 97 | if (rdev->family >= CHIP_R600) { |
Daniel Vetter | 0a10c85 | 2010-03-11 21:19:14 +0000 | [diff] [blame] | 98 | rdev->pciep_rreg = &r600_pciep_rreg; |
| 99 | rdev->pciep_wreg = &r600_pciep_wreg; |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | |
| 104 | /* helper to disable agp */ |
| 105 | void radeon_agp_disable(struct radeon_device *rdev) |
| 106 | { |
| 107 | rdev->flags &= ~RADEON_IS_AGP; |
| 108 | if (rdev->family >= CHIP_R600) { |
| 109 | DRM_INFO("Forcing AGP to PCIE mode\n"); |
| 110 | rdev->flags |= RADEON_IS_PCIE; |
| 111 | } else if (rdev->family >= CHIP_RV515 || |
| 112 | rdev->family == CHIP_RV380 || |
| 113 | rdev->family == CHIP_RV410 || |
| 114 | rdev->family == CHIP_R423) { |
| 115 | DRM_INFO("Forcing AGP to PCIE mode\n"); |
| 116 | rdev->flags |= RADEON_IS_PCIE; |
| 117 | rdev->asic->gart_tlb_flush = &rv370_pcie_gart_tlb_flush; |
| 118 | rdev->asic->gart_set_page = &rv370_pcie_gart_set_page; |
| 119 | } else { |
| 120 | DRM_INFO("Forcing AGP to PCI mode\n"); |
| 121 | rdev->flags |= RADEON_IS_PCI; |
| 122 | rdev->asic->gart_tlb_flush = &r100_pci_gart_tlb_flush; |
| 123 | rdev->asic->gart_set_page = &r100_pci_gart_set_page; |
| 124 | } |
| 125 | rdev->mc.gtt_size = radeon_gart_size * 1024 * 1024; |
| 126 | } |
| 127 | |
| 128 | /* |
| 129 | * ASIC |
| 130 | */ |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 131 | static struct radeon_asic r100_asic = { |
| 132 | .init = &r100_init, |
| 133 | .fini = &r100_fini, |
| 134 | .suspend = &r100_suspend, |
| 135 | .resume = &r100_resume, |
| 136 | .vga_set_state = &r100_vga_set_state, |
Jerome Glisse | 225758d | 2010-03-09 14:45:10 +0000 | [diff] [blame] | 137 | .gpu_is_lockup = &r100_gpu_is_lockup, |
Jerome Glisse | a2d07b7 | 2010-03-09 14:45:11 +0000 | [diff] [blame] | 138 | .asic_reset = &r100_asic_reset, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 139 | .gart_tlb_flush = &r100_pci_gart_tlb_flush, |
| 140 | .gart_set_page = &r100_pci_gart_set_page, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 141 | .ring_start = &r100_ring_start, |
| 142 | .ring_test = &r100_ring_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 143 | .ring = { |
| 144 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 145 | .ib_execute = &r100_ring_ib_execute, |
| 146 | .emit_fence = &r100_fence_ring_emit, |
| 147 | .emit_semaphore = &r100_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame^] | 148 | .cs_parse = &r100_cs_parse, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 149 | } |
| 150 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 151 | .irq_set = &r100_irq_set, |
| 152 | .irq_process = &r100_irq_process, |
| 153 | .get_vblank_counter = &r100_get_vblank_counter, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 154 | .copy_blit = &r100_copy_blit, |
| 155 | .copy_dma = NULL, |
| 156 | .copy = &r100_copy_blit, |
| 157 | .get_engine_clock = &radeon_legacy_get_engine_clock, |
| 158 | .set_engine_clock = &radeon_legacy_set_engine_clock, |
| 159 | .get_memory_clock = &radeon_legacy_get_memory_clock, |
| 160 | .set_memory_clock = NULL, |
| 161 | .get_pcie_lanes = NULL, |
| 162 | .set_pcie_lanes = NULL, |
| 163 | .set_clock_gating = &radeon_legacy_set_clock_gating, |
| 164 | .set_surface_reg = r100_set_surface_reg, |
| 165 | .clear_surface_reg = r100_clear_surface_reg, |
| 166 | .bandwidth_update = &r100_bandwidth_update, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 167 | .hpd = { |
| 168 | .init = &r100_hpd_init, |
| 169 | .fini = &r100_hpd_fini, |
| 170 | .sense = &r100_hpd_sense, |
| 171 | .set_polarity = &r100_hpd_set_polarity, |
| 172 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 173 | .ioctl_wait_idle = NULL, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 174 | .gui_idle = &r100_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 175 | .pm = { |
| 176 | .misc = &r100_pm_misc, |
| 177 | .prepare = &r100_pm_prepare, |
| 178 | .finish = &r100_pm_finish, |
| 179 | .init_profile = &r100_pm_init_profile, |
| 180 | .get_dynpm_state = &r100_pm_get_dynpm_state, |
| 181 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 182 | .pflip = { |
| 183 | .pre_page_flip = &r100_pre_page_flip, |
| 184 | .page_flip = &r100_page_flip, |
| 185 | .post_page_flip = &r100_post_page_flip, |
| 186 | }, |
Alex Deucher | 3ae19b7 | 2012-02-23 17:53:37 -0500 | [diff] [blame] | 187 | .wait_for_vblank = &r100_wait_for_vblank, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 188 | .mc_wait_for_idle = &r100_mc_wait_for_idle, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 189 | }; |
| 190 | |
| 191 | static struct radeon_asic r200_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 Glisse | 225758d | 2010-03-09 14:45:10 +0000 | [diff] [blame] | 197 | .gpu_is_lockup = &r100_gpu_is_lockup, |
Jerome Glisse | a2d07b7 | 2010-03-09 14:45:11 +0000 | [diff] [blame] | 198 | .asic_reset = &r100_asic_reset, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 199 | .gart_tlb_flush = &r100_pci_gart_tlb_flush, |
| 200 | .gart_set_page = &r100_pci_gart_set_page, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 201 | .ring_start = &r100_ring_start, |
| 202 | .ring_test = &r100_ring_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 203 | .ring = { |
| 204 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 205 | .ib_execute = &r100_ring_ib_execute, |
| 206 | .emit_fence = &r100_fence_ring_emit, |
| 207 | .emit_semaphore = &r100_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame^] | 208 | .cs_parse = &r100_cs_parse, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 209 | } |
| 210 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 211 | .irq_set = &r100_irq_set, |
| 212 | .irq_process = &r100_irq_process, |
| 213 | .get_vblank_counter = &r100_get_vblank_counter, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 214 | .copy_blit = &r100_copy_blit, |
| 215 | .copy_dma = &r200_copy_dma, |
| 216 | .copy = &r100_copy_blit, |
| 217 | .get_engine_clock = &radeon_legacy_get_engine_clock, |
| 218 | .set_engine_clock = &radeon_legacy_set_engine_clock, |
| 219 | .get_memory_clock = &radeon_legacy_get_memory_clock, |
| 220 | .set_memory_clock = NULL, |
| 221 | .set_pcie_lanes = NULL, |
| 222 | .set_clock_gating = &radeon_legacy_set_clock_gating, |
| 223 | .set_surface_reg = r100_set_surface_reg, |
| 224 | .clear_surface_reg = r100_clear_surface_reg, |
| 225 | .bandwidth_update = &r100_bandwidth_update, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 226 | .hpd = { |
| 227 | .init = &r100_hpd_init, |
| 228 | .fini = &r100_hpd_fini, |
| 229 | .sense = &r100_hpd_sense, |
| 230 | .set_polarity = &r100_hpd_set_polarity, |
| 231 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 232 | .ioctl_wait_idle = NULL, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 233 | .gui_idle = &r100_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 234 | .pm = { |
| 235 | .misc = &r100_pm_misc, |
| 236 | .prepare = &r100_pm_prepare, |
| 237 | .finish = &r100_pm_finish, |
| 238 | .init_profile = &r100_pm_init_profile, |
| 239 | .get_dynpm_state = &r100_pm_get_dynpm_state, |
| 240 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 241 | .pflip = { |
| 242 | .pre_page_flip = &r100_pre_page_flip, |
| 243 | .page_flip = &r100_page_flip, |
| 244 | .post_page_flip = &r100_post_page_flip, |
| 245 | }, |
Alex Deucher | 3ae19b7 | 2012-02-23 17:53:37 -0500 | [diff] [blame] | 246 | .wait_for_vblank = &r100_wait_for_vblank, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 247 | .mc_wait_for_idle = &r100_mc_wait_for_idle, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 248 | }; |
| 249 | |
| 250 | static struct radeon_asic r300_asic = { |
| 251 | .init = &r300_init, |
| 252 | .fini = &r300_fini, |
| 253 | .suspend = &r300_suspend, |
| 254 | .resume = &r300_resume, |
| 255 | .vga_set_state = &r100_vga_set_state, |
Jerome Glisse | 225758d | 2010-03-09 14:45:10 +0000 | [diff] [blame] | 256 | .gpu_is_lockup = &r300_gpu_is_lockup, |
Jerome Glisse | a2d07b7 | 2010-03-09 14:45:11 +0000 | [diff] [blame] | 257 | .asic_reset = &r300_asic_reset, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 258 | .gart_tlb_flush = &r100_pci_gart_tlb_flush, |
| 259 | .gart_set_page = &r100_pci_gart_set_page, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 260 | .ring_start = &r300_ring_start, |
| 261 | .ring_test = &r100_ring_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 262 | .ring = { |
| 263 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 264 | .ib_execute = &r100_ring_ib_execute, |
| 265 | .emit_fence = &r300_fence_ring_emit, |
| 266 | .emit_semaphore = &r100_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame^] | 267 | .cs_parse = &r300_cs_parse, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 268 | } |
| 269 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 270 | .irq_set = &r100_irq_set, |
| 271 | .irq_process = &r100_irq_process, |
| 272 | .get_vblank_counter = &r100_get_vblank_counter, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 273 | .copy_blit = &r100_copy_blit, |
| 274 | .copy_dma = &r200_copy_dma, |
| 275 | .copy = &r100_copy_blit, |
| 276 | .get_engine_clock = &radeon_legacy_get_engine_clock, |
| 277 | .set_engine_clock = &radeon_legacy_set_engine_clock, |
| 278 | .get_memory_clock = &radeon_legacy_get_memory_clock, |
| 279 | .set_memory_clock = NULL, |
| 280 | .get_pcie_lanes = &rv370_get_pcie_lanes, |
| 281 | .set_pcie_lanes = &rv370_set_pcie_lanes, |
| 282 | .set_clock_gating = &radeon_legacy_set_clock_gating, |
| 283 | .set_surface_reg = r100_set_surface_reg, |
| 284 | .clear_surface_reg = r100_clear_surface_reg, |
| 285 | .bandwidth_update = &r100_bandwidth_update, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 286 | .hpd = { |
| 287 | .init = &r100_hpd_init, |
| 288 | .fini = &r100_hpd_fini, |
| 289 | .sense = &r100_hpd_sense, |
| 290 | .set_polarity = &r100_hpd_set_polarity, |
| 291 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 292 | .ioctl_wait_idle = NULL, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 293 | .gui_idle = &r100_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 294 | .pm = { |
| 295 | .misc = &r100_pm_misc, |
| 296 | .prepare = &r100_pm_prepare, |
| 297 | .finish = &r100_pm_finish, |
| 298 | .init_profile = &r100_pm_init_profile, |
| 299 | .get_dynpm_state = &r100_pm_get_dynpm_state, |
| 300 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 301 | .pflip = { |
| 302 | .pre_page_flip = &r100_pre_page_flip, |
| 303 | .page_flip = &r100_page_flip, |
| 304 | .post_page_flip = &r100_post_page_flip, |
| 305 | }, |
Alex Deucher | 3ae19b7 | 2012-02-23 17:53:37 -0500 | [diff] [blame] | 306 | .wait_for_vblank = &r100_wait_for_vblank, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 307 | .mc_wait_for_idle = &r300_mc_wait_for_idle, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 308 | }; |
| 309 | |
| 310 | static struct radeon_asic r300_asic_pcie = { |
| 311 | .init = &r300_init, |
| 312 | .fini = &r300_fini, |
| 313 | .suspend = &r300_suspend, |
| 314 | .resume = &r300_resume, |
| 315 | .vga_set_state = &r100_vga_set_state, |
Jerome Glisse | 225758d | 2010-03-09 14:45:10 +0000 | [diff] [blame] | 316 | .gpu_is_lockup = &r300_gpu_is_lockup, |
Jerome Glisse | a2d07b7 | 2010-03-09 14:45:11 +0000 | [diff] [blame] | 317 | .asic_reset = &r300_asic_reset, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 318 | .gart_tlb_flush = &rv370_pcie_gart_tlb_flush, |
| 319 | .gart_set_page = &rv370_pcie_gart_set_page, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 320 | .ring_start = &r300_ring_start, |
| 321 | .ring_test = &r100_ring_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 322 | .ring = { |
| 323 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 324 | .ib_execute = &r100_ring_ib_execute, |
| 325 | .emit_fence = &r300_fence_ring_emit, |
| 326 | .emit_semaphore = &r100_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame^] | 327 | .cs_parse = &r300_cs_parse, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 328 | } |
| 329 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 330 | .irq_set = &r100_irq_set, |
| 331 | .irq_process = &r100_irq_process, |
| 332 | .get_vblank_counter = &r100_get_vblank_counter, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 333 | .copy_blit = &r100_copy_blit, |
| 334 | .copy_dma = &r200_copy_dma, |
| 335 | .copy = &r100_copy_blit, |
| 336 | .get_engine_clock = &radeon_legacy_get_engine_clock, |
| 337 | .set_engine_clock = &radeon_legacy_set_engine_clock, |
| 338 | .get_memory_clock = &radeon_legacy_get_memory_clock, |
| 339 | .set_memory_clock = NULL, |
| 340 | .set_pcie_lanes = &rv370_set_pcie_lanes, |
| 341 | .set_clock_gating = &radeon_legacy_set_clock_gating, |
| 342 | .set_surface_reg = r100_set_surface_reg, |
| 343 | .clear_surface_reg = r100_clear_surface_reg, |
| 344 | .bandwidth_update = &r100_bandwidth_update, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 345 | .hpd = { |
| 346 | .init = &r100_hpd_init, |
| 347 | .fini = &r100_hpd_fini, |
| 348 | .sense = &r100_hpd_sense, |
| 349 | .set_polarity = &r100_hpd_set_polarity, |
| 350 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 351 | .ioctl_wait_idle = NULL, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 352 | .gui_idle = &r100_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 353 | .pm = { |
| 354 | .misc = &r100_pm_misc, |
| 355 | .prepare = &r100_pm_prepare, |
| 356 | .finish = &r100_pm_finish, |
| 357 | .init_profile = &r100_pm_init_profile, |
| 358 | .get_dynpm_state = &r100_pm_get_dynpm_state, |
| 359 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 360 | .pflip = { |
| 361 | .pre_page_flip = &r100_pre_page_flip, |
| 362 | .page_flip = &r100_page_flip, |
| 363 | .post_page_flip = &r100_post_page_flip, |
| 364 | }, |
Alex Deucher | 3ae19b7 | 2012-02-23 17:53:37 -0500 | [diff] [blame] | 365 | .wait_for_vblank = &r100_wait_for_vblank, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 366 | .mc_wait_for_idle = &r300_mc_wait_for_idle, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 367 | }; |
| 368 | |
| 369 | static struct radeon_asic r420_asic = { |
| 370 | .init = &r420_init, |
| 371 | .fini = &r420_fini, |
| 372 | .suspend = &r420_suspend, |
| 373 | .resume = &r420_resume, |
| 374 | .vga_set_state = &r100_vga_set_state, |
Jerome Glisse | 225758d | 2010-03-09 14:45:10 +0000 | [diff] [blame] | 375 | .gpu_is_lockup = &r300_gpu_is_lockup, |
Jerome Glisse | a2d07b7 | 2010-03-09 14:45:11 +0000 | [diff] [blame] | 376 | .asic_reset = &r300_asic_reset, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 377 | .gart_tlb_flush = &rv370_pcie_gart_tlb_flush, |
| 378 | .gart_set_page = &rv370_pcie_gart_set_page, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 379 | .ring_start = &r300_ring_start, |
| 380 | .ring_test = &r100_ring_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 381 | .ring = { |
| 382 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 383 | .ib_execute = &r100_ring_ib_execute, |
| 384 | .emit_fence = &r300_fence_ring_emit, |
| 385 | .emit_semaphore = &r100_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame^] | 386 | .cs_parse = &r300_cs_parse, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 387 | } |
| 388 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 389 | .irq_set = &r100_irq_set, |
| 390 | .irq_process = &r100_irq_process, |
| 391 | .get_vblank_counter = &r100_get_vblank_counter, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 392 | .copy_blit = &r100_copy_blit, |
| 393 | .copy_dma = &r200_copy_dma, |
| 394 | .copy = &r100_copy_blit, |
| 395 | .get_engine_clock = &radeon_atom_get_engine_clock, |
| 396 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 397 | .get_memory_clock = &radeon_atom_get_memory_clock, |
| 398 | .set_memory_clock = &radeon_atom_set_memory_clock, |
| 399 | .get_pcie_lanes = &rv370_get_pcie_lanes, |
| 400 | .set_pcie_lanes = &rv370_set_pcie_lanes, |
| 401 | .set_clock_gating = &radeon_atom_set_clock_gating, |
| 402 | .set_surface_reg = r100_set_surface_reg, |
| 403 | .clear_surface_reg = r100_clear_surface_reg, |
| 404 | .bandwidth_update = &r100_bandwidth_update, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 405 | .hpd = { |
| 406 | .init = &r100_hpd_init, |
| 407 | .fini = &r100_hpd_fini, |
| 408 | .sense = &r100_hpd_sense, |
| 409 | .set_polarity = &r100_hpd_set_polarity, |
| 410 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 411 | .ioctl_wait_idle = NULL, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 412 | .gui_idle = &r100_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 413 | .pm = { |
| 414 | .misc = &r100_pm_misc, |
| 415 | .prepare = &r100_pm_prepare, |
| 416 | .finish = &r100_pm_finish, |
| 417 | .init_profile = &r420_pm_init_profile, |
| 418 | .get_dynpm_state = &r100_pm_get_dynpm_state, |
| 419 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 420 | .pflip = { |
| 421 | .pre_page_flip = &r100_pre_page_flip, |
| 422 | .page_flip = &r100_page_flip, |
| 423 | .post_page_flip = &r100_post_page_flip, |
| 424 | }, |
Alex Deucher | 3ae19b7 | 2012-02-23 17:53:37 -0500 | [diff] [blame] | 425 | .wait_for_vblank = &r100_wait_for_vblank, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 426 | .mc_wait_for_idle = &r300_mc_wait_for_idle, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 427 | }; |
| 428 | |
| 429 | static struct radeon_asic rs400_asic = { |
| 430 | .init = &rs400_init, |
| 431 | .fini = &rs400_fini, |
| 432 | .suspend = &rs400_suspend, |
| 433 | .resume = &rs400_resume, |
| 434 | .vga_set_state = &r100_vga_set_state, |
Jerome Glisse | 225758d | 2010-03-09 14:45:10 +0000 | [diff] [blame] | 435 | .gpu_is_lockup = &r300_gpu_is_lockup, |
Jerome Glisse | a2d07b7 | 2010-03-09 14:45:11 +0000 | [diff] [blame] | 436 | .asic_reset = &r300_asic_reset, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 437 | .gart_tlb_flush = &rs400_gart_tlb_flush, |
| 438 | .gart_set_page = &rs400_gart_set_page, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 439 | .ring_start = &r300_ring_start, |
| 440 | .ring_test = &r100_ring_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 441 | .ring = { |
| 442 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 443 | .ib_execute = &r100_ring_ib_execute, |
| 444 | .emit_fence = &r300_fence_ring_emit, |
| 445 | .emit_semaphore = &r100_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame^] | 446 | .cs_parse = &r300_cs_parse, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 447 | } |
| 448 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 449 | .irq_set = &r100_irq_set, |
| 450 | .irq_process = &r100_irq_process, |
| 451 | .get_vblank_counter = &r100_get_vblank_counter, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 452 | .copy_blit = &r100_copy_blit, |
| 453 | .copy_dma = &r200_copy_dma, |
| 454 | .copy = &r100_copy_blit, |
| 455 | .get_engine_clock = &radeon_legacy_get_engine_clock, |
| 456 | .set_engine_clock = &radeon_legacy_set_engine_clock, |
| 457 | .get_memory_clock = &radeon_legacy_get_memory_clock, |
| 458 | .set_memory_clock = NULL, |
| 459 | .get_pcie_lanes = NULL, |
| 460 | .set_pcie_lanes = NULL, |
| 461 | .set_clock_gating = &radeon_legacy_set_clock_gating, |
| 462 | .set_surface_reg = r100_set_surface_reg, |
| 463 | .clear_surface_reg = r100_clear_surface_reg, |
| 464 | .bandwidth_update = &r100_bandwidth_update, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 465 | .hpd = { |
| 466 | .init = &r100_hpd_init, |
| 467 | .fini = &r100_hpd_fini, |
| 468 | .sense = &r100_hpd_sense, |
| 469 | .set_polarity = &r100_hpd_set_polarity, |
| 470 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 471 | .ioctl_wait_idle = NULL, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 472 | .gui_idle = &r100_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 473 | .pm = { |
| 474 | .misc = &r100_pm_misc, |
| 475 | .prepare = &r100_pm_prepare, |
| 476 | .finish = &r100_pm_finish, |
| 477 | .init_profile = &r100_pm_init_profile, |
| 478 | .get_dynpm_state = &r100_pm_get_dynpm_state, |
| 479 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 480 | .pflip = { |
| 481 | .pre_page_flip = &r100_pre_page_flip, |
| 482 | .page_flip = &r100_page_flip, |
| 483 | .post_page_flip = &r100_post_page_flip, |
| 484 | }, |
Alex Deucher | 3ae19b7 | 2012-02-23 17:53:37 -0500 | [diff] [blame] | 485 | .wait_for_vblank = &r100_wait_for_vblank, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 486 | .mc_wait_for_idle = &rs400_mc_wait_for_idle, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 487 | }; |
| 488 | |
| 489 | static struct radeon_asic rs600_asic = { |
| 490 | .init = &rs600_init, |
| 491 | .fini = &rs600_fini, |
| 492 | .suspend = &rs600_suspend, |
| 493 | .resume = &rs600_resume, |
| 494 | .vga_set_state = &r100_vga_set_state, |
Jerome Glisse | 225758d | 2010-03-09 14:45:10 +0000 | [diff] [blame] | 495 | .gpu_is_lockup = &r300_gpu_is_lockup, |
Jerome Glisse | 90aca4d | 2010-03-09 14:45:12 +0000 | [diff] [blame] | 496 | .asic_reset = &rs600_asic_reset, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 497 | .gart_tlb_flush = &rs600_gart_tlb_flush, |
| 498 | .gart_set_page = &rs600_gart_set_page, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 499 | .ring_start = &r300_ring_start, |
| 500 | .ring_test = &r100_ring_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 501 | .ring = { |
| 502 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 503 | .ib_execute = &r100_ring_ib_execute, |
| 504 | .emit_fence = &r300_fence_ring_emit, |
| 505 | .emit_semaphore = &r100_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame^] | 506 | .cs_parse = &r300_cs_parse, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 507 | } |
| 508 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 509 | .irq_set = &rs600_irq_set, |
| 510 | .irq_process = &rs600_irq_process, |
| 511 | .get_vblank_counter = &rs600_get_vblank_counter, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 512 | .copy_blit = &r100_copy_blit, |
| 513 | .copy_dma = &r200_copy_dma, |
| 514 | .copy = &r100_copy_blit, |
| 515 | .get_engine_clock = &radeon_atom_get_engine_clock, |
| 516 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 517 | .get_memory_clock = &radeon_atom_get_memory_clock, |
| 518 | .set_memory_clock = &radeon_atom_set_memory_clock, |
| 519 | .get_pcie_lanes = NULL, |
| 520 | .set_pcie_lanes = NULL, |
| 521 | .set_clock_gating = &radeon_atom_set_clock_gating, |
| 522 | .set_surface_reg = r100_set_surface_reg, |
| 523 | .clear_surface_reg = r100_clear_surface_reg, |
| 524 | .bandwidth_update = &rs600_bandwidth_update, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 525 | .hpd = { |
| 526 | .init = &rs600_hpd_init, |
| 527 | .fini = &rs600_hpd_fini, |
| 528 | .sense = &rs600_hpd_sense, |
| 529 | .set_polarity = &rs600_hpd_set_polarity, |
| 530 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 531 | .ioctl_wait_idle = NULL, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 532 | .gui_idle = &r100_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 533 | .pm = { |
| 534 | .misc = &rs600_pm_misc, |
| 535 | .prepare = &rs600_pm_prepare, |
| 536 | .finish = &rs600_pm_finish, |
| 537 | .init_profile = &r420_pm_init_profile, |
| 538 | .get_dynpm_state = &r100_pm_get_dynpm_state, |
| 539 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 540 | .pflip = { |
| 541 | .pre_page_flip = &rs600_pre_page_flip, |
| 542 | .page_flip = &rs600_page_flip, |
| 543 | .post_page_flip = &rs600_post_page_flip, |
| 544 | }, |
Alex Deucher | 3ae19b7 | 2012-02-23 17:53:37 -0500 | [diff] [blame] | 545 | .wait_for_vblank = &avivo_wait_for_vblank, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 546 | .mc_wait_for_idle = &rs600_mc_wait_for_idle, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 547 | }; |
| 548 | |
| 549 | static struct radeon_asic rs690_asic = { |
| 550 | .init = &rs690_init, |
| 551 | .fini = &rs690_fini, |
| 552 | .suspend = &rs690_suspend, |
| 553 | .resume = &rs690_resume, |
| 554 | .vga_set_state = &r100_vga_set_state, |
Jerome Glisse | 225758d | 2010-03-09 14:45:10 +0000 | [diff] [blame] | 555 | .gpu_is_lockup = &r300_gpu_is_lockup, |
Jerome Glisse | 90aca4d | 2010-03-09 14:45:12 +0000 | [diff] [blame] | 556 | .asic_reset = &rs600_asic_reset, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 557 | .gart_tlb_flush = &rs400_gart_tlb_flush, |
| 558 | .gart_set_page = &rs400_gart_set_page, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 559 | .ring_start = &r300_ring_start, |
| 560 | .ring_test = &r100_ring_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 561 | .ring = { |
| 562 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 563 | .ib_execute = &r100_ring_ib_execute, |
| 564 | .emit_fence = &r300_fence_ring_emit, |
| 565 | .emit_semaphore = &r100_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame^] | 566 | .cs_parse = &r300_cs_parse, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 567 | } |
| 568 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 569 | .irq_set = &rs600_irq_set, |
| 570 | .irq_process = &rs600_irq_process, |
| 571 | .get_vblank_counter = &rs600_get_vblank_counter, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 572 | .copy_blit = &r100_copy_blit, |
| 573 | .copy_dma = &r200_copy_dma, |
| 574 | .copy = &r200_copy_dma, |
| 575 | .get_engine_clock = &radeon_atom_get_engine_clock, |
| 576 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 577 | .get_memory_clock = &radeon_atom_get_memory_clock, |
| 578 | .set_memory_clock = &radeon_atom_set_memory_clock, |
| 579 | .get_pcie_lanes = NULL, |
| 580 | .set_pcie_lanes = NULL, |
| 581 | .set_clock_gating = &radeon_atom_set_clock_gating, |
| 582 | .set_surface_reg = r100_set_surface_reg, |
| 583 | .clear_surface_reg = r100_clear_surface_reg, |
| 584 | .bandwidth_update = &rs690_bandwidth_update, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 585 | .hpd = { |
| 586 | .init = &rs600_hpd_init, |
| 587 | .fini = &rs600_hpd_fini, |
| 588 | .sense = &rs600_hpd_sense, |
| 589 | .set_polarity = &rs600_hpd_set_polarity, |
| 590 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 591 | .ioctl_wait_idle = NULL, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 592 | .gui_idle = &r100_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 593 | .pm = { |
| 594 | .misc = &rs600_pm_misc, |
| 595 | .prepare = &rs600_pm_prepare, |
| 596 | .finish = &rs600_pm_finish, |
| 597 | .init_profile = &r420_pm_init_profile, |
| 598 | .get_dynpm_state = &r100_pm_get_dynpm_state, |
| 599 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 600 | .pflip = { |
| 601 | .pre_page_flip = &rs600_pre_page_flip, |
| 602 | .page_flip = &rs600_page_flip, |
| 603 | .post_page_flip = &rs600_post_page_flip, |
| 604 | }, |
Alex Deucher | 3ae19b7 | 2012-02-23 17:53:37 -0500 | [diff] [blame] | 605 | .wait_for_vblank = &avivo_wait_for_vblank, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 606 | .mc_wait_for_idle = &rs690_mc_wait_for_idle, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 607 | }; |
| 608 | |
| 609 | static struct radeon_asic rv515_asic = { |
| 610 | .init = &rv515_init, |
| 611 | .fini = &rv515_fini, |
| 612 | .suspend = &rv515_suspend, |
| 613 | .resume = &rv515_resume, |
| 614 | .vga_set_state = &r100_vga_set_state, |
Jerome Glisse | 225758d | 2010-03-09 14:45:10 +0000 | [diff] [blame] | 615 | .gpu_is_lockup = &r300_gpu_is_lockup, |
Jerome Glisse | 90aca4d | 2010-03-09 14:45:12 +0000 | [diff] [blame] | 616 | .asic_reset = &rs600_asic_reset, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 617 | .gart_tlb_flush = &rv370_pcie_gart_tlb_flush, |
| 618 | .gart_set_page = &rv370_pcie_gart_set_page, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 619 | .ring_start = &rv515_ring_start, |
| 620 | .ring_test = &r100_ring_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 621 | .ring = { |
| 622 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 623 | .ib_execute = &r100_ring_ib_execute, |
| 624 | .emit_fence = &r300_fence_ring_emit, |
| 625 | .emit_semaphore = &r100_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame^] | 626 | .cs_parse = &r300_cs_parse, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 627 | } |
| 628 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 629 | .irq_set = &rs600_irq_set, |
| 630 | .irq_process = &rs600_irq_process, |
| 631 | .get_vblank_counter = &rs600_get_vblank_counter, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 632 | .copy_blit = &r100_copy_blit, |
| 633 | .copy_dma = &r200_copy_dma, |
| 634 | .copy = &r100_copy_blit, |
| 635 | .get_engine_clock = &radeon_atom_get_engine_clock, |
| 636 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 637 | .get_memory_clock = &radeon_atom_get_memory_clock, |
| 638 | .set_memory_clock = &radeon_atom_set_memory_clock, |
| 639 | .get_pcie_lanes = &rv370_get_pcie_lanes, |
| 640 | .set_pcie_lanes = &rv370_set_pcie_lanes, |
| 641 | .set_clock_gating = &radeon_atom_set_clock_gating, |
| 642 | .set_surface_reg = r100_set_surface_reg, |
| 643 | .clear_surface_reg = r100_clear_surface_reg, |
| 644 | .bandwidth_update = &rv515_bandwidth_update, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 645 | .hpd = { |
| 646 | .init = &rs600_hpd_init, |
| 647 | .fini = &rs600_hpd_fini, |
| 648 | .sense = &rs600_hpd_sense, |
| 649 | .set_polarity = &rs600_hpd_set_polarity, |
| 650 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 651 | .ioctl_wait_idle = NULL, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 652 | .gui_idle = &r100_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 653 | .pm = { |
| 654 | .misc = &rs600_pm_misc, |
| 655 | .prepare = &rs600_pm_prepare, |
| 656 | .finish = &rs600_pm_finish, |
| 657 | .init_profile = &r420_pm_init_profile, |
| 658 | .get_dynpm_state = &r100_pm_get_dynpm_state, |
| 659 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 660 | .pflip = { |
| 661 | .pre_page_flip = &rs600_pre_page_flip, |
| 662 | .page_flip = &rs600_page_flip, |
| 663 | .post_page_flip = &rs600_post_page_flip, |
| 664 | }, |
Alex Deucher | 3ae19b7 | 2012-02-23 17:53:37 -0500 | [diff] [blame] | 665 | .wait_for_vblank = &avivo_wait_for_vblank, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 666 | .mc_wait_for_idle = &rv515_mc_wait_for_idle, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 667 | }; |
| 668 | |
| 669 | static struct radeon_asic r520_asic = { |
| 670 | .init = &r520_init, |
| 671 | .fini = &rv515_fini, |
| 672 | .suspend = &rv515_suspend, |
| 673 | .resume = &r520_resume, |
| 674 | .vga_set_state = &r100_vga_set_state, |
Jerome Glisse | 225758d | 2010-03-09 14:45:10 +0000 | [diff] [blame] | 675 | .gpu_is_lockup = &r300_gpu_is_lockup, |
Jerome Glisse | 90aca4d | 2010-03-09 14:45:12 +0000 | [diff] [blame] | 676 | .asic_reset = &rs600_asic_reset, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 677 | .gart_tlb_flush = &rv370_pcie_gart_tlb_flush, |
| 678 | .gart_set_page = &rv370_pcie_gart_set_page, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 679 | .ring_start = &rv515_ring_start, |
| 680 | .ring_test = &r100_ring_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 681 | .ring = { |
| 682 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 683 | .ib_execute = &r100_ring_ib_execute, |
| 684 | .emit_fence = &r300_fence_ring_emit, |
| 685 | .emit_semaphore = &r100_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame^] | 686 | .cs_parse = &r300_cs_parse, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 687 | } |
| 688 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 689 | .irq_set = &rs600_irq_set, |
| 690 | .irq_process = &rs600_irq_process, |
| 691 | .get_vblank_counter = &rs600_get_vblank_counter, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 692 | .copy_blit = &r100_copy_blit, |
| 693 | .copy_dma = &r200_copy_dma, |
| 694 | .copy = &r100_copy_blit, |
| 695 | .get_engine_clock = &radeon_atom_get_engine_clock, |
| 696 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 697 | .get_memory_clock = &radeon_atom_get_memory_clock, |
| 698 | .set_memory_clock = &radeon_atom_set_memory_clock, |
| 699 | .get_pcie_lanes = &rv370_get_pcie_lanes, |
| 700 | .set_pcie_lanes = &rv370_set_pcie_lanes, |
| 701 | .set_clock_gating = &radeon_atom_set_clock_gating, |
| 702 | .set_surface_reg = r100_set_surface_reg, |
| 703 | .clear_surface_reg = r100_clear_surface_reg, |
| 704 | .bandwidth_update = &rv515_bandwidth_update, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 705 | .hpd = { |
| 706 | .init = &rs600_hpd_init, |
| 707 | .fini = &rs600_hpd_fini, |
| 708 | .sense = &rs600_hpd_sense, |
| 709 | .set_polarity = &rs600_hpd_set_polarity, |
| 710 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 711 | .ioctl_wait_idle = NULL, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 712 | .gui_idle = &r100_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 713 | .pm = { |
| 714 | .misc = &rs600_pm_misc, |
| 715 | .prepare = &rs600_pm_prepare, |
| 716 | .finish = &rs600_pm_finish, |
| 717 | .init_profile = &r420_pm_init_profile, |
| 718 | .get_dynpm_state = &r100_pm_get_dynpm_state, |
| 719 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 720 | .pflip = { |
| 721 | .pre_page_flip = &rs600_pre_page_flip, |
| 722 | .page_flip = &rs600_page_flip, |
| 723 | .post_page_flip = &rs600_post_page_flip, |
| 724 | }, |
Alex Deucher | 3ae19b7 | 2012-02-23 17:53:37 -0500 | [diff] [blame] | 725 | .wait_for_vblank = &avivo_wait_for_vblank, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 726 | .mc_wait_for_idle = &r520_mc_wait_for_idle, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 727 | }; |
| 728 | |
| 729 | static struct radeon_asic r600_asic = { |
| 730 | .init = &r600_init, |
| 731 | .fini = &r600_fini, |
| 732 | .suspend = &r600_suspend, |
| 733 | .resume = &r600_resume, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 734 | .vga_set_state = &r600_vga_set_state, |
Jerome Glisse | 225758d | 2010-03-09 14:45:10 +0000 | [diff] [blame] | 735 | .gpu_is_lockup = &r600_gpu_is_lockup, |
Jerome Glisse | a2d07b7 | 2010-03-09 14:45:11 +0000 | [diff] [blame] | 736 | .asic_reset = &r600_asic_reset, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 737 | .gart_tlb_flush = &r600_pcie_gart_tlb_flush, |
| 738 | .gart_set_page = &rs600_gart_set_page, |
| 739 | .ring_test = &r600_ring_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 740 | .ring = { |
| 741 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 742 | .ib_execute = &r600_ring_ib_execute, |
| 743 | .emit_fence = &r600_fence_ring_emit, |
| 744 | .emit_semaphore = &r600_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame^] | 745 | .cs_parse = &r600_cs_parse, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 746 | } |
| 747 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 748 | .irq_set = &r600_irq_set, |
| 749 | .irq_process = &r600_irq_process, |
| 750 | .get_vblank_counter = &rs600_get_vblank_counter, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 751 | .copy_blit = &r600_copy_blit, |
Alex Deucher | 2063344 | 2011-06-13 21:33:39 +0000 | [diff] [blame] | 752 | .copy_dma = NULL, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 753 | .copy = &r600_copy_blit, |
| 754 | .get_engine_clock = &radeon_atom_get_engine_clock, |
| 755 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 756 | .get_memory_clock = &radeon_atom_get_memory_clock, |
| 757 | .set_memory_clock = &radeon_atom_set_memory_clock, |
Alex Deucher | 3313e3d | 2011-01-06 18:49:34 -0500 | [diff] [blame] | 758 | .get_pcie_lanes = &r600_get_pcie_lanes, |
| 759 | .set_pcie_lanes = &r600_set_pcie_lanes, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 760 | .set_clock_gating = NULL, |
| 761 | .set_surface_reg = r600_set_surface_reg, |
| 762 | .clear_surface_reg = r600_clear_surface_reg, |
| 763 | .bandwidth_update = &rv515_bandwidth_update, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 764 | .hpd = { |
| 765 | .init = &r600_hpd_init, |
| 766 | .fini = &r600_hpd_fini, |
| 767 | .sense = &r600_hpd_sense, |
| 768 | .set_polarity = &r600_hpd_set_polarity, |
| 769 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 770 | .ioctl_wait_idle = r600_ioctl_wait_idle, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 771 | .gui_idle = &r600_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 772 | .pm = { |
| 773 | .misc = &r600_pm_misc, |
| 774 | .prepare = &rs600_pm_prepare, |
| 775 | .finish = &rs600_pm_finish, |
| 776 | .init_profile = &r600_pm_init_profile, |
| 777 | .get_dynpm_state = &r600_pm_get_dynpm_state, |
| 778 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 779 | .pflip = { |
| 780 | .pre_page_flip = &rs600_pre_page_flip, |
| 781 | .page_flip = &rs600_page_flip, |
| 782 | .post_page_flip = &rs600_post_page_flip, |
| 783 | }, |
Alex Deucher | 3ae19b7 | 2012-02-23 17:53:37 -0500 | [diff] [blame] | 784 | .wait_for_vblank = &avivo_wait_for_vblank, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 785 | .mc_wait_for_idle = &r600_mc_wait_for_idle, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 786 | }; |
| 787 | |
Alex Deucher | f47299c | 2010-03-16 20:54:38 -0400 | [diff] [blame] | 788 | static struct radeon_asic rs780_asic = { |
| 789 | .init = &r600_init, |
| 790 | .fini = &r600_fini, |
| 791 | .suspend = &r600_suspend, |
| 792 | .resume = &r600_resume, |
Jerome Glisse | 90aca4d | 2010-03-09 14:45:12 +0000 | [diff] [blame] | 793 | .gpu_is_lockup = &r600_gpu_is_lockup, |
Alex Deucher | f47299c | 2010-03-16 20:54:38 -0400 | [diff] [blame] | 794 | .vga_set_state = &r600_vga_set_state, |
Jerome Glisse | a2d07b7 | 2010-03-09 14:45:11 +0000 | [diff] [blame] | 795 | .asic_reset = &r600_asic_reset, |
Alex Deucher | f47299c | 2010-03-16 20:54:38 -0400 | [diff] [blame] | 796 | .gart_tlb_flush = &r600_pcie_gart_tlb_flush, |
| 797 | .gart_set_page = &rs600_gart_set_page, |
| 798 | .ring_test = &r600_ring_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 799 | .ring = { |
| 800 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 801 | .ib_execute = &r600_ring_ib_execute, |
| 802 | .emit_fence = &r600_fence_ring_emit, |
| 803 | .emit_semaphore = &r600_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame^] | 804 | .cs_parse = &r600_cs_parse, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 805 | } |
| 806 | }, |
Alex Deucher | f47299c | 2010-03-16 20:54:38 -0400 | [diff] [blame] | 807 | .irq_set = &r600_irq_set, |
| 808 | .irq_process = &r600_irq_process, |
| 809 | .get_vblank_counter = &rs600_get_vblank_counter, |
Alex Deucher | f47299c | 2010-03-16 20:54:38 -0400 | [diff] [blame] | 810 | .copy_blit = &r600_copy_blit, |
Alex Deucher | 2063344 | 2011-06-13 21:33:39 +0000 | [diff] [blame] | 811 | .copy_dma = NULL, |
Alex Deucher | f47299c | 2010-03-16 20:54:38 -0400 | [diff] [blame] | 812 | .copy = &r600_copy_blit, |
| 813 | .get_engine_clock = &radeon_atom_get_engine_clock, |
| 814 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 815 | .get_memory_clock = NULL, |
| 816 | .set_memory_clock = NULL, |
| 817 | .get_pcie_lanes = NULL, |
| 818 | .set_pcie_lanes = NULL, |
| 819 | .set_clock_gating = NULL, |
| 820 | .set_surface_reg = r600_set_surface_reg, |
| 821 | .clear_surface_reg = r600_clear_surface_reg, |
| 822 | .bandwidth_update = &rs690_bandwidth_update, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 823 | .hpd = { |
| 824 | .init = &r600_hpd_init, |
| 825 | .fini = &r600_hpd_fini, |
| 826 | .sense = &r600_hpd_sense, |
| 827 | .set_polarity = &r600_hpd_set_polarity, |
| 828 | }, |
Alex Deucher | f47299c | 2010-03-16 20:54:38 -0400 | [diff] [blame] | 829 | .ioctl_wait_idle = r600_ioctl_wait_idle, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 830 | .gui_idle = &r600_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 831 | .pm = { |
| 832 | .misc = &r600_pm_misc, |
| 833 | .prepare = &rs600_pm_prepare, |
| 834 | .finish = &rs600_pm_finish, |
| 835 | .init_profile = &rs780_pm_init_profile, |
| 836 | .get_dynpm_state = &r600_pm_get_dynpm_state, |
| 837 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 838 | .pflip = { |
| 839 | .pre_page_flip = &rs600_pre_page_flip, |
| 840 | .page_flip = &rs600_page_flip, |
| 841 | .post_page_flip = &rs600_post_page_flip, |
| 842 | }, |
Alex Deucher | 3ae19b7 | 2012-02-23 17:53:37 -0500 | [diff] [blame] | 843 | .wait_for_vblank = &avivo_wait_for_vblank, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 844 | .mc_wait_for_idle = &r600_mc_wait_for_idle, |
Alex Deucher | f47299c | 2010-03-16 20:54:38 -0400 | [diff] [blame] | 845 | }; |
| 846 | |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 847 | static struct radeon_asic rv770_asic = { |
| 848 | .init = &rv770_init, |
| 849 | .fini = &rv770_fini, |
| 850 | .suspend = &rv770_suspend, |
| 851 | .resume = &rv770_resume, |
Jerome Glisse | a2d07b7 | 2010-03-09 14:45:11 +0000 | [diff] [blame] | 852 | .asic_reset = &r600_asic_reset, |
Jerome Glisse | 225758d | 2010-03-09 14:45:10 +0000 | [diff] [blame] | 853 | .gpu_is_lockup = &r600_gpu_is_lockup, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 854 | .vga_set_state = &r600_vga_set_state, |
| 855 | .gart_tlb_flush = &r600_pcie_gart_tlb_flush, |
| 856 | .gart_set_page = &rs600_gart_set_page, |
| 857 | .ring_test = &r600_ring_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 858 | .ring = { |
| 859 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 860 | .ib_execute = &r600_ring_ib_execute, |
| 861 | .emit_fence = &r600_fence_ring_emit, |
| 862 | .emit_semaphore = &r600_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame^] | 863 | .cs_parse = &r600_cs_parse, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 864 | } |
| 865 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 866 | .irq_set = &r600_irq_set, |
| 867 | .irq_process = &r600_irq_process, |
| 868 | .get_vblank_counter = &rs600_get_vblank_counter, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 869 | .copy_blit = &r600_copy_blit, |
Alex Deucher | 2063344 | 2011-06-13 21:33:39 +0000 | [diff] [blame] | 870 | .copy_dma = NULL, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 871 | .copy = &r600_copy_blit, |
| 872 | .get_engine_clock = &radeon_atom_get_engine_clock, |
| 873 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 874 | .get_memory_clock = &radeon_atom_get_memory_clock, |
| 875 | .set_memory_clock = &radeon_atom_set_memory_clock, |
Alex Deucher | 3313e3d | 2011-01-06 18:49:34 -0500 | [diff] [blame] | 876 | .get_pcie_lanes = &r600_get_pcie_lanes, |
| 877 | .set_pcie_lanes = &r600_set_pcie_lanes, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 878 | .set_clock_gating = &radeon_atom_set_clock_gating, |
| 879 | .set_surface_reg = r600_set_surface_reg, |
| 880 | .clear_surface_reg = r600_clear_surface_reg, |
| 881 | .bandwidth_update = &rv515_bandwidth_update, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 882 | .hpd = { |
| 883 | .init = &r600_hpd_init, |
| 884 | .fini = &r600_hpd_fini, |
| 885 | .sense = &r600_hpd_sense, |
| 886 | .set_polarity = &r600_hpd_set_polarity, |
| 887 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 888 | .ioctl_wait_idle = r600_ioctl_wait_idle, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 889 | .gui_idle = &r600_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 890 | .pm = { |
| 891 | .misc = &rv770_pm_misc, |
| 892 | .prepare = &rs600_pm_prepare, |
| 893 | .finish = &rs600_pm_finish, |
| 894 | .init_profile = &r600_pm_init_profile, |
| 895 | .get_dynpm_state = &r600_pm_get_dynpm_state, |
| 896 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 897 | .pflip = { |
| 898 | .pre_page_flip = &rs600_pre_page_flip, |
| 899 | .page_flip = &rv770_page_flip, |
| 900 | .post_page_flip = &rs600_post_page_flip, |
| 901 | }, |
Alex Deucher | 3ae19b7 | 2012-02-23 17:53:37 -0500 | [diff] [blame] | 902 | .wait_for_vblank = &avivo_wait_for_vblank, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 903 | .mc_wait_for_idle = &r600_mc_wait_for_idle, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 904 | }; |
| 905 | |
| 906 | static struct radeon_asic evergreen_asic = { |
| 907 | .init = &evergreen_init, |
| 908 | .fini = &evergreen_fini, |
| 909 | .suspend = &evergreen_suspend, |
| 910 | .resume = &evergreen_resume, |
Jerome Glisse | 225758d | 2010-03-09 14:45:10 +0000 | [diff] [blame] | 911 | .gpu_is_lockup = &evergreen_gpu_is_lockup, |
Jerome Glisse | a2d07b7 | 2010-03-09 14:45:11 +0000 | [diff] [blame] | 912 | .asic_reset = &evergreen_asic_reset, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 913 | .vga_set_state = &r600_vga_set_state, |
Alex Deucher | 0fcdb61 | 2010-03-24 13:20:41 -0400 | [diff] [blame] | 914 | .gart_tlb_flush = &evergreen_pcie_gart_tlb_flush, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 915 | .gart_set_page = &rs600_gart_set_page, |
Alex Deucher | fe251e2 | 2010-03-24 13:36:43 -0400 | [diff] [blame] | 916 | .ring_test = &r600_ring_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 917 | .ring = { |
| 918 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 919 | .ib_execute = &evergreen_ring_ib_execute, |
| 920 | .emit_fence = &r600_fence_ring_emit, |
| 921 | .emit_semaphore = &r600_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame^] | 922 | .cs_parse = &evergreen_cs_parse, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 923 | } |
| 924 | }, |
Alex Deucher | 45f9a39 | 2010-03-24 13:55:51 -0400 | [diff] [blame] | 925 | .irq_set = &evergreen_irq_set, |
| 926 | .irq_process = &evergreen_irq_process, |
| 927 | .get_vblank_counter = &evergreen_get_vblank_counter, |
Ilija Hadzic | fb3d9e9 | 2011-10-12 23:29:41 -0400 | [diff] [blame] | 928 | .copy_blit = &r600_copy_blit, |
Alex Deucher | 2063344 | 2011-06-13 21:33:39 +0000 | [diff] [blame] | 929 | .copy_dma = NULL, |
Ilija Hadzic | fb3d9e9 | 2011-10-12 23:29:41 -0400 | [diff] [blame] | 930 | .copy = &r600_copy_blit, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 931 | .get_engine_clock = &radeon_atom_get_engine_clock, |
| 932 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 933 | .get_memory_clock = &radeon_atom_get_memory_clock, |
| 934 | .set_memory_clock = &radeon_atom_set_memory_clock, |
Alex Deucher | 3313e3d | 2011-01-06 18:49:34 -0500 | [diff] [blame] | 935 | .get_pcie_lanes = &r600_get_pcie_lanes, |
| 936 | .set_pcie_lanes = &r600_set_pcie_lanes, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 937 | .set_clock_gating = NULL, |
| 938 | .set_surface_reg = r600_set_surface_reg, |
| 939 | .clear_surface_reg = r600_clear_surface_reg, |
| 940 | .bandwidth_update = &evergreen_bandwidth_update, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 941 | .hpd = { |
| 942 | .init = &evergreen_hpd_init, |
| 943 | .fini = &evergreen_hpd_fini, |
| 944 | .sense = &evergreen_hpd_sense, |
| 945 | .set_polarity = &evergreen_hpd_set_polarity, |
| 946 | }, |
Dave Airlie | 97bfd0a | 2011-05-19 14:14:43 +1000 | [diff] [blame] | 947 | .ioctl_wait_idle = r600_ioctl_wait_idle, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 948 | .gui_idle = &r600_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 949 | .pm = { |
| 950 | .misc = &evergreen_pm_misc, |
| 951 | .prepare = &evergreen_pm_prepare, |
| 952 | .finish = &evergreen_pm_finish, |
| 953 | .init_profile = &r600_pm_init_profile, |
| 954 | .get_dynpm_state = &r600_pm_get_dynpm_state, |
| 955 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 956 | .pflip = { |
| 957 | .pre_page_flip = &evergreen_pre_page_flip, |
| 958 | .page_flip = &evergreen_page_flip, |
| 959 | .post_page_flip = &evergreen_post_page_flip, |
| 960 | }, |
Alex Deucher | 3ae19b7 | 2012-02-23 17:53:37 -0500 | [diff] [blame] | 961 | .wait_for_vblank = &dce4_wait_for_vblank, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 962 | .mc_wait_for_idle = &evergreen_mc_wait_for_idle, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 963 | }; |
| 964 | |
Alex Deucher | 958261d | 2010-11-22 17:56:30 -0500 | [diff] [blame] | 965 | static struct radeon_asic sumo_asic = { |
| 966 | .init = &evergreen_init, |
| 967 | .fini = &evergreen_fini, |
| 968 | .suspend = &evergreen_suspend, |
| 969 | .resume = &evergreen_resume, |
Alex Deucher | 958261d | 2010-11-22 17:56:30 -0500 | [diff] [blame] | 970 | .gpu_is_lockup = &evergreen_gpu_is_lockup, |
| 971 | .asic_reset = &evergreen_asic_reset, |
| 972 | .vga_set_state = &r600_vga_set_state, |
| 973 | .gart_tlb_flush = &evergreen_pcie_gart_tlb_flush, |
| 974 | .gart_set_page = &rs600_gart_set_page, |
| 975 | .ring_test = &r600_ring_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 976 | .ring = { |
| 977 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 978 | .ib_execute = &evergreen_ring_ib_execute, |
| 979 | .emit_fence = &r600_fence_ring_emit, |
| 980 | .emit_semaphore = &r600_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame^] | 981 | .cs_parse = &evergreen_cs_parse, |
| 982 | }, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 983 | }, |
Alex Deucher | 958261d | 2010-11-22 17:56:30 -0500 | [diff] [blame] | 984 | .irq_set = &evergreen_irq_set, |
| 985 | .irq_process = &evergreen_irq_process, |
| 986 | .get_vblank_counter = &evergreen_get_vblank_counter, |
Ilija Hadzic | fb3d9e9 | 2011-10-12 23:29:41 -0400 | [diff] [blame] | 987 | .copy_blit = &r600_copy_blit, |
Alex Deucher | 2063344 | 2011-06-13 21:33:39 +0000 | [diff] [blame] | 988 | .copy_dma = NULL, |
Ilija Hadzic | fb3d9e9 | 2011-10-12 23:29:41 -0400 | [diff] [blame] | 989 | .copy = &r600_copy_blit, |
Alex Deucher | 958261d | 2010-11-22 17:56:30 -0500 | [diff] [blame] | 990 | .get_engine_clock = &radeon_atom_get_engine_clock, |
| 991 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 992 | .get_memory_clock = NULL, |
| 993 | .set_memory_clock = NULL, |
| 994 | .get_pcie_lanes = NULL, |
| 995 | .set_pcie_lanes = NULL, |
| 996 | .set_clock_gating = NULL, |
| 997 | .set_surface_reg = r600_set_surface_reg, |
| 998 | .clear_surface_reg = r600_clear_surface_reg, |
| 999 | .bandwidth_update = &evergreen_bandwidth_update, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 1000 | .hpd = { |
| 1001 | .init = &evergreen_hpd_init, |
| 1002 | .fini = &evergreen_hpd_fini, |
| 1003 | .sense = &evergreen_hpd_sense, |
| 1004 | .set_polarity = &evergreen_hpd_set_polarity, |
| 1005 | }, |
Dave Airlie | 97bfd0a | 2011-05-19 14:14:43 +1000 | [diff] [blame] | 1006 | .ioctl_wait_idle = r600_ioctl_wait_idle, |
Alex Deucher | 958261d | 2010-11-22 17:56:30 -0500 | [diff] [blame] | 1007 | .gui_idle = &r600_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 1008 | .pm = { |
| 1009 | .misc = &evergreen_pm_misc, |
| 1010 | .prepare = &evergreen_pm_prepare, |
| 1011 | .finish = &evergreen_pm_finish, |
| 1012 | .init_profile = &sumo_pm_init_profile, |
| 1013 | .get_dynpm_state = &r600_pm_get_dynpm_state, |
| 1014 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 1015 | .pflip = { |
| 1016 | .pre_page_flip = &evergreen_pre_page_flip, |
| 1017 | .page_flip = &evergreen_page_flip, |
| 1018 | .post_page_flip = &evergreen_post_page_flip, |
| 1019 | }, |
Alex Deucher | 3ae19b7 | 2012-02-23 17:53:37 -0500 | [diff] [blame] | 1020 | .wait_for_vblank = &dce4_wait_for_vblank, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 1021 | .mc_wait_for_idle = &evergreen_mc_wait_for_idle, |
Alex Deucher | 958261d | 2010-11-22 17:56:30 -0500 | [diff] [blame] | 1022 | }; |
| 1023 | |
Alex Deucher | a43b766 | 2011-01-06 21:19:33 -0500 | [diff] [blame] | 1024 | static struct radeon_asic btc_asic = { |
| 1025 | .init = &evergreen_init, |
| 1026 | .fini = &evergreen_fini, |
| 1027 | .suspend = &evergreen_suspend, |
| 1028 | .resume = &evergreen_resume, |
Alex Deucher | a43b766 | 2011-01-06 21:19:33 -0500 | [diff] [blame] | 1029 | .gpu_is_lockup = &evergreen_gpu_is_lockup, |
| 1030 | .asic_reset = &evergreen_asic_reset, |
| 1031 | .vga_set_state = &r600_vga_set_state, |
| 1032 | .gart_tlb_flush = &evergreen_pcie_gart_tlb_flush, |
| 1033 | .gart_set_page = &rs600_gart_set_page, |
| 1034 | .ring_test = &r600_ring_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 1035 | .ring = { |
| 1036 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 1037 | .ib_execute = &evergreen_ring_ib_execute, |
| 1038 | .emit_fence = &r600_fence_ring_emit, |
| 1039 | .emit_semaphore = &r600_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame^] | 1040 | .cs_parse = &evergreen_cs_parse, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 1041 | } |
| 1042 | }, |
Alex Deucher | a43b766 | 2011-01-06 21:19:33 -0500 | [diff] [blame] | 1043 | .irq_set = &evergreen_irq_set, |
| 1044 | .irq_process = &evergreen_irq_process, |
| 1045 | .get_vblank_counter = &evergreen_get_vblank_counter, |
Ilija Hadzic | fb3d9e9 | 2011-10-12 23:29:41 -0400 | [diff] [blame] | 1046 | .copy_blit = &r600_copy_blit, |
Alex Deucher | 2063344 | 2011-06-13 21:33:39 +0000 | [diff] [blame] | 1047 | .copy_dma = NULL, |
Ilija Hadzic | fb3d9e9 | 2011-10-12 23:29:41 -0400 | [diff] [blame] | 1048 | .copy = &r600_copy_blit, |
Alex Deucher | a43b766 | 2011-01-06 21:19:33 -0500 | [diff] [blame] | 1049 | .get_engine_clock = &radeon_atom_get_engine_clock, |
| 1050 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 1051 | .get_memory_clock = &radeon_atom_get_memory_clock, |
| 1052 | .set_memory_clock = &radeon_atom_set_memory_clock, |
| 1053 | .get_pcie_lanes = NULL, |
| 1054 | .set_pcie_lanes = NULL, |
| 1055 | .set_clock_gating = NULL, |
| 1056 | .set_surface_reg = r600_set_surface_reg, |
| 1057 | .clear_surface_reg = r600_clear_surface_reg, |
| 1058 | .bandwidth_update = &evergreen_bandwidth_update, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 1059 | .hpd = { |
| 1060 | .init = &evergreen_hpd_init, |
| 1061 | .fini = &evergreen_hpd_fini, |
| 1062 | .sense = &evergreen_hpd_sense, |
| 1063 | .set_polarity = &evergreen_hpd_set_polarity, |
| 1064 | }, |
Dave Airlie | 97bfd0a | 2011-05-19 14:14:43 +1000 | [diff] [blame] | 1065 | .ioctl_wait_idle = r600_ioctl_wait_idle, |
Alex Deucher | a43b766 | 2011-01-06 21:19:33 -0500 | [diff] [blame] | 1066 | .gui_idle = &r600_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 1067 | .pm = { |
| 1068 | .misc = &evergreen_pm_misc, |
| 1069 | .prepare = &evergreen_pm_prepare, |
| 1070 | .finish = &evergreen_pm_finish, |
| 1071 | .init_profile = &r600_pm_init_profile, |
| 1072 | .get_dynpm_state = &r600_pm_get_dynpm_state, |
| 1073 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 1074 | .pflip = { |
| 1075 | .pre_page_flip = &evergreen_pre_page_flip, |
| 1076 | .page_flip = &evergreen_page_flip, |
| 1077 | .post_page_flip = &evergreen_post_page_flip, |
| 1078 | }, |
Alex Deucher | 3ae19b7 | 2012-02-23 17:53:37 -0500 | [diff] [blame] | 1079 | .wait_for_vblank = &dce4_wait_for_vblank, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 1080 | .mc_wait_for_idle = &evergreen_mc_wait_for_idle, |
Alex Deucher | a43b766 | 2011-01-06 21:19:33 -0500 | [diff] [blame] | 1081 | }; |
| 1082 | |
Jerome Glisse | 721604a | 2012-01-05 22:11:05 -0500 | [diff] [blame] | 1083 | static const struct radeon_vm_funcs cayman_vm_funcs = { |
| 1084 | .init = &cayman_vm_init, |
| 1085 | .fini = &cayman_vm_fini, |
| 1086 | .bind = &cayman_vm_bind, |
| 1087 | .unbind = &cayman_vm_unbind, |
| 1088 | .tlb_flush = &cayman_vm_tlb_flush, |
| 1089 | .page_flags = &cayman_vm_page_flags, |
| 1090 | .set_page = &cayman_vm_set_page, |
| 1091 | }; |
| 1092 | |
Alex Deucher | e348762 | 2011-03-02 20:07:36 -0500 | [diff] [blame] | 1093 | static struct radeon_asic cayman_asic = { |
| 1094 | .init = &cayman_init, |
| 1095 | .fini = &cayman_fini, |
| 1096 | .suspend = &cayman_suspend, |
| 1097 | .resume = &cayman_resume, |
Alex Deucher | e348762 | 2011-03-02 20:07:36 -0500 | [diff] [blame] | 1098 | .gpu_is_lockup = &cayman_gpu_is_lockup, |
| 1099 | .asic_reset = &cayman_asic_reset, |
| 1100 | .vga_set_state = &r600_vga_set_state, |
| 1101 | .gart_tlb_flush = &cayman_pcie_gart_tlb_flush, |
| 1102 | .gart_set_page = &rs600_gart_set_page, |
| 1103 | .ring_test = &r600_ring_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 1104 | .ring = { |
| 1105 | [RADEON_RING_TYPE_GFX_INDEX] = { |
Jerome Glisse | 721604a | 2012-01-05 22:11:05 -0500 | [diff] [blame] | 1106 | .ib_execute = &cayman_ring_ib_execute, |
| 1107 | .ib_parse = &evergreen_ib_parse, |
Alex Deucher | b40e7e1 | 2011-11-17 14:57:50 -0500 | [diff] [blame] | 1108 | .emit_fence = &cayman_fence_ring_emit, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 1109 | .emit_semaphore = &r600_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame^] | 1110 | .cs_parse = &evergreen_cs_parse, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 1111 | }, |
| 1112 | [CAYMAN_RING_TYPE_CP1_INDEX] = { |
Jerome Glisse | 721604a | 2012-01-05 22:11:05 -0500 | [diff] [blame] | 1113 | .ib_execute = &cayman_ring_ib_execute, |
| 1114 | .ib_parse = &evergreen_ib_parse, |
Alex Deucher | b40e7e1 | 2011-11-17 14:57:50 -0500 | [diff] [blame] | 1115 | .emit_fence = &cayman_fence_ring_emit, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 1116 | .emit_semaphore = &r600_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame^] | 1117 | .cs_parse = &evergreen_cs_parse, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 1118 | }, |
| 1119 | [CAYMAN_RING_TYPE_CP2_INDEX] = { |
Jerome Glisse | 721604a | 2012-01-05 22:11:05 -0500 | [diff] [blame] | 1120 | .ib_execute = &cayman_ring_ib_execute, |
| 1121 | .ib_parse = &evergreen_ib_parse, |
Alex Deucher | b40e7e1 | 2011-11-17 14:57:50 -0500 | [diff] [blame] | 1122 | .emit_fence = &cayman_fence_ring_emit, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 1123 | .emit_semaphore = &r600_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame^] | 1124 | .cs_parse = &evergreen_cs_parse, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 1125 | } |
| 1126 | }, |
Alex Deucher | e348762 | 2011-03-02 20:07:36 -0500 | [diff] [blame] | 1127 | .irq_set = &evergreen_irq_set, |
| 1128 | .irq_process = &evergreen_irq_process, |
| 1129 | .get_vblank_counter = &evergreen_get_vblank_counter, |
Ilija Hadzic | fb3d9e9 | 2011-10-12 23:29:41 -0400 | [diff] [blame] | 1130 | .copy_blit = &r600_copy_blit, |
Alex Deucher | 2063344 | 2011-06-13 21:33:39 +0000 | [diff] [blame] | 1131 | .copy_dma = NULL, |
Ilija Hadzic | fb3d9e9 | 2011-10-12 23:29:41 -0400 | [diff] [blame] | 1132 | .copy = &r600_copy_blit, |
Alex Deucher | e348762 | 2011-03-02 20:07:36 -0500 | [diff] [blame] | 1133 | .get_engine_clock = &radeon_atom_get_engine_clock, |
| 1134 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 1135 | .get_memory_clock = &radeon_atom_get_memory_clock, |
| 1136 | .set_memory_clock = &radeon_atom_set_memory_clock, |
| 1137 | .get_pcie_lanes = NULL, |
| 1138 | .set_pcie_lanes = NULL, |
| 1139 | .set_clock_gating = NULL, |
| 1140 | .set_surface_reg = r600_set_surface_reg, |
| 1141 | .clear_surface_reg = r600_clear_surface_reg, |
| 1142 | .bandwidth_update = &evergreen_bandwidth_update, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 1143 | .hpd = { |
| 1144 | .init = &evergreen_hpd_init, |
| 1145 | .fini = &evergreen_hpd_fini, |
| 1146 | .sense = &evergreen_hpd_sense, |
| 1147 | .set_polarity = &evergreen_hpd_set_polarity, |
| 1148 | }, |
Dave Airlie | 97bfd0a | 2011-05-19 14:14:43 +1000 | [diff] [blame] | 1149 | .ioctl_wait_idle = r600_ioctl_wait_idle, |
Alex Deucher | e348762 | 2011-03-02 20:07:36 -0500 | [diff] [blame] | 1150 | .gui_idle = &r600_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 1151 | .pm = { |
| 1152 | .misc = &evergreen_pm_misc, |
| 1153 | .prepare = &evergreen_pm_prepare, |
| 1154 | .finish = &evergreen_pm_finish, |
| 1155 | .init_profile = &r600_pm_init_profile, |
| 1156 | .get_dynpm_state = &r600_pm_get_dynpm_state, |
| 1157 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 1158 | .pflip = { |
| 1159 | .pre_page_flip = &evergreen_pre_page_flip, |
| 1160 | .page_flip = &evergreen_page_flip, |
| 1161 | .post_page_flip = &evergreen_post_page_flip, |
| 1162 | }, |
Alex Deucher | 3ae19b7 | 2012-02-23 17:53:37 -0500 | [diff] [blame] | 1163 | .wait_for_vblank = &dce4_wait_for_vblank, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 1164 | .mc_wait_for_idle = &evergreen_mc_wait_for_idle, |
Alex Deucher | e348762 | 2011-03-02 20:07:36 -0500 | [diff] [blame] | 1165 | }; |
| 1166 | |
Daniel Vetter | 0a10c85 | 2010-03-11 21:19:14 +0000 | [diff] [blame] | 1167 | int radeon_asic_init(struct radeon_device *rdev) |
| 1168 | { |
| 1169 | radeon_register_accessor_init(rdev); |
Alex Deucher | ba7e05e | 2011-06-16 18:14:22 +0000 | [diff] [blame] | 1170 | |
| 1171 | /* set the number of crtcs */ |
| 1172 | if (rdev->flags & RADEON_SINGLE_CRTC) |
| 1173 | rdev->num_crtc = 1; |
| 1174 | else |
| 1175 | rdev->num_crtc = 2; |
| 1176 | |
Alex Deucher | 3000bf3 | 2012-01-05 22:11:07 -0500 | [diff] [blame] | 1177 | /* set the ring used for bo copies */ |
| 1178 | rdev->copy_ring = RADEON_RING_TYPE_GFX_INDEX; |
| 1179 | |
Daniel Vetter | 0a10c85 | 2010-03-11 21:19:14 +0000 | [diff] [blame] | 1180 | switch (rdev->family) { |
| 1181 | case CHIP_R100: |
| 1182 | case CHIP_RV100: |
| 1183 | case CHIP_RS100: |
| 1184 | case CHIP_RV200: |
| 1185 | case CHIP_RS200: |
| 1186 | rdev->asic = &r100_asic; |
| 1187 | break; |
| 1188 | case CHIP_R200: |
| 1189 | case CHIP_RV250: |
| 1190 | case CHIP_RS300: |
| 1191 | case CHIP_RV280: |
| 1192 | rdev->asic = &r200_asic; |
| 1193 | break; |
| 1194 | case CHIP_R300: |
| 1195 | case CHIP_R350: |
| 1196 | case CHIP_RV350: |
| 1197 | case CHIP_RV380: |
| 1198 | if (rdev->flags & RADEON_IS_PCIE) |
| 1199 | rdev->asic = &r300_asic_pcie; |
| 1200 | else |
| 1201 | rdev->asic = &r300_asic; |
| 1202 | break; |
| 1203 | case CHIP_R420: |
| 1204 | case CHIP_R423: |
| 1205 | case CHIP_RV410: |
| 1206 | rdev->asic = &r420_asic; |
Alex Deucher | 07bb084 | 2010-06-22 21:58:26 -0400 | [diff] [blame] | 1207 | /* handle macs */ |
| 1208 | if (rdev->bios == NULL) { |
| 1209 | rdev->asic->get_engine_clock = &radeon_legacy_get_engine_clock; |
| 1210 | rdev->asic->set_engine_clock = &radeon_legacy_set_engine_clock; |
| 1211 | rdev->asic->get_memory_clock = &radeon_legacy_get_memory_clock; |
| 1212 | rdev->asic->set_memory_clock = NULL; |
| 1213 | } |
Daniel Vetter | 0a10c85 | 2010-03-11 21:19:14 +0000 | [diff] [blame] | 1214 | break; |
| 1215 | case CHIP_RS400: |
| 1216 | case CHIP_RS480: |
| 1217 | rdev->asic = &rs400_asic; |
| 1218 | break; |
| 1219 | case CHIP_RS600: |
| 1220 | rdev->asic = &rs600_asic; |
| 1221 | break; |
| 1222 | case CHIP_RS690: |
| 1223 | case CHIP_RS740: |
| 1224 | rdev->asic = &rs690_asic; |
| 1225 | break; |
| 1226 | case CHIP_RV515: |
| 1227 | rdev->asic = &rv515_asic; |
| 1228 | break; |
| 1229 | case CHIP_R520: |
| 1230 | case CHIP_RV530: |
| 1231 | case CHIP_RV560: |
| 1232 | case CHIP_RV570: |
| 1233 | case CHIP_R580: |
| 1234 | rdev->asic = &r520_asic; |
| 1235 | break; |
| 1236 | case CHIP_R600: |
| 1237 | case CHIP_RV610: |
| 1238 | case CHIP_RV630: |
| 1239 | case CHIP_RV620: |
| 1240 | case CHIP_RV635: |
| 1241 | case CHIP_RV670: |
Alex Deucher | f47299c | 2010-03-16 20:54:38 -0400 | [diff] [blame] | 1242 | rdev->asic = &r600_asic; |
| 1243 | break; |
Daniel Vetter | 0a10c85 | 2010-03-11 21:19:14 +0000 | [diff] [blame] | 1244 | case CHIP_RS780: |
| 1245 | case CHIP_RS880: |
Alex Deucher | f47299c | 2010-03-16 20:54:38 -0400 | [diff] [blame] | 1246 | rdev->asic = &rs780_asic; |
Daniel Vetter | 0a10c85 | 2010-03-11 21:19:14 +0000 | [diff] [blame] | 1247 | break; |
| 1248 | case CHIP_RV770: |
| 1249 | case CHIP_RV730: |
| 1250 | case CHIP_RV710: |
| 1251 | case CHIP_RV740: |
| 1252 | rdev->asic = &rv770_asic; |
| 1253 | break; |
| 1254 | case CHIP_CEDAR: |
| 1255 | case CHIP_REDWOOD: |
| 1256 | case CHIP_JUNIPER: |
| 1257 | case CHIP_CYPRESS: |
| 1258 | case CHIP_HEMLOCK: |
Alex Deucher | ba7e05e | 2011-06-16 18:14:22 +0000 | [diff] [blame] | 1259 | /* set num crtcs */ |
| 1260 | if (rdev->family == CHIP_CEDAR) |
| 1261 | rdev->num_crtc = 4; |
| 1262 | else |
| 1263 | rdev->num_crtc = 6; |
Daniel Vetter | 0a10c85 | 2010-03-11 21:19:14 +0000 | [diff] [blame] | 1264 | rdev->asic = &evergreen_asic; |
| 1265 | break; |
Alex Deucher | 958261d | 2010-11-22 17:56:30 -0500 | [diff] [blame] | 1266 | case CHIP_PALM: |
Alex Deucher | 89da5a3 | 2011-05-31 15:42:47 -0400 | [diff] [blame] | 1267 | case CHIP_SUMO: |
| 1268 | case CHIP_SUMO2: |
Alex Deucher | 958261d | 2010-11-22 17:56:30 -0500 | [diff] [blame] | 1269 | rdev->asic = &sumo_asic; |
| 1270 | break; |
Alex Deucher | a43b766 | 2011-01-06 21:19:33 -0500 | [diff] [blame] | 1271 | case CHIP_BARTS: |
| 1272 | case CHIP_TURKS: |
| 1273 | case CHIP_CAICOS: |
Alex Deucher | ba7e05e | 2011-06-16 18:14:22 +0000 | [diff] [blame] | 1274 | /* set num crtcs */ |
| 1275 | if (rdev->family == CHIP_CAICOS) |
| 1276 | rdev->num_crtc = 4; |
| 1277 | else |
| 1278 | rdev->num_crtc = 6; |
Alex Deucher | a43b766 | 2011-01-06 21:19:33 -0500 | [diff] [blame] | 1279 | rdev->asic = &btc_asic; |
| 1280 | break; |
Alex Deucher | e348762 | 2011-03-02 20:07:36 -0500 | [diff] [blame] | 1281 | case CHIP_CAYMAN: |
| 1282 | rdev->asic = &cayman_asic; |
Alex Deucher | ba7e05e | 2011-06-16 18:14:22 +0000 | [diff] [blame] | 1283 | /* set num crtcs */ |
| 1284 | rdev->num_crtc = 6; |
Jerome Glisse | 721604a | 2012-01-05 22:11:05 -0500 | [diff] [blame] | 1285 | rdev->vm_manager.funcs = &cayman_vm_funcs; |
Alex Deucher | e348762 | 2011-03-02 20:07:36 -0500 | [diff] [blame] | 1286 | break; |
Daniel Vetter | 0a10c85 | 2010-03-11 21:19:14 +0000 | [diff] [blame] | 1287 | default: |
| 1288 | /* FIXME: not supported yet */ |
| 1289 | return -EINVAL; |
| 1290 | } |
| 1291 | |
| 1292 | if (rdev->flags & RADEON_IS_IGP) { |
| 1293 | rdev->asic->get_memory_clock = NULL; |
| 1294 | rdev->asic->set_memory_clock = NULL; |
| 1295 | } |
| 1296 | |
Daniel Vetter | 0a10c85 | 2010-03-11 21:19:14 +0000 | [diff] [blame] | 1297 | return 0; |
| 1298 | } |
| 1299 | |