aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2009-11-10 22:22:57 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 15:41:53 -0500
commit127ce5f0adcca71eeeed2386ed4742ea6363a063 (patch)
tree2b41f1ed2a7abf484fbd9669562229ca7f02ef12 /drivers/media/video/cx18
parent1047a83844a4d894a068d94aca2d3efe54ac7a9c (diff)
V4L/DVB (13432): cx18: Adjust encoder VBI MDL size to be exactly frame's worth of VBI data
Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18')
-rw-r--r--drivers/media/video/cx18/cx18-driver.c4
-rw-r--r--drivers/media/video/cx18/cx18-driver.h1
-rw-r--r--drivers/media/video/cx18/cx18-streams.c16
3 files changed, 17 insertions, 4 deletions
diff --git a/drivers/media/video/cx18/cx18-driver.c b/drivers/media/video/cx18/cx18-driver.c
index 87a735f1ee9e..1a67ad5daad3 100644
--- a/drivers/media/video/cx18/cx18-driver.c
+++ b/drivers/media/video/cx18/cx18-driver.c
@@ -87,7 +87,6 @@ static int enc_ts_bufsize = CX18_DEFAULT_ENC_TS_BUFSIZE;
87static int enc_mpg_bufsize = CX18_DEFAULT_ENC_MPG_BUFSIZE; 87static int enc_mpg_bufsize = CX18_DEFAULT_ENC_MPG_BUFSIZE;
88static int enc_idx_bufsize = CX18_DEFAULT_ENC_IDX_BUFSIZE; 88static int enc_idx_bufsize = CX18_DEFAULT_ENC_IDX_BUFSIZE;
89static int enc_yuv_bufsize = CX18_DEFAULT_ENC_YUV_BUFSIZE; 89static int enc_yuv_bufsize = CX18_DEFAULT_ENC_YUV_BUFSIZE;
90/* VBI bufsize based on standards supported by card tuner for now */
91static int enc_pcm_bufsize = CX18_DEFAULT_ENC_PCM_BUFSIZE; 90static int enc_pcm_bufsize = CX18_DEFAULT_ENC_PCM_BUFSIZE;
92 91
93static int enc_ts_bufs = -1; 92static int enc_ts_bufs = -1;
@@ -128,7 +127,6 @@ module_param(enc_ts_bufsize, int, 0644);
128module_param(enc_mpg_bufsize, int, 0644); 127module_param(enc_mpg_bufsize, int, 0644);
129module_param(enc_idx_bufsize, int, 0644); 128module_param(enc_idx_bufsize, int, 0644);
130module_param(enc_yuv_bufsize, int, 0644); 129module_param(enc_yuv_bufsize, int, 0644);
131/* VBI bufsize based on standards supported by card tuner for now */
132module_param(enc_pcm_bufsize, int, 0644); 130module_param(enc_pcm_bufsize, int, 0644);
133 131
134module_param(enc_ts_bufs, int, 0644); 132module_param(enc_ts_bufs, int, 0644);
@@ -222,7 +220,7 @@ MODULE_PARM_DESC(enc_vbi_buffers,
222 "\t\t\tDefault: " __stringify(CX18_DEFAULT_ENC_VBI_BUFFERS)); 220 "\t\t\tDefault: " __stringify(CX18_DEFAULT_ENC_VBI_BUFFERS));
223MODULE_PARM_DESC(enc_vbi_bufs, 221MODULE_PARM_DESC(enc_vbi_bufs,
224 "Number of encoder VBI buffers\n" 222 "Number of encoder VBI buffers\n"
225 "\t\t\tDefault is computed from enc_vbi_buffers & tuner std"); 223 "\t\t\tDefault is computed from enc_vbi_buffers");
226MODULE_PARM_DESC(enc_pcm_buffers, 224MODULE_PARM_DESC(enc_pcm_buffers,
227 "Encoder PCM buffer memory (MB). (enc_pcm_bufs can override)\n" 225 "Encoder PCM buffer memory (MB). (enc_pcm_bufs can override)\n"
228 "\t\t\tDefault: " __stringify(CX18_DEFAULT_ENC_PCM_BUFFERS)); 226 "\t\t\tDefault: " __stringify(CX18_DEFAULT_ENC_PCM_BUFFERS));
diff --git a/drivers/media/video/cx18/cx18-driver.h b/drivers/media/video/cx18/cx18-driver.h
index 5c78b014dbc0..fe767b82c9a8 100644
--- a/drivers/media/video/cx18/cx18-driver.h
+++ b/drivers/media/video/cx18/cx18-driver.h
@@ -130,7 +130,6 @@
130#define CX18_DEFAULT_ENC_MPG_BUFSIZE 32 130#define CX18_DEFAULT_ENC_MPG_BUFSIZE 32
131#define CX18_DEFAULT_ENC_IDX_BUFSIZE 32 131#define CX18_DEFAULT_ENC_IDX_BUFSIZE 32
132#define CX18_DEFAULT_ENC_YUV_BUFSIZE (CX18_UNIT_ENC_YUV_BUFSIZE * 3 / 1024 + 1) 132#define CX18_DEFAULT_ENC_YUV_BUFSIZE (CX18_UNIT_ENC_YUV_BUFSIZE * 3 / 1024 + 1)
133/* Default VBI bufsize based on standards supported by card tuner for now */
134#define CX18_DEFAULT_ENC_PCM_BUFSIZE 4 133#define CX18_DEFAULT_ENC_PCM_BUFSIZE 4
135 134
136/* i2c stuff */ 135/* i2c stuff */
diff --git a/drivers/media/video/cx18/cx18-streams.c b/drivers/media/video/cx18/cx18-streams.c
index 7755937fc521..c398651dd74c 100644
--- a/drivers/media/video/cx18/cx18-streams.c
+++ b/drivers/media/video/cx18/cx18-streams.c
@@ -515,6 +515,22 @@ static void cx18_stream_configure_mdls(struct cx18_stream *s)
515 if (s->mdl_size % s->buf_size) 515 if (s->mdl_size % s->buf_size)
516 s->bufs_per_mdl++; 516 s->bufs_per_mdl++;
517 break; 517 break;
518 case CX18_ENC_STREAM_TYPE_VBI:
519 s->bufs_per_mdl = 1;
520 if (cx18_raw_vbi(s->cx)) {
521 s->mdl_size = (s->cx->is_60hz ? 12 : 18)
522 * 2 * vbi_active_samples;
523 } else {
524 /*
525 * See comment in cx18_vbi_setup() below about the
526 * extra lines we capture in sliced VBI mode due to
527 * the lines on which EAV RP codes toggle.
528 */
529 s->mdl_size = s->cx->is_60hz
530 ? (21 - 4 + 1) * 2 * vbi_hblank_samples_60Hz
531 : (23 - 2 + 1) * 2 * vbi_hblank_samples_50Hz;
532 }
533 break;
518 default: 534 default:
519 s->bufs_per_mdl = 1; 535 s->bufs_per_mdl = 1;
520 s->mdl_size = s->buf_size * s->bufs_per_mdl; 536 s->mdl_size = s->buf_size * s->bufs_per_mdl;