[Mplayer-cvslog] CVS: main/drivers mga_vid.c,1.53,1.54

Attila Kinali CVS attila at mplayerhq.hu
Sun Aug 31 22:58:06 CEST 2003


Update of /cvsroot/mplayer/main/drivers
In directory mail:/var/tmp.root/cvs-serv13729

Modified Files:
	mga_vid.c 
Log Message:
* Add multi device support.
  For the moment up to 16 cards are supported.
  More can be added easily by changing 2 defines.
  This makes 90% of the patch (mostly stupid s/$var/card->$var/)
  The different devices can be accessed by different minor
  numbers (0-15): 
  	mknod /dev/mga_vid0 c 178 0
  	mknod /dev/mga_vid1 c 178 1
  	mknod /dev/mga_vid2 c 178 2
  	mknod /dev/mga_vid3 c 178 3
	...
	ln -s mga_vid /dev/mga_vid

* Change the devfs code to let the kernel assign us
  a major and a minor number (what is the sense behind
  using devfs anyways if we dont do that ?)
  Subdevices for the different cards are created.
  mga_vid uses the first card (for compatibility)

* Fix a possible error when mmap() is called before
  the card is configured by a ioctl().


Index: mga_vid.c
===================================================================
RCS file: /cvsroot/mplayer/main/drivers/mga_vid.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- mga_vid.c	21 Mar 2003 17:59:15 -0000	1.53
+++ mga_vid.c	31 Aug 2003 20:57:34 -0000	1.54
@@ -3,6 +3,7 @@
 // YUY2 support (see config.format) added by A'rpi/ESP-team
 // double buffering added by A'rpi/ESP-team
 // brightness/contrast introduced by eyck
+// multiple card support by Attila Kinali <attila at kinali.ch>
 
 // Set this value, if autodetection fails! (video ram size in megabytes)
 // #define MGA_MEMORY_SIZE 16
@@ -71,8 +72,6 @@
 
 #define DEFAULT_MGA_VID_MAJOR 178
 
[...1790 lines suppressed...]
+			if(card->mmio_base)
+				iounmap(card->mmio_base);
+			if(card->param_buff)
+				kfree(card->param_buff);
+#ifdef CONFIG_DEVFS_FS
+			if(card->dev_handle) devfs_unregister(card->dev_handle);
+#endif
+
+			kfree(card);
+			mga_cards[i]=NULL;
+		}
+	}
 
 	//FIXME turn off BES
 	printk(KERN_INFO "mga_vid: Cleaning up module\n");
@@ -1687,4 +1781,3 @@
 #endif
 	unregister_chrdev(major, "mga_vid");
 }
-



More information about the MPlayer-cvslog mailing list