aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/r300.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/r300.c')
-rw-r--r--drivers/gpu/drm/radeon/r300.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
index 83490c2b5061..3f2cc9e2e8d9 100644
--- a/drivers/gpu/drm/radeon/r300.c
+++ b/drivers/gpu/drm/radeon/r300.c
@@ -887,6 +887,14 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
887 track->textures[i].cpp = 1; 887 track->textures[i].cpp = 1;
888 track->textures[i].compress_format = R100_TRACK_COMP_DXT1; 888 track->textures[i].compress_format = R100_TRACK_COMP_DXT1;
889 break; 889 break;
890 case R300_TX_FORMAT_ATI2N:
891 if (p->rdev->family < CHIP_R420) {
892 DRM_ERROR("Invalid texture format %u\n",
893 (idx_value & 0x1F));
894 return -EINVAL;
895 }
896 /* The same rules apply as for DXT3/5. */
897 /* Pass through. */
890 case R300_TX_FORMAT_DXT3: 898 case R300_TX_FORMAT_DXT3:
891 case R300_TX_FORMAT_DXT5: 899 case R300_TX_FORMAT_DXT5:
892 track->textures[i].cpp = 1; 900 track->textures[i].cpp = 1;
@@ -951,6 +959,16 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
951 track->textures[i].width_11 = tmp; 959 track->textures[i].width_11 = tmp;
952 tmp = ((idx_value >> 16) & 1) << 11; 960 tmp = ((idx_value >> 16) & 1) << 11;
953 track->textures[i].height_11 = tmp; 961 track->textures[i].height_11 = tmp;
962
963 /* ATI1N */
964 if (idx_value & (1 << 14)) {
965 /* The same rules apply as for DXT1. */
966 track->textures[i].compress_format =
967 R100_TRACK_COMP_DXT1;
968 }
969 } else if (idx_value & (1 << 14)) {
970 DRM_ERROR("Forbidden bit TXFORMAT_MSB\n");
971 return -EINVAL;
954 } 972 }
955 break; 973 break;
956 case 0x4480: 974 case 0x4480:
@@ -992,6 +1010,18 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
992 } 1010 }
993 ib[idx] = idx_value + ((u32)reloc->lobj.gpu_offset); 1011 ib[idx] = idx_value + ((u32)reloc->lobj.gpu_offset);
994 break; 1012 break;
1013 case 0x4e0c:
1014 /* RB3D_COLOR_CHANNEL_MASK */
1015 track->color_channel_mask = idx_value;
1016 break;
1017 case 0x4d1c:
1018 /* ZB_BW_CNTL */
1019 track->fastfill = !!(idx_value & (1 << 2));
1020 break;
1021 case 0x4e04:
1022 /* RB3D_BLENDCNTL */
1023 track->blend_read_enable = !!(idx_value & (1 << 2));
1024 break;
995 case 0x4be8: 1025 case 0x4be8:
996 /* valid register only on RV530 */ 1026 /* valid register only on RV530 */
997 if (p->rdev->family == CHIP_RV530) 1027 if (p->rdev->family == CHIP_RV530)