Commit 127ce5f0 authored by Andy Walls's avatar Andy Walls Committed by Mauro Carvalho Chehab

V4L/DVB (13432): cx18: Adjust encoder VBI MDL size to be exactly frame's worth of VBI data

Signed-off-by: default avatarAndy Walls <awalls@radix.net>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 1047a838
...@@ -87,7 +87,6 @@ static int enc_ts_bufsize = CX18_DEFAULT_ENC_TS_BUFSIZE; ...@@ -87,7 +87,6 @@ static int enc_ts_bufsize = CX18_DEFAULT_ENC_TS_BUFSIZE;
static int enc_mpg_bufsize = CX18_DEFAULT_ENC_MPG_BUFSIZE; static int enc_mpg_bufsize = CX18_DEFAULT_ENC_MPG_BUFSIZE;
static int enc_idx_bufsize = CX18_DEFAULT_ENC_IDX_BUFSIZE; static int enc_idx_bufsize = CX18_DEFAULT_ENC_IDX_BUFSIZE;
static int enc_yuv_bufsize = CX18_DEFAULT_ENC_YUV_BUFSIZE; static int enc_yuv_bufsize = CX18_DEFAULT_ENC_YUV_BUFSIZE;
/* VBI bufsize based on standards supported by card tuner for now */
static int enc_pcm_bufsize = CX18_DEFAULT_ENC_PCM_BUFSIZE; static int enc_pcm_bufsize = CX18_DEFAULT_ENC_PCM_BUFSIZE;
static int enc_ts_bufs = -1; static int enc_ts_bufs = -1;
...@@ -128,7 +127,6 @@ module_param(enc_ts_bufsize, int, 0644); ...@@ -128,7 +127,6 @@ module_param(enc_ts_bufsize, int, 0644);
module_param(enc_mpg_bufsize, int, 0644); module_param(enc_mpg_bufsize, int, 0644);
module_param(enc_idx_bufsize, int, 0644); module_param(enc_idx_bufsize, int, 0644);
module_param(enc_yuv_bufsize, int, 0644); module_param(enc_yuv_bufsize, int, 0644);
/* VBI bufsize based on standards supported by card tuner for now */
module_param(enc_pcm_bufsize, int, 0644); module_param(enc_pcm_bufsize, int, 0644);
module_param(enc_ts_bufs, int, 0644); module_param(enc_ts_bufs, int, 0644);
...@@ -222,7 +220,7 @@ MODULE_PARM_DESC(enc_vbi_buffers, ...@@ -222,7 +220,7 @@ MODULE_PARM_DESC(enc_vbi_buffers,
"\t\t\tDefault: " __stringify(CX18_DEFAULT_ENC_VBI_BUFFERS)); "\t\t\tDefault: " __stringify(CX18_DEFAULT_ENC_VBI_BUFFERS));
MODULE_PARM_DESC(enc_vbi_bufs, MODULE_PARM_DESC(enc_vbi_bufs,
"Number of encoder VBI buffers\n" "Number of encoder VBI buffers\n"
"\t\t\tDefault is computed from enc_vbi_buffers & tuner std"); "\t\t\tDefault is computed from enc_vbi_buffers");
MODULE_PARM_DESC(enc_pcm_buffers, MODULE_PARM_DESC(enc_pcm_buffers,
"Encoder PCM buffer memory (MB). (enc_pcm_bufs can override)\n" "Encoder PCM buffer memory (MB). (enc_pcm_bufs can override)\n"
"\t\t\tDefault: " __stringify(CX18_DEFAULT_ENC_PCM_BUFFERS)); "\t\t\tDefault: " __stringify(CX18_DEFAULT_ENC_PCM_BUFFERS));
......
...@@ -130,7 +130,6 @@ ...@@ -130,7 +130,6 @@
#define CX18_DEFAULT_ENC_MPG_BUFSIZE 32 #define CX18_DEFAULT_ENC_MPG_BUFSIZE 32
#define CX18_DEFAULT_ENC_IDX_BUFSIZE 32 #define CX18_DEFAULT_ENC_IDX_BUFSIZE 32
#define CX18_DEFAULT_ENC_YUV_BUFSIZE (CX18_UNIT_ENC_YUV_BUFSIZE * 3 / 1024 + 1) #define CX18_DEFAULT_ENC_YUV_BUFSIZE (CX18_UNIT_ENC_YUV_BUFSIZE * 3 / 1024 + 1)
/* Default VBI bufsize based on standards supported by card tuner for now */
#define CX18_DEFAULT_ENC_PCM_BUFSIZE 4 #define CX18_DEFAULT_ENC_PCM_BUFSIZE 4
/* i2c stuff */ /* i2c stuff */
......
...@@ -515,6 +515,22 @@ static void cx18_stream_configure_mdls(struct cx18_stream *s) ...@@ -515,6 +515,22 @@ static void cx18_stream_configure_mdls(struct cx18_stream *s)
if (s->mdl_size % s->buf_size) if (s->mdl_size % s->buf_size)
s->bufs_per_mdl++; s->bufs_per_mdl++;
break; break;
case CX18_ENC_STREAM_TYPE_VBI:
s->bufs_per_mdl = 1;
if (cx18_raw_vbi(s->cx)) {
s->mdl_size = (s->cx->is_60hz ? 12 : 18)
* 2 * vbi_active_samples;
} else {
/*
* See comment in cx18_vbi_setup() below about the
* extra lines we capture in sliced VBI mode due to
* the lines on which EAV RP codes toggle.
*/
s->mdl_size = s->cx->is_60hz
? (21 - 4 + 1) * 2 * vbi_hblank_samples_60Hz
: (23 - 2 + 1) * 2 * vbi_hblank_samples_50Hz;
}
break;
default: default:
s->bufs_per_mdl = 1; s->bufs_per_mdl = 1;
s->mdl_size = s->buf_size * s->bufs_per_mdl; s->mdl_size = s->buf_size * s->bufs_per_mdl;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment