aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/cx18/cx18-mailbox.c1
-rw-r--r--drivers/media/video/cx18/cx18-streams.c10
-rw-r--r--drivers/media/video/cx18/cx23418.h2
3 files changed, 12 insertions, 1 deletions
diff --git a/drivers/media/video/cx18/cx18-mailbox.c b/drivers/media/video/cx18/cx18-mailbox.c
index 93177514e846..1b9fbf9a6bc5 100644
--- a/drivers/media/video/cx18/cx18-mailbox.c
+++ b/drivers/media/video/cx18/cx18-mailbox.c
@@ -82,6 +82,7 @@ static const struct cx18_api_info api_info[] = {
82 API_ENTRY(CPU, CX18_CPU_DE_SET_MDL_ACK, 0), 82 API_ENTRY(CPU, CX18_CPU_DE_SET_MDL_ACK, 0),
83 API_ENTRY(CPU, CX18_CPU_DE_SET_MDL, API_FAST), 83 API_ENTRY(CPU, CX18_CPU_DE_SET_MDL, API_FAST),
84 API_ENTRY(CPU, CX18_APU_RESETAI, API_FAST), 84 API_ENTRY(CPU, CX18_APU_RESETAI, API_FAST),
85 API_ENTRY(CPU, CX18_CPU_DE_RELEASE_MDL, 0),
85 API_ENTRY(0, 0, 0), 86 API_ENTRY(0, 0, 0),
86}; 87};
87 88
diff --git a/drivers/media/video/cx18/cx18-streams.c b/drivers/media/video/cx18/cx18-streams.c
index 53c5852bba37..4d5b446895cb 100644
--- a/drivers/media/video/cx18/cx18-streams.c
+++ b/drivers/media/video/cx18/cx18-streams.c
@@ -488,7 +488,14 @@ int cx18_start_v4l2_encode_stream(struct cx18_stream *s)
488 /* begin_capture */ 488 /* begin_capture */
489 if (cx18_vapi(cx, CX18_CPU_CAPTURE_START, 1, s->handle)) { 489 if (cx18_vapi(cx, CX18_CPU_CAPTURE_START, 1, s->handle)) {
490 CX18_DEBUG_WARN("Error starting capture!\n"); 490 CX18_DEBUG_WARN("Error starting capture!\n");
491 /* Ensure we're really not capturing before releasing MDLs */
492 if (s->type == CX18_ENC_STREAM_TYPE_MPG)
493 cx18_vapi(cx, CX18_CPU_CAPTURE_STOP, 2, s->handle, 1);
494 else
495 cx18_vapi(cx, CX18_CPU_CAPTURE_STOP, 1, s->handle);
496 cx18_vapi(cx, CX18_CPU_DE_RELEASE_MDL, 1, s->handle);
491 cx18_vapi(cx, CX18_DESTROY_TASK, 1, s->handle); 497 cx18_vapi(cx, CX18_DESTROY_TASK, 1, s->handle);
498 /* FIXME - clean-up DSP0_INT mask, i_flags, s_flags, etc. */
492 return -EINVAL; 499 return -EINVAL;
493 } 500 }
494 501
@@ -540,6 +547,9 @@ int cx18_stop_v4l2_encode_stream(struct cx18_stream *s, int gop_end)
540 CX18_INFO("ignoring gop_end: not (yet?) supported by the firmware\n"); 547 CX18_INFO("ignoring gop_end: not (yet?) supported by the firmware\n");
541 } 548 }
542 549
550 /* Tell the CX23418 it can't use our buffers anymore */
551 cx18_vapi(cx, CX18_CPU_DE_RELEASE_MDL, 1, s->handle);
552
543 if (s->type != CX18_ENC_STREAM_TYPE_TS) 553 if (s->type != CX18_ENC_STREAM_TYPE_TS)
544 atomic_dec(&cx->ana_capturing); 554 atomic_dec(&cx->ana_capturing);
545 atomic_dec(&cx->tot_capturing); 555 atomic_dec(&cx->tot_capturing);
diff --git a/drivers/media/video/cx18/cx23418.h b/drivers/media/video/cx18/cx23418.h
index e7ed053059a8..668f968d7761 100644
--- a/drivers/media/video/cx18/cx23418.h
+++ b/drivers/media/video/cx18/cx23418.h
@@ -351,7 +351,7 @@
351 Descriptor Lists to the driver 351 Descriptor Lists to the driver
352 IN[0] - Task handle. Handle of the task to start 352 IN[0] - Task handle. Handle of the task to start
353 ReturnCode - One of the ERR_DE_... */ 353 ReturnCode - One of the ERR_DE_... */
354/* #define CX18_CPU_DE_ReleaseMDL (CPU_CMD_MASK_DE | 0x0006) */ 354#define CX18_CPU_DE_RELEASE_MDL (CPU_CMD_MASK_DE | 0x0006)
355 355
356/* Description: This command signals the cpu that the dat buffer has been 356/* Description: This command signals the cpu that the dat buffer has been
357 consumed and ready for re-use. 357 consumed and ready for re-use.