i965: Introduce an UNKNOWN_RING state.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Nov 2013 22:07:12 +0000 (14:07 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Nov 2013 23:01:13 +0000 (15:01 -0800)
commit395a32717df494353703f3581edcd3ba380f16d6
tree5d106133114ec2051f16f80484e81ab8b7fc02e4
parent6bc40f9af5b35724caff9fa7ced47b2ca6183f22
i965: Introduce an UNKNOWN_RING state.

When we first create a batch buffer, it's empty.  We don't actually
know what ring it will be targeted at until the first BEGIN_BATCH or
BEGIN_BATCH_BLT macro.

Previously, one could determine the state of the batch by checking
brw->batch.ring (blit vs. render) and brw->batch.used != 0 (known vs.
unknown).

This should be functionally equivalent, but the tri-state enum is a bit
clearer.

v2: Catch three explicit require_space callers (thanks to Carl and Eric).
v3: Split the boolean -> enum change from the UNKNOWN_RING change.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/intel_batchbuffer.c
src/mesa/drivers/dri/i965/intel_batchbuffer.h