Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [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 | #ifndef __RADEON_ASIC_H__ |
| 29 | #define __RADEON_ASIC_H__ |
| 30 | |
| 31 | /* |
| 32 | * common functions |
| 33 | */ |
Rafał Miłecki | 7433874 | 2009-11-03 00:53:02 +0100 | [diff] [blame] | 34 | uint32_t radeon_legacy_get_engine_clock(struct radeon_device *rdev); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 35 | void radeon_legacy_set_engine_clock(struct radeon_device *rdev, uint32_t eng_clock); |
Rafał Miłecki | 5ea597f | 2009-12-17 13:50:09 +0100 | [diff] [blame] | 36 | uint32_t radeon_legacy_get_memory_clock(struct radeon_device *rdev); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 37 | void radeon_legacy_set_clock_gating(struct radeon_device *rdev, int enable); |
| 38 | |
Rafał Miłecki | 7433874 | 2009-11-03 00:53:02 +0100 | [diff] [blame] | 39 | uint32_t radeon_atom_get_engine_clock(struct radeon_device *rdev); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 40 | void radeon_atom_set_engine_clock(struct radeon_device *rdev, uint32_t eng_clock); |
Rafał Miłecki | 7433874 | 2009-11-03 00:53:02 +0100 | [diff] [blame] | 41 | uint32_t radeon_atom_get_memory_clock(struct radeon_device *rdev); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 42 | void radeon_atom_set_memory_clock(struct radeon_device *rdev, uint32_t mem_clock); |
| 43 | void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable); |
| 44 | |
Alex Deucher | 37e9b6a | 2012-08-03 11:39:43 -0400 | [diff] [blame] | 45 | void atombios_set_backlight_level(struct radeon_encoder *radeon_encoder, u8 level); |
Alex Deucher | 6d92f81 | 2012-09-14 09:59:26 -0400 | [diff] [blame] | 46 | u8 atombios_get_backlight_level(struct radeon_encoder *radeon_encoder); |
Alex Deucher | 37e9b6a | 2012-08-03 11:39:43 -0400 | [diff] [blame] | 47 | void radeon_legacy_set_backlight_level(struct radeon_encoder *radeon_encoder, u8 level); |
Alex Deucher | 6d92f81 | 2012-09-14 09:59:26 -0400 | [diff] [blame] | 48 | u8 radeon_legacy_get_backlight_level(struct radeon_encoder *radeon_encoder); |
Alex Deucher | 37e9b6a | 2012-08-03 11:39:43 -0400 | [diff] [blame] | 49 | |
Alex Deucher | f93bdef | 2013-01-29 14:10:56 -0500 | [diff] [blame] | 50 | u32 radeon_ring_generic_get_rptr(struct radeon_device *rdev, |
| 51 | struct radeon_ring *ring); |
| 52 | u32 radeon_ring_generic_get_wptr(struct radeon_device *rdev, |
| 53 | struct radeon_ring *ring); |
| 54 | void radeon_ring_generic_set_wptr(struct radeon_device *rdev, |
| 55 | struct radeon_ring *ring); |
Alex Deucher | 37e9b6a | 2012-08-03 11:39:43 -0400 | [diff] [blame] | 56 | |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 57 | /* |
Pauli Nieminen | 44ca747 | 2010-02-11 17:25:47 +0000 | [diff] [blame] | 58 | * r100,rv100,rs100,rv200,rs200 |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 59 | */ |
Daniel Vetter | 2b49750 | 2010-03-11 21:19:18 +0000 | [diff] [blame] | 60 | struct r100_mc_save { |
| 61 | u32 GENMO_WT; |
| 62 | u32 CRTC_EXT_CNTL; |
| 63 | u32 CRTC_GEN_CNTL; |
| 64 | u32 CRTC2_GEN_CNTL; |
| 65 | u32 CUR_OFFSET; |
| 66 | u32 CUR2_OFFSET; |
| 67 | }; |
| 68 | int r100_init(struct radeon_device *rdev); |
| 69 | void r100_fini(struct radeon_device *rdev); |
| 70 | int r100_suspend(struct radeon_device *rdev); |
| 71 | int r100_resume(struct radeon_device *rdev); |
Dave Airlie | 28d5204 | 2009-09-21 14:33:58 +1000 | [diff] [blame] | 72 | void r100_vga_set_state(struct radeon_device *rdev, bool state); |
Christian König | e32eb50 | 2011-10-23 12:56:27 +0200 | [diff] [blame] | 73 | bool r100_gpu_is_lockup(struct radeon_device *rdev, struct radeon_ring *cp); |
Jerome Glisse | a2d07b7 | 2010-03-09 14:45:11 +0000 | [diff] [blame] | 74 | int r100_asic_reset(struct radeon_device *rdev); |
Michel Dänzer | 7ed220d | 2009-08-13 11:10:51 +0200 | [diff] [blame] | 75 | u32 r100_get_vblank_counter(struct radeon_device *rdev, int crtc); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 76 | void r100_pci_gart_tlb_flush(struct radeon_device *rdev); |
| 77 | int r100_pci_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr); |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 78 | void r100_ring_start(struct radeon_device *rdev, struct radeon_ring *ring); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 79 | int r100_irq_set(struct radeon_device *rdev); |
| 80 | int r100_irq_process(struct radeon_device *rdev); |
| 81 | void r100_fence_ring_emit(struct radeon_device *rdev, |
| 82 | struct radeon_fence *fence); |
Christian König | 15d3332 | 2011-09-15 19:02:22 +0200 | [diff] [blame] | 83 | void r100_semaphore_ring_emit(struct radeon_device *rdev, |
Christian König | e32eb50 | 2011-10-23 12:56:27 +0200 | [diff] [blame] | 84 | struct radeon_ring *cp, |
Christian König | 15d3332 | 2011-09-15 19:02:22 +0200 | [diff] [blame] | 85 | struct radeon_semaphore *semaphore, |
Christian König | 7b1f248 | 2011-09-23 15:11:23 +0200 | [diff] [blame] | 86 | bool emit_wait); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 87 | int r100_cs_parse(struct radeon_cs_parser *p); |
| 88 | void r100_pll_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v); |
| 89 | uint32_t r100_pll_rreg(struct radeon_device *rdev, uint32_t reg); |
| 90 | int r100_copy_blit(struct radeon_device *rdev, |
| 91 | uint64_t src_offset, |
| 92 | uint64_t dst_offset, |
Alex Deucher | 003cefe | 2011-09-16 12:04:08 -0400 | [diff] [blame] | 93 | unsigned num_gpu_pages, |
Christian König | 876dc9f | 2012-05-08 14:24:01 +0200 | [diff] [blame] | 94 | struct radeon_fence **fence); |
Dave Airlie | e024e11 | 2009-06-24 09:48:08 +1000 | [diff] [blame] | 95 | int r100_set_surface_reg(struct radeon_device *rdev, int reg, |
| 96 | uint32_t tiling_flags, uint32_t pitch, |
| 97 | uint32_t offset, uint32_t obj_size); |
Daniel Vetter | 9479c54 | 2010-03-11 21:19:16 +0000 | [diff] [blame] | 98 | void r100_clear_surface_reg(struct radeon_device *rdev, int reg); |
Jerome Glisse | c93bb85 | 2009-07-13 21:04:08 +0200 | [diff] [blame] | 99 | void r100_bandwidth_update(struct radeon_device *rdev); |
Jerome Glisse | 3ce0a23 | 2009-09-08 10:10:24 +1000 | [diff] [blame] | 100 | void r100_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib); |
Christian König | e32eb50 | 2011-10-23 12:56:27 +0200 | [diff] [blame] | 101 | int r100_ring_test(struct radeon_device *rdev, struct radeon_ring *cp); |
Alex Deucher | 429770b | 2009-12-04 15:26:55 -0500 | [diff] [blame] | 102 | void r100_hpd_init(struct radeon_device *rdev); |
| 103 | void r100_hpd_fini(struct radeon_device *rdev); |
| 104 | bool r100_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd); |
| 105 | void r100_hpd_set_polarity(struct radeon_device *rdev, |
| 106 | enum radeon_hpd_id hpd); |
Daniel Vetter | 2b49750 | 2010-03-11 21:19:18 +0000 | [diff] [blame] | 107 | int r100_debugfs_rbbm_init(struct radeon_device *rdev); |
| 108 | int r100_debugfs_cp_init(struct radeon_device *rdev); |
| 109 | void r100_cp_disable(struct radeon_device *rdev); |
| 110 | int r100_cp_init(struct radeon_device *rdev, unsigned ring_size); |
| 111 | void r100_cp_fini(struct radeon_device *rdev); |
| 112 | int r100_pci_gart_init(struct radeon_device *rdev); |
| 113 | void r100_pci_gart_fini(struct radeon_device *rdev); |
| 114 | int r100_pci_gart_enable(struct radeon_device *rdev); |
| 115 | void r100_pci_gart_disable(struct radeon_device *rdev); |
| 116 | int r100_debugfs_mc_info_init(struct radeon_device *rdev); |
| 117 | int r100_gui_wait_for_idle(struct radeon_device *rdev); |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 118 | int r100_ib_test(struct radeon_device *rdev, struct radeon_ring *ring); |
Daniel Vetter | 2b49750 | 2010-03-11 21:19:18 +0000 | [diff] [blame] | 119 | void r100_irq_disable(struct radeon_device *rdev); |
| 120 | void r100_mc_stop(struct radeon_device *rdev, struct r100_mc_save *save); |
| 121 | void r100_mc_resume(struct radeon_device *rdev, struct r100_mc_save *save); |
| 122 | void r100_vram_init_sizes(struct radeon_device *rdev); |
Daniel Vetter | 2b49750 | 2010-03-11 21:19:18 +0000 | [diff] [blame] | 123 | int r100_cp_reset(struct radeon_device *rdev); |
| 124 | void r100_vga_render_disable(struct radeon_device *rdev); |
Dave Airlie | 4c712e6 | 2010-07-15 12:13:50 +1000 | [diff] [blame] | 125 | void r100_restore_sanity(struct radeon_device *rdev); |
Daniel Vetter | 2b49750 | 2010-03-11 21:19:18 +0000 | [diff] [blame] | 126 | int r100_cs_track_check_pkt3_indx_buffer(struct radeon_cs_parser *p, |
| 127 | struct radeon_cs_packet *pkt, |
| 128 | struct radeon_bo *robj); |
| 129 | int r100_cs_parse_packet0(struct radeon_cs_parser *p, |
| 130 | struct radeon_cs_packet *pkt, |
| 131 | const unsigned *auth, unsigned n, |
| 132 | radeon_packet0_check_t check); |
| 133 | int r100_cs_packet_parse(struct radeon_cs_parser *p, |
| 134 | struct radeon_cs_packet *pkt, |
| 135 | unsigned idx); |
| 136 | void r100_enable_bm(struct radeon_device *rdev); |
| 137 | void r100_set_common_regs(struct radeon_device *rdev); |
Jerome Glisse | 90aca4d | 2010-03-09 14:45:12 +0000 | [diff] [blame] | 138 | void r100_bm_disable(struct radeon_device *rdev); |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 139 | extern bool r100_gui_idle(struct radeon_device *rdev); |
Alex Deucher | 49e02b7 | 2010-04-23 17:57:27 -0400 | [diff] [blame] | 140 | extern void r100_pm_misc(struct radeon_device *rdev); |
| 141 | extern void r100_pm_prepare(struct radeon_device *rdev); |
| 142 | extern void r100_pm_finish(struct radeon_device *rdev); |
Alex Deucher | ce8f537 | 2010-05-07 15:10:16 -0400 | [diff] [blame] | 143 | extern void r100_pm_init_profile(struct radeon_device *rdev); |
| 144 | extern void r100_pm_get_dynpm_state(struct radeon_device *rdev); |
Alex Deucher | 6f34be5 | 2010-11-21 10:59:01 -0500 | [diff] [blame] | 145 | extern void r100_pre_page_flip(struct radeon_device *rdev, int crtc); |
| 146 | extern u32 r100_page_flip(struct radeon_device *rdev, int crtc, u64 crtc_base); |
| 147 | extern void r100_post_page_flip(struct radeon_device *rdev, int crtc); |
Alex Deucher | 3ae19b7 | 2012-02-23 17:53:37 -0500 | [diff] [blame] | 148 | extern void r100_wait_for_vblank(struct radeon_device *rdev, int crtc); |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 149 | extern int r100_mc_wait_for_idle(struct radeon_device *rdev); |
Alex Deucher | bae6b562 | 2010-04-22 13:38:05 -0400 | [diff] [blame] | 150 | |
Pauli Nieminen | 44ca747 | 2010-02-11 17:25:47 +0000 | [diff] [blame] | 151 | /* |
| 152 | * r200,rv250,rs300,rv280 |
| 153 | */ |
| 154 | extern int r200_copy_dma(struct radeon_device *rdev, |
Daniel Vetter | 187f3da | 2010-11-28 19:06:09 +0100 | [diff] [blame] | 155 | uint64_t src_offset, |
| 156 | uint64_t dst_offset, |
Alex Deucher | 003cefe | 2011-09-16 12:04:08 -0400 | [diff] [blame] | 157 | unsigned num_gpu_pages, |
Christian König | 876dc9f | 2012-05-08 14:24:01 +0200 | [diff] [blame] | 158 | struct radeon_fence **fence); |
Daniel Vetter | 187f3da | 2010-11-28 19:06:09 +0100 | [diff] [blame] | 159 | void r200_set_safe_registers(struct radeon_device *rdev); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 160 | |
| 161 | /* |
| 162 | * r300,r350,rv350,rv380 |
| 163 | */ |
Jerome Glisse | 207bf9e | 2009-09-30 15:35:32 +0200 | [diff] [blame] | 164 | extern int r300_init(struct radeon_device *rdev); |
| 165 | extern void r300_fini(struct radeon_device *rdev); |
| 166 | extern int r300_suspend(struct radeon_device *rdev); |
| 167 | extern int r300_resume(struct radeon_device *rdev); |
Jerome Glisse | a2d07b7 | 2010-03-09 14:45:11 +0000 | [diff] [blame] | 168 | extern int r300_asic_reset(struct radeon_device *rdev); |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 169 | extern void r300_ring_start(struct radeon_device *rdev, struct radeon_ring *ring); |
Jerome Glisse | 207bf9e | 2009-09-30 15:35:32 +0200 | [diff] [blame] | 170 | extern void r300_fence_ring_emit(struct radeon_device *rdev, |
| 171 | struct radeon_fence *fence); |
| 172 | extern int r300_cs_parse(struct radeon_cs_parser *p); |
| 173 | extern void rv370_pcie_gart_tlb_flush(struct radeon_device *rdev); |
| 174 | extern int rv370_pcie_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr); |
Jerome Glisse | 207bf9e | 2009-09-30 15:35:32 +0200 | [diff] [blame] | 175 | extern void rv370_set_pcie_lanes(struct radeon_device *rdev, int lanes); |
Alex Deucher | c836a41 | 2009-12-23 10:07:50 -0500 | [diff] [blame] | 176 | extern int rv370_get_pcie_lanes(struct radeon_device *rdev); |
Daniel Vetter | 187f3da | 2010-11-28 19:06:09 +0100 | [diff] [blame] | 177 | extern void r300_set_reg_safe(struct radeon_device *rdev); |
| 178 | extern void r300_mc_program(struct radeon_device *rdev); |
| 179 | extern void r300_mc_init(struct radeon_device *rdev); |
| 180 | extern void r300_clock_startup(struct radeon_device *rdev); |
| 181 | extern int r300_mc_wait_for_idle(struct radeon_device *rdev); |
| 182 | extern int rv370_pcie_gart_init(struct radeon_device *rdev); |
| 183 | extern void rv370_pcie_gart_fini(struct radeon_device *rdev); |
| 184 | extern int rv370_pcie_gart_enable(struct radeon_device *rdev); |
| 185 | extern void rv370_pcie_gart_disable(struct radeon_device *rdev); |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 186 | extern int r300_mc_wait_for_idle(struct radeon_device *rdev); |
Pauli Nieminen | 44ca747 | 2010-02-11 17:25:47 +0000 | [diff] [blame] | 187 | |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 188 | /* |
| 189 | * r420,r423,rv410 |
| 190 | */ |
Jerome Glisse | 9f022dd | 2009-09-11 15:35:22 +0200 | [diff] [blame] | 191 | extern int r420_init(struct radeon_device *rdev); |
| 192 | extern void r420_fini(struct radeon_device *rdev); |
| 193 | extern int r420_suspend(struct radeon_device *rdev); |
| 194 | extern int r420_resume(struct radeon_device *rdev); |
Alex Deucher | ce8f537 | 2010-05-07 15:10:16 -0400 | [diff] [blame] | 195 | extern void r420_pm_init_profile(struct radeon_device *rdev); |
Daniel Vetter | 187f3da | 2010-11-28 19:06:09 +0100 | [diff] [blame] | 196 | extern u32 r420_mc_rreg(struct radeon_device *rdev, u32 reg); |
| 197 | extern void r420_mc_wreg(struct radeon_device *rdev, u32 reg, u32 v); |
| 198 | extern int r420_debugfs_pipes_info_init(struct radeon_device *rdev); |
| 199 | extern void r420_pipes_init(struct radeon_device *rdev); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 200 | |
| 201 | /* |
| 202 | * rs400,rs480 |
| 203 | */ |
Jerome Glisse | ca6ffc6 | 2009-10-01 10:20:52 +0200 | [diff] [blame] | 204 | extern int rs400_init(struct radeon_device *rdev); |
| 205 | extern void rs400_fini(struct radeon_device *rdev); |
| 206 | extern int rs400_suspend(struct radeon_device *rdev); |
| 207 | extern int rs400_resume(struct radeon_device *rdev); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 208 | void rs400_gart_tlb_flush(struct radeon_device *rdev); |
| 209 | int rs400_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr); |
| 210 | uint32_t rs400_mc_rreg(struct radeon_device *rdev, uint32_t reg); |
| 211 | void rs400_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v); |
Daniel Vetter | 187f3da | 2010-11-28 19:06:09 +0100 | [diff] [blame] | 212 | int rs400_gart_init(struct radeon_device *rdev); |
| 213 | int rs400_gart_enable(struct radeon_device *rdev); |
| 214 | void rs400_gart_adjust_size(struct radeon_device *rdev); |
| 215 | void rs400_gart_disable(struct radeon_device *rdev); |
| 216 | void rs400_gart_fini(struct radeon_device *rdev); |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 217 | extern int rs400_mc_wait_for_idle(struct radeon_device *rdev); |
Daniel Vetter | 187f3da | 2010-11-28 19:06:09 +0100 | [diff] [blame] | 218 | |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 219 | /* |
| 220 | * rs600. |
| 221 | */ |
Jerome Glisse | 90aca4d | 2010-03-09 14:45:12 +0000 | [diff] [blame] | 222 | extern int rs600_asic_reset(struct radeon_device *rdev); |
Jerome Glisse | c010f80 | 2009-09-30 22:09:06 +0200 | [diff] [blame] | 223 | extern int rs600_init(struct radeon_device *rdev); |
| 224 | extern void rs600_fini(struct radeon_device *rdev); |
| 225 | extern int rs600_suspend(struct radeon_device *rdev); |
| 226 | extern int rs600_resume(struct radeon_device *rdev); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 227 | int rs600_irq_set(struct radeon_device *rdev); |
Michel Dänzer | 7ed220d | 2009-08-13 11:10:51 +0200 | [diff] [blame] | 228 | int rs600_irq_process(struct radeon_device *rdev); |
Daniel Vetter | 187f3da | 2010-11-28 19:06:09 +0100 | [diff] [blame] | 229 | void rs600_irq_disable(struct radeon_device *rdev); |
Michel Dänzer | 7ed220d | 2009-08-13 11:10:51 +0200 | [diff] [blame] | 230 | u32 rs600_get_vblank_counter(struct radeon_device *rdev, int crtc); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 231 | void rs600_gart_tlb_flush(struct radeon_device *rdev); |
| 232 | int rs600_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr); |
| 233 | uint32_t rs600_mc_rreg(struct radeon_device *rdev, uint32_t reg); |
| 234 | void rs600_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v); |
Jerome Glisse | c93bb85 | 2009-07-13 21:04:08 +0200 | [diff] [blame] | 235 | void rs600_bandwidth_update(struct radeon_device *rdev); |
Alex Deucher | 429770b | 2009-12-04 15:26:55 -0500 | [diff] [blame] | 236 | void rs600_hpd_init(struct radeon_device *rdev); |
| 237 | void rs600_hpd_fini(struct radeon_device *rdev); |
| 238 | bool rs600_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd); |
| 239 | void rs600_hpd_set_polarity(struct radeon_device *rdev, |
| 240 | enum radeon_hpd_id hpd); |
Alex Deucher | 49e02b7 | 2010-04-23 17:57:27 -0400 | [diff] [blame] | 241 | extern void rs600_pm_misc(struct radeon_device *rdev); |
| 242 | extern void rs600_pm_prepare(struct radeon_device *rdev); |
| 243 | extern void rs600_pm_finish(struct radeon_device *rdev); |
Alex Deucher | 6f34be5 | 2010-11-21 10:59:01 -0500 | [diff] [blame] | 244 | extern void rs600_pre_page_flip(struct radeon_device *rdev, int crtc); |
| 245 | extern u32 rs600_page_flip(struct radeon_device *rdev, int crtc, u64 crtc_base); |
| 246 | extern void rs600_post_page_flip(struct radeon_device *rdev, int crtc); |
Daniel Vetter | 187f3da | 2010-11-28 19:06:09 +0100 | [diff] [blame] | 247 | void rs600_set_safe_registers(struct radeon_device *rdev); |
Alex Deucher | 3ae19b7 | 2012-02-23 17:53:37 -0500 | [diff] [blame] | 248 | extern void avivo_wait_for_vblank(struct radeon_device *rdev, int crtc); |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 249 | extern int rs600_mc_wait_for_idle(struct radeon_device *rdev); |
Alex Deucher | 429770b | 2009-12-04 15:26:55 -0500 | [diff] [blame] | 250 | |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 251 | /* |
| 252 | * rs690,rs740 |
| 253 | */ |
Jerome Glisse | 3bc6853 | 2009-10-01 09:39:24 +0200 | [diff] [blame] | 254 | int rs690_init(struct radeon_device *rdev); |
| 255 | void rs690_fini(struct radeon_device *rdev); |
| 256 | int rs690_resume(struct radeon_device *rdev); |
| 257 | int rs690_suspend(struct radeon_device *rdev); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 258 | uint32_t rs690_mc_rreg(struct radeon_device *rdev, uint32_t reg); |
| 259 | void rs690_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v); |
Jerome Glisse | c93bb85 | 2009-07-13 21:04:08 +0200 | [diff] [blame] | 260 | void rs690_bandwidth_update(struct radeon_device *rdev); |
Daniel Vetter | 187f3da | 2010-11-28 19:06:09 +0100 | [diff] [blame] | 261 | void rs690_line_buffer_adjust(struct radeon_device *rdev, |
| 262 | struct drm_display_mode *mode1, |
| 263 | struct drm_display_mode *mode2); |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 264 | extern int rs690_mc_wait_for_idle(struct radeon_device *rdev); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 265 | |
| 266 | /* |
| 267 | * rv515 |
| 268 | */ |
Daniel Vetter | 187f3da | 2010-11-28 19:06:09 +0100 | [diff] [blame] | 269 | struct rv515_mc_save { |
Daniel Vetter | 187f3da | 2010-11-28 19:06:09 +0100 | [diff] [blame] | 270 | u32 vga_render_control; |
| 271 | u32 vga_hdp_control; |
Alex Deucher | 6253e4c | 2012-12-12 14:30:32 -0500 | [diff] [blame] | 272 | bool crtc_enabled[2]; |
Daniel Vetter | 187f3da | 2010-11-28 19:06:09 +0100 | [diff] [blame] | 273 | }; |
Jerome Glisse | 81ee8fb | 2012-07-27 16:32:24 -0400 | [diff] [blame] | 274 | |
Jerome Glisse | 068a117 | 2009-06-17 13:28:30 +0200 | [diff] [blame] | 275 | int rv515_init(struct radeon_device *rdev); |
Jerome Glisse | d39c3b8 | 2009-09-28 18:34:43 +0200 | [diff] [blame] | 276 | void rv515_fini(struct radeon_device *rdev); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 277 | uint32_t rv515_mc_rreg(struct radeon_device *rdev, uint32_t reg); |
| 278 | void rv515_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v); |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 279 | void rv515_ring_start(struct radeon_device *rdev, struct radeon_ring *ring); |
Jerome Glisse | c93bb85 | 2009-07-13 21:04:08 +0200 | [diff] [blame] | 280 | void rv515_bandwidth_update(struct radeon_device *rdev); |
Jerome Glisse | d39c3b8 | 2009-09-28 18:34:43 +0200 | [diff] [blame] | 281 | int rv515_resume(struct radeon_device *rdev); |
| 282 | int rv515_suspend(struct radeon_device *rdev); |
Daniel Vetter | 187f3da | 2010-11-28 19:06:09 +0100 | [diff] [blame] | 283 | void rv515_bandwidth_avivo_update(struct radeon_device *rdev); |
| 284 | void rv515_vga_render_disable(struct radeon_device *rdev); |
| 285 | void rv515_set_safe_registers(struct radeon_device *rdev); |
| 286 | void rv515_mc_stop(struct radeon_device *rdev, struct rv515_mc_save *save); |
| 287 | void rv515_mc_resume(struct radeon_device *rdev, struct rv515_mc_save *save); |
| 288 | void rv515_clock_startup(struct radeon_device *rdev); |
| 289 | void rv515_debugfs(struct radeon_device *rdev); |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 290 | int rv515_mc_wait_for_idle(struct radeon_device *rdev); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 291 | |
| 292 | /* |
| 293 | * r520,rv530,rv560,rv570,r580 |
| 294 | */ |
Jerome Glisse | d39c3b8 | 2009-09-28 18:34:43 +0200 | [diff] [blame] | 295 | int r520_init(struct radeon_device *rdev); |
Jerome Glisse | f0ed1f6 | 2009-09-28 20:39:19 +0200 | [diff] [blame] | 296 | int r520_resume(struct radeon_device *rdev); |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 297 | int r520_mc_wait_for_idle(struct radeon_device *rdev); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 298 | |
| 299 | /* |
Jerome Glisse | 3ce0a23 | 2009-09-08 10:10:24 +1000 | [diff] [blame] | 300 | * r600,rv610,rv630,rv620,rv635,rv670,rs780,rs880 |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 301 | */ |
Jerome Glisse | 3ce0a23 | 2009-09-08 10:10:24 +1000 | [diff] [blame] | 302 | int r600_init(struct radeon_device *rdev); |
| 303 | void r600_fini(struct radeon_device *rdev); |
| 304 | int r600_suspend(struct radeon_device *rdev); |
| 305 | int r600_resume(struct radeon_device *rdev); |
Dave Airlie | 28d5204 | 2009-09-21 14:33:58 +1000 | [diff] [blame] | 306 | void r600_vga_set_state(struct radeon_device *rdev, bool state); |
Jerome Glisse | 3ce0a23 | 2009-09-08 10:10:24 +1000 | [diff] [blame] | 307 | int r600_wb_init(struct radeon_device *rdev); |
| 308 | void r600_wb_fini(struct radeon_device *rdev); |
Jerome Glisse | 3ce0a23 | 2009-09-08 10:10:24 +1000 | [diff] [blame] | 309 | void r600_pcie_gart_tlb_flush(struct radeon_device *rdev); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 310 | uint32_t r600_pciep_rreg(struct radeon_device *rdev, uint32_t reg); |
| 311 | void r600_pciep_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v); |
Jerome Glisse | 3ce0a23 | 2009-09-08 10:10:24 +1000 | [diff] [blame] | 312 | int r600_cs_parse(struct radeon_cs_parser *p); |
Alex Deucher | cf4ccd0 | 2011-11-18 10:19:47 -0500 | [diff] [blame] | 313 | int r600_dma_cs_parse(struct radeon_cs_parser *p); |
Jerome Glisse | 3ce0a23 | 2009-09-08 10:10:24 +1000 | [diff] [blame] | 314 | void r600_fence_ring_emit(struct radeon_device *rdev, |
| 315 | struct radeon_fence *fence); |
Christian König | 15d3332 | 2011-09-15 19:02:22 +0200 | [diff] [blame] | 316 | void r600_semaphore_ring_emit(struct radeon_device *rdev, |
Christian König | e32eb50 | 2011-10-23 12:56:27 +0200 | [diff] [blame] | 317 | struct radeon_ring *cp, |
Christian König | 15d3332 | 2011-09-15 19:02:22 +0200 | [diff] [blame] | 318 | struct radeon_semaphore *semaphore, |
Christian König | 7b1f248 | 2011-09-23 15:11:23 +0200 | [diff] [blame] | 319 | bool emit_wait); |
Alex Deucher | 4d75658 | 2012-09-27 15:08:35 -0400 | [diff] [blame] | 320 | void r600_dma_fence_ring_emit(struct radeon_device *rdev, |
| 321 | struct radeon_fence *fence); |
| 322 | void r600_dma_semaphore_ring_emit(struct radeon_device *rdev, |
| 323 | struct radeon_ring *ring, |
| 324 | struct radeon_semaphore *semaphore, |
| 325 | bool emit_wait); |
| 326 | void r600_dma_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib); |
| 327 | bool r600_dma_is_lockup(struct radeon_device *rdev, struct radeon_ring *ring); |
Alex Deucher | 123bc18 | 2013-01-24 11:37:19 -0500 | [diff] [blame] | 328 | bool r600_gfx_is_lockup(struct radeon_device *rdev, struct radeon_ring *cp); |
Jerome Glisse | a2d07b7 | 2010-03-09 14:45:11 +0000 | [diff] [blame] | 329 | int r600_asic_reset(struct radeon_device *rdev); |
Jerome Glisse | 3ce0a23 | 2009-09-08 10:10:24 +1000 | [diff] [blame] | 330 | int r600_set_surface_reg(struct radeon_device *rdev, int reg, |
| 331 | uint32_t tiling_flags, uint32_t pitch, |
| 332 | uint32_t offset, uint32_t obj_size); |
Daniel Vetter | 9479c54 | 2010-03-11 21:19:16 +0000 | [diff] [blame] | 333 | void r600_clear_surface_reg(struct radeon_device *rdev, int reg); |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 334 | int r600_ib_test(struct radeon_device *rdev, struct radeon_ring *ring); |
Alex Deucher | 4d75658 | 2012-09-27 15:08:35 -0400 | [diff] [blame] | 335 | int r600_dma_ib_test(struct radeon_device *rdev, struct radeon_ring *ring); |
Jerome Glisse | 3ce0a23 | 2009-09-08 10:10:24 +1000 | [diff] [blame] | 336 | void r600_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib); |
Christian König | e32eb50 | 2011-10-23 12:56:27 +0200 | [diff] [blame] | 337 | int r600_ring_test(struct radeon_device *rdev, struct radeon_ring *cp); |
Alex Deucher | 4d75658 | 2012-09-27 15:08:35 -0400 | [diff] [blame] | 338 | int r600_dma_ring_test(struct radeon_device *rdev, struct radeon_ring *cp); |
Christian König | f2ba57b | 2013-04-08 12:41:29 +0200 | [diff] [blame] | 339 | int r600_uvd_ring_test(struct radeon_device *rdev, struct radeon_ring *ring); |
Jerome Glisse | 3ce0a23 | 2009-09-08 10:10:24 +1000 | [diff] [blame] | 340 | int r600_copy_blit(struct radeon_device *rdev, |
| 341 | uint64_t src_offset, uint64_t dst_offset, |
Christian König | 876dc9f | 2012-05-08 14:24:01 +0200 | [diff] [blame] | 342 | unsigned num_gpu_pages, struct radeon_fence **fence); |
Alex Deucher | 4d75658 | 2012-09-27 15:08:35 -0400 | [diff] [blame] | 343 | int r600_copy_dma(struct radeon_device *rdev, |
| 344 | uint64_t src_offset, uint64_t dst_offset, |
| 345 | unsigned num_gpu_pages, struct radeon_fence **fence); |
Alex Deucher | 429770b | 2009-12-04 15:26:55 -0500 | [diff] [blame] | 346 | void r600_hpd_init(struct radeon_device *rdev); |
| 347 | void r600_hpd_fini(struct radeon_device *rdev); |
| 348 | bool r600_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd); |
| 349 | void r600_hpd_set_polarity(struct radeon_device *rdev, |
| 350 | enum radeon_hpd_id hpd); |
Jerome Glisse | 062b389 | 2010-02-04 20:36:39 +0100 | [diff] [blame] | 351 | extern void r600_ioctl_wait_idle(struct radeon_device *rdev, struct radeon_bo *bo); |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 352 | extern bool r600_gui_idle(struct radeon_device *rdev); |
Alex Deucher | 49e02b7 | 2010-04-23 17:57:27 -0400 | [diff] [blame] | 353 | extern void r600_pm_misc(struct radeon_device *rdev); |
Alex Deucher | ce8f537 | 2010-05-07 15:10:16 -0400 | [diff] [blame] | 354 | extern void r600_pm_init_profile(struct radeon_device *rdev); |
| 355 | extern void rs780_pm_init_profile(struct radeon_device *rdev); |
Samuel Li | 65337e6 | 2013-04-05 17:50:53 -0400 | [diff] [blame] | 356 | extern uint32_t rs780_mc_rreg(struct radeon_device *rdev, uint32_t reg); |
| 357 | extern void rs780_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v); |
Alex Deucher | ce8f537 | 2010-05-07 15:10:16 -0400 | [diff] [blame] | 358 | extern void r600_pm_get_dynpm_state(struct radeon_device *rdev); |
Alex Deucher | 3313e3d | 2011-01-06 18:49:34 -0500 | [diff] [blame] | 359 | extern void r600_set_pcie_lanes(struct radeon_device *rdev, int lanes); |
| 360 | extern int r600_get_pcie_lanes(struct radeon_device *rdev); |
Daniel Vetter | 3574dda | 2011-02-18 17:59:19 +0100 | [diff] [blame] | 361 | bool r600_card_posted(struct radeon_device *rdev); |
| 362 | void r600_cp_stop(struct radeon_device *rdev); |
| 363 | int r600_cp_start(struct radeon_device *rdev); |
Christian König | e32eb50 | 2011-10-23 12:56:27 +0200 | [diff] [blame] | 364 | void r600_ring_init(struct radeon_device *rdev, struct radeon_ring *cp, unsigned ring_size); |
Daniel Vetter | 3574dda | 2011-02-18 17:59:19 +0100 | [diff] [blame] | 365 | int r600_cp_resume(struct radeon_device *rdev); |
| 366 | void r600_cp_fini(struct radeon_device *rdev); |
| 367 | int r600_count_pipe_bits(uint32_t val); |
| 368 | int r600_mc_wait_for_idle(struct radeon_device *rdev); |
| 369 | int r600_pcie_gart_init(struct radeon_device *rdev); |
| 370 | void r600_scratch_init(struct radeon_device *rdev); |
| 371 | int r600_blit_init(struct radeon_device *rdev); |
| 372 | void r600_blit_fini(struct radeon_device *rdev); |
| 373 | int r600_init_microcode(struct radeon_device *rdev); |
| 374 | /* r600 irq */ |
| 375 | int r600_irq_process(struct radeon_device *rdev); |
| 376 | int r600_irq_init(struct radeon_device *rdev); |
| 377 | void r600_irq_fini(struct radeon_device *rdev); |
| 378 | void r600_ih_ring_init(struct radeon_device *rdev, unsigned ring_size); |
| 379 | int r600_irq_set(struct radeon_device *rdev); |
| 380 | void r600_irq_suspend(struct radeon_device *rdev); |
| 381 | void r600_disable_interrupts(struct radeon_device *rdev); |
| 382 | void r600_rlc_stop(struct radeon_device *rdev); |
| 383 | /* r600 audio */ |
| 384 | int r600_audio_init(struct radeon_device *rdev); |
Rafał Miłecki | 3299de9 | 2012-05-14 21:25:57 +0200 | [diff] [blame] | 385 | struct r600_audio r600_audio_status(struct radeon_device *rdev); |
Daniel Vetter | 3574dda | 2011-02-18 17:59:19 +0100 | [diff] [blame] | 386 | void r600_audio_fini(struct radeon_device *rdev); |
Daniel Vetter | 3574dda | 2011-02-18 17:59:19 +0100 | [diff] [blame] | 387 | int r600_hdmi_buffer_status_changed(struct drm_encoder *encoder); |
| 388 | void r600_hdmi_update_audio_settings(struct drm_encoder *encoder); |
Alex Deucher | a973bea | 2013-04-18 11:32:16 -0400 | [diff] [blame] | 389 | void r600_hdmi_enable(struct drm_encoder *encoder, bool enable); |
| 390 | void r600_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *mode); |
Daniel Vetter | 4546b2c | 2011-02-18 17:59:21 +0100 | [diff] [blame] | 391 | /* r600 blit */ |
Christian König | f237750 | 2012-05-09 15:35:01 +0200 | [diff] [blame] | 392 | int r600_blit_prepare_copy(struct radeon_device *rdev, unsigned num_gpu_pages, |
Christian König | 220907d | 2012-05-10 16:46:43 +0200 | [diff] [blame] | 393 | struct radeon_fence **fence, struct radeon_sa_bo **vb, |
| 394 | struct radeon_semaphore **sem); |
Christian König | 876dc9f | 2012-05-08 14:24:01 +0200 | [diff] [blame] | 395 | void r600_blit_done_copy(struct radeon_device *rdev, struct radeon_fence **fence, |
Christian König | 220907d | 2012-05-10 16:46:43 +0200 | [diff] [blame] | 396 | struct radeon_sa_bo *vb, struct radeon_semaphore *sem); |
Daniel Vetter | 4546b2c | 2011-02-18 17:59:21 +0100 | [diff] [blame] | 397 | void r600_kms_blit_copy(struct radeon_device *rdev, |
| 398 | u64 src_gpu_addr, u64 dst_gpu_addr, |
Christian König | f237750 | 2012-05-09 15:35:01 +0200 | [diff] [blame] | 399 | unsigned num_gpu_pages, |
| 400 | struct radeon_sa_bo *vb); |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 401 | int r600_mc_wait_for_idle(struct radeon_device *rdev); |
Alex Deucher | 454d2e2 | 2013-02-14 10:04:02 -0500 | [diff] [blame] | 402 | u32 r600_get_xclk(struct radeon_device *rdev); |
Alex Deucher | d041889 | 2013-01-24 10:35:23 -0500 | [diff] [blame] | 403 | uint64_t r600_get_gpu_clock_counter(struct radeon_device *rdev); |
Alex Deucher | 6bd1c38 | 2013-06-21 14:38:03 -0400 | [diff] [blame] | 404 | int rv6xx_get_temp(struct radeon_device *rdev); |
Jerome Glisse | 3ce0a23 | 2009-09-08 10:10:24 +1000 | [diff] [blame] | 405 | |
Christian König | f2ba57b | 2013-04-08 12:41:29 +0200 | [diff] [blame] | 406 | /* uvd */ |
| 407 | int r600_uvd_init(struct radeon_device *rdev); |
| 408 | int r600_uvd_rbc_start(struct radeon_device *rdev); |
| 409 | void r600_uvd_rbc_stop(struct radeon_device *rdev); |
| 410 | int r600_uvd_ib_test(struct radeon_device *rdev, struct radeon_ring *ring); |
| 411 | void r600_uvd_fence_emit(struct radeon_device *rdev, |
| 412 | struct radeon_fence *fence); |
| 413 | void r600_uvd_semaphore_emit(struct radeon_device *rdev, |
| 414 | struct radeon_ring *ring, |
| 415 | struct radeon_semaphore *semaphore, |
| 416 | bool emit_wait); |
| 417 | void r600_uvd_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib); |
| 418 | |
Jerome Glisse | 3ce0a23 | 2009-09-08 10:10:24 +1000 | [diff] [blame] | 419 | /* |
| 420 | * rv770,rv730,rv710,rv740 |
| 421 | */ |
| 422 | int rv770_init(struct radeon_device *rdev); |
| 423 | void rv770_fini(struct radeon_device *rdev); |
| 424 | int rv770_suspend(struct radeon_device *rdev); |
| 425 | int rv770_resume(struct radeon_device *rdev); |
Daniel Vetter | 3574dda | 2011-02-18 17:59:19 +0100 | [diff] [blame] | 426 | void rv770_pm_misc(struct radeon_device *rdev); |
| 427 | u32 rv770_page_flip(struct radeon_device *rdev, int crtc, u64 crtc_base); |
| 428 | void r700_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc); |
| 429 | void r700_cp_stop(struct radeon_device *rdev); |
| 430 | void r700_cp_fini(struct radeon_device *rdev); |
Alex Deucher | 43fb778 | 2013-01-04 09:24:18 -0500 | [diff] [blame] | 431 | int rv770_copy_dma(struct radeon_device *rdev, |
| 432 | uint64_t src_offset, uint64_t dst_offset, |
| 433 | unsigned num_gpu_pages, |
| 434 | struct radeon_fence **fence); |
Alex Deucher | 454d2e2 | 2013-02-14 10:04:02 -0500 | [diff] [blame] | 435 | u32 rv770_get_xclk(struct radeon_device *rdev); |
Christian König | f2ba57b | 2013-04-08 12:41:29 +0200 | [diff] [blame] | 436 | int rv770_uvd_resume(struct radeon_device *rdev); |
Christian König | ef0e6e6 | 2013-04-08 12:41:35 +0200 | [diff] [blame] | 437 | int rv770_set_uvd_clocks(struct radeon_device *rdev, u32 vclk, u32 dclk); |
Alex Deucher | 6bd1c38 | 2013-06-21 14:38:03 -0400 | [diff] [blame] | 438 | int rv770_get_temp(struct radeon_device *rdev); |
Jerome Glisse | 3ce0a23 | 2009-09-08 10:10:24 +1000 | [diff] [blame] | 439 | |
Alex Deucher | bcc1c2a | 2010-01-12 17:54:34 -0500 | [diff] [blame] | 440 | /* |
| 441 | * evergreen |
| 442 | */ |
Daniel Vetter | 3574dda | 2011-02-18 17:59:19 +0100 | [diff] [blame] | 443 | struct evergreen_mc_save { |
Daniel Vetter | 3574dda | 2011-02-18 17:59:19 +0100 | [diff] [blame] | 444 | u32 vga_render_control; |
| 445 | u32 vga_hdp_control; |
Alex Deucher | 62444b7 | 2012-08-15 17:18:42 -0400 | [diff] [blame] | 446 | bool crtc_enabled[RADEON_MAX_CRTCS]; |
Daniel Vetter | 3574dda | 2011-02-18 17:59:19 +0100 | [diff] [blame] | 447 | }; |
Jerome Glisse | 81ee8fb | 2012-07-27 16:32:24 -0400 | [diff] [blame] | 448 | |
Alex Deucher | 0fcdb61 | 2010-03-24 13:20:41 -0400 | [diff] [blame] | 449 | void evergreen_pcie_gart_tlb_flush(struct radeon_device *rdev); |
Alex Deucher | bcc1c2a | 2010-01-12 17:54:34 -0500 | [diff] [blame] | 450 | int evergreen_init(struct radeon_device *rdev); |
| 451 | void evergreen_fini(struct radeon_device *rdev); |
| 452 | int evergreen_suspend(struct radeon_device *rdev); |
| 453 | int evergreen_resume(struct radeon_device *rdev); |
Alex Deucher | 123bc18 | 2013-01-24 11:37:19 -0500 | [diff] [blame] | 454 | bool evergreen_gfx_is_lockup(struct radeon_device *rdev, struct radeon_ring *cp); |
| 455 | bool evergreen_dma_is_lockup(struct radeon_device *rdev, struct radeon_ring *cp); |
Jerome Glisse | a2d07b7 | 2010-03-09 14:45:11 +0000 | [diff] [blame] | 456 | int evergreen_asic_reset(struct radeon_device *rdev); |
Alex Deucher | bcc1c2a | 2010-01-12 17:54:34 -0500 | [diff] [blame] | 457 | void evergreen_bandwidth_update(struct radeon_device *rdev); |
Alex Deucher | 1292059 | 2011-02-02 12:37:40 -0500 | [diff] [blame] | 458 | void evergreen_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib); |
Alex Deucher | bcc1c2a | 2010-01-12 17:54:34 -0500 | [diff] [blame] | 459 | void evergreen_hpd_init(struct radeon_device *rdev); |
| 460 | void evergreen_hpd_fini(struct radeon_device *rdev); |
| 461 | bool evergreen_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd); |
| 462 | void evergreen_hpd_set_polarity(struct radeon_device *rdev, |
| 463 | enum radeon_hpd_id hpd); |
Alex Deucher | 45f9a39 | 2010-03-24 13:55:51 -0400 | [diff] [blame] | 464 | u32 evergreen_get_vblank_counter(struct radeon_device *rdev, int crtc); |
| 465 | int evergreen_irq_set(struct radeon_device *rdev); |
| 466 | int evergreen_irq_process(struct radeon_device *rdev); |
Alex Deucher | cb5fcbd | 2010-05-28 19:01:35 -0400 | [diff] [blame] | 467 | extern int evergreen_cs_parse(struct radeon_cs_parser *p); |
Alex Deucher | d2ead3e | 2012-12-13 09:55:45 -0500 | [diff] [blame] | 468 | extern int evergreen_dma_cs_parse(struct radeon_cs_parser *p); |
Alex Deucher | 49e02b7 | 2010-04-23 17:57:27 -0400 | [diff] [blame] | 469 | extern void evergreen_pm_misc(struct radeon_device *rdev); |
| 470 | extern void evergreen_pm_prepare(struct radeon_device *rdev); |
| 471 | extern void evergreen_pm_finish(struct radeon_device *rdev); |
Alex Deucher | a4c9e2e | 2011-11-04 10:09:41 -0400 | [diff] [blame] | 472 | extern void sumo_pm_init_profile(struct radeon_device *rdev); |
Alex Deucher | 27810fb | 2012-10-01 19:25:11 -0400 | [diff] [blame] | 473 | extern void btc_pm_init_profile(struct radeon_device *rdev); |
Alex Deucher | 23d33ba | 2013-04-08 12:41:32 +0200 | [diff] [blame] | 474 | int sumo_set_uvd_clocks(struct radeon_device *rdev, u32 vclk, u32 dclk); |
Alex Deucher | a8b4925 | 2013-04-08 12:41:33 +0200 | [diff] [blame] | 475 | int evergreen_set_uvd_clocks(struct radeon_device *rdev, u32 vclk, u32 dclk); |
Alex Deucher | 6f34be5 | 2010-11-21 10:59:01 -0500 | [diff] [blame] | 476 | extern void evergreen_pre_page_flip(struct radeon_device *rdev, int crtc); |
| 477 | extern u32 evergreen_page_flip(struct radeon_device *rdev, int crtc, u64 crtc_base); |
| 478 | extern void evergreen_post_page_flip(struct radeon_device *rdev, int crtc); |
Alex Deucher | 3ae19b7 | 2012-02-23 17:53:37 -0500 | [diff] [blame] | 479 | extern void dce4_wait_for_vblank(struct radeon_device *rdev, int crtc); |
Daniel Vetter | 3574dda | 2011-02-18 17:59:19 +0100 | [diff] [blame] | 480 | void evergreen_disable_interrupt_state(struct radeon_device *rdev); |
| 481 | int evergreen_blit_init(struct radeon_device *rdev); |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 482 | int evergreen_mc_wait_for_idle(struct radeon_device *rdev); |
Alex Deucher | 233d1ad | 2012-12-04 15:25:59 -0500 | [diff] [blame] | 483 | void evergreen_dma_fence_ring_emit(struct radeon_device *rdev, |
| 484 | struct radeon_fence *fence); |
| 485 | void evergreen_dma_ring_ib_execute(struct radeon_device *rdev, |
| 486 | struct radeon_ib *ib); |
| 487 | int evergreen_copy_dma(struct radeon_device *rdev, |
| 488 | uint64_t src_offset, uint64_t dst_offset, |
| 489 | unsigned num_gpu_pages, |
| 490 | struct radeon_fence **fence); |
Alex Deucher | a973bea | 2013-04-18 11:32:16 -0400 | [diff] [blame] | 491 | void evergreen_hdmi_enable(struct drm_encoder *encoder, bool enable); |
| 492 | void evergreen_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *mode); |
Alex Deucher | 6bd1c38 | 2013-06-21 14:38:03 -0400 | [diff] [blame] | 493 | int evergreen_get_temp(struct radeon_device *rdev); |
| 494 | int sumo_get_temp(struct radeon_device *rdev); |
Alex Deucher | 29a1522 | 2012-12-14 11:57:36 -0500 | [diff] [blame^] | 495 | int tn_get_temp(struct radeon_device *rdev); |
Daniel Vetter | 4546b2c | 2011-02-18 17:59:21 +0100 | [diff] [blame] | 496 | |
Alex Deucher | e348762 | 2011-03-02 20:07:36 -0500 | [diff] [blame] | 497 | /* |
| 498 | * cayman |
| 499 | */ |
Alex Deucher | b40e7e1 | 2011-11-17 14:57:50 -0500 | [diff] [blame] | 500 | void cayman_fence_ring_emit(struct radeon_device *rdev, |
| 501 | struct radeon_fence *fence); |
Christian König | f2ba57b | 2013-04-08 12:41:29 +0200 | [diff] [blame] | 502 | void cayman_uvd_semaphore_emit(struct radeon_device *rdev, |
| 503 | struct radeon_ring *ring, |
| 504 | struct radeon_semaphore *semaphore, |
| 505 | bool emit_wait); |
Alex Deucher | e348762 | 2011-03-02 20:07:36 -0500 | [diff] [blame] | 506 | void cayman_pcie_gart_tlb_flush(struct radeon_device *rdev); |
| 507 | int cayman_init(struct radeon_device *rdev); |
| 508 | void cayman_fini(struct radeon_device *rdev); |
| 509 | int cayman_suspend(struct radeon_device *rdev); |
| 510 | int cayman_resume(struct radeon_device *rdev); |
Alex Deucher | e348762 | 2011-03-02 20:07:36 -0500 | [diff] [blame] | 511 | int cayman_asic_reset(struct radeon_device *rdev); |
Jerome Glisse | 721604a | 2012-01-05 22:11:05 -0500 | [diff] [blame] | 512 | void cayman_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib); |
| 513 | int cayman_vm_init(struct radeon_device *rdev); |
| 514 | void cayman_vm_fini(struct radeon_device *rdev); |
Alex Deucher | 498522b | 2012-10-02 14:43:38 -0400 | [diff] [blame] | 515 | void cayman_vm_flush(struct radeon_device *rdev, int ridx, struct radeon_vm *vm); |
Christian König | 089a786 | 2012-08-11 11:54:05 +0200 | [diff] [blame] | 516 | uint32_t cayman_vm_page_flags(struct radeon_device *rdev, uint32_t flags); |
Alex Deucher | 43f1214 | 2013-02-01 17:32:42 +0100 | [diff] [blame] | 517 | void cayman_vm_set_page(struct radeon_device *rdev, |
| 518 | struct radeon_ib *ib, |
| 519 | uint64_t pe, |
Christian König | dce34bf | 2012-09-17 19:36:18 +0200 | [diff] [blame] | 520 | uint64_t addr, unsigned count, |
| 521 | uint32_t incr, uint32_t flags); |
Jerome Glisse | 721604a | 2012-01-05 22:11:05 -0500 | [diff] [blame] | 522 | int evergreen_ib_parse(struct radeon_device *rdev, struct radeon_ib *ib); |
Alex Deucher | cd459e5 | 2012-12-13 12:17:38 -0500 | [diff] [blame] | 523 | int evergreen_dma_ib_parse(struct radeon_device *rdev, struct radeon_ib *ib); |
Alex Deucher | f60cbd1 | 2012-12-04 15:27:33 -0500 | [diff] [blame] | 524 | void cayman_dma_ring_ib_execute(struct radeon_device *rdev, |
| 525 | struct radeon_ib *ib); |
Alex Deucher | 123bc18 | 2013-01-24 11:37:19 -0500 | [diff] [blame] | 526 | bool cayman_gfx_is_lockup(struct radeon_device *rdev, struct radeon_ring *ring); |
Alex Deucher | f60cbd1 | 2012-12-04 15:27:33 -0500 | [diff] [blame] | 527 | bool cayman_dma_is_lockup(struct radeon_device *rdev, struct radeon_ring *ring); |
| 528 | void cayman_dma_vm_flush(struct radeon_device *rdev, int ridx, struct radeon_vm *vm); |
Alex Deucher | 45f9a39 | 2010-03-24 13:55:51 -0400 | [diff] [blame] | 529 | |
Alex Deucher | 43b3cd9 | 2012-03-20 17:18:00 -0400 | [diff] [blame] | 530 | /* DCE6 - SI */ |
| 531 | void dce6_bandwidth_update(struct radeon_device *rdev); |
| 532 | |
Alex Deucher | 02779c0 | 2012-03-20 17:18:25 -0400 | [diff] [blame] | 533 | /* |
| 534 | * si |
| 535 | */ |
| 536 | void si_fence_ring_emit(struct radeon_device *rdev, |
| 537 | struct radeon_fence *fence); |
| 538 | void si_pcie_gart_tlb_flush(struct radeon_device *rdev); |
| 539 | int si_init(struct radeon_device *rdev); |
| 540 | void si_fini(struct radeon_device *rdev); |
| 541 | int si_suspend(struct radeon_device *rdev); |
| 542 | int si_resume(struct radeon_device *rdev); |
Alex Deucher | 123bc18 | 2013-01-24 11:37:19 -0500 | [diff] [blame] | 543 | bool si_gfx_is_lockup(struct radeon_device *rdev, struct radeon_ring *cp); |
| 544 | bool si_dma_is_lockup(struct radeon_device *rdev, struct radeon_ring *cp); |
Alex Deucher | 02779c0 | 2012-03-20 17:18:25 -0400 | [diff] [blame] | 545 | int si_asic_reset(struct radeon_device *rdev); |
| 546 | void si_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib); |
| 547 | int si_irq_set(struct radeon_device *rdev); |
| 548 | int si_irq_process(struct radeon_device *rdev); |
| 549 | int si_vm_init(struct radeon_device *rdev); |
| 550 | void si_vm_fini(struct radeon_device *rdev); |
Alex Deucher | 43f1214 | 2013-02-01 17:32:42 +0100 | [diff] [blame] | 551 | void si_vm_set_page(struct radeon_device *rdev, |
| 552 | struct radeon_ib *ib, |
| 553 | uint64_t pe, |
Alex Deucher | 82ffd92 | 2012-10-02 14:47:46 -0400 | [diff] [blame] | 554 | uint64_t addr, unsigned count, |
| 555 | uint32_t incr, uint32_t flags); |
Alex Deucher | 498522b | 2012-10-02 14:43:38 -0400 | [diff] [blame] | 556 | void si_vm_flush(struct radeon_device *rdev, int ridx, struct radeon_vm *vm); |
Alex Deucher | 02779c0 | 2012-03-20 17:18:25 -0400 | [diff] [blame] | 557 | int si_ib_parse(struct radeon_device *rdev, struct radeon_ib *ib); |
Alex Deucher | 8c5fd7e | 2012-12-04 15:28:18 -0500 | [diff] [blame] | 558 | int si_copy_dma(struct radeon_device *rdev, |
| 559 | uint64_t src_offset, uint64_t dst_offset, |
| 560 | unsigned num_gpu_pages, |
| 561 | struct radeon_fence **fence); |
| 562 | void si_dma_vm_flush(struct radeon_device *rdev, int ridx, struct radeon_vm *vm); |
Alex Deucher | 454d2e2 | 2013-02-14 10:04:02 -0500 | [diff] [blame] | 563 | u32 si_get_xclk(struct radeon_device *rdev); |
Alex Deucher | d041889 | 2013-01-24 10:35:23 -0500 | [diff] [blame] | 564 | uint64_t si_get_gpu_clock_counter(struct radeon_device *rdev); |
Christian König | 2539eb0 | 2013-04-08 12:41:34 +0200 | [diff] [blame] | 565 | int si_set_uvd_clocks(struct radeon_device *rdev, u32 vclk, u32 dclk); |
Alex Deucher | 6bd1c38 | 2013-06-21 14:38:03 -0400 | [diff] [blame] | 566 | int si_get_temp(struct radeon_device *rdev); |
Alex Deucher | 02779c0 | 2012-03-20 17:18:25 -0400 | [diff] [blame] | 567 | |
Alex Deucher | 0672e27 | 2013-04-09 16:22:31 -0400 | [diff] [blame] | 568 | /* DCE8 - CIK */ |
| 569 | void dce8_bandwidth_update(struct radeon_device *rdev); |
| 570 | |
Alex Deucher | 44fa346 | 2012-12-18 22:17:00 -0500 | [diff] [blame] | 571 | /* |
| 572 | * cik |
| 573 | */ |
| 574 | uint64_t cik_get_gpu_clock_counter(struct radeon_device *rdev); |
Alex Deucher | 2c67912 | 2013-04-09 13:32:18 -0400 | [diff] [blame] | 575 | u32 cik_get_xclk(struct radeon_device *rdev); |
Alex Deucher | 6e2c3c0 | 2013-04-03 19:28:32 -0400 | [diff] [blame] | 576 | uint32_t cik_pciep_rreg(struct radeon_device *rdev, uint32_t reg); |
| 577 | void cik_pciep_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v); |
Christian König | 87167bb | 2013-04-09 13:39:21 -0400 | [diff] [blame] | 578 | int cik_set_uvd_clocks(struct radeon_device *rdev, u32 vclk, u32 dclk); |
| 579 | int cik_uvd_resume(struct radeon_device *rdev); |
Alex Deucher | 0672e27 | 2013-04-09 16:22:31 -0400 | [diff] [blame] | 580 | void cik_sdma_fence_ring_emit(struct radeon_device *rdev, |
| 581 | struct radeon_fence *fence); |
| 582 | void cik_sdma_semaphore_ring_emit(struct radeon_device *rdev, |
| 583 | struct radeon_ring *ring, |
| 584 | struct radeon_semaphore *semaphore, |
| 585 | bool emit_wait); |
| 586 | void cik_sdma_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib); |
| 587 | int cik_copy_dma(struct radeon_device *rdev, |
| 588 | uint64_t src_offset, uint64_t dst_offset, |
| 589 | unsigned num_gpu_pages, |
| 590 | struct radeon_fence **fence); |
| 591 | int cik_sdma_ring_test(struct radeon_device *rdev, struct radeon_ring *ring); |
| 592 | int cik_sdma_ib_test(struct radeon_device *rdev, struct radeon_ring *ring); |
| 593 | bool cik_sdma_is_lockup(struct radeon_device *rdev, struct radeon_ring *ring); |
| 594 | void cik_fence_gfx_ring_emit(struct radeon_device *rdev, |
| 595 | struct radeon_fence *fence); |
| 596 | void cik_fence_compute_ring_emit(struct radeon_device *rdev, |
| 597 | struct radeon_fence *fence); |
| 598 | void cik_semaphore_ring_emit(struct radeon_device *rdev, |
| 599 | struct radeon_ring *cp, |
| 600 | struct radeon_semaphore *semaphore, |
| 601 | bool emit_wait); |
| 602 | void cik_pcie_gart_tlb_flush(struct radeon_device *rdev); |
| 603 | int cik_init(struct radeon_device *rdev); |
| 604 | void cik_fini(struct radeon_device *rdev); |
| 605 | int cik_suspend(struct radeon_device *rdev); |
| 606 | int cik_resume(struct radeon_device *rdev); |
| 607 | bool cik_gfx_is_lockup(struct radeon_device *rdev, struct radeon_ring *cp); |
| 608 | int cik_asic_reset(struct radeon_device *rdev); |
| 609 | void cik_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib); |
| 610 | int cik_ring_test(struct radeon_device *rdev, struct radeon_ring *ring); |
| 611 | int cik_ib_test(struct radeon_device *rdev, struct radeon_ring *ring); |
| 612 | int cik_irq_set(struct radeon_device *rdev); |
| 613 | int cik_irq_process(struct radeon_device *rdev); |
| 614 | int cik_vm_init(struct radeon_device *rdev); |
| 615 | void cik_vm_fini(struct radeon_device *rdev); |
| 616 | void cik_vm_flush(struct radeon_device *rdev, int ridx, struct radeon_vm *vm); |
| 617 | void cik_vm_set_page(struct radeon_device *rdev, |
| 618 | struct radeon_ib *ib, |
| 619 | uint64_t pe, |
| 620 | uint64_t addr, unsigned count, |
| 621 | uint32_t incr, uint32_t flags); |
| 622 | void cik_dma_vm_flush(struct radeon_device *rdev, int ridx, struct radeon_vm *vm); |
| 623 | int cik_ib_parse(struct radeon_device *rdev, struct radeon_ib *ib); |
| 624 | u32 cik_compute_ring_get_rptr(struct radeon_device *rdev, |
| 625 | struct radeon_ring *ring); |
| 626 | u32 cik_compute_ring_get_wptr(struct radeon_device *rdev, |
| 627 | struct radeon_ring *ring); |
| 628 | void cik_compute_ring_set_wptr(struct radeon_device *rdev, |
| 629 | struct radeon_ring *ring); |
Alex Deucher | 44fa346 | 2012-12-18 22:17:00 -0500 | [diff] [blame] | 630 | |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 631 | #endif |