From patchwork Fri Aug 19 15:24:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Michel_D=C3=A4nzer?= X-Patchwork-Id: 1080912 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 p7JFOqgL020915 for ; Fri, 19 Aug 2011 15:25:12 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 44F86A0C41 for ; Fri, 19 Aug 2011 08:24:51 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from TX2EHSOBE003.bigfish.com (tx2ehsobe002.messaging.microsoft.com [65.55.88.12]) by gabe.freedesktop.org (Postfix) with ESMTP id C842AA0BFB for ; Fri, 19 Aug 2011 08:24:35 -0700 (PDT) Received: from mail146-tx2-R.bigfish.com (10.9.14.249) by TX2EHSOBE003.bigfish.com (10.9.40.23) with Microsoft SMTP Server id 14.1.225.22; Fri, 19 Aug 2011 15:24:31 +0000 Received: from mail146-tx2 (localhost.localdomain [127.0.0.1]) by mail146-tx2-R.bigfish.com (Postfix) with ESMTP id 7C0C8A6817D for ; Fri, 19 Aug 2011 15:24:27 +0000 (UTC) X-SpamScore: 1 X-BigFish: VPS1(zzc89bhzz1202hzz8275bhz32i668h839h93fh64h) X-Spam-TCS-SCL: 3:0 X-Forefront-Antispam-Report: CIP:163.181.249.108; KIP:(null); UIP:(null); IPVD:NLI; H:ausb3twp01.amd.com; RD:none; EFVD:NLI Received: from mail146-tx2 (localhost.localdomain [127.0.0.1]) by mail146-tx2 (MessageSwitch) id 1313767467170611_5108; Fri, 19 Aug 2011 15:24:27 +0000 (UTC) Received: from TX2EHSMHS015.bigfish.com (unknown [10.9.14.251]) by mail146-tx2.bigfish.com (Postfix) with ESMTP id 25570EE8046 for ; Fri, 19 Aug 2011 15:24:27 +0000 (UTC) Received: from ausb3twp01.amd.com (163.181.249.108) by TX2EHSMHS015.bigfish.com (10.9.99.115) with Microsoft SMTP Server id 14.1.225.22; Fri, 19 Aug 2011 15:24:26 +0000 X-WSS-ID: 0LQ6LGO-01-6L7-02 X-M-MSG: Received: from sausexedgep02.amd.com (sausexedgep02-ext.amd.com [163.181.249.73]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by ausb3twp01.amd.com (Axway MailGate 3.8.1) with ESMTP id 23B461028239 for ; Fri, 19 Aug 2011 10:24:24 -0500 (CDT) Received: from sausexhtp01.amd.com (163.181.3.165) by sausexedgep02.amd.com (163.181.36.59) with Microsoft SMTP Server (TLS) id 8.3.106.1; Fri, 19 Aug 2011 10:24:55 -0500 Received: from storexhtp02.amd.com (172.24.4.4) by sausexhtp01.amd.com (163.181.3.165) with Microsoft SMTP Server (TLS) id 8.3.83.0; Fri, 19 Aug 2011 10:24:25 -0500 Received: from probook.local (10.224.154.229) by storexhtp02.amd.com (172.24.4.4) with Microsoft SMTP Server id 8.3.83.0; Fri, 19 Aug 2011 11:24:24 -0400 Received: from daenzer by probook.local with local (Exim 4.76) (envelope-from ) id 1QuQvl-00022P-Ho for dri-devel@lists.freedesktop.org; Fri, 19 Aug 2011 17:24:21 +0200 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= To: Subject: [PATCH] drm/radeon: Make vramlimit parameter actually work. Date: Fri, 19 Aug 2011 17:24:18 +0200 Message-ID: <1313767459-7796-3-git-send-email-michel@daenzer.net> X-Mailer: git-send-email 1.7.5.4 MIME-Version: 1.0 X-OriginatorOrg: amd.com 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]); Fri, 19 Aug 2011 15:25:12 +0000 (UTC) X-MIME-Autoconverted: from base64 to 8bit by demeter2.kernel.org id p7JFOqgL020915 From: Michel Dänzer Signed-off-by: Michel Dänzer Reviewed-by: Alex Deucher --- drivers/gpu/drm/radeon/radeon_device.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index 7cfaa7e..f67d719 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c @@ -300,6 +300,8 @@ void radeon_vram_location(struct radeon_device *rdev, struct radeon_mc *mc, u64 mc->mc_vram_size = mc->aper_size; } mc->vram_end = mc->vram_start + mc->mc_vram_size - 1; + if (radeon_vram_limit && radeon_vram_limit < mc->real_vram_size) + mc->real_vram_size = radeon_vram_limit; dev_info(rdev->dev, "VRAM: %lluM 0x%016llX - 0x%016llX (%lluM used)\n", mc->mc_vram_size >> 20, mc->vram_start, mc->vram_end, mc->real_vram_size >> 20);