diff options
author | Andy Walls <awalls@radix.net> | 2008-12-14 16:52:12 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-30 06:39:07 -0500 |
commit | 0ef0289264e8f278312909f1639a7764cc9cf580 (patch) | |
tree | 8727d4d5d7519db50e8cd77e03b0d00892d35d76 | |
parent | 83c3a3c8b6a0e7a54ca9fa18b02c90e2d9a889f9 (diff) |
V4L/DVB (9891): 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.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/cx18/cx18-driver.h | 5 | ||||
-rw-r--r-- | drivers/media/video/cx18/cx18-queue.c | 5 | ||||
-rw-r--r-- | drivers/media/video/cx18/cx18-streams.c | 5 |
3 files changed, 9 insertions, 6 deletions
diff --git a/drivers/media/video/cx18/cx18-driver.h b/drivers/media/video/cx18/cx18-driver.h index 018d98f94f97..0d2edebc39b4 100644 --- a/drivers/media/video/cx18/cx18-driver.h +++ b/drivers/media/video/cx18/cx18-driver.h | |||
@@ -116,7 +116,7 @@ | |||
116 | #define CX18_DEFAULT_ENC_PCM_BUFFERS 1 | 116 | #define CX18_DEFAULT_ENC_PCM_BUFFERS 1 |
117 | 117 | ||
118 | /* Maximum firmware DMA buffers per stream */ | 118 | /* Maximum firmware DMA buffers per stream */ |
119 | #define CX18_MAX_MDLS_PER_STREAM 63 | 119 | #define CX18_MAX_FW_MDLS_PER_STREAM 63 |
120 | 120 | ||
121 | /* DMA buffer, default size in kB allocated */ | 121 | /* DMA buffer, default size in kB allocated */ |
122 | #define CX18_DEFAULT_ENC_TS_BUFSIZE 32 | 122 | #define CX18_DEFAULT_ENC_TS_BUFSIZE 32 |
@@ -255,7 +255,8 @@ struct cx18_scb; /* forward reference */ | |||
255 | 255 | ||
256 | 256 | ||
257 | #define CX18_MAX_MDL_ACKS 2 | 257 | #define CX18_MAX_MDL_ACKS 2 |
258 | #define CX18_MAX_EPU_WORK_ORDERS 70 /* CPU_DE_RELEASE_MDL bursts 63 commands */ | 258 | #define CX18_MAX_EPU_WORK_ORDERS (CX18_MAX_FW_MDLS_PER_STREAM + 7) |
259 | /* CPU_DE_RELEASE_MDL can burst CX18_MAX_FW_MDLS_PER_STREAM orders in a group */ | ||
259 | 260 | ||
260 | #define CX18_F_EWO_MB_STALE_UPON_RECEIPT 0x1 | 261 | #define CX18_F_EWO_MB_STALE_UPON_RECEIPT 0x1 |
261 | #define CX18_F_EWO_MB_STALE_WHILE_PROC 0x2 | 262 | #define CX18_F_EWO_MB_STALE_WHILE_PROC 0x2 |
diff --git a/drivers/media/video/cx18/cx18-queue.c b/drivers/media/video/cx18/cx18-queue.c index a6b0666f0ba3..2c58b0c478c0 100644 --- a/drivers/media/video/cx18/cx18-queue.c +++ b/drivers/media/video/cx18/cx18-queue.c | |||
@@ -55,8 +55,9 @@ struct cx18_queue *_cx18_enqueue(struct cx18_stream *s, struct cx18_buffer *buf, | |||
55 | 55 | ||
56 | mutex_lock(&s->qlock); | 56 | mutex_lock(&s->qlock); |
57 | 57 | ||
58 | /* q_busy is restricted to 63 buffers to stay within firmware limits */ | 58 | /* q_busy is restricted to a max buffer count imposed by firmware */ |
59 | if (q == &s->q_busy && atomic_read(&q->buffers) >= 63) | 59 | if (q == &s->q_busy && |
60 | atomic_read(&q->buffers) >= CX18_MAX_FW_MDLS_PER_STREAM) | ||
60 | q = &s->q_free; | 61 | q = &s->q_free; |
61 | 62 | ||
62 | if (to_front) | 63 | if (to_front) |
diff --git a/drivers/media/video/cx18/cx18-streams.c b/drivers/media/video/cx18/cx18-streams.c index 985bad89f311..8fc655d3ced9 100644 --- a/drivers/media/video/cx18/cx18-streams.c +++ b/drivers/media/video/cx18/cx18-streams.c | |||
@@ -425,7 +425,7 @@ void cx18_stream_load_fw_queue(struct cx18_stream *s) | |||
425 | struct cx18_buffer *buf; | 425 | struct cx18_buffer *buf; |
426 | 426 | ||
427 | if (atomic_read(&s->q_free.buffers) == 0 || | 427 | if (atomic_read(&s->q_free.buffers) == 0 || |
428 | atomic_read(&s->q_busy.buffers) >= 63) | 428 | atomic_read(&s->q_busy.buffers) >= CX18_MAX_FW_MDLS_PER_STREAM) |
429 | return; | 429 | return; |
430 | 430 | ||
431 | /* Move from q_free to q_busy notifying the firmware, until the limit */ | 431 | /* Move from q_free to q_busy notifying the firmware, until the limit */ |
@@ -434,7 +434,8 @@ void cx18_stream_load_fw_queue(struct cx18_stream *s) | |||
434 | if (buf == NULL) | 434 | if (buf == NULL) |
435 | break; | 435 | break; |
436 | q = cx18_stream_put_buf_fw(s, buf); | 436 | q = cx18_stream_put_buf_fw(s, buf); |
437 | } while (atomic_read(&s->q_busy.buffers) < 63 && q == &s->q_busy); | 437 | } while (atomic_read(&s->q_busy.buffers) < CX18_MAX_FW_MDLS_PER_STREAM |
438 | && q == &s->q_busy); | ||
438 | } | 439 | } |
439 | 440 | ||
440 | int cx18_start_v4l2_encode_stream(struct cx18_stream *s) | 441 | int cx18_start_v4l2_encode_stream(struct cx18_stream *s) |