aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-irq.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-03-10 04:52:02 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-04-27 14:44:24 -0400
commit1e13f9e3f1501cc167e40a2adf07e6e4705cb331 (patch)
treed55c1c1a50b865752867919c6de715adfd9a56d5 /drivers/media/video/ivtv/ivtv-irq.c
parent037c86c53362b0b3dda6201c9f62f64c9d17abb6 (diff)
V4L/DVB (5404): Merges VBI & YUV handling into a single work queue.
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-irq.c')
-rw-r--r--drivers/media/video/ivtv/ivtv-irq.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/drivers/media/video/ivtv/ivtv-irq.c b/drivers/media/video/ivtv/ivtv-irq.c
index 0656e18b7c7e..c3a047b381b3 100644
--- a/drivers/media/video/ivtv/ivtv-irq.c
+++ b/drivers/media/video/ivtv/ivtv-irq.c
@@ -27,6 +27,7 @@
27#include "ivtv-ioctl.h" 27#include "ivtv-ioctl.h"
28#include "ivtv-mailbox.h" 28#include "ivtv-mailbox.h"
29#include "ivtv-vbi.h" 29#include "ivtv-vbi.h"
30#include "ivtv-yuv.h"
30 31
31#define DMA_MAGIC_COOKIE 0x000001fe 32#define DMA_MAGIC_COOKIE 0x000001fe
32 33
@@ -49,6 +50,19 @@ static inline int ivtv_use_pio(struct ivtv_stream *s)
49 (SLICED_VBI_PIO && s->type == IVTV_ENC_STREAM_TYPE_VBI && itv->vbi.sliced_in->service_set); 50 (SLICED_VBI_PIO && s->type == IVTV_ENC_STREAM_TYPE_VBI && itv->vbi.sliced_in->service_set);
50} 51}
51 52
53void ivtv_irq_work_handler(struct work_struct *work)
54{
55 struct ivtv *itv = container_of(work, struct ivtv, irq_work_queue);
56
57 DEFINE_WAIT(wait);
58
59 if (test_and_clear_bit(IVTV_F_I_WORK_HANDLER_VBI, &itv->i_flags))
60 vbi_work_handler(itv);
61
62 if (test_and_clear_bit(IVTV_F_I_WORK_HANDLER_YUV, &itv->i_flags))
63 ivtv_yuv_work_handler(itv);
64}
65
52/* Determine the required DMA size, setup enough buffers in the predma queue and 66/* Determine the required DMA size, setup enough buffers in the predma queue and
53 actually copy the data from the card to the buffers in case a PIO transfer is 67 actually copy the data from the card to the buffers in case a PIO transfer is
54 required for this stream. 68 required for this stream.
@@ -643,6 +657,7 @@ static void ivtv_irq_vsync(struct ivtv *itv)
643 } 657 }
644 if (frame != (itv->lastVsyncFrame & 1)) { 658 if (frame != (itv->lastVsyncFrame & 1)) {
645 struct ivtv_stream *s = ivtv_get_output_stream(itv); 659 struct ivtv_stream *s = ivtv_get_output_stream(itv);
660 int work = 0;
646 661
647 itv->lastVsyncFrame += 1; 662 itv->lastVsyncFrame += 1;
648 if (frame == 0) { 663 if (frame == 0) {
@@ -661,8 +676,10 @@ static void ivtv_irq_vsync(struct ivtv *itv)
661 wake_up(&s->waitq); 676 wake_up(&s->waitq);
662 677
663 /* Send VBI to saa7127 */ 678 /* Send VBI to saa7127 */
664 if (frame) 679 if (frame) {
665 vbi_schedule_work(itv); 680 set_bit(IVTV_F_I_WORK_HANDLER_VBI, &itv->i_flags);
681 work = 1;
682 }
666 683
667 /* Check if we need to update the yuv registers */ 684 /* Check if we need to update the yuv registers */
668 if ((itv->yuv_info.yuv_forced_update || itv->yuv_info.new_frame_info[last_dma_frame].update) && last_dma_frame != -1) { 685 if ((itv->yuv_info.yuv_forced_update || itv->yuv_info.new_frame_info[last_dma_frame].update) && last_dma_frame != -1) {
@@ -673,9 +690,12 @@ static void ivtv_irq_vsync(struct ivtv *itv)
673 itv->yuv_info.update_frame = last_dma_frame; 690 itv->yuv_info.update_frame = last_dma_frame;
674 itv->yuv_info.new_frame_info[last_dma_frame].update = 0; 691 itv->yuv_info.new_frame_info[last_dma_frame].update = 0;
675 itv->yuv_info.yuv_forced_update = 0; 692 itv->yuv_info.yuv_forced_update = 0;
676 queue_work(itv->yuv_info.work_queues, &itv->yuv_info.work_queue); 693 set_bit(IVTV_F_I_WORK_HANDLER_YUV, &itv->i_flags);
694 work = 1;
677 } 695 }
678 } 696 }
697 if (work)
698 queue_work(itv->irq_work_queues, &itv->irq_work_queue);
679 } 699 }
680} 700}
681 701