summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@fairlite.demon.co.uk>2001-08-19 15:20:08 +0000
committerAlan Hourihane <alanh@fairlite.demon.co.uk>2001-08-19 15:20:08 +0000
commitf4c2f1400203434d9a5392b990aaa4fa32dce9c5 (patch)
tree85cfb2292942fb8ddd4f44dc94275433dc74df05 /linux-core
parent8aaf82d45c406220d5f18168e4350827a9e038e2 (diff)
No one's maintaining 2.2.x support - so remove all the cruft.X_4_1_99_1-20010822-preimport
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/ati_pcigart.c6
-rw-r--r--linux-core/drmP.h28
-rw-r--r--linux-core/drm_agpsupport.c8
-rw-r--r--linux-core/drm_bufs.c4
-rw-r--r--linux-core/drm_drv.c20
-rw-r--r--linux-core/drm_fops.c18
-rw-r--r--linux-core/drm_memory.h15
-rw-r--r--linux-core/drm_scatter.c6
-rw-r--r--linux-core/drm_stub.c6
-rw-r--r--linux-core/drm_vm.c88
-rw-r--r--linux-core/i810_dma.c5
11 files changed, 8 insertions, 196 deletions
diff --git a/linux-core/ati_pcigart.c b/linux-core/ati_pcigart.c
index a794b3e0..d5d7c0ad 100644
--- a/linux-core/ati_pcigart.c
+++ b/linux-core/ati_pcigart.c
@@ -103,7 +103,7 @@ int DRM(ati_pcigart_init)( drm_device_t *dev,
goto done;
}
-#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400)
+#if defined(__alpha__)
if ( !dev->pdev ) {
DRM_ERROR( "PCI device unknown!\n" );
goto done;
@@ -130,7 +130,7 @@ int DRM(ati_pcigart_init)( drm_device_t *dev,
memset( pci_gart, 0, ATI_MAX_PCIGART_PAGES * sizeof(u32) );
for ( i = 0 ; i < pages ; i++ ) {
-#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400)
+#if defined(__alpha__)
/* we need to support large memory configurations */
entry->busaddr[i] = pci_map_single(dev->pdev,
page_address( entry->pagelist[i] ),
@@ -171,7 +171,7 @@ int DRM(ati_pcigart_cleanup)( drm_device_t *dev,
unsigned long addr,
dma_addr_t bus_addr)
{
-#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400)
+#if defined(__alpha__)
drm_sg_mem_t *entry = dev->sg;
unsigned long pages;
int i;
diff --git a/linux-core/drmP.h b/linux-core/drmP.h
index aac5c58a..a6d36a64 100644
--- a/linux-core/drmP.h
+++ b/linux-core/drmP.h
@@ -66,13 +66,8 @@
#include <linux/types.h>
#include <linux/agp_backend.h>
#endif
-#if LINUX_VERSION_CODE >= 0x020100 /* KERNEL_VERSION(2,1,0) */
#include <linux/tqueue.h>
#include <linux/poll.h>
-#endif
-#if LINUX_VERSION_CODE < 0x020400
-#include "compat-pre24.h"
-#endif
#include <asm/pgalloc.h>
#include "drm.h"
@@ -171,12 +166,7 @@ typedef struct wait_queue *wait_queue_head_t;
#define _PAGE_PSE _PAGE_4M
#endif
- /* vm_offset changed to vm_pgoff in 2.3.25 */
-#if LINUX_VERSION_CODE < 0x020319
-#define VM_OFFSET(vma) ((vma)->vm_offset)
-#else
#define VM_OFFSET(vma) ((vma)->vm_pgoff << PAGE_SHIFT)
-#endif
/* *_nopage return values defined in 2.3.26 */
#ifndef NOPAGE_SIGBUS
@@ -629,7 +619,7 @@ typedef struct drm_sg_mem {
void *virtual;
int pages;
struct page **pagelist;
-#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400)
+#if defined(__alpha__)
dma_addr_t *busaddr;
#endif
} drm_sg_mem_t;
@@ -772,21 +762,6 @@ extern unsigned int DRM(poll)(struct file *filp,
struct poll_table_struct *wait);
/* Mapping support (drm_vm.h) */
-#if LINUX_VERSION_CODE < 0x020317
-extern unsigned long DRM(vm_nopage)(struct vm_area_struct *vma,
- unsigned long address,
- int write_access);
-extern unsigned long DRM(vm_shm_nopage)(struct vm_area_struct *vma,
- unsigned long address,
- int write_access);
-extern unsigned long DRM(vm_dma_nopage)(struct vm_area_struct *vma,
- unsigned long address,
- int write_access);
-extern unsigned long DRM(vm_sg_nopage)(struct vm_area_struct *vma,
- unsigned long address,
- int write_access);
-#else
- /* Return type changed in 2.3.23 */
extern struct page *DRM(vm_nopage)(struct vm_area_struct *vma,
unsigned long address,
int write_access);
@@ -799,7 +774,6 @@ extern struct page *DRM(vm_dma_nopage)(struct vm_area_struct *vma,
extern struct page *DRM(vm_sg_nopage)(struct vm_area_struct *vma,
unsigned long address,
int write_access);
-#endif
extern void DRM(vm_open)(struct vm_area_struct *vma);
extern void DRM(vm_close)(struct vm_area_struct *vma);
extern void DRM(vm_shm_close)(struct vm_area_struct *vma);
diff --git a/linux-core/drm_agpsupport.c b/linux-core/drm_agpsupport.c
index 66d1defc..b4b85abd 100644
--- a/linux-core/drm_agpsupport.c
+++ b/linux-core/drm_agpsupport.c
@@ -35,12 +35,8 @@
#if __REALLY_HAVE_AGP
-#if LINUX_VERSION_CODE < 0x020400
-#include "agpsupport-pre24.h"
-#else
#define DRM_AGP_GET (drm_agp_t *)inter_module_get("drm_agp")
#define DRM_AGP_PUT inter_module_put("drm_agp")
-#endif
static const drm_agp_t *drm_agp = NULL;
@@ -271,22 +267,18 @@ drm_agp_head_t *DRM(agp_init)(void)
case INTEL_GX: head->chipset = "Intel 440GX"; break;
case INTEL_I810: head->chipset = "Intel i810"; break;
-#if LINUX_VERSION_CODE >= 0x020400
case INTEL_I815: head->chipset = "Intel i815"; break;
case INTEL_I840: head->chipset = "Intel i840"; break;
case INTEL_I850: head->chipset = "Intel i850"; break;
-#endif
case VIA_GENERIC: head->chipset = "VIA"; break;
case VIA_VP3: head->chipset = "VIA VP3"; break;
case VIA_MVP3: head->chipset = "VIA MVP3"; break;
-#if LINUX_VERSION_CODE >= 0x020400
case VIA_MVP4: head->chipset = "VIA MVP4"; break;
case VIA_APOLLO_KX133: head->chipset = "VIA Apollo KX133";
break;
case VIA_APOLLO_KT133: head->chipset = "VIA Apollo KT133";
break;
-#endif
case VIA_APOLLO_PRO: head->chipset = "VIA Apollo Pro";
break;
diff --git a/linux-core/drm_bufs.c b/linux-core/drm_bufs.c
index ec5dd543..3ff3527f 100644
--- a/linux-core/drm_bufs.c
+++ b/linux-core/drm_bufs.c
@@ -229,11 +229,7 @@ int DRM(rmmap)(struct inode *inode, struct file *filp,
DRM(free)(list, sizeof(*list), DRM_MEM_MAPS);
for (pt = dev->vmalist, prev = NULL; pt; prev = pt, pt = pt->next) {
-#if LINUX_VERSION_CODE >= 0x020300
if (pt->vma->vm_private_data == map) found_maps++;
-#else
- if (pt->vma->vm_pte == map) found_maps++;
-#endif
}
if(!found_maps) {
diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c
index e1aff06d..43186632 100644
--- a/linux-core/drm_drv.c
+++ b/linux-core/drm_drv.c
@@ -113,7 +113,6 @@
#define DRIVER_IOCTLS
#endif
#ifndef DRIVER_FOPS
-#if LINUX_VERSION_CODE >= 0x020400
#define DRIVER_FOPS \
static struct file_operations DRM(fops) = { \
owner: THIS_MODULE, \
@@ -126,19 +125,6 @@ static struct file_operations DRM(fops) = { \
fasync: DRM(fasync), \
poll: DRM(poll), \
}
-#else
-#define DRIVER_FOPS \
-static struct file_operations DRM(fops) = { \
- open: DRM(open), \
- flush: DRM(flush), \
- release: DRM(release), \
- ioctl: DRM(ioctl), \
- mmap: DRM(mmap), \
- read: DRM(read), \
- fasync: DRM(fasync), \
- poll: DRM(poll), \
-}
-#endif
#endif
@@ -731,9 +717,6 @@ int DRM(open)( struct inode *inode, struct file *filp )
retcode = DRM(open_helper)( inode, filp, dev );
if ( !retcode ) {
-#if LINUX_VERSION_CODE < 0x020333
- MOD_INC_USE_COUNT; /* Needed before Linux 2.3.51 */
-#endif
atomic_inc( &dev->counts[_DRM_STAT_OPENS] );
spin_lock( &dev->count_lock );
if ( !dev->open_count++ ) {
@@ -852,9 +835,6 @@ int DRM(release)( struct inode *inode, struct file *filp )
* End inline drm_release
*/
-#if LINUX_VERSION_CODE < 0x020333
- MOD_DEC_USE_COUNT; /* Needed before Linux 2.3.51 */
-#endif
atomic_inc( &dev->counts[_DRM_STAT_CLOSES] );
spin_lock( &dev->count_lock );
if ( !--dev->open_count ) {
diff --git a/linux-core/drm_fops.c b/linux-core/drm_fops.c
index 3656c5e9..d8e9112f 100644
--- a/linux-core/drm_fops.c
+++ b/linux-core/drm_fops.c
@@ -191,24 +191,8 @@ int DRM(write_string)(drm_device_t *dev, const char *s)
send -= count;
}
-#if LINUX_VERSION_CODE < 0x020315 && !defined(KILLFASYNCHASTHREEPARAMETERS)
- /* The extra parameter to kill_fasync was added in 2.3.21, and is
- _not_ present in _stock_ 2.2.14 and 2.2.15. However, some
- distributions patch 2.2.x kernels to add this parameter. The
- Makefile.linux attempts to detect this addition and defines
- KILLFASYNCHASTHREEPARAMETERS if three parameters are found. */
- if (dev->buf_async) kill_fasync(dev->buf_async, SIGIO);
-#else
-
- /* Parameter added in 2.3.21. */
-#if LINUX_VERSION_CODE < 0x020400
- if (dev->buf_async) kill_fasync(dev->buf_async, SIGIO, POLL_IN);
-#else
- /* Type of first parameter changed in
- Linux 2.4.0-test2... */
if (dev->buf_async) kill_fasync(&dev->buf_async, SIGIO, POLL_IN);
-#endif
-#endif
+
DRM_DEBUG("waking\n");
wake_up_interruptible(&dev->buf_readers);
return 0;
diff --git a/linux-core/drm_memory.h b/linux-core/drm_memory.h
index 498937d4..f11b80c3 100644
--- a/linux-core/drm_memory.h
+++ b/linux-core/drm_memory.h
@@ -85,12 +85,7 @@ void DRM(mem_init)(void)
}
si_meminfo(&si);
-#if LINUX_VERSION_CODE < 0x020317
- /* Changed to page count in 2.3.23 */
- DRM(ram_available) = si.totalram >> PAGE_SHIFT;
-#else
DRM(ram_available) = si.totalram;
-#endif
DRM(ram_used) = 0;
}
@@ -257,12 +252,7 @@ unsigned long DRM(alloc_pages)(int order, int area)
for (addr = address, sz = bytes;
sz > 0;
addr += PAGE_SIZE, sz -= PAGE_SIZE) {
-#if LINUX_VERSION_CODE >= 0x020400
- /* Argument type changed in 2.4.0-test6/pre8 */
mem_map_reserve(virt_to_page(addr));
-#else
- mem_map_reserve(MAP_NR(addr));
-#endif
}
return address;
@@ -283,12 +273,7 @@ void DRM(free_pages)(unsigned long address, int order, int area)
for (addr = address, sz = bytes;
sz > 0;
addr += PAGE_SIZE, sz -= PAGE_SIZE) {
-#if LINUX_VERSION_CODE >= 0x020400
- /* Argument type changed in 2.4.0-test6/pre8 */
mem_map_unreserve(virt_to_page(addr));
-#else
- mem_map_unreserve(MAP_NR(addr));
-#endif
}
free_pages(address, order);
}
diff --git a/linux-core/drm_scatter.c b/linux-core/drm_scatter.c
index 66d34968..f0074450 100644
--- a/linux-core/drm_scatter.c
+++ b/linux-core/drm_scatter.c
@@ -47,7 +47,7 @@ void DRM(sg_cleanup)( drm_sg_mem_t *entry )
vfree( entry->virtual );
-#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400)
+#if defined(__alpha__)
DRM(free)( entry->busaddr,
entry->pages * sizeof(*entry->busaddr),
DRM_MEM_PAGES );
@@ -99,7 +99,7 @@ int DRM(sg_alloc)( struct inode *inode, struct file *filp,
return -ENOMEM;
}
-#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400)
+#if defined(__alpha__)
entry->busaddr = DRM(alloc)( pages * sizeof(*entry->busaddr),
DRM_MEM_PAGES );
if ( !entry->busaddr ) {
@@ -116,7 +116,7 @@ int DRM(sg_alloc)( struct inode *inode, struct file *filp,
entry->virtual = vmalloc_32( pages << PAGE_SHIFT );
if ( !entry->virtual ) {
-#if defined(__alpha__) && (LINUX_VERSION_CODE >= 0x020400)
+#if defined(__alpha__)
DRM(free)( entry->busaddr,
entry->pages * sizeof(*entry->busaddr),
DRM_MEM_PAGES );
diff --git a/linux-core/drm_stub.c b/linux-core/drm_stub.c
index fe8a1bc9..ead5b959 100644
--- a/linux-core/drm_stub.c
+++ b/linux-core/drm_stub.c
@@ -31,10 +31,6 @@
#define __NO_VERSION__
#include "drmP.h"
-#if LINUX_VERSION_CODE < 0x020400
-#include "stubsupport-pre24.h"
-#endif
-
#define DRM_STUB_MAXCARDS 16 /* Enough for one machine */
static struct drm_stub_list {
@@ -70,9 +66,7 @@ static int DRM(stub_open)(struct inode *inode, struct file *filp)
}
static struct file_operations DRM(stub_fops) = {
-#if LINUX_VERSION_CODE >= 0x020400
owner: THIS_MODULE,
-#endif
open: DRM(stub_open)
};
diff --git a/linux-core/drm_vm.c b/linux-core/drm_vm.c
index d9ee0ff4..43ef500a 100644
--- a/linux-core/drm_vm.c
+++ b/linux-core/drm_vm.c
@@ -56,16 +56,9 @@ struct vm_operations_struct DRM(vm_sg_ops) = {
close: DRM(vm_close),
};
-#if LINUX_VERSION_CODE < 0x020317
-unsigned long DRM(vm_nopage)(struct vm_area_struct *vma,
- unsigned long address,
- int write_access)
-#else
- /* Return type changed in 2.3.23 */
struct page *DRM(vm_nopage)(struct vm_area_struct *vma,
unsigned long address,
int write_access)
-#endif
{
#if defined(__alpha__) && __REALLY_HAVE_AGP
drm_file_t *priv = vma->vm_file->private_data;
@@ -122,32 +115,17 @@ struct page *DRM(vm_nopage)(struct vm_area_struct *vma,
baddr, __va(agpmem->memory->memory[offset]), offset);
#endif
get_page(page);
-#if LINUX_VERSION_CODE < 0x020317
- return page_address(page);
-#else
return page;
-#endif
}
#endif
return NOPAGE_SIGBUS; /* Disallow mremap */
}
-#if LINUX_VERSION_CODE < 0x020317
-unsigned long DRM(vm_shm_nopage)(struct vm_area_struct *vma,
- unsigned long address,
- int write_access)
-#else
- /* Return type changed in 2.3.23 */
struct page *DRM(vm_shm_nopage)(struct vm_area_struct *vma,
unsigned long address,
int write_access)
-#endif
{
-#if LINUX_VERSION_CODE >= 0x020300
drm_map_t *map = (drm_map_t *)vma->vm_private_data;
-#else
- drm_map_t *map = (drm_map_t *)vma->vm_pte;
-#endif
unsigned long offset;
unsigned long i;
pgd_t *pgd;
@@ -174,11 +152,7 @@ struct page *DRM(vm_shm_nopage)(struct vm_area_struct *vma,
get_page(page);
DRM_DEBUG("0x%08lx => 0x%08x\n", address, page_to_bus(page));
-#if LINUX_VERSION_CODE < 0x020317
- return page_address(page);
-#else
return page;
-#endif
}
/* Special close routine which deletes map information if we are the last
@@ -197,25 +171,14 @@ void DRM(vm_shm_close)(struct vm_area_struct *vma)
DRM_DEBUG("0x%08lx,0x%08lx\n",
vma->vm_start, vma->vm_end - vma->vm_start);
-#if LINUX_VERSION_CODE < 0x020333
- MOD_DEC_USE_COUNT; /* Needed before Linux 2.3.51 */
-#endif
atomic_dec(&dev->vma_count);
-#if LINUX_VERSION_CODE >= 0x020300
map = vma->vm_private_data;
-#else
- map = vma->vm_pte;
-#endif
down(&dev->struct_sem);
for (pt = dev->vmalist, prev = NULL; pt; pt = next) {
next = pt->next;
-#if LINUX_VERSION_CODE >= 0x020300
if (pt->vma->vm_private_data == map) found_maps++;
-#else
- if (pt->vma->vm_pte == map) found_maps++;
-#endif
if (pt->vma == vma) {
if (prev) {
prev->next = pt->next;
@@ -268,16 +231,9 @@ void DRM(vm_shm_close)(struct vm_area_struct *vma)
up(&dev->struct_sem);
}
-#if LINUX_VERSION_CODE < 0x020317
-unsigned long DRM(vm_dma_nopage)(struct vm_area_struct *vma,
- unsigned long address,
- int write_access)
-#else
- /* Return type changed in 2.3.23 */
struct page *DRM(vm_dma_nopage)(struct vm_area_struct *vma,
unsigned long address,
int write_access)
-#endif
{
drm_file_t *priv = vma->vm_file->private_data;
drm_device_t *dev = priv->dev;
@@ -299,29 +255,14 @@ struct page *DRM(vm_dma_nopage)(struct vm_area_struct *vma,
DRM_DEBUG("0x%08lx (page %lu) => 0x%08x\n", address, page_nr,
page_to_bus(page));
-#if LINUX_VERSION_CODE < 0x020317
- return page_address(page);
-#else
return page;
-#endif
}
-#if LINUX_VERSION_CODE < 0x020317
-unsigned long DRM(vm_sg_nopage)(struct vm_area_struct *vma,
- unsigned long address,
- int write_access)
-#else
- /* Return type changed in 2.3.23 */
struct page *DRM(vm_sg_nopage)(struct vm_area_struct *vma,
unsigned long address,
int write_access)
-#endif
{
-#if LINUX_VERSION_CODE >= 0x020300
drm_map_t *map = (drm_map_t *)vma->vm_private_data;
-#else
- drm_map_t *map = (drm_map_t *)vma->vm_pte;
-#endif
drm_file_t *priv = vma->vm_file->private_data;
drm_device_t *dev = priv->dev;
drm_sg_mem_t *entry = dev->sg;
@@ -341,11 +282,7 @@ struct page *DRM(vm_sg_nopage)(struct vm_area_struct *vma,
page = entry->pagelist[page_offset];
get_page(page);
-#if LINUX_VERSION_CODE < 0x020317
- return page_address(page);
-#else
return page;
-#endif
}
void DRM(vm_open)(struct vm_area_struct *vma)
@@ -357,10 +294,6 @@ void DRM(vm_open)(struct vm_area_struct *vma)
DRM_DEBUG("0x%08lx,0x%08lx\n",
vma->vm_start, vma->vm_end - vma->vm_start);
atomic_inc(&dev->vma_count);
-#if LINUX_VERSION_CODE < 0x020333
- /* The map can exist after the fd is closed. */
- MOD_INC_USE_COUNT; /* Needed before Linux 2.3.51 */
-#endif
vma_entry = DRM(alloc)(sizeof(*vma_entry), DRM_MEM_VMAS);
if (vma_entry) {
@@ -381,9 +314,6 @@ void DRM(vm_close)(struct vm_area_struct *vma)
DRM_DEBUG("0x%08lx,0x%08lx\n",
vma->vm_start, vma->vm_end - vma->vm_start);
-#if LINUX_VERSION_CODE < 0x020333
- MOD_DEC_USE_COUNT; /* Needed before Linux 2.3.51 */
-#endif
atomic_dec(&dev->vma_count);
down(&dev->struct_sem);
@@ -424,11 +354,6 @@ int DRM(mmap_dma)(struct file *filp, struct vm_area_struct *vma)
vma->vm_ops = &DRM(vm_dma_ops);
vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */
-#if LINUX_VERSION_CODE < 0x020203 /* KERNEL_VERSION(2,2,3) */
- /* In Linux 2.2.3 and above, this is
- handled in do_mmap() in mm/mmap.c. */
- ++filp->f_count;
-#endif
vma->vm_file = filp; /* Needed for drm_vm_open() */
DRM(vm_open)(vma);
return 0;
@@ -543,22 +468,14 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
break;
case _DRM_SHM:
vma->vm_ops = &DRM(vm_shm_ops);
-#if LINUX_VERSION_CODE >= 0x020300
vma->vm_private_data = (void *)map;
-#else
- vma->vm_pte = (unsigned long)map;
-#endif
/* Don't let this area swap. Change when
DRM_KERNEL advisory is supported. */
vma->vm_flags |= VM_LOCKED;
break;
case _DRM_SCATTER_GATHER:
vma->vm_ops = &DRM(vm_sg_ops);
-#if LINUX_VERSION_CODE >= 0x020300
vma->vm_private_data = (void *)map;
-#else
- vma->vm_pte = (unsigned long)map;
-#endif
vma->vm_flags |= VM_LOCKED;
break;
default:
@@ -566,11 +483,6 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
}
vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */
-#if LINUX_VERSION_CODE < 0x020203 /* KERNEL_VERSION(2,2,3) */
- /* In Linux 2.2.3 and above, this is
- handled in do_mmap() in mm/mmap.c. */
- ++filp->f_count;
-#endif
vma->vm_file = filp; /* Needed for drm_vm_open() */
DRM(vm_open)(vma);
return 0;
diff --git a/linux-core/i810_dma.c b/linux-core/i810_dma.c
index d6933d57..e9b0e807 100644
--- a/linux-core/i810_dma.c
+++ b/linux-core/i810_dma.c
@@ -227,14 +227,9 @@ static int i810_unmap_buffer(drm_buf_t *buf)
#else
down_write( &current->mm->mmap_sem );
#endif
-#if LINUX_VERSION_CODE < 0x020399
- retcode = do_munmap((unsigned long)buf_priv->virtual,
- (size_t) buf->total);
-#else
retcode = do_munmap(current->mm,
(unsigned long)buf_priv->virtual,
(size_t) buf->total);
-#endif
#if LINUX_VERSION_CODE <= 0x020402
up( &current->mm->mmap_sem );
#else