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; |
Alex Deucher | c5b3b85 | 2012-02-23 17:53:46 -0500 | [diff] [blame] | 117 | rdev->asic->gart.tlb_flush = &rv370_pcie_gart_tlb_flush; |
| 118 | rdev->asic->gart.set_page = &rv370_pcie_gart_set_page; |
Daniel Vetter | 0a10c85 | 2010-03-11 21:19:14 +0000 | [diff] [blame] | 119 | } else { |
| 120 | DRM_INFO("Forcing AGP to PCI mode\n"); |
| 121 | rdev->flags |= RADEON_IS_PCI; |
Alex Deucher | c5b3b85 | 2012-02-23 17:53:46 -0500 | [diff] [blame] | 122 | rdev->asic->gart.tlb_flush = &r100_pci_gart_tlb_flush; |
| 123 | rdev->asic->gart.set_page = &r100_pci_gart_set_page; |
Daniel Vetter | 0a10c85 | 2010-03-11 21:19:14 +0000 | [diff] [blame] | 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, |
Alex Deucher | c5b3b85 | 2012-02-23 17:53:46 -0500 | [diff] [blame] | 139 | .gart = { |
| 140 | .tlb_flush = &r100_pci_gart_tlb_flush, |
| 141 | .set_page = &r100_pci_gart_set_page, |
| 142 | }, |
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, |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 149 | .ring_start = &r100_ring_start, |
| 150 | .ring_test = &r100_ring_test, |
| 151 | .ib_test = &r100_ib_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 152 | } |
| 153 | }, |
Alex Deucher | b35ea4a | 2012-02-23 17:53:43 -0500 | [diff] [blame] | 154 | .irq = { |
| 155 | .set = &r100_irq_set, |
| 156 | .process = &r100_irq_process, |
| 157 | }, |
Alex Deucher | c79a49c | 2012-02-23 17:53:47 -0500 | [diff] [blame] | 158 | .display = { |
| 159 | .bandwidth_update = &r100_bandwidth_update, |
| 160 | .get_vblank_counter = &r100_get_vblank_counter, |
| 161 | .wait_for_vblank = &r100_wait_for_vblank, |
| 162 | }, |
Alex Deucher | 27cd776 | 2012-02-23 17:53:42 -0500 | [diff] [blame] | 163 | .copy = { |
| 164 | .blit = &r100_copy_blit, |
| 165 | .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 166 | .dma = NULL, |
| 167 | .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 168 | .copy = &r100_copy_blit, |
| 169 | .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 170 | }, |
Alex Deucher | 9e6f3d0 | 2012-02-23 17:53:49 -0500 | [diff] [blame^] | 171 | .surface = { |
| 172 | .set_reg = r100_set_surface_reg, |
| 173 | .clear_reg = r100_clear_surface_reg, |
| 174 | }, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 175 | .hpd = { |
| 176 | .init = &r100_hpd_init, |
| 177 | .fini = &r100_hpd_fini, |
| 178 | .sense = &r100_hpd_sense, |
| 179 | .set_polarity = &r100_hpd_set_polarity, |
| 180 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 181 | .ioctl_wait_idle = NULL, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 182 | .gui_idle = &r100_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 183 | .pm = { |
| 184 | .misc = &r100_pm_misc, |
| 185 | .prepare = &r100_pm_prepare, |
| 186 | .finish = &r100_pm_finish, |
| 187 | .init_profile = &r100_pm_init_profile, |
| 188 | .get_dynpm_state = &r100_pm_get_dynpm_state, |
Alex Deucher | 798bcf7 | 2012-02-23 17:53:48 -0500 | [diff] [blame] | 189 | .get_engine_clock = &radeon_legacy_get_engine_clock, |
| 190 | .set_engine_clock = &radeon_legacy_set_engine_clock, |
| 191 | .get_memory_clock = &radeon_legacy_get_memory_clock, |
| 192 | .set_memory_clock = NULL, |
| 193 | .get_pcie_lanes = NULL, |
| 194 | .set_pcie_lanes = NULL, |
| 195 | .set_clock_gating = &radeon_legacy_set_clock_gating, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 196 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 197 | .pflip = { |
| 198 | .pre_page_flip = &r100_pre_page_flip, |
| 199 | .page_flip = &r100_page_flip, |
| 200 | .post_page_flip = &r100_post_page_flip, |
| 201 | }, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 202 | .mc_wait_for_idle = &r100_mc_wait_for_idle, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 203 | }; |
| 204 | |
| 205 | static struct radeon_asic r200_asic = { |
| 206 | .init = &r100_init, |
| 207 | .fini = &r100_fini, |
| 208 | .suspend = &r100_suspend, |
| 209 | .resume = &r100_resume, |
| 210 | .vga_set_state = &r100_vga_set_state, |
Jerome Glisse | 225758d | 2010-03-09 14:45:10 +0000 | [diff] [blame] | 211 | .gpu_is_lockup = &r100_gpu_is_lockup, |
Jerome Glisse | a2d07b7 | 2010-03-09 14:45:11 +0000 | [diff] [blame] | 212 | .asic_reset = &r100_asic_reset, |
Alex Deucher | c5b3b85 | 2012-02-23 17:53:46 -0500 | [diff] [blame] | 213 | .gart = { |
| 214 | .tlb_flush = &r100_pci_gart_tlb_flush, |
| 215 | .set_page = &r100_pci_gart_set_page, |
| 216 | }, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 217 | .ring = { |
| 218 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 219 | .ib_execute = &r100_ring_ib_execute, |
| 220 | .emit_fence = &r100_fence_ring_emit, |
| 221 | .emit_semaphore = &r100_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame] | 222 | .cs_parse = &r100_cs_parse, |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 223 | .ring_start = &r100_ring_start, |
| 224 | .ring_test = &r100_ring_test, |
| 225 | .ib_test = &r100_ib_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 226 | } |
| 227 | }, |
Alex Deucher | b35ea4a | 2012-02-23 17:53:43 -0500 | [diff] [blame] | 228 | .irq = { |
| 229 | .set = &r100_irq_set, |
| 230 | .process = &r100_irq_process, |
| 231 | }, |
Alex Deucher | c79a49c | 2012-02-23 17:53:47 -0500 | [diff] [blame] | 232 | .display = { |
| 233 | .bandwidth_update = &r100_bandwidth_update, |
| 234 | .get_vblank_counter = &r100_get_vblank_counter, |
| 235 | .wait_for_vblank = &r100_wait_for_vblank, |
| 236 | }, |
Alex Deucher | 27cd776 | 2012-02-23 17:53:42 -0500 | [diff] [blame] | 237 | .copy = { |
| 238 | .blit = &r100_copy_blit, |
| 239 | .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 240 | .dma = &r200_copy_dma, |
| 241 | .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 242 | .copy = &r100_copy_blit, |
| 243 | .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 244 | }, |
Alex Deucher | 9e6f3d0 | 2012-02-23 17:53:49 -0500 | [diff] [blame^] | 245 | .surface = { |
| 246 | .set_reg = r100_set_surface_reg, |
| 247 | .clear_reg = r100_clear_surface_reg, |
| 248 | }, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 249 | .hpd = { |
| 250 | .init = &r100_hpd_init, |
| 251 | .fini = &r100_hpd_fini, |
| 252 | .sense = &r100_hpd_sense, |
| 253 | .set_polarity = &r100_hpd_set_polarity, |
| 254 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 255 | .ioctl_wait_idle = NULL, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 256 | .gui_idle = &r100_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 257 | .pm = { |
| 258 | .misc = &r100_pm_misc, |
| 259 | .prepare = &r100_pm_prepare, |
| 260 | .finish = &r100_pm_finish, |
| 261 | .init_profile = &r100_pm_init_profile, |
| 262 | .get_dynpm_state = &r100_pm_get_dynpm_state, |
Alex Deucher | 798bcf7 | 2012-02-23 17:53:48 -0500 | [diff] [blame] | 263 | .get_engine_clock = &radeon_legacy_get_engine_clock, |
| 264 | .set_engine_clock = &radeon_legacy_set_engine_clock, |
| 265 | .get_memory_clock = &radeon_legacy_get_memory_clock, |
| 266 | .set_memory_clock = NULL, |
| 267 | .get_pcie_lanes = NULL, |
| 268 | .set_pcie_lanes = NULL, |
| 269 | .set_clock_gating = &radeon_legacy_set_clock_gating, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 270 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 271 | .pflip = { |
| 272 | .pre_page_flip = &r100_pre_page_flip, |
| 273 | .page_flip = &r100_page_flip, |
| 274 | .post_page_flip = &r100_post_page_flip, |
| 275 | }, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 276 | .mc_wait_for_idle = &r100_mc_wait_for_idle, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 277 | }; |
| 278 | |
| 279 | static struct radeon_asic r300_asic = { |
| 280 | .init = &r300_init, |
| 281 | .fini = &r300_fini, |
| 282 | .suspend = &r300_suspend, |
| 283 | .resume = &r300_resume, |
| 284 | .vga_set_state = &r100_vga_set_state, |
Jerome Glisse | 225758d | 2010-03-09 14:45:10 +0000 | [diff] [blame] | 285 | .gpu_is_lockup = &r300_gpu_is_lockup, |
Jerome Glisse | a2d07b7 | 2010-03-09 14:45:11 +0000 | [diff] [blame] | 286 | .asic_reset = &r300_asic_reset, |
Alex Deucher | c5b3b85 | 2012-02-23 17:53:46 -0500 | [diff] [blame] | 287 | .gart = { |
| 288 | .tlb_flush = &r100_pci_gart_tlb_flush, |
| 289 | .set_page = &r100_pci_gart_set_page, |
| 290 | }, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 291 | .ring = { |
| 292 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 293 | .ib_execute = &r100_ring_ib_execute, |
| 294 | .emit_fence = &r300_fence_ring_emit, |
| 295 | .emit_semaphore = &r100_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame] | 296 | .cs_parse = &r300_cs_parse, |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 297 | .ring_start = &r300_ring_start, |
| 298 | .ring_test = &r100_ring_test, |
| 299 | .ib_test = &r100_ib_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 300 | } |
| 301 | }, |
Alex Deucher | b35ea4a | 2012-02-23 17:53:43 -0500 | [diff] [blame] | 302 | .irq = { |
| 303 | .set = &r100_irq_set, |
| 304 | .process = &r100_irq_process, |
| 305 | }, |
Alex Deucher | c79a49c | 2012-02-23 17:53:47 -0500 | [diff] [blame] | 306 | .display = { |
| 307 | .bandwidth_update = &r100_bandwidth_update, |
| 308 | .get_vblank_counter = &r100_get_vblank_counter, |
| 309 | .wait_for_vblank = &r100_wait_for_vblank, |
| 310 | }, |
Alex Deucher | 27cd776 | 2012-02-23 17:53:42 -0500 | [diff] [blame] | 311 | .copy = { |
| 312 | .blit = &r100_copy_blit, |
| 313 | .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 314 | .dma = &r200_copy_dma, |
| 315 | .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 316 | .copy = &r100_copy_blit, |
| 317 | .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 318 | }, |
Alex Deucher | 9e6f3d0 | 2012-02-23 17:53:49 -0500 | [diff] [blame^] | 319 | .surface = { |
| 320 | .set_reg = r100_set_surface_reg, |
| 321 | .clear_reg = r100_clear_surface_reg, |
| 322 | }, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 323 | .hpd = { |
| 324 | .init = &r100_hpd_init, |
| 325 | .fini = &r100_hpd_fini, |
| 326 | .sense = &r100_hpd_sense, |
| 327 | .set_polarity = &r100_hpd_set_polarity, |
| 328 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 329 | .ioctl_wait_idle = NULL, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 330 | .gui_idle = &r100_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 331 | .pm = { |
| 332 | .misc = &r100_pm_misc, |
| 333 | .prepare = &r100_pm_prepare, |
| 334 | .finish = &r100_pm_finish, |
| 335 | .init_profile = &r100_pm_init_profile, |
| 336 | .get_dynpm_state = &r100_pm_get_dynpm_state, |
Alex Deucher | 798bcf7 | 2012-02-23 17:53:48 -0500 | [diff] [blame] | 337 | .get_engine_clock = &radeon_legacy_get_engine_clock, |
| 338 | .set_engine_clock = &radeon_legacy_set_engine_clock, |
| 339 | .get_memory_clock = &radeon_legacy_get_memory_clock, |
| 340 | .set_memory_clock = NULL, |
| 341 | .get_pcie_lanes = &rv370_get_pcie_lanes, |
| 342 | .set_pcie_lanes = &rv370_set_pcie_lanes, |
| 343 | .set_clock_gating = &radeon_legacy_set_clock_gating, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 344 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 345 | .pflip = { |
| 346 | .pre_page_flip = &r100_pre_page_flip, |
| 347 | .page_flip = &r100_page_flip, |
| 348 | .post_page_flip = &r100_post_page_flip, |
| 349 | }, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 350 | .mc_wait_for_idle = &r300_mc_wait_for_idle, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 351 | }; |
| 352 | |
| 353 | static struct radeon_asic r300_asic_pcie = { |
| 354 | .init = &r300_init, |
| 355 | .fini = &r300_fini, |
| 356 | .suspend = &r300_suspend, |
| 357 | .resume = &r300_resume, |
| 358 | .vga_set_state = &r100_vga_set_state, |
Jerome Glisse | 225758d | 2010-03-09 14:45:10 +0000 | [diff] [blame] | 359 | .gpu_is_lockup = &r300_gpu_is_lockup, |
Jerome Glisse | a2d07b7 | 2010-03-09 14:45:11 +0000 | [diff] [blame] | 360 | .asic_reset = &r300_asic_reset, |
Alex Deucher | c5b3b85 | 2012-02-23 17:53:46 -0500 | [diff] [blame] | 361 | .gart = { |
| 362 | .tlb_flush = &rv370_pcie_gart_tlb_flush, |
| 363 | .set_page = &rv370_pcie_gart_set_page, |
| 364 | }, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 365 | .ring = { |
| 366 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 367 | .ib_execute = &r100_ring_ib_execute, |
| 368 | .emit_fence = &r300_fence_ring_emit, |
| 369 | .emit_semaphore = &r100_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame] | 370 | .cs_parse = &r300_cs_parse, |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 371 | .ring_start = &r300_ring_start, |
| 372 | .ring_test = &r100_ring_test, |
| 373 | .ib_test = &r100_ib_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 374 | } |
| 375 | }, |
Alex Deucher | b35ea4a | 2012-02-23 17:53:43 -0500 | [diff] [blame] | 376 | .irq = { |
| 377 | .set = &r100_irq_set, |
| 378 | .process = &r100_irq_process, |
| 379 | }, |
Alex Deucher | c79a49c | 2012-02-23 17:53:47 -0500 | [diff] [blame] | 380 | .display = { |
| 381 | .bandwidth_update = &r100_bandwidth_update, |
| 382 | .get_vblank_counter = &r100_get_vblank_counter, |
| 383 | .wait_for_vblank = &r100_wait_for_vblank, |
| 384 | }, |
Alex Deucher | 27cd776 | 2012-02-23 17:53:42 -0500 | [diff] [blame] | 385 | .copy = { |
| 386 | .blit = &r100_copy_blit, |
| 387 | .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 388 | .dma = &r200_copy_dma, |
| 389 | .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 390 | .copy = &r100_copy_blit, |
| 391 | .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 392 | }, |
Alex Deucher | 9e6f3d0 | 2012-02-23 17:53:49 -0500 | [diff] [blame^] | 393 | .surface = { |
| 394 | .set_reg = r100_set_surface_reg, |
| 395 | .clear_reg = r100_clear_surface_reg, |
| 396 | }, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 397 | .hpd = { |
| 398 | .init = &r100_hpd_init, |
| 399 | .fini = &r100_hpd_fini, |
| 400 | .sense = &r100_hpd_sense, |
| 401 | .set_polarity = &r100_hpd_set_polarity, |
| 402 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 403 | .ioctl_wait_idle = NULL, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 404 | .gui_idle = &r100_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 405 | .pm = { |
| 406 | .misc = &r100_pm_misc, |
| 407 | .prepare = &r100_pm_prepare, |
| 408 | .finish = &r100_pm_finish, |
| 409 | .init_profile = &r100_pm_init_profile, |
| 410 | .get_dynpm_state = &r100_pm_get_dynpm_state, |
Alex Deucher | 798bcf7 | 2012-02-23 17:53:48 -0500 | [diff] [blame] | 411 | .get_engine_clock = &radeon_legacy_get_engine_clock, |
| 412 | .set_engine_clock = &radeon_legacy_set_engine_clock, |
| 413 | .get_memory_clock = &radeon_legacy_get_memory_clock, |
| 414 | .set_memory_clock = NULL, |
| 415 | .get_pcie_lanes = &rv370_get_pcie_lanes, |
| 416 | .set_pcie_lanes = &rv370_set_pcie_lanes, |
| 417 | .set_clock_gating = &radeon_legacy_set_clock_gating, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 418 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 419 | .pflip = { |
| 420 | .pre_page_flip = &r100_pre_page_flip, |
| 421 | .page_flip = &r100_page_flip, |
| 422 | .post_page_flip = &r100_post_page_flip, |
| 423 | }, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 424 | .mc_wait_for_idle = &r300_mc_wait_for_idle, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 425 | }; |
| 426 | |
| 427 | static struct radeon_asic r420_asic = { |
| 428 | .init = &r420_init, |
| 429 | .fini = &r420_fini, |
| 430 | .suspend = &r420_suspend, |
| 431 | .resume = &r420_resume, |
| 432 | .vga_set_state = &r100_vga_set_state, |
Jerome Glisse | 225758d | 2010-03-09 14:45:10 +0000 | [diff] [blame] | 433 | .gpu_is_lockup = &r300_gpu_is_lockup, |
Jerome Glisse | a2d07b7 | 2010-03-09 14:45:11 +0000 | [diff] [blame] | 434 | .asic_reset = &r300_asic_reset, |
Alex Deucher | c5b3b85 | 2012-02-23 17:53:46 -0500 | [diff] [blame] | 435 | .gart = { |
| 436 | .tlb_flush = &rv370_pcie_gart_tlb_flush, |
| 437 | .set_page = &rv370_pcie_gart_set_page, |
| 438 | }, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 439 | .ring = { |
| 440 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 441 | .ib_execute = &r100_ring_ib_execute, |
| 442 | .emit_fence = &r300_fence_ring_emit, |
| 443 | .emit_semaphore = &r100_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame] | 444 | .cs_parse = &r300_cs_parse, |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 445 | .ring_start = &r300_ring_start, |
| 446 | .ring_test = &r100_ring_test, |
| 447 | .ib_test = &r100_ib_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 448 | } |
| 449 | }, |
Alex Deucher | b35ea4a | 2012-02-23 17:53:43 -0500 | [diff] [blame] | 450 | .irq = { |
| 451 | .set = &r100_irq_set, |
| 452 | .process = &r100_irq_process, |
| 453 | }, |
Alex Deucher | c79a49c | 2012-02-23 17:53:47 -0500 | [diff] [blame] | 454 | .display = { |
| 455 | .bandwidth_update = &r100_bandwidth_update, |
| 456 | .get_vblank_counter = &r100_get_vblank_counter, |
| 457 | .wait_for_vblank = &r100_wait_for_vblank, |
| 458 | }, |
Alex Deucher | 27cd776 | 2012-02-23 17:53:42 -0500 | [diff] [blame] | 459 | .copy = { |
| 460 | .blit = &r100_copy_blit, |
| 461 | .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 462 | .dma = &r200_copy_dma, |
| 463 | .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 464 | .copy = &r100_copy_blit, |
| 465 | .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 466 | }, |
Alex Deucher | 9e6f3d0 | 2012-02-23 17:53:49 -0500 | [diff] [blame^] | 467 | .surface = { |
| 468 | .set_reg = r100_set_surface_reg, |
| 469 | .clear_reg = r100_clear_surface_reg, |
| 470 | }, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 471 | .hpd = { |
| 472 | .init = &r100_hpd_init, |
| 473 | .fini = &r100_hpd_fini, |
| 474 | .sense = &r100_hpd_sense, |
| 475 | .set_polarity = &r100_hpd_set_polarity, |
| 476 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 477 | .ioctl_wait_idle = NULL, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 478 | .gui_idle = &r100_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 479 | .pm = { |
| 480 | .misc = &r100_pm_misc, |
| 481 | .prepare = &r100_pm_prepare, |
| 482 | .finish = &r100_pm_finish, |
| 483 | .init_profile = &r420_pm_init_profile, |
| 484 | .get_dynpm_state = &r100_pm_get_dynpm_state, |
Alex Deucher | 798bcf7 | 2012-02-23 17:53:48 -0500 | [diff] [blame] | 485 | .get_engine_clock = &radeon_atom_get_engine_clock, |
| 486 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 487 | .get_memory_clock = &radeon_atom_get_memory_clock, |
| 488 | .set_memory_clock = &radeon_atom_set_memory_clock, |
| 489 | .get_pcie_lanes = &rv370_get_pcie_lanes, |
| 490 | .set_pcie_lanes = &rv370_set_pcie_lanes, |
| 491 | .set_clock_gating = &radeon_atom_set_clock_gating, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 492 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 493 | .pflip = { |
| 494 | .pre_page_flip = &r100_pre_page_flip, |
| 495 | .page_flip = &r100_page_flip, |
| 496 | .post_page_flip = &r100_post_page_flip, |
| 497 | }, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 498 | .mc_wait_for_idle = &r300_mc_wait_for_idle, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 499 | }; |
| 500 | |
| 501 | static struct radeon_asic rs400_asic = { |
| 502 | .init = &rs400_init, |
| 503 | .fini = &rs400_fini, |
| 504 | .suspend = &rs400_suspend, |
| 505 | .resume = &rs400_resume, |
| 506 | .vga_set_state = &r100_vga_set_state, |
Jerome Glisse | 225758d | 2010-03-09 14:45:10 +0000 | [diff] [blame] | 507 | .gpu_is_lockup = &r300_gpu_is_lockup, |
Jerome Glisse | a2d07b7 | 2010-03-09 14:45:11 +0000 | [diff] [blame] | 508 | .asic_reset = &r300_asic_reset, |
Alex Deucher | c5b3b85 | 2012-02-23 17:53:46 -0500 | [diff] [blame] | 509 | .gart = { |
| 510 | .tlb_flush = &rs400_gart_tlb_flush, |
| 511 | .set_page = &rs400_gart_set_page, |
| 512 | }, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 513 | .ring = { |
| 514 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 515 | .ib_execute = &r100_ring_ib_execute, |
| 516 | .emit_fence = &r300_fence_ring_emit, |
| 517 | .emit_semaphore = &r100_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame] | 518 | .cs_parse = &r300_cs_parse, |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 519 | .ring_start = &r300_ring_start, |
| 520 | .ring_test = &r100_ring_test, |
| 521 | .ib_test = &r100_ib_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 522 | } |
| 523 | }, |
Alex Deucher | b35ea4a | 2012-02-23 17:53:43 -0500 | [diff] [blame] | 524 | .irq = { |
| 525 | .set = &r100_irq_set, |
| 526 | .process = &r100_irq_process, |
| 527 | }, |
Alex Deucher | c79a49c | 2012-02-23 17:53:47 -0500 | [diff] [blame] | 528 | .display = { |
| 529 | .bandwidth_update = &r100_bandwidth_update, |
| 530 | .get_vblank_counter = &r100_get_vblank_counter, |
| 531 | .wait_for_vblank = &r100_wait_for_vblank, |
| 532 | }, |
Alex Deucher | 27cd776 | 2012-02-23 17:53:42 -0500 | [diff] [blame] | 533 | .copy = { |
| 534 | .blit = &r100_copy_blit, |
| 535 | .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 536 | .dma = &r200_copy_dma, |
| 537 | .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 538 | .copy = &r100_copy_blit, |
| 539 | .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 540 | }, |
Alex Deucher | 9e6f3d0 | 2012-02-23 17:53:49 -0500 | [diff] [blame^] | 541 | .surface = { |
| 542 | .set_reg = r100_set_surface_reg, |
| 543 | .clear_reg = r100_clear_surface_reg, |
| 544 | }, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 545 | .hpd = { |
| 546 | .init = &r100_hpd_init, |
| 547 | .fini = &r100_hpd_fini, |
| 548 | .sense = &r100_hpd_sense, |
| 549 | .set_polarity = &r100_hpd_set_polarity, |
| 550 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 551 | .ioctl_wait_idle = NULL, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 552 | .gui_idle = &r100_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 553 | .pm = { |
| 554 | .misc = &r100_pm_misc, |
| 555 | .prepare = &r100_pm_prepare, |
| 556 | .finish = &r100_pm_finish, |
| 557 | .init_profile = &r100_pm_init_profile, |
| 558 | .get_dynpm_state = &r100_pm_get_dynpm_state, |
Alex Deucher | 798bcf7 | 2012-02-23 17:53:48 -0500 | [diff] [blame] | 559 | .get_engine_clock = &radeon_legacy_get_engine_clock, |
| 560 | .set_engine_clock = &radeon_legacy_set_engine_clock, |
| 561 | .get_memory_clock = &radeon_legacy_get_memory_clock, |
| 562 | .set_memory_clock = NULL, |
| 563 | .get_pcie_lanes = NULL, |
| 564 | .set_pcie_lanes = NULL, |
| 565 | .set_clock_gating = &radeon_legacy_set_clock_gating, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 566 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 567 | .pflip = { |
| 568 | .pre_page_flip = &r100_pre_page_flip, |
| 569 | .page_flip = &r100_page_flip, |
| 570 | .post_page_flip = &r100_post_page_flip, |
| 571 | }, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 572 | .mc_wait_for_idle = &rs400_mc_wait_for_idle, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 573 | }; |
| 574 | |
| 575 | static struct radeon_asic rs600_asic = { |
| 576 | .init = &rs600_init, |
| 577 | .fini = &rs600_fini, |
| 578 | .suspend = &rs600_suspend, |
| 579 | .resume = &rs600_resume, |
| 580 | .vga_set_state = &r100_vga_set_state, |
Jerome Glisse | 225758d | 2010-03-09 14:45:10 +0000 | [diff] [blame] | 581 | .gpu_is_lockup = &r300_gpu_is_lockup, |
Jerome Glisse | 90aca4d | 2010-03-09 14:45:12 +0000 | [diff] [blame] | 582 | .asic_reset = &rs600_asic_reset, |
Alex Deucher | c5b3b85 | 2012-02-23 17:53:46 -0500 | [diff] [blame] | 583 | .gart = { |
| 584 | .tlb_flush = &rs600_gart_tlb_flush, |
| 585 | .set_page = &rs600_gart_set_page, |
| 586 | }, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 587 | .ring = { |
| 588 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 589 | .ib_execute = &r100_ring_ib_execute, |
| 590 | .emit_fence = &r300_fence_ring_emit, |
| 591 | .emit_semaphore = &r100_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame] | 592 | .cs_parse = &r300_cs_parse, |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 593 | .ring_start = &r300_ring_start, |
| 594 | .ring_test = &r100_ring_test, |
| 595 | .ib_test = &r100_ib_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 596 | } |
| 597 | }, |
Alex Deucher | b35ea4a | 2012-02-23 17:53:43 -0500 | [diff] [blame] | 598 | .irq = { |
| 599 | .set = &rs600_irq_set, |
| 600 | .process = &rs600_irq_process, |
| 601 | }, |
Alex Deucher | c79a49c | 2012-02-23 17:53:47 -0500 | [diff] [blame] | 602 | .display = { |
| 603 | .bandwidth_update = &rs600_bandwidth_update, |
| 604 | .get_vblank_counter = &rs600_get_vblank_counter, |
| 605 | .wait_for_vblank = &avivo_wait_for_vblank, |
| 606 | }, |
Alex Deucher | 27cd776 | 2012-02-23 17:53:42 -0500 | [diff] [blame] | 607 | .copy = { |
| 608 | .blit = &r100_copy_blit, |
| 609 | .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 610 | .dma = &r200_copy_dma, |
| 611 | .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 612 | .copy = &r100_copy_blit, |
| 613 | .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 614 | }, |
Alex Deucher | 9e6f3d0 | 2012-02-23 17:53:49 -0500 | [diff] [blame^] | 615 | .surface = { |
| 616 | .set_reg = r100_set_surface_reg, |
| 617 | .clear_reg = r100_clear_surface_reg, |
| 618 | }, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 619 | .hpd = { |
| 620 | .init = &rs600_hpd_init, |
| 621 | .fini = &rs600_hpd_fini, |
| 622 | .sense = &rs600_hpd_sense, |
| 623 | .set_polarity = &rs600_hpd_set_polarity, |
| 624 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 625 | .ioctl_wait_idle = NULL, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 626 | .gui_idle = &r100_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 627 | .pm = { |
| 628 | .misc = &rs600_pm_misc, |
| 629 | .prepare = &rs600_pm_prepare, |
| 630 | .finish = &rs600_pm_finish, |
| 631 | .init_profile = &r420_pm_init_profile, |
| 632 | .get_dynpm_state = &r100_pm_get_dynpm_state, |
Alex Deucher | 798bcf7 | 2012-02-23 17:53:48 -0500 | [diff] [blame] | 633 | .get_engine_clock = &radeon_atom_get_engine_clock, |
| 634 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 635 | .get_memory_clock = &radeon_atom_get_memory_clock, |
| 636 | .set_memory_clock = &radeon_atom_set_memory_clock, |
| 637 | .get_pcie_lanes = NULL, |
| 638 | .set_pcie_lanes = NULL, |
| 639 | .set_clock_gating = &radeon_atom_set_clock_gating, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 640 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 641 | .pflip = { |
| 642 | .pre_page_flip = &rs600_pre_page_flip, |
| 643 | .page_flip = &rs600_page_flip, |
| 644 | .post_page_flip = &rs600_post_page_flip, |
| 645 | }, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 646 | .mc_wait_for_idle = &rs600_mc_wait_for_idle, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 647 | }; |
| 648 | |
| 649 | static struct radeon_asic rs690_asic = { |
| 650 | .init = &rs690_init, |
| 651 | .fini = &rs690_fini, |
| 652 | .suspend = &rs690_suspend, |
| 653 | .resume = &rs690_resume, |
| 654 | .vga_set_state = &r100_vga_set_state, |
Jerome Glisse | 225758d | 2010-03-09 14:45:10 +0000 | [diff] [blame] | 655 | .gpu_is_lockup = &r300_gpu_is_lockup, |
Jerome Glisse | 90aca4d | 2010-03-09 14:45:12 +0000 | [diff] [blame] | 656 | .asic_reset = &rs600_asic_reset, |
Alex Deucher | c5b3b85 | 2012-02-23 17:53:46 -0500 | [diff] [blame] | 657 | .gart = { |
| 658 | .tlb_flush = &rs400_gart_tlb_flush, |
| 659 | .set_page = &rs400_gart_set_page, |
| 660 | }, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 661 | .ring = { |
| 662 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 663 | .ib_execute = &r100_ring_ib_execute, |
| 664 | .emit_fence = &r300_fence_ring_emit, |
| 665 | .emit_semaphore = &r100_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame] | 666 | .cs_parse = &r300_cs_parse, |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 667 | .ring_start = &r300_ring_start, |
| 668 | .ring_test = &r100_ring_test, |
| 669 | .ib_test = &r100_ib_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 670 | } |
| 671 | }, |
Alex Deucher | b35ea4a | 2012-02-23 17:53:43 -0500 | [diff] [blame] | 672 | .irq = { |
| 673 | .set = &rs600_irq_set, |
| 674 | .process = &rs600_irq_process, |
| 675 | }, |
Alex Deucher | c79a49c | 2012-02-23 17:53:47 -0500 | [diff] [blame] | 676 | .display = { |
| 677 | .get_vblank_counter = &rs600_get_vblank_counter, |
| 678 | .bandwidth_update = &rs690_bandwidth_update, |
| 679 | .wait_for_vblank = &avivo_wait_for_vblank, |
| 680 | }, |
Alex Deucher | 27cd776 | 2012-02-23 17:53:42 -0500 | [diff] [blame] | 681 | .copy = { |
| 682 | .blit = &r100_copy_blit, |
| 683 | .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 684 | .dma = &r200_copy_dma, |
| 685 | .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 686 | .copy = &r200_copy_dma, |
| 687 | .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 688 | }, |
Alex Deucher | 9e6f3d0 | 2012-02-23 17:53:49 -0500 | [diff] [blame^] | 689 | .surface = { |
| 690 | .set_reg = r100_set_surface_reg, |
| 691 | .clear_reg = r100_clear_surface_reg, |
| 692 | }, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 693 | .hpd = { |
| 694 | .init = &rs600_hpd_init, |
| 695 | .fini = &rs600_hpd_fini, |
| 696 | .sense = &rs600_hpd_sense, |
| 697 | .set_polarity = &rs600_hpd_set_polarity, |
| 698 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 699 | .ioctl_wait_idle = NULL, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 700 | .gui_idle = &r100_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 701 | .pm = { |
| 702 | .misc = &rs600_pm_misc, |
| 703 | .prepare = &rs600_pm_prepare, |
| 704 | .finish = &rs600_pm_finish, |
| 705 | .init_profile = &r420_pm_init_profile, |
| 706 | .get_dynpm_state = &r100_pm_get_dynpm_state, |
Alex Deucher | 798bcf7 | 2012-02-23 17:53:48 -0500 | [diff] [blame] | 707 | .get_engine_clock = &radeon_atom_get_engine_clock, |
| 708 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 709 | .get_memory_clock = &radeon_atom_get_memory_clock, |
| 710 | .set_memory_clock = &radeon_atom_set_memory_clock, |
| 711 | .get_pcie_lanes = NULL, |
| 712 | .set_pcie_lanes = NULL, |
| 713 | .set_clock_gating = &radeon_atom_set_clock_gating, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 714 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 715 | .pflip = { |
| 716 | .pre_page_flip = &rs600_pre_page_flip, |
| 717 | .page_flip = &rs600_page_flip, |
| 718 | .post_page_flip = &rs600_post_page_flip, |
| 719 | }, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 720 | .mc_wait_for_idle = &rs690_mc_wait_for_idle, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 721 | }; |
| 722 | |
| 723 | static struct radeon_asic rv515_asic = { |
| 724 | .init = &rv515_init, |
| 725 | .fini = &rv515_fini, |
| 726 | .suspend = &rv515_suspend, |
| 727 | .resume = &rv515_resume, |
| 728 | .vga_set_state = &r100_vga_set_state, |
Jerome Glisse | 225758d | 2010-03-09 14:45:10 +0000 | [diff] [blame] | 729 | .gpu_is_lockup = &r300_gpu_is_lockup, |
Jerome Glisse | 90aca4d | 2010-03-09 14:45:12 +0000 | [diff] [blame] | 730 | .asic_reset = &rs600_asic_reset, |
Alex Deucher | c5b3b85 | 2012-02-23 17:53:46 -0500 | [diff] [blame] | 731 | .gart = { |
| 732 | .tlb_flush = &rv370_pcie_gart_tlb_flush, |
| 733 | .set_page = &rv370_pcie_gart_set_page, |
| 734 | }, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 735 | .ring = { |
| 736 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 737 | .ib_execute = &r100_ring_ib_execute, |
| 738 | .emit_fence = &r300_fence_ring_emit, |
| 739 | .emit_semaphore = &r100_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame] | 740 | .cs_parse = &r300_cs_parse, |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 741 | .ring_start = &rv515_ring_start, |
| 742 | .ring_test = &r100_ring_test, |
| 743 | .ib_test = &r100_ib_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 744 | } |
| 745 | }, |
Alex Deucher | b35ea4a | 2012-02-23 17:53:43 -0500 | [diff] [blame] | 746 | .irq = { |
| 747 | .set = &rs600_irq_set, |
| 748 | .process = &rs600_irq_process, |
| 749 | }, |
Alex Deucher | c79a49c | 2012-02-23 17:53:47 -0500 | [diff] [blame] | 750 | .display = { |
| 751 | .get_vblank_counter = &rs600_get_vblank_counter, |
| 752 | .bandwidth_update = &rv515_bandwidth_update, |
| 753 | .wait_for_vblank = &avivo_wait_for_vblank, |
| 754 | }, |
Alex Deucher | 27cd776 | 2012-02-23 17:53:42 -0500 | [diff] [blame] | 755 | .copy = { |
| 756 | .blit = &r100_copy_blit, |
| 757 | .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 758 | .dma = &r200_copy_dma, |
| 759 | .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 760 | .copy = &r100_copy_blit, |
| 761 | .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 762 | }, |
Alex Deucher | 9e6f3d0 | 2012-02-23 17:53:49 -0500 | [diff] [blame^] | 763 | .surface = { |
| 764 | .set_reg = r100_set_surface_reg, |
| 765 | .clear_reg = r100_clear_surface_reg, |
| 766 | }, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 767 | .hpd = { |
| 768 | .init = &rs600_hpd_init, |
| 769 | .fini = &rs600_hpd_fini, |
| 770 | .sense = &rs600_hpd_sense, |
| 771 | .set_polarity = &rs600_hpd_set_polarity, |
| 772 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 773 | .ioctl_wait_idle = NULL, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 774 | .gui_idle = &r100_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 775 | .pm = { |
| 776 | .misc = &rs600_pm_misc, |
| 777 | .prepare = &rs600_pm_prepare, |
| 778 | .finish = &rs600_pm_finish, |
| 779 | .init_profile = &r420_pm_init_profile, |
| 780 | .get_dynpm_state = &r100_pm_get_dynpm_state, |
Alex Deucher | 798bcf7 | 2012-02-23 17:53:48 -0500 | [diff] [blame] | 781 | .get_engine_clock = &radeon_atom_get_engine_clock, |
| 782 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 783 | .get_memory_clock = &radeon_atom_get_memory_clock, |
| 784 | .set_memory_clock = &radeon_atom_set_memory_clock, |
| 785 | .get_pcie_lanes = &rv370_get_pcie_lanes, |
| 786 | .set_pcie_lanes = &rv370_set_pcie_lanes, |
| 787 | .set_clock_gating = &radeon_atom_set_clock_gating, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 788 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 789 | .pflip = { |
| 790 | .pre_page_flip = &rs600_pre_page_flip, |
| 791 | .page_flip = &rs600_page_flip, |
| 792 | .post_page_flip = &rs600_post_page_flip, |
| 793 | }, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 794 | .mc_wait_for_idle = &rv515_mc_wait_for_idle, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 795 | }; |
| 796 | |
| 797 | static struct radeon_asic r520_asic = { |
| 798 | .init = &r520_init, |
| 799 | .fini = &rv515_fini, |
| 800 | .suspend = &rv515_suspend, |
| 801 | .resume = &r520_resume, |
| 802 | .vga_set_state = &r100_vga_set_state, |
Jerome Glisse | 225758d | 2010-03-09 14:45:10 +0000 | [diff] [blame] | 803 | .gpu_is_lockup = &r300_gpu_is_lockup, |
Jerome Glisse | 90aca4d | 2010-03-09 14:45:12 +0000 | [diff] [blame] | 804 | .asic_reset = &rs600_asic_reset, |
Alex Deucher | c5b3b85 | 2012-02-23 17:53:46 -0500 | [diff] [blame] | 805 | .gart = { |
| 806 | .tlb_flush = &rv370_pcie_gart_tlb_flush, |
| 807 | .set_page = &rv370_pcie_gart_set_page, |
| 808 | }, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 809 | .ring = { |
| 810 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 811 | .ib_execute = &r100_ring_ib_execute, |
| 812 | .emit_fence = &r300_fence_ring_emit, |
| 813 | .emit_semaphore = &r100_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame] | 814 | .cs_parse = &r300_cs_parse, |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 815 | .ring_start = &rv515_ring_start, |
| 816 | .ring_test = &r100_ring_test, |
| 817 | .ib_test = &r100_ib_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 818 | } |
| 819 | }, |
Alex Deucher | b35ea4a | 2012-02-23 17:53:43 -0500 | [diff] [blame] | 820 | .irq = { |
| 821 | .set = &rs600_irq_set, |
| 822 | .process = &rs600_irq_process, |
| 823 | }, |
Alex Deucher | c79a49c | 2012-02-23 17:53:47 -0500 | [diff] [blame] | 824 | .display = { |
| 825 | .bandwidth_update = &rv515_bandwidth_update, |
| 826 | .get_vblank_counter = &rs600_get_vblank_counter, |
| 827 | .wait_for_vblank = &avivo_wait_for_vblank, |
| 828 | }, |
Alex Deucher | 27cd776 | 2012-02-23 17:53:42 -0500 | [diff] [blame] | 829 | .copy = { |
| 830 | .blit = &r100_copy_blit, |
| 831 | .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 832 | .dma = &r200_copy_dma, |
| 833 | .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 834 | .copy = &r100_copy_blit, |
| 835 | .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 836 | }, |
Alex Deucher | 9e6f3d0 | 2012-02-23 17:53:49 -0500 | [diff] [blame^] | 837 | .surface = { |
| 838 | .set_reg = r100_set_surface_reg, |
| 839 | .clear_reg = r100_clear_surface_reg, |
| 840 | }, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 841 | .hpd = { |
| 842 | .init = &rs600_hpd_init, |
| 843 | .fini = &rs600_hpd_fini, |
| 844 | .sense = &rs600_hpd_sense, |
| 845 | .set_polarity = &rs600_hpd_set_polarity, |
| 846 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 847 | .ioctl_wait_idle = NULL, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 848 | .gui_idle = &r100_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 849 | .pm = { |
| 850 | .misc = &rs600_pm_misc, |
| 851 | .prepare = &rs600_pm_prepare, |
| 852 | .finish = &rs600_pm_finish, |
| 853 | .init_profile = &r420_pm_init_profile, |
| 854 | .get_dynpm_state = &r100_pm_get_dynpm_state, |
Alex Deucher | 798bcf7 | 2012-02-23 17:53:48 -0500 | [diff] [blame] | 855 | .get_engine_clock = &radeon_atom_get_engine_clock, |
| 856 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 857 | .get_memory_clock = &radeon_atom_get_memory_clock, |
| 858 | .set_memory_clock = &radeon_atom_set_memory_clock, |
| 859 | .get_pcie_lanes = &rv370_get_pcie_lanes, |
| 860 | .set_pcie_lanes = &rv370_set_pcie_lanes, |
| 861 | .set_clock_gating = &radeon_atom_set_clock_gating, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 862 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 863 | .pflip = { |
| 864 | .pre_page_flip = &rs600_pre_page_flip, |
| 865 | .page_flip = &rs600_page_flip, |
| 866 | .post_page_flip = &rs600_post_page_flip, |
| 867 | }, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 868 | .mc_wait_for_idle = &r520_mc_wait_for_idle, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 869 | }; |
| 870 | |
| 871 | static struct radeon_asic r600_asic = { |
| 872 | .init = &r600_init, |
| 873 | .fini = &r600_fini, |
| 874 | .suspend = &r600_suspend, |
| 875 | .resume = &r600_resume, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 876 | .vga_set_state = &r600_vga_set_state, |
Jerome Glisse | 225758d | 2010-03-09 14:45:10 +0000 | [diff] [blame] | 877 | .gpu_is_lockup = &r600_gpu_is_lockup, |
Jerome Glisse | a2d07b7 | 2010-03-09 14:45:11 +0000 | [diff] [blame] | 878 | .asic_reset = &r600_asic_reset, |
Alex Deucher | c5b3b85 | 2012-02-23 17:53:46 -0500 | [diff] [blame] | 879 | .gart = { |
| 880 | .tlb_flush = &r600_pcie_gart_tlb_flush, |
| 881 | .set_page = &rs600_gart_set_page, |
| 882 | }, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 883 | .ring = { |
| 884 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 885 | .ib_execute = &r600_ring_ib_execute, |
| 886 | .emit_fence = &r600_fence_ring_emit, |
| 887 | .emit_semaphore = &r600_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame] | 888 | .cs_parse = &r600_cs_parse, |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 889 | .ring_test = &r600_ring_test, |
| 890 | .ib_test = &r600_ib_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 891 | } |
| 892 | }, |
Alex Deucher | b35ea4a | 2012-02-23 17:53:43 -0500 | [diff] [blame] | 893 | .irq = { |
| 894 | .set = &r600_irq_set, |
| 895 | .process = &r600_irq_process, |
| 896 | }, |
Alex Deucher | c79a49c | 2012-02-23 17:53:47 -0500 | [diff] [blame] | 897 | .display = { |
| 898 | .bandwidth_update = &rv515_bandwidth_update, |
| 899 | .get_vblank_counter = &rs600_get_vblank_counter, |
| 900 | .wait_for_vblank = &avivo_wait_for_vblank, |
| 901 | }, |
Alex Deucher | 27cd776 | 2012-02-23 17:53:42 -0500 | [diff] [blame] | 902 | .copy = { |
| 903 | .blit = &r600_copy_blit, |
| 904 | .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 905 | .dma = NULL, |
| 906 | .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 907 | .copy = &r600_copy_blit, |
| 908 | .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 909 | }, |
Alex Deucher | 9e6f3d0 | 2012-02-23 17:53:49 -0500 | [diff] [blame^] | 910 | .surface = { |
| 911 | .set_reg = r600_set_surface_reg, |
| 912 | .clear_reg = r600_clear_surface_reg, |
| 913 | }, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 914 | .hpd = { |
| 915 | .init = &r600_hpd_init, |
| 916 | .fini = &r600_hpd_fini, |
| 917 | .sense = &r600_hpd_sense, |
| 918 | .set_polarity = &r600_hpd_set_polarity, |
| 919 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 920 | .ioctl_wait_idle = r600_ioctl_wait_idle, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 921 | .gui_idle = &r600_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 922 | .pm = { |
| 923 | .misc = &r600_pm_misc, |
| 924 | .prepare = &rs600_pm_prepare, |
| 925 | .finish = &rs600_pm_finish, |
| 926 | .init_profile = &r600_pm_init_profile, |
| 927 | .get_dynpm_state = &r600_pm_get_dynpm_state, |
Alex Deucher | 798bcf7 | 2012-02-23 17:53:48 -0500 | [diff] [blame] | 928 | .get_engine_clock = &radeon_atom_get_engine_clock, |
| 929 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 930 | .get_memory_clock = &radeon_atom_get_memory_clock, |
| 931 | .set_memory_clock = &radeon_atom_set_memory_clock, |
| 932 | .get_pcie_lanes = &r600_get_pcie_lanes, |
| 933 | .set_pcie_lanes = &r600_set_pcie_lanes, |
| 934 | .set_clock_gating = NULL, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 935 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 936 | .pflip = { |
| 937 | .pre_page_flip = &rs600_pre_page_flip, |
| 938 | .page_flip = &rs600_page_flip, |
| 939 | .post_page_flip = &rs600_post_page_flip, |
| 940 | }, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 941 | .mc_wait_for_idle = &r600_mc_wait_for_idle, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 942 | }; |
| 943 | |
Alex Deucher | f47299c | 2010-03-16 20:54:38 -0400 | [diff] [blame] | 944 | static struct radeon_asic rs780_asic = { |
| 945 | .init = &r600_init, |
| 946 | .fini = &r600_fini, |
| 947 | .suspend = &r600_suspend, |
| 948 | .resume = &r600_resume, |
Jerome Glisse | 90aca4d | 2010-03-09 14:45:12 +0000 | [diff] [blame] | 949 | .gpu_is_lockup = &r600_gpu_is_lockup, |
Alex Deucher | f47299c | 2010-03-16 20:54:38 -0400 | [diff] [blame] | 950 | .vga_set_state = &r600_vga_set_state, |
Jerome Glisse | a2d07b7 | 2010-03-09 14:45:11 +0000 | [diff] [blame] | 951 | .asic_reset = &r600_asic_reset, |
Alex Deucher | c5b3b85 | 2012-02-23 17:53:46 -0500 | [diff] [blame] | 952 | .gart = { |
| 953 | .tlb_flush = &r600_pcie_gart_tlb_flush, |
| 954 | .set_page = &rs600_gart_set_page, |
| 955 | }, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 956 | .ring = { |
| 957 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 958 | .ib_execute = &r600_ring_ib_execute, |
| 959 | .emit_fence = &r600_fence_ring_emit, |
| 960 | .emit_semaphore = &r600_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame] | 961 | .cs_parse = &r600_cs_parse, |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 962 | .ring_test = &r600_ring_test, |
| 963 | .ib_test = &r600_ib_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 964 | } |
| 965 | }, |
Alex Deucher | b35ea4a | 2012-02-23 17:53:43 -0500 | [diff] [blame] | 966 | .irq = { |
| 967 | .set = &r600_irq_set, |
| 968 | .process = &r600_irq_process, |
| 969 | }, |
Alex Deucher | c79a49c | 2012-02-23 17:53:47 -0500 | [diff] [blame] | 970 | .display = { |
| 971 | .bandwidth_update = &rs690_bandwidth_update, |
| 972 | .get_vblank_counter = &rs600_get_vblank_counter, |
| 973 | .wait_for_vblank = &avivo_wait_for_vblank, |
| 974 | }, |
Alex Deucher | 27cd776 | 2012-02-23 17:53:42 -0500 | [diff] [blame] | 975 | .copy = { |
| 976 | .blit = &r600_copy_blit, |
| 977 | .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 978 | .dma = NULL, |
| 979 | .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 980 | .copy = &r600_copy_blit, |
| 981 | .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 982 | }, |
Alex Deucher | 9e6f3d0 | 2012-02-23 17:53:49 -0500 | [diff] [blame^] | 983 | .surface = { |
| 984 | .set_reg = r600_set_surface_reg, |
| 985 | .clear_reg = r600_clear_surface_reg, |
| 986 | }, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 987 | .hpd = { |
| 988 | .init = &r600_hpd_init, |
| 989 | .fini = &r600_hpd_fini, |
| 990 | .sense = &r600_hpd_sense, |
| 991 | .set_polarity = &r600_hpd_set_polarity, |
| 992 | }, |
Alex Deucher | f47299c | 2010-03-16 20:54:38 -0400 | [diff] [blame] | 993 | .ioctl_wait_idle = r600_ioctl_wait_idle, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 994 | .gui_idle = &r600_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 995 | .pm = { |
| 996 | .misc = &r600_pm_misc, |
| 997 | .prepare = &rs600_pm_prepare, |
| 998 | .finish = &rs600_pm_finish, |
| 999 | .init_profile = &rs780_pm_init_profile, |
| 1000 | .get_dynpm_state = &r600_pm_get_dynpm_state, |
Alex Deucher | 798bcf7 | 2012-02-23 17:53:48 -0500 | [diff] [blame] | 1001 | .get_engine_clock = &radeon_atom_get_engine_clock, |
| 1002 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 1003 | .get_memory_clock = NULL, |
| 1004 | .set_memory_clock = NULL, |
| 1005 | .get_pcie_lanes = NULL, |
| 1006 | .set_pcie_lanes = NULL, |
| 1007 | .set_clock_gating = NULL, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 1008 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 1009 | .pflip = { |
| 1010 | .pre_page_flip = &rs600_pre_page_flip, |
| 1011 | .page_flip = &rs600_page_flip, |
| 1012 | .post_page_flip = &rs600_post_page_flip, |
| 1013 | }, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 1014 | .mc_wait_for_idle = &r600_mc_wait_for_idle, |
Alex Deucher | f47299c | 2010-03-16 20:54:38 -0400 | [diff] [blame] | 1015 | }; |
| 1016 | |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 1017 | static struct radeon_asic rv770_asic = { |
| 1018 | .init = &rv770_init, |
| 1019 | .fini = &rv770_fini, |
| 1020 | .suspend = &rv770_suspend, |
| 1021 | .resume = &rv770_resume, |
Jerome Glisse | a2d07b7 | 2010-03-09 14:45:11 +0000 | [diff] [blame] | 1022 | .asic_reset = &r600_asic_reset, |
Jerome Glisse | 225758d | 2010-03-09 14:45:10 +0000 | [diff] [blame] | 1023 | .gpu_is_lockup = &r600_gpu_is_lockup, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 1024 | .vga_set_state = &r600_vga_set_state, |
Alex Deucher | c5b3b85 | 2012-02-23 17:53:46 -0500 | [diff] [blame] | 1025 | .gart = { |
| 1026 | .tlb_flush = &r600_pcie_gart_tlb_flush, |
| 1027 | .set_page = &rs600_gart_set_page, |
| 1028 | }, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 1029 | .ring = { |
| 1030 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 1031 | .ib_execute = &r600_ring_ib_execute, |
| 1032 | .emit_fence = &r600_fence_ring_emit, |
| 1033 | .emit_semaphore = &r600_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame] | 1034 | .cs_parse = &r600_cs_parse, |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 1035 | .ring_test = &r600_ring_test, |
| 1036 | .ib_test = &r600_ib_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 1037 | } |
| 1038 | }, |
Alex Deucher | b35ea4a | 2012-02-23 17:53:43 -0500 | [diff] [blame] | 1039 | .irq = { |
| 1040 | .set = &r600_irq_set, |
| 1041 | .process = &r600_irq_process, |
| 1042 | }, |
Alex Deucher | c79a49c | 2012-02-23 17:53:47 -0500 | [diff] [blame] | 1043 | .display = { |
| 1044 | .bandwidth_update = &rv515_bandwidth_update, |
| 1045 | .get_vblank_counter = &rs600_get_vblank_counter, |
| 1046 | .wait_for_vblank = &avivo_wait_for_vblank, |
| 1047 | }, |
Alex Deucher | 27cd776 | 2012-02-23 17:53:42 -0500 | [diff] [blame] | 1048 | .copy = { |
| 1049 | .blit = &r600_copy_blit, |
| 1050 | .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 1051 | .dma = NULL, |
| 1052 | .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 1053 | .copy = &r600_copy_blit, |
| 1054 | .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 1055 | }, |
Alex Deucher | 9e6f3d0 | 2012-02-23 17:53:49 -0500 | [diff] [blame^] | 1056 | .surface = { |
| 1057 | .set_reg = r600_set_surface_reg, |
| 1058 | .clear_reg = r600_clear_surface_reg, |
| 1059 | }, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 1060 | .hpd = { |
| 1061 | .init = &r600_hpd_init, |
| 1062 | .fini = &r600_hpd_fini, |
| 1063 | .sense = &r600_hpd_sense, |
| 1064 | .set_polarity = &r600_hpd_set_polarity, |
| 1065 | }, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 1066 | .ioctl_wait_idle = r600_ioctl_wait_idle, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 1067 | .gui_idle = &r600_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 1068 | .pm = { |
| 1069 | .misc = &rv770_pm_misc, |
| 1070 | .prepare = &rs600_pm_prepare, |
| 1071 | .finish = &rs600_pm_finish, |
| 1072 | .init_profile = &r600_pm_init_profile, |
| 1073 | .get_dynpm_state = &r600_pm_get_dynpm_state, |
Alex Deucher | 798bcf7 | 2012-02-23 17:53:48 -0500 | [diff] [blame] | 1074 | .get_engine_clock = &radeon_atom_get_engine_clock, |
| 1075 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 1076 | .get_memory_clock = &radeon_atom_get_memory_clock, |
| 1077 | .set_memory_clock = &radeon_atom_set_memory_clock, |
| 1078 | .get_pcie_lanes = &r600_get_pcie_lanes, |
| 1079 | .set_pcie_lanes = &r600_set_pcie_lanes, |
| 1080 | .set_clock_gating = &radeon_atom_set_clock_gating, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 1081 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 1082 | .pflip = { |
| 1083 | .pre_page_flip = &rs600_pre_page_flip, |
| 1084 | .page_flip = &rv770_page_flip, |
| 1085 | .post_page_flip = &rs600_post_page_flip, |
| 1086 | }, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 1087 | .mc_wait_for_idle = &r600_mc_wait_for_idle, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 1088 | }; |
| 1089 | |
| 1090 | static struct radeon_asic evergreen_asic = { |
| 1091 | .init = &evergreen_init, |
| 1092 | .fini = &evergreen_fini, |
| 1093 | .suspend = &evergreen_suspend, |
| 1094 | .resume = &evergreen_resume, |
Jerome Glisse | 225758d | 2010-03-09 14:45:10 +0000 | [diff] [blame] | 1095 | .gpu_is_lockup = &evergreen_gpu_is_lockup, |
Jerome Glisse | a2d07b7 | 2010-03-09 14:45:11 +0000 | [diff] [blame] | 1096 | .asic_reset = &evergreen_asic_reset, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 1097 | .vga_set_state = &r600_vga_set_state, |
Alex Deucher | c5b3b85 | 2012-02-23 17:53:46 -0500 | [diff] [blame] | 1098 | .gart = { |
| 1099 | .tlb_flush = &evergreen_pcie_gart_tlb_flush, |
| 1100 | .set_page = &rs600_gart_set_page, |
| 1101 | }, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 1102 | .ring = { |
| 1103 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 1104 | .ib_execute = &evergreen_ring_ib_execute, |
| 1105 | .emit_fence = &r600_fence_ring_emit, |
| 1106 | .emit_semaphore = &r600_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame] | 1107 | .cs_parse = &evergreen_cs_parse, |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 1108 | .ring_test = &r600_ring_test, |
| 1109 | .ib_test = &r600_ib_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 1110 | } |
| 1111 | }, |
Alex Deucher | b35ea4a | 2012-02-23 17:53:43 -0500 | [diff] [blame] | 1112 | .irq = { |
| 1113 | .set = &evergreen_irq_set, |
| 1114 | .process = &evergreen_irq_process, |
| 1115 | }, |
Alex Deucher | c79a49c | 2012-02-23 17:53:47 -0500 | [diff] [blame] | 1116 | .display = { |
| 1117 | .bandwidth_update = &evergreen_bandwidth_update, |
| 1118 | .get_vblank_counter = &evergreen_get_vblank_counter, |
| 1119 | .wait_for_vblank = &dce4_wait_for_vblank, |
| 1120 | }, |
Alex Deucher | 27cd776 | 2012-02-23 17:53:42 -0500 | [diff] [blame] | 1121 | .copy = { |
| 1122 | .blit = &r600_copy_blit, |
| 1123 | .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 1124 | .dma = NULL, |
| 1125 | .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 1126 | .copy = &r600_copy_blit, |
| 1127 | .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 1128 | }, |
Alex Deucher | 9e6f3d0 | 2012-02-23 17:53:49 -0500 | [diff] [blame^] | 1129 | .surface = { |
| 1130 | .set_reg = r600_set_surface_reg, |
| 1131 | .clear_reg = r600_clear_surface_reg, |
| 1132 | }, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 1133 | .hpd = { |
| 1134 | .init = &evergreen_hpd_init, |
| 1135 | .fini = &evergreen_hpd_fini, |
| 1136 | .sense = &evergreen_hpd_sense, |
| 1137 | .set_polarity = &evergreen_hpd_set_polarity, |
| 1138 | }, |
Dave Airlie | 97bfd0a | 2011-05-19 14:14:43 +1000 | [diff] [blame] | 1139 | .ioctl_wait_idle = r600_ioctl_wait_idle, |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 1140 | .gui_idle = &r600_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 1141 | .pm = { |
| 1142 | .misc = &evergreen_pm_misc, |
| 1143 | .prepare = &evergreen_pm_prepare, |
| 1144 | .finish = &evergreen_pm_finish, |
| 1145 | .init_profile = &r600_pm_init_profile, |
| 1146 | .get_dynpm_state = &r600_pm_get_dynpm_state, |
Alex Deucher | 798bcf7 | 2012-02-23 17:53:48 -0500 | [diff] [blame] | 1147 | .get_engine_clock = &radeon_atom_get_engine_clock, |
| 1148 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 1149 | .get_memory_clock = &radeon_atom_get_memory_clock, |
| 1150 | .set_memory_clock = &radeon_atom_set_memory_clock, |
| 1151 | .get_pcie_lanes = &r600_get_pcie_lanes, |
| 1152 | .set_pcie_lanes = &r600_set_pcie_lanes, |
| 1153 | .set_clock_gating = NULL, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 1154 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 1155 | .pflip = { |
| 1156 | .pre_page_flip = &evergreen_pre_page_flip, |
| 1157 | .page_flip = &evergreen_page_flip, |
| 1158 | .post_page_flip = &evergreen_post_page_flip, |
| 1159 | }, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 1160 | .mc_wait_for_idle = &evergreen_mc_wait_for_idle, |
Daniel Vetter | 48e7a5f | 2010-03-11 21:19:15 +0000 | [diff] [blame] | 1161 | }; |
| 1162 | |
Alex Deucher | 958261d | 2010-11-22 17:56:30 -0500 | [diff] [blame] | 1163 | static struct radeon_asic sumo_asic = { |
| 1164 | .init = &evergreen_init, |
| 1165 | .fini = &evergreen_fini, |
| 1166 | .suspend = &evergreen_suspend, |
| 1167 | .resume = &evergreen_resume, |
Alex Deucher | 958261d | 2010-11-22 17:56:30 -0500 | [diff] [blame] | 1168 | .gpu_is_lockup = &evergreen_gpu_is_lockup, |
| 1169 | .asic_reset = &evergreen_asic_reset, |
| 1170 | .vga_set_state = &r600_vga_set_state, |
Alex Deucher | c5b3b85 | 2012-02-23 17:53:46 -0500 | [diff] [blame] | 1171 | .gart = { |
| 1172 | .tlb_flush = &evergreen_pcie_gart_tlb_flush, |
| 1173 | .set_page = &rs600_gart_set_page, |
| 1174 | }, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 1175 | .ring = { |
| 1176 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 1177 | .ib_execute = &evergreen_ring_ib_execute, |
| 1178 | .emit_fence = &r600_fence_ring_emit, |
| 1179 | .emit_semaphore = &r600_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame] | 1180 | .cs_parse = &evergreen_cs_parse, |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 1181 | .ring_test = &r600_ring_test, |
| 1182 | .ib_test = &r600_ib_test, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame] | 1183 | }, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 1184 | }, |
Alex Deucher | b35ea4a | 2012-02-23 17:53:43 -0500 | [diff] [blame] | 1185 | .irq = { |
| 1186 | .set = &evergreen_irq_set, |
| 1187 | .process = &evergreen_irq_process, |
| 1188 | }, |
Alex Deucher | c79a49c | 2012-02-23 17:53:47 -0500 | [diff] [blame] | 1189 | .display = { |
| 1190 | .bandwidth_update = &evergreen_bandwidth_update, |
| 1191 | .get_vblank_counter = &evergreen_get_vblank_counter, |
| 1192 | .wait_for_vblank = &dce4_wait_for_vblank, |
| 1193 | }, |
Alex Deucher | 27cd776 | 2012-02-23 17:53:42 -0500 | [diff] [blame] | 1194 | .copy = { |
| 1195 | .blit = &r600_copy_blit, |
| 1196 | .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 1197 | .dma = NULL, |
| 1198 | .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 1199 | .copy = &r600_copy_blit, |
| 1200 | .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 1201 | }, |
Alex Deucher | 9e6f3d0 | 2012-02-23 17:53:49 -0500 | [diff] [blame^] | 1202 | .surface = { |
| 1203 | .set_reg = r600_set_surface_reg, |
| 1204 | .clear_reg = r600_clear_surface_reg, |
| 1205 | }, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 1206 | .hpd = { |
| 1207 | .init = &evergreen_hpd_init, |
| 1208 | .fini = &evergreen_hpd_fini, |
| 1209 | .sense = &evergreen_hpd_sense, |
| 1210 | .set_polarity = &evergreen_hpd_set_polarity, |
| 1211 | }, |
Dave Airlie | 97bfd0a | 2011-05-19 14:14:43 +1000 | [diff] [blame] | 1212 | .ioctl_wait_idle = r600_ioctl_wait_idle, |
Alex Deucher | 958261d | 2010-11-22 17:56:30 -0500 | [diff] [blame] | 1213 | .gui_idle = &r600_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 1214 | .pm = { |
| 1215 | .misc = &evergreen_pm_misc, |
| 1216 | .prepare = &evergreen_pm_prepare, |
| 1217 | .finish = &evergreen_pm_finish, |
| 1218 | .init_profile = &sumo_pm_init_profile, |
| 1219 | .get_dynpm_state = &r600_pm_get_dynpm_state, |
Alex Deucher | 798bcf7 | 2012-02-23 17:53:48 -0500 | [diff] [blame] | 1220 | .get_engine_clock = &radeon_atom_get_engine_clock, |
| 1221 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 1222 | .get_memory_clock = NULL, |
| 1223 | .set_memory_clock = NULL, |
| 1224 | .get_pcie_lanes = NULL, |
| 1225 | .set_pcie_lanes = NULL, |
| 1226 | .set_clock_gating = NULL, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 1227 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 1228 | .pflip = { |
| 1229 | .pre_page_flip = &evergreen_pre_page_flip, |
| 1230 | .page_flip = &evergreen_page_flip, |
| 1231 | .post_page_flip = &evergreen_post_page_flip, |
| 1232 | }, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 1233 | .mc_wait_for_idle = &evergreen_mc_wait_for_idle, |
Alex Deucher | 958261d | 2010-11-22 17:56:30 -0500 | [diff] [blame] | 1234 | }; |
| 1235 | |
Alex Deucher | a43b766 | 2011-01-06 21:19:33 -0500 | [diff] [blame] | 1236 | static struct radeon_asic btc_asic = { |
| 1237 | .init = &evergreen_init, |
| 1238 | .fini = &evergreen_fini, |
| 1239 | .suspend = &evergreen_suspend, |
| 1240 | .resume = &evergreen_resume, |
Alex Deucher | a43b766 | 2011-01-06 21:19:33 -0500 | [diff] [blame] | 1241 | .gpu_is_lockup = &evergreen_gpu_is_lockup, |
| 1242 | .asic_reset = &evergreen_asic_reset, |
| 1243 | .vga_set_state = &r600_vga_set_state, |
Alex Deucher | c5b3b85 | 2012-02-23 17:53:46 -0500 | [diff] [blame] | 1244 | .gart = { |
| 1245 | .tlb_flush = &evergreen_pcie_gart_tlb_flush, |
| 1246 | .set_page = &rs600_gart_set_page, |
| 1247 | }, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 1248 | .ring = { |
| 1249 | [RADEON_RING_TYPE_GFX_INDEX] = { |
| 1250 | .ib_execute = &evergreen_ring_ib_execute, |
| 1251 | .emit_fence = &r600_fence_ring_emit, |
| 1252 | .emit_semaphore = &r600_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame] | 1253 | .cs_parse = &evergreen_cs_parse, |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 1254 | .ring_test = &r600_ring_test, |
| 1255 | .ib_test = &r600_ib_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 1256 | } |
| 1257 | }, |
Alex Deucher | b35ea4a | 2012-02-23 17:53:43 -0500 | [diff] [blame] | 1258 | .irq = { |
| 1259 | .set = &evergreen_irq_set, |
| 1260 | .process = &evergreen_irq_process, |
| 1261 | }, |
Alex Deucher | c79a49c | 2012-02-23 17:53:47 -0500 | [diff] [blame] | 1262 | .display = { |
| 1263 | .bandwidth_update = &evergreen_bandwidth_update, |
| 1264 | .get_vblank_counter = &evergreen_get_vblank_counter, |
| 1265 | .wait_for_vblank = &dce4_wait_for_vblank, |
| 1266 | }, |
Alex Deucher | 27cd776 | 2012-02-23 17:53:42 -0500 | [diff] [blame] | 1267 | .copy = { |
| 1268 | .blit = &r600_copy_blit, |
| 1269 | .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 1270 | .dma = NULL, |
| 1271 | .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 1272 | .copy = &r600_copy_blit, |
| 1273 | .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 1274 | }, |
Alex Deucher | 9e6f3d0 | 2012-02-23 17:53:49 -0500 | [diff] [blame^] | 1275 | .surface = { |
| 1276 | .set_reg = r600_set_surface_reg, |
| 1277 | .clear_reg = r600_clear_surface_reg, |
| 1278 | }, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 1279 | .hpd = { |
| 1280 | .init = &evergreen_hpd_init, |
| 1281 | .fini = &evergreen_hpd_fini, |
| 1282 | .sense = &evergreen_hpd_sense, |
| 1283 | .set_polarity = &evergreen_hpd_set_polarity, |
| 1284 | }, |
Dave Airlie | 97bfd0a | 2011-05-19 14:14:43 +1000 | [diff] [blame] | 1285 | .ioctl_wait_idle = r600_ioctl_wait_idle, |
Alex Deucher | a43b766 | 2011-01-06 21:19:33 -0500 | [diff] [blame] | 1286 | .gui_idle = &r600_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 1287 | .pm = { |
| 1288 | .misc = &evergreen_pm_misc, |
| 1289 | .prepare = &evergreen_pm_prepare, |
| 1290 | .finish = &evergreen_pm_finish, |
| 1291 | .init_profile = &r600_pm_init_profile, |
| 1292 | .get_dynpm_state = &r600_pm_get_dynpm_state, |
Alex Deucher | 798bcf7 | 2012-02-23 17:53:48 -0500 | [diff] [blame] | 1293 | .get_engine_clock = &radeon_atom_get_engine_clock, |
| 1294 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 1295 | .get_memory_clock = &radeon_atom_get_memory_clock, |
| 1296 | .set_memory_clock = &radeon_atom_set_memory_clock, |
| 1297 | .get_pcie_lanes = NULL, |
| 1298 | .set_pcie_lanes = NULL, |
| 1299 | .set_clock_gating = NULL, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 1300 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 1301 | .pflip = { |
| 1302 | .pre_page_flip = &evergreen_pre_page_flip, |
| 1303 | .page_flip = &evergreen_page_flip, |
| 1304 | .post_page_flip = &evergreen_post_page_flip, |
| 1305 | }, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 1306 | .mc_wait_for_idle = &evergreen_mc_wait_for_idle, |
Alex Deucher | a43b766 | 2011-01-06 21:19:33 -0500 | [diff] [blame] | 1307 | }; |
| 1308 | |
Jerome Glisse | 721604a | 2012-01-05 22:11:05 -0500 | [diff] [blame] | 1309 | static const struct radeon_vm_funcs cayman_vm_funcs = { |
| 1310 | .init = &cayman_vm_init, |
| 1311 | .fini = &cayman_vm_fini, |
| 1312 | .bind = &cayman_vm_bind, |
| 1313 | .unbind = &cayman_vm_unbind, |
| 1314 | .tlb_flush = &cayman_vm_tlb_flush, |
| 1315 | .page_flags = &cayman_vm_page_flags, |
| 1316 | .set_page = &cayman_vm_set_page, |
| 1317 | }; |
| 1318 | |
Alex Deucher | e348762 | 2011-03-02 20:07:36 -0500 | [diff] [blame] | 1319 | static struct radeon_asic cayman_asic = { |
| 1320 | .init = &cayman_init, |
| 1321 | .fini = &cayman_fini, |
| 1322 | .suspend = &cayman_suspend, |
| 1323 | .resume = &cayman_resume, |
Alex Deucher | e348762 | 2011-03-02 20:07:36 -0500 | [diff] [blame] | 1324 | .gpu_is_lockup = &cayman_gpu_is_lockup, |
| 1325 | .asic_reset = &cayman_asic_reset, |
| 1326 | .vga_set_state = &r600_vga_set_state, |
Alex Deucher | c5b3b85 | 2012-02-23 17:53:46 -0500 | [diff] [blame] | 1327 | .gart = { |
| 1328 | .tlb_flush = &cayman_pcie_gart_tlb_flush, |
| 1329 | .set_page = &rs600_gart_set_page, |
| 1330 | }, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 1331 | .ring = { |
| 1332 | [RADEON_RING_TYPE_GFX_INDEX] = { |
Jerome Glisse | 721604a | 2012-01-05 22:11:05 -0500 | [diff] [blame] | 1333 | .ib_execute = &cayman_ring_ib_execute, |
| 1334 | .ib_parse = &evergreen_ib_parse, |
Alex Deucher | b40e7e1 | 2011-11-17 14:57:50 -0500 | [diff] [blame] | 1335 | .emit_fence = &cayman_fence_ring_emit, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 1336 | .emit_semaphore = &r600_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame] | 1337 | .cs_parse = &evergreen_cs_parse, |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 1338 | .ring_test = &r600_ring_test, |
| 1339 | .ib_test = &r600_ib_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 1340 | }, |
| 1341 | [CAYMAN_RING_TYPE_CP1_INDEX] = { |
Jerome Glisse | 721604a | 2012-01-05 22:11:05 -0500 | [diff] [blame] | 1342 | .ib_execute = &cayman_ring_ib_execute, |
| 1343 | .ib_parse = &evergreen_ib_parse, |
Alex Deucher | b40e7e1 | 2011-11-17 14:57:50 -0500 | [diff] [blame] | 1344 | .emit_fence = &cayman_fence_ring_emit, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 1345 | .emit_semaphore = &r600_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame] | 1346 | .cs_parse = &evergreen_cs_parse, |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 1347 | .ring_test = &r600_ring_test, |
| 1348 | .ib_test = &r600_ib_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 1349 | }, |
| 1350 | [CAYMAN_RING_TYPE_CP2_INDEX] = { |
Jerome Glisse | 721604a | 2012-01-05 22:11:05 -0500 | [diff] [blame] | 1351 | .ib_execute = &cayman_ring_ib_execute, |
| 1352 | .ib_parse = &evergreen_ib_parse, |
Alex Deucher | b40e7e1 | 2011-11-17 14:57:50 -0500 | [diff] [blame] | 1353 | .emit_fence = &cayman_fence_ring_emit, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 1354 | .emit_semaphore = &r600_semaphore_ring_emit, |
Christian König | eb0c19c | 2012-02-23 15:18:44 +0100 | [diff] [blame] | 1355 | .cs_parse = &evergreen_cs_parse, |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 1356 | .ring_test = &r600_ring_test, |
| 1357 | .ib_test = &r600_ib_test, |
Christian König | 4c87bc2 | 2011-10-19 19:02:21 +0200 | [diff] [blame] | 1358 | } |
| 1359 | }, |
Alex Deucher | b35ea4a | 2012-02-23 17:53:43 -0500 | [diff] [blame] | 1360 | .irq = { |
| 1361 | .set = &evergreen_irq_set, |
| 1362 | .process = &evergreen_irq_process, |
| 1363 | }, |
Alex Deucher | c79a49c | 2012-02-23 17:53:47 -0500 | [diff] [blame] | 1364 | .display = { |
| 1365 | .bandwidth_update = &evergreen_bandwidth_update, |
| 1366 | .get_vblank_counter = &evergreen_get_vblank_counter, |
| 1367 | .wait_for_vblank = &dce4_wait_for_vblank, |
| 1368 | }, |
Alex Deucher | 27cd776 | 2012-02-23 17:53:42 -0500 | [diff] [blame] | 1369 | .copy = { |
| 1370 | .blit = &r600_copy_blit, |
| 1371 | .blit_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 1372 | .dma = NULL, |
| 1373 | .dma_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 1374 | .copy = &r600_copy_blit, |
| 1375 | .copy_ring_index = RADEON_RING_TYPE_GFX_INDEX, |
| 1376 | }, |
Alex Deucher | 9e6f3d0 | 2012-02-23 17:53:49 -0500 | [diff] [blame^] | 1377 | .surface = { |
| 1378 | .set_reg = r600_set_surface_reg, |
| 1379 | .clear_reg = r600_clear_surface_reg, |
| 1380 | }, |
Alex Deucher | 901ea57 | 2012-02-23 17:53:39 -0500 | [diff] [blame] | 1381 | .hpd = { |
| 1382 | .init = &evergreen_hpd_init, |
| 1383 | .fini = &evergreen_hpd_fini, |
| 1384 | .sense = &evergreen_hpd_sense, |
| 1385 | .set_polarity = &evergreen_hpd_set_polarity, |
| 1386 | }, |
Dave Airlie | 97bfd0a | 2011-05-19 14:14:43 +1000 | [diff] [blame] | 1387 | .ioctl_wait_idle = r600_ioctl_wait_idle, |
Alex Deucher | e348762 | 2011-03-02 20:07:36 -0500 | [diff] [blame] | 1388 | .gui_idle = &r600_gui_idle, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 1389 | .pm = { |
| 1390 | .misc = &evergreen_pm_misc, |
| 1391 | .prepare = &evergreen_pm_prepare, |
| 1392 | .finish = &evergreen_pm_finish, |
| 1393 | .init_profile = &r600_pm_init_profile, |
| 1394 | .get_dynpm_state = &r600_pm_get_dynpm_state, |
Alex Deucher | 798bcf7 | 2012-02-23 17:53:48 -0500 | [diff] [blame] | 1395 | .get_engine_clock = &radeon_atom_get_engine_clock, |
| 1396 | .set_engine_clock = &radeon_atom_set_engine_clock, |
| 1397 | .get_memory_clock = &radeon_atom_get_memory_clock, |
| 1398 | .set_memory_clock = &radeon_atom_set_memory_clock, |
| 1399 | .get_pcie_lanes = NULL, |
| 1400 | .set_pcie_lanes = NULL, |
| 1401 | .set_clock_gating = NULL, |
Alex Deucher | a02fa39 | 2012-02-23 17:53:41 -0500 | [diff] [blame] | 1402 | }, |
Alex Deucher | 0f9e006 | 2012-02-23 17:53:40 -0500 | [diff] [blame] | 1403 | .pflip = { |
| 1404 | .pre_page_flip = &evergreen_pre_page_flip, |
| 1405 | .page_flip = &evergreen_page_flip, |
| 1406 | .post_page_flip = &evergreen_post_page_flip, |
| 1407 | }, |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 1408 | .mc_wait_for_idle = &evergreen_mc_wait_for_idle, |
Alex Deucher | e348762 | 2011-03-02 20:07:36 -0500 | [diff] [blame] | 1409 | }; |
| 1410 | |
Daniel Vetter | 0a10c85 | 2010-03-11 21:19:14 +0000 | [diff] [blame] | 1411 | int radeon_asic_init(struct radeon_device *rdev) |
| 1412 | { |
| 1413 | radeon_register_accessor_init(rdev); |
Alex Deucher | ba7e05e | 2011-06-16 18:14:22 +0000 | [diff] [blame] | 1414 | |
| 1415 | /* set the number of crtcs */ |
| 1416 | if (rdev->flags & RADEON_SINGLE_CRTC) |
| 1417 | rdev->num_crtc = 1; |
| 1418 | else |
| 1419 | rdev->num_crtc = 2; |
| 1420 | |
Daniel Vetter | 0a10c85 | 2010-03-11 21:19:14 +0000 | [diff] [blame] | 1421 | switch (rdev->family) { |
| 1422 | case CHIP_R100: |
| 1423 | case CHIP_RV100: |
| 1424 | case CHIP_RS100: |
| 1425 | case CHIP_RV200: |
| 1426 | case CHIP_RS200: |
| 1427 | rdev->asic = &r100_asic; |
| 1428 | break; |
| 1429 | case CHIP_R200: |
| 1430 | case CHIP_RV250: |
| 1431 | case CHIP_RS300: |
| 1432 | case CHIP_RV280: |
| 1433 | rdev->asic = &r200_asic; |
| 1434 | break; |
| 1435 | case CHIP_R300: |
| 1436 | case CHIP_R350: |
| 1437 | case CHIP_RV350: |
| 1438 | case CHIP_RV380: |
| 1439 | if (rdev->flags & RADEON_IS_PCIE) |
| 1440 | rdev->asic = &r300_asic_pcie; |
| 1441 | else |
| 1442 | rdev->asic = &r300_asic; |
| 1443 | break; |
| 1444 | case CHIP_R420: |
| 1445 | case CHIP_R423: |
| 1446 | case CHIP_RV410: |
| 1447 | rdev->asic = &r420_asic; |
Alex Deucher | 07bb084 | 2010-06-22 21:58:26 -0400 | [diff] [blame] | 1448 | /* handle macs */ |
| 1449 | if (rdev->bios == NULL) { |
Alex Deucher | 798bcf7 | 2012-02-23 17:53:48 -0500 | [diff] [blame] | 1450 | rdev->asic->pm.get_engine_clock = &radeon_legacy_get_engine_clock; |
| 1451 | rdev->asic->pm.set_engine_clock = &radeon_legacy_set_engine_clock; |
| 1452 | rdev->asic->pm.get_memory_clock = &radeon_legacy_get_memory_clock; |
| 1453 | rdev->asic->pm.set_memory_clock = NULL; |
Alex Deucher | 07bb084 | 2010-06-22 21:58:26 -0400 | [diff] [blame] | 1454 | } |
Daniel Vetter | 0a10c85 | 2010-03-11 21:19:14 +0000 | [diff] [blame] | 1455 | break; |
| 1456 | case CHIP_RS400: |
| 1457 | case CHIP_RS480: |
| 1458 | rdev->asic = &rs400_asic; |
| 1459 | break; |
| 1460 | case CHIP_RS600: |
| 1461 | rdev->asic = &rs600_asic; |
| 1462 | break; |
| 1463 | case CHIP_RS690: |
| 1464 | case CHIP_RS740: |
| 1465 | rdev->asic = &rs690_asic; |
| 1466 | break; |
| 1467 | case CHIP_RV515: |
| 1468 | rdev->asic = &rv515_asic; |
| 1469 | break; |
| 1470 | case CHIP_R520: |
| 1471 | case CHIP_RV530: |
| 1472 | case CHIP_RV560: |
| 1473 | case CHIP_RV570: |
| 1474 | case CHIP_R580: |
| 1475 | rdev->asic = &r520_asic; |
| 1476 | break; |
| 1477 | case CHIP_R600: |
| 1478 | case CHIP_RV610: |
| 1479 | case CHIP_RV630: |
| 1480 | case CHIP_RV620: |
| 1481 | case CHIP_RV635: |
| 1482 | case CHIP_RV670: |
Alex Deucher | f47299c | 2010-03-16 20:54:38 -0400 | [diff] [blame] | 1483 | rdev->asic = &r600_asic; |
| 1484 | break; |
Daniel Vetter | 0a10c85 | 2010-03-11 21:19:14 +0000 | [diff] [blame] | 1485 | case CHIP_RS780: |
| 1486 | case CHIP_RS880: |
Alex Deucher | f47299c | 2010-03-16 20:54:38 -0400 | [diff] [blame] | 1487 | rdev->asic = &rs780_asic; |
Daniel Vetter | 0a10c85 | 2010-03-11 21:19:14 +0000 | [diff] [blame] | 1488 | break; |
| 1489 | case CHIP_RV770: |
| 1490 | case CHIP_RV730: |
| 1491 | case CHIP_RV710: |
| 1492 | case CHIP_RV740: |
| 1493 | rdev->asic = &rv770_asic; |
| 1494 | break; |
| 1495 | case CHIP_CEDAR: |
| 1496 | case CHIP_REDWOOD: |
| 1497 | case CHIP_JUNIPER: |
| 1498 | case CHIP_CYPRESS: |
| 1499 | case CHIP_HEMLOCK: |
Alex Deucher | ba7e05e | 2011-06-16 18:14:22 +0000 | [diff] [blame] | 1500 | /* set num crtcs */ |
| 1501 | if (rdev->family == CHIP_CEDAR) |
| 1502 | rdev->num_crtc = 4; |
| 1503 | else |
| 1504 | rdev->num_crtc = 6; |
Daniel Vetter | 0a10c85 | 2010-03-11 21:19:14 +0000 | [diff] [blame] | 1505 | rdev->asic = &evergreen_asic; |
| 1506 | break; |
Alex Deucher | 958261d | 2010-11-22 17:56:30 -0500 | [diff] [blame] | 1507 | case CHIP_PALM: |
Alex Deucher | 89da5a3 | 2011-05-31 15:42:47 -0400 | [diff] [blame] | 1508 | case CHIP_SUMO: |
| 1509 | case CHIP_SUMO2: |
Alex Deucher | 958261d | 2010-11-22 17:56:30 -0500 | [diff] [blame] | 1510 | rdev->asic = &sumo_asic; |
| 1511 | break; |
Alex Deucher | a43b766 | 2011-01-06 21:19:33 -0500 | [diff] [blame] | 1512 | case CHIP_BARTS: |
| 1513 | case CHIP_TURKS: |
| 1514 | case CHIP_CAICOS: |
Alex Deucher | ba7e05e | 2011-06-16 18:14:22 +0000 | [diff] [blame] | 1515 | /* set num crtcs */ |
| 1516 | if (rdev->family == CHIP_CAICOS) |
| 1517 | rdev->num_crtc = 4; |
| 1518 | else |
| 1519 | rdev->num_crtc = 6; |
Alex Deucher | a43b766 | 2011-01-06 21:19:33 -0500 | [diff] [blame] | 1520 | rdev->asic = &btc_asic; |
| 1521 | break; |
Alex Deucher | e348762 | 2011-03-02 20:07:36 -0500 | [diff] [blame] | 1522 | case CHIP_CAYMAN: |
| 1523 | rdev->asic = &cayman_asic; |
Alex Deucher | ba7e05e | 2011-06-16 18:14:22 +0000 | [diff] [blame] | 1524 | /* set num crtcs */ |
| 1525 | rdev->num_crtc = 6; |
Jerome Glisse | 721604a | 2012-01-05 22:11:05 -0500 | [diff] [blame] | 1526 | rdev->vm_manager.funcs = &cayman_vm_funcs; |
Alex Deucher | e348762 | 2011-03-02 20:07:36 -0500 | [diff] [blame] | 1527 | break; |
Daniel Vetter | 0a10c85 | 2010-03-11 21:19:14 +0000 | [diff] [blame] | 1528 | default: |
| 1529 | /* FIXME: not supported yet */ |
| 1530 | return -EINVAL; |
| 1531 | } |
| 1532 | |
| 1533 | if (rdev->flags & RADEON_IS_IGP) { |
Alex Deucher | 798bcf7 | 2012-02-23 17:53:48 -0500 | [diff] [blame] | 1534 | rdev->asic->pm.get_memory_clock = NULL; |
| 1535 | rdev->asic->pm.set_memory_clock = NULL; |
Daniel Vetter | 0a10c85 | 2010-03-11 21:19:14 +0000 | [diff] [blame] | 1536 | } |
| 1537 | |
Daniel Vetter | 0a10c85 | 2010-03-11 21:19:14 +0000 | [diff] [blame] | 1538 | return 0; |
| 1539 | } |
| 1540 | |