summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2016-12-07 10:17:17 -0500
committerRob Clark <[email protected]>2016-12-18 13:46:48 -0500
commit5e632b3a830d61ef0e12251ea24b46a085ebf69b (patch)
tree9d0a6294b24e3cfe4b8e6247f333e679fed3bd54 /src/gallium/drivers/freedreno
parent0f2e9a898611fecc47fa3f8040b6d6f32721b747 (diff)
freedreno/a5xx: fix stride/size for mem->gmem blits
<brownpaperbag>these should be the in-GMEM dimensions</brownpaperbag> Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno')
-rw-r--r--src/gallium/drivers/freedreno/a5xx/fd5_gmem.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_gmem.c b/src/gallium/drivers/freedreno/a5xx/fd5_gmem.c
index 1b6b784a252..cf1cd76fea8 100644
--- a/src/gallium/drivers/freedreno/a5xx/fd5_gmem.c
+++ b/src/gallium/drivers/freedreno/a5xx/fd5_gmem.c
@@ -287,13 +287,15 @@ emit_mem2gmem_surf(struct fd_batch *batch, uint32_t base,
struct pipe_surface *psurf, enum a5xx_blit_buf buf)
{
struct fd_ringbuffer *ring = batch->gmem;
+ struct fd_gmem_stateobj *gmem = &batch->ctx->gmem;
struct fd_resource *rsc = fd_resource(psurf->texture);
- struct fd_resource_slice *slice;
-
- slice = fd_resource_slice(rsc, psurf->u.tex.level);
+ uint32_t stride, size;
debug_assert(psurf->u.tex.first_layer == psurf->u.tex.last_layer);
+ stride = gmem->bin_w * rsc->cpp;
+ size = stride * gmem->bin_h;
+
OUT_PKT4(ring, REG_A5XX_RB_BLIT_FLAG_DST_LO, 4);
OUT_RING(ring, 0x00000000); /* RB_BLIT_FLAG_DST_LO */
OUT_RING(ring, 0x00000000); /* RB_BLIT_FLAG_DST_HI */
@@ -304,8 +306,8 @@ emit_mem2gmem_surf(struct fd_batch *batch, uint32_t base,
OUT_RING(ring, 0x00000000); /* RB_RESOLVE_CNTL_3 */
OUT_RING(ring, base); /* RB_BLIT_DST_LO */
OUT_RING(ring, 0x00000000); /* RB_BLIT_DST_HI */
- OUT_RING(ring, A5XX_RB_BLIT_DST_PITCH(slice->pitch * rsc->cpp));
- OUT_RING(ring, A5XX_RB_BLIT_DST_ARRAY_PITCH(slice->size0));
+ OUT_RING(ring, A5XX_RB_BLIT_DST_PITCH(stride));
+ OUT_RING(ring, A5XX_RB_BLIT_DST_ARRAY_PITCH(size));
OUT_PKT4(ring, REG_A5XX_RB_BLIT_CNTL, 1);
OUT_RING(ring, A5XX_RB_BLIT_CNTL_BUF(buf));