Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 109509
b: refs/heads/master
c: d526afe
h: refs/heads/master
i:
  109507: 69af841
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Sep 3, 2008
1 parent 6a8ccdd commit 1b696d4
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 26 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c58dc0beaf70bce4d04ff53b82a7035a255a04e4
refs/heads/master: d526afe06b285006c63ed8f2eba9589f04e3283a
2 changes: 1 addition & 1 deletion trunk/drivers/media/video/ivtv/ivtv-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ static int __devinit ivtv_init_struct1(struct ivtv *itv)
spin_lock_init(&itv->lock);
spin_lock_init(&itv->dma_reg_lock);

itv->irq_work_queues = create_workqueue(itv->name);
itv->irq_work_queues = create_singlethread_workqueue(itv->name);
if (itv->irq_work_queues == NULL) {
IVTV_ERR("Could not create ivtv workqueue\n");
return -1;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/media/video/ivtv/ivtv-driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ struct ivtv_mailbox_data {
#define IVTV_F_I_DEC_PAUSED 20 /* the decoder is paused */
#define IVTV_F_I_INITED 21 /* set after first open */
#define IVTV_F_I_FAILED 22 /* set if first open failed */
#define IVTV_F_I_WORK_INITED 23 /* worker thread was initialized */

/* Event notifications */
#define IVTV_F_I_EV_DEC_STOPPED 28 /* decoder stopped event */
Expand Down
29 changes: 8 additions & 21 deletions trunk/drivers/media/video/ivtv/ivtv-irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ void ivtv_irq_work_handler(struct work_struct *work)

DEFINE_WAIT(wait);

if (test_and_clear_bit(IVTV_F_I_WORK_INITED, &itv->i_flags)) {
struct sched_param param = { .sched_priority = 99 };

/* This thread must use the FIFO scheduler as it
is realtime sensitive. */
sched_setscheduler(current, SCHED_FIFO, &param);
}
if (test_and_clear_bit(IVTV_F_I_WORK_HANDLER_PIO, &itv->i_flags))
ivtv_pio_work_handler(itv);

Expand Down Expand Up @@ -678,34 +685,14 @@ static void ivtv_irq_enc_start_cap(struct ivtv *itv)

static void ivtv_irq_enc_vbi_cap(struct ivtv *itv)
{
struct ivtv_stream *s_mpg = &itv->streams[IVTV_ENC_STREAM_TYPE_MPG];
u32 data[CX2341X_MBOX_MAX_DATA];
struct ivtv_stream *s;

IVTV_DEBUG_HI_IRQ("ENC START VBI CAP\n");
s = &itv->streams[IVTV_ENC_STREAM_TYPE_VBI];

/* If more than two VBI buffers are pending, then
clear the old ones and start with this new one.
This can happen during transition stages when MPEG capturing is
started, but the first interrupts haven't arrived yet. During
that period VBI requests can accumulate without being able to
DMA the data. Since at most four VBI DMA buffers are available,
we just drop the old requests when there are already three
requests queued. */
if (s->sg_pending_size > 2) {
struct ivtv_buffer *buf;
list_for_each_entry(buf, &s->q_predma.list, list)
ivtv_buf_sync_for_cpu(s, buf);
ivtv_queue_move(s, &s->q_predma, NULL, &s->q_free, 0);
s->sg_pending_size = 0;
}
/* if we can append the data, and the MPEG stream isn't capturing,
then start a DMA request for just the VBI data. */
if (!stream_enc_dma_append(s, data) &&
!test_bit(IVTV_F_S_STREAMING, &s_mpg->s_flags)) {
if (!stream_enc_dma_append(s, data))
set_bit(ivtv_use_pio(s) ? IVTV_F_S_PIO_PENDING : IVTV_F_S_DMA_PENDING, &s->s_flags);
}
}

static void ivtv_irq_dec_vbi_reinsert(struct ivtv *itv)
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/video/ivtv/ivtv-queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#define IVTV_QUEUE_H

#define IVTV_DMA_UNMAPPED ((u32) -1)
#define SLICED_VBI_PIO 1
#define SLICED_VBI_PIO 0

/* ivtv_buffer utility functions */

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/video/ivtv/ivtv-streams.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ static void ivtv_vbi_setup(struct ivtv *itv)
/* Every X number of frames a VBI interrupt arrives (frames as in 25 or 30 fps) */
data[1] = 1;
/* The VBI frames are stored in a ringbuffer with this size (with a VBI frame as unit) */
data[2] = raw ? 4 : 8;
data[2] = raw ? 4 : 4 * (itv->vbi.raw_size / itv->vbi.enc_size);
/* The start/stop codes determine which VBI lines end up in the raw VBI data area.
The codes are from table 24 in the saa7115 datasheet. Each raw/sliced/video line
is framed with codes FF0000XX where XX is the SAV/EAV (Start/End of Active Video)
Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/media/video/ivtv/ivtv-vbi.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ static u32 compress_sliced_buf(struct ivtv *itv, u32 line, u8 *buf, u32 size, u8
u32 line_size = itv->vbi.sliced_decoder_line_size;
struct v4l2_decode_vbi_line vbi;
int i;
unsigned lines = 0;

/* find the first valid line */
for (i = 0; i < size; i++, buf++) {
Expand All @@ -313,7 +314,8 @@ static u32 compress_sliced_buf(struct ivtv *itv, u32 line, u8 *buf, u32 size, u8
}
vbi.p = p + 4;
itv->video_dec_func(itv, VIDIOC_INT_DECODE_VBI_LINE, &vbi);
if (vbi.type) {
if (vbi.type && !(lines & (1 << vbi.line))) {
lines |= 1 << vbi.line;
itv->vbi.sliced_data[line].id = vbi.type;
itv->vbi.sliced_data[line].field = vbi.is_second_field;
itv->vbi.sliced_data[line].line = vbi.line;
Expand Down

0 comments on commit 1b696d4

Please sign in to comment.