From patchwork Mon Feb 16 18:25:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lespiau, Damien" X-Patchwork-Id: 5834331 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4697D9F380 for ; Mon, 16 Feb 2015 18:25:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7D42C20115 for ; Mon, 16 Feb 2015 18:25:15 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C1617200DE for ; Mon, 16 Feb 2015 18:25:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BE97C6E05E; Mon, 16 Feb 2015 10:25:13 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id ECB096E05E for ; Mon, 16 Feb 2015 10:25:12 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP; 16 Feb 2015 10:17:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,589,1418112000"; d="scan'208";a="678766590" Received: from fcrouzet-mobl1.ger.corp.intel.com (HELO strange.ger.corp.intel.com) ([10.252.18.225]) by fmsmga002.fm.intel.com with ESMTP; 16 Feb 2015 10:25:10 -0800 From: Damien Lespiau To: intel-gfx@lists.freedesktop.org Date: Mon, 16 Feb 2015 18:25:10 +0000 Message-Id: <1424111111-23853-1-git-send-email-damien.lespiau@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [Intel-gfx] [PATCH 1/2] drm/i915: Re-order some checks to do the unlikely one first X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 instpm_mode != relative_constants_mode is quite unlikely to happen, so we can test it first to use C's && short-circuiting and not test on 'ring'. I know, probably a useless micro-optimisation in the big scheme of things, but I'm going to add another test here, so might as well do it. Signed-off-by: Damien Lespiau --- drivers/gpu/drm/i915/intel_lrc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index aafcef3..896641a 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -691,8 +691,8 @@ int intel_execlists_submission(struct drm_device *dev, struct drm_file *file, if (ret) return ret; - if (ring == &dev_priv->ring[RCS] && - instp_mode != dev_priv->relative_constants_mode) { + if (instp_mode != dev_priv->relative_constants_mode && + ring == &dev_priv->ring[RCS]) { ret = intel_logical_ring_begin(ringbuf, ctx, 4); if (ret) return ret;