fix pfn vs page for older kernels (2.6.9-rc kernels many not work..)
parent
8d7e798d4c
commit
182a0e5dac
|
@ -181,6 +181,18 @@ static inline void radeon_delete_i2c_busses(struct drm_device *dev)
|
|||
|
||||
#define VM_OFFSET(vma) ((vma)->vm_pgoff << PAGE_SHIFT)
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9)
|
||||
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,
|
||||
pfn << PAGE_SHIFT,
|
||||
size,
|
||||
pgprot);
|
||||
}
|
||||
#endif
|
||||
|
||||
extern const drm_agp_t drm_agp_entry;
|
||||
|
||||
/* old architectures */
|
||||
#ifdef __AMD64__
|
||||
#define __x86_64__
|
||||
|
|
|
@ -645,7 +645,7 @@ int drm_mmap(struct file *filp, struct vm_area_struct *vma)
|
|||
vma->vm_end - vma->vm_start,
|
||||
vma->vm_page_prot, 0))
|
||||
#else
|
||||
if (remap_pfn_range(DRM_RPR_ARG(vma) vma->vm_start,
|
||||
if (remap_pfn_range(vma, vma->vm_start,
|
||||
(VM_OFFSET(vma) + offset) >> PAGE_SHIFT,
|
||||
vma->vm_end - vma->vm_start,
|
||||
vma->vm_page_prot))
|
||||
|
|
|
@ -130,7 +130,7 @@ int i810_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
|
|||
buf_priv->currently_mapped = I810_BUF_MAPPED;
|
||||
unlock_kernel();
|
||||
|
||||
if (remap_pfn_range(DRM_RPR_ARG(vma) vma->vm_start,
|
||||
if (remap_pfn_range(vma, vma->vm_start,
|
||||
VM_OFFSET(vma) >> PAGE_SHIFT,
|
||||
vma->vm_end - vma->vm_start,
|
||||
vma->vm_page_prot))
|
||||
|
|
|
@ -131,7 +131,7 @@ int i830_mmap_buffers(struct file *filp, struct vm_area_struct *vma)
|
|||
buf_priv->currently_mapped = I830_BUF_MAPPED;
|
||||
unlock_kernel();
|
||||
|
||||
if (remap_pfn_range(DRM_RPR_ARG(vma) vma->vm_start,
|
||||
if (remap_pfn_range(vma, vma->vm_start,
|
||||
VM_OFFSET(vma) >> PAGE_SHIFT,
|
||||
vma->vm_end - vma->vm_start,
|
||||
vma->vm_page_prot))
|
||||
|
|
Loading…
Reference in New Issue