From patchwork Fri Mar 6 01:51:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Ung X-Patchwork-Id: 446984 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 37547140134 for ; Fri, 6 Mar 2015 12:50:35 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753911AbbCFBue (ORCPT ); Thu, 5 Mar 2015 20:50:34 -0500 Received: from hqemgate15.nvidia.com ([216.228.121.64]:10583 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754550AbbCFBue (ORCPT ); Thu, 5 Mar 2015 20:50:34 -0500 Received: from hqnvupgp08.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com id ; Thu, 05 Mar 2015 17:51:09 -0800 Received: from hqemhub02.nvidia.com ([172.20.12.94]) by hqnvupgp08.nvidia.com (PGP Universal service); Thu, 05 Mar 2015 17:48:49 -0800 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Thu, 05 Mar 2015 17:48:49 -0800 Received: from dung-P9X79.nvidia.com (172.20.144.16) by hqemhub02.nvidia.com (172.20.150.31) with Microsoft SMTP Server (TLS) id 8.3.342.0; Thu, 5 Mar 2015 17:50:33 -0800 From: David Ung To: airlied@linux.ie CC: linux-tegra@vger.kernel.org, thierry.reding@gmail.com, swarren@wwwdotorg.org, amerilainen@nvidia.com, tbergstrom@nvidia.com, gnurou@gmail.com, David Ung Subject: [PATCH V2 3/3] gpu: host1x: Record the physical address for gathers Date: Thu, 5 Mar 2015 17:51:52 -0800 Message-ID: <1425606712-15986-3-git-send-email-davidu@nvidia.com> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1425606712-15986-1-git-send-email-davidu@nvidia.com> References: <1425606712-15986-1-git-send-email-davidu@nvidia.com> MIME-Version: 1.0 Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org The gather's base physical address is recorded during patching of gathers, but only the 1st one within the same buffer object has it set, subsequent gathers in the same buffer are being skipped. This patch records the phys addr during pin_job for all gathers. Signed-off-by: David Ung --- drivers/gpu/host1x/job.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c index 7ecbefd..6b374bc 100644 --- a/drivers/gpu/host1x/job.c +++ b/drivers/gpu/host1x/job.c @@ -202,17 +202,16 @@ static unsigned int pin_job(struct host1x_job *job) for (i = 0; i < job->num_gathers; i++) { struct host1x_job_gather *g = &job->gathers[i]; struct sg_table *sgt; - dma_addr_t phys_addr; g->bo = host1x_bo_get(g->bo); if (!g->bo) goto unpin; - phys_addr = host1x_bo_pin(g->bo, &sgt); - if (!phys_addr) + g->base = host1x_bo_pin(g->bo, &sgt); + if (!g->base) goto unpin; - job->gather_addr_phys[i] = phys_addr; + job->gather_addr_phys[i] = g->base; job->unpins[job->num_unpins].bo = g->bo; job->unpins[job->num_unpins].sgt = sgt; job->num_unpins++; @@ -536,8 +535,6 @@ int host1x_job_pin(struct host1x_job *job, struct device *dev) if (g->handled) continue; - g->base = job->gather_addr_phys[i]; - for (j = i + 1; j < job->num_gathers; j++) if (job->gathers[j].bo == g->bo) job->gathers[j].handled = true;