From patchwork Tue Sep 28 23:07:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francisco Jerez X-Patchwork-Id: 216052 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 o8SN7NJo032011 for ; Tue, 28 Sep 2010 23:07:44 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1C3B59EFCC for ; Tue, 28 Sep 2010 16:07:23 -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 845209E76C for ; Tue, 28 Sep 2010 16:07:13 -0700 (PDT) Received: from auk.riseup.net (auk-pn.riseup.net [10.0.1.45]) (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 E0E9C25FC8E; Tue, 28 Sep 2010 16:07:12 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: currojerez@auk.riseup.net) with ESMTPSA id 9F4BE48E5 From: Francisco Jerez To: linux-kernel@vger.kernel.org Subject: [PATCH] agp/amd-k7: Allow binding user memory to the AGP GART. Date: Wed, 29 Sep 2010 01:07:05 +0200 Message-Id: <1285715225-21449-1-git-send-email-currojerez@riseup.net> X-Mailer: git-send-email 1.6.4.4 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.96.3 at mx1 X-Virus-Status: Clean Cc: =?UTF-8?q?Grzesiek=20S=C3=B3jka?= , 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.3 (demeter1.kernel.org [140.211.167.41]); Tue, 28 Sep 2010 23:07:44 +0000 (UTC) X-MIME-Autoconverted: from base64 to 8bit by demeter1.kernel.org id o8SN7NJo032011 diff --git a/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c index b6b1568..82e5189 100644 --- a/drivers/char/agp/amd-k7-agp.c +++ b/drivers/char/agp/amd-k7-agp.c @@ -303,13 +303,15 @@ static void amd_irongate_tlbflush(struct agp_memory *temp) static int amd_insert_memory(struct agp_memory *mem, off_t pg_start, int type) { + struct agp_bridge_data *bridge = mem->bridge; int i, j, num_entries; unsigned long __iomem *cur_gatt; unsigned long addr; num_entries = A_SIZE_LVL2(agp_bridge->current_size)->num_entries; - if (type != 0 || mem->type != 0) + if (!bridge || type != mem->type || + bridge->driver->agp_type_to_mask_type(bridge, type)) return -EINVAL; if ((pg_start + mem->page_count) > num_entries)