[MPlayer-dev-eng] [PATCH] mga_vid for linux kernel 2.5
Alex Beregszaszi
alex at naxine.org
Tue Jun 25 13:53:45 CEST 2002
Hi,
> ===================================================================
> RCS file: /cvsroot/mplayer/main/drivers/mga_vid.c,v
> retrieving revision 1.46
> diff -u -r1.46 mga_vid.c
> --- mga_vid.c 13 May 2002 22:10:11 -0000 1.46
> +++ mga_vid.c 25 Jun 2002 09:10:26 -0000
> @@ -133,7 +133,9 @@
> *endp = (char *)cp;
> return result;
> }
> +#endif
>
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) || LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,5)
> static long simple_strtol(const char *cp,char **endp,unsigned int base)
> {
> if(*cp=='-')
> @@ -1472,8 +1474,13 @@
> #ifdef MP_DEBUG
> printk(KERN_DEBUG "mga_vid: mapping video memory into userspace\n");
> #endif
> +#if LINUX_VERSION_CODE >= 132355
use here KERNEL_VERSION() macro too, please
> + if(remap_page_range(vma, vma->vm_start, mga_mem_base + mga_src_base,
> + vma->vm_end - vma->vm_start, vma->vm_page_prot))
> +#else
> if(remap_page_range(vma->vm_start, mga_mem_base + mga_src_base,
> vma->vm_end - vma->vm_start, vma->vm_page_prot))
> +#endif
> {
> printk(KERN_ERR "mga_vid: error mapping video memory\n");
> return(-EAGAIN);
> @@ -1507,7 +1514,11 @@
>
> static int mga_vid_open(struct inode *inode, struct file *file)
> {
> +#if LINUX_VERSION_CODE >= 132354
here too
> + int minor = MINOR(inode->i_rdev.value);
> +#else
> int minor = MINOR(inode->i_rdev);
> +#endif
>
> if(minor != 0)
> return(-ENXIO);
>
> I have tested it and it works for me. Could somebody add this to CVS?
-
alex
More information about the MPlayer-dev-eng
mailing list