diff options
-rw-r--r-- | drivers/gpu/drm/radeon/r100.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index 3ae51ada1abf..e40dbdc4ebb3 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c | |||
@@ -2890,7 +2890,7 @@ static int r100_cs_track_texture_check(struct radeon_device *rdev, | |||
2890 | { | 2890 | { |
2891 | struct radeon_bo *robj; | 2891 | struct radeon_bo *robj; |
2892 | unsigned long size; | 2892 | unsigned long size; |
2893 | unsigned u, i, w, h; | 2893 | unsigned u, i, w, h, d; |
2894 | int ret; | 2894 | int ret; |
2895 | 2895 | ||
2896 | for (u = 0; u < track->num_texture; u++) { | 2896 | for (u = 0; u < track->num_texture; u++) { |
@@ -2922,20 +2922,25 @@ static int r100_cs_track_texture_check(struct radeon_device *rdev, | |||
2922 | h = h / (1 << i); | 2922 | h = h / (1 << i); |
2923 | if (track->textures[u].roundup_h) | 2923 | if (track->textures[u].roundup_h) |
2924 | h = roundup_pow_of_two(h); | 2924 | h = roundup_pow_of_two(h); |
2925 | if (track->textures[u].tex_coord_type == 1) { | ||
2926 | d = (1 << track->textures[u].txdepth) / (1 << i); | ||
2927 | if (!d) | ||
2928 | d = 1; | ||
2929 | } else { | ||
2930 | d = 1; | ||
2931 | } | ||
2925 | if (track->textures[u].compress_format) { | 2932 | if (track->textures[u].compress_format) { |
2926 | 2933 | ||
2927 | size += r100_track_compress_size(track->textures[u].compress_format, w, h); | 2934 | size += r100_track_compress_size(track->textures[u].compress_format, w, h) * d; |
2928 | /* compressed textures are block based */ | 2935 | /* compressed textures are block based */ |
2929 | } else | 2936 | } else |
2930 | size += w * h; | 2937 | size += w * h * d; |
2931 | } | 2938 | } |
2932 | size *= track->textures[u].cpp; | 2939 | size *= track->textures[u].cpp; |
2933 | 2940 | ||
2934 | switch (track->textures[u].tex_coord_type) { | 2941 | switch (track->textures[u].tex_coord_type) { |
2935 | case 0: | 2942 | case 0: |
2936 | break; | ||
2937 | case 1: | 2943 | case 1: |
2938 | size *= (1 << track->textures[u].txdepth); | ||
2939 | break; | 2944 | break; |
2940 | case 2: | 2945 | case 2: |
2941 | if (track->separate_cube) { | 2946 | if (track->separate_cube) { |