aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18/cx18-dvb.c
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2008-11-05 19:19:15 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-30 06:38:01 -0500
commitf68d0cf56761128e85ebc98d8de4776b89c30279 (patch)
tree3c0af57cc1909728bef2397b2e9a58305fdea301 /drivers/media/video/cx18/cx18-dvb.c
parent13563f44a27a07dfade36662903037edbf8a6e01 (diff)
V4L/DVB (9592): cx18: Use default kernel work queue; fix streaming flag for work handler
cx18: Use default kernel work queue; fix streaming flag for work handler. Eliminate cx18 specific work queue and use the kernel default work queue. Fixed the F_STREAMING_FLAG for the TS stream so cx18_dvb_work_handler() can know when it is not safe to send MDLs to the firmware. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18/cx18-dvb.c')
-rw-r--r--drivers/media/video/cx18/cx18-dvb.c37
1 files changed, 21 insertions, 16 deletions
diff --git a/drivers/media/video/cx18/cx18-dvb.c b/drivers/media/video/cx18/cx18-dvb.c
index 4542e2e5e3d7..4845f732ef48 100644
--- a/drivers/media/video/cx18/cx18-dvb.c
+++ b/drivers/media/video/cx18/cx18-dvb.c
@@ -109,20 +109,23 @@ static int cx18_dvb_start_feed(struct dvb_demux_feed *feed)
109 if (!demux->dmx.frontend) 109 if (!demux->dmx.frontend)
110 return -EINVAL; 110 return -EINVAL;
111 111
112 if (stream) { 112 if (!stream)
113 mutex_lock(&stream->dvb.feedlock); 113 return -EINVAL;
114 if (stream->dvb.feeding++ == 0) { 114
115 CX18_DEBUG_INFO("Starting Transport DMA\n"); 115 mutex_lock(&stream->dvb.feedlock);
116 ret = cx18_start_v4l2_encode_stream(stream); 116 if (stream->dvb.feeding++ == 0) {
117 if (ret < 0) { 117 CX18_DEBUG_INFO("Starting Transport DMA\n");
118 CX18_DEBUG_INFO( 118 set_bit(CX18_F_S_STREAMING, &stream->s_flags);
119 "Failed to start Transport DMA\n"); 119 ret = cx18_start_v4l2_encode_stream(stream);
120 stream->dvb.feeding--; 120 if (ret < 0) {
121 } 121 CX18_DEBUG_INFO("Failed to start Transport DMA\n");
122 } else 122 stream->dvb.feeding--;
123 ret = 0; 123 if (stream->dvb.feeding == 0)
124 mutex_unlock(&stream->dvb.feedlock); 124 clear_bit(CX18_F_S_STREAMING, &stream->s_flags);
125 } 125 }
126 } else
127 ret = 0;
128 mutex_unlock(&stream->dvb.feedlock);
126 129
127 return ret; 130 return ret;
128} 131}
@@ -313,9 +316,11 @@ void cx18_dvb_work_handler(struct cx18 *cx)
313 dvb_dmx_swfilter(&s->dvb.demux, buf->buf, 316 dvb_dmx_swfilter(&s->dvb.demux, buf->buf,
314 buf->bytesused); 317 buf->bytesused);
315 318
316 cx18_enqueue(s, buf, &s->q_free);
317 cx18_buf_sync_for_device(s, buf); 319 cx18_buf_sync_for_device(s, buf);
318 if (s->handle == CX18_INVALID_TASK_HANDLE) /* FIXME: improve */ 320 cx18_enqueue(s, buf, &s->q_free);
321
322 if (s->handle == CX18_INVALID_TASK_HANDLE ||
323 !test_bit(CX18_F_S_STREAMING, &s->s_flags))
319 continue; 324 continue;
320 325
321 cx18_vapi(cx, CX18_CPU_DE_SET_MDL, 5, s->handle, 326 cx18_vapi(cx, CX18_CPU_DE_SET_MDL, 5, s->handle,