From: Kenneth Graunke Subject: [PATCH 1/3] uxa: Don't emit PIPE_CONTROLs in an empty batch. Date: Thu, 6 Mar 2014 13:12:30 -0800 Message-ID: <1394140352-1307-1-git-send-email-kenneth@whitecape.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from homiemail-a10.g.dreamhost.com (mailbigip.dreamhost.com [208.97.132.5]) by gabe.freedesktop.org (Postfix) with ESMTP id 67B3CFAB5B for ; Thu, 6 Mar 2014 13:16:44 -0800 (PST) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org Cc: stephane.marchesin@gmail.com List-Id: intel-gfx@lists.freedesktop.org The first call to BEGIN_BATCH or BEGIN_BATCH_BLT will set current_batch to RENDER_BATCH or BLT_BATCH. If it's zero, that means the batch is empty, so there's no point in flushing. Previously, we would just go ahead and do a RENDER_RING flush, though more by accident than intentional design. Signed-off-by: Kenneth Graunke --- src/uxa/intel_batchbuffer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/uxa/intel_batchbuffer.c b/src/uxa/intel_batchbuffer.c index 579a63a..ca1af0d 100644 --- a/src/uxa/intel_batchbuffer.c +++ b/src/uxa/intel_batchbuffer.c @@ -184,6 +184,10 @@ void intel_batch_emit_flush(ScrnInfoPtr scrn) assert (!intel->in_batch_atomic); + /* No point in flushing an empty batch. */ + if (intel->current_batch == 0) + return; + /* Big hammer, look to the pipelined flushes in future. */ if ((INTEL_INFO(intel)->gen >= 060)) { if (intel->current_batch == BLT_BATCH) { -- 1.8.4.2