[Mesa-dev] [PATCH] i965: Remove redundant gen check
Kenneth Graunke
kenneth at whitecape.org
Fri Apr 10 02:14:09 PDT 2015
On Thursday, April 09, 2015 07:46:34 PM Ben Widawsky wrote:
> The blit ring doesn't exist until Gen6, therefore we don't need to actually
> check it. Keep an assert to make sure old code doesn't do stupid stuff.
>
> (Only compile tested)
>
> Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
> ---
> src/mesa/drivers/dri/i965/intel_batchbuffer.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
> index e522e4e..ada5573 100644
> --- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c
> +++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c
> @@ -702,7 +702,8 @@ intel_emit_post_sync_nonzero_flush(struct brw_context *brw)
> void
> intel_batchbuffer_emit_mi_flush(struct brw_context *brw)
> {
> - if (brw->batch.ring == BLT_RING && brw->gen >= 6) {
> + if (brw->batch.ring == BLT_RING) {
> + assert(brw->gen >= 6);
> BEGIN_BATCH_BLT(4);
> OUT_BATCH(MI_FLUSH_DW);
> OUT_BATCH(0);
>
NAK. It doesn't work that way.
BEGIN_BATCH() sets brw->batch.ring to RENDER_RING.
BEGIN_BATCH_BLT() sets brw->batch.ring to BLT_RING.
This happens on all generations. When doing execbuf, we ignore the ring
type on Gen4-5, and always use I915_EXEC_RENDER. On Gen6+, we use both.
On Gen6+, we flush the batch when changing ring types. On Gen4-5, we
don't care - it just reflects the type of commands emitted last.
I suppose we could change BEGIN_BATCH_BLT to use RENDER_RING for
everything on Gen4-5, so the ring enum matches up better. That would
be fine.
As is, this will assert fail on Gen4-5.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150410/163b29b1/attachment.sig>
More information about the mesa-dev
mailing list