From patchwork Thu Mar 6 21:12:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kenneth Graunke X-Patchwork-Id: 3786441 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 95B5B9F369 for ; Thu, 6 Mar 2014 21:16:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CB8B2201F0 for ; Thu, 6 Mar 2014 21:16:48 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B0C512024C for ; Thu, 6 Mar 2014 21:16:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 57F1DFAB5B; Thu, 6 Mar 2014 13:16:46 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org 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) Received: from homiemail-a10.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a10.g.dreamhost.com (Postfix) with ESMTP id 79E40280074; Thu, 6 Mar 2014 13:16:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=whitecape.org; h=from:to :cc:subject:date:message-id; s=whitecape.org; bh=sKcfbOxIuO+Dfbn xzsgdQkXaR5g=; b=gBxYd6TpiuliMIq5/Xj6EAPW+TILvquH5IZassna1J/i4oS acOw2fsRHM1XpfcZhz0kPZGXenSXcWALUGjnfyiutvRHaMLlZRBdsPZZQwtrM4ng ecR2kdo39xAUzeB+dg1I/RQjP64/ughMLHqrcP9PrMtebNLvW0/k9w4PYRrU= Received: from localhost.localdomain (unknown [172.56.32.17]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: kenneth@whitecape.org) by homiemail-a10.g.dreamhost.com (Postfix) with ESMTPSA id 1D38A28005C; Thu, 6 Mar 2014 13:16:38 -0800 (PST) From: Kenneth Graunke To: intel-gfx@lists.freedesktop.org Date: Thu, 6 Mar 2014 13:12:30 -0800 Message-Id: <1394140352-1307-1-git-send-email-kenneth@whitecape.org> X-Mailer: git-send-email 1.8.4.2 Cc: stephane.marchesin@gmail.com Subject: [Intel-gfx] [PATCH 1/3] uxa: Don't emit PIPE_CONTROLs in an empty batch. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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) {