From: Alexandre Courbot <acourbot@nvidia.com>
To: Ben Skeggs <bskeggs@redhat.com>
Cc: Thierry Reding <thierry.reding@gmail.com>,
<nouveau@lists.freedesktop.org>,
<dri-devel@lists.freedesktop.org>, <linux-tegra@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <gnurou@gmail.com>,
Alexandre Courbot <acourbot@nvidia.com>
Subject: [PATCH 03/12] drm/nouveau/bar: only ioremap BAR3 if it exists
Date: Mon, 24 Mar 2014 17:42:25 +0900 [thread overview]
Message-ID: <1395650554-31925-4-git-send-email-acourbot@nvidia.com> (raw)
In-Reply-To: <1395650554-31925-1-git-send-email-acourbot@nvidia.com>
Some chips that use system memory exclusively (e.g. GK20A) do not
expose 2 BAR regions. For them only BAR1 exists, and it should be used
for USERD mapping. Do not map BAR3 if its resource does not exist.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
drivers/gpu/drm/nouveau/core/subdev/bar/base.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/core/subdev/bar/base.c b/drivers/gpu/drm/nouveau/core/subdev/bar/base.c
index bdf594116f3f..d713eeb75b13 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/bar/base.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/bar/base.c
@@ -110,6 +110,7 @@ nouveau_bar_create_(struct nouveau_object *parent,
{
struct nouveau_device *device = nv_device(parent);
struct nouveau_bar *bar;
+ bool has_bar3 = nv_device_resource_len(device, 3) != 0;
int ret;
ret = nouveau_subdev_create_(parent, engine, oclass, 0, "BARCTL",
@@ -118,8 +119,10 @@ nouveau_bar_create_(struct nouveau_object *parent,
if (ret)
return ret;
- bar->iomem = ioremap(nv_device_resource_start(device, 3),
- nv_device_resource_len(device, 3));
+ if (has_bar3)
+ bar->iomem = ioremap(nv_device_resource_start(device, 3),
+ nv_device_resource_len(device, 3));
+
return 0;
}
--
1.9.1
next prev parent reply other threads:[~2014-03-24 8:46 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-24 8:42 [PATCH 00/12] drm/nouveau: support for GK20A, cont'd Alexandre Courbot
2014-03-24 8:42 ` [PATCH 01/12] drm/nouveau: fix missing newline Alexandre Courbot
2014-03-24 21:49 ` Thierry Reding
2014-03-24 8:42 ` [PATCH 02/12] drm/nouveau/timer: skip calibration on GK20A Alexandre Courbot
2014-03-24 21:54 ` Thierry Reding
2014-03-26 4:19 ` Ben Skeggs
2014-04-11 2:46 ` Alexandre Courbot
2014-04-11 7:31 ` Ben Skeggs
2014-04-11 7:34 ` Alexandre Courbot
2014-04-14 8:35 ` Ben Skeggs
2014-04-15 6:10 ` Alexandre Courbot
2014-03-24 8:42 ` Alexandre Courbot [this message]
2014-03-24 22:13 ` [PATCH 03/12] drm/nouveau/bar: only ioremap BAR3 if it exists Thierry Reding
2014-03-26 4:20 ` [Nouveau] " Ben Skeggs
2014-03-24 8:42 ` [PATCH 04/12] drm/nouveau/bar/nvc0: support chips without BAR3 Alexandre Courbot
2014-03-24 22:10 ` Thierry Reding
2014-04-02 13:47 ` Alexandre Courbot
2014-03-24 8:42 ` [PATCH 05/12] drm/nouveau/fifo: add GK20A support Alexandre Courbot
2014-03-24 22:14 ` Thierry Reding
2014-03-24 8:42 ` [PATCH 06/12] drm/nouveau/ibus: " Alexandre Courbot
2014-03-24 22:34 ` Thierry Reding
2014-04-02 13:52 ` Alexandre Courbot
2014-04-02 14:18 ` [Nouveau] " Ilia Mirkin
2014-04-02 14:22 ` Alexandre Courbot
2014-03-24 8:42 ` [PATCH 07/12] drm/nouveau/fb: " Alexandre Courbot
2014-03-24 8:42 ` [PATCH 08/12] drm/nouveau/graph: enable when using external firmware Alexandre Courbot
2014-03-24 22:58 ` Thierry Reding
2014-03-26 4:21 ` Ben Skeggs
2014-04-02 13:53 ` Alexandre Courbot
2014-03-24 8:42 ` [PATCH 09/12] drm/nouveau/graph: pad firmware code at load time Alexandre Courbot
2014-03-24 23:02 ` Thierry Reding
2014-03-26 4:22 ` [Nouveau] " Ben Skeggs
2014-04-02 13:54 ` Alexandre Courbot
2014-03-24 8:42 ` [PATCH 10/12] drm/nouveau/graph: add GK20A support Alexandre Courbot
2014-03-26 4:24 ` Ben Skeggs
2014-04-02 14:03 ` Alexandre Courbot
2014-04-02 23:11 ` Ben Skeggs
2014-03-24 8:42 ` [PATCH 11/12] drm/nouveau: support GK20A in nouveau_accel_init() Alexandre Courbot
2014-03-24 23:10 ` Thierry Reding
2014-03-26 4:27 ` Ben Skeggs
2014-04-02 14:14 ` Alexandre Courbot
2014-04-02 14:23 ` [Nouveau] " Ilia Mirkin
2014-04-02 23:14 ` Ben Skeggs
2014-04-16 5:57 ` Alexandre Courbot
2014-03-24 8:42 ` [PATCH 12/12] drm/nouveau: support for probing GK20A Alexandre Courbot
2014-03-24 23:11 ` Thierry Reding
2014-03-26 4:28 ` [Nouveau] " Ben Skeggs
2014-04-02 14:19 ` Alexandre Courbot
2014-03-24 13:19 ` [PATCH 00/12] drm/nouveau: support for GK20A, cont'd Lucas Stach
2014-03-26 6:33 ` Alexandre Courbot
2014-03-26 10:33 ` Lucas Stach
2014-03-27 3:50 ` Alexandre Courbot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1395650554-31925-4-git-send-email-acourbot@nvidia.com \
--to=acourbot@nvidia.com \
--cc=bskeggs@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gnurou@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=nouveau@lists.freedesktop.org \
--cc=thierry.reding@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox