diff options
Diffstat (limited to 'drivers/char/drm/drm_vm.c')
-rw-r--r-- | drivers/char/drm/drm_vm.c | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/drivers/char/drm/drm_vm.c b/drivers/char/drm/drm_vm.c index 99b5c86f7513..292fa7167b26 100644 --- a/drivers/char/drm/drm_vm.c +++ b/drivers/char/drm/drm_vm.c | |||
@@ -314,8 +314,6 @@ static __inline__ struct page *drm_do_vm_sg_nopage(struct vm_area_struct *vma, | |||
314 | } | 314 | } |
315 | 315 | ||
316 | 316 | ||
317 | #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) | ||
318 | |||
319 | static struct page *drm_vm_nopage(struct vm_area_struct *vma, | 317 | static struct page *drm_vm_nopage(struct vm_area_struct *vma, |
320 | unsigned long address, | 318 | unsigned long address, |
321 | int *type) { | 319 | int *type) { |
@@ -344,35 +342,6 @@ static struct page *drm_vm_sg_nopage(struct vm_area_struct *vma, | |||
344 | return drm_do_vm_sg_nopage(vma, address); | 342 | return drm_do_vm_sg_nopage(vma, address); |
345 | } | 343 | } |
346 | 344 | ||
347 | #else /* LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,0) */ | ||
348 | |||
349 | static struct page *drm_vm_nopage(struct vm_area_struct *vma, | ||
350 | unsigned long address, | ||
351 | int unused) { | ||
352 | return drm_do_vm_nopage(vma, address); | ||
353 | } | ||
354 | |||
355 | static struct page *drm_vm_shm_nopage(struct vm_area_struct *vma, | ||
356 | unsigned long address, | ||
357 | int unused) { | ||
358 | return drm_do_vm_shm_nopage(vma, address); | ||
359 | } | ||
360 | |||
361 | static struct page *drm_vm_dma_nopage(struct vm_area_struct *vma, | ||
362 | unsigned long address, | ||
363 | int unused) { | ||
364 | return drm_do_vm_dma_nopage(vma, address); | ||
365 | } | ||
366 | |||
367 | static struct page *drm_vm_sg_nopage(struct vm_area_struct *vma, | ||
368 | unsigned long address, | ||
369 | int unused) { | ||
370 | return drm_do_vm_sg_nopage(vma, address); | ||
371 | } | ||
372 | |||
373 | #endif | ||
374 | |||
375 | |||
376 | /** AGP virtual memory operations */ | 345 | /** AGP virtual memory operations */ |
377 | static struct vm_operations_struct drm_vm_ops = { | 346 | static struct vm_operations_struct drm_vm_ops = { |
378 | .nopage = drm_vm_nopage, | 347 | .nopage = drm_vm_nopage, |
@@ -496,11 +465,7 @@ static int drm_mmap_dma(struct file *filp, struct vm_area_struct *vma) | |||
496 | 465 | ||
497 | vma->vm_ops = &drm_vm_dma_ops; | 466 | vma->vm_ops = &drm_vm_dma_ops; |
498 | 467 | ||
499 | #if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */ | ||
500 | vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */ | ||
501 | #else | ||
502 | vma->vm_flags |= VM_RESERVED; /* Don't swap */ | 468 | vma->vm_flags |= VM_RESERVED; /* Don't swap */ |
503 | #endif | ||
504 | 469 | ||
505 | vma->vm_file = filp; /* Needed for drm_vm_open() */ | 470 | vma->vm_file = filp; /* Needed for drm_vm_open() */ |
506 | drm_vm_open(vma); | 471 | drm_vm_open(vma); |
@@ -660,29 +625,17 @@ int drm_mmap(struct file *filp, struct vm_area_struct *vma) | |||
660 | vma->vm_private_data = (void *)map; | 625 | vma->vm_private_data = (void *)map; |
661 | /* Don't let this area swap. Change when | 626 | /* Don't let this area swap. Change when |
662 | DRM_KERNEL advisory is supported. */ | 627 | DRM_KERNEL advisory is supported. */ |
663 | #if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */ | ||
664 | vma->vm_flags |= VM_LOCKED; | ||
665 | #else | ||
666 | vma->vm_flags |= VM_RESERVED; | 628 | vma->vm_flags |= VM_RESERVED; |
667 | #endif | ||
668 | break; | 629 | break; |
669 | case _DRM_SCATTER_GATHER: | 630 | case _DRM_SCATTER_GATHER: |
670 | vma->vm_ops = &drm_vm_sg_ops; | 631 | vma->vm_ops = &drm_vm_sg_ops; |
671 | vma->vm_private_data = (void *)map; | 632 | vma->vm_private_data = (void *)map; |
672 | #if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */ | ||
673 | vma->vm_flags |= VM_LOCKED; | ||
674 | #else | ||
675 | vma->vm_flags |= VM_RESERVED; | 633 | vma->vm_flags |= VM_RESERVED; |
676 | #endif | ||
677 | break; | 634 | break; |
678 | default: | 635 | default: |
679 | return -EINVAL; /* This should never happen. */ | 636 | return -EINVAL; /* This should never happen. */ |
680 | } | 637 | } |
681 | #if LINUX_VERSION_CODE <= 0x02040e /* KERNEL_VERSION(2,4,14) */ | ||
682 | vma->vm_flags |= VM_LOCKED | VM_SHM; /* Don't swap */ | ||
683 | #else | ||
684 | vma->vm_flags |= VM_RESERVED; /* Don't swap */ | 638 | vma->vm_flags |= VM_RESERVED; /* Don't swap */ |
685 | #endif | ||
686 | 639 | ||
687 | vma->vm_file = filp; /* Needed for drm_vm_open() */ | 640 | vma->vm_file = filp; /* Needed for drm_vm_open() */ |
688 | drm_vm_open(vma); | 641 | drm_vm_open(vma); |