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