The patch number 9891 was added via Andy Walls <awa...@radix.net> to http://linuxtv.org/hg/v4l-dvb master development tree.
Kernel patches in this development tree may be modified to be backward compatible with older kernels. Compatibility modifications will be removed before inclusion into the mainstream Kernel If anyone has any objections, please let us know by sending a message to: v4l-dvb-maintai...@linuxtv.org ------ From: Andy Walls <awa...@radix.net> cx18 Replace magic number 63 with CX18_MAX_FW_MDLS_PER_STREAM Removed magic number that referred to firmware limit on the number of MDLs the firmware can maintain for any stream at any one time. Priority: normal Signed-off-by: Andy Walls <awa...@radix.net> --- linux/drivers/media/video/cx18/cx18-driver.h | 5 +++-- linux/drivers/media/video/cx18/cx18-queue.c | 5 +++-- linux/drivers/media/video/cx18/cx18-streams.c | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff -r eb855f5c9f38 -r a1b0c8a95ebb linux/drivers/media/video/cx18/cx18-driver.h --- a/linux/drivers/media/video/cx18/cx18-driver.h Sun Dec 14 09:28:07 2008 -0200 +++ b/linux/drivers/media/video/cx18/cx18-driver.h Sun Dec 14 16:52:12 2008 -0500 @@ -116,7 +116,7 @@ #define CX18_DEFAULT_ENC_PCM_BUFFERS 1 /* Maximum firmware DMA buffers per stream */ -#define CX18_MAX_MDLS_PER_STREAM 63 +#define CX18_MAX_FW_MDLS_PER_STREAM 63 /* DMA buffer, default size in kB allocated */ #define CX18_DEFAULT_ENC_TS_BUFSIZE 32 @@ -255,7 +255,8 @@ struct cx18_scb; /* forward reference */ #define CX18_MAX_MDL_ACKS 2 -#define CX18_MAX_EPU_WORK_ORDERS 70 /* CPU_DE_RELEASE_MDL bursts 63 commands */ +#define CX18_MAX_EPU_WORK_ORDERS (CX18_MAX_FW_MDLS_PER_STREAM + 7) +/* CPU_DE_RELEASE_MDL can burst CX18_MAX_FW_MDLS_PER_STREAM orders in a group */ #define CX18_F_EWO_MB_STALE_UPON_RECEIPT 0x1 #define CX18_F_EWO_MB_STALE_WHILE_PROC 0x2 diff -r eb855f5c9f38 -r a1b0c8a95ebb linux/drivers/media/video/cx18/cx18-queue.c --- a/linux/drivers/media/video/cx18/cx18-queue.c Sun Dec 14 09:28:07 2008 -0200 +++ b/linux/drivers/media/video/cx18/cx18-queue.c Sun Dec 14 16:52:12 2008 -0500 @@ -55,8 +55,9 @@ struct cx18_queue *_cx18_enqueue(struct mutex_lock(&s->qlock); - /* q_busy is restricted to 63 buffers to stay within firmware limits */ - if (q == &s->q_busy && atomic_read(&q->buffers) >= 63) + /* q_busy is restricted to a max buffer count imposed by firmware */ + if (q == &s->q_busy && + atomic_read(&q->buffers) >= CX18_MAX_FW_MDLS_PER_STREAM) q = &s->q_free; if (to_front) diff -r eb855f5c9f38 -r a1b0c8a95ebb linux/drivers/media/video/cx18/cx18-streams.c --- a/linux/drivers/media/video/cx18/cx18-streams.c Sun Dec 14 09:28:07 2008 -0200 +++ b/linux/drivers/media/video/cx18/cx18-streams.c Sun Dec 14 16:52:12 2008 -0500 @@ -425,7 +425,7 @@ void cx18_stream_load_fw_queue(struct cx struct cx18_buffer *buf; if (atomic_read(&s->q_free.buffers) == 0 || - atomic_read(&s->q_busy.buffers) >= 63) + atomic_read(&s->q_busy.buffers) >= CX18_MAX_FW_MDLS_PER_STREAM) return; /* Move from q_free to q_busy notifying the firmware, until the limit */ @@ -434,7 +434,8 @@ void cx18_stream_load_fw_queue(struct cx if (buf == NULL) break; q = cx18_stream_put_buf_fw(s, buf); - } while (atomic_read(&s->q_busy.buffers) < 63 && q == &s->q_busy); + } while (atomic_read(&s->q_busy.buffers) < CX18_MAX_FW_MDLS_PER_STREAM + && q == &s->q_busy); } int cx18_start_v4l2_encode_stream(struct cx18_stream *s) --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/a1b0c8a95ebb862a6a5ccbae4943ec0832c0335b _______________________________________________ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits