From patchwork Sun Nov 5 11:01:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Perttunen X-Patchwork-Id: 10042087 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0EDD960244 for ; Sun, 5 Nov 2017 11:20:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED5FE292AB for ; Sun, 5 Nov 2017 11:20:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E23E9292C1; Sun, 5 Nov 2017 11:20:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8DC432930E for ; Sun, 5 Nov 2017 11:20:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 09B366E16A; Sun, 5 Nov 2017 11:20:49 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kapsi.fi (mail.kapsi.fi [IPv6:2001:67c:1be8::25]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5CB0F6E16A for ; Sun, 5 Nov 2017 11:20:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kapsi.fi; s=20161220; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=IVvtNUwes4p1VrTD4ari5NRMQ587s4kmU1Xik5J92fE=; b=1bz8d7/h0nxnBnfU1BlURGJ3nL9F9vQFr4nY6RbFX3u8S3JhZx2pXF7jOXgOvvht5N2EXOLz0aP4OIzpDnaqC6mRqmfFd9o/Kua9oyC4tni43gn/+jAyAruBFjbBT1AWMrROBhWqq+xRatIGkW2v5I5jiJAZhGSW84Y6GmrJNs5uLLAxiG8DcYtWsh2QABPkYcqcPyQ1Z/+cNpj5rTGW83Q2UW02DO4szcSGOwChIfVAKAZC6IM4LouxuTuQOp++DLQTpW6KwiwFI7HwckmZ95mp7RBt3tvhatWqP/GFeGZnDKg4BUwdZFEYs6uKxpRBgTt22a4IijMc74Ehk4S6aw==; Received: from dsl-hkibng22-54f983-249.dhcp.inet.fi ([84.249.131.249] helo=localhost.localdomain) by mail.kapsi.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eBIgk-0006dR-2E; Sun, 05 Nov 2017 13:02:02 +0200 From: Mikko Perttunen To: thierry.reding@gmail.com, jonathanh@nvidia.com Subject: [PATCH 01/10] gpu: host1x: Parameterize channel aperture size Date: Sun, 5 Nov 2017 13:01:09 +0200 Message-Id: <20171105110118.15142-2-mperttunen@nvidia.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171105110118.15142-1-mperttunen@nvidia.com> References: <20171105110118.15142-1-mperttunen@nvidia.com> X-SA-Exim-Connect-IP: 84.249.131.249 X-SA-Exim-Mail-From: mperttunen@nvidia.com X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Cc: linux-tegra@vger.kernel.org, digetx@gmail.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Mikko Perttunen X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The size of a single channel's aperture is different on Tegra186 vs. previous chips. Parameterize the value using a new define in the register definition headers. Signed-off-by: Mikko Perttunen --- drivers/gpu/host1x/hw/channel_hw.c | 3 +-- drivers/gpu/host1x/hw/hw_host1x01_channel.h | 2 ++ drivers/gpu/host1x/hw/hw_host1x02_channel.h | 2 ++ drivers/gpu/host1x/hw/hw_host1x04_channel.h | 2 ++ drivers/gpu/host1x/hw/hw_host1x05_channel.h | 2 ++ drivers/gpu/host1x/hw/hw_host1x06_vm.h | 2 ++ 6 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/host1x/hw/channel_hw.c b/drivers/gpu/host1x/hw/channel_hw.c index 5c0dc6bb51d1..246b78c41281 100644 --- a/drivers/gpu/host1x/hw/channel_hw.c +++ b/drivers/gpu/host1x/hw/channel_hw.c @@ -26,7 +26,6 @@ #include "../intr.h" #include "../job.h" -#define HOST1X_CHANNEL_SIZE 16384 #define TRACE_MAX_LENGTH 128U static void trace_write_gather(struct host1x_cdma *cdma, struct host1x_bo *bo, @@ -205,7 +204,7 @@ static void enable_gather_filter(struct host1x *host, static int host1x_channel_init(struct host1x_channel *ch, struct host1x *dev, unsigned int index) { - ch->regs = dev->regs + index * HOST1X_CHANNEL_SIZE; + ch->regs = dev->regs + HOST1X_CHANNEL_BASE(index); enable_gather_filter(dev, ch); return 0; } diff --git a/drivers/gpu/host1x/hw/hw_host1x01_channel.h b/drivers/gpu/host1x/hw/hw_host1x01_channel.h index b4bc7ca4e051..be56a3a506de 100644 --- a/drivers/gpu/host1x/hw/hw_host1x01_channel.h +++ b/drivers/gpu/host1x/hw/hw_host1x01_channel.h @@ -51,6 +51,8 @@ #ifndef __hw_host1x_channel_host1x_h__ #define __hw_host1x_channel_host1x_h__ +#define HOST1X_CHANNEL_BASE(x) ((x) * 0x4000) + static inline u32 host1x_channel_fifostat_r(void) { return 0x0; diff --git a/drivers/gpu/host1x/hw/hw_host1x02_channel.h b/drivers/gpu/host1x/hw/hw_host1x02_channel.h index e490bcde33fe..a142576a2c6e 100644 --- a/drivers/gpu/host1x/hw/hw_host1x02_channel.h +++ b/drivers/gpu/host1x/hw/hw_host1x02_channel.h @@ -51,6 +51,8 @@ #ifndef HOST1X_HW_HOST1X02_CHANNEL_H #define HOST1X_HW_HOST1X02_CHANNEL_H +#define HOST1X_CHANNEL_BASE(x) ((x) * 0x4000) + static inline u32 host1x_channel_fifostat_r(void) { return 0x0; diff --git a/drivers/gpu/host1x/hw/hw_host1x04_channel.h b/drivers/gpu/host1x/hw/hw_host1x04_channel.h index 2e8b635aa660..645483c07fc2 100644 --- a/drivers/gpu/host1x/hw/hw_host1x04_channel.h +++ b/drivers/gpu/host1x/hw/hw_host1x04_channel.h @@ -51,6 +51,8 @@ #ifndef HOST1X_HW_HOST1X04_CHANNEL_H #define HOST1X_HW_HOST1X04_CHANNEL_H +#define HOST1X_CHANNEL_BASE(x) ((x) * 0x4000) + static inline u32 host1x_channel_fifostat_r(void) { return 0x0; diff --git a/drivers/gpu/host1x/hw/hw_host1x05_channel.h b/drivers/gpu/host1x/hw/hw_host1x05_channel.h index abbbc2641ce6..6aef6bc1c96d 100644 --- a/drivers/gpu/host1x/hw/hw_host1x05_channel.h +++ b/drivers/gpu/host1x/hw/hw_host1x05_channel.h @@ -51,6 +51,8 @@ #ifndef HOST1X_HW_HOST1X05_CHANNEL_H #define HOST1X_HW_HOST1X05_CHANNEL_H +#define HOST1X_CHANNEL_BASE(x) ((x) * 0x4000) + static inline u32 host1x_channel_fifostat_r(void) { return 0x0; diff --git a/drivers/gpu/host1x/hw/hw_host1x06_vm.h b/drivers/gpu/host1x/hw/hw_host1x06_vm.h index e54b33902332..0750aea78a30 100644 --- a/drivers/gpu/host1x/hw/hw_host1x06_vm.h +++ b/drivers/gpu/host1x/hw/hw_host1x06_vm.h @@ -15,6 +15,8 @@ * */ +#define HOST1X_CHANNEL_BASE(x) ((x) * 0x100) + #define HOST1X_CHANNEL_DMASTART 0x0000 #define HOST1X_CHANNEL_DMASTART_HI 0x0004 #define HOST1X_CHANNEL_DMAPUT 0x0008