etnaviv: explicitly call resource_written(..)

We might end in cases where etna_acc_get_query_result(..) gets called
within one draw call (aka before flushing). At this point the status
of the resource was not set but gets used in etna_acc_get_query_result(..)
to handle different wait cases. Fix this issue by calling resource_written(..)
explicitly.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/1530>
This commit is contained in:
Christian Gmeiner 2019-07-31 20:10:14 +02:00 committed by Marge Bot
parent f2c4892512
commit 2381904030
2 changed files with 2 additions and 3 deletions

View file

@ -347,9 +347,6 @@ etna_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
}
}
list_for_each_entry(struct etna_acc_query, aq, &ctx->active_acc_queries, node)
resource_written(ctx, aq->prsc);
ctx->stats.prims_emitted += u_reduced_prims_for_vertices(info->mode, info->count);
ctx->stats.draw_calls++;

View file

@ -59,6 +59,7 @@ occlusion_resume(struct etna_acc_query *aq, struct etna_context *ctx)
r.offset = aq->samples * 8; /* 64bit value */
etna_set_state_reloc(ctx->stream, VIVS_GL_OCCLUSION_QUERY_ADDR, &r);
resource_written(ctx, aq->prsc);
}
static void
@ -66,6 +67,7 @@ occlusion_suspend(struct etna_acc_query *aq, struct etna_context *ctx)
{
/* 0x1DF5E76 is the value used by blob - but any random value will work */
etna_set_state(ctx->stream, VIVS_GL_OCCLUSION_QUERY_CONTROL, 0x1DF5E76);
resource_written(ctx, aq->prsc);
}
static void