From 003b68f23d607074d37f15044a7b978a412ff300 Mon Sep 17 00:00:00 2001 From: Guosong Zhou Date: Sat, 29 Dec 2018 03:25:55 -0500 Subject: [PATCH] amlvideo2: fix record apk exit [1/1] PD#SWPL-209 Problem: record apk exit when recording Solution: set right start vdin flag Verify: test pass on P321 Change-Id: I0130b5a898392d75d500987f8087dbe9ab778372 Signed-off-by: Guosong Zhou --- .../media/video_processor/video_dev/amlvideo2.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/amlogic/media/video_processor/video_dev/amlvideo2.c b/drivers/amlogic/media/video_processor/video_dev/amlvideo2.c index 452d8ee8a9d4..6beff5fa6c80 100644 --- a/drivers/amlogic/media/video_processor/video_dev/amlvideo2.c +++ b/drivers/amlogic/media/video_processor/video_dev/amlvideo2.c @@ -4720,7 +4720,6 @@ static int amlvideo2_stop_tvin_service(struct amlvideo2_node *node) vops->stop_tvin_service(node->vdin_device_num); } - node->start_vdin_flag = 0; return ret; } @@ -4734,7 +4733,7 @@ static int amlvideo2_start_tvin_service(struct amlvideo2_node *node) vinfo = get_current_vinfo(); - if ((!node->start_vdin_flag) || (node->r_type != AML_RECEIVER_NONE)) + if (node->r_type != AML_RECEIVER_NONE) goto start; if (amlvideo2_dbg_en) @@ -4883,7 +4882,7 @@ int amlvideo2_notify_callback(struct notifier_block *block, unsigned long cmd, /* if local queue have vf , should give back to provider */ if (vfq_empty(&node->q_ready)) { - if (amlvideo2_dbg_en) + if (amlvideo2_dbg_en & 4) pr_info("q_ready is empty .\n"); } else { recycle_vf = vfq_pop(&node->q_ready); @@ -4891,12 +4890,12 @@ int amlvideo2_notify_callback(struct notifier_block *block, unsigned long cmd, vf_put(recycle_vf, node->recv.name); recycle_vf = vfq_pop(&node->q_ready); } - if (amlvideo2_dbg_en) + if (amlvideo2_dbg_en & 4) pr_info("already flush local vf .\n"); } /*debug provider vf state*/ - if (amlvideo2_dbg_en) { + if (amlvideo2_dbg_en & 4) { ret = vf_get_states(vfp, &states); if (ret == 0) { pr_info("vf_pool_size = %d, buf_free_num = %d .\n", @@ -4914,7 +4913,7 @@ int amlvideo2_notify_callback(struct notifier_block *block, unsigned long cmd, if (node->r_type == AML_RECEIVER_NONE) amlvideo2_start_thread(node->fh); - msleep(500); + ret = amlvideo2_start_tvin_service(node); if (ret < 0) { @@ -5354,7 +5353,7 @@ int amlvideo2_cma_buf_init(struct amlvideo2_device *vid_dev, int node_id) return -1; } } else { - flags = CODEC_MM_FLAGS_DMA_CPU| + flags = CODEC_MM_FLAGS_DMA | CODEC_MM_FLAGS_CMA_CLEAR; if (node_id == 0) { if (vid_dev->node[node_id]->