aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-irq.c
diff options
context:
space:
mode:
authorIan Armstrong <ian@iarmst.demon.co.uk>2007-10-22 13:24:26 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 16:03:10 -0500
commit3b5c1c8e71eb8fe2297a5884db59108e3c8b44c5 (patch)
tree39161a925790139e733137c5114e4419d3e45983 /drivers/media/video/ivtv/ivtv-irq.c
parent406c8b0ff0891ace87440bcb298a91c1927f9ae5 (diff)
V4L/DVB (6716): ivtv: yuv interlace mode change
Interlace mode selection code moved into the frame setup phase, so it's now run before the frame is loaded into a hardware buffer. Given that it can affect how a new frame is displayed, it was a bit stupid running it after the frame was already visible. A few stray interlace related variables which were linked to individual frames have now been moved into the yuv_frame_info struct. This means that all variables linked to a specific frame are in the same place & not scattered. Minor code reformatting in areas touched by the above changes. 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.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/media/video/ivtv/ivtv-irq.c b/drivers/media/video/ivtv/ivtv-irq.c
index 8c00d8f6d4d9..dd0dd8d126de 100644
--- a/drivers/media/video/ivtv/ivtv-irq.c
+++ b/drivers/media/video/ivtv/ivtv-irq.c
@@ -746,15 +746,16 @@ static void ivtv_irq_vsync(struct ivtv *itv)
746 unsigned int frame = read_reg(0x28c0) & 1; 746 unsigned int frame = read_reg(0x28c0) & 1;
747 struct yuv_playback_info *yi = &itv->yuv_info; 747 struct yuv_playback_info *yi = &itv->yuv_info;
748 int last_dma_frame = atomic_read(&itv->yuv_info.next_dma_frame); 748 int last_dma_frame = atomic_read(&itv->yuv_info.next_dma_frame);
749 struct yuv_frame_info *f = &yi->new_frame_info[last_dma_frame];
749 750
750 if (0) IVTV_DEBUG_IRQ("DEC VSYNC\n"); 751 if (0) IVTV_DEBUG_IRQ("DEC VSYNC\n");
751 752
752 if (((frame ^ yi->sync_field[last_dma_frame]) == 0 && 753 if (((frame ^ f->sync_field) == 0 &&
753 ((itv->last_vsync_field & 1) ^ yi->sync_field[last_dma_frame])) || 754 ((itv->last_vsync_field & 1) ^ f->sync_field)) ||
754 (frame != (itv->last_vsync_field & 1) && !yi->frame_interlaced)) { 755 (frame != (itv->last_vsync_field & 1) && !f->interlaced)) {
755 int next_dma_frame = last_dma_frame; 756 int next_dma_frame = last_dma_frame;
756 757
757 if (!(yi->frame_interlaced && yi->field_delay[next_dma_frame] && yi->fields_lapsed < 1)) { 758 if (!(f->interlaced && f->delay && yi->fields_lapsed < 1)) {
758 if (next_dma_frame >= 0 && next_dma_frame != atomic_read(&yi->next_fill_frame)) { 759 if (next_dma_frame >= 0 && next_dma_frame != atomic_read(&yi->next_fill_frame)) {
759 write_reg(yuv_offset[next_dma_frame] >> 4, 0x82c); 760 write_reg(yuv_offset[next_dma_frame] >> 4, 0x82c);
760 write_reg((yuv_offset[next_dma_frame] + IVTV_YUV_BUFFER_UV_OFFSET) >> 4, 0x830); 761 write_reg((yuv_offset[next_dma_frame] + IVTV_YUV_BUFFER_UV_OFFSET) >> 4, 0x830);
@@ -795,13 +796,15 @@ static void ivtv_irq_vsync(struct ivtv *itv)
795 } 796 }
796 797
797 /* Check if we need to update the yuv registers */ 798 /* Check if we need to update the yuv registers */
798 if ((yi->yuv_forced_update || yi->new_frame_info[last_dma_frame].update) && last_dma_frame != -1) { 799 if ((yi->yuv_forced_update || f->update) && last_dma_frame != -1) {
799 if (!yi->new_frame_info[last_dma_frame].update) 800 if (!f->update) {
800 last_dma_frame = (u8)(last_dma_frame - 1) % IVTV_YUV_BUFFERS; 801 last_dma_frame = (u8)(last_dma_frame - 1) % IVTV_YUV_BUFFERS;
802 f = &yi->new_frame_info[last_dma_frame];
803 }
801 804
802 if (yi->new_frame_info[last_dma_frame].src_w) { 805 if (f->src_w) {
803 yi->update_frame = last_dma_frame; 806 yi->update_frame = last_dma_frame;
804 yi->new_frame_info[last_dma_frame].update = 0; 807 f->update = 0;
805 yi->yuv_forced_update = 0; 808 yi->yuv_forced_update = 0;
806 set_bit(IVTV_F_I_WORK_HANDLER_YUV, &itv->i_flags); 809 set_bit(IVTV_F_I_WORK_HANDLER_YUV, &itv->i_flags);
807 set_bit(IVTV_F_I_HAVE_WORK, &itv->i_flags); 810 set_bit(IVTV_F_I_HAVE_WORK, &itv->i_flags);