iris: Spruce up "are we using this engine?" checks for flushing
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 5 Mar 2019 09:21:53 +0000 (01:21 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 8 Mar 2019 01:08:07 +0000 (17:08 -0800)
commit335726fdaca2751a12c9cb515cdfd34b51e00049
treee219d4b7692eb7c9b46399ebbb4d0aa1ba8d0c42
parentb0c214cceeada1e5d4afa89b1ce819c79d8b8c5b
iris: Spruce up "are we using this engine?" checks for flushing

We were using batch->contains_draw as a proxy for "are we even using
this engine?"  That isn't quite right, because it only counts regular
draws.  BLORP operations may have also rendered to a resource, which
needs to trigger flushing.  To check for this, we also see if the
render and sometimes depth caches are non-empty.

We can also drop the "but there might already be stale data in the
cache even if we haven't emitted any commands yet" concern in the
comments.  The kernel flushes caches between batches.

This may not be great but it's at least better than what was there.
src/gallium/drivers/iris/iris_pipe_control.c
src/gallium/drivers/iris/iris_resource.c