From: Roland Scheidegger <srol...@vmware.com>

The command parser is very sad if we don't emit the relocs per hw query...

However, don't enable it. It mostly works, but piglit
arb_transform_feedback_overflow_query-basic shows 2 failures (it's really the
same case for the hw), conditional_render_any and conditional_render_single.
By some experimentation, it looks like the firmware combines the values wrongly
for the non-inverted (i.e. hw-inverted) case - it will only not draw if all
4 streams overflow, rather than just at least one.
Interestingly, radeonsi has a workaround for some VI firmware which looks like
it was the exact same firmware bug. Hence, looks like it would need new
firmware to properly fix this.
(Tested on Juniper, not sure if firmware for all chips is broken.)
---
 src/gallium/drivers/r600/r600_query.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_query.c 
b/src/gallium/drivers/r600/r600_query.c
index b4519830cc..5ff0570308 100644
--- a/src/gallium/drivers/r600/r600_query.c
+++ b/src/gallium/drivers/r600/r600_query.c
@@ -742,9 +742,12 @@ static void r600_query_hw_do_emit_start(struct 
r600_common_context *ctx,
                emit_sample_streamout(cs, va, query->stream);
                break;
        case PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE:
-               for (unsigned stream = 0; stream < R600_MAX_STREAMS; ++stream)
+               for (unsigned stream = 0; stream < R600_MAX_STREAMS; ++stream) {
                        emit_sample_streamout(cs, va + 32 * stream, stream);
-               break;
+                       r600_emit_reloc(ctx, &ctx->gfx, query->buffer.buf,
+                                       RADEON_USAGE_WRITE, RADEON_PRIO_QUERY);
+               }
+               return;
        case PIPE_QUERY_TIME_ELAPSED:
                /* Write the timestamp after the last draw is done.
                 * (bottom-of-pipe)
@@ -827,9 +830,12 @@ static void r600_query_hw_do_emit_stop(struct 
r600_common_context *ctx,
                break;
        case PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE:
                va += 16;
-               for (unsigned stream = 0; stream < R600_MAX_STREAMS; ++stream)
+               for (unsigned stream = 0; stream < R600_MAX_STREAMS; ++stream) {
                        emit_sample_streamout(cs, va + 32 * stream, stream);
-               break;
+                       r600_emit_reloc(ctx, &ctx->gfx, query->buffer.buf,
+                                       RADEON_USAGE_WRITE, RADEON_PRIO_QUERY);
+               }
+               return;
        case PIPE_QUERY_TIME_ELAPSED:
                va += 8;
                /* fall through */
-- 
2.12.3

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to