summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2013-07-23 21:51:10 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2013-07-23 21:51:10 +0200
commit7a4cacdcce786f5ff1465b3352dbac9a1d68cfaf (patch)
treec9a6de8a648dc35d55d61c79a44362234ce1629a
parent101789f291c48cd6e61bf5b2b661b7662bc8c409 (diff)
etnaviv: fix buffer management issue
-rw-r--r--native/etnaviv/etna.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/native/etnaviv/etna.c b/native/etnaviv/etna.c
index 37d2cec..a6106e3 100644
--- a/native/etnaviv/etna.c
+++ b/native/etnaviv/etna.c
@@ -252,10 +252,10 @@ static void clear_buffer(gcoCMDBUF cmdbuf)
/* Switch to next buffer, optionally wait for it to be available */
static int switch_next_buffer(struct etna_ctx *ctx)
{
-#ifdef DEBUG
- printf("Switching to new buffer\n");
-#endif
int next_buf_id = (ctx->cur_buf + 1) % NUM_COMMAND_BUFFERS;
+#if 0
+ printf("Switching to new buffer %i\n", next_buf_id);
+#endif
if(viv_user_signal_wait(ctx->conn, ctx->cmdbuf_sig[next_buf_id], VIV_WAIT_INDEFINITE) != 0)
{
#ifdef DEBUG
@@ -375,9 +375,7 @@ int etna_flush(struct etna_ctx *ctx)
/* nothing more fits in buffer, prevent warning about buffer overflow
on next etna_reserve.
*/
- ctx->cur_buf = -1;
- ctx->buf = 0;
- ctx->offset = 0;
+ ctx->offset = (COMMAND_BUFFER_SIZE - END_COMMIT_CLEARANCE) / 4;
} else {
/* set writing offset for next etna_reserve */
ctx->offset = cur_buf->offset / 4;