freedreno: a2xx: fix gmem2mem viewport
authorJonathan Marek <jonathan@marek.ca>
Mon, 10 Dec 2018 04:14:41 +0000 (23:14 -0500)
committerRob Clark <robdclark@gmail.com>
Mon, 21 Jan 2019 14:22:16 +0000 (09:22 -0500)
Fixes cases where previous viewport values might case gmem2mem to fail.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/a2xx/fd2_gmem.c

index 199bf948b92f4c31d0cf0b02f8f8a5bd0ba09505..6ffeefb3784534bf7cb8de41c78290b06af4598b 100644 (file)
@@ -160,6 +160,13 @@ fd2_emit_tile_gmem2mem(struct fd_batch *batch, struct fd_tile *tile)
        OUT_RING(ring, CP_REG(REG_A2XX_PA_CL_CLIP_CNTL));
        OUT_RING(ring, 0x00000000);
 
+       OUT_PKT3(ring, CP_SET_CONSTANT, 5);
+       OUT_RING(ring, CP_REG(REG_A2XX_PA_CL_VPORT_XSCALE));
+       OUT_RING(ring, fui((float) tile->bin_w / 2.0)); /* XSCALE */
+       OUT_RING(ring, fui((float) tile->bin_w / 2.0)); /* XOFFSET */
+       OUT_RING(ring, fui((float) tile->bin_h / 2.0)); /* YSCALE */
+       OUT_RING(ring, fui((float) tile->bin_h / 2.0)); /* YOFFSET */
+
        OUT_PKT3(ring, CP_SET_CONSTANT, 2);
        OUT_RING(ring, CP_REG(REG_A2XX_RB_MODECONTROL));
        OUT_RING(ring, A2XX_RB_MODECONTROL_EDRAM_MODE(EDRAM_COPY));