vserver 2.0 rc7
[linux-2.6.git] / drivers / media / video / planb.c
index 10eb49b..b19c334 100644 (file)
@@ -40,6 +40,7 @@
 #include <linux/mm.h>
 #include <linux/sched.h>
 #include <linux/videodev.h>
+#include <linux/wait.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
 #include <asm/prom.h>
@@ -421,6 +422,16 @@ static void planb_prepare_close(struct planb *pb)
 /* overlay support functions */
 /*****************************/
 
+static inline int overlay_is_active(struct planb *pb)
+{
+       unsigned int size = pb->tab_size * sizeof(struct dbdma_cmd);
+       unsigned int caddr = (unsigned)in_le32(&pb->planb_base->ch1.cmdptr);
+
+       return (in_le32(&pb->overlay_last1->cmd_dep) == pb->ch1_cmd_phys)
+                       && (caddr < (pb->ch1_cmd_phys + size))
+                       && (caddr >= (unsigned)pb->ch1_cmd_phys);
+}
+
 static void overlay_start(struct planb *pb)
 {
 
@@ -852,16 +863,6 @@ static int palette2fmt[] = {
 
 #define PLANB_PALETTE_MAX 15
 
-static inline int overlay_is_active(struct planb *pb)
-{
-       unsigned int size = pb->tab_size * sizeof(struct dbdma_cmd);
-       unsigned int caddr = (unsigned)in_le32(&pb->planb_base->ch1.cmdptr);
-
-       return (in_le32(&pb->overlay_last1->cmd_dep) == pb->ch1_cmd_phys)
-                       && (caddr < (pb->ch1_cmd_phys + size))
-                       && (caddr >= (unsigned)pb->ch1_cmd_phys);
-}
-
 static int vgrab(struct planb *pb, struct video_mmap *mp)
 {
        unsigned int fr = mp->frame;
@@ -1609,8 +1610,7 @@ static int planb_ioctl(struct video_device *dev, unsigned int cmd, void *arg)
                                }
                                planb_lock(pb);
                                /* empty the grabbing queue */
-                               while(pb->grabbing)
-                                       interruptible_sleep_on(&pb->capq);
+                               wait_event(pb->capq, !pb->grabbing);
                                pb->maxlines = maxlines;
                                pb->win.norm = v.norm;
                                /* Stop overlay if running */