From patchwork Tue Jan 7 20:03:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Faye-Lund X-Patchwork-Id: 3449761 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4E1DAC02DC for ; Tue, 7 Jan 2014 20:03:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3F45120120 for ; Tue, 7 Jan 2014 20:03:25 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 591D920115 for ; Tue, 7 Jan 2014 20:03:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EB970FA8F4; Tue, 7 Jan 2014 12:03:21 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-la0-f41.google.com (mail-la0-f41.google.com [209.85.215.41]) by gabe.freedesktop.org (Postfix) with ESMTP id E3B57FA8F4 for ; Tue, 7 Jan 2014 12:03:19 -0800 (PST) Received: by mail-la0-f41.google.com with SMTP id c6so482690lan.14 for ; Tue, 07 Jan 2014 12:03:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=8V/hg3vzhytXvnhd10EcZ8x7QN+USPtKXs9nMyplT+s=; b=KZeQvT8W3YDuKpzCwDhkG/rPSlQjrvldkHEyKIRkzXbngP8MlGfb+WcCMUMVtShwz1 Y4XzoHduYVPQ84TIoMTnRycDTSc6+c9A9hJjKLOPbX1zvM4QBthAV7nQTwXHXti+W6PG o5s0CrVTcMo6Z0YD0/bWrkIlZFfxBTbvMsWapQC8bkab0WJGIz0F5/acKY3kYLhBX+rk oRPbOsIWCzWuLRFbJFsaHQuzHUrY4FpbwXqq0m+BzRsgEZQyOMsGaIa8qxNdS6AGPOmW FUHySr09t3w5cmWA68XRxYch9GGGH7cpqZNpEAnZfhZglWLzwwZHuGIFn9IVXIE8CEbH KPlA== X-Received: by 10.112.35.232 with SMTP id l8mr3283169lbj.80.1389124998492; Tue, 07 Jan 2014 12:03:18 -0800 (PST) Received: from kusma-linux.getinternet.no (cm-84.215.107.111.getinternet.no. [84.215.107.111]) by mx.google.com with ESMTPSA id ox6sm45570404lbb.6.2014.01.07.12.03.14 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 Jan 2014 12:03:15 -0800 (PST) From: Erik Faye-Lund To: linux-tegra@vger.kernel.org Subject: [PATCH] gpu: host1x: do not check previously handled gathers Date: Tue, 7 Jan 2014 21:03:06 +0100 Message-Id: <1389124986-32501-1-git-send-email-kusmabite@gmail.com> X-Mailer: git-send-email 1.8.1.2 Cc: tbergstrom@nvidia.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 When patching gathers, we don't need to check against gathers with lower indices than the current one, as they are guaranteed to already have been handled. Signed-off-by: Erik Faye-Lund Acked-By: Terje Bergstrom --- Here's a trivial optimization I have been running with for a while. drivers/gpu/host1x/job.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c index de5ec33..e965805 100644 --- a/drivers/gpu/host1x/job.c +++ b/drivers/gpu/host1x/job.c @@ -534,7 +534,7 @@ int host1x_job_pin(struct host1x_job *job, struct device *dev) g->base = job->gather_addr_phys[i]; - for (j = 0; j < job->num_gathers; j++) + for (j = i + 1; j < job->num_gathers; j++) if (job->gathers[j].bo == g->bo) job->gathers[j].handled = true;