diff options
author | Dave Airlie <airlied@linux.ie> | 2005-06-17 09:09:17 +0000 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2005-06-17 09:09:17 +0000 |
commit | 71df0eed3476d4430a59ce21ca641ac8eecf54e2 (patch) | |
tree | 1b49d7846e3ca3dc516afa126498920bb642c002 /linux-core | |
parent | 0569fe7a528e5e0753d9f72807a8f4310c6c9782 (diff) |
fix up drm_alloc_agp to take a dev arg and not pass crappy agpgart around
Diffstat (limited to 'linux-core')
-rw-r--r-- | linux-core/drmP.h | 6 | ||||
-rw-r--r-- | linux-core/drm_agpsupport.c | 9 | ||||
-rw-r--r-- | linux-core/drm_memory.c | 6 | ||||
-rw-r--r-- | linux-core/drm_memory_debug.c | 2 | ||||
-rw-r--r-- | linux-core/drm_memory_debug.h | 2 |
5 files changed, 7 insertions, 18 deletions
diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 7d5902ef..410a3e2c 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -786,11 +786,7 @@ extern void *drm_calloc(size_t nmemb, size_t size, int area); extern void *drm_realloc(void *oldpt, size_t oldsize, size_t size, int area); extern unsigned long drm_alloc_pages(int order, int area); extern void drm_free_pages(unsigned long address, int order, int area); -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11) -extern DRM_AGP_MEM *drm_alloc_agp(int pages, u32 type); -#else -extern DRM_AGP_MEM *drm_alloc_agp(struct agp_bridge_data *bridge, int pages, u32 type); -#endif +extern DRM_AGP_MEM *drm_alloc_agp(drm_device_t *dev, int pages, u32 type); extern int drm_free_agp(DRM_AGP_MEM * handle, int pages); extern int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start); extern int drm_unbind_agp(DRM_AGP_MEM * handle); diff --git a/linux-core/drm_agpsupport.c b/linux-core/drm_agpsupport.c index 686efcc9..078c9127 100644 --- a/linux-core/drm_agpsupport.c +++ b/linux-core/drm_agpsupport.c @@ -251,17 +251,10 @@ int drm_agp_alloc(struct inode *inode, struct file *filp, pages = (request.size + PAGE_SIZE - 1) / PAGE_SIZE; type = (u32) request.type; -#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11) - if (!(memory = drm_alloc_agp(pages, type))) { - drm_free(entry, sizeof(*entry), DRM_MEM_AGPLISTS); - return -ENOMEM; - } -#else - if (!(memory = drm_alloc_agp(dev->agp->bridge, pages, type))) { + if (!(memory = drm_alloc_agp(dev, pages, type))) { drm_free(entry, sizeof(*entry), DRM_MEM_AGPLISTS); return -ENOMEM; } -#endif entry->handle = (unsigned long)memory->key + 1; entry->memory = memory; diff --git a/linux-core/drm_memory.c b/linux-core/drm_memory.c index 2cc3dc67..69610046 100644 --- a/linux-core/drm_memory.c +++ b/linux-core/drm_memory.c @@ -152,14 +152,14 @@ void drm_free_pages(unsigned long address, int order, int area) #if __OS_HAS_AGP /** Wrapper around agp_allocate_memory() */ #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11) -DRM_AGP_MEM *drm_alloc_agp(int pages, u32 type) +DRM_AGP_MEM *drm_alloc_agp(drm_device_t *dev, int pages, u32 type) { return drm_agp_allocate_memory(pages, type); } #else -DRM_AGP_MEM *drm_alloc_agp(struct agp_bridge_data *bridge, int pages, u32 type) +DRM_AGP_MEM *drm_alloc_agp(drm_device_t *dev, int pages, u32 type) { - return drm_agp_allocate_memory(bridge, pages, type); + return drm_agp_allocate_memory(dev->agp->bridge, pages, type); } #endif EXPORT_SYMBOL(drm_alloc_agp); diff --git a/linux-core/drm_memory_debug.c b/linux-core/drm_memory_debug.c index 9a47c5fd..875fec05 100644 --- a/linux-core/drm_memory_debug.c +++ b/linux-core/drm_memory_debug.c @@ -365,7 +365,7 @@ EXPORT_SYMBOL(drm_ioremapfree); #if __OS_HAS_AGP -DRM_AGP_MEM *drm_alloc_agp(int pages, u32 type) +DRM_AGP_MEM *drm_alloc_agp(drm_device_t *dev, int pages, u32 type) { DRM_AGP_MEM *handle; diff --git a/linux-core/drm_memory_debug.h b/linux-core/drm_memory_debug.h index c55ec230..706b7525 100644 --- a/linux-core/drm_memory_debug.h +++ b/linux-core/drm_memory_debug.h @@ -346,7 +346,7 @@ void drm_ioremapfree (void *pt, unsigned long size, drm_device_t * dev) { #if __OS_HAS_AGP -DRM_AGP_MEM *drm_alloc_agp (int pages, u32 type) { +DRM_AGP_MEM *drm_alloc_agp (drm_device_t *dev, int pages, u32 type) { DRM_AGP_MEM *handle; if (!pages) { |