freedreno/a3xx: fix VFD_INDEX_MAX overflow
authorRob Clark <robclark@freedesktop.org>
Wed, 11 Sep 2013 14:06:29 +0000 (10:06 -0400)
committerRob Clark <robclark@freedesktop.org>
Sat, 14 Sep 2013 17:31:58 +0000 (13:31 -0400)
max_index may be 0xffffffff.  The hardware does not need 1 + max_index
(although it does not hurt unless max_index wraps around to zero).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/a3xx/fd3_draw.c

index e1f8067501b83a4c8283520eb34bfd18c43de9d5..85c7441a84d9f91a24178bb6a3706bda63080d30 100644 (file)
@@ -84,7 +84,7 @@ fd3_draw(struct fd_context *ctx, const struct pipe_draw_info *info)
 
        OUT_PKT0(ring, REG_A3XX_VFD_INDEX_MIN, 4);
        OUT_RING(ring, info->min_index);        /* VFD_INDEX_MIN */
-       OUT_RING(ring, info->max_index + 1);    /* VFD_INDEX_MAX */
+       OUT_RING(ring, info->max_index);        /* VFD_INDEX_MAX */
        OUT_RING(ring, info->start_instance);   /* VFD_INSTANCEID_OFFSET */
        OUT_RING(ring, info->start);            /* VFD_INDEX_OFFSET */