From patchwork Mon Jun 20 18:20:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jay Estabrook X-Patchwork-Id: 897962 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 p5KILDVf028556 for ; Mon, 20 Jun 2011 18:21:33 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 898A09E9F1 for ; Mon, 20 Jun 2011 11:21:12 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-vw0-f49.google.com (mail-vw0-f49.google.com [209.85.212.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 877DA9E732 for ; Mon, 20 Jun 2011 11:21:03 -0700 (PDT) Received: by vws8 with SMTP id 8so3209040vws.36 for ; Mon, 20 Jun 2011 11:21:02 -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=eXFbBroscKzesZCbvUOExDuKqcsBGOtC0C3pNfVuZ7g=; b=jM8AnpDZPY5AEgxEy/iaNlSI0jbmPYQIHD0/I9BHQe8EfNtjKoQkNet5UtSNdiUI9k EFAEefjSxVTTv8YHH9+JOTDynD4JPAa55Dmulff5WQPQ/FRyfmuJfVMLTIv+MrUnyohZ KVJkqiEgSuulz0xE+B6ApN1ZwDNrBk0pespUg= 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=ojFsk09PIDtiPRZbeKNITXAGUHhjYnz8TYhUriqEGm5284G4NJYSawPrANBDOvbEv4 Mund1sUW4MeBOFSG9b1gglGnKb1M7YM0fs5kWwIYa5+swUEBwgAi2In/+WpKqOOXhgh4 /z9Lz9mhbLgI9o7o0fAT7d3R4mbovDYPNp/tw= Received: by 10.52.113.194 with SMTP id ja2mr4503474vdb.300.1308594062760; Mon, 20 Jun 2011 11:21:02 -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 c1sm1845961vdu.17.2011.06.20.11.21.01 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 20 Jun 2011 11:21:02 -0700 (PDT) Date: Mon, 20 Jun 2011 14:20:59 -0400 From: Jay Estabrook To: airlied@linux.ie, linux-kernel , linux-alpha , dri-devel Subject: [PATCH 3/3 REPOST] alpha, drm: Add Alpha support to Radeon DRM code Message-ID: <20110620142059.04c3b912.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]); Mon, 20 Jun 2011 18:21:33 +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: 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;