Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 174140
b: refs/heads/master
c: 1047a83
h: refs/heads/master
v: v3
  • Loading branch information
Andy Walls authored and Mauro Carvalho Chehab committed Dec 5, 2009
1 parent e9b9a7a commit f86fdb9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 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: 22dce188ef3e1e058ceabe3b3072640d7568f764
refs/heads/master: 1047a83844a4d894a068d94aca2d3efe54ac7a9c
21 changes: 18 additions & 3 deletions trunk/drivers/media/video/cx18/cx18-queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ void cx18_load_queues(struct cx18_stream *s)
struct cx18_buffer *buf;
int mdl_id;
int i;
u32 partial_buf_size;

/*
* Attach buffers to MDLs, give the MDLs ids, and add MDLs to q_free
Expand Down Expand Up @@ -308,10 +309,24 @@ void cx18_load_queues(struct cx18_stream *s)
&cx->scb->cpu_mdl[mdl_id + i].length);
}

if (i == s->bufs_per_mdl)
if (i == s->bufs_per_mdl) {
/*
* The encoder doesn't honor s->mdl_size. So in the
* case of a non-integral number of buffers to meet
* mdl_size, we lie about the size of the last buffer
* in the MDL to get the encoder to really only send
* us mdl_size bytes per MDL transfer.
*/
partial_buf_size = s->mdl_size % s->buf_size;
if (partial_buf_size) {
cx18_writel(cx, partial_buf_size,
&cx->scb->cpu_mdl[mdl_id + i - 1].length);
}
cx18_enqueue(s, mdl, &s->q_free);
else
cx18_push(s, mdl, &s->q_idle); /* not enough buffers */
} else {
/* Not enough buffers for this MDL; we won't use it */
cx18_push(s, mdl, &s->q_idle);
}
mdl_id += i;
}
}
Expand Down

0 comments on commit f86fdb9

Please sign in to comment.