di: optimize di buf optimization
authorDezhi Kong <dezhi.kong@amlogic.com>
Wed, 7 Mar 2018 12:06:08 +0000 (20:06 +0800)
committerYixun Lan <yixun.lan@amlogic.com>
Tue, 3 Apr 2018 07:07:39 +0000 (23:07 -0800)
PD#161171: optimize di buf optimization

1.optimize di buf queue operation
2.add di task semaphone check

Change-Id: Ia60d1ebd57d839fb1783b1257d82300469038415
Signed-off-by: Dezhi Kong <dezhi.kong@amlogic.com>
drivers/amlogic/media/deinterlace/deinterlace.c

index a3e2e19..d6a5027 100644 (file)
@@ -2031,7 +2031,7 @@ static int di_init_buf(int width, int height, unsigned char prog_flag)
                                di_buf->canvas_config_flag = 2;
                        }
                        di_buf->index = i;
-                                       di_buf->vframe = &(vframe_local[i]);
+                       di_buf->vframe = &(vframe_local[i]);
                        di_buf->vframe->private_data = di_buf;
                        di_buf->vframe->canvas0Addr = di_buf->nr_canvas_idx;
                        di_buf->vframe->canvas1Addr = di_buf->nr_canvas_idx;
@@ -3550,11 +3550,11 @@ jiffies_to_msecs(jiffies_64 - vframe->ready_jiffies64));
                                        pr_err("DI:no free in_buffer for progressive skip.\n");
                                        return 0;
                                }
+                               queue_out(di_buf_tmp);
                                di_buf_tmp->vframe->private_data
                                        = di_buf_tmp;
                                di_buf_tmp->seq = di_pre_stru.in_seq;
                                di_pre_stru.in_seq++;
-                               queue_out(di_buf_tmp);
                                vframe_in[di_buf_tmp->index] = vframe;
                                memcpy(
                                        di_buf_tmp->vframe, vframe,
@@ -6113,6 +6113,8 @@ static int di_task_handle(void *data)
                return -1;
        while (1) {
                ret = down_interruptible(&di_sema);
+               if (ret != 0)
+                       continue;
                if (active_flag) {
                        if ((di_pre_stru.unreg_req_flag ||
                                di_pre_stru.force_unreg_req_flag ||
@@ -7640,9 +7642,9 @@ module_param_named(check_start_drop_prog, check_start_drop_prog, bool, 0664);
 module_param_named(overturn, overturn, bool, 0664);
 module_param_named(queue_print_flag, queue_print_flag, int, 0664);
 module_param_named(full_422_pack, full_422_pack, bool, 0644);
+module_param_named(cma_print, cma_print, bool, 0644);
 #ifdef DEBUG_SUPPORT
 module_param_named(pulldown_enable, pulldown_enable, bool, 0644);
-module_param_named(cma_print, cma_print, bool, 0644);
 #ifdef RUN_DI_PROCESS_IN_IRQ
 module_param_named(input2pre, input2pre, uint, 0664);
 module_param_named(input2pre_buf_miss_count, input2pre_buf_miss_count,