Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=51a99c0428cc6d3a442eef1c9046099c9383d72b
Commit:     51a99c0428cc6d3a442eef1c9046099c9383d72b
Parent:     de870b52be9d52c3dad76c9ea7399cb94abcaa1a
Author:     Hans Verkuil <[EMAIL PROTECTED]>
AuthorDate: Sat Aug 18 15:16:00 2007 -0300
Committer:  Mauro Carvalho Chehab <[EMAIL PROTECTED]>
CommitDate: Tue Oct 9 22:05:36 2007 -0300

    V4L/DVB (6049): ivtv: fix VBI reinsertion decoding
    
    - Invalid VBI packets should result in an empty VBI frame, not
      in an zero-sized frame that causes the reader to incorrectly
      return a 0 (EOF) value.
    - PIO completion should not reset the sg_pending_size field.
    - The DMA offset detection code should be ignored for PIO transfers:
      it somehow messes up the data on the card and is not needed anyway
      for PIO.
    
    Signed-off-by: Hans Verkuil <[EMAIL PROTECTED]>
    Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
---
 drivers/media/video/ivtv/ivtv-irq.c |    5 ++---
 drivers/media/video/ivtv/ivtv-vbi.c |    4 ++--
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/media/video/ivtv/ivtv-irq.c 
b/drivers/media/video/ivtv/ivtv-irq.c
index 9695e53..7272f1a 100644
--- a/drivers/media/video/ivtv/ivtv-irq.c
+++ b/drivers/media/video/ivtv/ivtv-irq.c
@@ -165,7 +165,7 @@ static int stream_enc_dma_append(struct ivtv_stream *s, u32 
data[CX2341X_MBOX_MA
        }
 
        /* if this is the start of the DMA then fill in the magic cookie */
-       if (s->sg_pending_size == 0) {
+       if (s->sg_pending_size == 0 && ivtv_use_dma(s)) {
                if (itv->has_cx23415 && (s->type == IVTV_ENC_STREAM_TYPE_PCM ||
                    s->type == IVTV_DEC_STREAM_TYPE_VBI)) {
                        s->pending_backup = read_dec(offset - 
IVTV_DECODER_OFFSET);
@@ -252,7 +252,7 @@ static void dma_post(struct ivtv_stream *s)
                /* Sync Buffer */
                ivtv_buf_sync_for_cpu(s, buf);
 
-               if (x == 0) {
+               if (x == 0 && ivtv_use_dma(s)) {
                        offset = s->dma_last_offset;
                        if (u32buf[offset / 4] != DMA_MAGIC_COOKIE)
                        {
@@ -591,7 +591,6 @@ static void ivtv_irq_enc_pio_complete(struct ivtv *itv)
        }
        s = &itv->streams[itv->cur_pio_stream];
        IVTV_DEBUG_HI_IRQ("ENC PIO COMPLETE %s\n", s->name);
-       s->sg_pending_size = 0;
        clear_bit(IVTV_F_I_PIO, &itv->i_flags);
        itv->cur_pio_stream = -1;
        dma_post(s);
diff --git a/drivers/media/video/ivtv/ivtv-vbi.c 
b/drivers/media/video/ivtv/ivtv-vbi.c
index a7282a9..a58c833 100644
--- a/drivers/media/video/ivtv/ivtv-vbi.c
+++ b/drivers/media/video/ivtv/ivtv-vbi.c
@@ -163,8 +163,8 @@ static int ivtv_convert_ivtv_vbi(struct ivtv *itv, u8 *p)
                linemask[1] = 0xf;
                p += 4;
        } else {
-               /* unknown VBI data stream */
-               return 0;
+               /* unknown VBI data, convert to empty VBI frame */
+               linemask[0] = linemask[1] = 0;
        }
        for (i = 0; i < 36; i++) {
                int err = 0;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to