i965: Fix occlusion queries for BLORP operations.

Submitted by Kenneth Graunke on May 7, 2018, 3:45 p.m.

Details

Message ID 20180507154512.3733-1-kenneth@whitecape.org
State New
Headers show
Series "i965: Fix occlusion queries for BLORP operations." ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Kenneth Graunke May 7, 2018, 3:45 p.m.
Gen4-5 traditionally don't use GEM context support, which means that
the PS_DEPTH_COUNT register isn't saved/restored for us across batches.

This means that we have to bookend each batch with start/end snapshots,
and add deltas from a series of pairs, instead of simply having a single
<start, end> pair.  Much messier.

In the normal state upload code, we check on every draw call whether
we need to take the starting snapshot for the batch.  But in BLORP,
we forgot to do this, so we'd miss the BLORP operation if it were the
first thing in the batch.
---
 src/mesa/drivers/dri/i965/gen4_blorp_exec.h | 2 ++
 1 file changed, 2 insertions(+)

I haven't observed this to fix anything.  I was hoping it might help
with NV_conditional_render test flakiness...

Patch hide | download patch | download mbox

diff --git a/src/mesa/drivers/dri/i965/gen4_blorp_exec.h b/src/mesa/drivers/dri/i965/gen4_blorp_exec.h
index e59bc9f2c2c..ccff1f98123 100644
--- a/src/mesa/drivers/dri/i965/gen4_blorp_exec.h
+++ b/src/mesa/drivers/dri/i965/gen4_blorp_exec.h
@@ -173,6 +173,8 @@  blorp_emit_pipeline(struct blorp_batch *batch,
    assert(batch->blorp->driver_ctx == batch->driver_batch);
    struct brw_context *brw = batch->driver_batch;
 
+   brw_emit_query_begin(brw);
+
    emit_urb_config(batch, params);
 
    blorp_emit(batch, GENX(3DSTATE_PIPELINED_POINTERS), pp) {

Comments

Acked-by: Jason Ekstrand <jason@jlekstrand.net>

On Mon, May 7, 2018 at 8:45 AM, Kenneth Graunke <kenneth@whitecape.org>
wrote:

> Gen4-5 traditionally don't use GEM context support, which means that
> the PS_DEPTH_COUNT register isn't saved/restored for us across batches.
>
> This means that we have to bookend each batch with start/end snapshots,
> and add deltas from a series of pairs, instead of simply having a single
> <start, end> pair.  Much messier.
>
> In the normal state upload code, we check on every draw call whether
> we need to take the starting snapshot for the batch.  But in BLORP,
> we forgot to do this, so we'd miss the BLORP operation if it were the
> first thing in the batch.
> ---
>  src/mesa/drivers/dri/i965/gen4_blorp_exec.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> I haven't observed this to fix anything.  I was hoping it might help
> with NV_conditional_render test flakiness...
>
> diff --git a/src/mesa/drivers/dri/i965/gen4_blorp_exec.h
> b/src/mesa/drivers/dri/i965/gen4_blorp_exec.h
> index e59bc9f2c2c..ccff1f98123 100644
> --- a/src/mesa/drivers/dri/i965/gen4_blorp_exec.h
> +++ b/src/mesa/drivers/dri/i965/gen4_blorp_exec.h
> @@ -173,6 +173,8 @@ blorp_emit_pipeline(struct blorp_batch *batch,
>     assert(batch->blorp->driver_ctx == batch->driver_batch);
>     struct brw_context *brw = batch->driver_batch;
>
> +   brw_emit_query_begin(brw);
> +
>     emit_urb_config(batch, params);
>
>     blorp_emit(batch, GENX(3DSTATE_PIPELINED_POINTERS), pp) {
> --
> 2.17.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>