i965/query: Remove redundant drm_intel_bo_references call in CheckQuery.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 11 Dec 2014 09:43:52 +0000 (01:43 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 16 Dec 2014 23:39:53 +0000 (15:39 -0800)
commit9c47653d3202b166efb51bac00ae84f9d03b2a40
tree75a2fbabaefaa3c8d4240dfb109a5b1f4ebaf58c
parent12c16f4f27f7d57b036493826eacc1cab0584d45
i965/query: Remove redundant drm_intel_bo_references call in CheckQuery.

CheckQuery calls drm_intel_bo_references to see if the batch references
the query BO, and if so, flushes.  It then checks if the query BO is
busy, and if not, calls gen6_queryobj_get_results().

Stupidly, gen6_queryobj_get_results() immediately did a second redundant
drm_intel_bo_references check, even though we know the buffer is not
referenced and in fact idle.

This patch moves the batch-flush check out of gen6_queryobj_get_results
and into WaitQuery() (the other caller).  That way, both callers do a
single batch-flush check.

This should only be a minor improvement, since it would only affect
the first CheckQuery call where the result is actually available.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86969
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i965/gen6_queryobj.c