Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 109527
b: refs/heads/master
c: 0058717
h: refs/heads/master
i:
  109525: a00359d
  109523: 9eda3d4
  109519: 7864b69
v: v3
  • Loading branch information
Andy Walls authored and Mauro Carvalho Chehab committed Sep 3, 2008
1 parent e858c03 commit 4e83fde
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 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: 46f2c21cfdb1a829a9a23e23562ffa66b007dc48
refs/heads/master: 0058717a1ef0c87deeccbe0a3b17def173fee9a9
2 changes: 1 addition & 1 deletion trunk/drivers/media/video/cx18/cx18-irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static void epu_dma_done(struct cx18 *cx, struct cx18_mailbox *mb)
CX18_WARN("Ack struct = %d for %s\n",
mb->args[2], s->name);
id = read_enc(off);
buf = cx18_queue_find_buf(s, id, read_enc(off + 4));
buf = cx18_queue_get_buf_irq(s, id, read_enc(off + 4));
CX18_DEBUG_HI_DMA("DMA DONE for %s (buffer %d)\n", s->name, id);
if (buf) {
cx18_buf_sync_for_cpu(s, buf);
Expand Down
23 changes: 13 additions & 10 deletions trunk/drivers/media/video/cx18/cx18-queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,13 @@ struct cx18_buffer *cx18_dequeue(struct cx18_stream *s, struct cx18_queue *q)
return buf;
}

struct cx18_buffer *cx18_queue_find_buf(struct cx18_stream *s, u32 id,
struct cx18_buffer *cx18_queue_get_buf_irq(struct cx18_stream *s, u32 id,
u32 bytesused)
{
struct cx18 *cx = s->cx;
struct list_head *p;

spin_lock(&s->qlock);
list_for_each(p, &s->q_free.list) {
struct cx18_buffer *buf =
list_entry(p, struct cx18_buffer, list);
Expand All @@ -92,17 +93,19 @@ struct cx18_buffer *cx18_queue_find_buf(struct cx18_stream *s, u32 id,
continue;
buf->bytesused = bytesused;
/* the transport buffers are handled differently,
so there is no need to move them to the full queue */
if (s->type == CX18_ENC_STREAM_TYPE_TS)
return buf;
s->q_free.buffers--;
s->q_free.length -= s->buf_size;
s->q_full.buffers++;
s->q_full.length += s->buf_size;
s->q_full.bytesused += buf->bytesused;
list_move_tail(&buf->list, &s->q_full.list);
they are not moved to the full queue */
if (s->type != CX18_ENC_STREAM_TYPE_TS) {
s->q_free.buffers--;
s->q_free.length -= s->buf_size;
s->q_full.buffers++;
s->q_full.length += s->buf_size;
s->q_full.bytesused += buf->bytesused;
list_move_tail(&buf->list, &s->q_full.list);
}
spin_unlock(&s->qlock);
return buf;
}
spin_unlock(&s->qlock);
CX18_ERR("Cannot find buffer %d for stream %s\n", id, s->name);
return NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/media/video/cx18/cx18-queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void cx18_queue_init(struct cx18_queue *q);
void cx18_enqueue(struct cx18_stream *s, struct cx18_buffer *buf,
struct cx18_queue *q);
struct cx18_buffer *cx18_dequeue(struct cx18_stream *s, struct cx18_queue *q);
struct cx18_buffer *cx18_queue_find_buf(struct cx18_stream *s, u32 id,
struct cx18_buffer *cx18_queue_get_buf_irq(struct cx18_stream *s, u32 id,
u32 bytesused);
void cx18_flush_queues(struct cx18_stream *s);

Expand Down

0 comments on commit 4e83fde

Please sign in to comment.