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 | |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 50 | /* |
Pauli Nieminen | 44ca747 | 2010-02-11 17:25:47 +0000 | [diff] [blame] | 51 | * r100,rv100,rs100,rv200,rs200 |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 52 | */ |
Daniel Vetter | 2b49750 | 2010-03-11 21:19:18 +0000 | [diff] [blame] | 53 | struct r100_mc_save { |
| 54 | u32 GENMO_WT; |
| 55 | u32 CRTC_EXT_CNTL; |
| 56 | u32 CRTC_GEN_CNTL; |
| 57 | u32 CRTC2_GEN_CNTL; |
| 58 | u32 CUR_OFFSET; |
| 59 | u32 CUR2_OFFSET; |
| 60 | }; |
| 61 | int r100_init(struct radeon_device *rdev); |
| 62 | void r100_fini(struct radeon_device *rdev); |
| 63 | int r100_suspend(struct radeon_device *rdev); |
| 64 | int r100_resume(struct radeon_device *rdev); |
Dave Airlie | 28d5204 | 2009-09-21 14:33:58 +1000 | [diff] [blame] | 65 | void r100_vga_set_state(struct radeon_device *rdev, bool state); |
Christian König | e32eb50 | 2011-10-23 12:56:27 +0200 | [diff] [blame] | 66 | bool r100_gpu_is_lockup(struct radeon_device *rdev, struct radeon_ring *cp); |
Jérome Glisse | 71fe289 | 2016-03-18 16:58:38 +0100 | [diff] [blame] | 67 | int r100_asic_reset(struct radeon_device *rdev, bool hard); |
Michel Dänzer | 7ed220d | 2009-08-13 11:10:51 +0200 | [diff] [blame] | 68 | u32 r100_get_vblank_counter(struct radeon_device *rdev, int crtc); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 69 | void r100_pci_gart_tlb_flush(struct radeon_device *rdev); |
Michel Dänzer | cb65890 | 2015-01-21 17:36:35 +0900 | [diff] [blame] | 70 | uint64_t r100_pci_gart_get_page_entry(uint64_t addr, uint32_t flags); |
Christian König | 7f90fc9 | 2014-06-04 15:29:57 +0200 | [diff] [blame] | 71 | void r100_pci_gart_set_page(struct radeon_device *rdev, unsigned i, |
Michel Dänzer | cb65890 | 2015-01-21 17:36:35 +0900 | [diff] [blame] | 72 | uint64_t entry); |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 73 | void r100_ring_start(struct radeon_device *rdev, struct radeon_ring *ring); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 74 | int r100_irq_set(struct radeon_device *rdev); |
| 75 | int r100_irq_process(struct radeon_device *rdev); |
| 76 | void r100_fence_ring_emit(struct radeon_device *rdev, |
| 77 | struct radeon_fence *fence); |
Christian König | 1654b81 | 2013-11-12 12:58:05 +0100 | [diff] [blame] | 78 | bool r100_semaphore_ring_emit(struct radeon_device *rdev, |
Christian König | e32eb50 | 2011-10-23 12:56:27 +0200 | [diff] [blame] | 79 | struct radeon_ring *cp, |
Christian König | 15d3332 | 2011-09-15 19:02:22 +0200 | [diff] [blame] | 80 | struct radeon_semaphore *semaphore, |
Christian König | 7b1f248 | 2011-09-23 15:11:23 +0200 | [diff] [blame] | 81 | bool emit_wait); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 82 | int r100_cs_parse(struct radeon_cs_parser *p); |
| 83 | void r100_pll_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v); |
| 84 | uint32_t r100_pll_rreg(struct radeon_device *rdev, uint32_t reg); |
Christian König | 57d20a4 | 2014-09-04 20:01:53 +0200 | [diff] [blame] | 85 | struct radeon_fence *r100_copy_blit(struct radeon_device *rdev, |
| 86 | uint64_t src_offset, |
| 87 | uint64_t dst_offset, |
| 88 | unsigned num_gpu_pages, |
| 89 | struct reservation_object *resv); |
Dave Airlie | e024e11 | 2009-06-24 09:48:08 +1000 | [diff] [blame] | 90 | int r100_set_surface_reg(struct radeon_device *rdev, int reg, |
| 91 | uint32_t tiling_flags, uint32_t pitch, |
| 92 | uint32_t offset, uint32_t obj_size); |
Daniel Vetter | 9479c54 | 2010-03-11 21:19:16 +0000 | [diff] [blame] | 93 | void r100_clear_surface_reg(struct radeon_device *rdev, int reg); |
Jerome Glisse | c93bb85 | 2009-07-13 21:04:08 +0200 | [diff] [blame] | 94 | void r100_bandwidth_update(struct radeon_device *rdev); |
Jerome Glisse | 3ce0a23 | 2009-09-08 10:10:24 +1000 | [diff] [blame] | 95 | 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] | 96 | int r100_ring_test(struct radeon_device *rdev, struct radeon_ring *cp); |
Alex Deucher | 429770b | 2009-12-04 15:26:55 -0500 | [diff] [blame] | 97 | void r100_hpd_init(struct radeon_device *rdev); |
| 98 | void r100_hpd_fini(struct radeon_device *rdev); |
| 99 | bool r100_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd); |
| 100 | void r100_hpd_set_polarity(struct radeon_device *rdev, |
| 101 | enum radeon_hpd_id hpd); |
Daniel Vetter | 2b49750 | 2010-03-11 21:19:18 +0000 | [diff] [blame] | 102 | int r100_debugfs_rbbm_init(struct radeon_device *rdev); |
| 103 | int r100_debugfs_cp_init(struct radeon_device *rdev); |
| 104 | void r100_cp_disable(struct radeon_device *rdev); |
| 105 | int r100_cp_init(struct radeon_device *rdev, unsigned ring_size); |
| 106 | void r100_cp_fini(struct radeon_device *rdev); |
| 107 | int r100_pci_gart_init(struct radeon_device *rdev); |
| 108 | void r100_pci_gart_fini(struct radeon_device *rdev); |
| 109 | int r100_pci_gart_enable(struct radeon_device *rdev); |
| 110 | void r100_pci_gart_disable(struct radeon_device *rdev); |
| 111 | int r100_debugfs_mc_info_init(struct radeon_device *rdev); |
| 112 | int r100_gui_wait_for_idle(struct radeon_device *rdev); |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 113 | int r100_ib_test(struct radeon_device *rdev, struct radeon_ring *ring); |
Daniel Vetter | 2b49750 | 2010-03-11 21:19:18 +0000 | [diff] [blame] | 114 | void r100_irq_disable(struct radeon_device *rdev); |
| 115 | void r100_mc_stop(struct radeon_device *rdev, struct r100_mc_save *save); |
| 116 | void r100_mc_resume(struct radeon_device *rdev, struct r100_mc_save *save); |
| 117 | void r100_vram_init_sizes(struct radeon_device *rdev); |
Daniel Vetter | 2b49750 | 2010-03-11 21:19:18 +0000 | [diff] [blame] | 118 | int r100_cp_reset(struct radeon_device *rdev); |
| 119 | void r100_vga_render_disable(struct radeon_device *rdev); |
Dave Airlie | 4c712e6 | 2010-07-15 12:13:50 +1000 | [diff] [blame] | 120 | void r100_restore_sanity(struct radeon_device *rdev); |
Daniel Vetter | 2b49750 | 2010-03-11 21:19:18 +0000 | [diff] [blame] | 121 | int r100_cs_track_check_pkt3_indx_buffer(struct radeon_cs_parser *p, |
| 122 | struct radeon_cs_packet *pkt, |
| 123 | struct radeon_bo *robj); |
| 124 | int r100_cs_parse_packet0(struct radeon_cs_parser *p, |
| 125 | struct radeon_cs_packet *pkt, |
| 126 | const unsigned *auth, unsigned n, |
| 127 | radeon_packet0_check_t check); |
| 128 | int r100_cs_packet_parse(struct radeon_cs_parser *p, |
| 129 | struct radeon_cs_packet *pkt, |
| 130 | unsigned idx); |
| 131 | void r100_enable_bm(struct radeon_device *rdev); |
| 132 | void r100_set_common_regs(struct radeon_device *rdev); |
Jerome Glisse | 90aca4d | 2010-03-09 14:45:12 +0000 | [diff] [blame] | 133 | void r100_bm_disable(struct radeon_device *rdev); |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 134 | extern bool r100_gui_idle(struct radeon_device *rdev); |
Alex Deucher | 49e02b7 | 2010-04-23 17:57:27 -0400 | [diff] [blame] | 135 | extern void r100_pm_misc(struct radeon_device *rdev); |
| 136 | extern void r100_pm_prepare(struct radeon_device *rdev); |
| 137 | extern void r100_pm_finish(struct radeon_device *rdev); |
Alex Deucher | ce8f537 | 2010-05-07 15:10:16 -0400 | [diff] [blame] | 138 | extern void r100_pm_init_profile(struct radeon_device *rdev); |
| 139 | extern void r100_pm_get_dynpm_state(struct radeon_device *rdev); |
Christian König | 157fa14 | 2014-05-27 16:49:20 +0200 | [diff] [blame] | 140 | extern void r100_page_flip(struct radeon_device *rdev, int crtc, |
Michel Dänzer | c63dd75 | 2016-04-01 18:51:34 +0900 | [diff] [blame] | 141 | u64 crtc_base, bool async); |
Christian König | 157fa14 | 2014-05-27 16:49:20 +0200 | [diff] [blame] | 142 | extern bool r100_page_flip_pending(struct radeon_device *rdev, int crtc); |
Alex Deucher | 3ae19b7 | 2012-02-23 17:53:37 -0500 | [diff] [blame] | 143 | extern void r100_wait_for_vblank(struct radeon_device *rdev, int crtc); |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 144 | extern int r100_mc_wait_for_idle(struct radeon_device *rdev); |
Alex Deucher | bae6b562 | 2010-04-22 13:38:05 -0400 | [diff] [blame] | 145 | |
Alex Deucher | ea31bf6 | 2013-12-09 19:44:30 -0500 | [diff] [blame] | 146 | u32 r100_gfx_get_rptr(struct radeon_device *rdev, |
| 147 | struct radeon_ring *ring); |
| 148 | u32 r100_gfx_get_wptr(struct radeon_device *rdev, |
| 149 | struct radeon_ring *ring); |
| 150 | void r100_gfx_set_wptr(struct radeon_device *rdev, |
| 151 | struct radeon_ring *ring); |
Michel Dänzer | 897eba8 | 2014-09-17 16:25:55 +0900 | [diff] [blame] | 152 | |
Pauli Nieminen | 44ca747 | 2010-02-11 17:25:47 +0000 | [diff] [blame] | 153 | /* |
| 154 | * r200,rv250,rs300,rv280 |
| 155 | */ |
Christian König | 57d20a4 | 2014-09-04 20:01:53 +0200 | [diff] [blame] | 156 | struct radeon_fence *r200_copy_dma(struct radeon_device *rdev, |
| 157 | uint64_t src_offset, |
| 158 | uint64_t dst_offset, |
| 159 | unsigned num_gpu_pages, |
| 160 | struct reservation_object *resv); |
Daniel Vetter | 187f3da | 2010-11-28 19:06:09 +0100 | [diff] [blame] | 161 | void r200_set_safe_registers(struct radeon_device *rdev); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 162 | |
| 163 | /* |
| 164 | * r300,r350,rv350,rv380 |
| 165 | */ |
Jerome Glisse | 207bf9e | 2009-09-30 15:35:32 +0200 | [diff] [blame] | 166 | extern int r300_init(struct radeon_device *rdev); |
| 167 | extern void r300_fini(struct radeon_device *rdev); |
| 168 | extern int r300_suspend(struct radeon_device *rdev); |
| 169 | extern int r300_resume(struct radeon_device *rdev); |
Jérome Glisse | 71fe289 | 2016-03-18 16:58:38 +0100 | [diff] [blame] | 170 | extern int r300_asic_reset(struct radeon_device *rdev, bool hard); |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 171 | 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] | 172 | extern void r300_fence_ring_emit(struct radeon_device *rdev, |
| 173 | struct radeon_fence *fence); |
| 174 | extern int r300_cs_parse(struct radeon_cs_parser *p); |
| 175 | extern void rv370_pcie_gart_tlb_flush(struct radeon_device *rdev); |
Michel Dänzer | cb65890 | 2015-01-21 17:36:35 +0900 | [diff] [blame] | 176 | extern uint64_t rv370_pcie_gart_get_page_entry(uint64_t addr, uint32_t flags); |
Christian König | 7f90fc9 | 2014-06-04 15:29:57 +0200 | [diff] [blame] | 177 | extern void rv370_pcie_gart_set_page(struct radeon_device *rdev, unsigned i, |
Michel Dänzer | cb65890 | 2015-01-21 17:36:35 +0900 | [diff] [blame] | 178 | uint64_t entry); |
Jerome Glisse | 207bf9e | 2009-09-30 15:35:32 +0200 | [diff] [blame] | 179 | extern void rv370_set_pcie_lanes(struct radeon_device *rdev, int lanes); |
Alex Deucher | c836a41 | 2009-12-23 10:07:50 -0500 | [diff] [blame] | 180 | extern int rv370_get_pcie_lanes(struct radeon_device *rdev); |
Daniel Vetter | 187f3da | 2010-11-28 19:06:09 +0100 | [diff] [blame] | 181 | extern void r300_set_reg_safe(struct radeon_device *rdev); |
| 182 | extern void r300_mc_program(struct radeon_device *rdev); |
| 183 | extern void r300_mc_init(struct radeon_device *rdev); |
| 184 | extern void r300_clock_startup(struct radeon_device *rdev); |
| 185 | extern int r300_mc_wait_for_idle(struct radeon_device *rdev); |
| 186 | extern int rv370_pcie_gart_init(struct radeon_device *rdev); |
| 187 | extern void rv370_pcie_gart_fini(struct radeon_device *rdev); |
| 188 | extern int rv370_pcie_gart_enable(struct radeon_device *rdev); |
| 189 | extern void rv370_pcie_gart_disable(struct radeon_device *rdev); |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 190 | extern int r300_mc_wait_for_idle(struct radeon_device *rdev); |
Pauli Nieminen | 44ca747 | 2010-02-11 17:25:47 +0000 | [diff] [blame] | 191 | |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 192 | /* |
| 193 | * r420,r423,rv410 |
| 194 | */ |
Jerome Glisse | 9f022dd | 2009-09-11 15:35:22 +0200 | [diff] [blame] | 195 | extern int r420_init(struct radeon_device *rdev); |
| 196 | extern void r420_fini(struct radeon_device *rdev); |
| 197 | extern int r420_suspend(struct radeon_device *rdev); |
| 198 | extern int r420_resume(struct radeon_device *rdev); |
Alex Deucher | ce8f537 | 2010-05-07 15:10:16 -0400 | [diff] [blame] | 199 | extern void r420_pm_init_profile(struct radeon_device *rdev); |
Daniel Vetter | 187f3da | 2010-11-28 19:06:09 +0100 | [diff] [blame] | 200 | extern u32 r420_mc_rreg(struct radeon_device *rdev, u32 reg); |
| 201 | extern void r420_mc_wreg(struct radeon_device *rdev, u32 reg, u32 v); |
| 202 | extern int r420_debugfs_pipes_info_init(struct radeon_device *rdev); |
| 203 | extern void r420_pipes_init(struct radeon_device *rdev); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 204 | |
| 205 | /* |
| 206 | * rs400,rs480 |
| 207 | */ |
Jerome Glisse | ca6ffc6 | 2009-10-01 10:20:52 +0200 | [diff] [blame] | 208 | extern int rs400_init(struct radeon_device *rdev); |
| 209 | extern void rs400_fini(struct radeon_device *rdev); |
| 210 | extern int rs400_suspend(struct radeon_device *rdev); |
| 211 | extern int rs400_resume(struct radeon_device *rdev); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 212 | void rs400_gart_tlb_flush(struct radeon_device *rdev); |
Michel Dänzer | cb65890 | 2015-01-21 17:36:35 +0900 | [diff] [blame] | 213 | uint64_t rs400_gart_get_page_entry(uint64_t addr, uint32_t flags); |
Christian König | 7f90fc9 | 2014-06-04 15:29:57 +0200 | [diff] [blame] | 214 | void rs400_gart_set_page(struct radeon_device *rdev, unsigned i, |
Michel Dänzer | cb65890 | 2015-01-21 17:36:35 +0900 | [diff] [blame] | 215 | uint64_t entry); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 216 | uint32_t rs400_mc_rreg(struct radeon_device *rdev, uint32_t reg); |
| 217 | 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] | 218 | int rs400_gart_init(struct radeon_device *rdev); |
| 219 | int rs400_gart_enable(struct radeon_device *rdev); |
| 220 | void rs400_gart_adjust_size(struct radeon_device *rdev); |
| 221 | void rs400_gart_disable(struct radeon_device *rdev); |
| 222 | void rs400_gart_fini(struct radeon_device *rdev); |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 223 | extern int rs400_mc_wait_for_idle(struct radeon_device *rdev); |
Daniel Vetter | 187f3da | 2010-11-28 19:06:09 +0100 | [diff] [blame] | 224 | |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 225 | /* |
| 226 | * rs600. |
| 227 | */ |
Jérome Glisse | 71fe289 | 2016-03-18 16:58:38 +0100 | [diff] [blame] | 228 | extern int rs600_asic_reset(struct radeon_device *rdev, bool hard); |
Jerome Glisse | c010f80 | 2009-09-30 22:09:06 +0200 | [diff] [blame] | 229 | extern int rs600_init(struct radeon_device *rdev); |
| 230 | extern void rs600_fini(struct radeon_device *rdev); |
| 231 | extern int rs600_suspend(struct radeon_device *rdev); |
| 232 | extern int rs600_resume(struct radeon_device *rdev); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 233 | int rs600_irq_set(struct radeon_device *rdev); |
Michel Dänzer | 7ed220d | 2009-08-13 11:10:51 +0200 | [diff] [blame] | 234 | int rs600_irq_process(struct radeon_device *rdev); |
Daniel Vetter | 187f3da | 2010-11-28 19:06:09 +0100 | [diff] [blame] | 235 | void rs600_irq_disable(struct radeon_device *rdev); |
Michel Dänzer | 7ed220d | 2009-08-13 11:10:51 +0200 | [diff] [blame] | 236 | u32 rs600_get_vblank_counter(struct radeon_device *rdev, int crtc); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 237 | void rs600_gart_tlb_flush(struct radeon_device *rdev); |
Michel Dänzer | cb65890 | 2015-01-21 17:36:35 +0900 | [diff] [blame] | 238 | uint64_t rs600_gart_get_page_entry(uint64_t addr, uint32_t flags); |
Christian König | 7f90fc9 | 2014-06-04 15:29:57 +0200 | [diff] [blame] | 239 | void rs600_gart_set_page(struct radeon_device *rdev, unsigned i, |
Michel Dänzer | cb65890 | 2015-01-21 17:36:35 +0900 | [diff] [blame] | 240 | uint64_t entry); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 241 | uint32_t rs600_mc_rreg(struct radeon_device *rdev, uint32_t reg); |
| 242 | 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] | 243 | void rs600_bandwidth_update(struct radeon_device *rdev); |
Alex Deucher | 429770b | 2009-12-04 15:26:55 -0500 | [diff] [blame] | 244 | void rs600_hpd_init(struct radeon_device *rdev); |
| 245 | void rs600_hpd_fini(struct radeon_device *rdev); |
| 246 | bool rs600_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd); |
| 247 | void rs600_hpd_set_polarity(struct radeon_device *rdev, |
| 248 | enum radeon_hpd_id hpd); |
Alex Deucher | 49e02b7 | 2010-04-23 17:57:27 -0400 | [diff] [blame] | 249 | extern void rs600_pm_misc(struct radeon_device *rdev); |
| 250 | extern void rs600_pm_prepare(struct radeon_device *rdev); |
| 251 | extern void rs600_pm_finish(struct radeon_device *rdev); |
Christian König | 157fa14 | 2014-05-27 16:49:20 +0200 | [diff] [blame] | 252 | extern void rs600_page_flip(struct radeon_device *rdev, int crtc, |
Michel Dänzer | c63dd75 | 2016-04-01 18:51:34 +0900 | [diff] [blame] | 253 | u64 crtc_base, bool async); |
Christian König | 157fa14 | 2014-05-27 16:49:20 +0200 | [diff] [blame] | 254 | extern bool rs600_page_flip_pending(struct radeon_device *rdev, int crtc); |
Daniel Vetter | 187f3da | 2010-11-28 19:06:09 +0100 | [diff] [blame] | 255 | void rs600_set_safe_registers(struct radeon_device *rdev); |
Alex Deucher | 3ae19b7 | 2012-02-23 17:53:37 -0500 | [diff] [blame] | 256 | extern void avivo_wait_for_vblank(struct radeon_device *rdev, int crtc); |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 257 | extern int rs600_mc_wait_for_idle(struct radeon_device *rdev); |
Alex Deucher | 429770b | 2009-12-04 15:26:55 -0500 | [diff] [blame] | 258 | |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 259 | /* |
| 260 | * rs690,rs740 |
| 261 | */ |
Jerome Glisse | 3bc6853 | 2009-10-01 09:39:24 +0200 | [diff] [blame] | 262 | int rs690_init(struct radeon_device *rdev); |
| 263 | void rs690_fini(struct radeon_device *rdev); |
| 264 | int rs690_resume(struct radeon_device *rdev); |
| 265 | int rs690_suspend(struct radeon_device *rdev); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 266 | uint32_t rs690_mc_rreg(struct radeon_device *rdev, uint32_t reg); |
| 267 | 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] | 268 | void rs690_bandwidth_update(struct radeon_device *rdev); |
Daniel Vetter | 187f3da | 2010-11-28 19:06:09 +0100 | [diff] [blame] | 269 | void rs690_line_buffer_adjust(struct radeon_device *rdev, |
| 270 | struct drm_display_mode *mode1, |
| 271 | struct drm_display_mode *mode2); |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 272 | extern int rs690_mc_wait_for_idle(struct radeon_device *rdev); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 273 | |
| 274 | /* |
| 275 | * rv515 |
| 276 | */ |
Daniel Vetter | 187f3da | 2010-11-28 19:06:09 +0100 | [diff] [blame] | 277 | struct rv515_mc_save { |
Daniel Vetter | 187f3da | 2010-11-28 19:06:09 +0100 | [diff] [blame] | 278 | u32 vga_render_control; |
| 279 | u32 vga_hdp_control; |
Alex Deucher | 6253e4c | 2012-12-12 14:30:32 -0500 | [diff] [blame] | 280 | bool crtc_enabled[2]; |
Daniel Vetter | 187f3da | 2010-11-28 19:06:09 +0100 | [diff] [blame] | 281 | }; |
Jerome Glisse | 81ee8fb | 2012-07-27 16:32:24 -0400 | [diff] [blame] | 282 | |
Jerome Glisse | 068a117 | 2009-06-17 13:28:30 +0200 | [diff] [blame] | 283 | int rv515_init(struct radeon_device *rdev); |
Jerome Glisse | d39c3b8 | 2009-09-28 18:34:43 +0200 | [diff] [blame] | 284 | void rv515_fini(struct radeon_device *rdev); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 285 | uint32_t rv515_mc_rreg(struct radeon_device *rdev, uint32_t reg); |
| 286 | 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] | 287 | void rv515_ring_start(struct radeon_device *rdev, struct radeon_ring *ring); |
Jerome Glisse | c93bb85 | 2009-07-13 21:04:08 +0200 | [diff] [blame] | 288 | void rv515_bandwidth_update(struct radeon_device *rdev); |
Jerome Glisse | d39c3b8 | 2009-09-28 18:34:43 +0200 | [diff] [blame] | 289 | int rv515_resume(struct radeon_device *rdev); |
| 290 | int rv515_suspend(struct radeon_device *rdev); |
Daniel Vetter | 187f3da | 2010-11-28 19:06:09 +0100 | [diff] [blame] | 291 | void rv515_bandwidth_avivo_update(struct radeon_device *rdev); |
| 292 | void rv515_vga_render_disable(struct radeon_device *rdev); |
| 293 | void rv515_set_safe_registers(struct radeon_device *rdev); |
| 294 | void rv515_mc_stop(struct radeon_device *rdev, struct rv515_mc_save *save); |
| 295 | void rv515_mc_resume(struct radeon_device *rdev, struct rv515_mc_save *save); |
| 296 | void rv515_clock_startup(struct radeon_device *rdev); |
| 297 | void rv515_debugfs(struct radeon_device *rdev); |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 298 | int rv515_mc_wait_for_idle(struct radeon_device *rdev); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 299 | |
| 300 | /* |
| 301 | * r520,rv530,rv560,rv570,r580 |
| 302 | */ |
Jerome Glisse | d39c3b8 | 2009-09-28 18:34:43 +0200 | [diff] [blame] | 303 | int r520_init(struct radeon_device *rdev); |
Jerome Glisse | f0ed1f6 | 2009-09-28 20:39:19 +0200 | [diff] [blame] | 304 | int r520_resume(struct radeon_device *rdev); |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 305 | int r520_mc_wait_for_idle(struct radeon_device *rdev); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 306 | |
| 307 | /* |
Jerome Glisse | 3ce0a23 | 2009-09-08 10:10:24 +1000 | [diff] [blame] | 308 | * r600,rv610,rv630,rv620,rv635,rv670,rs780,rs880 |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 309 | */ |
Jerome Glisse | 3ce0a23 | 2009-09-08 10:10:24 +1000 | [diff] [blame] | 310 | int r600_init(struct radeon_device *rdev); |
| 311 | void r600_fini(struct radeon_device *rdev); |
| 312 | int r600_suspend(struct radeon_device *rdev); |
| 313 | int r600_resume(struct radeon_device *rdev); |
Dave Airlie | 28d5204 | 2009-09-21 14:33:58 +1000 | [diff] [blame] | 314 | void r600_vga_set_state(struct radeon_device *rdev, bool state); |
Jerome Glisse | 3ce0a23 | 2009-09-08 10:10:24 +1000 | [diff] [blame] | 315 | int r600_wb_init(struct radeon_device *rdev); |
| 316 | void r600_wb_fini(struct radeon_device *rdev); |
Jerome Glisse | 3ce0a23 | 2009-09-08 10:10:24 +1000 | [diff] [blame] | 317 | void r600_pcie_gart_tlb_flush(struct radeon_device *rdev); |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 318 | uint32_t r600_pciep_rreg(struct radeon_device *rdev, uint32_t reg); |
| 319 | 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] | 320 | int r600_cs_parse(struct radeon_cs_parser *p); |
Alex Deucher | cf4ccd0 | 2011-11-18 10:19:47 -0500 | [diff] [blame] | 321 | int r600_dma_cs_parse(struct radeon_cs_parser *p); |
Jerome Glisse | 3ce0a23 | 2009-09-08 10:10:24 +1000 | [diff] [blame] | 322 | void r600_fence_ring_emit(struct radeon_device *rdev, |
| 323 | struct radeon_fence *fence); |
Christian König | 1654b81 | 2013-11-12 12:58:05 +0100 | [diff] [blame] | 324 | bool r600_semaphore_ring_emit(struct radeon_device *rdev, |
Christian König | e32eb50 | 2011-10-23 12:56:27 +0200 | [diff] [blame] | 325 | struct radeon_ring *cp, |
Christian König | 15d3332 | 2011-09-15 19:02:22 +0200 | [diff] [blame] | 326 | struct radeon_semaphore *semaphore, |
Christian König | 7b1f248 | 2011-09-23 15:11:23 +0200 | [diff] [blame] | 327 | bool emit_wait); |
Alex Deucher | 4d75658 | 2012-09-27 15:08:35 -0400 | [diff] [blame] | 328 | void r600_dma_fence_ring_emit(struct radeon_device *rdev, |
| 329 | struct radeon_fence *fence); |
Christian König | 1654b81 | 2013-11-12 12:58:05 +0100 | [diff] [blame] | 330 | bool r600_dma_semaphore_ring_emit(struct radeon_device *rdev, |
Alex Deucher | 4d75658 | 2012-09-27 15:08:35 -0400 | [diff] [blame] | 331 | struct radeon_ring *ring, |
| 332 | struct radeon_semaphore *semaphore, |
| 333 | bool emit_wait); |
| 334 | void r600_dma_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib); |
| 335 | 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] | 336 | bool r600_gfx_is_lockup(struct radeon_device *rdev, struct radeon_ring *cp); |
Jérome Glisse | 71fe289 | 2016-03-18 16:58:38 +0100 | [diff] [blame] | 337 | int r600_asic_reset(struct radeon_device *rdev, bool hard); |
Jerome Glisse | 3ce0a23 | 2009-09-08 10:10:24 +1000 | [diff] [blame] | 338 | int r600_set_surface_reg(struct radeon_device *rdev, int reg, |
| 339 | uint32_t tiling_flags, uint32_t pitch, |
| 340 | uint32_t offset, uint32_t obj_size); |
Daniel Vetter | 9479c54 | 2010-03-11 21:19:16 +0000 | [diff] [blame] | 341 | void r600_clear_surface_reg(struct radeon_device *rdev, int reg); |
Alex Deucher | f712812 | 2012-02-23 17:53:45 -0500 | [diff] [blame] | 342 | int r600_ib_test(struct radeon_device *rdev, struct radeon_ring *ring); |
Alex Deucher | 4d75658 | 2012-09-27 15:08:35 -0400 | [diff] [blame] | 343 | 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] | 344 | 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] | 345 | int r600_ring_test(struct radeon_device *rdev, struct radeon_ring *cp); |
Alex Deucher | 4d75658 | 2012-09-27 15:08:35 -0400 | [diff] [blame] | 346 | int r600_dma_ring_test(struct radeon_device *rdev, struct radeon_ring *cp); |
Christian König | 57d20a4 | 2014-09-04 20:01:53 +0200 | [diff] [blame] | 347 | struct radeon_fence *r600_copy_cpdma(struct radeon_device *rdev, |
| 348 | uint64_t src_offset, uint64_t dst_offset, |
| 349 | unsigned num_gpu_pages, |
| 350 | struct reservation_object *resv); |
| 351 | struct radeon_fence *r600_copy_dma(struct radeon_device *rdev, |
| 352 | uint64_t src_offset, uint64_t dst_offset, |
| 353 | unsigned num_gpu_pages, |
| 354 | struct reservation_object *resv); |
Alex Deucher | 429770b | 2009-12-04 15:26:55 -0500 | [diff] [blame] | 355 | void r600_hpd_init(struct radeon_device *rdev); |
| 356 | void r600_hpd_fini(struct radeon_device *rdev); |
| 357 | bool r600_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd); |
| 358 | void r600_hpd_set_polarity(struct radeon_device *rdev, |
| 359 | enum radeon_hpd_id hpd); |
Michel Dänzer | 124764f | 2014-07-31 18:43:48 +0900 | [diff] [blame] | 360 | extern void r600_mmio_hdp_flush(struct radeon_device *rdev); |
Alex Deucher | def9ba9 | 2010-04-22 12:39:58 -0400 | [diff] [blame] | 361 | extern bool r600_gui_idle(struct radeon_device *rdev); |
Alex Deucher | 49e02b7 | 2010-04-23 17:57:27 -0400 | [diff] [blame] | 362 | extern void r600_pm_misc(struct radeon_device *rdev); |
Alex Deucher | ce8f537 | 2010-05-07 15:10:16 -0400 | [diff] [blame] | 363 | extern void r600_pm_init_profile(struct radeon_device *rdev); |
| 364 | extern void rs780_pm_init_profile(struct radeon_device *rdev); |
Samuel Li | 65337e6 | 2013-04-05 17:50:53 -0400 | [diff] [blame] | 365 | extern uint32_t rs780_mc_rreg(struct radeon_device *rdev, uint32_t reg); |
| 366 | 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] | 367 | extern void r600_pm_get_dynpm_state(struct radeon_device *rdev); |
Alex Deucher | 3313e3d | 2011-01-06 18:49:34 -0500 | [diff] [blame] | 368 | extern void r600_set_pcie_lanes(struct radeon_device *rdev, int lanes); |
| 369 | extern int r600_get_pcie_lanes(struct radeon_device *rdev); |
Daniel Vetter | 3574dda | 2011-02-18 17:59:19 +0100 | [diff] [blame] | 370 | bool r600_card_posted(struct radeon_device *rdev); |
| 371 | void r600_cp_stop(struct radeon_device *rdev); |
| 372 | int r600_cp_start(struct radeon_device *rdev); |
Christian König | e32eb50 | 2011-10-23 12:56:27 +0200 | [diff] [blame] | 373 | 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] | 374 | int r600_cp_resume(struct radeon_device *rdev); |
| 375 | void r600_cp_fini(struct radeon_device *rdev); |
| 376 | int r600_count_pipe_bits(uint32_t val); |
| 377 | int r600_mc_wait_for_idle(struct radeon_device *rdev); |
| 378 | int r600_pcie_gart_init(struct radeon_device *rdev); |
| 379 | void r600_scratch_init(struct radeon_device *rdev); |
Daniel Vetter | 3574dda | 2011-02-18 17:59:19 +0100 | [diff] [blame] | 380 | int r600_init_microcode(struct radeon_device *rdev); |
Alex Deucher | ea31bf6 | 2013-12-09 19:44:30 -0500 | [diff] [blame] | 381 | u32 r600_gfx_get_rptr(struct radeon_device *rdev, |
| 382 | struct radeon_ring *ring); |
| 383 | u32 r600_gfx_get_wptr(struct radeon_device *rdev, |
| 384 | struct radeon_ring *ring); |
| 385 | void r600_gfx_set_wptr(struct radeon_device *rdev, |
| 386 | struct radeon_ring *ring); |
Alex Deucher | c6d2ac2 | 2014-10-01 09:36:57 -0400 | [diff] [blame] | 387 | int r600_get_allowed_info_register(struct radeon_device *rdev, |
| 388 | u32 reg, u32 *val); |
Daniel Vetter | 3574dda | 2011-02-18 17:59:19 +0100 | [diff] [blame] | 389 | /* r600 irq */ |
| 390 | int r600_irq_process(struct radeon_device *rdev); |
| 391 | int r600_irq_init(struct radeon_device *rdev); |
| 392 | void r600_irq_fini(struct radeon_device *rdev); |
| 393 | void r600_ih_ring_init(struct radeon_device *rdev, unsigned ring_size); |
| 394 | int r600_irq_set(struct radeon_device *rdev); |
| 395 | void r600_irq_suspend(struct radeon_device *rdev); |
| 396 | void r600_disable_interrupts(struct radeon_device *rdev); |
| 397 | void r600_rlc_stop(struct radeon_device *rdev); |
| 398 | /* r600 audio */ |
Daniel Vetter | 3574dda | 2011-02-18 17:59:19 +0100 | [diff] [blame] | 399 | void r600_audio_fini(struct radeon_device *rdev); |
Rafał Miłecki | 8f33a15 | 2014-05-16 11:36:24 +0200 | [diff] [blame] | 400 | void r600_audio_set_dto(struct drm_encoder *encoder, u32 clock); |
| 401 | void r600_hdmi_update_avi_infoframe(struct drm_encoder *encoder, void *buffer, |
| 402 | size_t size); |
| 403 | void r600_hdmi_update_ACR(struct drm_encoder *encoder, uint32_t clock); |
| 404 | void r600_hdmi_audio_workaround(struct drm_encoder *encoder); |
Daniel Vetter | 3574dda | 2011-02-18 17:59:19 +0100 | [diff] [blame] | 405 | int r600_hdmi_buffer_status_changed(struct drm_encoder *encoder); |
| 406 | void r600_hdmi_update_audio_settings(struct drm_encoder *encoder); |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 407 | int r600_mc_wait_for_idle(struct radeon_device *rdev); |
Alex Deucher | 454d2e2 | 2013-02-14 10:04:02 -0500 | [diff] [blame] | 408 | u32 r600_get_xclk(struct radeon_device *rdev); |
Alex Deucher | d041889 | 2013-01-24 10:35:23 -0500 | [diff] [blame] | 409 | uint64_t r600_get_gpu_clock_counter(struct radeon_device *rdev); |
Alex Deucher | 6bd1c38 | 2013-06-21 14:38:03 -0400 | [diff] [blame] | 410 | int rv6xx_get_temp(struct radeon_device *rdev); |
Alex Deucher | 1b9ba70 | 2013-09-05 09:52:37 -0400 | [diff] [blame] | 411 | int r600_set_uvd_clocks(struct radeon_device *rdev, u32 vclk, u32 dclk); |
Alex Deucher | 9824391 | 2013-01-16 13:13:42 -0500 | [diff] [blame] | 412 | int r600_dpm_pre_set_power_state(struct radeon_device *rdev); |
| 413 | void r600_dpm_post_set_power_state(struct radeon_device *rdev); |
Alex Deucher | a4643ba | 2013-12-19 12:18:13 -0500 | [diff] [blame] | 414 | int r600_dpm_late_enable(struct radeon_device *rdev); |
Christian König | 2e1e6da | 2013-08-13 11:56:52 +0200 | [diff] [blame] | 415 | /* r600 dma */ |
| 416 | uint32_t r600_dma_get_rptr(struct radeon_device *rdev, |
| 417 | struct radeon_ring *ring); |
| 418 | uint32_t r600_dma_get_wptr(struct radeon_device *rdev, |
| 419 | struct radeon_ring *ring); |
| 420 | void r600_dma_set_wptr(struct radeon_device *rdev, |
| 421 | struct radeon_ring *ring); |
Alex Deucher | 4a6369e | 2013-04-12 14:04:10 -0400 | [diff] [blame] | 422 | /* rv6xx dpm */ |
| 423 | int rv6xx_dpm_init(struct radeon_device *rdev); |
| 424 | int rv6xx_dpm_enable(struct radeon_device *rdev); |
| 425 | void rv6xx_dpm_disable(struct radeon_device *rdev); |
| 426 | int rv6xx_dpm_set_power_state(struct radeon_device *rdev); |
| 427 | void rv6xx_setup_asic(struct radeon_device *rdev); |
| 428 | void rv6xx_dpm_display_configuration_changed(struct radeon_device *rdev); |
| 429 | void rv6xx_dpm_fini(struct radeon_device *rdev); |
| 430 | u32 rv6xx_dpm_get_sclk(struct radeon_device *rdev, bool low); |
| 431 | u32 rv6xx_dpm_get_mclk(struct radeon_device *rdev, bool low); |
| 432 | void rv6xx_dpm_print_power_state(struct radeon_device *rdev, |
| 433 | struct radeon_ps *ps); |
Alex Deucher | 242916a | 2013-06-28 14:20:53 -0400 | [diff] [blame] | 434 | void rv6xx_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, |
| 435 | struct seq_file *m); |
Alex Deucher | f4f85a8 | 2013-07-25 20:07:25 -0400 | [diff] [blame] | 436 | int rv6xx_dpm_force_performance_level(struct radeon_device *rdev, |
| 437 | enum radeon_dpm_forced_level level); |
Alex Deucher | d0a04d3 | 2014-09-30 10:27:42 -0400 | [diff] [blame] | 438 | u32 rv6xx_dpm_get_current_sclk(struct radeon_device *rdev); |
| 439 | u32 rv6xx_dpm_get_current_mclk(struct radeon_device *rdev); |
Alex Deucher | 9d67006 | 2013-04-12 13:59:22 -0400 | [diff] [blame] | 440 | /* rs780 dpm */ |
| 441 | int rs780_dpm_init(struct radeon_device *rdev); |
| 442 | int rs780_dpm_enable(struct radeon_device *rdev); |
| 443 | void rs780_dpm_disable(struct radeon_device *rdev); |
| 444 | int rs780_dpm_set_power_state(struct radeon_device *rdev); |
| 445 | void rs780_dpm_setup_asic(struct radeon_device *rdev); |
| 446 | void rs780_dpm_display_configuration_changed(struct radeon_device *rdev); |
| 447 | void rs780_dpm_fini(struct radeon_device *rdev); |
| 448 | u32 rs780_dpm_get_sclk(struct radeon_device *rdev, bool low); |
| 449 | u32 rs780_dpm_get_mclk(struct radeon_device *rdev, bool low); |
| 450 | void rs780_dpm_print_power_state(struct radeon_device *rdev, |
| 451 | struct radeon_ps *ps); |
Alex Deucher | 444bddc | 2013-07-02 13:05:23 -0400 | [diff] [blame] | 452 | void rs780_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, |
| 453 | struct seq_file *m); |
Anthoine Bourgeois | 63580c3 | 2013-09-03 13:52:19 -0400 | [diff] [blame] | 454 | int rs780_dpm_force_performance_level(struct radeon_device *rdev, |
| 455 | enum radeon_dpm_forced_level level); |
Alex Deucher | 3c94566 | 2014-09-30 10:19:57 -0400 | [diff] [blame] | 456 | u32 rs780_dpm_get_current_sclk(struct radeon_device *rdev); |
| 457 | u32 rs780_dpm_get_current_mclk(struct radeon_device *rdev); |
Jerome Glisse | 3ce0a23 | 2009-09-08 10:10:24 +1000 | [diff] [blame] | 458 | |
Jerome Glisse | 3ce0a23 | 2009-09-08 10:10:24 +1000 | [diff] [blame] | 459 | /* |
| 460 | * rv770,rv730,rv710,rv740 |
| 461 | */ |
| 462 | int rv770_init(struct radeon_device *rdev); |
| 463 | void rv770_fini(struct radeon_device *rdev); |
| 464 | int rv770_suspend(struct radeon_device *rdev); |
| 465 | int rv770_resume(struct radeon_device *rdev); |
Daniel Vetter | 3574dda | 2011-02-18 17:59:19 +0100 | [diff] [blame] | 466 | void rv770_pm_misc(struct radeon_device *rdev); |
Michel Dänzer | c63dd75 | 2016-04-01 18:51:34 +0900 | [diff] [blame] | 467 | void rv770_page_flip(struct radeon_device *rdev, int crtc, u64 crtc_base, |
| 468 | bool async); |
Christian König | 157fa14 | 2014-05-27 16:49:20 +0200 | [diff] [blame] | 469 | bool rv770_page_flip_pending(struct radeon_device *rdev, int crtc); |
Daniel Vetter | 3574dda | 2011-02-18 17:59:19 +0100 | [diff] [blame] | 470 | void r700_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc); |
| 471 | void r700_cp_stop(struct radeon_device *rdev); |
| 472 | void r700_cp_fini(struct radeon_device *rdev); |
Christian König | 57d20a4 | 2014-09-04 20:01:53 +0200 | [diff] [blame] | 473 | struct radeon_fence *rv770_copy_dma(struct radeon_device *rdev, |
| 474 | uint64_t src_offset, uint64_t dst_offset, |
| 475 | unsigned num_gpu_pages, |
| 476 | struct reservation_object *resv); |
Alex Deucher | 454d2e2 | 2013-02-14 10:04:02 -0500 | [diff] [blame] | 477 | u32 rv770_get_xclk(struct radeon_device *rdev); |
Christian König | ef0e6e6 | 2013-04-08 12:41:35 +0200 | [diff] [blame] | 478 | 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] | 479 | int rv770_get_temp(struct radeon_device *rdev); |
Alex Deucher | 66229b2 | 2013-06-26 00:11:19 -0400 | [diff] [blame] | 480 | /* rv7xx pm */ |
| 481 | int rv770_dpm_init(struct radeon_device *rdev); |
| 482 | int rv770_dpm_enable(struct radeon_device *rdev); |
Alex Deucher | a3f1124 | 2013-12-19 13:48:36 -0500 | [diff] [blame] | 483 | int rv770_dpm_late_enable(struct radeon_device *rdev); |
Alex Deucher | 66229b2 | 2013-06-26 00:11:19 -0400 | [diff] [blame] | 484 | void rv770_dpm_disable(struct radeon_device *rdev); |
| 485 | int rv770_dpm_set_power_state(struct radeon_device *rdev); |
| 486 | void rv770_dpm_setup_asic(struct radeon_device *rdev); |
| 487 | void rv770_dpm_display_configuration_changed(struct radeon_device *rdev); |
| 488 | void rv770_dpm_fini(struct radeon_device *rdev); |
| 489 | u32 rv770_dpm_get_sclk(struct radeon_device *rdev, bool low); |
| 490 | u32 rv770_dpm_get_mclk(struct radeon_device *rdev, bool low); |
| 491 | void rv770_dpm_print_power_state(struct radeon_device *rdev, |
| 492 | struct radeon_ps *ps); |
Alex Deucher | bd210d1 | 2013-06-28 10:06:26 -0400 | [diff] [blame] | 493 | void rv770_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, |
| 494 | struct seq_file *m); |
Alex Deucher | 8b5e6b7 | 2013-07-02 18:40:35 -0400 | [diff] [blame] | 495 | int rv770_dpm_force_performance_level(struct radeon_device *rdev, |
| 496 | enum radeon_dpm_forced_level level); |
Alex Deucher | b06195d | 2013-07-08 11:49:48 -0400 | [diff] [blame] | 497 | bool rv770_dpm_vblank_too_short(struct radeon_device *rdev); |
Alex Deucher | 296deb7 | 2014-09-30 10:34:39 -0400 | [diff] [blame] | 498 | u32 rv770_dpm_get_current_sclk(struct radeon_device *rdev); |
| 499 | u32 rv770_dpm_get_current_mclk(struct radeon_device *rdev); |
Jerome Glisse | 3ce0a23 | 2009-09-08 10:10:24 +1000 | [diff] [blame] | 500 | |
Alex Deucher | bcc1c2a | 2010-01-12 17:54:34 -0500 | [diff] [blame] | 501 | /* |
| 502 | * evergreen |
| 503 | */ |
Daniel Vetter | 3574dda | 2011-02-18 17:59:19 +0100 | [diff] [blame] | 504 | struct evergreen_mc_save { |
Daniel Vetter | 3574dda | 2011-02-18 17:59:19 +0100 | [diff] [blame] | 505 | u32 vga_render_control; |
| 506 | u32 vga_hdp_control; |
Alex Deucher | 62444b7 | 2012-08-15 17:18:42 -0400 | [diff] [blame] | 507 | bool crtc_enabled[RADEON_MAX_CRTCS]; |
Daniel Vetter | 3574dda | 2011-02-18 17:59:19 +0100 | [diff] [blame] | 508 | }; |
Jerome Glisse | 81ee8fb | 2012-07-27 16:32:24 -0400 | [diff] [blame] | 509 | |
Alex Deucher | 0fcdb61 | 2010-03-24 13:20:41 -0400 | [diff] [blame] | 510 | void evergreen_pcie_gart_tlb_flush(struct radeon_device *rdev); |
Alex Deucher | bcc1c2a | 2010-01-12 17:54:34 -0500 | [diff] [blame] | 511 | int evergreen_init(struct radeon_device *rdev); |
| 512 | void evergreen_fini(struct radeon_device *rdev); |
| 513 | int evergreen_suspend(struct radeon_device *rdev); |
| 514 | int evergreen_resume(struct radeon_device *rdev); |
Alex Deucher | 123bc18 | 2013-01-24 11:37:19 -0500 | [diff] [blame] | 515 | bool evergreen_gfx_is_lockup(struct radeon_device *rdev, struct radeon_ring *cp); |
| 516 | bool evergreen_dma_is_lockup(struct radeon_device *rdev, struct radeon_ring *cp); |
Jérome Glisse | 71fe289 | 2016-03-18 16:58:38 +0100 | [diff] [blame] | 517 | int evergreen_asic_reset(struct radeon_device *rdev, bool hard); |
Alex Deucher | bcc1c2a | 2010-01-12 17:54:34 -0500 | [diff] [blame] | 518 | void evergreen_bandwidth_update(struct radeon_device *rdev); |
Alex Deucher | 1292059 | 2011-02-02 12:37:40 -0500 | [diff] [blame] | 519 | 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] | 520 | void evergreen_hpd_init(struct radeon_device *rdev); |
| 521 | void evergreen_hpd_fini(struct radeon_device *rdev); |
| 522 | bool evergreen_hpd_sense(struct radeon_device *rdev, enum radeon_hpd_id hpd); |
| 523 | void evergreen_hpd_set_polarity(struct radeon_device *rdev, |
| 524 | enum radeon_hpd_id hpd); |
Alex Deucher | 45f9a39 | 2010-03-24 13:55:51 -0400 | [diff] [blame] | 525 | u32 evergreen_get_vblank_counter(struct radeon_device *rdev, int crtc); |
| 526 | int evergreen_irq_set(struct radeon_device *rdev); |
| 527 | int evergreen_irq_process(struct radeon_device *rdev); |
Alex Deucher | cb5fcbd | 2010-05-28 19:01:35 -0400 | [diff] [blame] | 528 | extern int evergreen_cs_parse(struct radeon_cs_parser *p); |
Alex Deucher | d2ead3e | 2012-12-13 09:55:45 -0500 | [diff] [blame] | 529 | extern int evergreen_dma_cs_parse(struct radeon_cs_parser *p); |
Alex Deucher | 49e02b7 | 2010-04-23 17:57:27 -0400 | [diff] [blame] | 530 | extern void evergreen_pm_misc(struct radeon_device *rdev); |
| 531 | extern void evergreen_pm_prepare(struct radeon_device *rdev); |
| 532 | extern void evergreen_pm_finish(struct radeon_device *rdev); |
Alex Deucher | a4c9e2e | 2011-11-04 10:09:41 -0400 | [diff] [blame] | 533 | extern void sumo_pm_init_profile(struct radeon_device *rdev); |
Alex Deucher | 27810fb | 2012-10-01 19:25:11 -0400 | [diff] [blame] | 534 | extern void btc_pm_init_profile(struct radeon_device *rdev); |
Alex Deucher | 23d33ba | 2013-04-08 12:41:32 +0200 | [diff] [blame] | 535 | 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] | 536 | int evergreen_set_uvd_clocks(struct radeon_device *rdev, u32 vclk, u32 dclk); |
Christian König | 157fa14 | 2014-05-27 16:49:20 +0200 | [diff] [blame] | 537 | extern void evergreen_page_flip(struct radeon_device *rdev, int crtc, |
Michel Dänzer | c63dd75 | 2016-04-01 18:51:34 +0900 | [diff] [blame] | 538 | u64 crtc_base, bool async); |
Christian König | 157fa14 | 2014-05-27 16:49:20 +0200 | [diff] [blame] | 539 | extern bool evergreen_page_flip_pending(struct radeon_device *rdev, int crtc); |
Alex Deucher | 3ae19b7 | 2012-02-23 17:53:37 -0500 | [diff] [blame] | 540 | extern void dce4_wait_for_vblank(struct radeon_device *rdev, int crtc); |
Daniel Vetter | 3574dda | 2011-02-18 17:59:19 +0100 | [diff] [blame] | 541 | void evergreen_disable_interrupt_state(struct radeon_device *rdev); |
Alex Deucher | 89e5181 | 2012-02-23 17:53:38 -0500 | [diff] [blame] | 542 | int evergreen_mc_wait_for_idle(struct radeon_device *rdev); |
Alex Deucher | 233d1ad | 2012-12-04 15:25:59 -0500 | [diff] [blame] | 543 | void evergreen_dma_fence_ring_emit(struct radeon_device *rdev, |
| 544 | struct radeon_fence *fence); |
| 545 | void evergreen_dma_ring_ib_execute(struct radeon_device *rdev, |
| 546 | struct radeon_ib *ib); |
Christian König | 57d20a4 | 2014-09-04 20:01:53 +0200 | [diff] [blame] | 547 | struct radeon_fence *evergreen_copy_dma(struct radeon_device *rdev, |
| 548 | uint64_t src_offset, uint64_t dst_offset, |
| 549 | unsigned num_gpu_pages, |
| 550 | struct reservation_object *resv); |
Alex Deucher | 6bd1c38 | 2013-06-21 14:38:03 -0400 | [diff] [blame] | 551 | int evergreen_get_temp(struct radeon_device *rdev); |
Alex Deucher | ff60997 | 2014-10-01 09:43:38 -0400 | [diff] [blame] | 552 | int evergreen_get_allowed_info_register(struct radeon_device *rdev, |
| 553 | u32 reg, u32 *val); |
Alex Deucher | 6bd1c38 | 2013-06-21 14:38:03 -0400 | [diff] [blame] | 554 | int sumo_get_temp(struct radeon_device *rdev); |
Alex Deucher | 29a1522 | 2012-12-14 11:57:36 -0500 | [diff] [blame] | 555 | int tn_get_temp(struct radeon_device *rdev); |
Alex Deucher | dc50ba7 | 2013-06-26 00:33:35 -0400 | [diff] [blame] | 556 | int cypress_dpm_init(struct radeon_device *rdev); |
| 557 | void cypress_dpm_setup_asic(struct radeon_device *rdev); |
| 558 | int cypress_dpm_enable(struct radeon_device *rdev); |
| 559 | void cypress_dpm_disable(struct radeon_device *rdev); |
| 560 | int cypress_dpm_set_power_state(struct radeon_device *rdev); |
| 561 | void cypress_dpm_display_configuration_changed(struct radeon_device *rdev); |
| 562 | void cypress_dpm_fini(struct radeon_device *rdev); |
Alex Deucher | d0b54bd | 2013-07-08 11:56:09 -0400 | [diff] [blame] | 563 | bool cypress_dpm_vblank_too_short(struct radeon_device *rdev); |
Alex Deucher | 6596afd | 2013-06-26 00:15:24 -0400 | [diff] [blame] | 564 | int btc_dpm_init(struct radeon_device *rdev); |
| 565 | void btc_dpm_setup_asic(struct radeon_device *rdev); |
| 566 | int btc_dpm_enable(struct radeon_device *rdev); |
| 567 | void btc_dpm_disable(struct radeon_device *rdev); |
Alex Deucher | e8a9539 | 2013-01-16 14:17:23 -0500 | [diff] [blame] | 568 | int btc_dpm_pre_set_power_state(struct radeon_device *rdev); |
Alex Deucher | 6596afd | 2013-06-26 00:15:24 -0400 | [diff] [blame] | 569 | int btc_dpm_set_power_state(struct radeon_device *rdev); |
Alex Deucher | e8a9539 | 2013-01-16 14:17:23 -0500 | [diff] [blame] | 570 | void btc_dpm_post_set_power_state(struct radeon_device *rdev); |
Alex Deucher | 6596afd | 2013-06-26 00:15:24 -0400 | [diff] [blame] | 571 | void btc_dpm_fini(struct radeon_device *rdev); |
Alex Deucher | e8a9539 | 2013-01-16 14:17:23 -0500 | [diff] [blame] | 572 | u32 btc_dpm_get_sclk(struct radeon_device *rdev, bool low); |
| 573 | u32 btc_dpm_get_mclk(struct radeon_device *rdev, bool low); |
Alex Deucher | a84301c | 2013-07-08 12:03:55 -0400 | [diff] [blame] | 574 | bool btc_dpm_vblank_too_short(struct radeon_device *rdev); |
Alex Deucher | 9f3f63f | 2014-01-30 11:19:22 -0500 | [diff] [blame] | 575 | void btc_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, |
| 576 | struct seq_file *m); |
Alex Deucher | 99550ee | 2014-09-30 10:39:30 -0400 | [diff] [blame] | 577 | u32 btc_dpm_get_current_sclk(struct radeon_device *rdev); |
| 578 | u32 btc_dpm_get_current_mclk(struct radeon_device *rdev); |
Alex Deucher | 80ea2c1 | 2013-04-12 14:56:21 -0400 | [diff] [blame] | 579 | int sumo_dpm_init(struct radeon_device *rdev); |
| 580 | int sumo_dpm_enable(struct radeon_device *rdev); |
Alex Deucher | 14ec9fa | 2013-12-19 11:56:52 -0500 | [diff] [blame] | 581 | int sumo_dpm_late_enable(struct radeon_device *rdev); |
Alex Deucher | 80ea2c1 | 2013-04-12 14:56:21 -0400 | [diff] [blame] | 582 | void sumo_dpm_disable(struct radeon_device *rdev); |
Alex Deucher | 422a56b | 2013-06-25 15:40:21 -0400 | [diff] [blame] | 583 | int sumo_dpm_pre_set_power_state(struct radeon_device *rdev); |
Alex Deucher | 80ea2c1 | 2013-04-12 14:56:21 -0400 | [diff] [blame] | 584 | int sumo_dpm_set_power_state(struct radeon_device *rdev); |
Alex Deucher | 422a56b | 2013-06-25 15:40:21 -0400 | [diff] [blame] | 585 | void sumo_dpm_post_set_power_state(struct radeon_device *rdev); |
Alex Deucher | 80ea2c1 | 2013-04-12 14:56:21 -0400 | [diff] [blame] | 586 | void sumo_dpm_setup_asic(struct radeon_device *rdev); |
| 587 | void sumo_dpm_display_configuration_changed(struct radeon_device *rdev); |
| 588 | void sumo_dpm_fini(struct radeon_device *rdev); |
| 589 | u32 sumo_dpm_get_sclk(struct radeon_device *rdev, bool low); |
| 590 | u32 sumo_dpm_get_mclk(struct radeon_device *rdev, bool low); |
| 591 | void sumo_dpm_print_power_state(struct radeon_device *rdev, |
| 592 | struct radeon_ps *ps); |
Alex Deucher | fb70160 | 2013-06-28 10:47:56 -0400 | [diff] [blame] | 593 | void sumo_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, |
| 594 | struct seq_file *m); |
Alex Deucher | 5d5e559 | 2013-07-02 18:50:09 -0400 | [diff] [blame] | 595 | int sumo_dpm_force_performance_level(struct radeon_device *rdev, |
| 596 | enum radeon_dpm_forced_level level); |
Alex Deucher | 2f8e1eb | 2014-09-30 10:58:22 -0400 | [diff] [blame] | 597 | u32 sumo_dpm_get_current_sclk(struct radeon_device *rdev); |
| 598 | u32 sumo_dpm_get_current_mclk(struct radeon_device *rdev); |
Daniel Vetter | 4546b2c | 2011-02-18 17:59:21 +0100 | [diff] [blame] | 599 | |
Alex Deucher | e348762 | 2011-03-02 20:07:36 -0500 | [diff] [blame] | 600 | /* |
| 601 | * cayman |
| 602 | */ |
Alex Deucher | b40e7e1 | 2011-11-17 14:57:50 -0500 | [diff] [blame] | 603 | void cayman_fence_ring_emit(struct radeon_device *rdev, |
| 604 | struct radeon_fence *fence); |
Alex Deucher | e348762 | 2011-03-02 20:07:36 -0500 | [diff] [blame] | 605 | void cayman_pcie_gart_tlb_flush(struct radeon_device *rdev); |
| 606 | int cayman_init(struct radeon_device *rdev); |
| 607 | void cayman_fini(struct radeon_device *rdev); |
| 608 | int cayman_suspend(struct radeon_device *rdev); |
| 609 | int cayman_resume(struct radeon_device *rdev); |
Jérome Glisse | 71fe289 | 2016-03-18 16:58:38 +0100 | [diff] [blame] | 610 | int cayman_asic_reset(struct radeon_device *rdev, bool hard); |
Jerome Glisse | 721604a | 2012-01-05 22:11:05 -0500 | [diff] [blame] | 611 | void cayman_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib); |
| 612 | int cayman_vm_init(struct radeon_device *rdev); |
| 613 | void cayman_vm_fini(struct radeon_device *rdev); |
Christian König | faffaf6 | 2014-11-19 14:01:19 +0100 | [diff] [blame] | 614 | void cayman_vm_flush(struct radeon_device *rdev, struct radeon_ring *ring, |
| 615 | unsigned vm_id, uint64_t pd_addr); |
Christian König | 089a786 | 2012-08-11 11:54:05 +0200 | [diff] [blame] | 616 | uint32_t cayman_vm_page_flags(struct radeon_device *rdev, uint32_t flags); |
Jerome Glisse | 721604a | 2012-01-05 22:11:05 -0500 | [diff] [blame] | 617 | int evergreen_ib_parse(struct radeon_device *rdev, struct radeon_ib *ib); |
Alex Deucher | cd459e5 | 2012-12-13 12:17:38 -0500 | [diff] [blame] | 618 | 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] | 619 | void cayman_dma_ring_ib_execute(struct radeon_device *rdev, |
| 620 | struct radeon_ib *ib); |
Alex Deucher | 123bc18 | 2013-01-24 11:37:19 -0500 | [diff] [blame] | 621 | 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] | 622 | bool cayman_dma_is_lockup(struct radeon_device *rdev, struct radeon_ring *ring); |
Christian König | 03f62ab | 2014-07-30 21:05:17 +0200 | [diff] [blame] | 623 | |
| 624 | void cayman_dma_vm_copy_pages(struct radeon_device *rdev, |
| 625 | struct radeon_ib *ib, |
| 626 | uint64_t pe, uint64_t src, |
| 627 | unsigned count); |
| 628 | void cayman_dma_vm_write_pages(struct radeon_device *rdev, |
| 629 | struct radeon_ib *ib, |
| 630 | uint64_t pe, |
| 631 | uint64_t addr, unsigned count, |
| 632 | uint32_t incr, uint32_t flags); |
| 633 | void cayman_dma_vm_set_pages(struct radeon_device *rdev, |
| 634 | struct radeon_ib *ib, |
| 635 | uint64_t pe, |
| 636 | uint64_t addr, unsigned count, |
| 637 | uint32_t incr, uint32_t flags); |
| 638 | void cayman_dma_vm_pad_ib(struct radeon_ib *ib); |
Christian König | 24c1643 | 2013-10-30 11:51:09 -0400 | [diff] [blame] | 639 | |
Christian König | faffaf6 | 2014-11-19 14:01:19 +0100 | [diff] [blame] | 640 | void cayman_dma_vm_flush(struct radeon_device *rdev, struct radeon_ring *ring, |
| 641 | unsigned vm_id, uint64_t pd_addr); |
Alex Deucher | 45f9a39 | 2010-03-24 13:55:51 -0400 | [diff] [blame] | 642 | |
Alex Deucher | ea31bf6 | 2013-12-09 19:44:30 -0500 | [diff] [blame] | 643 | u32 cayman_gfx_get_rptr(struct radeon_device *rdev, |
| 644 | struct radeon_ring *ring); |
| 645 | u32 cayman_gfx_get_wptr(struct radeon_device *rdev, |
| 646 | struct radeon_ring *ring); |
| 647 | void cayman_gfx_set_wptr(struct radeon_device *rdev, |
| 648 | struct radeon_ring *ring); |
| 649 | uint32_t cayman_dma_get_rptr(struct radeon_device *rdev, |
| 650 | struct radeon_ring *ring); |
| 651 | uint32_t cayman_dma_get_wptr(struct radeon_device *rdev, |
| 652 | struct radeon_ring *ring); |
| 653 | void cayman_dma_set_wptr(struct radeon_device *rdev, |
| 654 | struct radeon_ring *ring); |
Alex Deucher | e66582f | 2014-10-01 09:51:29 -0400 | [diff] [blame] | 655 | int cayman_get_allowed_info_register(struct radeon_device *rdev, |
| 656 | u32 reg, u32 *val); |
Alex Deucher | ea31bf6 | 2013-12-09 19:44:30 -0500 | [diff] [blame] | 657 | |
Alex Deucher | 69e0b57 | 2013-04-12 16:42:42 -0400 | [diff] [blame] | 658 | int ni_dpm_init(struct radeon_device *rdev); |
| 659 | void ni_dpm_setup_asic(struct radeon_device *rdev); |
| 660 | int ni_dpm_enable(struct radeon_device *rdev); |
| 661 | void ni_dpm_disable(struct radeon_device *rdev); |
Alex Deucher | fee3d74 | 2013-01-16 14:35:39 -0500 | [diff] [blame] | 662 | int ni_dpm_pre_set_power_state(struct radeon_device *rdev); |
Alex Deucher | 69e0b57 | 2013-04-12 16:42:42 -0400 | [diff] [blame] | 663 | int ni_dpm_set_power_state(struct radeon_device *rdev); |
Alex Deucher | fee3d74 | 2013-01-16 14:35:39 -0500 | [diff] [blame] | 664 | void ni_dpm_post_set_power_state(struct radeon_device *rdev); |
Alex Deucher | 69e0b57 | 2013-04-12 16:42:42 -0400 | [diff] [blame] | 665 | void ni_dpm_fini(struct radeon_device *rdev); |
| 666 | u32 ni_dpm_get_sclk(struct radeon_device *rdev, bool low); |
| 667 | u32 ni_dpm_get_mclk(struct radeon_device *rdev, bool low); |
| 668 | void ni_dpm_print_power_state(struct radeon_device *rdev, |
| 669 | struct radeon_ps *ps); |
Alex Deucher | bdf0c4f | 2013-06-28 17:49:02 -0400 | [diff] [blame] | 670 | void ni_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, |
| 671 | struct seq_file *m); |
Alex Deucher | 170a47f | 2013-07-02 18:43:53 -0400 | [diff] [blame] | 672 | int ni_dpm_force_performance_level(struct radeon_device *rdev, |
| 673 | enum radeon_dpm_forced_level level); |
Alex Deucher | 76ad73e | 2013-07-08 12:09:41 -0400 | [diff] [blame] | 674 | bool ni_dpm_vblank_too_short(struct radeon_device *rdev); |
Alex Deucher | 1d633e3 | 2014-09-30 10:46:02 -0400 | [diff] [blame] | 675 | u32 ni_dpm_get_current_sclk(struct radeon_device *rdev); |
| 676 | u32 ni_dpm_get_current_mclk(struct radeon_device *rdev); |
Alex Deucher | d70229f | 2013-04-12 16:40:41 -0400 | [diff] [blame] | 677 | int trinity_dpm_init(struct radeon_device *rdev); |
| 678 | int trinity_dpm_enable(struct radeon_device *rdev); |
Alex Deucher | bda44c1 | 2013-12-19 12:03:35 -0500 | [diff] [blame] | 679 | int trinity_dpm_late_enable(struct radeon_device *rdev); |
Alex Deucher | d70229f | 2013-04-12 16:40:41 -0400 | [diff] [blame] | 680 | void trinity_dpm_disable(struct radeon_device *rdev); |
Alex Deucher | a284c48 | 2013-01-16 13:53:40 -0500 | [diff] [blame] | 681 | int trinity_dpm_pre_set_power_state(struct radeon_device *rdev); |
Alex Deucher | d70229f | 2013-04-12 16:40:41 -0400 | [diff] [blame] | 682 | int trinity_dpm_set_power_state(struct radeon_device *rdev); |
Alex Deucher | a284c48 | 2013-01-16 13:53:40 -0500 | [diff] [blame] | 683 | void trinity_dpm_post_set_power_state(struct radeon_device *rdev); |
Alex Deucher | d70229f | 2013-04-12 16:40:41 -0400 | [diff] [blame] | 684 | void trinity_dpm_setup_asic(struct radeon_device *rdev); |
| 685 | void trinity_dpm_display_configuration_changed(struct radeon_device *rdev); |
| 686 | void trinity_dpm_fini(struct radeon_device *rdev); |
| 687 | u32 trinity_dpm_get_sclk(struct radeon_device *rdev, bool low); |
| 688 | u32 trinity_dpm_get_mclk(struct radeon_device *rdev, bool low); |
| 689 | void trinity_dpm_print_power_state(struct radeon_device *rdev, |
| 690 | struct radeon_ps *ps); |
Alex Deucher | 490ab93 | 2013-06-28 12:01:38 -0400 | [diff] [blame] | 691 | void trinity_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, |
| 692 | struct seq_file *m); |
Alex Deucher | 9b5de59 | 2013-07-02 18:52:10 -0400 | [diff] [blame] | 693 | int trinity_dpm_force_performance_level(struct radeon_device *rdev, |
| 694 | enum radeon_dpm_forced_level level); |
Alex Deucher | 1187706 | 2013-09-09 19:19:52 -0400 | [diff] [blame] | 695 | void trinity_dpm_enable_bapm(struct radeon_device *rdev, bool enable); |
Alex Deucher | 7ce9cda | 2014-09-30 11:01:59 -0400 | [diff] [blame] | 696 | u32 trinity_dpm_get_current_sclk(struct radeon_device *rdev); |
| 697 | u32 trinity_dpm_get_current_mclk(struct radeon_device *rdev); |
Alex Deucher | 0fda42a | 2015-05-11 22:01:50 +0200 | [diff] [blame] | 698 | int tn_set_vce_clocks(struct radeon_device *rdev, u32 evclk, u32 ecclk); |
Alex Deucher | d70229f | 2013-04-12 16:40:41 -0400 | [diff] [blame] | 699 | |
Alex Deucher | 43b3cd9 | 2012-03-20 17:18:00 -0400 | [diff] [blame] | 700 | /* DCE6 - SI */ |
| 701 | void dce6_bandwidth_update(struct radeon_device *rdev); |
Alex Deucher | b530602 | 2013-07-31 16:51:33 -0400 | [diff] [blame] | 702 | void dce6_audio_fini(struct radeon_device *rdev); |
Alex Deucher | 43b3cd9 | 2012-03-20 17:18:00 -0400 | [diff] [blame] | 703 | |
Alex Deucher | 02779c0 | 2012-03-20 17:18:25 -0400 | [diff] [blame] | 704 | /* |
| 705 | * si |
| 706 | */ |
| 707 | void si_fence_ring_emit(struct radeon_device *rdev, |
| 708 | struct radeon_fence *fence); |
| 709 | void si_pcie_gart_tlb_flush(struct radeon_device *rdev); |
| 710 | int si_init(struct radeon_device *rdev); |
| 711 | void si_fini(struct radeon_device *rdev); |
| 712 | int si_suspend(struct radeon_device *rdev); |
| 713 | int si_resume(struct radeon_device *rdev); |
Alex Deucher | 123bc18 | 2013-01-24 11:37:19 -0500 | [diff] [blame] | 714 | bool si_gfx_is_lockup(struct radeon_device *rdev, struct radeon_ring *cp); |
| 715 | bool si_dma_is_lockup(struct radeon_device *rdev, struct radeon_ring *cp); |
Jérome Glisse | 71fe289 | 2016-03-18 16:58:38 +0100 | [diff] [blame] | 716 | int si_asic_reset(struct radeon_device *rdev, bool hard); |
Alex Deucher | 02779c0 | 2012-03-20 17:18:25 -0400 | [diff] [blame] | 717 | void si_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib); |
| 718 | int si_irq_set(struct radeon_device *rdev); |
| 719 | int si_irq_process(struct radeon_device *rdev); |
| 720 | int si_vm_init(struct radeon_device *rdev); |
| 721 | void si_vm_fini(struct radeon_device *rdev); |
Christian König | faffaf6 | 2014-11-19 14:01:19 +0100 | [diff] [blame] | 722 | void si_vm_flush(struct radeon_device *rdev, struct radeon_ring *ring, |
| 723 | unsigned vm_id, uint64_t pd_addr); |
Alex Deucher | 02779c0 | 2012-03-20 17:18:25 -0400 | [diff] [blame] | 724 | int si_ib_parse(struct radeon_device *rdev, struct radeon_ib *ib); |
Christian König | 57d20a4 | 2014-09-04 20:01:53 +0200 | [diff] [blame] | 725 | struct radeon_fence *si_copy_dma(struct radeon_device *rdev, |
| 726 | uint64_t src_offset, uint64_t dst_offset, |
| 727 | unsigned num_gpu_pages, |
| 728 | struct reservation_object *resv); |
Christian König | 03f62ab | 2014-07-30 21:05:17 +0200 | [diff] [blame] | 729 | |
| 730 | void si_dma_vm_copy_pages(struct radeon_device *rdev, |
| 731 | struct radeon_ib *ib, |
| 732 | uint64_t pe, uint64_t src, |
| 733 | unsigned count); |
| 734 | void si_dma_vm_write_pages(struct radeon_device *rdev, |
| 735 | struct radeon_ib *ib, |
| 736 | uint64_t pe, |
| 737 | uint64_t addr, unsigned count, |
| 738 | uint32_t incr, uint32_t flags); |
| 739 | void si_dma_vm_set_pages(struct radeon_device *rdev, |
| 740 | struct radeon_ib *ib, |
| 741 | uint64_t pe, |
| 742 | uint64_t addr, unsigned count, |
| 743 | uint32_t incr, uint32_t flags); |
| 744 | |
Christian König | faffaf6 | 2014-11-19 14:01:19 +0100 | [diff] [blame] | 745 | void si_dma_vm_flush(struct radeon_device *rdev, struct radeon_ring *ring, |
| 746 | unsigned vm_id, uint64_t pd_addr); |
Alex Deucher | 454d2e2 | 2013-02-14 10:04:02 -0500 | [diff] [blame] | 747 | u32 si_get_xclk(struct radeon_device *rdev); |
Alex Deucher | d041889 | 2013-01-24 10:35:23 -0500 | [diff] [blame] | 748 | uint64_t si_get_gpu_clock_counter(struct radeon_device *rdev); |
Christian König | 2539eb0 | 2013-04-08 12:41:34 +0200 | [diff] [blame] | 749 | int si_set_uvd_clocks(struct radeon_device *rdev, u32 vclk, u32 dclk); |
Christian König | b7af630 | 2015-05-11 22:01:49 +0200 | [diff] [blame] | 750 | int si_set_vce_clocks(struct radeon_device *rdev, u32 evclk, u32 ecclk); |
Alex Deucher | 6bd1c38 | 2013-06-21 14:38:03 -0400 | [diff] [blame] | 751 | int si_get_temp(struct radeon_device *rdev); |
Alex Deucher | 4af692f | 2014-10-01 10:03:31 -0400 | [diff] [blame] | 752 | int si_get_allowed_info_register(struct radeon_device *rdev, |
| 753 | u32 reg, u32 *val); |
Alex Deucher | a9e6141 | 2013-06-25 17:56:16 -0400 | [diff] [blame] | 754 | int si_dpm_init(struct radeon_device *rdev); |
| 755 | void si_dpm_setup_asic(struct radeon_device *rdev); |
| 756 | int si_dpm_enable(struct radeon_device *rdev); |
Alex Deucher | 963c115 | 2013-12-19 13:54:35 -0500 | [diff] [blame] | 757 | int si_dpm_late_enable(struct radeon_device *rdev); |
Alex Deucher | a9e6141 | 2013-06-25 17:56:16 -0400 | [diff] [blame] | 758 | void si_dpm_disable(struct radeon_device *rdev); |
| 759 | int si_dpm_pre_set_power_state(struct radeon_device *rdev); |
| 760 | int si_dpm_set_power_state(struct radeon_device *rdev); |
| 761 | void si_dpm_post_set_power_state(struct radeon_device *rdev); |
| 762 | void si_dpm_fini(struct radeon_device *rdev); |
| 763 | void si_dpm_display_configuration_changed(struct radeon_device *rdev); |
Alex Deucher | 7982128 | 2013-06-28 18:02:19 -0400 | [diff] [blame] | 764 | void si_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, |
| 765 | struct seq_file *m); |
Alex Deucher | a160a6a | 2013-07-02 18:46:28 -0400 | [diff] [blame] | 766 | int si_dpm_force_performance_level(struct radeon_device *rdev, |
| 767 | enum radeon_dpm_forced_level level); |
Alex Deucher | 5e8150a | 2015-01-07 15:29:06 -0500 | [diff] [blame] | 768 | int si_fan_ctrl_get_fan_speed_percent(struct radeon_device *rdev, |
| 769 | u32 *speed); |
| 770 | int si_fan_ctrl_set_fan_speed_percent(struct radeon_device *rdev, |
| 771 | u32 speed); |
| 772 | u32 si_fan_ctrl_get_mode(struct radeon_device *rdev); |
| 773 | void si_fan_ctrl_set_mode(struct radeon_device *rdev, u32 mode); |
Alex Deucher | ca1110b | 2014-09-30 10:50:07 -0400 | [diff] [blame] | 774 | u32 si_dpm_get_current_sclk(struct radeon_device *rdev); |
| 775 | u32 si_dpm_get_current_mclk(struct radeon_device *rdev); |
Alex Deucher | 02779c0 | 2012-03-20 17:18:25 -0400 | [diff] [blame] | 776 | |
Alex Deucher | 0672e27 | 2013-04-09 16:22:31 -0400 | [diff] [blame] | 777 | /* DCE8 - CIK */ |
| 778 | void dce8_bandwidth_update(struct radeon_device *rdev); |
| 779 | |
Alex Deucher | 44fa346 | 2012-12-18 22:17:00 -0500 | [diff] [blame] | 780 | /* |
| 781 | * cik |
| 782 | */ |
| 783 | uint64_t cik_get_gpu_clock_counter(struct radeon_device *rdev); |
Alex Deucher | 2c67912 | 2013-04-09 13:32:18 -0400 | [diff] [blame] | 784 | u32 cik_get_xclk(struct radeon_device *rdev); |
Alex Deucher | 6e2c3c0 | 2013-04-03 19:28:32 -0400 | [diff] [blame] | 785 | uint32_t cik_pciep_rreg(struct radeon_device *rdev, uint32_t reg); |
| 786 | 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] | 787 | int cik_set_uvd_clocks(struct radeon_device *rdev, u32 vclk, u32 dclk); |
Alex Deucher | 5ad6bf9 | 2013-08-22 17:09:06 -0400 | [diff] [blame] | 788 | int cik_set_vce_clocks(struct radeon_device *rdev, u32 evclk, u32 ecclk); |
Alex Deucher | 0672e27 | 2013-04-09 16:22:31 -0400 | [diff] [blame] | 789 | void cik_sdma_fence_ring_emit(struct radeon_device *rdev, |
| 790 | struct radeon_fence *fence); |
Christian König | 1654b81 | 2013-11-12 12:58:05 +0100 | [diff] [blame] | 791 | bool cik_sdma_semaphore_ring_emit(struct radeon_device *rdev, |
Alex Deucher | 0672e27 | 2013-04-09 16:22:31 -0400 | [diff] [blame] | 792 | struct radeon_ring *ring, |
| 793 | struct radeon_semaphore *semaphore, |
| 794 | bool emit_wait); |
| 795 | void cik_sdma_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib); |
Christian König | 57d20a4 | 2014-09-04 20:01:53 +0200 | [diff] [blame] | 796 | struct radeon_fence *cik_copy_dma(struct radeon_device *rdev, |
| 797 | uint64_t src_offset, uint64_t dst_offset, |
| 798 | unsigned num_gpu_pages, |
| 799 | struct reservation_object *resv); |
| 800 | struct radeon_fence *cik_copy_cpdma(struct radeon_device *rdev, |
| 801 | uint64_t src_offset, uint64_t dst_offset, |
| 802 | unsigned num_gpu_pages, |
| 803 | struct reservation_object *resv); |
Alex Deucher | 0672e27 | 2013-04-09 16:22:31 -0400 | [diff] [blame] | 804 | int cik_sdma_ring_test(struct radeon_device *rdev, struct radeon_ring *ring); |
| 805 | int cik_sdma_ib_test(struct radeon_device *rdev, struct radeon_ring *ring); |
| 806 | bool cik_sdma_is_lockup(struct radeon_device *rdev, struct radeon_ring *ring); |
| 807 | void cik_fence_gfx_ring_emit(struct radeon_device *rdev, |
| 808 | struct radeon_fence *fence); |
| 809 | void cik_fence_compute_ring_emit(struct radeon_device *rdev, |
| 810 | struct radeon_fence *fence); |
Christian König | 1654b81 | 2013-11-12 12:58:05 +0100 | [diff] [blame] | 811 | bool cik_semaphore_ring_emit(struct radeon_device *rdev, |
Alex Deucher | 0672e27 | 2013-04-09 16:22:31 -0400 | [diff] [blame] | 812 | struct radeon_ring *cp, |
| 813 | struct radeon_semaphore *semaphore, |
| 814 | bool emit_wait); |
| 815 | void cik_pcie_gart_tlb_flush(struct radeon_device *rdev); |
| 816 | int cik_init(struct radeon_device *rdev); |
| 817 | void cik_fini(struct radeon_device *rdev); |
| 818 | int cik_suspend(struct radeon_device *rdev); |
| 819 | int cik_resume(struct radeon_device *rdev); |
| 820 | bool cik_gfx_is_lockup(struct radeon_device *rdev, struct radeon_ring *cp); |
Jérome Glisse | 71fe289 | 2016-03-18 16:58:38 +0100 | [diff] [blame] | 821 | int cik_asic_reset(struct radeon_device *rdev, bool hard); |
Alex Deucher | 0672e27 | 2013-04-09 16:22:31 -0400 | [diff] [blame] | 822 | void cik_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib); |
| 823 | int cik_ring_test(struct radeon_device *rdev, struct radeon_ring *ring); |
| 824 | int cik_ib_test(struct radeon_device *rdev, struct radeon_ring *ring); |
| 825 | int cik_irq_set(struct radeon_device *rdev); |
| 826 | int cik_irq_process(struct radeon_device *rdev); |
| 827 | int cik_vm_init(struct radeon_device *rdev); |
| 828 | void cik_vm_fini(struct radeon_device *rdev); |
Christian König | faffaf6 | 2014-11-19 14:01:19 +0100 | [diff] [blame] | 829 | void cik_vm_flush(struct radeon_device *rdev, struct radeon_ring *ring, |
| 830 | unsigned vm_id, uint64_t pd_addr); |
Christian König | 03f62ab | 2014-07-30 21:05:17 +0200 | [diff] [blame] | 831 | |
| 832 | void cik_sdma_vm_copy_pages(struct radeon_device *rdev, |
| 833 | struct radeon_ib *ib, |
| 834 | uint64_t pe, uint64_t src, |
| 835 | unsigned count); |
| 836 | void cik_sdma_vm_write_pages(struct radeon_device *rdev, |
| 837 | struct radeon_ib *ib, |
| 838 | uint64_t pe, |
| 839 | uint64_t addr, unsigned count, |
| 840 | uint32_t incr, uint32_t flags); |
| 841 | void cik_sdma_vm_set_pages(struct radeon_device *rdev, |
| 842 | struct radeon_ib *ib, |
| 843 | uint64_t pe, |
| 844 | uint64_t addr, unsigned count, |
| 845 | uint32_t incr, uint32_t flags); |
| 846 | void cik_sdma_vm_pad_ib(struct radeon_ib *ib); |
| 847 | |
Christian König | faffaf6 | 2014-11-19 14:01:19 +0100 | [diff] [blame] | 848 | void cik_dma_vm_flush(struct radeon_device *rdev, struct radeon_ring *ring, |
| 849 | unsigned vm_id, uint64_t pd_addr); |
Alex Deucher | 0672e27 | 2013-04-09 16:22:31 -0400 | [diff] [blame] | 850 | int cik_ib_parse(struct radeon_device *rdev, struct radeon_ib *ib); |
Alex Deucher | ea31bf6 | 2013-12-09 19:44:30 -0500 | [diff] [blame] | 851 | u32 cik_gfx_get_rptr(struct radeon_device *rdev, |
| 852 | struct radeon_ring *ring); |
| 853 | u32 cik_gfx_get_wptr(struct radeon_device *rdev, |
| 854 | struct radeon_ring *ring); |
| 855 | void cik_gfx_set_wptr(struct radeon_device *rdev, |
| 856 | struct radeon_ring *ring); |
| 857 | u32 cik_compute_get_rptr(struct radeon_device *rdev, |
| 858 | struct radeon_ring *ring); |
| 859 | u32 cik_compute_get_wptr(struct radeon_device *rdev, |
| 860 | struct radeon_ring *ring); |
| 861 | void cik_compute_set_wptr(struct radeon_device *rdev, |
| 862 | struct radeon_ring *ring); |
| 863 | u32 cik_sdma_get_rptr(struct radeon_device *rdev, |
| 864 | struct radeon_ring *ring); |
| 865 | u32 cik_sdma_get_wptr(struct radeon_device *rdev, |
| 866 | struct radeon_ring *ring); |
| 867 | void cik_sdma_set_wptr(struct radeon_device *rdev, |
| 868 | struct radeon_ring *ring); |
Alex Deucher | 286d9cc | 2013-06-21 15:50:47 -0400 | [diff] [blame] | 869 | int ci_get_temp(struct radeon_device *rdev); |
| 870 | int kv_get_temp(struct radeon_device *rdev); |
Alex Deucher | 353eec2 | 2014-10-01 11:18:46 -0400 | [diff] [blame] | 871 | int cik_get_allowed_info_register(struct radeon_device *rdev, |
| 872 | u32 reg, u32 *val); |
Alex Deucher | 44fa346 | 2012-12-18 22:17:00 -0500 | [diff] [blame] | 873 | |
Alex Deucher | cc8dbbb | 2013-08-14 01:03:41 -0400 | [diff] [blame] | 874 | int ci_dpm_init(struct radeon_device *rdev); |
| 875 | int ci_dpm_enable(struct radeon_device *rdev); |
Alex Deucher | 9020842 | 2013-12-19 13:59:46 -0500 | [diff] [blame] | 876 | int ci_dpm_late_enable(struct radeon_device *rdev); |
Alex Deucher | cc8dbbb | 2013-08-14 01:03:41 -0400 | [diff] [blame] | 877 | void ci_dpm_disable(struct radeon_device *rdev); |
| 878 | int ci_dpm_pre_set_power_state(struct radeon_device *rdev); |
| 879 | int ci_dpm_set_power_state(struct radeon_device *rdev); |
| 880 | void ci_dpm_post_set_power_state(struct radeon_device *rdev); |
| 881 | void ci_dpm_setup_asic(struct radeon_device *rdev); |
| 882 | void ci_dpm_display_configuration_changed(struct radeon_device *rdev); |
| 883 | void ci_dpm_fini(struct radeon_device *rdev); |
| 884 | u32 ci_dpm_get_sclk(struct radeon_device *rdev, bool low); |
| 885 | u32 ci_dpm_get_mclk(struct radeon_device *rdev, bool low); |
| 886 | void ci_dpm_print_power_state(struct radeon_device *rdev, |
| 887 | struct radeon_ps *ps); |
Alex Deucher | 94b4adc | 2013-07-15 17:34:33 -0400 | [diff] [blame] | 888 | void ci_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, |
| 889 | struct seq_file *m); |
Alex Deucher | 89536fd | 2013-07-15 18:14:24 -0400 | [diff] [blame] | 890 | int ci_dpm_force_performance_level(struct radeon_device *rdev, |
| 891 | enum radeon_dpm_forced_level level); |
Alex Deucher | 5496131 | 2013-07-15 18:24:31 -0400 | [diff] [blame] | 892 | bool ci_dpm_vblank_too_short(struct radeon_device *rdev); |
Alex Deucher | 942bdf7 | 2013-08-09 10:05:24 -0400 | [diff] [blame] | 893 | void ci_dpm_powergate_uvd(struct radeon_device *rdev, bool gate); |
Alex Deucher | dbbd3c8 | 2014-09-30 10:54:05 -0400 | [diff] [blame] | 894 | u32 ci_dpm_get_current_sclk(struct radeon_device *rdev); |
| 895 | u32 ci_dpm_get_current_mclk(struct radeon_device *rdev); |
Alex Deucher | cc8dbbb | 2013-08-14 01:03:41 -0400 | [diff] [blame] | 896 | |
Oleg Chernovskiy | 36689e5 | 2014-12-08 00:10:46 +0300 | [diff] [blame] | 897 | int ci_fan_ctrl_get_fan_speed_percent(struct radeon_device *rdev, |
| 898 | u32 *speed); |
| 899 | int ci_fan_ctrl_set_fan_speed_percent(struct radeon_device *rdev, |
| 900 | u32 speed); |
| 901 | u32 ci_fan_ctrl_get_mode(struct radeon_device *rdev); |
| 902 | void ci_fan_ctrl_set_mode(struct radeon_device *rdev, u32 mode); |
| 903 | |
Alex Deucher | 41a524a | 2013-08-14 01:01:40 -0400 | [diff] [blame] | 904 | int kv_dpm_init(struct radeon_device *rdev); |
| 905 | int kv_dpm_enable(struct radeon_device *rdev); |
Alex Deucher | d8852c3 | 2013-12-19 14:03:36 -0500 | [diff] [blame] | 906 | int kv_dpm_late_enable(struct radeon_device *rdev); |
Alex Deucher | 41a524a | 2013-08-14 01:01:40 -0400 | [diff] [blame] | 907 | void kv_dpm_disable(struct radeon_device *rdev); |
| 908 | int kv_dpm_pre_set_power_state(struct radeon_device *rdev); |
| 909 | int kv_dpm_set_power_state(struct radeon_device *rdev); |
| 910 | void kv_dpm_post_set_power_state(struct radeon_device *rdev); |
| 911 | void kv_dpm_setup_asic(struct radeon_device *rdev); |
| 912 | void kv_dpm_display_configuration_changed(struct radeon_device *rdev); |
| 913 | void kv_dpm_fini(struct radeon_device *rdev); |
| 914 | u32 kv_dpm_get_sclk(struct radeon_device *rdev, bool low); |
| 915 | u32 kv_dpm_get_mclk(struct radeon_device *rdev, bool low); |
| 916 | void kv_dpm_print_power_state(struct radeon_device *rdev, |
| 917 | struct radeon_ps *ps); |
Alex Deucher | ae3e40e | 2013-07-18 16:39:53 -0400 | [diff] [blame] | 918 | void kv_dpm_debugfs_print_current_performance_level(struct radeon_device *rdev, |
| 919 | struct seq_file *m); |
Alex Deucher | 2b4c802 | 2013-07-18 16:48:46 -0400 | [diff] [blame] | 920 | int kv_dpm_force_performance_level(struct radeon_device *rdev, |
| 921 | enum radeon_dpm_forced_level level); |
Alex Deucher | 77df508 | 2013-08-09 10:02:40 -0400 | [diff] [blame] | 922 | void kv_dpm_powergate_uvd(struct radeon_device *rdev, bool gate); |
Alex Deucher | b7a5ae9 | 2013-09-09 19:33:08 -0400 | [diff] [blame] | 923 | void kv_dpm_enable_bapm(struct radeon_device *rdev, bool enable); |
Alex Deucher | 9b23bad | 2014-09-30 11:21:23 -0400 | [diff] [blame] | 924 | u32 kv_dpm_get_current_sclk(struct radeon_device *rdev); |
| 925 | u32 kv_dpm_get_current_mclk(struct radeon_device *rdev); |
Alex Deucher | 41a524a | 2013-08-14 01:01:40 -0400 | [diff] [blame] | 926 | |
Christian König | e409b12 | 2013-08-13 11:56:53 +0200 | [diff] [blame] | 927 | /* uvd v1.0 */ |
| 928 | uint32_t uvd_v1_0_get_rptr(struct radeon_device *rdev, |
| 929 | struct radeon_ring *ring); |
| 930 | uint32_t uvd_v1_0_get_wptr(struct radeon_device *rdev, |
| 931 | struct radeon_ring *ring); |
| 932 | void uvd_v1_0_set_wptr(struct radeon_device *rdev, |
| 933 | struct radeon_ring *ring); |
Christian König | 856754c | 2013-04-16 22:11:22 +0200 | [diff] [blame] | 934 | int uvd_v1_0_resume(struct radeon_device *rdev); |
Christian König | e409b12 | 2013-08-13 11:56:53 +0200 | [diff] [blame] | 935 | |
| 936 | int uvd_v1_0_init(struct radeon_device *rdev); |
| 937 | void uvd_v1_0_fini(struct radeon_device *rdev); |
| 938 | int uvd_v1_0_start(struct radeon_device *rdev); |
| 939 | void uvd_v1_0_stop(struct radeon_device *rdev); |
| 940 | |
| 941 | int uvd_v1_0_ring_test(struct radeon_device *rdev, struct radeon_ring *ring); |
Christian König | 856754c | 2013-04-16 22:11:22 +0200 | [diff] [blame] | 942 | void uvd_v1_0_fence_emit(struct radeon_device *rdev, |
| 943 | struct radeon_fence *fence); |
Christian König | e409b12 | 2013-08-13 11:56:53 +0200 | [diff] [blame] | 944 | int uvd_v1_0_ib_test(struct radeon_device *rdev, struct radeon_ring *ring); |
Christian König | 1654b81 | 2013-11-12 12:58:05 +0100 | [diff] [blame] | 945 | bool uvd_v1_0_semaphore_emit(struct radeon_device *rdev, |
Christian König | e409b12 | 2013-08-13 11:56:53 +0200 | [diff] [blame] | 946 | struct radeon_ring *ring, |
| 947 | struct radeon_semaphore *semaphore, |
| 948 | bool emit_wait); |
| 949 | void uvd_v1_0_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib); |
| 950 | |
| 951 | /* uvd v2.2 */ |
| 952 | int uvd_v2_2_resume(struct radeon_device *rdev); |
| 953 | void uvd_v2_2_fence_emit(struct radeon_device *rdev, |
| 954 | struct radeon_fence *fence); |
Christian König | 013ead4 | 2015-05-01 12:34:12 +0200 | [diff] [blame] | 955 | bool uvd_v2_2_semaphore_emit(struct radeon_device *rdev, |
| 956 | struct radeon_ring *ring, |
| 957 | struct radeon_semaphore *semaphore, |
| 958 | bool emit_wait); |
Christian König | e409b12 | 2013-08-13 11:56:53 +0200 | [diff] [blame] | 959 | |
| 960 | /* uvd v3.1 */ |
Christian König | 1654b81 | 2013-11-12 12:58:05 +0100 | [diff] [blame] | 961 | bool uvd_v3_1_semaphore_emit(struct radeon_device *rdev, |
Christian König | e409b12 | 2013-08-13 11:56:53 +0200 | [diff] [blame] | 962 | struct radeon_ring *ring, |
| 963 | struct radeon_semaphore *semaphore, |
| 964 | bool emit_wait); |
| 965 | |
| 966 | /* uvd v4.2 */ |
| 967 | int uvd_v4_2_resume(struct radeon_device *rdev); |
| 968 | |
Christian König | d93f793 | 2013-05-23 12:10:04 +0200 | [diff] [blame] | 969 | /* vce v1.0 */ |
| 970 | uint32_t vce_v1_0_get_rptr(struct radeon_device *rdev, |
| 971 | struct radeon_ring *ring); |
| 972 | uint32_t vce_v1_0_get_wptr(struct radeon_device *rdev, |
| 973 | struct radeon_ring *ring); |
| 974 | void vce_v1_0_set_wptr(struct radeon_device *rdev, |
| 975 | struct radeon_ring *ring); |
Christian König | a918efa | 2015-05-11 22:01:53 +0200 | [diff] [blame] | 976 | int vce_v1_0_load_fw(struct radeon_device *rdev, uint32_t *data); |
| 977 | unsigned vce_v1_0_bo_size(struct radeon_device *rdev); |
| 978 | int vce_v1_0_resume(struct radeon_device *rdev); |
Christian König | d93f793 | 2013-05-23 12:10:04 +0200 | [diff] [blame] | 979 | int vce_v1_0_init(struct radeon_device *rdev); |
| 980 | int vce_v1_0_start(struct radeon_device *rdev); |
| 981 | |
| 982 | /* vce v2.0 */ |
Christian König | fa0cf2f | 2015-05-11 22:01:47 +0200 | [diff] [blame] | 983 | unsigned vce_v2_0_bo_size(struct radeon_device *rdev); |
Christian König | d93f793 | 2013-05-23 12:10:04 +0200 | [diff] [blame] | 984 | int vce_v2_0_resume(struct radeon_device *rdev); |
| 985 | |
Jerome Glisse | 771fe6b | 2009-06-05 14:42:42 +0200 | [diff] [blame] | 986 | #endif |