summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPekka Paalanen <pq@iki.fi>2009-03-02 22:09:26 +0200
committerPekka Paalanen <pq@iki.fi>2009-03-02 22:09:26 +0200
commitb47de8d5a3dbfc669c7ba9c6cb66a7491c30b537 (patch)
treeeb49620b586361db15bc0d97ec1f11bd945ad0c1
parent4c439ac4a7fa627691dfcd6a4be67cd95d8d33ee (diff)
drm: drop Linux < 2.6.12 support
Signed-off-by: Pekka Paalanen <pq@iki.fi>
-rw-r--r--linux-core/drmP.h6
-rw-r--r--linux-core/drm_agpsupport.c37
-rw-r--r--linux-core/drm_memory.c7
-rw-r--r--linux-core/drm_memory_debug.c4
4 files changed, 1 insertions, 53 deletions
diff --git a/linux-core/drmP.h b/linux-core/drmP.h
index 002ad3d9..bc68bfef 100644
--- a/linux-core/drmP.h
+++ b/linux-core/drmP.h
@@ -517,9 +517,7 @@ struct drm_agp_head {
DRM_AGP_KERN agp_info; /**< AGP device information */
struct list_head memory;
unsigned long mode; /**< AGP mode */
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,11)
struct agp_bridge_data *bridge;
-#endif
int enabled; /**< whether the AGP bus as been enabled */
int acquired; /**< whether the AGP device has been acquired */
unsigned long base;
@@ -1279,11 +1277,7 @@ extern int drm_agp_unbind_ioctl(struct drm_device *dev, void *data,
extern int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request);
extern int drm_agp_bind_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv);
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11)
-extern DRM_AGP_MEM *drm_agp_allocate_memory(size_t pages, u32 type);
-#else
extern DRM_AGP_MEM *drm_agp_allocate_memory(struct agp_bridge_data *bridge, size_t pages, u32 type);
-#endif
extern int drm_agp_free_memory(DRM_AGP_MEM * handle);
extern int drm_agp_bind_memory(DRM_AGP_MEM * handle, off_t start);
extern int drm_agp_unbind_memory(DRM_AGP_MEM * handle);
diff --git a/linux-core/drm_agpsupport.c b/linux-core/drm_agpsupport.c
index 3cc94ff7..2abfac6e 100644
--- a/linux-core/drm_agpsupport.c
+++ b/linux-core/drm_agpsupport.c
@@ -94,21 +94,12 @@ int drm_agp_info_ioctl(struct drm_device *dev, void *data,
*/
int drm_agp_acquire(struct drm_device * dev)
{
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11)
- int retcode;
-#endif
-
if (!dev->agp)
return -ENODEV;
if (dev->agp->acquired)
return -EBUSY;
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11)
- if ((retcode = agp_backend_acquire()))
- return retcode;
-#else
if (!(dev->agp->bridge = agp_backend_acquire(dev->pdev)))
return -ENODEV;
-#endif
dev->agp->acquired = 1;
return 0;
@@ -145,11 +136,7 @@ int drm_agp_release(struct drm_device *dev)
{
if (!dev->agp || !dev->agp->acquired)
return -EINVAL;
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11)
- agp_backend_release();
-#else
agp_backend_release(dev->agp->bridge);
-#endif
dev->agp->acquired = 0;
return 0;
@@ -178,11 +165,7 @@ int drm_agp_enable(struct drm_device *dev, struct drm_agp_mode mode)
return -EINVAL;
dev->agp->mode = mode.mode;
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11)
- agp_enable(mode.mode);
-#else
agp_enable(dev->agp->bridge, mode.mode);
-#endif
dev->agp->enabled = 1;
return 0;
}
@@ -418,9 +401,6 @@ struct drm_agp_head *drm_agp_init(struct drm_device *dev)
return NULL;
memset((void *)head, 0, sizeof(*head));
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11)
- agp_copy_info(&head->agp_info);
-#else
head->bridge = agp_find_bridge(dev->pdev);
if (!head->bridge) {
if (!(head->bridge = agp_backend_acquire(dev->pdev))) {
@@ -432,7 +412,7 @@ struct drm_agp_head *drm_agp_init(struct drm_device *dev)
} else {
agp_copy_info(head->bridge, &head->agp_info);
}
-#endif
+
if (head->agp_info.chipset == NOT_SUPPORTED) {
drm_free(head, sizeof(*head), DRM_MEM_AGPLISTS);
return NULL;
@@ -445,18 +425,11 @@ struct drm_agp_head *drm_agp_init(struct drm_device *dev)
}
/** Calls agp_allocate_memory() */
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11)
-DRM_AGP_MEM *drm_agp_allocate_memory(size_t pages, u32 type)
-{
- return agp_allocate_memory(pages, type);
-}
-#else
DRM_AGP_MEM *drm_agp_allocate_memory(struct agp_bridge_data *bridge,
size_t pages, u32 type)
{
return agp_allocate_memory(bridge, pages, type);
}
-#endif
/** Calls agp_free_memory() */
int drm_agp_free_memory(DRM_AGP_MEM * handle)
@@ -501,12 +474,8 @@ drm_agp_bind_pages(struct drm_device *dev,
int ret, i;
DRM_DEBUG("drm_agp_populate_ttm\n");
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11)
- mem = drm_agp_allocate_memory(num_pages, AGP_USER_MEMORY);
-#else
mem = drm_agp_allocate_memory(dev->agp->bridge, num_pages,
AGP_USER_MEMORY);
-#endif
if (mem == NULL) {
DRM_ERROR("Failed to allocate memory for %ld pages\n",
num_pages);
@@ -561,11 +530,7 @@ static int drm_agp_populate(struct drm_ttm_backend *backend,
return -1;
DRM_DEBUG("drm_agp_populate_ttm\n");
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11)
- mem = drm_agp_allocate_memory(num_pages, AGP_USER_MEMORY);
-#else
mem = drm_agp_allocate_memory(agp_be->bridge, num_pages, AGP_USER_MEMORY);
-#endif
if (!mem) {
drm_free_memctl(num_pages * sizeof(void *));
return -1;
diff --git a/linux-core/drm_memory.c b/linux-core/drm_memory.c
index d1a88c88..b6f0485c 100644
--- a/linux-core/drm_memory.c
+++ b/linux-core/drm_memory.c
@@ -293,17 +293,10 @@ static void *agp_remap(unsigned long offset, unsigned long size,
}
/** Wrapper around agp_allocate_memory() */
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11)
-DRM_AGP_MEM *drm_alloc_agp(struct drm_device *dev, int pages, u32 type)
-{
- return drm_agp_allocate_memory(pages, type);
-}
-#else
DRM_AGP_MEM *drm_alloc_agp(struct drm_device *dev, int pages, u32 type)
{
return drm_agp_allocate_memory(dev->agp->bridge, pages, type);
}
-#endif
/** Wrapper around agp_free_memory() */
int drm_free_agp(DRM_AGP_MEM * handle, int pages)
diff --git a/linux-core/drm_memory_debug.c b/linux-core/drm_memory_debug.c
index c196ee2b..faef1d72 100644
--- a/linux-core/drm_memory_debug.c
+++ b/linux-core/drm_memory_debug.c
@@ -300,11 +300,7 @@ DRM_AGP_MEM *drm_alloc_agp(struct drm_device *dev, int pages, u32 type)
return NULL;
}
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11)
- if ((handle = drm_agp_allocate_memory(pages, type))) {
-#else
if ((handle = drm_agp_allocate_memory(dev->agp->bridge, pages, type))) {
-#endif
spin_lock(&drm_mem_lock);
++drm_mem_stats[DRM_MEM_TOTALAGP].succeed_count;
drm_mem_stats[DRM_MEM_TOTALAGP].bytes_allocated