aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/rv515.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-08-13 02:32:14 -0400
committerDave Airlie <airlied@redhat.com>2009-09-07 19:24:37 -0400
commit4ce001abafafe77e5dd943d1480fc9f87894e96f (patch)
tree4a22b42c58a80450992fcf5d7625b19fe045855b /drivers/gpu/drm/radeon/rv515.c
parent551ebd837c75fc75df81811a18b7136c39cab487 (diff)
drm/radeon/kms: add initial radeon tv-out support.
This ports the tv-out code from the DDX to KMS. adds a radeon.tv module option, radeon.tv=0 to disable tv Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/rv515.c')
-rw-r--r--drivers/gpu/drm/radeon/rv515.c452
1 files changed, 227 insertions, 225 deletions
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c
index 60a194f1d9a8..97965c430c1f 100644
--- a/drivers/gpu/drm/radeon/rv515.c
+++ b/drivers/gpu/drm/radeon/rv515.c
@@ -475,232 +475,234 @@ int rv515_init(struct radeon_device *rdev)
475 return 0; 475 return 0;
476} 476}
477 477
478void atom_rv515_force_tv_scaler(struct radeon_device *rdev) 478void atom_rv515_force_tv_scaler(struct radeon_device *rdev, struct radeon_crtc *crtc)
479{ 479{
480 480 int index_reg = 0x6578 + crtc->crtc_offset;
481 WREG32(0x659C, 0x0); 481 int data_reg = 0x657c + crtc->crtc_offset;
482 WREG32(0x6594, 0x705); 482
483 WREG32(0x65A4, 0x10001); 483 WREG32(0x659C + crtc->crtc_offset, 0x0);
484 WREG32(0x65D8, 0x0); 484 WREG32(0x6594 + crtc->crtc_offset, 0x705);
485 WREG32(0x65B0, 0x0); 485 WREG32(0x65A4 + crtc->crtc_offset, 0x10001);
486 WREG32(0x65C0, 0x0); 486 WREG32(0x65D8 + crtc->crtc_offset, 0x0);
487 WREG32(0x65D4, 0x0); 487 WREG32(0x65B0 + crtc->crtc_offset, 0x0);
488 WREG32(0x6578, 0x0); 488 WREG32(0x65C0 + crtc->crtc_offset, 0x0);
489 WREG32(0x657C, 0x841880A8); 489 WREG32(0x65D4 + crtc->crtc_offset, 0x0);
490 WREG32(0x6578, 0x1); 490 WREG32(index_reg, 0x0);
491 WREG32(0x657C, 0x84208680); 491 WREG32(data_reg, 0x841880A8);
492 WREG32(0x6578, 0x2); 492 WREG32(index_reg, 0x1);
493 WREG32(0x657C, 0xBFF880B0); 493 WREG32(data_reg, 0x84208680);
494 WREG32(0x6578, 0x100); 494 WREG32(index_reg, 0x2);
495 WREG32(0x657C, 0x83D88088); 495 WREG32(data_reg, 0xBFF880B0);
496 WREG32(0x6578, 0x101); 496 WREG32(index_reg, 0x100);
497 WREG32(0x657C, 0x84608680); 497 WREG32(data_reg, 0x83D88088);
498 WREG32(0x6578, 0x102); 498 WREG32(index_reg, 0x101);
499 WREG32(0x657C, 0xBFF080D0); 499 WREG32(data_reg, 0x84608680);
500 WREG32(0x6578, 0x200); 500 WREG32(index_reg, 0x102);
501 WREG32(0x657C, 0x83988068); 501 WREG32(data_reg, 0xBFF080D0);
502 WREG32(0x6578, 0x201); 502 WREG32(index_reg, 0x200);
503 WREG32(0x657C, 0x84A08680); 503 WREG32(data_reg, 0x83988068);
504 WREG32(0x6578, 0x202); 504 WREG32(index_reg, 0x201);
505 WREG32(0x657C, 0xBFF080F8); 505 WREG32(data_reg, 0x84A08680);
506 WREG32(0x6578, 0x300); 506 WREG32(index_reg, 0x202);
507 WREG32(0x657C, 0x83588058); 507 WREG32(data_reg, 0xBFF080F8);
508 WREG32(0x6578, 0x301); 508 WREG32(index_reg, 0x300);
509 WREG32(0x657C, 0x84E08660); 509 WREG32(data_reg, 0x83588058);
510 WREG32(0x6578, 0x302); 510 WREG32(index_reg, 0x301);
511 WREG32(0x657C, 0xBFF88120); 511 WREG32(data_reg, 0x84E08660);
512 WREG32(0x6578, 0x400); 512 WREG32(index_reg, 0x302);
513 WREG32(0x657C, 0x83188040); 513 WREG32(data_reg, 0xBFF88120);
514 WREG32(0x6578, 0x401); 514 WREG32(index_reg, 0x400);
515 WREG32(0x657C, 0x85008660); 515 WREG32(data_reg, 0x83188040);
516 WREG32(0x6578, 0x402); 516 WREG32(index_reg, 0x401);
517 WREG32(0x657C, 0xBFF88150); 517 WREG32(data_reg, 0x85008660);
518 WREG32(0x6578, 0x500); 518 WREG32(index_reg, 0x402);
519 WREG32(0x657C, 0x82D88030); 519 WREG32(data_reg, 0xBFF88150);
520 WREG32(0x6578, 0x501); 520 WREG32(index_reg, 0x500);
521 WREG32(0x657C, 0x85408640); 521 WREG32(data_reg, 0x82D88030);
522 WREG32(0x6578, 0x502); 522 WREG32(index_reg, 0x501);
523 WREG32(0x657C, 0xBFF88180); 523 WREG32(data_reg, 0x85408640);
524 WREG32(0x6578, 0x600); 524 WREG32(index_reg, 0x502);
525 WREG32(0x657C, 0x82A08018); 525 WREG32(data_reg, 0xBFF88180);
526 WREG32(0x6578, 0x601); 526 WREG32(index_reg, 0x600);
527 WREG32(0x657C, 0x85808620); 527 WREG32(data_reg, 0x82A08018);
528 WREG32(0x6578, 0x602); 528 WREG32(index_reg, 0x601);
529 WREG32(0x657C, 0xBFF081B8); 529 WREG32(data_reg, 0x85808620);
530 WREG32(0x6578, 0x700); 530 WREG32(index_reg, 0x602);
531 WREG32(0x657C, 0x82608010); 531 WREG32(data_reg, 0xBFF081B8);
532 WREG32(0x6578, 0x701); 532 WREG32(index_reg, 0x700);
533 WREG32(0x657C, 0x85A08600); 533 WREG32(data_reg, 0x82608010);
534 WREG32(0x6578, 0x702); 534 WREG32(index_reg, 0x701);
535 WREG32(0x657C, 0x800081F0); 535 WREG32(data_reg, 0x85A08600);
536 WREG32(0x6578, 0x800); 536 WREG32(index_reg, 0x702);
537 WREG32(0x657C, 0x8228BFF8); 537 WREG32(data_reg, 0x800081F0);
538 WREG32(0x6578, 0x801); 538 WREG32(index_reg, 0x800);
539 WREG32(0x657C, 0x85E085E0); 539 WREG32(data_reg, 0x8228BFF8);
540 WREG32(0x6578, 0x802); 540 WREG32(index_reg, 0x801);
541 WREG32(0x657C, 0xBFF88228); 541 WREG32(data_reg, 0x85E085E0);
542 WREG32(0x6578, 0x10000); 542 WREG32(index_reg, 0x802);
543 WREG32(0x657C, 0x82A8BF00); 543 WREG32(data_reg, 0xBFF88228);
544 WREG32(0x6578, 0x10001); 544 WREG32(index_reg, 0x10000);
545 WREG32(0x657C, 0x82A08CC0); 545 WREG32(data_reg, 0x82A8BF00);
546 WREG32(0x6578, 0x10002); 546 WREG32(index_reg, 0x10001);
547 WREG32(0x657C, 0x8008BEF8); 547 WREG32(data_reg, 0x82A08CC0);
548 WREG32(0x6578, 0x10100); 548 WREG32(index_reg, 0x10002);
549 WREG32(0x657C, 0x81F0BF28); 549 WREG32(data_reg, 0x8008BEF8);
550 WREG32(0x6578, 0x10101); 550 WREG32(index_reg, 0x10100);
551 WREG32(0x657C, 0x83608CA0); 551 WREG32(data_reg, 0x81F0BF28);
552 WREG32(0x6578, 0x10102); 552 WREG32(index_reg, 0x10101);
553 WREG32(0x657C, 0x8018BED0); 553 WREG32(data_reg, 0x83608CA0);
554 WREG32(0x6578, 0x10200); 554 WREG32(index_reg, 0x10102);
555 WREG32(0x657C, 0x8148BF38); 555 WREG32(data_reg, 0x8018BED0);
556 WREG32(0x6578, 0x10201); 556 WREG32(index_reg, 0x10200);
557 WREG32(0x657C, 0x84408C80); 557 WREG32(data_reg, 0x8148BF38);
558 WREG32(0x6578, 0x10202); 558 WREG32(index_reg, 0x10201);
559 WREG32(0x657C, 0x8008BEB8); 559 WREG32(data_reg, 0x84408C80);
560 WREG32(0x6578, 0x10300); 560 WREG32(index_reg, 0x10202);
561 WREG32(0x657C, 0x80B0BF78); 561 WREG32(data_reg, 0x8008BEB8);
562 WREG32(0x6578, 0x10301); 562 WREG32(index_reg, 0x10300);
563 WREG32(0x657C, 0x85008C20); 563 WREG32(data_reg, 0x80B0BF78);
564 WREG32(0x6578, 0x10302); 564 WREG32(index_reg, 0x10301);
565 WREG32(0x657C, 0x8020BEA0); 565 WREG32(data_reg, 0x85008C20);
566 WREG32(0x6578, 0x10400); 566 WREG32(index_reg, 0x10302);
567 WREG32(0x657C, 0x8028BF90); 567 WREG32(data_reg, 0x8020BEA0);
568 WREG32(0x6578, 0x10401); 568 WREG32(index_reg, 0x10400);
569 WREG32(0x657C, 0x85E08BC0); 569 WREG32(data_reg, 0x8028BF90);
570 WREG32(0x6578, 0x10402); 570 WREG32(index_reg, 0x10401);
571 WREG32(0x657C, 0x8018BE90); 571 WREG32(data_reg, 0x85E08BC0);
572 WREG32(0x6578, 0x10500); 572 WREG32(index_reg, 0x10402);
573 WREG32(0x657C, 0xBFB8BFB0); 573 WREG32(data_reg, 0x8018BE90);
574 WREG32(0x6578, 0x10501); 574 WREG32(index_reg, 0x10500);
575 WREG32(0x657C, 0x86C08B40); 575 WREG32(data_reg, 0xBFB8BFB0);
576 WREG32(0x6578, 0x10502); 576 WREG32(index_reg, 0x10501);
577 WREG32(0x657C, 0x8010BE90); 577 WREG32(data_reg, 0x86C08B40);
578 WREG32(0x6578, 0x10600); 578 WREG32(index_reg, 0x10502);
579 WREG32(0x657C, 0xBF58BFC8); 579 WREG32(data_reg, 0x8010BE90);
580 WREG32(0x6578, 0x10601); 580 WREG32(index_reg, 0x10600);
581 WREG32(0x657C, 0x87A08AA0); 581 WREG32(data_reg, 0xBF58BFC8);
582 WREG32(0x6578, 0x10602); 582 WREG32(index_reg, 0x10601);
583 WREG32(0x657C, 0x8010BE98); 583 WREG32(data_reg, 0x87A08AA0);
584 WREG32(0x6578, 0x10700); 584 WREG32(index_reg, 0x10602);
585 WREG32(0x657C, 0xBF10BFF0); 585 WREG32(data_reg, 0x8010BE98);
586 WREG32(0x6578, 0x10701); 586 WREG32(index_reg, 0x10700);
587 WREG32(0x657C, 0x886089E0); 587 WREG32(data_reg, 0xBF10BFF0);
588 WREG32(0x6578, 0x10702); 588 WREG32(index_reg, 0x10701);
589 WREG32(0x657C, 0x8018BEB0); 589 WREG32(data_reg, 0x886089E0);
590 WREG32(0x6578, 0x10800); 590 WREG32(index_reg, 0x10702);
591 WREG32(0x657C, 0xBED8BFE8); 591 WREG32(data_reg, 0x8018BEB0);
592 WREG32(0x6578, 0x10801); 592 WREG32(index_reg, 0x10800);
593 WREG32(0x657C, 0x89408940); 593 WREG32(data_reg, 0xBED8BFE8);
594 WREG32(0x6578, 0x10802); 594 WREG32(index_reg, 0x10801);
595 WREG32(0x657C, 0xBFE8BED8); 595 WREG32(data_reg, 0x89408940);
596 WREG32(0x6578, 0x20000); 596 WREG32(index_reg, 0x10802);
597 WREG32(0x657C, 0x80008000); 597 WREG32(data_reg, 0xBFE8BED8);
598 WREG32(0x6578, 0x20001); 598 WREG32(index_reg, 0x20000);
599 WREG32(0x657C, 0x90008000); 599 WREG32(data_reg, 0x80008000);
600 WREG32(0x6578, 0x20002); 600 WREG32(index_reg, 0x20001);
601 WREG32(0x657C, 0x80008000); 601 WREG32(data_reg, 0x90008000);
602 WREG32(0x6578, 0x20003); 602 WREG32(index_reg, 0x20002);
603 WREG32(0x657C, 0x80008000); 603 WREG32(data_reg, 0x80008000);
604 WREG32(0x6578, 0x20100); 604 WREG32(index_reg, 0x20003);
605 WREG32(0x657C, 0x80108000); 605 WREG32(data_reg, 0x80008000);
606 WREG32(0x6578, 0x20101); 606 WREG32(index_reg, 0x20100);
607 WREG32(0x657C, 0x8FE0BF70); 607 WREG32(data_reg, 0x80108000);
608 WREG32(0x6578, 0x20102); 608 WREG32(index_reg, 0x20101);
609 WREG32(0x657C, 0xBFE880C0); 609 WREG32(data_reg, 0x8FE0BF70);
610 WREG32(0x6578, 0x20103); 610 WREG32(index_reg, 0x20102);
611 WREG32(0x657C, 0x80008000); 611 WREG32(data_reg, 0xBFE880C0);
612 WREG32(0x6578, 0x20200); 612 WREG32(index_reg, 0x20103);
613 WREG32(0x657C, 0x8018BFF8); 613 WREG32(data_reg, 0x80008000);
614 WREG32(0x6578, 0x20201); 614 WREG32(index_reg, 0x20200);
615 WREG32(0x657C, 0x8F80BF08); 615 WREG32(data_reg, 0x8018BFF8);
616 WREG32(0x6578, 0x20202); 616 WREG32(index_reg, 0x20201);
617 WREG32(0x657C, 0xBFD081A0); 617 WREG32(data_reg, 0x8F80BF08);
618 WREG32(0x6578, 0x20203); 618 WREG32(index_reg, 0x20202);
619 WREG32(0x657C, 0xBFF88000); 619 WREG32(data_reg, 0xBFD081A0);
620 WREG32(0x6578, 0x20300); 620 WREG32(index_reg, 0x20203);
621 WREG32(0x657C, 0x80188000); 621 WREG32(data_reg, 0xBFF88000);
622 WREG32(0x6578, 0x20301); 622 WREG32(index_reg, 0x20300);
623 WREG32(0x657C, 0x8EE0BEC0); 623 WREG32(data_reg, 0x80188000);
624 WREG32(0x6578, 0x20302); 624 WREG32(index_reg, 0x20301);
625 WREG32(0x657C, 0xBFB082A0); 625 WREG32(data_reg, 0x8EE0BEC0);
626 WREG32(0x6578, 0x20303); 626 WREG32(index_reg, 0x20302);
627 WREG32(0x657C, 0x80008000); 627 WREG32(data_reg, 0xBFB082A0);
628 WREG32(0x6578, 0x20400); 628 WREG32(index_reg, 0x20303);
629 WREG32(0x657C, 0x80188000); 629 WREG32(data_reg, 0x80008000);
630 WREG32(0x6578, 0x20401); 630 WREG32(index_reg, 0x20400);
631 WREG32(0x657C, 0x8E00BEA0); 631 WREG32(data_reg, 0x80188000);
632 WREG32(0x6578, 0x20402); 632 WREG32(index_reg, 0x20401);
633 WREG32(0x657C, 0xBF8883C0); 633 WREG32(data_reg, 0x8E00BEA0);
634 WREG32(0x6578, 0x20403); 634 WREG32(index_reg, 0x20402);
635 WREG32(0x657C, 0x80008000); 635 WREG32(data_reg, 0xBF8883C0);
636 WREG32(0x6578, 0x20500); 636 WREG32(index_reg, 0x20403);
637 WREG32(0x657C, 0x80188000); 637 WREG32(data_reg, 0x80008000);
638 WREG32(0x6578, 0x20501); 638 WREG32(index_reg, 0x20500);
639 WREG32(0x657C, 0x8D00BE90); 639 WREG32(data_reg, 0x80188000);
640 WREG32(0x6578, 0x20502); 640 WREG32(index_reg, 0x20501);
641 WREG32(0x657C, 0xBF588500); 641 WREG32(data_reg, 0x8D00BE90);
642 WREG32(0x6578, 0x20503); 642 WREG32(index_reg, 0x20502);
643 WREG32(0x657C, 0x80008008); 643 WREG32(data_reg, 0xBF588500);
644 WREG32(0x6578, 0x20600); 644 WREG32(index_reg, 0x20503);
645 WREG32(0x657C, 0x80188000); 645 WREG32(data_reg, 0x80008008);
646 WREG32(0x6578, 0x20601); 646 WREG32(index_reg, 0x20600);
647 WREG32(0x657C, 0x8BC0BE98); 647 WREG32(data_reg, 0x80188000);
648 WREG32(0x6578, 0x20602); 648 WREG32(index_reg, 0x20601);
649 WREG32(0x657C, 0xBF308660); 649 WREG32(data_reg, 0x8BC0BE98);
650 WREG32(0x6578, 0x20603); 650 WREG32(index_reg, 0x20602);
651 WREG32(0x657C, 0x80008008); 651 WREG32(data_reg, 0xBF308660);
652 WREG32(0x6578, 0x20700); 652 WREG32(index_reg, 0x20603);
653 WREG32(0x657C, 0x80108000); 653 WREG32(data_reg, 0x80008008);
654 WREG32(0x6578, 0x20701); 654 WREG32(index_reg, 0x20700);
655 WREG32(0x657C, 0x8A80BEB0); 655 WREG32(data_reg, 0x80108000);
656 WREG32(0x6578, 0x20702); 656 WREG32(index_reg, 0x20701);
657 WREG32(0x657C, 0xBF0087C0); 657 WREG32(data_reg, 0x8A80BEB0);
658 WREG32(0x6578, 0x20703); 658 WREG32(index_reg, 0x20702);
659 WREG32(0x657C, 0x80008008); 659 WREG32(data_reg, 0xBF0087C0);
660 WREG32(0x6578, 0x20800); 660 WREG32(index_reg, 0x20703);
661 WREG32(0x657C, 0x80108000); 661 WREG32(data_reg, 0x80008008);
662 WREG32(0x6578, 0x20801); 662 WREG32(index_reg, 0x20800);
663 WREG32(0x657C, 0x8920BED0); 663 WREG32(data_reg, 0x80108000);
664 WREG32(0x6578, 0x20802); 664 WREG32(index_reg, 0x20801);
665 WREG32(0x657C, 0xBED08920); 665 WREG32(data_reg, 0x8920BED0);
666 WREG32(0x6578, 0x20803); 666 WREG32(index_reg, 0x20802);
667 WREG32(0x657C, 0x80008010); 667 WREG32(data_reg, 0xBED08920);
668 WREG32(0x6578, 0x30000); 668 WREG32(index_reg, 0x20803);
669 WREG32(0x657C, 0x90008000); 669 WREG32(data_reg, 0x80008010);
670 WREG32(0x6578, 0x30001); 670 WREG32(index_reg, 0x30000);
671 WREG32(0x657C, 0x80008000); 671 WREG32(data_reg, 0x90008000);
672 WREG32(0x6578, 0x30100); 672 WREG32(index_reg, 0x30001);
673 WREG32(0x657C, 0x8FE0BF90); 673 WREG32(data_reg, 0x80008000);
674 WREG32(0x6578, 0x30101); 674 WREG32(index_reg, 0x30100);
675 WREG32(0x657C, 0xBFF880A0); 675 WREG32(data_reg, 0x8FE0BF90);
676 WREG32(0x6578, 0x30200); 676 WREG32(index_reg, 0x30101);
677 WREG32(0x657C, 0x8F60BF40); 677 WREG32(data_reg, 0xBFF880A0);
678 WREG32(0x6578, 0x30201); 678 WREG32(index_reg, 0x30200);
679 WREG32(0x657C, 0xBFE88180); 679 WREG32(data_reg, 0x8F60BF40);
680 WREG32(0x6578, 0x30300); 680 WREG32(index_reg, 0x30201);
681 WREG32(0x657C, 0x8EC0BF00); 681 WREG32(data_reg, 0xBFE88180);
682 WREG32(0x6578, 0x30301); 682 WREG32(index_reg, 0x30300);
683 WREG32(0x657C, 0xBFC88280); 683 WREG32(data_reg, 0x8EC0BF00);
684 WREG32(0x6578, 0x30400); 684 WREG32(index_reg, 0x30301);
685 WREG32(0x657C, 0x8DE0BEE0); 685 WREG32(data_reg, 0xBFC88280);
686 WREG32(0x6578, 0x30401); 686 WREG32(index_reg, 0x30400);
687 WREG32(0x657C, 0xBFA083A0); 687 WREG32(data_reg, 0x8DE0BEE0);
688 WREG32(0x6578, 0x30500); 688 WREG32(index_reg, 0x30401);
689 WREG32(0x657C, 0x8CE0BED0); 689 WREG32(data_reg, 0xBFA083A0);
690 WREG32(0x6578, 0x30501); 690 WREG32(index_reg, 0x30500);
691 WREG32(0x657C, 0xBF7884E0); 691 WREG32(data_reg, 0x8CE0BED0);
692 WREG32(0x6578, 0x30600); 692 WREG32(index_reg, 0x30501);
693 WREG32(0x657C, 0x8BA0BED8); 693 WREG32(data_reg, 0xBF7884E0);
694 WREG32(0x6578, 0x30601); 694 WREG32(index_reg, 0x30600);
695 WREG32(0x657C, 0xBF508640); 695 WREG32(data_reg, 0x8BA0BED8);
696 WREG32(0x6578, 0x30700); 696 WREG32(index_reg, 0x30601);
697 WREG32(0x657C, 0x8A60BEE8); 697 WREG32(data_reg, 0xBF508640);
698 WREG32(0x6578, 0x30701); 698 WREG32(index_reg, 0x30700);
699 WREG32(0x657C, 0xBF2087A0); 699 WREG32(data_reg, 0x8A60BEE8);
700 WREG32(0x6578, 0x30800); 700 WREG32(index_reg, 0x30701);
701 WREG32(0x657C, 0x8900BF00); 701 WREG32(data_reg, 0xBF2087A0);
702 WREG32(0x6578, 0x30801); 702 WREG32(index_reg, 0x30800);
703 WREG32(0x657C, 0xBF008900); 703 WREG32(data_reg, 0x8900BF00);
704 WREG32(index_reg, 0x30801);
705 WREG32(data_reg, 0xBF008900);
704} 706}
705 707
706struct rv515_watermark { 708struct rv515_watermark {