From patchwork Sat Oct 16 00:45:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francisco Jerez X-Patchwork-Id: 258161 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 o9G0jcpW011443 for ; Sat, 16 Oct 2010 00:46:00 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CC73D9E8A7 for ; Fri, 15 Oct 2010 17:45:37 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx1.riseup.net (mx1.riseup.net [204.13.164.18]) by gabe.freedesktop.org (Postfix) with ESMTP id D0AF29E821 for ; Fri, 15 Oct 2010 17:45:27 -0700 (PDT) Received: from tern.riseup.net (tern-pn.riseup.net [10.0.1.12]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "Gandi Standard SSL CA" (verified OK)) by mx1.riseup.net (Postfix) with ESMTPS id DCFFC25ECD5; Fri, 15 Oct 2010 17:45:26 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: currojerez@tern.riseup.net) with ESMTPSA id 5DA5514C158 From: Francisco Jerez To: Dave Airlie Subject: [PATCHv2] agp/amd-k7: Allow binding user memory to the AGP GART. Date: Sat, 16 Oct 2010 02:45:15 +0200 Message-Id: <1287189915-13341-1-git-send-email-currojerez@riseup.net> X-Mailer: git-send-email 1.6.4.4 In-Reply-To: <1285715225-21449-1-git-send-email-currojerez@riseup.net> References: <1285715225-21449-1-git-send-email-currojerez@riseup.net> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.96.3 at mx1 X-Virus-Status: Clean Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, =?UTF-8?q?Grzesiek=20S=C3=B3jka?= 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.3 (demeter1.kernel.org [140.211.167.41]); Sat, 16 Oct 2010 00:46:00 +0000 (UTC) X-MIME-Autoconverted: from base64 to 8bit by demeter1.kernel.org id o9G0jcpW011443 diff --git a/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c index b6b1568..b1b4362 100644 --- a/drivers/char/agp/amd-k7-agp.c +++ b/drivers/char/agp/amd-k7-agp.c @@ -309,7 +309,8 @@ static int amd_insert_memory(struct agp_memory *mem, off_t pg_start, int type) num_entries = A_SIZE_LVL2(agp_bridge->current_size)->num_entries; - if (type != 0 || mem->type != 0) + if (type != mem->type || + agp_bridge->driver->agp_type_to_mask_type(agp_bridge, type)) return -EINVAL; if ((pg_start + mem->page_count) > num_entries) @@ -348,7 +349,8 @@ static int amd_remove_memory(struct agp_memory *mem, off_t pg_start, int type) unsigned long __iomem *cur_gatt; unsigned long addr; - if (type != 0 || mem->type != 0) + if (type != mem->type || + agp_bridge->driver->agp_type_to_mask_type(agp_bridge, type)) return -EINVAL; for (i = pg_start; i < (mem->page_count + pg_start); i++) {