aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-yuv.c
diff options
context:
space:
mode:
authorIan Armstrong <ian@iarmst.demon.co.uk>2007-08-03 08:58:29 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 21:04:28 -0400
commit943e8910db31e36d945f2bf7d4c273ca5fa01f6e (patch)
tree40d74912b4e6a612b6a1ecb8a3ab7131249f008a /drivers/media/video/ivtv/ivtv-yuv.c
parent68a341a53ab5a3c5b7dad4b226124414c62c124d (diff)
V4L/DVB (5972): ivtv: prevent yuv register updates from being missed
The yuv output code always compares the new frame position & size with those of the previous frame. If they are different, a flag is set to request the yuv output registers be updated when the new frame is displayed. If the incoming frames are delivered too fast, exhausting the buffers, the most recent frame already buffered will be discarded. Unfortunately, any update request will also be discarded. If the new frame matches the size & position of the now discarded frame, the yuv registers are not flagged for update & will remain in their old state. This patch preserves the register update flag in the event that a frame is dropped. 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-yuv.c')
-rw-r--r--drivers/media/video/ivtv/ivtv-yuv.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/video/ivtv/ivtv-yuv.c b/drivers/media/video/ivtv/ivtv-yuv.c
index 70ddf4060d37..5c94d3282c82 100644
--- a/drivers/media/video/ivtv/ivtv-yuv.c
+++ b/drivers/media/video/ivtv/ivtv-yuv.c
@@ -940,6 +940,7 @@ int ivtv_yuv_prep_frame(struct ivtv *itv, struct ivtv_dma_frame *args)
940 int rc = 0; 940 int rc = 0;
941 int got_sig = 0; 941 int got_sig = 0;
942 int frame, next_fill_frame, last_fill_frame; 942 int frame, next_fill_frame, last_fill_frame;
943 int register_update = 0;
943 944
944 IVTV_DEBUG_INFO("yuv_prep_frame\n"); 945 IVTV_DEBUG_INFO("yuv_prep_frame\n");
945 946
@@ -953,6 +954,7 @@ int ivtv_yuv_prep_frame(struct ivtv *itv, struct ivtv_dma_frame *args)
953 /* Buffers are full - Overwrite the last frame */ 954 /* Buffers are full - Overwrite the last frame */
954 next_fill_frame = frame; 955 next_fill_frame = frame;
955 frame = (frame - 1) & 3; 956 frame = (frame - 1) & 3;
957 register_update = itv->yuv_info.new_frame_info[frame].update;
956 } 958 }
957 959
958 /* Take a snapshot of the yuv coordinate information */ 960 /* Take a snapshot of the yuv coordinate information */
@@ -991,6 +993,8 @@ int ivtv_yuv_prep_frame(struct ivtv *itv, struct ivtv_dma_frame *args)
991/* IVTV_DEBUG_YUV ("Requesting register update for frame %d\n",frame); */ 993/* IVTV_DEBUG_YUV ("Requesting register update for frame %d\n",frame); */
992 } 994 }
993 995
996 itv->yuv_info.new_frame_info[frame].update |= register_update;
997
994 /* DMA the frame */ 998 /* DMA the frame */
995 mutex_lock(&itv->udma.lock); 999 mutex_lock(&itv->udma.lock);
996 1000