]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/ivtv/ivtv-yuv.c
V4L/DVB (5671): Autodetect new PVR150 low profile cards.
[linux-2.6-omap-h63xx.git] / drivers / media / video / ivtv / ivtv-yuv.c
index e49ecef930461ad4f2ea954a583bf7d3a9beb003..bcea09542e5ae903493c71e2a7584dc9680525cf 100644 (file)
@@ -22,6 +22,7 @@
 #include "ivtv-queue.h"
 #include "ivtv-udma.h"
 #include "ivtv-irq.h"
+#include "ivtv-yuv.h"
 
 static int ivtv_yuv_prep_user_dma(struct ivtv *itv, struct ivtv_user_dma *dma,
                                 struct ivtv_dma_frame *args)
@@ -612,16 +613,19 @@ static void ivtv_yuv_handle_vertical(struct ivtv *itv, struct yuv_frame_info *wi
        }
 
        itv->yuv_info.frame_interlaced_last = itv->yuv_info.frame_interlaced;
-       itv->yuv_info.lace_threshold_last = itv->yuv_info.lace_threshold;
 }
 
 /* Modify the supplied coordinate information to fit the visible osd area */
 static u32 ivtv_yuv_window_setup (struct ivtv *itv, struct yuv_frame_info *window)
 {
-       int osd_crop;
+       int osd_crop, lace_threshold;
        u32 osd_scale;
        u32 yuv_update = 0;
 
+       lace_threshold = itv->yuv_info.lace_threshold;
+       if (lace_threshold < 0)
+               lace_threshold = itv->yuv_info.decode_height - 1;
+
        /* Work out the lace settings */
        switch (itv->yuv_info.lace_mode) {
                case IVTV_YUV_MODE_PROGRESSIVE: /* Progressive mode */
@@ -638,7 +642,7 @@ static u32 ivtv_yuv_window_setup (struct ivtv *itv, struct yuv_frame_info *windo
                        break;
 
                case IVTV_YUV_MODE_AUTO:
-                       if (window->tru_h <= itv->yuv_info.lace_threshold || window->tru_h > 576 || window->tru_w > 720){
+                       if (window->tru_h <= lace_threshold || window->tru_h > 576 || window->tru_w > 720){
                                itv->yuv_info.frame_interlaced = 0;
                                if ((window->tru_h < 512) ||
                                  (window->tru_h > 576 && window->tru_h < 1021) ||
@@ -804,12 +808,8 @@ static u32 ivtv_yuv_window_setup (struct ivtv *itv, struct yuv_frame_info *windo
 }
 
 /* Update the scaling register to the requested value */
-void ivtv_yuv_work_handler (struct work_struct *work)
+void ivtv_yuv_work_handler (struct ivtv *itv)
 {
-       struct yuv_playback_info *info = container_of(work, struct yuv_playback_info, work_queue);
-       struct ivtv *itv = container_of(info, struct ivtv, yuv_info);
-       DEFINE_WAIT(wait);
-
        struct yuv_frame_info window;
        u32 yuv_update;