freedreno: a2xx: minor solid_vertexbuf fixups
authorJonathan Marek <jonathan@marek.ca>
Wed, 23 Jan 2019 20:03:55 +0000 (15:03 -0500)
committerRob Clark <robdclark@gmail.com>
Mon, 28 Jan 2019 23:21:16 +0000 (18:21 -0500)
The big thing here is the 0x60 offset for the mem2gmem copy which I missed
in my last patch.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
src/gallium/drivers/freedreno/a2xx/fd2_context.c
src/gallium/drivers/freedreno/a2xx/fd2_draw.c
src/gallium/drivers/freedreno/a2xx/fd2_gmem.c

index 28073b0701144f918ce447def5479a3ce5eb519b..6d9dce2ffbec787aa1b62cfb36c554c9543ccdb5 100644 (file)
@@ -56,6 +56,8 @@ create_solid_vertexbuf(struct pipe_context *pctx)
                        +0.000000, +1.000000,
                        /* SCREEN_SCISSOR_BR value (must be at 60 byte offset in page) */
                        0.0,
+                       /* zero indices dummy draw workaround (3 16-bit zeros) */
+                       0.0, 0.0,
        };
        struct pipe_resource *prsc = pipe_buffer_create(pctx->screen,
                        PIPE_BIND_CUSTOM, PIPE_USAGE_IMMUTABLE, sizeof(init_shader_const));
index 05c4cd5391b8400abb2aa9528a809e18cb623107..772127c74789dad56aef92cbaab5703cbf0f9d71 100644 (file)
@@ -109,7 +109,7 @@ draw_impl(struct fd_context *ctx, const struct pipe_draw_info *info,
                OUT_RING(ring, 0x0003c004);
                OUT_RING(ring, 0x00000000);
                OUT_RING(ring, 0x00000003);
-               OUT_RELOC(ring, fd_resource(fd2_context(ctx)->solid_vertexbuf)->bo, 0x80, 0, 0);
+               OUT_RELOC(ring, fd_resource(fd2_context(ctx)->solid_vertexbuf)->bo, 64, 0, 0);
                OUT_RING(ring, 0x00000006);
        } else {
                OUT_WFI (ring);
index 17d6d6ef25aabb042f92c3d30a8e3598703f7bdb..1c073e31739c6a41af04e019b276e994b22a269d 100644 (file)
@@ -263,7 +263,7 @@ fd2_emit_tile_mem2gmem(struct fd_batch *batch, struct fd_tile *tile)
        float x0, y0, x1, y1;
 
        fd2_emit_vertex_bufs(ring, 0x9c, (struct fd2_vertex_buf[]) {
-                       { .prsc = fd2_ctx->solid_vertexbuf, .size = 36, },
+                       { .prsc = fd2_ctx->solid_vertexbuf, .size = 36 },
                        { .prsc = fd2_ctx->solid_vertexbuf, .size = 24, .offset = 36 },
                }, 2);
 
@@ -273,7 +273,7 @@ fd2_emit_tile_mem2gmem(struct fd_batch *batch, struct fd_tile *tile)
        y0 = ((float)tile->yoff) / ((float)pfb->height);
        y1 = ((float)tile->yoff + bin_h) / ((float)pfb->height);
        OUT_PKT3(ring, CP_MEM_WRITE, 9);
-       OUT_RELOC(ring, fd_resource(fd2_ctx->solid_vertexbuf)->bo, 0x60, 0, 0);
+       OUT_RELOC(ring, fd_resource(fd2_ctx->solid_vertexbuf)->bo, 36, 0, 0);
        OUT_RING(ring, fui(x0));
        OUT_RING(ring, fui(y0));
        OUT_RING(ring, fui(x1));
@@ -685,7 +685,7 @@ fd2_emit_tile_renderprep(struct fd_batch *batch, struct fd_tile *tile)
                        A2XX_PA_SC_SCREEN_SCISSOR_BR_Y(tile->bin_h));
 
        /* tile offset for gl_FragCoord on a20x (C64 in fragment shader) */
-       if (is_a20x(batch->ctx->screen)) {
+       if (is_a20x(ctx->screen)) {
                OUT_PKT3(ring, CP_SET_CONSTANT, 5);
                OUT_RING(ring, 0x00000580);
                OUT_RING(ring, fui(tile->xoff));