From patchwork Thu Jun 9 22:20:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jay Estabrook X-Patchwork-Id: 867422 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p59N343O001868 for ; Thu, 9 Jun 2011 23:03:25 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D256FA026E for ; Thu, 9 Jun 2011 16:03:03 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-vx0-f177.google.com (mail-vx0-f177.google.com [209.85.220.177]) by gabe.freedesktop.org (Postfix) with ESMTP id DC5BC9E732 for ; Thu, 9 Jun 2011 15:48:22 -0700 (PDT) Received: by vxd2 with SMTP id 2so2121174vxd.36 for ; Thu, 09 Jun 2011 15:48:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:x-mailer :mime-version:content-type:content-transfer-encoding; bh=AYY/g27HmYxMdi9PN7uYlQJw3DOlVP5+LquD7dWAWsI=; b=KzIccJzZrXz68CPR3njc5daVrX/RArlsAH2ZNGCgEG7edHd3fdTMSIG6wVuBj1XDNo 8TnwK/V1sNzqfVHUxf9SB6eyus+yfx30sMpDwms5KFljN6pNhOlfdvOx1VntXZj0aJU1 bXr/2Odu9n2lwPCcFLNWQcebBkKVJ2/IIVinM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:x-mailer:mime-version :content-type:content-transfer-encoding; b=ZxurJfGcRiE8LT/RE7KmiiWSNtA+KZ0mcWGo+Zu9bEeLgTnmSvf+tz2dGqxMDU4CEL V+y6TBjMq+aF7drE7m6yQrSWCxhuI5OlMnWkgIEtHjeENAhJS7gRLn5nVsAb2a781CD8 LbxDt5gIi8mzLHWiqIk7CdEERH4jvYA9BbEkM= Received: by 10.52.176.74 with SMTP id cg10mr454024vdc.242.1307659702219; Thu, 09 Jun 2011 15:48:22 -0700 (PDT) Received: from localhost (pool-98-110-153-132.bstnma.fios.verizon.net [98.110.153.132]) by mx.google.com with ESMTPS id bl1sm1352627vbb.5.2011.06.09.15.48.20 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 09 Jun 2011 15:48:21 -0700 (PDT) Date: Thu, 9 Jun 2011 18:20:21 -0400 From: Jay Estabrook To: linux-alpha , linux-kernel , dri-devel Subject: [PATCH 3/3] alpha, drm: Add Alpha support to Radeon DRM code Message-ID: <20110609182021.73726ea3.jay.estabrook_gmail.com@gmail.com> X-Mailer: Claws Mail 3.7.8 (GTK+ 2.22.1; alpha-unknown-linux-gnu) Mime-Version: 1.0 X-Mailman-Approved-At: Thu, 09 Jun 2011 16:02:53 -0700 Cc: Jay Estabrook , Ivan Kokshaysky , Richard Henderson X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 09 Jun 2011 23:03:25 +0000 (UTC) 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 --- 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;