From b0e1f0ddb96c58ee38dc986f7bffff964116e3cf Mon Sep 17 00:00:00 2001 From: Shaohua Li Date: Mon, 4 Aug 2008 14:51:30 +0800 Subject: [PATCH] --- yaml --- r: 112524 b: refs/heads/master c: 466ae837424dcc538b1af2a0eaf53be32edcdbe7 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/char/agp/agp.h | 4 ++++ trunk/drivers/char/agp/generic.c | 4 +++- trunk/include/asm-x86/agp.h | 3 +++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 5777ea66f84b..192410bcca47 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1ac2f7d55b7ee1613c90631e87fea22ec06781e5 +refs/heads/master: 466ae837424dcc538b1af2a0eaf53be32edcdbe7 diff --git a/trunk/drivers/char/agp/agp.h b/trunk/drivers/char/agp/agp.h index 81e14bea54bd..395168fb17e3 100644 --- a/trunk/drivers/char/agp/agp.h +++ b/trunk/drivers/char/agp/agp.h @@ -30,6 +30,10 @@ #define _AGP_BACKEND_PRIV_H 1 #include /* for flush_agp_cache() */ +#ifndef map_page_into_agp_noflush +#define map_page_into_agp_noflush(page) map_page_into_agp(page) +#define map_page_into_agp_global_flush() +#endif #define PFX "agpgart: " diff --git a/trunk/drivers/char/agp/generic.c b/trunk/drivers/char/agp/generic.c index eaa1a355bb32..bf239b8ecac5 100644 --- a/trunk/drivers/char/agp/generic.c +++ b/trunk/drivers/char/agp/generic.c @@ -274,6 +274,7 @@ struct agp_memory *agp_allocate_memory(struct agp_bridge_data *bridge, new->memory[i] = virt_to_gart(addr); new->page_count++; } + map_page_into_agp_global_flush(); new->bridge = bridge; return new; @@ -1186,7 +1187,8 @@ void *agp_generic_alloc_page(struct agp_bridge_data *bridge) if (page == NULL) return NULL; - map_page_into_agp(page); + /* agp_allocate_memory will do flush */ + map_page_into_agp_noflush(page); get_page(page); atomic_inc(&agp_bridge->current_memory_agp); diff --git a/trunk/include/asm-x86/agp.h b/trunk/include/asm-x86/agp.h index e4004a9f6a9a..181b9e984b3a 100644 --- a/trunk/include/asm-x86/agp.h +++ b/trunk/include/asm-x86/agp.h @@ -15,6 +15,9 @@ #define map_page_into_agp(page) set_pages_uc(page, 1) #define unmap_page_from_agp(page) set_pages_wb(page, 1) +#define map_page_into_agp_noflush(page) set_pages_uc_noflush(page, 1) +#define map_page_into_agp_global_flush() set_memory_flush_all() + /* * Could use CLFLUSH here if the cpu supports it. But then it would * need to be called for each cacheline of the whole page so it may