Received: by 10.223.164.200 with SMTP id h8csp60378wrb; Sun, 5 Nov 2017 03:05:51 -0800 (PST) X-Google-Smtp-Source: ABhQp+SKhJAphQuglF5KiUFsZsKCX5bvTkG7bcpV0vqenuWrBwvjcsgxTm6pmP66GHoX0nXJTrvw X-Received: by 10.99.119.4 with SMTP id s4mr12050804pgc.377.1509879951777; Sun, 05 Nov 2017 03:05:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1509879951; cv=none; d=google.com; s=arc-20160816; b=vfvYKN1rS3vw3iRlf5UVoN8GDyYOMzYGhI9/iTMcvCdUU9ayJ3oWK+O1wJAKjA/3Y1 0U4Luj5mDBVbYLfKJZemCV06qB6A0eBBoHmyR7gfPnOIanEgEya3H7pbgizt4JmJbH4s 2xoKK07Dn/wjnPqoUqruuDJ2teYnevmooQQIynjIKFkzl4FNKbOYu59R1A11hHJyVC9o lJUyDRfqhSeXiyup1VvBJG142VOqjr+dM4HWS4qJ8dCBpgxjU3Tye88tjP+hyGcVCzRD FbXKUaygzMg3qtXAzxNEiiBd/IfnaELWCk/ahSJ+YuVlyj36wmtQM91P8ahgft0w4u93 gtNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=IVvtNUwes4p1VrTD4ari5NRMQ587s4kmU1Xik5J92fE=; b=f9AFouQrFAKRxhRqsRWWxn29WofjT4rkJ6OQ+SHyfiF9IWBv17trLtbv0Po2V1i7WN hWOqyEVY8Y3V+Cn/ElypY7r9w5p5MCDCx7yU/y8axZp0M/KPChFHI/7bVkB/MgzkX02l 5pvOS/Trw7giwpxnuicdlorz4hrpe6tzd8ESCwVN765+Q/oyf97sxa2iKvYGF0ac3kLm 9Z1gJMgb47rTxBKevMZIY53Sp/fOwyIfwnJUsdWuZXxQ54q0K2Z7FGn+dk2ygwD4Jbvi 12aUywpMNsAQojQ0rtuUpOnJutPTbrBZKG7B32CeBtUu8A8azrCrzJX/oQzoaVtVDNYY 2JDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kapsi.fi header.s=20161220 header.b=1bz8d7/h; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f19si9578852pgn.241.2017.11.05.03.05.38; Sun, 05 Nov 2017 03:05:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kapsi.fi header.s=20161220 header.b=1bz8d7/h; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753038AbdKELEV (ORCPT + 96 others); Sun, 5 Nov 2017 06:04:21 -0500 Received: from mail.kapsi.fi ([91.232.154.25]:43493 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751039AbdKELCD (ORCPT ); Sun, 5 Nov 2017 06:02:03 -0500 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 Cc: digetx@gmail.com, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, Mikko Perttunen 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.14.2 From 1583168237305480445@xxx Sat Nov 04 20:21:26 +0000 2017 X-GM-THRID: 1583168237305480445 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread