intel: Assert that no batch is emitted if a region is mapped
authorChad Versace <chad@chad-versace.us>
Thu, 6 Oct 2011 21:18:35 +0000 (14:18 -0700)
committerChad Versace <chad@chad-versace.us>
Wed, 12 Oct 2011 00:16:31 +0000 (17:16 -0700)
commite9adfa2ba1af9c3579b25327335c47118b6c7c3f
tree04b11c3d92b9821c36489a65487e8ff152c3911b
parentd06cc42c3c85382600176d118d8bf492b4de6a55
intel: Assert that no batch is emitted if a region is mapped

What I would prefer to assert is that, for each region that is currently
mapped, no batch is emitted that uses that region's bo. However, it's much
easier to implement this big hammer.

Observe that this requires that the batch flush in intel_region_map() be
moved to within the map_refcount guard.

v2: Add comments (borrowed from anholt's reply) explaining why the
assertion is a good idea.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad@chad-versace.us>
src/mesa/drivers/dri/intel/intel_batchbuffer.c
src/mesa/drivers/dri/intel/intel_context.h
src/mesa/drivers/dri/intel/intel_regions.c