[MPlayer-users] mga_vid and kernel 2.5

Bartek Jakubski migo at pld.org.pl
Tue Apr 22 21:07:26 CEST 2003


I'm by no means kernel or mplayer hacker and I barely know C, so I can't
guarantee _anything_ about information presented below... :-)

To compile and use mga_vid under recent 2.5.x kernel small changes have to
be done to the code:

---------------
--- mga_vid-org.c       Tue Apr 22 20:27:13 2003
+++ mga_vid.c   Tue Apr 22 20:25:16 2003
@@ -148,7 +148,7 @@
 }
 #endif

-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) || LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,5)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
 static long simple_strtol(const char *cp,char **endp,unsigned int base)
 {
         if(*cp=='-')
@@ -1338,7 +1338,7 @@
                        break;
                default:
                        num_found--;
-                       printk(KERN_INFO "mga_vid: ignoring matrox device (%d) at %s [%s]\n", dev->device, dev->slot_name, dev->name);
+                       printk(KERN_INFO "mga_vid: ignoring matrox device (%d) at %s [%s]\n", dev->device, dev->slot_name, (dev->dev).name);
                        break;
                }
                if(num_found == mga_number+1)
@@ -1353,7 +1353,7 @@
                        printk(KERN_ERR "mga_vid: Only %d supported cards found\n", num_found);
                return FALSE;
        }
-       printk(KERN_INFO "mga_vid: Found %s at %s [%s]\n", mga_dev_name, dev->slot_name, dev->name);
+       printk(KERN_INFO "mga_vid: Found %s at %s [%s]\n", mga_dev_name, dev->slot_name, (dev->dev).name);

        pci_dev = dev;

---------------


simple_strtol is exported since 2.5.31 and pci_dev structure changed in
2.5.48

Now, to take advantage of a new kernel build system use the following
Makefile:

---------------
ifneq ($(KERNELRELEASE),)
obj-m       := mga_vid.o

else
KDIR        := /lib/modules/$(shell uname -r)/build
PWD         := $(shell pwd)

default:
        $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
endif
---------------

It is pretty self-explanatory.

'make' should build the mga_vid.ko - the module itself (warning: you need
write access to kernel source dir!)

NOTE: To use matroxfb with current 2.5.x kernel you need to apply patch from:
ftp://platan.vc.cvut.cz/pub/linux/matrox-latest/ called
mga-KERNELVERSION.gz


-- 
-- .- Bartek Jakubski --------------------- Sosnowiec -. --
-- |  Free Software is a matter of liberty, not price  | --
-- `---------------(http://www.fsf.org/philosophy)-----' --



More information about the MPlayer-users mailing list