drm: remove all 2.4 support for drm development tree.

Bye bye 2.4 you served us well..
main
Dave Airlie 2006-12-19 20:29:03 +11:00
parent 656c3a3737
commit 86ff2aeb9b
9 changed files with 8 additions and 217 deletions

View File

@ -241,11 +241,11 @@ else
# Check for kernel versions that we don't support. # Check for kernel versions that we don't support.
BELOW24 := $(shell if [ $(VERSION) -lt 2 -o $(PATCHLEVEL) -lt 4 ]; then \ BELOW26 := $(shell if [ $(VERSION) -lt 2 -o $(PATCHLEVEL) -lt 6 ]; then \
echo y; fi) echo y; fi)
ifeq ($(BELOW24),y) ifeq ($(BELOW26),y)
$(error Only 2.4.x and later kernels are supported \ $(error Only 2.6.x and later kernels are supported \
($(VERSION).$(PATCHLEVEL).$(SUBLEVEL))) ($(VERSION).$(PATCHLEVEL).$(SUBLEVEL)))
endif endif
@ -258,30 +258,6 @@ endif
# This needs to go before all other include paths. # This needs to go before all other include paths.
CC += -I$(DRMSRCDIR) CC += -I$(DRMSRCDIR)
# Check for Red Hat's 4-argument do_munmap().
DOMUNMAP := $(shell grep do_munmap $(LINUXDIR)/include/linux/mm.h | \
grep -c acct)
ifneq ($(DOMUNMAP),0)
EXTRA_CFLAGS += -DDO_MUNMAP_4_ARGS
endif
# Check for 5-argument remap_page_range() in RH9 kernel, and 2.5.x kernels
RPR := $(shell grep remap_page_range $(LINUXDIR)/include/linux/mm.h | \
grep -c vma)
ifneq ($(RPR),0)
EXTRA_CFLAGS += -DREMAP_PAGE_RANGE_5_ARGS
endif
# Check for 4-argument vmap() in some 2.5.x and 2.4.x kernels
VMAP := $(shell grep -A1 'vmap.*count,$$' $(LINUXDIR)/include/linux/vmalloc.h | \
grep -c prot)
ifneq ($(VMAP),0)
EXTRA_CFLAGS += -DVMAP_4_ARGS
endif
# Check for PAGE_AGP definition # Check for PAGE_AGP definition
PAGE_AGP := $(shell cat $(LINUXDIR)/include/asm/agp.h 2>/dev/null | \ PAGE_AGP := $(shell cat $(LINUXDIR)/include/asm/agp.h 2>/dev/null | \
grep -c PAGE_AGP) grep -c PAGE_AGP)
@ -290,7 +266,6 @@ ifneq ($(PAGE_AGP),0)
EXTRA_CFLAGS += -DHAVE_PAGE_AGP EXTRA_CFLAGS += -DHAVE_PAGE_AGP
endif endif
# Start with all modules turned off. # Start with all modules turned off.
CONFIG_DRM_GAMMA := n CONFIG_DRM_GAMMA := n
CONFIG_DRM_TDFX := n CONFIG_DRM_TDFX := n

View File

@ -70,16 +70,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/agp_backend.h> #include <linux/agp_backend.h>
#endif #endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,41)
#define HAS_WORKQUEUE 0
#else
#define HAS_WORKQUEUE 1
#endif
#if !HAS_WORKQUEUE
#include <linux/tqueue.h>
#else
#include <linux/workqueue.h> #include <linux/workqueue.h>
#endif
#include <linux/poll.h> #include <linux/poll.h>
#include <asm/pgalloc.h> #include <asm/pgalloc.h>
#include "drm.h" #include "drm.h"
@ -897,11 +888,8 @@ typedef struct drm_device {
unsigned long last_switch; /**< jiffies at last context switch */ unsigned long last_switch; /**< jiffies at last context switch */
/*@} */ /*@} */
#if !HAS_WORKQUEUE
struct tq_struct tq;
#else
struct work_struct work; struct work_struct work;
#endif
/** \name VBLANK IRQ support */ /** \name VBLANK IRQ support */
/*@{ */ /*@{ */
@ -929,11 +917,7 @@ typedef struct drm_device {
int pci_vendor; /**< PCI vendor id */ int pci_vendor; /**< PCI vendor id */
int pci_device; /**< PCI device id */ int pci_device; /**< PCI device id */
#ifdef __alpha__ #ifdef __alpha__
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,3)
struct pci_controler *hose;
#else
struct pci_controller *hose; struct pci_controller *hose;
#endif
#endif #endif
drm_sg_mem_t *sg; /**< Scatter gather memory */ drm_sg_mem_t *sg; /**< Scatter gather memory */
unsigned long *ctx_bitmap; /**< context bitmap */ unsigned long *ctx_bitmap; /**< context bitmap */

View File

@ -106,10 +106,6 @@ int drm_agp_acquire(drm_device_t * dev)
return -ENODEV; return -ENODEV;
if (dev->agp->acquired) if (dev->agp->acquired)
return -EBUSY; return -EBUSY;
#ifndef VMAP_4_ARGS
if (dev->agp->cant_use_aperture)
return -EINVAL;
#endif
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11) #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11)
if ((retcode = agp_backend_acquire())) if ((retcode = agp_backend_acquire()))
return retcode; return retcode;

View File

@ -86,92 +86,12 @@
pos = n, n = list_entry(n->member.next, typeof(*n), member)) pos = n, n = list_entry(n->member.next, typeof(*n), member))
#endif #endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,19)
static inline struct page *vmalloc_to_page(void *vmalloc_addr)
{
unsigned long addr = (unsigned long)vmalloc_addr;
struct page *page = NULL;
pgd_t *pgd = pgd_offset_k(addr);
pmd_t *pmd;
pte_t *ptep, pte;
if (!pgd_none(*pgd)) {
pmd = pmd_offset(pgd, addr);
if (!pmd_none(*pmd)) {
preempt_disable();
ptep = pte_offset_map(pmd, addr);
pte = *ptep;
if (pte_present(pte))
page = pte_page(pte);
pte_unmap(ptep);
preempt_enable();
}
}
return page;
}
#endif
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,2)
#define down_write down
#define up_write up
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
#define DRM_PCI_DEV(pdev) &pdev->dev #define DRM_PCI_DEV(pdev) &pdev->dev
#else #else
#define DRM_PCI_DEV(pdev) NULL #define DRM_PCI_DEV(pdev) NULL
#endif #endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
static inline unsigned iminor(struct inode *inode)
{
return MINOR(inode->i_rdev);
}
#define old_encode_dev(x) (x)
struct drm_sysfs_class;
struct class_simple;
struct device;
#define pci_dev_put(x) do {} while (0)
#define pci_get_subsys pci_find_subsys
static inline struct class_device *DRM(sysfs_device_add) (struct drm_sysfs_class
* cs, dev_t dev,
struct device *
device,
const char *fmt,
...) {
return NULL;
}
static inline void DRM(sysfs_device_remove) (dev_t dev) {
}
static inline void DRM(sysfs_destroy) (struct drm_sysfs_class * cs) {
}
static inline struct drm_sysfs_class *DRM(sysfs_create) (struct module * owner,
char *name) {
return NULL;
}
#ifndef pci_pretty_name
#define pci_pretty_name(x) x->name
#endif
struct drm_device;
static inline int radeon_create_i2c_busses(struct drm_device *dev)
{
return 0;
};
static inline void radeon_delete_i2c_busses(struct drm_device *dev)
{
};
#endif
#ifndef __user #ifndef __user
#define __user #define __user
#endif #endif
@ -184,18 +104,12 @@ static inline void radeon_delete_i2c_busses(struct drm_device *dev)
#define __GFP_COMP 0 #define __GFP_COMP 0
#endif #endif
#ifndef REMAP_PAGE_RANGE_5_ARGS
#define DRM_RPR_ARG(vma)
#else
#define DRM_RPR_ARG(vma) vma,
#endif
#define VM_OFFSET(vma) ((vma)->vm_pgoff << PAGE_SHIFT) #define VM_OFFSET(vma) ((vma)->vm_pgoff << PAGE_SHIFT)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
static inline int remap_pfn_range(struct vm_area_struct *vma, unsigned long from, unsigned long pfn, unsigned long size, pgprot_t pgprot) static inline int remap_pfn_range(struct vm_area_struct *vma, unsigned long from, unsigned long pfn, unsigned long size, pgprot_t pgprot)
{ {
return remap_page_range(DRM_RPR_ARG(vma) from, return remap_page_range(vma, from,
pfn << PAGE_SHIFT, pfn << PAGE_SHIFT,
size, size,
pgprot); pgprot);
@ -221,10 +135,6 @@ static inline int remap_pfn_range(struct vm_area_struct *vma, unsigned long from
#define __x86_64__ #define __x86_64__
#endif #endif
#ifndef pci_pretty_name
#define pci_pretty_name(dev) ""
#endif
/* sysfs __ATTR macro */ /* sysfs __ATTR macro */
#ifndef __ATTR #ifndef __ATTR
#define __ATTR(_name,_mode,_show,_store) { \ #define __ATTR(_name,_mode,_show,_store) { \

View File

@ -43,7 +43,7 @@
*/ */
/* Need the 4-argument version of vmap(). */ /* Need the 4-argument version of vmap(). */
#if __OS_HAS_AGP && defined(VMAP_4_ARGS) #if __OS_HAS_AGP
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
@ -57,18 +57,6 @@
# endif # endif
#endif #endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
#ifndef pte_offset_kernel
# define pte_offset_kernel(dir, address) pte_offset(dir, address)
#endif
#ifndef pte_pfn
# define pte_pfn(pte) (pte_page(pte) - mem_map)
#endif
#ifndef pfn_to_page
# define pfn_to_page(pfn) (mem_map + (pfn))
#endif
#endif
/* /*
* Find the drm_map that covers the range [offset, offset+size). * Find the drm_map that covers the range [offset, offset+size).
*/ */
@ -171,14 +159,12 @@ static inline unsigned long drm_follow_page(void *vaddr)
static inline void *drm_ioremap(unsigned long offset, unsigned long size, static inline void *drm_ioremap(unsigned long offset, unsigned long size,
drm_device_t * dev) drm_device_t * dev)
{ {
#if defined(VMAP_4_ARGS)
if (drm_core_has_AGP(dev) && dev->agp && dev->agp->cant_use_aperture) { if (drm_core_has_AGP(dev) && dev->agp && dev->agp->cant_use_aperture) {
drm_map_t *map = drm_lookup_map(offset, size, dev); drm_map_t *map = drm_lookup_map(offset, size, dev);
if (map && map->type == _DRM_AGP) if (map && map->type == _DRM_AGP)
return agp_remap(offset, size, dev); return agp_remap(offset, size, dev);
} }
#endif
return ioremap(offset, size); return ioremap(offset, size);
} }
@ -186,14 +172,12 @@ static inline void *drm_ioremap(unsigned long offset, unsigned long size,
static inline void *drm_ioremap_nocache(unsigned long offset, static inline void *drm_ioremap_nocache(unsigned long offset,
unsigned long size, drm_device_t * dev) unsigned long size, drm_device_t * dev)
{ {
#if defined(VMAP_4_ARGS)
if (drm_core_has_AGP(dev) && dev->agp && dev->agp->cant_use_aperture) { if (drm_core_has_AGP(dev) && dev->agp && dev->agp->cant_use_aperture) {
drm_map_t *map = drm_lookup_map(offset, size, dev); drm_map_t *map = drm_lookup_map(offset, size, dev);
if (map && map->type == _DRM_AGP) if (map && map->type == _DRM_AGP)
return agp_remap(offset, size, dev); return agp_remap(offset, size, dev);
} }
#endif
return ioremap_nocache(offset, size); return ioremap_nocache(offset, size);
} }
@ -201,7 +185,6 @@ static inline void *drm_ioremap_nocache(unsigned long offset,
static inline void drm_ioremapfree(void *pt, unsigned long size, static inline void drm_ioremapfree(void *pt, unsigned long size,
drm_device_t * dev) drm_device_t * dev)
{ {
#if defined(VMAP_4_ARGS)
/* /*
* This is a bit ugly. It would be much cleaner if the DRM API would use separate * This is a bit ugly. It would be much cleaner if the DRM API would use separate
* routines for handling mappings in the AGP space. Hopefully this can be done in * routines for handling mappings in the AGP space. Hopefully this can be done in
@ -220,7 +203,6 @@ static inline void drm_ioremapfree(void *pt, unsigned long size,
return; return;
} }
} }
#endif
iounmap(pt); iounmap(pt);
} }
#else #else

View File

@ -66,13 +66,8 @@ typedef void irqreturn_t;
/** AGP types */ /** AGP types */
#if __OS_HAS_AGP #if __OS_HAS_AGP
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,70)
#define DRM_AGP_MEM agp_memory
#define DRM_AGP_KERN agp_kern_info
#else
#define DRM_AGP_MEM struct agp_memory #define DRM_AGP_MEM struct agp_memory
#define DRM_AGP_KERN struct agp_kern_info #define DRM_AGP_KERN struct agp_kern_info
#endif
#else #else
/* define some dummy types for non AGP supporting kernels */ /* define some dummy types for non AGP supporting kernels */
struct no_agp_kern { struct no_agp_kern {

View File

@ -244,9 +244,9 @@ int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
if ((ret = drm_get_head(dev, &dev->primary))) if ((ret = drm_get_head(dev, &dev->primary)))
goto err_g1; goto err_g1;
DRM_INFO("Initialized %s %d.%d.%d %s on minor %d: %s\n", DRM_INFO("Initialized %s %d.%d.%d %s on minor %d\n",
driver->name, driver->major, driver->minor, driver->patchlevel, driver->name, driver->major, driver->minor, driver->patchlevel,
driver->date, dev->primary.minor, pci_pretty_name(dev->pdev)); driver->date, dev->primary.minor);
return 0; return 0;

View File

@ -446,8 +446,6 @@ static __inline__ struct page *drm_do_vm_sg_nopage(struct vm_area_struct *vma,
return page; return page;
} }
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
static struct page *drm_vm_nopage(struct vm_area_struct *vma, static struct page *drm_vm_nopage(struct vm_area_struct *vma,
unsigned long address, int *type) unsigned long address, int *type)
{ {
@ -481,34 +479,6 @@ static struct page *drm_vm_sg_nopage(struct vm_area_struct *vma,
} }
#else /* LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,0) */
static struct page *drm_vm_nopage(struct vm_area_struct *vma,
unsigned long address, int unused)
{
return drm_do_vm_nopage(vma, address);
}
static struct page *drm_vm_shm_nopage(struct vm_area_struct *vma,
unsigned long address, int unused)
{
return drm_do_vm_shm_nopage(vma, address);
}
static struct page *drm_vm_dma_nopage(struct vm_area_struct *vma,
unsigned long address, int unused)
{
return drm_do_vm_dma_nopage(vma, address);
}
static struct page *drm_vm_sg_nopage(struct vm_area_struct *vma,
unsigned long address, int unused)
{
return drm_do_vm_sg_nopage(vma, address);
}
#endif
/** AGP virtual memory operations */ /** AGP virtual memory operations */
static struct vm_operations_struct drm_vm_ops = { static struct vm_operations_struct drm_vm_ops = {
.nopage = drm_vm_nopage, .nopage = drm_vm_nopage,
@ -712,12 +682,7 @@ static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma)
} }
vma->vm_ops = &drm_vm_dma_ops; vma->vm_ops = &drm_vm_dma_ops;
#if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */
vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */
#else
vma->vm_flags |= VM_RESERVED; /* Don't swap */ vma->vm_flags |= VM_RESERVED; /* Don't swap */
#endif
vma->vm_file = filp; /* Needed for drm_vm_open() */ vma->vm_file = filp; /* Needed for drm_vm_open() */
drm_vm_open(vma); drm_vm_open(vma);
@ -860,20 +825,12 @@ int drm_mmap(struct file *filp, struct vm_area_struct *vma)
vma->vm_private_data = (void *)map; vma->vm_private_data = (void *)map;
/* Don't let this area swap. Change when /* Don't let this area swap. Change when
DRM_KERNEL advisory is supported. */ DRM_KERNEL advisory is supported. */
#if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */
vma->vm_flags |= VM_LOCKED;
#else
vma->vm_flags |= VM_RESERVED; vma->vm_flags |= VM_RESERVED;
#endif
break; break;
case _DRM_SCATTER_GATHER: case _DRM_SCATTER_GATHER:
vma->vm_ops = &drm_vm_sg_ops; vma->vm_ops = &drm_vm_sg_ops;
vma->vm_private_data = (void *)map; vma->vm_private_data = (void *)map;
#if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */
vma->vm_flags |= VM_LOCKED;
#else
vma->vm_flags |= VM_RESERVED; vma->vm_flags |= VM_RESERVED;
#endif
break; break;
case _DRM_TTM: { case _DRM_TTM: {
vma->vm_ops = &drm_vm_ttm_ops; vma->vm_ops = &drm_vm_ttm_ops;
@ -892,11 +849,7 @@ int drm_mmap(struct file *filp, struct vm_area_struct *vma)
default: default:
return -EINVAL; /* This should never happen. */ return -EINVAL; /* This should never happen. */
} }
#if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */
vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */
#else
vma->vm_flags |= VM_RESERVED; /* Don't swap */ vma->vm_flags |= VM_RESERVED; /* Don't swap */
#endif
vma->vm_file = filp; /* Needed for drm_vm_open() */ vma->vm_file = filp; /* Needed for drm_vm_open() */
drm_vm_open(vma); drm_vm_open(vma);

View File

@ -36,11 +36,7 @@
#include "sis_drv.h" #include "sis_drv.h"
#if defined(__linux__) #if defined(__linux__)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
#include <video/sisfb.h> #include <video/sisfb.h>
#else
#include <linux/sisfb.h>
#endif
#endif #endif
#define VIDEO_TYPE 0 #define VIDEO_TYPE 0