summaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2010-10-16 00:45:15 +0000
committerDave Airlie <airlied@redhat.com>2010-10-19 14:12:32 +1000
commitf6086134d0b17b2c37f537a5429a919b3d2cced8 (patch)
tree05062712f62bb1ed8984889a104096fcef90622b /drivers/char
parent965d38074e6eae71757a8baf9a348139e1e6894d (diff)
downloadop-kernel-dev-f6086134d0b17b2c37f537a5429a919b3d2cced8.zip
op-kernel-dev-f6086134d0b17b2c37f537a5429a919b3d2cced8.tar.gz
agp/amd-k7: Allow binding user memory to the AGP GART.
TTM-based DRM drivers need to be able to bind user memory to the AGP aperture. This patch fixes the "[TTM] AGP Bind memory failed." errors and the subsequent fallout seen with the nouveau driver. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Tested-by: Grzesiek Sójka <pld@pfu.pl> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/agp/amd-k7-agp.c6
1 files changed, 4 insertions, 2 deletions
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++) {
OpenPOWER on IntegriCloud