From patchwork Thu Feb 24 08:25:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 586781 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1O8PtoI013238 for ; Thu, 24 Feb 2011 08:26:15 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B403D9ED97 for ; Thu, 24 Feb 2011 00:25:54 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-fx0-f49.google.com (mail-fx0-f49.google.com [209.85.161.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 0C2A19E752 for ; Thu, 24 Feb 2011 00:25:44 -0800 (PST) Received: by fxm16 with SMTP id 16so312994fxm.36 for ; Thu, 24 Feb 2011 00:25:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=toh3qw7PdAn7CKoGYpATWYWaSgyAq000o/oLWYgk8S0=; b=krDet+AJqAreI/K9Td6CEW3pbnxZUWnJwJZPYHMg5GmESVBxD6BYEBhcZlVY+mEG9i nWMcK73t1eUDqWrPWMwMdGq9FyCHUtyyU4HCTG1hLFmh0syMfJVggfTeXfg+2CP2Ma2+ 6EYnSCG+8k1Ur5WB6suRDBtl+t6tjSWHKPleI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=CkvdV0RQFIKxRdnP8If+WFwjKkOeyu34Pg3/1j7XwKOs0/nP7h23fDpl1oUVF+jPul ZTaguONXAACMYaihJi3Re1Bn06Yjc+4VUdn2yQY6/LvA8+1O8s2BMk0VMiABUhyq3Q9U LAbetvl4VgGQUqLTyrm+TBkgL6EEhD9U5olec= MIME-Version: 1.0 Received: by 10.223.113.73 with SMTP id z9mr665028fap.41.1298535943937; Thu, 24 Feb 2011 00:25:43 -0800 (PST) Received: by 10.223.114.68 with HTTP; Thu, 24 Feb 2011 00:25:43 -0800 (PST) In-Reply-To: <1298494135-16751-2-git-send-email-konrad.wilk@oracle.com> References: <1298494135-16751-1-git-send-email-konrad.wilk@oracle.com> <1298494135-16751-2-git-send-email-konrad.wilk@oracle.com> Date: Thu, 24 Feb 2011 03:25:43 -0500 Message-ID: Subject: Re: [PATCH] radeon: DMA unmap dummy page during unload/unbind. From: Alex Deucher To: Konrad Rzeszutek Wilk Cc: Dave Airlie , Jerome Glisse , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org 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 (demeter1.kernel.org [140.211.167.41]); Thu, 24 Feb 2011 08:26:15 +0000 (UTC) From d22bba30a66ba95cabeed7a71c982dfa96521384 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Thu, 24 Feb 2011 03:16:21 -0500 Subject: [PATCH] drm/radeon/kms: clean up gart dummy page handling As per Konrad's original patch, the dummy page used by the gart code and allocated in radeon_gart_init() was not freed properly in radeon_gart_fini(). At the same time r6xx and newer allocated and freed the dummy page on their own. So to do Konrad's patch one better, just remove the allocation and freeing of the dummy page in the r6xx, 7xx, evergreen, and ni code and allocate and free in the gart_init/fini() functions for all asics. Cc: Konrad Rzeszutek Wilk Cc: Jerome Glisse Signed-off-by: Alex Deucher --- drivers/gpu/drm/radeon/evergreen.c | 4 ---- drivers/gpu/drm/radeon/r600.c | 4 ---- drivers/gpu/drm/radeon/radeon_gart.c | 2 ++ drivers/gpu/drm/radeon/rv770.c | 4 ---- 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 789441e..9ecb2b6 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c @@ -3048,9 +3048,6 @@ int evergreen_init(struct radeon_device *rdev) { int r; - r = radeon_dummy_page_init(rdev); - if (r) - return r; /* This don't do much */ r = radeon_gem_init(rdev); if (r) @@ -3162,7 +3159,6 @@ void evergreen_fini(struct radeon_device *rdev) radeon_atombios_fini(rdev); kfree(rdev->bios); rdev->bios = NULL; - radeon_dummy_page_fini(rdev); } static void evergreen_pcie_gen2_enable(struct radeon_device *rdev) diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index 1252198..88eaffc 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c @@ -2510,9 +2510,6 @@ int r600_init(struct radeon_device *rdev) { int r; - r = radeon_dummy_page_init(rdev); - if (r) - return r; if (r600_debugfs_mc_info_init(rdev)) { DRM_ERROR("Failed to register debugfs file for mc !\n"); } @@ -2626,7 +2623,6 @@ void r600_fini(struct radeon_device *rdev) radeon_atombios_fini(rdev); kfree(rdev->bios); rdev->bios = NULL; - radeon_dummy_page_fini(rdev); } diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c index 6501611..dc04c7b 100644 --- a/drivers/gpu/drm/radeon/radeon_gart.c +++ b/drivers/gpu/drm/radeon/radeon_gart.c @@ -269,4 +269,6 @@ void radeon_gart_fini(struct radeon_device *rdev) kfree(rdev->gart.pages_addr); rdev->gart.pages = NULL; rdev->gart.pages_addr = NULL; + + radeon_dummy_page_fini(rdev); } diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c index d8ba676..6a312e6 100644 --- a/drivers/gpu/drm/radeon/rv770.c +++ b/drivers/gpu/drm/radeon/rv770.c @@ -1256,9 +1256,6 @@ int rv770_init(struct radeon_device *rdev) { int r; - r = radeon_dummy_page_init(rdev); - if (r) - return r; /* This don't do much */ r = radeon_gem_init(rdev); if (r) @@ -1373,7 +1370,6 @@ void rv770_fini(struct radeon_device *rdev) radeon_atombios_fini(rdev); kfree(rdev->bios); rdev->bios = NULL; - radeon_dummy_page_fini(rdev); } static void rv770_pcie_gen2_enable(struct radeon_device *rdev) -- 1.7.1.1