iris: gen10+ workarounds and break fix
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 26 Sep 2018 10:51:44 +0000 (12:51 +0200)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:08 +0000 (10:26 -0800)
src/gallium/drivers/iris/iris_query.c

index a8bab7d3e3518345ff1e99fc2985daa0e90b1b30..e4597ed7a7c3ecdae870f279c65a7d9829646618 100644 (file)
@@ -150,16 +150,27 @@ iris_pipelined_write(struct iris_batch *batch,
 static void
 write_value(struct iris_context *ice, struct iris_query *q, unsigned offset)
 {
-   iris_use_pinned_bo(&ice->render_batch, q->bo, true);
+   struct iris_batch *batch = &ice->render_batch;
+   const struct gen_device_info *devinfo = &batch->screen->devinfo;
+
+   iris_use_pinned_bo(batch, q->bo, true);
 
    switch (q->type) {
    case PIPE_QUERY_OCCLUSION_COUNTER:
    case PIPE_QUERY_OCCLUSION_PREDICATE:
    case PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE:
+      if (devinfo->gen >= 10) {
+         /* "Driver must program PIPE_CONTROL with only Depth Stall Enable
+          *  bit set prior to programming a PIPE_CONTROL with Write PS Depth
+          *  Count sync operation."
+          */
+         iris_emit_pipe_control_flush(batch, PIPE_CONTROL_DEPTH_STALL);
+      }
       iris_pipelined_write(&ice->render_batch, q,
                            PIPE_CONTROL_WRITE_DEPTH_COUNT |
                            PIPE_CONTROL_DEPTH_STALL,
                            offset);
+      break;
    case PIPE_QUERY_TIME_ELAPSED:
       iris_pipelined_write(&ice->render_batch, q,
                            PIPE_CONTROL_WRITE_TIMESTAMP,