From patchwork Wed Jul 6 23:57:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jay Estabrook X-Patchwork-Id: 951672 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 p66NvRTq022276 for ; Wed, 6 Jul 2011 23:57:48 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 524769E841 for ; Wed, 6 Jul 2011 16:57:27 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qw0-f49.google.com (mail-qw0-f49.google.com [209.85.216.49]) by gabe.freedesktop.org (Postfix) with ESMTP id D538B9E74F for ; Wed, 6 Jul 2011 16:57:18 -0700 (PDT) Received: by qwi2 with SMTP id 2so258415qwi.36 for ; Wed, 06 Jul 2011 16:57:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:x-mailer:mime-version :content-type:content-transfer-encoding; bh=kP0ENFpz/O8rf4qXps/m1OxLVZ8E6SWB1UGUMqrjF0g=; b=G7CQH2OkyTzWI4Ra8ugC5hLngL4lvfj/xfJY+0QiQpViq9lB5RzqHcT7JnYAFUDzpj ccDnbuZSE7bD77bbrXe8jhfPxxdn9IHEJ6g15ppuFdMDeY0k9y/ef+8ngel1d6/Npcvc gm0fvJIHTwUVMC/Xl6tKlT46flCn2KY110VOk= Received: by 10.229.128.211 with SMTP id l19mr140131qcs.31.1309996638201; Wed, 06 Jul 2011 16:57:18 -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 e18sm6798952qcs.17.2011.07.06.16.57.15 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 06 Jul 2011 16:57:16 -0700 (PDT) Date: Wed, 6 Jul 2011 19:57:13 -0400 From: Jay Estabrook To: airlied@linux.ie, linux-kernel , linux-alpha , dri-devel Subject: [PATCH 3/3 REPOST #2] alpha, drm: Add Alpha support to Radeon DRM code Message-ID: <20110706195713.48fe25fe.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 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]); Wed, 06 Jul 2011 23:57:48 +0000 (UTC) Alpha needs to have available the system bus address for the Radeon's local memory, so that it can be used in ttm_bo_vm_fault(), when building the PTEs for accessing that VRAM. So, we make bus.addr hold the ioremap() return, and then we can modify bus.base appropriately for use during page fault processing. 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: Use just the bus offset plus + * the hose/domain memory base for bus.base. + * It then can be used to build PTEs for VRAM + * access, as done in ttm_bo_vm_fault(). + */ + mem->bus.base = (mem->bus.base & 0x0ffffffffUL) + + rdev->ddev->hose->dense_mem_base; +#endif break; default: return -EINVAL;