i965: Use the batch save/reset code to avoid needing the BO validate step.
authorEric Anholt <eric@anholt.net>
Sat, 22 Oct 2011 16:37:57 +0000 (09:37 -0700)
committerEric Anholt <eric@anholt.net>
Sat, 29 Oct 2011 19:16:05 +0000 (12:16 -0700)
commit3d851ae48865ac6a20a615e6e06d913c2265cda5
tree61983729c6319a982cc0842b70f0c9d73cab0999
parentda8f052560120010b7f37a300f03c0847cca3aa5
i965: Use the batch save/reset code to avoid needing the BO validate step.

We were doing the BO validate step in prepare() (brw_validate_state())
hooks of atoms so that we could check_aperture before emitting the
relocation trees during brw_upload_state() that would actually make
the batchbuffer reference too much memory to be executed.  Now that
all relocations occur in the batchbuffer, we can instead
check_aperture after emitting our state into the batchbuffer, and
easily roll back, flush, and retry if we happened to go over the
limits.

This will let us remove the whole prepare() vs emit() split in our
state atoms, which is a source of tricky dependencies and duplicated
code.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
src/mesa/drivers/dri/i965/brw_draw.c