ilo: remove ilo_cp_empty()

Call ilo_builder_batch_used() directly.
This commit is contained in:
Chia-I Wu 2014-09-19 14:37:56 +08:00
parent 270667472f
commit 1887d15eed
3 changed files with 13 additions and 23 deletions

View File

@ -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);
if (ilo_cp_empty(p->cp)) {
success = false;
break;
}
else {
/* flush and try again */
ilo_cp_flush(p->cp, "out of aperture");
if (ilo_builder_batch_used(&p->cp->builder)) {
ilo_cp_flush(p->cp, "out of aperture");
continue;
}
success = false;
}
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;
}

View File

@ -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);

View File

@ -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.
*/