diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/r300.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r300.c | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c index 55fe5ba7def3..069efa8c8ecf 100644 --- a/drivers/gpu/drm/radeon/r300.c +++ b/drivers/gpu/drm/radeon/r300.c | |||
@@ -667,6 +667,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p, | |||
667 | } | 667 | } |
668 | track->cb[i].robj = reloc->robj; | 668 | track->cb[i].robj = reloc->robj; |
669 | track->cb[i].offset = idx_value; | 669 | track->cb[i].offset = idx_value; |
670 | track->cb_dirty = true; | ||
670 | ib[idx] = idx_value + ((u32)reloc->lobj.gpu_offset); | 671 | ib[idx] = idx_value + ((u32)reloc->lobj.gpu_offset); |
671 | break; | 672 | break; |
672 | case R300_ZB_DEPTHOFFSET: | 673 | case R300_ZB_DEPTHOFFSET: |
@@ -679,6 +680,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p, | |||
679 | } | 680 | } |
680 | track->zb.robj = reloc->robj; | 681 | track->zb.robj = reloc->robj; |
681 | track->zb.offset = idx_value; | 682 | track->zb.offset = idx_value; |
683 | track->zb_dirty = true; | ||
682 | ib[idx] = idx_value + ((u32)reloc->lobj.gpu_offset); | 684 | ib[idx] = idx_value + ((u32)reloc->lobj.gpu_offset); |
683 | break; | 685 | break; |
684 | case R300_TX_OFFSET_0: | 686 | case R300_TX_OFFSET_0: |
@@ -717,6 +719,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p, | |||
717 | tmp |= tile_flags; | 719 | tmp |= tile_flags; |
718 | ib[idx] = tmp; | 720 | ib[idx] = tmp; |
719 | track->textures[i].robj = reloc->robj; | 721 | track->textures[i].robj = reloc->robj; |
722 | track->tex_dirty = true; | ||
720 | break; | 723 | break; |
721 | /* Tracked registers */ | 724 | /* Tracked registers */ |
722 | case 0x2084: | 725 | case 0x2084: |
@@ -743,6 +746,8 @@ static int r300_packet0_check(struct radeon_cs_parser *p, | |||
743 | if (p->rdev->family < CHIP_RV515) { | 746 | if (p->rdev->family < CHIP_RV515) { |
744 | track->maxy -= 1440; | 747 | track->maxy -= 1440; |
745 | } | 748 | } |
749 | track->cb_dirty = true; | ||
750 | track->zb_dirty = true; | ||
746 | break; | 751 | break; |
747 | case 0x4E00: | 752 | case 0x4E00: |
748 | /* RB3D_CCTL */ | 753 | /* RB3D_CCTL */ |
@@ -752,6 +757,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p, | |||
752 | return -EINVAL; | 757 | return -EINVAL; |
753 | } | 758 | } |
754 | track->num_cb = ((idx_value >> 5) & 0x3) + 1; | 759 | track->num_cb = ((idx_value >> 5) & 0x3) + 1; |
760 | track->cb_dirty = true; | ||
755 | break; | 761 | break; |
756 | case 0x4E38: | 762 | case 0x4E38: |
757 | case 0x4E3C: | 763 | case 0x4E3C: |
@@ -814,6 +820,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p, | |||
814 | ((idx_value >> 21) & 0xF)); | 820 | ((idx_value >> 21) & 0xF)); |
815 | return -EINVAL; | 821 | return -EINVAL; |
816 | } | 822 | } |
823 | track->cb_dirty = true; | ||
817 | break; | 824 | break; |
818 | case 0x4F00: | 825 | case 0x4F00: |
819 | /* ZB_CNTL */ | 826 | /* ZB_CNTL */ |
@@ -822,6 +829,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p, | |||
822 | } else { | 829 | } else { |
823 | track->z_enabled = false; | 830 | track->z_enabled = false; |
824 | } | 831 | } |
832 | track->zb_dirty = true; | ||
825 | break; | 833 | break; |
826 | case 0x4F10: | 834 | case 0x4F10: |
827 | /* ZB_FORMAT */ | 835 | /* ZB_FORMAT */ |
@@ -838,6 +846,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p, | |||
838 | (idx_value & 0xF)); | 846 | (idx_value & 0xF)); |
839 | return -EINVAL; | 847 | return -EINVAL; |
840 | } | 848 | } |
849 | track->zb_dirty = true; | ||
841 | break; | 850 | break; |
842 | case 0x4F24: | 851 | case 0x4F24: |
843 | /* ZB_DEPTHPITCH */ | 852 | /* ZB_DEPTHPITCH */ |
@@ -861,14 +870,17 @@ static int r300_packet0_check(struct radeon_cs_parser *p, | |||
861 | ib[idx] = tmp; | 870 | ib[idx] = tmp; |
862 | 871 | ||
863 | track->zb.pitch = idx_value & 0x3FFC; | 872 | track->zb.pitch = idx_value & 0x3FFC; |
873 | track->zb_dirty = true; | ||
864 | break; | 874 | break; |
865 | case 0x4104: | 875 | case 0x4104: |
876 | /* TX_ENABLE */ | ||
866 | for (i = 0; i < 16; i++) { | 877 | for (i = 0; i < 16; i++) { |
867 | bool enabled; | 878 | bool enabled; |
868 | 879 | ||
869 | enabled = !!(idx_value & (1 << i)); | 880 | enabled = !!(idx_value & (1 << i)); |
870 | track->textures[i].enabled = enabled; | 881 | track->textures[i].enabled = enabled; |
871 | } | 882 | } |
883 | track->tex_dirty = true; | ||
872 | break; | 884 | break; |
873 | case 0x44C0: | 885 | case 0x44C0: |
874 | case 0x44C4: | 886 | case 0x44C4: |
@@ -898,6 +910,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p, | |||
898 | track->textures[i].compress_format = R100_TRACK_COMP_NONE; | 910 | track->textures[i].compress_format = R100_TRACK_COMP_NONE; |
899 | break; | 911 | break; |
900 | case R300_TX_FORMAT_X16: | 912 | case R300_TX_FORMAT_X16: |
913 | case R300_TX_FORMAT_FL_I16: | ||
901 | case R300_TX_FORMAT_Y8X8: | 914 | case R300_TX_FORMAT_Y8X8: |
902 | case R300_TX_FORMAT_Z5Y6X5: | 915 | case R300_TX_FORMAT_Z5Y6X5: |
903 | case R300_TX_FORMAT_Z6Y5X5: | 916 | case R300_TX_FORMAT_Z6Y5X5: |
@@ -910,6 +923,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p, | |||
910 | track->textures[i].compress_format = R100_TRACK_COMP_NONE; | 923 | track->textures[i].compress_format = R100_TRACK_COMP_NONE; |
911 | break; | 924 | break; |
912 | case R300_TX_FORMAT_Y16X16: | 925 | case R300_TX_FORMAT_Y16X16: |
926 | case R300_TX_FORMAT_FL_I16A16: | ||
913 | case R300_TX_FORMAT_Z11Y11X10: | 927 | case R300_TX_FORMAT_Z11Y11X10: |
914 | case R300_TX_FORMAT_Z10Y11X11: | 928 | case R300_TX_FORMAT_Z10Y11X11: |
915 | case R300_TX_FORMAT_W8Z8Y8X8: | 929 | case R300_TX_FORMAT_W8Z8Y8X8: |
@@ -951,8 +965,8 @@ static int r300_packet0_check(struct radeon_cs_parser *p, | |||
951 | DRM_ERROR("Invalid texture format %u\n", | 965 | DRM_ERROR("Invalid texture format %u\n", |
952 | (idx_value & 0x1F)); | 966 | (idx_value & 0x1F)); |
953 | return -EINVAL; | 967 | return -EINVAL; |
954 | break; | ||
955 | } | 968 | } |
969 | track->tex_dirty = true; | ||
956 | break; | 970 | break; |
957 | case 0x4400: | 971 | case 0x4400: |
958 | case 0x4404: | 972 | case 0x4404: |
@@ -980,6 +994,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p, | |||
980 | if (tmp == 2 || tmp == 4 || tmp == 6) { | 994 | if (tmp == 2 || tmp == 4 || tmp == 6) { |
981 | track->textures[i].roundup_h = false; | 995 | track->textures[i].roundup_h = false; |
982 | } | 996 | } |
997 | track->tex_dirty = true; | ||
983 | break; | 998 | break; |
984 | case 0x4500: | 999 | case 0x4500: |
985 | case 0x4504: | 1000 | case 0x4504: |
@@ -1017,6 +1032,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p, | |||
1017 | DRM_ERROR("Forbidden bit TXFORMAT_MSB\n"); | 1032 | DRM_ERROR("Forbidden bit TXFORMAT_MSB\n"); |
1018 | return -EINVAL; | 1033 | return -EINVAL; |
1019 | } | 1034 | } |
1035 | track->tex_dirty = true; | ||
1020 | break; | 1036 | break; |
1021 | case 0x4480: | 1037 | case 0x4480: |
1022 | case 0x4484: | 1038 | case 0x4484: |
@@ -1046,6 +1062,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p, | |||
1046 | track->textures[i].use_pitch = !!tmp; | 1062 | track->textures[i].use_pitch = !!tmp; |
1047 | tmp = (idx_value >> 22) & 0xF; | 1063 | tmp = (idx_value >> 22) & 0xF; |
1048 | track->textures[i].txdepth = tmp; | 1064 | track->textures[i].txdepth = tmp; |
1065 | track->tex_dirty = true; | ||
1049 | break; | 1066 | break; |
1050 | case R300_ZB_ZPASS_ADDR: | 1067 | case R300_ZB_ZPASS_ADDR: |
1051 | r = r100_cs_packet_next_reloc(p, &reloc); | 1068 | r = r100_cs_packet_next_reloc(p, &reloc); |
@@ -1060,6 +1077,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p, | |||
1060 | case 0x4e0c: | 1077 | case 0x4e0c: |
1061 | /* RB3D_COLOR_CHANNEL_MASK */ | 1078 | /* RB3D_COLOR_CHANNEL_MASK */ |
1062 | track->color_channel_mask = idx_value; | 1079 | track->color_channel_mask = idx_value; |
1080 | track->cb_dirty = true; | ||
1063 | break; | 1081 | break; |
1064 | case 0x43a4: | 1082 | case 0x43a4: |
1065 | /* SC_HYPERZ_EN */ | 1083 | /* SC_HYPERZ_EN */ |
@@ -1073,6 +1091,8 @@ static int r300_packet0_check(struct radeon_cs_parser *p, | |||
1073 | case 0x4f1c: | 1091 | case 0x4f1c: |
1074 | /* ZB_BW_CNTL */ | 1092 | /* ZB_BW_CNTL */ |
1075 | track->zb_cb_clear = !!(idx_value & (1 << 5)); | 1093 | track->zb_cb_clear = !!(idx_value & (1 << 5)); |
1094 | track->cb_dirty = true; | ||
1095 | track->zb_dirty = true; | ||
1076 | if (p->rdev->hyperz_filp != p->filp) { | 1096 | if (p->rdev->hyperz_filp != p->filp) { |
1077 | if (idx_value & (R300_HIZ_ENABLE | | 1097 | if (idx_value & (R300_HIZ_ENABLE | |
1078 | R300_RD_COMP_ENABLE | | 1098 | R300_RD_COMP_ENABLE | |
@@ -1084,8 +1104,28 @@ static int r300_packet0_check(struct radeon_cs_parser *p, | |||
1084 | case 0x4e04: | 1104 | case 0x4e04: |
1085 | /* RB3D_BLENDCNTL */ | 1105 | /* RB3D_BLENDCNTL */ |
1086 | track->blend_read_enable = !!(idx_value & (1 << 2)); | 1106 | track->blend_read_enable = !!(idx_value & (1 << 2)); |
1107 | track->cb_dirty = true; | ||
1108 | break; | ||
1109 | case R300_RB3D_AARESOLVE_OFFSET: | ||
1110 | r = r100_cs_packet_next_reloc(p, &reloc); | ||
1111 | if (r) { | ||
1112 | DRM_ERROR("No reloc for ib[%d]=0x%04X\n", | ||
1113 | idx, reg); | ||
1114 | r100_cs_dump_packet(p, pkt); | ||
1115 | return r; | ||
1116 | } | ||
1117 | track->aa.robj = reloc->robj; | ||
1118 | track->aa.offset = idx_value; | ||
1119 | track->aa_dirty = true; | ||
1120 | ib[idx] = idx_value + ((u32)reloc->lobj.gpu_offset); | ||
1121 | break; | ||
1122 | case R300_RB3D_AARESOLVE_PITCH: | ||
1123 | track->aa.pitch = idx_value & 0x3FFE; | ||
1124 | track->aa_dirty = true; | ||
1087 | break; | 1125 | break; |
1088 | case 0x4f28: /* ZB_DEPTHCLEARVALUE */ | 1126 | case R300_RB3D_AARESOLVE_CTL: |
1127 | track->aaresolve = idx_value & 0x1; | ||
1128 | track->aa_dirty = true; | ||
1089 | break; | 1129 | break; |
1090 | case 0x4f30: /* ZB_MASK_OFFSET */ | 1130 | case 0x4f30: /* ZB_MASK_OFFSET */ |
1091 | case 0x4f34: /* ZB_ZMASK_PITCH */ | 1131 | case 0x4f34: /* ZB_ZMASK_PITCH */ |