aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-irq.c
diff options
context:
space:
mode:
authorIan Armstrong <ian@iarmst.demon.co.uk>2007-10-20 13:52:55 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 16:03:10 -0500
commita3e5f5e2dfb50bebca24329e5377d804c6e3eb1b (patch)
tree6a900057b715633c5b7951568253f35de2e0a24f /drivers/media/video/ivtv/ivtv-irq.c
parentc240ad00af78228726e6301ad6ffc54d3adce2a0 (diff)
V4L/DVB (6713): ivtv: ivtv_yuv_prep_frame breakup and yuv hardware buffer changes
ivtv_yuv_prep_frame is split in smaller code blocks. Modified yuv buffer handling on the PVR350 itself. We now cycle through all 8 hardware buffers. With this patch in place, driver behaviour should remain unchanged from the existing release. 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.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/drivers/media/video/ivtv/ivtv-irq.c b/drivers/media/video/ivtv/ivtv-irq.c
index bcf1c85991af..fc8eac09584c 100644
--- a/drivers/media/video/ivtv/ivtv-irq.c
+++ b/drivers/media/video/ivtv/ivtv-irq.c
@@ -744,24 +744,25 @@ static void ivtv_irq_vsync(struct ivtv *itv)
744 * one vsync per frame. 744 * one vsync per frame.
745 */ 745 */
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 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);
748 749
749 if (0) IVTV_DEBUG_IRQ("DEC VSYNC\n"); 750 if (0) IVTV_DEBUG_IRQ("DEC VSYNC\n");
750 751
751 if (((frame ^ itv->yuv_info.sync_field[last_dma_frame]) == 0 && 752 if (((frame ^ yi->sync_field[last_dma_frame]) == 0 &&
752 ((itv->last_vsync_field & 1) ^ itv->yuv_info.sync_field[last_dma_frame])) || 753 ((itv->last_vsync_field & 1) ^ yi->sync_field[last_dma_frame])) ||
753 (frame != (itv->last_vsync_field & 1) && !itv->yuv_info.frame_interlaced)) { 754 (frame != (itv->last_vsync_field & 1) && !yi->frame_interlaced)) {
754 int next_dma_frame = last_dma_frame; 755 int next_dma_frame = last_dma_frame;
755 756
756 if (!(itv->yuv_info.frame_interlaced && itv->yuv_info.field_delay[next_dma_frame] && itv->yuv_info.fields_lapsed < 1)) { 757 if (!(yi->frame_interlaced && yi->field_delay[next_dma_frame] && yi->fields_lapsed < 1)) {
757 if (next_dma_frame >= 0 && next_dma_frame != atomic_read(&itv->yuv_info.next_fill_frame)) { 758 if (next_dma_frame >= 0 && next_dma_frame != atomic_read(&yi->next_fill_frame)) {
758 write_reg(yuv_offset[next_dma_frame] >> 4, 0x82c); 759 write_reg(yuv_offset[next_dma_frame] >> 4, 0x82c);
759 write_reg((yuv_offset[next_dma_frame] + IVTV_YUV_BUFFER_UV_OFFSET) >> 4, 0x830); 760 write_reg((yuv_offset[next_dma_frame] + IVTV_YUV_BUFFER_UV_OFFSET) >> 4, 0x830);
760 write_reg(yuv_offset[next_dma_frame] >> 4, 0x834); 761 write_reg(yuv_offset[next_dma_frame] >> 4, 0x834);
761 write_reg((yuv_offset[next_dma_frame] + IVTV_YUV_BUFFER_UV_OFFSET) >> 4, 0x838); 762 write_reg((yuv_offset[next_dma_frame] + IVTV_YUV_BUFFER_UV_OFFSET) >> 4, 0x838);
762 next_dma_frame = (next_dma_frame + 1) & 0x3; 763 next_dma_frame = (next_dma_frame + 1) % IVTV_YUV_BUFFERS;
763 atomic_set(&itv->yuv_info.next_dma_frame, next_dma_frame); 764 atomic_set(&yi->next_dma_frame, next_dma_frame);
764 itv->yuv_info.fields_lapsed = -1; 765 yi->fields_lapsed = -1;
765 } 766 }
766 } 767 }
767 } 768 }
@@ -794,20 +795,20 @@ static void ivtv_irq_vsync(struct ivtv *itv)
794 } 795 }
795 796
796 /* Check if we need to update the yuv registers */ 797 /* Check if we need to update the yuv registers */
797 if ((itv->yuv_info.yuv_forced_update || itv->yuv_info.new_frame_info[last_dma_frame].update) && last_dma_frame != -1) { 798 if ((yi->yuv_forced_update || yi->new_frame_info[last_dma_frame].update) && last_dma_frame != -1) {
798 if (!itv->yuv_info.new_frame_info[last_dma_frame].update) 799 if (!yi->new_frame_info[last_dma_frame].update)
799 last_dma_frame = (last_dma_frame - 1) & 3; 800 last_dma_frame = (last_dma_frame - 1) & 3;
800 801
801 if (itv->yuv_info.new_frame_info[last_dma_frame].src_w) { 802 if (yi->new_frame_info[last_dma_frame].src_w) {
802 itv->yuv_info.update_frame = last_dma_frame; 803 yi->update_frame = last_dma_frame;
803 itv->yuv_info.new_frame_info[last_dma_frame].update = 0; 804 yi->new_frame_info[last_dma_frame].update = 0;
804 itv->yuv_info.yuv_forced_update = 0; 805 yi->yuv_forced_update = 0;
805 set_bit(IVTV_F_I_WORK_HANDLER_YUV, &itv->i_flags); 806 set_bit(IVTV_F_I_WORK_HANDLER_YUV, &itv->i_flags);
806 set_bit(IVTV_F_I_HAVE_WORK, &itv->i_flags); 807 set_bit(IVTV_F_I_HAVE_WORK, &itv->i_flags);
807 } 808 }
808 } 809 }
809 810
810 itv->yuv_info.fields_lapsed ++; 811 yi->fields_lapsed++;
811 } 812 }
812} 813}
813 814