Commit e17a06ba authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

V4L/DVB (6050): ivtv: retry/timer improvements

- Give up frame after three retries.
- When the last capture/decode ends, make sure to delete the dma_timer.
Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 51a99c04
...@@ -494,7 +494,9 @@ static void ivtv_irq_dma_read(struct ivtv *itv) ...@@ -494,7 +494,9 @@ static void ivtv_irq_dma_read(struct ivtv *itv)
s->sg_processed, s->sg_processing_size, itv->dma_retries); s->sg_processed, s->sg_processing_size, itv->dma_retries);
write_reg(read_reg(IVTV_REG_DMASTATUS) & 3, IVTV_REG_DMASTATUS); write_reg(read_reg(IVTV_REG_DMASTATUS) & 3, IVTV_REG_DMASTATUS);
if (itv->dma_retries == 3) { if (itv->dma_retries == 3) {
/* Too many retries, give up on this frame */
itv->dma_retries = 0; itv->dma_retries = 0;
s->sg_processed = s->sg_processing_size;
} }
else { else {
/* Retry, starting with the first xfer segment. /* Retry, starting with the first xfer segment.
...@@ -554,7 +556,9 @@ static void ivtv_irq_enc_dma_complete(struct ivtv *itv) ...@@ -554,7 +556,9 @@ static void ivtv_irq_enc_dma_complete(struct ivtv *itv)
s->dma_offset, s->sg_processed, s->sg_processing_size, itv->dma_retries); s->dma_offset, s->sg_processed, s->sg_processing_size, itv->dma_retries);
write_reg(read_reg(IVTV_REG_DMASTATUS) & 3, IVTV_REG_DMASTATUS); write_reg(read_reg(IVTV_REG_DMASTATUS) & 3, IVTV_REG_DMASTATUS);
if (itv->dma_retries == 3) { if (itv->dma_retries == 3) {
/* Too many retries, give up on this frame */
itv->dma_retries = 0; itv->dma_retries = 0;
s->sg_processed = s->sg_processing_size;
} }
else { else {
/* Retry, starting with the first xfer segment. /* Retry, starting with the first xfer segment.
......
...@@ -816,6 +816,7 @@ int ivtv_stop_v4l2_encode_stream(struct ivtv_stream *s, int gop_end) ...@@ -816,6 +816,7 @@ int ivtv_stop_v4l2_encode_stream(struct ivtv_stream *s, int gop_end)
/* Set the following Interrupt mask bits for capture */ /* Set the following Interrupt mask bits for capture */
ivtv_set_irq_mask(itv, IVTV_IRQ_MASK_CAPTURE); ivtv_set_irq_mask(itv, IVTV_IRQ_MASK_CAPTURE);
del_timer(&itv->dma_timer);
/* event notification (off) */ /* event notification (off) */
if (test_and_clear_bit(IVTV_F_I_DIG_RST, &itv->i_flags)) { if (test_and_clear_bit(IVTV_F_I_DIG_RST, &itv->i_flags)) {
...@@ -873,6 +874,7 @@ int ivtv_stop_v4l2_decode_stream(struct ivtv_stream *s, int flags, u64 pts) ...@@ -873,6 +874,7 @@ int ivtv_stop_v4l2_decode_stream(struct ivtv_stream *s, int flags, u64 pts)
ivtv_vapi(itv, CX2341X_DEC_SET_EVENT_NOTIFICATION, 4, 0, 0, IVTV_IRQ_DEC_AUD_MODE_CHG, -1); ivtv_vapi(itv, CX2341X_DEC_SET_EVENT_NOTIFICATION, 4, 0, 0, IVTV_IRQ_DEC_AUD_MODE_CHG, -1);
ivtv_set_irq_mask(itv, IVTV_IRQ_MASK_DECODE); ivtv_set_irq_mask(itv, IVTV_IRQ_MASK_DECODE);
del_timer(&itv->dma_timer);
clear_bit(IVTV_F_S_NEEDS_DATA, &s->s_flags); clear_bit(IVTV_F_S_NEEDS_DATA, &s->s_flags);
clear_bit(IVTV_F_S_STREAMING, &s->s_flags); clear_bit(IVTV_F_S_STREAMING, &s->s_flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment