diff --git a/src/freedreno/ci/freedreno-a618-fails.txt b/src/freedreno/ci/freedreno-a618-fails.txt index 37036203a03..0344ccbb98e 100644 --- a/src/freedreno/ci/freedreno-a618-fails.txt +++ b/src/freedreno/ci/freedreno-a618-fails.txt @@ -215,8 +215,6 @@ spec@ext_texture_snorm@fbo-generatemipmap-formats@GL_LUMINANCE16_SNORM NPOT,Fail spec@ext_texture_snorm@multisample-formats 2 gl_ext_texture_snorm,Fail spec@ext_texture_snorm@multisample-formats 4 gl_ext_texture_snorm,Fail -spec@ext_transform_feedback@intervening-read prims_generated,Fail -spec@ext_transform_feedback@intervening-read prims_generated use_gs,Fail spec@ext_transform_feedback@structs struct-array-elem run,Fail spec@ext_transform_feedback@structs struct-array-elem run interface,Fail spec@ext_transform_feedback@tessellation triangle_fan flat_first,Fail diff --git a/src/freedreno/ci/freedreno-a630-fails.txt b/src/freedreno/ci/freedreno-a630-fails.txt index 4a57868c226..2bf2b51af18 100644 --- a/src/freedreno/ci/freedreno-a630-fails.txt +++ b/src/freedreno/ci/freedreno-a630-fails.txt @@ -221,8 +221,6 @@ spec@ext_texture_snorm@fbo-generatemipmap-formats@GL_LUMINANCE16_SNORM NPOT,Fail spec@ext_texture_snorm@multisample-formats 2 gl_ext_texture_snorm,Fail spec@ext_texture_snorm@multisample-formats 4 gl_ext_texture_snorm,Fail -spec@ext_transform_feedback@intervening-read prims_generated,Fail -spec@ext_transform_feedback@intervening-read prims_generated use_gs,Fail spec@ext_transform_feedback@structs struct-array-elem run,Fail spec@ext_transform_feedback@structs struct-array-elem run interface,Fail spec@ext_transform_feedback@tessellation triangle_fan flat_first,Fail diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_query.cc b/src/gallium/drivers/freedreno/a6xx/fd6_query.cc index 44fab13fc64..7f61e1a83be 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_query.cc +++ b/src/gallium/drivers/freedreno/a6xx/fd6_query.cc @@ -399,7 +399,9 @@ pipeline_stats_resume(struct fd_acc_query *aq, struct fd_batch *batch) CP_REG_TO_MEM_0_REG(counter_base)); stats_reloc(ring, aq, start); - fd6_event_write(batch, ring, START_PRIMITIVE_CTRS, false); + if (!batch->pipeline_stats_queries_active) + fd6_event_write(batch, ring, START_PRIMITIVE_CTRS, false); + batch->pipeline_stats_queries_active++; } static void @@ -416,7 +418,10 @@ pipeline_stats_pause(struct fd_acc_query *aq, struct fd_batch *batch) CP_REG_TO_MEM_0_REG(counter_base)); stats_reloc(ring, aq, stop); - fd6_event_write(batch, ring, STOP_PRIMITIVE_CTRS, false); + assert(batch->pipeline_stats_queries_active > 0); + batch->pipeline_stats_queries_active--; + if (batch->pipeline_stats_queries_active) + fd6_event_write(batch, ring, STOP_PRIMITIVE_CTRS, false); /* result += stop - start: */ OUT_PKT7(ring, CP_MEM_TO_MEM, 9); diff --git a/src/gallium/drivers/freedreno/freedreno_batch.h b/src/gallium/drivers/freedreno/freedreno_batch.h index 7fe0902ed1e..4e654576983 100644 --- a/src/gallium/drivers/freedreno/freedreno_batch.h +++ b/src/gallium/drivers/freedreno/freedreno_batch.h @@ -281,6 +281,12 @@ struct fd_batch { */ uint32_t next_sample_offset; + /* The # of pipeline-stats queries running. In case of nested + * queries using START/STOP_PRIMITIVE_CNTRS, we need to start + * only on the first one and stop only on the last one. + */ + uint32_t pipeline_stats_queries_active; + /* cached samples (in case multiple queries need to reference * the same sample snapshot) */