aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/a3xx/fd3_resource.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2020-04-14 11:14:31 -0700
committerMarge Bot <[email protected]>2020-04-23 16:37:50 +0000
commit5a8718f01b3976e1bc82362a907befef68a7f525 (patch)
tree41cd79d33265f29d7249464bc946017c6d9a77ac /src/gallium/drivers/freedreno/a3xx/fd3_resource.c
parentbd76a24fd130bb5a45fea72a3041104ccfb4a8d1 (diff)
freedreno: Make the slice pitch be bytes, not pixels.
Back in a2xx, HW pitches were in pixels, so storing that was reasonable. Ever since then, the HW wants pitches in bytes, and we have only one instance of using pitch in pixels in the code (a3xx sysmem path). Flip things around so that only a2xx has to worry about the cpp for looking at pitches. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4558>
Diffstat (limited to 'src/gallium/drivers/freedreno/a3xx/fd3_resource.c')
-rw-r--r--src/gallium/drivers/freedreno/a3xx/fd3_resource.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_resource.c b/src/gallium/drivers/freedreno/a3xx/fd3_resource.c
index 6089ca01e40..0a58c16abc6 100644
--- a/src/gallium/drivers/freedreno/a3xx/fd3_resource.c
+++ b/src/gallium/drivers/freedreno/a3xx/fd3_resource.c
@@ -63,6 +63,8 @@ setup_slices(struct fd_resource *rsc, uint32_t alignment, enum pipe_format forma
slice->pitch = width = align(width, pitchalign);
blocks = util_format_get_nblocks(format, slice->pitch, height);
}
+ slice->pitch = util_format_get_nblocksx(format, slice->pitch) *
+ rsc->layout.cpp;
slice->offset = size;
/* 1d array and 2d array textures must all have the same layer size