From: Chia-I Wu Date: Fri, 19 Sep 2014 06:37:56 +0000 (+0800) Subject: ilo: remove ilo_cp_empty() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1887d15eede63927152f7f664061e7efe7d16185;p=mesa.git ilo: remove ilo_cp_empty() Call ilo_builder_batch_used() directly. --- diff --git a/src/gallium/drivers/ilo/ilo_3d_pipeline.c b/src/gallium/drivers/ilo/ilo_3d_pipeline.c index bbac8ce4278..baadfa7838a 100644 --- a/src/gallium/drivers/ilo/ilo_3d_pipeline.c +++ b/src/gallium/drivers/ilo/ilo_3d_pipeline.c @@ -170,7 +170,6 @@ ilo_3d_pipeline_emit_draw(struct ilo_3d_pipeline *p, ilo_cp_set_one_off_flags(p->cp, INTEL_EXEC_GEN7_SOL_RESET); } - while (true) { struct ilo_builder_snapshot snapshot; @@ -184,20 +183,20 @@ ilo_3d_pipeline_emit_draw(struct ilo_3d_pipeline *p, if (ilo_builder_validate(&ilo->cp->builder, 0, NULL)) { success = true; - break; - } + } else { + /* rewind */ + ilo_builder_batch_restore(&p->cp->builder, &snapshot); - /* rewind */ - ilo_builder_batch_restore(&p->cp->builder, &snapshot); + /* flush and try again */ + if (ilo_builder_batch_used(&p->cp->builder)) { + ilo_cp_flush(p->cp, "out of aperture"); + continue; + } - if (ilo_cp_empty(p->cp)) { success = false; - break; - } - else { - /* flush and try again */ - ilo_cp_flush(p->cp, "out of aperture"); } + + break; } if (success) { @@ -291,7 +290,7 @@ ilo_3d_pipeline_emit_rectlist(struct ilo_3d_pipeline *p, ilo_builder_batch_restore(&p->cp->builder, &snapshot); /* flush and try again */ - if (!ilo_cp_empty(p->cp)) { + if (ilo_builder_batch_used(&p->cp->builder)) { ilo_cp_flush(p->cp, "out of aperture"); continue; } diff --git a/src/gallium/drivers/ilo/ilo_blitter_rectlist.c b/src/gallium/drivers/ilo/ilo_blitter_rectlist.c index c77b8e14971..c77eac36bc6 100644 --- a/src/gallium/drivers/ilo/ilo_blitter_rectlist.c +++ b/src/gallium/drivers/ilo/ilo_blitter_rectlist.c @@ -334,7 +334,7 @@ hiz_emit_rectlist(struct ilo_blitter *blitter) * - we may sample from a texture that was rendered to * - we may sample from the fb shortly after */ - if (!ilo_cp_empty(p->cp)) + if (ilo_builder_batch_used(&p->cp->builder)) ilo_3d_pipeline_emit_flush(p); ilo_3d_pipeline_emit_rectlist(p, blitter); diff --git a/src/gallium/drivers/ilo/ilo_cp.h b/src/gallium/drivers/ilo/ilo_cp.h index 0f27e8e590d..c313745ea87 100644 --- a/src/gallium/drivers/ilo/ilo_cp.h +++ b/src/gallium/drivers/ilo/ilo_cp.h @@ -101,15 +101,6 @@ void ilo_cp_set_owner(struct ilo_cp *cp, enum intel_ring_type ring, const struct ilo_cp_owner *owner); -/** - * Return true if the parser buffer is empty. - */ -static inline bool -ilo_cp_empty(struct ilo_cp *cp) -{ - return !ilo_builder_batch_used(&cp->builder); -} - /** * Return the remaining space (in dwords) in the parser buffer. */