diff options
author | Jerome Glisse <jglisse@redhat.com> | 2009-09-14 12:29:49 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-09-14 18:53:14 -0400 |
commit | 4aac047323e3082d0866b8ad3784236632105af4 (patch) | |
tree | af4c118e42b9ea55c961c4f5bbb02998dc2cc4fe /drivers/gpu/drm/radeon/radeon_asic.h | |
parent | 21f9a437222e92adb3abc68584a5f04801b92739 (diff) |
drm/radeon/kms: clear confusion in GART init/deinit path
GART static one time initialization was mixed up with GART
enabling/disabling which could happen several time for instance
during suspend/resume cycles. This patch splits all GART
handling into 4 differents function. gart_init is for one
time initialization, gart_deinit is called upon module unload
to free resources allocated by gart_init, gart_enable enable
the GART and is intented to be call after first initialization
and at each resume cycle or reset cycle. Finaly gart_disable
stop the GART and is intended to be call at suspend time or
when unloading the module.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_asic.h')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_asic.h | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_asic.h b/drivers/gpu/drm/radeon/radeon_asic.h index 8f27be31e094..5f2a9e6f12c5 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.h +++ b/drivers/gpu/drm/radeon/radeon_asic.h | |||
@@ -53,7 +53,9 @@ void r100_mc_fini(struct radeon_device *rdev); | |||
53 | u32 r100_get_vblank_counter(struct radeon_device *rdev, int crtc); | 53 | u32 r100_get_vblank_counter(struct radeon_device *rdev, int crtc); |
54 | int r100_wb_init(struct radeon_device *rdev); | 54 | int r100_wb_init(struct radeon_device *rdev); |
55 | void r100_wb_fini(struct radeon_device *rdev); | 55 | void r100_wb_fini(struct radeon_device *rdev); |
56 | int r100_gart_enable(struct radeon_device *rdev); | 56 | int r100_pci_gart_init(struct radeon_device *rdev); |
57 | void r100_pci_gart_fini(struct radeon_device *rdev); | ||
58 | int r100_pci_gart_enable(struct radeon_device *rdev); | ||
57 | void r100_pci_gart_disable(struct radeon_device *rdev); | 59 | void r100_pci_gart_disable(struct radeon_device *rdev); |
58 | void r100_pci_gart_tlb_flush(struct radeon_device *rdev); | 60 | void r100_pci_gart_tlb_flush(struct radeon_device *rdev); |
59 | int r100_pci_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr); | 61 | int r100_pci_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr); |
@@ -92,7 +94,9 @@ static struct radeon_asic r100_asic = { | |||
92 | .mc_fini = &r100_mc_fini, | 94 | .mc_fini = &r100_mc_fini, |
93 | .wb_init = &r100_wb_init, | 95 | .wb_init = &r100_wb_init, |
94 | .wb_fini = &r100_wb_fini, | 96 | .wb_fini = &r100_wb_fini, |
95 | .gart_enable = &r100_gart_enable, | 97 | .gart_init = &r100_pci_gart_init, |
98 | .gart_fini = &r100_pci_gart_fini, | ||
99 | .gart_enable = &r100_pci_gart_enable, | ||
96 | .gart_disable = &r100_pci_gart_disable, | 100 | .gart_disable = &r100_pci_gart_disable, |
97 | .gart_tlb_flush = &r100_pci_gart_tlb_flush, | 101 | .gart_tlb_flush = &r100_pci_gart_tlb_flush, |
98 | .gart_set_page = &r100_pci_gart_set_page, | 102 | .gart_set_page = &r100_pci_gart_set_page, |
@@ -135,7 +139,9 @@ void r300_ring_start(struct radeon_device *rdev); | |||
135 | void r300_fence_ring_emit(struct radeon_device *rdev, | 139 | void r300_fence_ring_emit(struct radeon_device *rdev, |
136 | struct radeon_fence *fence); | 140 | struct radeon_fence *fence); |
137 | int r300_cs_parse(struct radeon_cs_parser *p); | 141 | int r300_cs_parse(struct radeon_cs_parser *p); |
138 | int r300_gart_enable(struct radeon_device *rdev); | 142 | int rv370_pcie_gart_init(struct radeon_device *rdev); |
143 | void rv370_pcie_gart_fini(struct radeon_device *rdev); | ||
144 | int rv370_pcie_gart_enable(struct radeon_device *rdev); | ||
139 | void rv370_pcie_gart_disable(struct radeon_device *rdev); | 145 | void rv370_pcie_gart_disable(struct radeon_device *rdev); |
140 | void rv370_pcie_gart_tlb_flush(struct radeon_device *rdev); | 146 | void rv370_pcie_gart_tlb_flush(struct radeon_device *rdev); |
141 | int rv370_pcie_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr); | 147 | int rv370_pcie_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr); |
@@ -157,7 +163,9 @@ static struct radeon_asic r300_asic = { | |||
157 | .mc_fini = &r300_mc_fini, | 163 | .mc_fini = &r300_mc_fini, |
158 | .wb_init = &r100_wb_init, | 164 | .wb_init = &r100_wb_init, |
159 | .wb_fini = &r100_wb_fini, | 165 | .wb_fini = &r100_wb_fini, |
160 | .gart_enable = &r300_gart_enable, | 166 | .gart_init = &r100_pci_gart_init, |
167 | .gart_fini = &r100_pci_gart_fini, | ||
168 | .gart_enable = &r100_pci_gart_enable, | ||
161 | .gart_disable = &r100_pci_gart_disable, | 169 | .gart_disable = &r100_pci_gart_disable, |
162 | .gart_tlb_flush = &r100_pci_gart_tlb_flush, | 170 | .gart_tlb_flush = &r100_pci_gart_tlb_flush, |
163 | .gart_set_page = &r100_pci_gart_set_page, | 171 | .gart_set_page = &r100_pci_gart_set_page, |
@@ -205,8 +213,8 @@ static struct radeon_asic r420_asic = { | |||
205 | .mc_fini = NULL, | 213 | .mc_fini = NULL, |
206 | .wb_init = NULL, | 214 | .wb_init = NULL, |
207 | .wb_fini = NULL, | 215 | .wb_fini = NULL, |
208 | .gart_enable = &r300_gart_enable, | 216 | .gart_enable = NULL, |
209 | .gart_disable = &rv370_pcie_gart_disable, | 217 | .gart_disable = NULL, |
210 | .gart_tlb_flush = &rv370_pcie_gart_tlb_flush, | 218 | .gart_tlb_flush = &rv370_pcie_gart_tlb_flush, |
211 | .gart_set_page = &rv370_pcie_gart_set_page, | 219 | .gart_set_page = &rv370_pcie_gart_set_page, |
212 | .cp_init = NULL, | 220 | .cp_init = NULL, |
@@ -242,6 +250,8 @@ void rs400_errata(struct radeon_device *rdev); | |||
242 | void rs400_vram_info(struct radeon_device *rdev); | 250 | void rs400_vram_info(struct radeon_device *rdev); |
243 | int rs400_mc_init(struct radeon_device *rdev); | 251 | int rs400_mc_init(struct radeon_device *rdev); |
244 | void rs400_mc_fini(struct radeon_device *rdev); | 252 | void rs400_mc_fini(struct radeon_device *rdev); |
253 | int rs400_gart_init(struct radeon_device *rdev); | ||
254 | void rs400_gart_fini(struct radeon_device *rdev); | ||
245 | int rs400_gart_enable(struct radeon_device *rdev); | 255 | int rs400_gart_enable(struct radeon_device *rdev); |
246 | void rs400_gart_disable(struct radeon_device *rdev); | 256 | void rs400_gart_disable(struct radeon_device *rdev); |
247 | void rs400_gart_tlb_flush(struct radeon_device *rdev); | 257 | void rs400_gart_tlb_flush(struct radeon_device *rdev); |
@@ -257,6 +267,8 @@ static struct radeon_asic rs400_asic = { | |||
257 | .mc_fini = &rs400_mc_fini, | 267 | .mc_fini = &rs400_mc_fini, |
258 | .wb_init = &r100_wb_init, | 268 | .wb_init = &r100_wb_init, |
259 | .wb_fini = &r100_wb_fini, | 269 | .wb_fini = &r100_wb_fini, |
270 | .gart_init = &rs400_gart_init, | ||
271 | .gart_fini = &rs400_gart_fini, | ||
260 | .gart_enable = &rs400_gart_enable, | 272 | .gart_enable = &rs400_gart_enable, |
261 | .gart_disable = &rs400_gart_disable, | 273 | .gart_disable = &rs400_gart_disable, |
262 | .gart_tlb_flush = &rs400_gart_tlb_flush, | 274 | .gart_tlb_flush = &rs400_gart_tlb_flush, |
@@ -298,6 +310,8 @@ void rs600_mc_fini(struct radeon_device *rdev); | |||
298 | int rs600_irq_set(struct radeon_device *rdev); | 310 | int rs600_irq_set(struct radeon_device *rdev); |
299 | int rs600_irq_process(struct radeon_device *rdev); | 311 | int rs600_irq_process(struct radeon_device *rdev); |
300 | u32 rs600_get_vblank_counter(struct radeon_device *rdev, int crtc); | 312 | u32 rs600_get_vblank_counter(struct radeon_device *rdev, int crtc); |
313 | int rs600_gart_init(struct radeon_device *rdev); | ||
314 | void rs600_gart_fini(struct radeon_device *rdev); | ||
301 | int rs600_gart_enable(struct radeon_device *rdev); | 315 | int rs600_gart_enable(struct radeon_device *rdev); |
302 | void rs600_gart_disable(struct radeon_device *rdev); | 316 | void rs600_gart_disable(struct radeon_device *rdev); |
303 | void rs600_gart_tlb_flush(struct radeon_device *rdev); | 317 | void rs600_gart_tlb_flush(struct radeon_device *rdev); |
@@ -314,6 +328,8 @@ static struct radeon_asic rs600_asic = { | |||
314 | .mc_fini = &rs600_mc_fini, | 328 | .mc_fini = &rs600_mc_fini, |
315 | .wb_init = &r100_wb_init, | 329 | .wb_init = &r100_wb_init, |
316 | .wb_fini = &r100_wb_fini, | 330 | .wb_fini = &r100_wb_fini, |
331 | .gart_init = &rs600_gart_init, | ||
332 | .gart_fini = &rs600_gart_fini, | ||
317 | .gart_enable = &rs600_gart_enable, | 333 | .gart_enable = &rs600_gart_enable, |
318 | .gart_disable = &rs600_gart_disable, | 334 | .gart_disable = &rs600_gart_disable, |
319 | .gart_tlb_flush = &rs600_gart_tlb_flush, | 335 | .gart_tlb_flush = &rs600_gart_tlb_flush, |
@@ -361,6 +377,8 @@ static struct radeon_asic rs690_asic = { | |||
361 | .mc_fini = &rs690_mc_fini, | 377 | .mc_fini = &rs690_mc_fini, |
362 | .wb_init = &r100_wb_init, | 378 | .wb_init = &r100_wb_init, |
363 | .wb_fini = &r100_wb_fini, | 379 | .wb_fini = &r100_wb_fini, |
380 | .gart_init = &rs400_gart_init, | ||
381 | .gart_fini = &rs400_gart_fini, | ||
364 | .gart_enable = &rs400_gart_enable, | 382 | .gart_enable = &rs400_gart_enable, |
365 | .gart_disable = &rs400_gart_disable, | 383 | .gart_disable = &rs400_gart_disable, |
366 | .gart_tlb_flush = &rs400_gart_tlb_flush, | 384 | .gart_tlb_flush = &rs400_gart_tlb_flush, |
@@ -415,7 +433,9 @@ static struct radeon_asic rv515_asic = { | |||
415 | .mc_fini = &rv515_mc_fini, | 433 | .mc_fini = &rv515_mc_fini, |
416 | .wb_init = &r100_wb_init, | 434 | .wb_init = &r100_wb_init, |
417 | .wb_fini = &r100_wb_fini, | 435 | .wb_fini = &r100_wb_fini, |
418 | .gart_enable = &r300_gart_enable, | 436 | .gart_init = &rv370_pcie_gart_init, |
437 | .gart_fini = &rv370_pcie_gart_fini, | ||
438 | .gart_enable = &rv370_pcie_gart_enable, | ||
419 | .gart_disable = &rv370_pcie_gart_disable, | 439 | .gart_disable = &rv370_pcie_gart_disable, |
420 | .gart_tlb_flush = &rv370_pcie_gart_tlb_flush, | 440 | .gart_tlb_flush = &rv370_pcie_gart_tlb_flush, |
421 | .gart_set_page = &rv370_pcie_gart_set_page, | 441 | .gart_set_page = &rv370_pcie_gart_set_page, |
@@ -462,7 +482,9 @@ static struct radeon_asic r520_asic = { | |||
462 | .mc_fini = &r520_mc_fini, | 482 | .mc_fini = &r520_mc_fini, |
463 | .wb_init = &r100_wb_init, | 483 | .wb_init = &r100_wb_init, |
464 | .wb_fini = &r100_wb_fini, | 484 | .wb_fini = &r100_wb_fini, |
465 | .gart_enable = &r300_gart_enable, | 485 | .gart_init = &rv370_pcie_gart_init, |
486 | .gart_fini = &rv370_pcie_gart_fini, | ||
487 | .gart_enable = &rv370_pcie_gart_enable, | ||
466 | .gart_disable = &rv370_pcie_gart_disable, | 488 | .gart_disable = &rv370_pcie_gart_disable, |
467 | .gart_tlb_flush = &rv370_pcie_gart_tlb_flush, | 489 | .gart_tlb_flush = &rv370_pcie_gart_tlb_flush, |
468 | .gart_set_page = &rv370_pcie_gart_set_page, | 490 | .gart_set_page = &rv370_pcie_gart_set_page, |