summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@fairlite.demon.co.uk>2001-12-10 23:29:37 +0000
committerAlan Hourihane <alanh@fairlite.demon.co.uk>2001-12-10 23:29:37 +0000
commitf18a6d836b5e0081dff9217b44e88e74c421c576 (patch)
tree6f104249c42e776ff94465464394c7c0f5f771cf
parent727abee235478a66c90a8cd097f85307e232524a (diff)
-rw-r--r--linux-core/ati_pcigart.c6
-rw-r--r--linux-core/drm_agpsupport.c6
-rw-r--r--linux-core/drm_vm.c19
-rw-r--r--linux/ati_pcigart.h6
-rw-r--r--linux/drm_agpsupport.h6
-rw-r--r--linux/drm_vm.h19
6 files changed, 54 insertions, 8 deletions
diff --git a/linux-core/ati_pcigart.c b/linux-core/ati_pcigart.c
index 8b486c10a..5851b72f6 100644
--- a/linux-core/ati_pcigart.c
+++ b/linux-core/ati_pcigart.c
@@ -36,7 +36,7 @@
#elif PAGE_SIZE == 4096
# define ATI_PCIGART_TABLE_ORDER 3
# define ATI_PCIGART_TABLE_PAGES (1 << 3)
-#elif
+#else
# error - PAGE_SIZE not 8K or 4K
#endif
@@ -57,7 +57,7 @@ static unsigned long DRM(ati_alloc_pcigart_table)( void )
page = virt_to_page( address );
- for ( i = 0 ; i <= ATI_PCIGART_TABLE_PAGES ; i++, page++ ) {
+ for ( i = 0 ; i < ATI_PCIGART_TABLE_PAGES ; i++, page++ ) {
atomic_inc( &page->count );
SetPageReserved( page );
}
@@ -74,7 +74,7 @@ static void DRM(ati_free_pcigart_table)( unsigned long address )
page = virt_to_page( address );
- for ( i = 0 ; i <= ATI_PCIGART_TABLE_PAGES ; i++, page++ ) {
+ for ( i = 0 ; i < ATI_PCIGART_TABLE_PAGES ; i++, page++ ) {
atomic_dec( &page->count );
ClearPageReserved( page );
}
diff --git a/linux-core/drm_agpsupport.c b/linux-core/drm_agpsupport.c
index 28cc5a26e..fc0b29aab 100644
--- a/linux-core/drm_agpsupport.c
+++ b/linux-core/drm_agpsupport.c
@@ -268,7 +268,13 @@ drm_agp_head_t *DRM(agp_init)(void)
case INTEL_I810: head->chipset = "Intel i810"; break;
case INTEL_I815: head->chipset = "Intel i815"; break;
+#if LINUX_VERSION_CODE >= 0x020415
+ case INTEL_I820: head->chipset = "Intel i820"; break;
+#endif
case INTEL_I840: head->chipset = "Intel i840"; break;
+#if LINUX_VERSION_CODE >= 0x020415
+ case INTEL_I845: head->chipset = "Intel i845"; break;
+#endif
case INTEL_I850: head->chipset = "Intel i850"; break;
case VIA_GENERIC: head->chipset = "VIA"; break;
diff --git a/linux-core/drm_vm.c b/linux-core/drm_vm.c
index 30b5b2264..6803a57b0 100644
--- a/linux-core/drm_vm.c
+++ b/linux-core/drm_vm.c
@@ -353,7 +353,12 @@ int DRM(mmap_dma)(struct file *filp, struct vm_area_struct *vma)
unlock_kernel();
vma->vm_ops = &DRM(vm_dma_ops);
+
+#if LINUX_VERSION_CODE <= 0x020414
vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */
+#else
+ vma->vm_flags |= VM_RESERVED; /* Don't swap */
+#endif
vma->vm_file = filp; /* Needed for drm_vm_open() */
DRM(vm_open)(vma);
@@ -479,17 +484,29 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
vma->vm_private_data = (void *)map;
/* Don't let this area swap. Change when
DRM_KERNEL advisory is supported. */
+#if LINUX_VERSION_CODE <= 0x020414
vma->vm_flags |= VM_LOCKED;
+#else
+ vma->vm_flags |= VM_RESERVED;
+#endif
break;
case _DRM_SCATTER_GATHER:
vma->vm_ops = &DRM(vm_sg_ops);
vma->vm_private_data = (void *)map;
- vma->vm_flags |= VM_LOCKED;
+#if LINUX_VERSION_CODE <= 0x020414
+ vma->vm_flags |= VM_LOCKED;
+#else
+ vma->vm_flags |= VM_RESERVED;
+#endif
break;
default:
return -EINVAL; /* This should never happen. */
}
+#if LINUX_VERSION_CODE <= 0x020414
vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */
+#else
+ vma->vm_flags |= VM_RESERVED; /* Don't swap */
+#endif
vma->vm_file = filp; /* Needed for drm_vm_open() */
DRM(vm_open)(vma);
diff --git a/linux/ati_pcigart.h b/linux/ati_pcigart.h
index 8b486c10a..5851b72f6 100644
--- a/linux/ati_pcigart.h
+++ b/linux/ati_pcigart.h
@@ -36,7 +36,7 @@
#elif PAGE_SIZE == 4096
# define ATI_PCIGART_TABLE_ORDER 3
# define ATI_PCIGART_TABLE_PAGES (1 << 3)
-#elif
+#else
# error - PAGE_SIZE not 8K or 4K
#endif
@@ -57,7 +57,7 @@ static unsigned long DRM(ati_alloc_pcigart_table)( void )
page = virt_to_page( address );
- for ( i = 0 ; i <= ATI_PCIGART_TABLE_PAGES ; i++, page++ ) {
+ for ( i = 0 ; i < ATI_PCIGART_TABLE_PAGES ; i++, page++ ) {
atomic_inc( &page->count );
SetPageReserved( page );
}
@@ -74,7 +74,7 @@ static void DRM(ati_free_pcigart_table)( unsigned long address )
page = virt_to_page( address );
- for ( i = 0 ; i <= ATI_PCIGART_TABLE_PAGES ; i++, page++ ) {
+ for ( i = 0 ; i < ATI_PCIGART_TABLE_PAGES ; i++, page++ ) {
atomic_dec( &page->count );
ClearPageReserved( page );
}
diff --git a/linux/drm_agpsupport.h b/linux/drm_agpsupport.h
index 28cc5a26e..fc0b29aab 100644
--- a/linux/drm_agpsupport.h
+++ b/linux/drm_agpsupport.h
@@ -268,7 +268,13 @@ drm_agp_head_t *DRM(agp_init)(void)
case INTEL_I810: head->chipset = "Intel i810"; break;
case INTEL_I815: head->chipset = "Intel i815"; break;
+#if LINUX_VERSION_CODE >= 0x020415
+ case INTEL_I820: head->chipset = "Intel i820"; break;
+#endif
case INTEL_I840: head->chipset = "Intel i840"; break;
+#if LINUX_VERSION_CODE >= 0x020415
+ case INTEL_I845: head->chipset = "Intel i845"; break;
+#endif
case INTEL_I850: head->chipset = "Intel i850"; break;
case VIA_GENERIC: head->chipset = "VIA"; break;
diff --git a/linux/drm_vm.h b/linux/drm_vm.h
index 30b5b2264..6803a57b0 100644
--- a/linux/drm_vm.h
+++ b/linux/drm_vm.h
@@ -353,7 +353,12 @@ int DRM(mmap_dma)(struct file *filp, struct vm_area_struct *vma)
unlock_kernel();
vma->vm_ops = &DRM(vm_dma_ops);
+
+#if LINUX_VERSION_CODE <= 0x020414
vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */
+#else
+ vma->vm_flags |= VM_RESERVED; /* Don't swap */
+#endif
vma->vm_file = filp; /* Needed for drm_vm_open() */
DRM(vm_open)(vma);
@@ -479,17 +484,29 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
vma->vm_private_data = (void *)map;
/* Don't let this area swap. Change when
DRM_KERNEL advisory is supported. */
+#if LINUX_VERSION_CODE <= 0x020414
vma->vm_flags |= VM_LOCKED;
+#else
+ vma->vm_flags |= VM_RESERVED;
+#endif
break;
case _DRM_SCATTER_GATHER:
vma->vm_ops = &DRM(vm_sg_ops);
vma->vm_private_data = (void *)map;
- vma->vm_flags |= VM_LOCKED;
+#if LINUX_VERSION_CODE <= 0x020414
+ vma->vm_flags |= VM_LOCKED;
+#else
+ vma->vm_flags |= VM_RESERVED;
+#endif
break;
default:
return -EINVAL; /* This should never happen. */
}
+#if LINUX_VERSION_CODE <= 0x020414
vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */
+#else
+ vma->vm_flags |= VM_RESERVED; /* Don't swap */
+#endif
vma->vm_file = filp; /* Needed for drm_vm_open() */
DRM(vm_open)(vma);