aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_asic.h
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2009-09-07 20:10:24 -0400
committerDave Airlie <airlied@redhat.com>2009-09-07 21:15:52 -0400
commit3ce0a23d2d253185df24e22e3d5f89800bb3dd1c (patch)
tree4b4defdbe33aec7317101cce0f89c33083f8d17b /drivers/gpu/drm/radeon/radeon_asic.h
parent4ce001abafafe77e5dd943d1480fc9f87894e96f (diff)
drm/radeon/kms: add r600 KMS support
This adds the r600 KMS + CS support to the Linux kernel. The r600 TTM support is quite basic and still needs more work esp around using interrupts, but the polled fencing should work okay for now. Also currently TTM is using memcpy to do VRAM moves, the code is here to use a 3D blit to do this, but isn't fully debugged yet. Authors: Alex Deucher <alexdeucher@gmail.com> Dave Airlie <airlied@redhat.com> Jerome Glisse <jglisse@redhat.com> 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.h156
1 files changed, 155 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_asic.h b/drivers/gpu/drm/radeon/radeon_asic.h
index c9cbd8ae1f95..e87bb915a6de 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.h
+++ b/drivers/gpu/drm/radeon/radeon_asic.h
@@ -60,6 +60,7 @@ int r100_pci_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr);
60int r100_cp_init(struct radeon_device *rdev, unsigned ring_size); 60int r100_cp_init(struct radeon_device *rdev, unsigned ring_size);
61void r100_cp_fini(struct radeon_device *rdev); 61void r100_cp_fini(struct radeon_device *rdev);
62void r100_cp_disable(struct radeon_device *rdev); 62void r100_cp_disable(struct radeon_device *rdev);
63void r100_cp_commit(struct radeon_device *rdev);
63void r100_ring_start(struct radeon_device *rdev); 64void r100_ring_start(struct radeon_device *rdev);
64int r100_irq_set(struct radeon_device *rdev); 65int r100_irq_set(struct radeon_device *rdev);
65int r100_irq_process(struct radeon_device *rdev); 66int r100_irq_process(struct radeon_device *rdev);
@@ -78,6 +79,9 @@ int r100_set_surface_reg(struct radeon_device *rdev, int reg,
78 uint32_t offset, uint32_t obj_size); 79 uint32_t offset, uint32_t obj_size);
79int r100_clear_surface_reg(struct radeon_device *rdev, int reg); 80int r100_clear_surface_reg(struct radeon_device *rdev, int reg);
80void r100_bandwidth_update(struct radeon_device *rdev); 81void r100_bandwidth_update(struct radeon_device *rdev);
82void r100_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib);
83int r100_ib_test(struct radeon_device *rdev);
84int r100_ring_test(struct radeon_device *rdev);
81 85
82static struct radeon_asic r100_asic = { 86static struct radeon_asic r100_asic = {
83 .init = &r100_init, 87 .init = &r100_init,
@@ -95,7 +99,11 @@ static struct radeon_asic r100_asic = {
95 .cp_init = &r100_cp_init, 99 .cp_init = &r100_cp_init,
96 .cp_fini = &r100_cp_fini, 100 .cp_fini = &r100_cp_fini,
97 .cp_disable = &r100_cp_disable, 101 .cp_disable = &r100_cp_disable,
102 .cp_commit = &r100_cp_commit,
98 .ring_start = &r100_ring_start, 103 .ring_start = &r100_ring_start,
104 .ring_test = &r100_ring_test,
105 .ring_ib_execute = &r100_ring_ib_execute,
106 .ib_test = &r100_ib_test,
99 .irq_set = &r100_irq_set, 107 .irq_set = &r100_irq_set,
100 .irq_process = &r100_irq_process, 108 .irq_process = &r100_irq_process,
101 .get_vblank_counter = &r100_get_vblank_counter, 109 .get_vblank_counter = &r100_get_vblank_counter,
@@ -156,7 +164,11 @@ static struct radeon_asic r300_asic = {
156 .cp_init = &r100_cp_init, 164 .cp_init = &r100_cp_init,
157 .cp_fini = &r100_cp_fini, 165 .cp_fini = &r100_cp_fini,
158 .cp_disable = &r100_cp_disable, 166 .cp_disable = &r100_cp_disable,
167 .cp_commit = &r100_cp_commit,
159 .ring_start = &r300_ring_start, 168 .ring_start = &r300_ring_start,
169 .ring_test = &r100_ring_test,
170 .ring_ib_execute = &r100_ring_ib_execute,
171 .ib_test = &r100_ib_test,
160 .irq_set = &r100_irq_set, 172 .irq_set = &r100_irq_set,
161 .irq_process = &r100_irq_process, 173 .irq_process = &r100_irq_process,
162 .get_vblank_counter = &r100_get_vblank_counter, 174 .get_vblank_counter = &r100_get_vblank_counter,
@@ -197,7 +209,11 @@ static struct radeon_asic r420_asic = {
197 .cp_init = &r100_cp_init, 209 .cp_init = &r100_cp_init,
198 .cp_fini = &r100_cp_fini, 210 .cp_fini = &r100_cp_fini,
199 .cp_disable = &r100_cp_disable, 211 .cp_disable = &r100_cp_disable,
212 .cp_commit = &r100_cp_commit,
200 .ring_start = &r300_ring_start, 213 .ring_start = &r300_ring_start,
214 .ring_test = &r100_ring_test,
215 .ring_ib_execute = &r100_ring_ib_execute,
216 .ib_test = &r100_ib_test,
201 .irq_set = &r100_irq_set, 217 .irq_set = &r100_irq_set,
202 .irq_process = &r100_irq_process, 218 .irq_process = &r100_irq_process,
203 .get_vblank_counter = &r100_get_vblank_counter, 219 .get_vblank_counter = &r100_get_vblank_counter,
@@ -245,7 +261,11 @@ static struct radeon_asic rs400_asic = {
245 .cp_init = &r100_cp_init, 261 .cp_init = &r100_cp_init,
246 .cp_fini = &r100_cp_fini, 262 .cp_fini = &r100_cp_fini,
247 .cp_disable = &r100_cp_disable, 263 .cp_disable = &r100_cp_disable,
264 .cp_commit = &r100_cp_commit,
248 .ring_start = &r300_ring_start, 265 .ring_start = &r300_ring_start,
266 .ring_test = &r100_ring_test,
267 .ring_ib_execute = &r100_ring_ib_execute,
268 .ib_test = &r100_ib_test,
249 .irq_set = &r100_irq_set, 269 .irq_set = &r100_irq_set,
250 .irq_process = &r100_irq_process, 270 .irq_process = &r100_irq_process,
251 .get_vblank_counter = &r100_get_vblank_counter, 271 .get_vblank_counter = &r100_get_vblank_counter,
@@ -298,7 +318,11 @@ static struct radeon_asic rs600_asic = {
298 .cp_init = &r100_cp_init, 318 .cp_init = &r100_cp_init,
299 .cp_fini = &r100_cp_fini, 319 .cp_fini = &r100_cp_fini,
300 .cp_disable = &r100_cp_disable, 320 .cp_disable = &r100_cp_disable,
321 .cp_commit = &r100_cp_commit,
301 .ring_start = &r300_ring_start, 322 .ring_start = &r300_ring_start,
323 .ring_test = &r100_ring_test,
324 .ring_ib_execute = &r100_ring_ib_execute,
325 .ib_test = &r100_ib_test,
302 .irq_set = &rs600_irq_set, 326 .irq_set = &rs600_irq_set,
303 .irq_process = &rs600_irq_process, 327 .irq_process = &rs600_irq_process,
304 .get_vblank_counter = &rs600_get_vblank_counter, 328 .get_vblank_counter = &rs600_get_vblank_counter,
@@ -341,7 +365,11 @@ static struct radeon_asic rs690_asic = {
341 .cp_init = &r100_cp_init, 365 .cp_init = &r100_cp_init,
342 .cp_fini = &r100_cp_fini, 366 .cp_fini = &r100_cp_fini,
343 .cp_disable = &r100_cp_disable, 367 .cp_disable = &r100_cp_disable,
368 .cp_commit = &r100_cp_commit,
344 .ring_start = &r300_ring_start, 369 .ring_start = &r300_ring_start,
370 .ring_test = &r100_ring_test,
371 .ring_ib_execute = &r100_ring_ib_execute,
372 .ib_test = &r100_ib_test,
345 .irq_set = &rs600_irq_set, 373 .irq_set = &rs600_irq_set,
346 .irq_process = &rs600_irq_process, 374 .irq_process = &rs600_irq_process,
347 .get_vblank_counter = &rs600_get_vblank_counter, 375 .get_vblank_counter = &rs600_get_vblank_counter,
@@ -391,7 +419,11 @@ static struct radeon_asic rv515_asic = {
391 .cp_init = &r100_cp_init, 419 .cp_init = &r100_cp_init,
392 .cp_fini = &r100_cp_fini, 420 .cp_fini = &r100_cp_fini,
393 .cp_disable = &r100_cp_disable, 421 .cp_disable = &r100_cp_disable,
422 .cp_commit = &r100_cp_commit,
394 .ring_start = &rv515_ring_start, 423 .ring_start = &rv515_ring_start,
424 .ring_test = &r100_ring_test,
425 .ring_ib_execute = &r100_ring_ib_execute,
426 .ib_test = &r100_ib_test,
395 .irq_set = &rs600_irq_set, 427 .irq_set = &rs600_irq_set,
396 .irq_process = &rs600_irq_process, 428 .irq_process = &rs600_irq_process,
397 .get_vblank_counter = &rs600_get_vblank_counter, 429 .get_vblank_counter = &rs600_get_vblank_counter,
@@ -434,7 +466,11 @@ static struct radeon_asic r520_asic = {
434 .cp_init = &r100_cp_init, 466 .cp_init = &r100_cp_init,
435 .cp_fini = &r100_cp_fini, 467 .cp_fini = &r100_cp_fini,
436 .cp_disable = &r100_cp_disable, 468 .cp_disable = &r100_cp_disable,
469 .cp_commit = &r100_cp_commit,
437 .ring_start = &rv515_ring_start, 470 .ring_start = &rv515_ring_start,
471 .ring_test = &r100_ring_test,
472 .ring_ib_execute = &r100_ring_ib_execute,
473 .ib_test = &r100_ib_test,
438 .irq_set = &rs600_irq_set, 474 .irq_set = &rs600_irq_set,
439 .irq_process = &rs600_irq_process, 475 .irq_process = &rs600_irq_process,
440 .get_vblank_counter = &rs600_get_vblank_counter, 476 .get_vblank_counter = &rs600_get_vblank_counter,
@@ -453,9 +489,127 @@ static struct radeon_asic r520_asic = {
453}; 489};
454 490
455/* 491/*
456 * r600,rv610,rv630,rv620,rv635,rv670,rs780,rv770,rv730,rv710 492 * r600,rv610,rv630,rv620,rv635,rv670,rs780,rs880
457 */ 493 */
494int r600_init(struct radeon_device *rdev);
495void r600_fini(struct radeon_device *rdev);
496int r600_suspend(struct radeon_device *rdev);
497int r600_resume(struct radeon_device *rdev);
498int r600_wb_init(struct radeon_device *rdev);
499void r600_wb_fini(struct radeon_device *rdev);
500void r600_cp_commit(struct radeon_device *rdev);
501void r600_pcie_gart_tlb_flush(struct radeon_device *rdev);
458uint32_t r600_pciep_rreg(struct radeon_device *rdev, uint32_t reg); 502uint32_t r600_pciep_rreg(struct radeon_device *rdev, uint32_t reg);
459void r600_pciep_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v); 503void r600_pciep_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v);
504int r600_cs_parse(struct radeon_cs_parser *p);
505void r600_fence_ring_emit(struct radeon_device *rdev,
506 struct radeon_fence *fence);
507int r600_copy_dma(struct radeon_device *rdev,
508 uint64_t src_offset,
509 uint64_t dst_offset,
510 unsigned num_pages,
511 struct radeon_fence *fence);
512int r600_irq_process(struct radeon_device *rdev);
513int r600_irq_set(struct radeon_device *rdev);
514int r600_gpu_reset(struct radeon_device *rdev);
515int r600_set_surface_reg(struct radeon_device *rdev, int reg,
516 uint32_t tiling_flags, uint32_t pitch,
517 uint32_t offset, uint32_t obj_size);
518int r600_clear_surface_reg(struct radeon_device *rdev, int reg);
519void r600_ring_ib_execute(struct radeon_device *rdev, struct radeon_ib *ib);
520int r600_ib_test(struct radeon_device *rdev);
521int r600_ring_test(struct radeon_device *rdev);
522int r600_copy_blit(struct radeon_device *rdev,
523 uint64_t src_offset, uint64_t dst_offset,
524 unsigned num_pages, struct radeon_fence *fence);
525
526static struct radeon_asic r600_asic = {
527 .errata = NULL,
528 .init = &r600_init,
529 .fini = &r600_fini,
530 .suspend = &r600_suspend,
531 .resume = &r600_resume,
532 .cp_commit = &r600_cp_commit,
533 .vram_info = NULL,
534 .gpu_reset = &r600_gpu_reset,
535 .mc_init = NULL,
536 .mc_fini = NULL,
537 .wb_init = &r600_wb_init,
538 .wb_fini = &r600_wb_fini,
539 .gart_enable = NULL,
540 .gart_disable = NULL,
541 .gart_tlb_flush = &r600_pcie_gart_tlb_flush,
542 .gart_set_page = &rs600_gart_set_page,
543 .cp_init = NULL,
544 .cp_fini = NULL,
545 .cp_disable = NULL,
546 .ring_start = NULL,
547 .ring_test = &r600_ring_test,
548 .ring_ib_execute = &r600_ring_ib_execute,
549 .ib_test = &r600_ib_test,
550 .irq_set = &r600_irq_set,
551 .irq_process = &r600_irq_process,
552 .fence_ring_emit = &r600_fence_ring_emit,
553 .cs_parse = &r600_cs_parse,
554 .copy_blit = &r600_copy_blit,
555 .copy_dma = &r600_copy_blit,
556 .copy = NULL,
557 .set_engine_clock = &radeon_atom_set_engine_clock,
558 .set_memory_clock = &radeon_atom_set_memory_clock,
559 .set_pcie_lanes = NULL,
560 .set_clock_gating = &radeon_atom_set_clock_gating,
561 .set_surface_reg = r600_set_surface_reg,
562 .clear_surface_reg = r600_clear_surface_reg,
563 .bandwidth_update = &r520_bandwidth_update,
564};
565
566/*
567 * rv770,rv730,rv710,rv740
568 */
569int rv770_init(struct radeon_device *rdev);
570void rv770_fini(struct radeon_device *rdev);
571int rv770_suspend(struct radeon_device *rdev);
572int rv770_resume(struct radeon_device *rdev);
573int rv770_gpu_reset(struct radeon_device *rdev);
574
575static struct radeon_asic rv770_asic = {
576 .errata = NULL,
577 .init = &rv770_init,
578 .fini = &rv770_fini,
579 .suspend = &rv770_suspend,
580 .resume = &rv770_resume,
581 .cp_commit = &r600_cp_commit,
582 .vram_info = NULL,
583 .gpu_reset = &rv770_gpu_reset,
584 .mc_init = NULL,
585 .mc_fini = NULL,
586 .wb_init = &r600_wb_init,
587 .wb_fini = &r600_wb_fini,
588 .gart_enable = NULL,
589 .gart_disable = NULL,
590 .gart_tlb_flush = &r600_pcie_gart_tlb_flush,
591 .gart_set_page = &rs600_gart_set_page,
592 .cp_init = NULL,
593 .cp_fini = NULL,
594 .cp_disable = NULL,
595 .ring_start = NULL,
596 .ring_test = &r600_ring_test,
597 .ring_ib_execute = &r600_ring_ib_execute,
598 .ib_test = &r600_ib_test,
599 .irq_set = &r600_irq_set,
600 .irq_process = &r600_irq_process,
601 .fence_ring_emit = &r600_fence_ring_emit,
602 .cs_parse = &r600_cs_parse,
603 .copy_blit = &r600_copy_blit,
604 .copy_dma = &r600_copy_blit,
605 .copy = NULL,
606 .set_engine_clock = &radeon_atom_set_engine_clock,
607 .set_memory_clock = &radeon_atom_set_memory_clock,
608 .set_pcie_lanes = NULL,
609 .set_clock_gating = &radeon_atom_set_clock_gating,
610 .set_surface_reg = r600_set_surface_reg,
611 .clear_surface_reg = r600_clear_surface_reg,
612 .bandwidth_update = &r520_bandwidth_update,
613};
460 614
461#endif 615#endif