diff options
author | Marcin KoĆcielnicki <koriakin@0x04.net> | 2010-04-11 14:41:38 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2010-05-18 23:15:14 -0400 |
commit | f23d4cf4bd037194866b7992934d4934ca97464a (patch) | |
tree | 0620a989de3e1648532d9993275b04e812b76a89 /drivers/gpu/drm | |
parent | a0e654408954d81c70241a4a470ca85f4fb42829 (diff) |
drm/nv04: Implement missing nv04 PGRAPH methods in software.
Signed-off-by: Marcin KoĆcielnicki <koriakin@0x04.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/nouveau/nv04_graph.c | 566 |
1 files changed, 553 insertions, 13 deletions
diff --git a/drivers/gpu/drm/nouveau/nv04_graph.c b/drivers/gpu/drm/nouveau/nv04_graph.c index e260986ea65a..618355e9cdd5 100644 --- a/drivers/gpu/drm/nouveau/nv04_graph.c +++ b/drivers/gpu/drm/nouveau/nv04_graph.c | |||
@@ -532,9 +532,82 @@ nv04_graph_mthd_set_ref(struct nouveau_channel *chan, int grclass, | |||
532 | return 0; | 532 | return 0; |
533 | } | 533 | } |
534 | 534 | ||
535 | static int | 535 | /* |
536 | nv04_graph_mthd_set_operation(struct nouveau_channel *chan, int grclass, | 536 | * Software methods, why they are needed, and how they all work: |
537 | int mthd, uint32_t data) | 537 | * |
538 | * NV04 and NV05 keep most of the state in PGRAPH context itself, but some | ||
539 | * 2d engine settings are kept inside the grobjs themselves. The grobjs are | ||
540 | * 3 words long on both. grobj format on NV04 is: | ||
541 | * | ||
542 | * word 0: | ||
543 | * - bits 0-7: class | ||
544 | * - bit 12: color key active | ||
545 | * - bit 13: clip rect active | ||
546 | * - bit 14: if set, destination surface is swizzled and taken from buffer 5 | ||
547 | * [set by NV04_SWIZZLED_SURFACE], otherwise it's linear and taken | ||
548 | * from buffer 0 [set by NV04_CONTEXT_SURFACES_2D or | ||
549 | * NV03_CONTEXT_SURFACE_DST]. | ||
550 | * - bits 15-17: 2d operation [aka patch config] | ||
551 | * - bit 24: patch valid [enables rendering using this object] | ||
552 | * - bit 25: surf3d valid [for tex_tri and multitex_tri only] | ||
553 | * word 1: | ||
554 | * - bits 0-1: mono format | ||
555 | * - bits 8-13: color format | ||
556 | * - bits 16-31: DMA_NOTIFY instance | ||
557 | * word 2: | ||
558 | * - bits 0-15: DMA_A instance | ||
559 | * - bits 16-31: DMA_B instance | ||
560 | * | ||
561 | * On NV05 it's: | ||
562 | * | ||
563 | * word 0: | ||
564 | * - bits 0-7: class | ||
565 | * - bit 12: color key active | ||
566 | * - bit 13: clip rect active | ||
567 | * - bit 14: if set, destination surface is swizzled and taken from buffer 5 | ||
568 | * [set by NV04_SWIZZLED_SURFACE], otherwise it's linear and taken | ||
569 | * from buffer 0 [set by NV04_CONTEXT_SURFACES_2D or | ||
570 | * NV03_CONTEXT_SURFACE_DST]. | ||
571 | * - bits 15-17: 2d operation [aka patch config] | ||
572 | * - bits 20-22: dither mode | ||
573 | * - bit 24: patch valid [enables rendering using this object] | ||
574 | * - bit 25: surface_dst/surface_color/surf2d/surf3d valid | ||
575 | * - bit 26: surface_src/surface_zeta valid | ||
576 | * - bit 27: pattern valid | ||
577 | * - bit 28: rop valid | ||
578 | * - bit 29: beta1 valid | ||
579 | * - bit 30: beta4 valid | ||
580 | * word 1: | ||
581 | * - bits 0-1: mono format | ||
582 | * - bits 8-13: color format | ||
583 | * - bits 16-31: DMA_NOTIFY instance | ||
584 | * word 2: | ||
585 | * - bits 0-15: DMA_A instance | ||
586 | * - bits 16-31: DMA_B instance | ||
587 | * | ||
588 | * NV05 will set/unset the relevant valid bits when you poke the relevant | ||
589 | * object-binding methods with object of the proper type, or with the NULL | ||
590 | * type. It'll only allow rendering using the grobj if all needed objects | ||
591 | * are bound. The needed set of objects depends on selected operation: for | ||
592 | * example rop object is needed by ROP_AND, but not by SRCCOPY_AND. | ||
593 | * | ||
594 | * NV04 doesn't have these methods implemented at all, and doesn't have the | ||
595 | * relevant bits in grobj. Instead, it'll allow rendering whenever bit 24 | ||
596 | * is set. So we have to emulate them in software, internally keeping the | ||
597 | * same bits as NV05 does. Since grobjs are aligned to 16 bytes on nv04, | ||
598 | * but the last word isn't actually used for anything, we abuse it for this | ||
599 | * purpose. | ||
600 | * | ||
601 | * Actually, NV05 can optionally check bit 24 too, but we disable this since | ||
602 | * there's no use for it. | ||
603 | * | ||
604 | * For unknown reasons, NV04 implements surf3d binding in hardware as an | ||
605 | * exception. Also for unknown reasons, NV04 doesn't implement the clipping | ||
606 | * methods on the surf3d object, so we have to emulate them too. | ||
607 | */ | ||
608 | |||
609 | static void | ||
610 | nv04_graph_set_ctx1(struct nouveau_channel *chan, uint32_t mask, uint32_t value) | ||
538 | { | 611 | { |
539 | struct drm_device *dev = chan->dev; | 612 | struct drm_device *dev = chan->dev; |
540 | uint32_t instance = (nv_rd32(dev, NV04_PGRAPH_CTX_SWITCH4) & 0xffff) << 4; | 613 | uint32_t instance = (nv_rd32(dev, NV04_PGRAPH_CTX_SWITCH4) & 0xffff) << 4; |
@@ -542,42 +615,509 @@ nv04_graph_mthd_set_operation(struct nouveau_channel *chan, int grclass, | |||
542 | uint32_t tmp; | 615 | uint32_t tmp; |
543 | 616 | ||
544 | tmp = nv_ri32(dev, instance); | 617 | tmp = nv_ri32(dev, instance); |
545 | tmp &= ~0x00038000; | 618 | tmp &= ~mask; |
546 | tmp |= ((data & 7) << 15); | 619 | tmp |= value; |
547 | 620 | ||
548 | nv_wi32(dev, instance, tmp); | 621 | nv_wi32(dev, instance, tmp); |
549 | nv_wr32(dev, NV04_PGRAPH_CTX_SWITCH1, tmp); | 622 | nv_wr32(dev, NV04_PGRAPH_CTX_SWITCH1, tmp); |
550 | nv_wr32(dev, NV04_PGRAPH_CTX_CACHE1 + (subc<<2), tmp); | 623 | nv_wr32(dev, NV04_PGRAPH_CTX_CACHE1 + (subc<<2), tmp); |
624 | } | ||
625 | |||
626 | static void | ||
627 | nv04_graph_set_ctx_val(struct nouveau_channel *chan, uint32_t mask, uint32_t value) | ||
628 | { | ||
629 | struct drm_device *dev = chan->dev; | ||
630 | uint32_t instance = (nv_rd32(dev, NV04_PGRAPH_CTX_SWITCH4) & 0xffff) << 4; | ||
631 | uint32_t tmp, ctx1; | ||
632 | int class, op, valid = 1; | ||
633 | |||
634 | ctx1 = nv_ri32(dev, instance); | ||
635 | class = ctx1 & 0xff; | ||
636 | op = (ctx1 >> 15) & 7; | ||
637 | tmp = nv_ri32(dev, instance + 0xc); | ||
638 | tmp &= ~mask; | ||
639 | tmp |= value; | ||
640 | nv_wi32(dev, instance + 0xc, tmp); | ||
641 | |||
642 | /* check for valid surf2d/surf_dst/surf_color */ | ||
643 | if (!(tmp & 0x02000000)) | ||
644 | valid = 0; | ||
645 | /* check for valid surf_src/surf_zeta */ | ||
646 | if ((class == 0x1f || class == 0x48) && !(tmp & 0x04000000)) | ||
647 | valid = 0; | ||
648 | |||
649 | switch (op) { | ||
650 | /* SRCCOPY_AND, SRCCOPY: no extra objects required */ | ||
651 | case 0: | ||
652 | case 3: | ||
653 | break; | ||
654 | /* ROP_AND: requires pattern and rop */ | ||
655 | case 1: | ||
656 | if (!(tmp & 0x18000000)) | ||
657 | valid = 0; | ||
658 | break; | ||
659 | /* BLEND_AND: requires beta1 */ | ||
660 | case 2: | ||
661 | if (!(tmp & 0x20000000)) | ||
662 | valid = 0; | ||
663 | break; | ||
664 | /* SRCCOPY_PREMULT, BLEND_PREMULT: beta4 required */ | ||
665 | case 4: | ||
666 | case 5: | ||
667 | if (!(tmp & 0x40000000)) | ||
668 | valid = 0; | ||
669 | break; | ||
670 | } | ||
671 | |||
672 | nv04_graph_set_ctx1(chan, 0x01000000, valid << 24); | ||
673 | } | ||
674 | |||
675 | static int | ||
676 | nv04_graph_mthd_set_operation(struct nouveau_channel *chan, int grclass, | ||
677 | int mthd, uint32_t data) | ||
678 | { | ||
679 | if (data > 5) | ||
680 | return 1; | ||
681 | /* Old versions of the objects only accept first three operations. */ | ||
682 | if (data > 2 && grclass < 0x40) | ||
683 | return 1; | ||
684 | nv04_graph_set_ctx1(chan, 0x00038000, data << 15); | ||
685 | /* changing operation changes set of objects needed for validation */ | ||
686 | nv04_graph_set_ctx_val(chan, 0, 0); | ||
687 | return 0; | ||
688 | } | ||
689 | |||
690 | static int | ||
691 | nv04_graph_mthd_surf3d_clip_h(struct nouveau_channel *chan, int grclass, | ||
692 | int mthd, uint32_t data) | ||
693 | { | ||
694 | uint32_t min = data & 0xffff, max; | ||
695 | uint32_t w = data >> 16; | ||
696 | if (min & 0x8000) | ||
697 | /* too large */ | ||
698 | return 1; | ||
699 | if (w & 0x8000) | ||
700 | /* yes, it accepts negative for some reason. */ | ||
701 | w |= 0xffff0000; | ||
702 | max = min + w; | ||
703 | max &= 0x3ffff; | ||
704 | nv_wr32(chan->dev, 0x40053c, min); | ||
705 | nv_wr32(chan->dev, 0x400544, max); | ||
706 | return 0; | ||
707 | } | ||
708 | |||
709 | static int | ||
710 | nv04_graph_mthd_surf3d_clip_v(struct nouveau_channel *chan, int grclass, | ||
711 | int mthd, uint32_t data) | ||
712 | { | ||
713 | uint32_t min = data & 0xffff, max; | ||
714 | uint32_t w = data >> 16; | ||
715 | if (min & 0x8000) | ||
716 | /* too large */ | ||
717 | return 1; | ||
718 | if (w & 0x8000) | ||
719 | /* yes, it accepts negative for some reason. */ | ||
720 | w |= 0xffff0000; | ||
721 | max = min + w; | ||
722 | max &= 0x3ffff; | ||
723 | nv_wr32(chan->dev, 0x400540, min); | ||
724 | nv_wr32(chan->dev, 0x400548, max); | ||
551 | return 0; | 725 | return 0; |
552 | } | 726 | } |
553 | 727 | ||
728 | static int | ||
729 | nv04_graph_mthd_bind_surf2d(struct nouveau_channel *chan, int grclass, | ||
730 | int mthd, uint32_t data) | ||
731 | { | ||
732 | switch (nv_ri32(chan->dev, data << 4) & 0xff) { | ||
733 | case 0x30: | ||
734 | nv04_graph_set_ctx1(chan, 0x00004000, 0); | ||
735 | nv04_graph_set_ctx_val(chan, 0x02000000, 0); | ||
736 | return 0; | ||
737 | case 0x42: | ||
738 | nv04_graph_set_ctx1(chan, 0x00004000, 0); | ||
739 | nv04_graph_set_ctx_val(chan, 0x02000000, 0x02000000); | ||
740 | return 0; | ||
741 | } | ||
742 | return 1; | ||
743 | } | ||
744 | |||
745 | static int | ||
746 | nv04_graph_mthd_bind_surf2d_swzsurf(struct nouveau_channel *chan, int grclass, | ||
747 | int mthd, uint32_t data) | ||
748 | { | ||
749 | switch (nv_ri32(chan->dev, data << 4) & 0xff) { | ||
750 | case 0x30: | ||
751 | nv04_graph_set_ctx1(chan, 0x00004000, 0); | ||
752 | nv04_graph_set_ctx_val(chan, 0x02000000, 0); | ||
753 | return 0; | ||
754 | case 0x42: | ||
755 | nv04_graph_set_ctx1(chan, 0x00004000, 0); | ||
756 | nv04_graph_set_ctx_val(chan, 0x02000000, 0x02000000); | ||
757 | return 0; | ||
758 | case 0x52: | ||
759 | nv04_graph_set_ctx1(chan, 0x00004000, 0x00004000); | ||
760 | nv04_graph_set_ctx_val(chan, 0x02000000, 0x02000000); | ||
761 | return 0; | ||
762 | } | ||
763 | return 1; | ||
764 | } | ||
765 | |||
766 | static int | ||
767 | nv04_graph_mthd_bind_nv01_patt(struct nouveau_channel *chan, int grclass, | ||
768 | int mthd, uint32_t data) | ||
769 | { | ||
770 | switch (nv_ri32(chan->dev, data << 4) & 0xff) { | ||
771 | case 0x30: | ||
772 | nv04_graph_set_ctx_val(chan, 0x08000000, 0); | ||
773 | return 0; | ||
774 | case 0x18: | ||
775 | nv04_graph_set_ctx_val(chan, 0x08000000, 0x08000000); | ||
776 | return 0; | ||
777 | } | ||
778 | return 1; | ||
779 | } | ||
780 | |||
781 | static int | ||
782 | nv04_graph_mthd_bind_nv04_patt(struct nouveau_channel *chan, int grclass, | ||
783 | int mthd, uint32_t data) | ||
784 | { | ||
785 | switch (nv_ri32(chan->dev, data << 4) & 0xff) { | ||
786 | case 0x30: | ||
787 | nv04_graph_set_ctx_val(chan, 0x08000000, 0); | ||
788 | return 0; | ||
789 | case 0x44: | ||
790 | nv04_graph_set_ctx_val(chan, 0x08000000, 0x08000000); | ||
791 | return 0; | ||
792 | } | ||
793 | return 1; | ||
794 | } | ||
795 | |||
796 | static int | ||
797 | nv04_graph_mthd_bind_rop(struct nouveau_channel *chan, int grclass, | ||
798 | int mthd, uint32_t data) | ||
799 | { | ||
800 | switch (nv_ri32(chan->dev, data << 4) & 0xff) { | ||
801 | case 0x30: | ||
802 | nv04_graph_set_ctx_val(chan, 0x10000000, 0); | ||
803 | return 0; | ||
804 | case 0x43: | ||
805 | nv04_graph_set_ctx_val(chan, 0x10000000, 0x10000000); | ||
806 | return 0; | ||
807 | } | ||
808 | return 1; | ||
809 | } | ||
810 | |||
811 | static int | ||
812 | nv04_graph_mthd_bind_beta1(struct nouveau_channel *chan, int grclass, | ||
813 | int mthd, uint32_t data) | ||
814 | { | ||
815 | switch (nv_ri32(chan->dev, data << 4) & 0xff) { | ||
816 | case 0x30: | ||
817 | nv04_graph_set_ctx_val(chan, 0x20000000, 0); | ||
818 | return 0; | ||
819 | case 0x12: | ||
820 | nv04_graph_set_ctx_val(chan, 0x20000000, 0x20000000); | ||
821 | return 0; | ||
822 | } | ||
823 | return 1; | ||
824 | } | ||
825 | |||
826 | static int | ||
827 | nv04_graph_mthd_bind_beta4(struct nouveau_channel *chan, int grclass, | ||
828 | int mthd, uint32_t data) | ||
829 | { | ||
830 | switch (nv_ri32(chan->dev, data << 4) & 0xff) { | ||
831 | case 0x30: | ||
832 | nv04_graph_set_ctx_val(chan, 0x40000000, 0); | ||
833 | return 0; | ||
834 | case 0x72: | ||
835 | nv04_graph_set_ctx_val(chan, 0x40000000, 0x40000000); | ||
836 | return 0; | ||
837 | } | ||
838 | return 1; | ||
839 | } | ||
840 | |||
841 | static int | ||
842 | nv04_graph_mthd_bind_surf_dst(struct nouveau_channel *chan, int grclass, | ||
843 | int mthd, uint32_t data) | ||
844 | { | ||
845 | switch (nv_ri32(chan->dev, data << 4) & 0xff) { | ||
846 | case 0x30: | ||
847 | nv04_graph_set_ctx_val(chan, 0x02000000, 0); | ||
848 | return 0; | ||
849 | case 0x58: | ||
850 | nv04_graph_set_ctx_val(chan, 0x02000000, 0x02000000); | ||
851 | return 0; | ||
852 | } | ||
853 | return 1; | ||
854 | } | ||
855 | |||
856 | static int | ||
857 | nv04_graph_mthd_bind_surf_src(struct nouveau_channel *chan, int grclass, | ||
858 | int mthd, uint32_t data) | ||
859 | { | ||
860 | switch (nv_ri32(chan->dev, data << 4) & 0xff) { | ||
861 | case 0x30: | ||
862 | nv04_graph_set_ctx_val(chan, 0x04000000, 0); | ||
863 | return 0; | ||
864 | case 0x59: | ||
865 | nv04_graph_set_ctx_val(chan, 0x04000000, 0x04000000); | ||
866 | return 0; | ||
867 | } | ||
868 | return 1; | ||
869 | } | ||
870 | |||
871 | static int | ||
872 | nv04_graph_mthd_bind_surf_color(struct nouveau_channel *chan, int grclass, | ||
873 | int mthd, uint32_t data) | ||
874 | { | ||
875 | switch (nv_ri32(chan->dev, data << 4) & 0xff) { | ||
876 | case 0x30: | ||
877 | nv04_graph_set_ctx_val(chan, 0x02000000, 0); | ||
878 | return 0; | ||
879 | case 0x5a: | ||
880 | nv04_graph_set_ctx_val(chan, 0x02000000, 0x02000000); | ||
881 | return 0; | ||
882 | } | ||
883 | return 1; | ||
884 | } | ||
885 | |||
886 | static int | ||
887 | nv04_graph_mthd_bind_surf_zeta(struct nouveau_channel *chan, int grclass, | ||
888 | int mthd, uint32_t data) | ||
889 | { | ||
890 | switch (nv_ri32(chan->dev, data << 4) & 0xff) { | ||
891 | case 0x30: | ||
892 | nv04_graph_set_ctx_val(chan, 0x04000000, 0); | ||
893 | return 0; | ||
894 | case 0x5b: | ||
895 | nv04_graph_set_ctx_val(chan, 0x04000000, 0x04000000); | ||
896 | return 0; | ||
897 | } | ||
898 | return 1; | ||
899 | } | ||
900 | |||
901 | static int | ||
902 | nv04_graph_mthd_bind_clip(struct nouveau_channel *chan, int grclass, | ||
903 | int mthd, uint32_t data) | ||
904 | { | ||
905 | switch (nv_ri32(chan->dev, data << 4) & 0xff) { | ||
906 | case 0x30: | ||
907 | nv04_graph_set_ctx1(chan, 0x2000, 0); | ||
908 | return 0; | ||
909 | case 0x19: | ||
910 | nv04_graph_set_ctx1(chan, 0x2000, 0x2000); | ||
911 | return 0; | ||
912 | } | ||
913 | return 1; | ||
914 | } | ||
915 | |||
916 | static int | ||
917 | nv04_graph_mthd_bind_chroma(struct nouveau_channel *chan, int grclass, | ||
918 | int mthd, uint32_t data) | ||
919 | { | ||
920 | switch (nv_ri32(chan->dev, data << 4) & 0xff) { | ||
921 | case 0x30: | ||
922 | nv04_graph_set_ctx1(chan, 0x1000, 0); | ||
923 | return 0; | ||
924 | /* Yes, for some reason even the old versions of objects | ||
925 | * accept 0x57 and not 0x17. Consistency be damned. | ||
926 | */ | ||
927 | case 0x57: | ||
928 | nv04_graph_set_ctx1(chan, 0x1000, 0x1000); | ||
929 | return 0; | ||
930 | } | ||
931 | return 1; | ||
932 | } | ||
933 | |||
554 | static struct nouveau_pgraph_object_method nv04_graph_mthds_sw[] = { | 934 | static struct nouveau_pgraph_object_method nv04_graph_mthds_sw[] = { |
555 | { 0x0150, nv04_graph_mthd_set_ref }, | 935 | { 0x0150, nv04_graph_mthd_set_ref }, |
556 | {} | 936 | {} |
557 | }; | 937 | }; |
558 | 938 | ||
559 | static struct nouveau_pgraph_object_method nv04_graph_mthds_set_operation[] = { | 939 | static struct nouveau_pgraph_object_method nv04_graph_mthds_nv03_gdirect[] = { |
940 | { 0x0184, nv04_graph_mthd_bind_nv01_patt }, | ||
941 | { 0x0188, nv04_graph_mthd_bind_rop }, | ||
942 | { 0x018c, nv04_graph_mthd_bind_beta1 }, | ||
943 | { 0x0190, nv04_graph_mthd_bind_surf_dst }, | ||
944 | { 0x02fc, nv04_graph_mthd_set_operation }, | ||
945 | {}, | ||
946 | }; | ||
947 | |||
948 | static struct nouveau_pgraph_object_method nv04_graph_mthds_nv04_gdirect[] = { | ||
949 | { 0x0188, nv04_graph_mthd_bind_nv04_patt }, | ||
950 | { 0x018c, nv04_graph_mthd_bind_rop }, | ||
951 | { 0x0190, nv04_graph_mthd_bind_beta1 }, | ||
952 | { 0x0194, nv04_graph_mthd_bind_beta4 }, | ||
953 | { 0x0198, nv04_graph_mthd_bind_surf2d }, | ||
954 | { 0x02fc, nv04_graph_mthd_set_operation }, | ||
955 | {}, | ||
956 | }; | ||
957 | |||
958 | static struct nouveau_pgraph_object_method nv04_graph_mthds_nv01_imageblit[] = { | ||
959 | { 0x0184, nv04_graph_mthd_bind_chroma }, | ||
960 | { 0x0188, nv04_graph_mthd_bind_clip }, | ||
961 | { 0x018c, nv04_graph_mthd_bind_nv01_patt }, | ||
962 | { 0x0190, nv04_graph_mthd_bind_rop }, | ||
963 | { 0x0194, nv04_graph_mthd_bind_beta1 }, | ||
964 | { 0x0198, nv04_graph_mthd_bind_surf_dst }, | ||
965 | { 0x019c, nv04_graph_mthd_bind_surf_src }, | ||
966 | { 0x02fc, nv04_graph_mthd_set_operation }, | ||
967 | {}, | ||
968 | }; | ||
969 | |||
970 | static struct nouveau_pgraph_object_method nv04_graph_mthds_nv04_imageblit_ifc[] = { | ||
971 | { 0x0184, nv04_graph_mthd_bind_chroma }, | ||
972 | { 0x0188, nv04_graph_mthd_bind_clip }, | ||
973 | { 0x018c, nv04_graph_mthd_bind_nv04_patt }, | ||
974 | { 0x0190, nv04_graph_mthd_bind_rop }, | ||
975 | { 0x0194, nv04_graph_mthd_bind_beta1 }, | ||
976 | { 0x0198, nv04_graph_mthd_bind_beta4 }, | ||
977 | { 0x019c, nv04_graph_mthd_bind_surf2d }, | ||
978 | { 0x02fc, nv04_graph_mthd_set_operation }, | ||
979 | {}, | ||
980 | }; | ||
981 | |||
982 | static struct nouveau_pgraph_object_method nv04_graph_mthds_nv04_iifc[] = { | ||
983 | { 0x0188, nv04_graph_mthd_bind_chroma }, | ||
984 | { 0x018c, nv04_graph_mthd_bind_clip }, | ||
985 | { 0x0190, nv04_graph_mthd_bind_nv04_patt }, | ||
986 | { 0x0194, nv04_graph_mthd_bind_rop }, | ||
987 | { 0x0198, nv04_graph_mthd_bind_beta1 }, | ||
988 | { 0x019c, nv04_graph_mthd_bind_beta4 }, | ||
989 | { 0x01a0, nv04_graph_mthd_bind_surf2d_swzsurf }, | ||
990 | { 0x03e4, nv04_graph_mthd_set_operation }, | ||
991 | {}, | ||
992 | }; | ||
993 | |||
994 | static struct nouveau_pgraph_object_method nv04_graph_mthds_nv01_ifc[] = { | ||
995 | { 0x0184, nv04_graph_mthd_bind_chroma }, | ||
996 | { 0x0188, nv04_graph_mthd_bind_clip }, | ||
997 | { 0x018c, nv04_graph_mthd_bind_nv01_patt }, | ||
998 | { 0x0190, nv04_graph_mthd_bind_rop }, | ||
999 | { 0x0194, nv04_graph_mthd_bind_beta1 }, | ||
1000 | { 0x0198, nv04_graph_mthd_bind_surf_dst }, | ||
1001 | { 0x02fc, nv04_graph_mthd_set_operation }, | ||
1002 | {}, | ||
1003 | }; | ||
1004 | |||
1005 | static struct nouveau_pgraph_object_method nv04_graph_mthds_nv03_sifc[] = { | ||
1006 | { 0x0184, nv04_graph_mthd_bind_chroma }, | ||
1007 | { 0x0188, nv04_graph_mthd_bind_nv01_patt }, | ||
1008 | { 0x018c, nv04_graph_mthd_bind_rop }, | ||
1009 | { 0x0190, nv04_graph_mthd_bind_beta1 }, | ||
1010 | { 0x0194, nv04_graph_mthd_bind_surf_dst }, | ||
560 | { 0x02fc, nv04_graph_mthd_set_operation }, | 1011 | { 0x02fc, nv04_graph_mthd_set_operation }, |
561 | {}, | 1012 | {}, |
562 | }; | 1013 | }; |
563 | 1014 | ||
1015 | static struct nouveau_pgraph_object_method nv04_graph_mthds_nv04_sifc[] = { | ||
1016 | { 0x0184, nv04_graph_mthd_bind_chroma }, | ||
1017 | { 0x0188, nv04_graph_mthd_bind_nv04_patt }, | ||
1018 | { 0x018c, nv04_graph_mthd_bind_rop }, | ||
1019 | { 0x0190, nv04_graph_mthd_bind_beta1 }, | ||
1020 | { 0x0194, nv04_graph_mthd_bind_beta4 }, | ||
1021 | { 0x0198, nv04_graph_mthd_bind_surf2d }, | ||
1022 | { 0x02fc, nv04_graph_mthd_set_operation }, | ||
1023 | {}, | ||
1024 | }; | ||
1025 | |||
1026 | static struct nouveau_pgraph_object_method nv04_graph_mthds_nv03_sifm[] = { | ||
1027 | { 0x0188, nv04_graph_mthd_bind_nv01_patt }, | ||
1028 | { 0x018c, nv04_graph_mthd_bind_rop }, | ||
1029 | { 0x0190, nv04_graph_mthd_bind_beta1 }, | ||
1030 | { 0x0194, nv04_graph_mthd_bind_surf_dst }, | ||
1031 | { 0x0304, nv04_graph_mthd_set_operation }, | ||
1032 | {}, | ||
1033 | }; | ||
1034 | |||
1035 | static struct nouveau_pgraph_object_method nv04_graph_mthds_nv04_sifm[] = { | ||
1036 | { 0x0188, nv04_graph_mthd_bind_nv04_patt }, | ||
1037 | { 0x018c, nv04_graph_mthd_bind_rop }, | ||
1038 | { 0x0190, nv04_graph_mthd_bind_beta1 }, | ||
1039 | { 0x0194, nv04_graph_mthd_bind_beta4 }, | ||
1040 | { 0x0198, nv04_graph_mthd_bind_surf2d_swzsurf }, | ||
1041 | { 0x0304, nv04_graph_mthd_set_operation }, | ||
1042 | {}, | ||
1043 | }; | ||
1044 | |||
1045 | static struct nouveau_pgraph_object_method nv04_graph_mthds_nv01_shape[] = { | ||
1046 | { 0x0184, nv04_graph_mthd_bind_clip }, | ||
1047 | { 0x0188, nv04_graph_mthd_bind_nv01_patt }, | ||
1048 | { 0x018c, nv04_graph_mthd_bind_rop }, | ||
1049 | { 0x0190, nv04_graph_mthd_bind_beta1 }, | ||
1050 | { 0x0194, nv04_graph_mthd_bind_surf_dst }, | ||
1051 | { 0x02fc, nv04_graph_mthd_set_operation }, | ||
1052 | {}, | ||
1053 | }; | ||
1054 | |||
1055 | static struct nouveau_pgraph_object_method nv04_graph_mthds_nv04_shape[] = { | ||
1056 | { 0x0184, nv04_graph_mthd_bind_clip }, | ||
1057 | { 0x0188, nv04_graph_mthd_bind_nv04_patt }, | ||
1058 | { 0x018c, nv04_graph_mthd_bind_rop }, | ||
1059 | { 0x0190, nv04_graph_mthd_bind_beta1 }, | ||
1060 | { 0x0194, nv04_graph_mthd_bind_beta4 }, | ||
1061 | { 0x0198, nv04_graph_mthd_bind_surf2d }, | ||
1062 | { 0x02fc, nv04_graph_mthd_set_operation }, | ||
1063 | {}, | ||
1064 | }; | ||
1065 | |||
1066 | static struct nouveau_pgraph_object_method nv04_graph_mthds_nv03_tex_tri[] = { | ||
1067 | { 0x0188, nv04_graph_mthd_bind_clip }, | ||
1068 | { 0x018c, nv04_graph_mthd_bind_surf_color }, | ||
1069 | { 0x0190, nv04_graph_mthd_bind_surf_zeta }, | ||
1070 | {}, | ||
1071 | }; | ||
1072 | |||
1073 | static struct nouveau_pgraph_object_method nv04_graph_mthds_surf3d[] = { | ||
1074 | { 0x02f8, nv04_graph_mthd_surf3d_clip_h }, | ||
1075 | { 0x02fc, nv04_graph_mthd_surf3d_clip_v }, | ||
1076 | {}, | ||
1077 | }; | ||
1078 | |||
564 | struct nouveau_pgraph_object_class nv04_graph_grclass[] = { | 1079 | struct nouveau_pgraph_object_class nv04_graph_grclass[] = { |
565 | { 0x0039, false, NULL }, | 1080 | { 0x0038, false, NULL }, /* dvd subpicture */ |
566 | { 0x004a, false, nv04_graph_mthds_set_operation }, /* gdirect */ | 1081 | { 0x0039, false, NULL }, /* m2mf */ |
567 | { 0x005f, false, nv04_graph_mthds_set_operation }, /* imageblit */ | 1082 | { 0x004b, false, nv04_graph_mthds_nv03_gdirect }, /* nv03 gdirect */ |
568 | { 0x0061, false, nv04_graph_mthds_set_operation }, /* ifc */ | 1083 | { 0x004a, false, nv04_graph_mthds_nv04_gdirect }, /* nv04 gdirect */ |
569 | { 0x0077, false, nv04_graph_mthds_set_operation }, /* sifm */ | 1084 | { 0x001f, false, nv04_graph_mthds_nv01_imageblit }, /* nv01 imageblit */ |
1085 | { 0x005f, false, nv04_graph_mthds_nv04_imageblit_ifc }, /* nv04 imageblit */ | ||
1086 | { 0x0060, false, nv04_graph_mthds_nv04_iifc }, /* nv04 iifc */ | ||
1087 | { 0x0064, false, NULL }, /* nv05 iifc */ | ||
1088 | { 0x0021, false, nv04_graph_mthds_nv01_ifc }, /* nv01 ifc */ | ||
1089 | { 0x0061, false, nv04_graph_mthds_nv04_imageblit_ifc }, /* nv04 ifc */ | ||
1090 | { 0x0065, false, NULL }, /* nv05 ifc */ | ||
1091 | { 0x0036, false, nv04_graph_mthds_nv03_sifc }, /* nv03 sifc */ | ||
1092 | { 0x0076, false, nv04_graph_mthds_nv04_sifc }, /* nv04 sifc */ | ||
1093 | { 0x0066, false, NULL }, /* nv05 sifc */ | ||
1094 | { 0x0037, false, nv04_graph_mthds_nv03_sifm }, /* nv03 sifm */ | ||
1095 | { 0x0077, false, nv04_graph_mthds_nv04_sifm }, /* nv04 sifm */ | ||
570 | { 0x0030, false, NULL }, /* null */ | 1096 | { 0x0030, false, NULL }, /* null */ |
571 | { 0x0042, false, NULL }, /* surf2d */ | 1097 | { 0x0042, false, NULL }, /* surf2d */ |
572 | { 0x0043, false, NULL }, /* rop */ | 1098 | { 0x0043, false, NULL }, /* rop */ |
573 | { 0x0012, false, NULL }, /* beta1 */ | 1099 | { 0x0012, false, NULL }, /* beta1 */ |
574 | { 0x0072, false, NULL }, /* beta4 */ | 1100 | { 0x0072, false, NULL }, /* beta4 */ |
575 | { 0x0019, false, NULL }, /* cliprect */ | 1101 | { 0x0019, false, NULL }, /* cliprect */ |
576 | { 0x0044, false, NULL }, /* pattern */ | 1102 | { 0x0018, false, NULL }, /* nv01 pattern */ |
1103 | { 0x0044, false, NULL }, /* nv04 pattern */ | ||
577 | { 0x0052, false, NULL }, /* swzsurf */ | 1104 | { 0x0052, false, NULL }, /* swzsurf */ |
578 | { 0x0053, false, NULL }, /* surf3d */ | 1105 | { 0x0053, false, nv04_graph_mthds_surf3d }, /* surf3d */ |
1106 | { 0x0048, false, nv04_graph_mthds_nv03_tex_tri }, /* nv03 tex_tri */ | ||
579 | { 0x0054, false, NULL }, /* tex_tri */ | 1107 | { 0x0054, false, NULL }, /* tex_tri */ |
580 | { 0x0055, false, NULL }, /* multitex_tri */ | 1108 | { 0x0055, false, NULL }, /* multitex_tri */ |
1109 | { 0x0017, false, NULL }, /* nv01 chroma */ | ||
1110 | { 0x0057, false, NULL }, /* nv04 chroma */ | ||
1111 | { 0x0058, false, NULL }, /* surf_dst */ | ||
1112 | { 0x0059, false, NULL }, /* surf_src */ | ||
1113 | { 0x005a, false, NULL }, /* surf_color */ | ||
1114 | { 0x005b, false, NULL }, /* surf_zeta */ | ||
1115 | { 0x001c, false, nv04_graph_mthds_nv01_shape }, /* nv01 line */ | ||
1116 | { 0x005c, false, nv04_graph_mthds_nv04_shape }, /* nv04 line */ | ||
1117 | { 0x001d, false, nv04_graph_mthds_nv01_shape }, /* nv01 tri */ | ||
1118 | { 0x005d, false, nv04_graph_mthds_nv04_shape }, /* nv04 tri */ | ||
1119 | { 0x001e, false, nv04_graph_mthds_nv01_shape }, /* nv01 rect */ | ||
1120 | { 0x005e, false, nv04_graph_mthds_nv04_shape }, /* nv04 rect */ | ||
581 | { 0x506e, true, nv04_graph_mthds_sw }, | 1121 | { 0x506e, true, nv04_graph_mthds_sw }, |
582 | {} | 1122 | {} |
583 | }; | 1123 | }; |