switch (q->type) {
case PIPE_QUERY_OCCLUSION_COUNTER:
case PIPE_QUERY_TIME_ELAPSED:
+ case PIPE_QUERY_PRIMITIVES_GENERATED:
+ case PIPE_QUERY_PRIMITIVES_EMITTED:
assert(q->stride == sizeof(*vals) * 2);
tmp = 0;
switch (q->type) {
case PIPE_QUERY_OCCLUSION_COUNTER:
case PIPE_QUERY_TIME_ELAPSED:
+ case PIPE_QUERY_PRIMITIVES_GENERATED:
+ case PIPE_QUERY_PRIMITIVES_EMITTED:
q->stride = sizeof(uint64_t);
q->in_pairs = true;
break;
q->stride = sizeof(uint64_t) * 11;
q->in_pairs = true;
break;
- case PIPE_QUERY_PRIMITIVES_GENERATED:
- case PIPE_QUERY_PRIMITIVES_EMITTED:
- return true;
- break;
default:
return false;
break;
ilo_3d_own_render_ring(hw3d);
- if (q->bo) {
- /* need to submit first */
- if (!ilo_builder_validate(&hw3d->cp->builder, 1, &q->bo) ||
- ilo_cp_space(hw3d->cp) < q->cmd_len) {
- ilo_cp_submit(hw3d->cp, "out of aperture or space");
+ /* need to submit first */
+ if (!ilo_builder_validate(&hw3d->cp->builder, 1, &q->bo) ||
+ ilo_cp_space(hw3d->cp) < q->cmd_len) {
+ ilo_cp_submit(hw3d->cp, "out of aperture or space");
- assert(ilo_builder_validate(&hw3d->cp->builder, 1, &q->bo));
- assert(ilo_cp_space(hw3d->cp) >= q->cmd_len);
+ assert(ilo_builder_validate(&hw3d->cp->builder, 1, &q->bo));
+ assert(ilo_cp_space(hw3d->cp) >= q->cmd_len);
- ilo_3d_own_render_ring(hw3d);
- }
+ ilo_3d_own_render_ring(hw3d);
+ }
- /* reserve the space for ending/pausing the query */
- hw3d->owner.reserve += q->cmd_len >> q->in_pairs;
+ /* reserve the space for ending/pausing the query */
+ hw3d->owner.reserve += q->cmd_len >> q->in_pairs;
- query_begin_bo(hw3d, q);
- }
+ query_begin_bo(hw3d, q);
switch (q->type) {
case PIPE_QUERY_OCCLUSION_COUNTER:
ilo_3d_own_render_ring(hw3d);
- if (q->bo) {
- /* reclaim the reserved space */
- hw3d->owner.reserve -= q->cmd_len >> q->in_pairs;
- assert(hw3d->owner.reserve >= 0);
+ /* reclaim the reserved space */
+ hw3d->owner.reserve -= q->cmd_len >> q->in_pairs;
+ assert(hw3d->owner.reserve >= 0);
- query_end_bo(hw3d, q);
- }
+ query_end_bo(hw3d, q);
list_delinit(&q->list);
}
{
struct ilo_3d *hw3d = ilo_context(pipe)->hw3d;
- if (q->bo)
- query_process_bo(hw3d, q);
+ query_process_bo(hw3d, q);
}
static void
LIST_FOR_EACH_ENTRY(q, &hw3d->time_elapsed_queries, list)
query_begin_bo(hw3d, q);
+ /* resume prim generated queries */
+ LIST_FOR_EACH_ENTRY(q, &hw3d->prim_generated_queries, list)
+ query_begin_bo(hw3d, q);
+
+ /* resume prim emitted queries */
+ LIST_FOR_EACH_ENTRY(q, &hw3d->prim_emitted_queries, list)
+ query_begin_bo(hw3d, q);
+
/* resume pipeline statistics queries */
LIST_FOR_EACH_ENTRY(q, &hw3d->pipeline_statistics_queries, list)
query_begin_bo(hw3d, q);
LIST_FOR_EACH_ENTRY(q, &hw3d->time_elapsed_queries, list)
query_end_bo(hw3d, q);
+ /* pause prim generated queries */
+ LIST_FOR_EACH_ENTRY(q, &hw3d->prim_generated_queries, list)
+ query_end_bo(hw3d, q);
+
+ /* pause prim emitted queries */
+ LIST_FOR_EACH_ENTRY(q, &hw3d->prim_emitted_queries, list)
+ query_end_bo(hw3d, q);
+
/* pause pipeline statistics queries */
LIST_FOR_EACH_ENTRY(q, &hw3d->pipeline_statistics_queries, list)
query_end_bo(hw3d, q);
}
static bool
-draw_vbo(struct ilo_3d *hw3d, const struct ilo_state_vector *vec,
- int *prim_generated, int *prim_emitted)
+draw_vbo(struct ilo_3d *hw3d, const struct ilo_state_vector *vec)
{
bool need_flush = false;
int max_len;
if (need_flush)
ilo_3d_pipeline_emit_flush(hw3d->pipeline);
- return ilo_3d_pipeline_emit_draw(hw3d->pipeline, vec,
- prim_generated, prim_emitted);
-}
-
-static void
-update_prim_count(struct ilo_3d *hw3d, int generated, int emitted)
-{
- struct ilo_query *q;
-
- LIST_FOR_EACH_ENTRY(q, &hw3d->prim_generated_queries, list)
- q->result.u64 += generated;
-
- LIST_FOR_EACH_ENTRY(q, &hw3d->prim_emitted_queries, list)
- q->result.u64 += emitted;
+ return ilo_3d_pipeline_emit_draw(hw3d->pipeline, vec);
}
bool
{
struct ilo_context *ilo = ilo_context(pipe);
struct ilo_3d *hw3d = ilo->hw3d;
- int prim_generated, prim_emitted;
if (ilo_debug & ILO_DEBUG_DRAW) {
if (info->indexed) {
ilo_blit_resolve_framebuffer(ilo);
/* If draw_vbo ever fails, return immediately. */
- if (!draw_vbo(hw3d, &ilo->state_vector, &prim_generated, &prim_emitted))
+ if (!draw_vbo(hw3d, &ilo->state_vector))
return;
/* clear dirty status */
/* avoid dangling pointer reference */
ilo->state_vector.draw = NULL;
- update_prim_count(hw3d, prim_generated, prim_emitted);
-
if (ilo_debug & ILO_DEBUG_NOCACHE)
ilo_3d_pipeline_emit_flush(hw3d->pipeline);
}
*/
bool
ilo_3d_pipeline_emit_draw(struct ilo_3d_pipeline *p,
- const struct ilo_state_vector *vec,
- int *prim_generated, int *prim_emitted)
+ const struct ilo_state_vector *vec)
{
bool success;
- if (vec->dirty & ILO_DIRTY_SO &&
- vec->so.enabled && !vec->so.append_bitmask) {
- /*
- * We keep track of the SVBI in the driver, so that we can restore it
- * when the HW context is invalidated (by another process). The value
- * needs to be reset when stream output is enabled and the targets are
- * changed.
- */
- p->state.so_num_vertices = 0;
-
- /* on GEN7+, we need SOL_RESET to reset the SO write offsets */
- if (ilo_dev_gen(p->dev) >= ILO_GEN(7))
- ilo_cp_set_one_off_flags(p->cp, INTEL_EXEC_GEN7_SOL_RESET);
- }
+ /* on GEN7+, we need SOL_RESET to reset the SO write offsets */
+ if (ilo_dev_gen(p->dev) >= ILO_GEN(7) && (vec->dirty & ILO_DIRTY_SO) &&
+ vec->so.enabled && !vec->so.append_bitmask)
+ ilo_cp_set_one_off_flags(p->cp, INTEL_EXEC_GEN7_SOL_RESET);
while (true) {
struct ilo_builder_snapshot snapshot;
break;
}
- if (success) {
- const int num_verts =
- u_vertices_per_prim(u_reduced_prim(vec->draw->mode));
- const int max_emit =
- (p->state.so_max_vertices - p->state.so_num_vertices) / num_verts;
- const int generated =
- u_reduced_prims_for_vertices(vec->draw->mode, vec->draw->count);
- const int emitted = MIN2(generated, max_emit);
-
- p->state.so_num_vertices += emitted * num_verts;
-
- if (prim_generated)
- *prim_generated = generated;
-
- if (prim_emitted)
- *prim_emitted = emitted;
- }
-
p->invalidate_flags = 0x0;
return success;