From: Jay Estabrook <jay.estabrook@gmail.com>
To: linux-alpha <linux-alpha@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
dri-devel <dri-devel@lists.freedesktop.org>
Cc: Matt Turner <mattst88@gmail.com>,
Richard Henderson <rth@twiddle.net>,
Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
Jay Estabrook <jay.estabrook@gmail.com>,
airlied@linux.ie
Subject: [PATCH 3/3] alpha, drm: Add Alpha support to Radeon DRM code
Date: Thu, 9 Jun 2011 18:20:21 -0400 [thread overview]
Message-ID: <20110609182021.73726ea3.jay.estabrook_gmail.com@gmail.com> (raw)
Alpha needs to have the system bus address for the device's local
memory available, so that it can be returned to user-level, where
it may be used in an mmap(). So, we make bus.addr hold the ioremap()
return for kernel use, and then we can modify bus.base appropriately.
Signed-off-by: Jay Estabrook <jay.estabrook@gmail.com>
---
drivers/gpu/drm/radeon/radeon_ttm.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff -Naurp a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
--- a/drivers/gpu/drm/radeon/radeon_ttm.c 2011-04-26 23:48:50.000000000 -0400
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c 2011-05-03 18:24:27.000000000 -0400
@@ -450,6 +450,29 @@ static int radeon_ttm_io_mem_reserve(str
return -EINVAL;
mem->bus.base = rdev->mc.aper_base;
mem->bus.is_iomem = true;
+#ifdef __alpha__
+ /*
+ * Alpha: use bus.addr to hold the ioremap() return,
+ * so we can modify bus.base below.
+ */
+ if (mem->placement & TTM_PL_FLAG_WC)
+ mem->bus.addr =
+ ioremap_wc(mem->bus.base + mem->bus.offset,
+ mem->bus.size);
+ else
+ mem->bus.addr =
+ ioremap_nocache(mem->bus.base + mem->bus.offset,
+ mem->bus.size);
+
+ /*
+ * Alpha: Take just the bus offset and
+ * add the hose/domain memory base.
+ * Then, bus.base can be returned
+ * for use in an mmap() call.
+ */
+ mem->bus.base = (mem->bus.base & 0x0ffffffffUL) +
+ rdev->ddev->hose->dense_mem_base;
+#endif
break;
default:
return -EINVAL;
---
next reply other threads:[~2011-06-09 22:20 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-09 22:20 Jay Estabrook [this message]
2011-06-13 23:35 ` [PATCH 3/3] alpha, drm: Add Alpha support to Radeon DRM code Dave Airlie
2011-06-15 2:38 ` Jay Estabrook
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=20110609182021.73726ea3.jay.estabrook_gmail.com@gmail.com \
--to=jay.estabrook@gmail.com \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=ink@jurassic.park.msu.ru \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mattst88@gmail.com \
--cc=rth@twiddle.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.