freedreno: Make the slice pitch be bytes, not pixels.
[mesa.git] / src / gallium / drivers / freedreno / a6xx / fd6_blitter.c
index d129183bfae5d13390cf85431b273e0b8997fab6..2da8438fbc387d4fc2875c5dd30b284f15c65041 100644 (file)
@@ -339,7 +339,6 @@ emit_blit_or_clear_texture(struct fd_context *ctx, struct fd_ringbuffer *ring,
        enum a6xx_format sfmt, dfmt;
        enum a6xx_tile_mode stile, dtile;
        enum a3xx_color_swap sswap, dswap;
-       unsigned spitch, dpitch;
        int sx1, sy1, sx2, sy2;
        int dx1, dy1, dx2, dy2;
 
@@ -371,12 +370,6 @@ emit_blit_or_clear_texture(struct fd_context *ctx, struct fd_ringbuffer *ring,
        sswap = fd6_resource_swap(src, info->src.format);
        dswap = fd6_resource_swap(dst, info->dst.format);
 
-       /* Use the underlying resource format so that we get the right block width
-        * for compressed textures.
-        */
-       spitch = util_format_get_nblocksx(src->base.format, sslice->pitch) * src->layout.cpp;
-       dpitch = util_format_get_nblocksx(dst->base.format, dslice->pitch) * dst->layout.cpp;
-
        uint32_t nr_samples = fd_resource_nr_samples(&dst->base);
        sx1 = sbox->x * nr_samples;
        sy1 = sbox->y;
@@ -507,7 +500,7 @@ emit_blit_or_clear_texture(struct fd_context *ctx, struct fd_ringbuffer *ring,
                OUT_RING(ring, A6XX_SP_PS_2D_SRC_SIZE_WIDTH(width) |
                                 A6XX_SP_PS_2D_SRC_SIZE_HEIGHT(height)); /* SP_PS_2D_SRC_SIZE */
                OUT_RELOC(ring, src->bo, soff, 0, 0);    /* SP_PS_2D_SRC_LO/HI */
-               OUT_RING(ring, A6XX_SP_PS_2D_SRC_PITCH_PITCH(spitch));
+               OUT_RING(ring, A6XX_SP_PS_2D_SRC_PITCH_PITCH(sslice->pitch));
 
                OUT_RING(ring, 0x00000000);
                OUT_RING(ring, 0x00000000);
@@ -533,7 +526,7 @@ emit_blit_or_clear_texture(struct fd_context *ctx, struct fd_ringbuffer *ring,
                                 COND(util_format_is_srgb(info->dst.format), A6XX_RB_2D_DST_INFO_SRGB) |
                                 COND(dubwc_enabled, A6XX_RB_2D_DST_INFO_FLAGS));
                OUT_RELOCW(ring, dst->bo, doff, 0, 0);    /* RB_2D_DST_LO/HI */
-               OUT_RING(ring, A6XX_RB_2D_DST_SIZE_PITCH(dpitch));
+               OUT_RING(ring, A6XX_RB_2D_DST_SIZE_PITCH(dslice->pitch));
                OUT_RING(ring, 0x00000000);
                OUT_RING(ring, 0x00000000);
                OUT_RING(ring, 0x00000000);