diff options
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-irq.c')
| -rw-r--r-- | drivers/media/video/ivtv/ivtv-irq.c | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/drivers/media/video/ivtv/ivtv-irq.c b/drivers/media/video/ivtv/ivtv-irq.c index fba150a6cd23..34f3ab827858 100644 --- a/drivers/media/video/ivtv/ivtv-irq.c +++ b/drivers/media/video/ivtv/ivtv-irq.c | |||
| @@ -76,6 +76,13 @@ void ivtv_irq_work_handler(struct work_struct *work) | |||
| 76 | 76 | ||
| 77 | DEFINE_WAIT(wait); | 77 | DEFINE_WAIT(wait); |
| 78 | 78 | ||
| 79 | if (test_and_clear_bit(IVTV_F_I_WORK_INITED, &itv->i_flags)) { | ||
| 80 | struct sched_param param = { .sched_priority = 99 }; | ||
| 81 | |||
| 82 | /* This thread must use the FIFO scheduler as it | ||
| 83 | is realtime sensitive. */ | ||
| 84 | sched_setscheduler(current, SCHED_FIFO, ¶m); | ||
| 85 | } | ||
| 79 | if (test_and_clear_bit(IVTV_F_I_WORK_HANDLER_PIO, &itv->i_flags)) | 86 | if (test_and_clear_bit(IVTV_F_I_WORK_HANDLER_PIO, &itv->i_flags)) |
| 80 | ivtv_pio_work_handler(itv); | 87 | ivtv_pio_work_handler(itv); |
| 81 | 88 | ||
| @@ -678,34 +685,14 @@ static void ivtv_irq_enc_start_cap(struct ivtv *itv) | |||
| 678 | 685 | ||
| 679 | static void ivtv_irq_enc_vbi_cap(struct ivtv *itv) | 686 | static void ivtv_irq_enc_vbi_cap(struct ivtv *itv) |
| 680 | { | 687 | { |
| 681 | struct ivtv_stream *s_mpg = &itv->streams[IVTV_ENC_STREAM_TYPE_MPG]; | ||
| 682 | u32 data[CX2341X_MBOX_MAX_DATA]; | 688 | u32 data[CX2341X_MBOX_MAX_DATA]; |
| 683 | struct ivtv_stream *s; | 689 | struct ivtv_stream *s; |
| 684 | 690 | ||
| 685 | IVTV_DEBUG_HI_IRQ("ENC START VBI CAP\n"); | 691 | IVTV_DEBUG_HI_IRQ("ENC START VBI CAP\n"); |
| 686 | s = &itv->streams[IVTV_ENC_STREAM_TYPE_VBI]; | 692 | s = &itv->streams[IVTV_ENC_STREAM_TYPE_VBI]; |
| 687 | 693 | ||
| 688 | /* If more than two VBI buffers are pending, then | 694 | if (!stream_enc_dma_append(s, data)) |
| 689 | clear the old ones and start with this new one. | ||
| 690 | This can happen during transition stages when MPEG capturing is | ||
| 691 | started, but the first interrupts haven't arrived yet. During | ||
| 692 | that period VBI requests can accumulate without being able to | ||
| 693 | DMA the data. Since at most four VBI DMA buffers are available, | ||
| 694 | we just drop the old requests when there are already three | ||
| 695 | requests queued. */ | ||
| 696 | if (s->sg_pending_size > 2) { | ||
| 697 | struct ivtv_buffer *buf; | ||
| 698 | list_for_each_entry(buf, &s->q_predma.list, list) | ||
| 699 | ivtv_buf_sync_for_cpu(s, buf); | ||
| 700 | ivtv_queue_move(s, &s->q_predma, NULL, &s->q_free, 0); | ||
| 701 | s->sg_pending_size = 0; | ||
| 702 | } | ||
| 703 | /* if we can append the data, and the MPEG stream isn't capturing, | ||
| 704 | then start a DMA request for just the VBI data. */ | ||
| 705 | if (!stream_enc_dma_append(s, data) && | ||
| 706 | !test_bit(IVTV_F_S_STREAMING, &s_mpg->s_flags)) { | ||
| 707 | set_bit(ivtv_use_pio(s) ? IVTV_F_S_PIO_PENDING : IVTV_F_S_DMA_PENDING, &s->s_flags); | 695 | set_bit(ivtv_use_pio(s) ? IVTV_F_S_PIO_PENDING : IVTV_F_S_DMA_PENDING, &s->s_flags); |
| 708 | } | ||
| 709 | } | 696 | } |
| 710 | 697 | ||
| 711 | static void ivtv_irq_dec_vbi_reinsert(struct ivtv *itv) | 698 | static void ivtv_irq_dec_vbi_reinsert(struct ivtv *itv) |
