amlvideo2: fix record apk exit [1/1]
authorGuosong Zhou <guosong.zhou@amlogic.com>
Sat, 29 Dec 2018 08:25:55 +0000 (03:25 -0500)
committerTao Zeng <tao.zeng@amlogic.com>
Wed, 9 Jan 2019 11:12:02 +0000 (03:12 -0800)
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 <guosong.zhou@amlogic.com>
drivers/amlogic/media/video_processor/video_dev/amlvideo2.c

index 452d8ee..6beff5f 100644 (file)
@@ -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]->