static void cx18_stream_configure_mdls(struct cx18_stream *s) { cx18_unload_queues(s); switch (s->type) { case CX18_ENC_STREAM_TYPE_YUV: if (s->pixelformat == V4L2_PIX_FMT_HM12) s->mdl_size = 720 * s->cx->cxhdl.height * 3 / 2; else s->mdl_size = 720 * s->cx->cxhdl.height * 2; s->bufs_per_mdl = s->mdl_size / s->buf_size; if (s->mdl_size % s->buf_size) s->bufs_per_mdl++; 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 { 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: s->bufs_per_mdl = 1; s->mdl_size = s->buf_size * s->bufs_per_mdl; break; } cx18_load_queues(s); }
void cx18_out_work_handler(struct work_struct *work) { #else void cx18_out_work_handler(void *arg) { struct work_struct *work = arg; #endif struct cx18_stream *s = container_of(work, struct cx18_stream, out_work_order); _cx18_stream_load_fw_queue(s); } static void cx18_stream_configure_mdls(struct cx18_stream *s) { cx18_unload_queues(s); switch (s->type) { case CX18_ENC_STREAM_TYPE_YUV: /* * Height should be a multiple of 32 lines. * Set the MDL size to the exact size needed for one frame. * Use enough buffers per MDL to cover the MDL size */ s->mdl_size = 720 * s->cx->params.height * 3 / 2; s->bufs_per_mdl = s->mdl_size / s->buf_size; if (s->mdl_size % s->buf_size) s->bufs_per_mdl++; 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: s->bufs_per_mdl = 1; s->mdl_size = s->buf_size * s->bufs_per_mdl; break; } cx18_load_queues(s); }
static void cx18_stream_configure_mdls(struct cx18_stream *s) { cx18_unload_queues(s); switch (s->type) { case CX18_ENC_STREAM_TYPE_YUV: /* * Height should be a multiple of 32 lines. * Set the MDL size to the exact size needed for one frame. * Use enough buffers per MDL to cover the MDL size */ if (s->pixelformat == V4L2_PIX_FMT_HM12) s->mdl_size = 720 * s->cx->cxhdl.height * 3 / 2; else s->mdl_size = 720 * s->cx->cxhdl.height * 2; s->bufs_per_mdl = s->mdl_size / s->buf_size; if (s->mdl_size % s->buf_size) s->bufs_per_mdl++; 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: s->bufs_per_mdl = 1; s->mdl_size = s->buf_size * s->bufs_per_mdl; break; } cx18_load_queues(s); }