aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichel Dänzer2014-09-26 04:19:12 -0500
committerMichel Dänzer2014-09-29 02:50:06 -0500
commitc866dc7c00e7f5f219901a9a81bf456a24d29cd1 (patch)
treee14a994f6f19684f4ed82ae7974fc76fa02c31a2
parent7068d987f4dc1260a948f2b4782c66d3d80e9978 (diff)
downloadexternal-libdrm-c866dc7c00e7f5f219901a9a81bf456a24d29cd1.tar.gz
external-libdrm-c866dc7c00e7f5f219901a9a81bf456a24d29cd1.tar.xz
external-libdrm-c866dc7c00e7f5f219901a9a81bf456a24d29cd1.zip
radeon: Always multiply pitch_bytes by nsamples, not by slice_pt
slice_pt is tileb[0] / tile_split, which isn't directly related to the pitch. This caused pitch_bytes to be too large in some cases. [0] Tile size in bytes Reviewed-by: Marek Olšák <marek.olsak@amd.com>
-rw-r--r--radeon/radeon_surface.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/radeon/radeon_surface.c b/radeon/radeon_surface.c
index 0723425e..930017ef 100644
--- a/radeon/radeon_surface.c
+++ b/radeon/radeon_surface.c
@@ -595,7 +595,7 @@ static void eg_surf_minify(struct radeon_surface *surf,
595 mtile_ps = (mtile_pr * surflevel->nblk_y) / mtileh; 595 mtile_ps = (mtile_pr * surflevel->nblk_y) / mtileh;
596 596
597 surflevel->offset = offset; 597 surflevel->offset = offset;
598 surflevel->pitch_bytes = surflevel->nblk_x * bpe * slice_pt; 598 surflevel->pitch_bytes = surflevel->nblk_x * bpe * surf->nsamples;
599 surflevel->slice_size = mtile_ps * mtileb * slice_pt; 599 surflevel->slice_size = mtile_ps * mtileb * slice_pt;
600 600
601 surf->bo_size = offset + surflevel->slice_size * surflevel->nblk_z * surf->array_size; 601 surf->bo_size = offset + surflevel->slice_size * surflevel->nblk_z * surf->array_size;
@@ -1498,7 +1498,7 @@ static void si_surf_minify_2d(struct radeon_surface *surf,
1498 /* macro tile per slice */ 1498 /* macro tile per slice */
1499 mtile_ps = (mtile_pr * surflevel->nblk_y) / yalign; 1499 mtile_ps = (mtile_pr * surflevel->nblk_y) / yalign;
1500 surflevel->offset = offset; 1500 surflevel->offset = offset;
1501 surflevel->pitch_bytes = surflevel->nblk_x * bpe * slice_pt; 1501 surflevel->pitch_bytes = surflevel->nblk_x * bpe * surf->nsamples;
1502 surflevel->slice_size = mtile_ps * mtileb * slice_pt; 1502 surflevel->slice_size = mtile_ps * mtileb * slice_pt;
1503 1503
1504 surf->bo_size = offset + surflevel->slice_size * surflevel->nblk_z * surf->array_size; 1504 surf->bo_size = offset + surflevel->slice_size * surflevel->nblk_z * surf->array_size;