@@ -752,11 +752,8 @@ show_vframe_status(struct device *dev,
752752{
753753 int ret = 0 ;
754754 struct vframe_states states ;
755- struct vframe_provider_s * vfp ;
756755
757- vfp = vf_get_provider (VFM_NAME );
758- if (vfp && vfp -> ops && vfp -> ops -> vf_states )
759- ret = vfp -> ops -> vf_states (& states , vfp -> op_arg );
756+ ret = vf_get_states_by_name (VFM_NAME , & states );
760757
761758 if (ret == 0 ) {
762759 ret += sprintf (buf + ret , "vframe_pool_size=%d\n" ,
@@ -768,6 +765,7 @@ show_vframe_status(struct device *dev,
768765 ret += sprintf (buf + ret , "vframe buf_avail_num=%d\n" ,
769766 states .buf_avail_num );
770767 } else {
768+ ret = 0 ;
771769 ret += sprintf (buf + ret , "vframe no states\n" );
772770 }
773771
@@ -2181,7 +2179,10 @@ static int di_init_buf(int width, int height, unsigned char prog_flag)
21812179 di_post_mem = de_devp -> mem_start + di_buf_size * local_buf_num ;
21822180 di_post_buf_size = width * canvas_height * 2 ;
21832181 /* pre buffer must 2 more than post buffer */
2184- di_post_stru .di_post_num = local_buf_num - 2 ;
2182+ if ((local_buf_num - 2 ) > MAX_POST_BUF_NUM )
2183+ di_post_stru .di_post_num = MAX_POST_BUF_NUM ;
2184+ else
2185+ di_post_stru .di_post_num = (local_buf_num - 2 );
21852186 pr_info ("DI: di post buffer size %u byte.\n" , di_post_buf_size );
21862187 } else {
21872188 di_post_stru .di_post_num = MAX_POST_BUF_NUM ;
@@ -3440,9 +3441,14 @@ static void pre_de_done_buf_config(void)
34403441 }
34413442 }
34423443 } else if ((pldn_cmb0 == 6 ) && (pldn_cmb1 == 6 )) {
3443- di_pre_stru .di_post_wr_buf -> reg1_s = 60 ;
3444- di_pre_stru .di_post_wr_buf -> reg1_e = 180 ;
3445- di_pre_stru .di_post_wr_buf -> reg1_bmode = 0 ;
3444+ if (!IS_ERR_OR_NULL (
3445+ di_pre_stru .di_post_wr_buf )) {
3446+ di_pre_stru .di_post_wr_buf -> reg1_s = 60 ;
3447+ di_pre_stru .di_post_wr_buf -> reg1_e
3448+ = 180 ;
3449+ di_pre_stru .di_post_wr_buf -> reg1_bmode
3450+ = 0 ;
3451+ }
34463452 }
34473453 }
34483454 field_count ++ ;
@@ -3561,14 +3567,14 @@ static void pre_de_done_buf_config(void)
35613567 queue_in (
35623568 di_buf_tmp ,
35633569 QUEUE_PRE_READY );
3564- }
35653570#ifdef DI_BUFFER_DEBUG
35663571 di_print (
35673572 "%s: dummy %s[%d] => pre_ready_list\n" ,
35683573 __func__ ,
35693574 vframe_type_name [di_buf_tmp -> type ],
35703575 di_buf_tmp -> index );
35713576#endif
3577+ }
35723578 }
35733579 }
35743580 di_pre_stru .di_wr_buf -> seq =
@@ -3703,6 +3709,8 @@ static struct di_buf_s *get_free_linked_buf(int idx)
37033709 queue_out (di_buf_linked );
37043710 }
37053711 }
3712+ if (IS_ERR_OR_NULL (di_buf ))
3713+ return NULL ;
37063714 di_buf -> di_wr_linked_buf = di_buf_linked ;
37073715 }
37083716 return di_buf ;
@@ -4668,12 +4676,13 @@ static void inc_post_ref_count(struct di_buf_s *di_buf)
46684676{
46694677/* int post_blend_mode; */
46704678
4671- if (di_buf == NULL ) {
4679+ if (IS_ERR_OR_NULL ( di_buf ) ) {
46724680 pr_dbg ("%s: Error\n" , __func__ );
46734681 if (recovery_flag == 0 )
46744682 recovery_log_reason = 13 ;
46754683
46764684 recovery_flag ++ ;
4685+ return ;
46774686 }
46784687
46794688 if (di_buf -> di_buf_dup_p [1 ])
@@ -4688,12 +4697,13 @@ static void inc_post_ref_count(struct di_buf_s *di_buf)
46884697
46894698static void dec_post_ref_count (struct di_buf_s * di_buf )
46904699{
4691- if (di_buf == NULL ) {
4700+ if (IS_ERR_OR_NULL ( di_buf ) ) {
46924701 pr_dbg ("%s: Error\n" , __func__ );
46934702 if (recovery_flag == 0 )
46944703 recovery_log_reason = 14 ;
46954704
46964705 recovery_flag ++ ;
4706+ return ;
46974707 }
46984708 if (di_buf -> pulldown_mode == PULL_DOWN_BUF1 )
46994709 return ;
@@ -4966,7 +4976,7 @@ de_post_process(void *arg, unsigned int zoom_start_x_lines,
49664976 unsigned int zoom_end_y_lines , vframe_t * disp_vf )
49674977{
49684978 struct di_buf_s * di_buf = (struct di_buf_s * )arg ;
4969- struct di_buf_s * di_pldn_buf = di_buf -> di_buf_dup_p [ pldn_dly ] ;
4979+ struct di_buf_s * di_pldn_buf = NULL ;
49704980 unsigned int di_width , di_height , di_start_x , di_end_x ;
49714981 unsigned int di_start_y , di_end_y , hold_line = post_hold_line ;
49724982 unsigned int post_blend_en = 0 , post_blend_mode = 0 ,
@@ -4986,8 +4996,11 @@ de_post_process(void *arg, unsigned int zoom_start_x_lines,
49864996 ((force_update_post_reg & 0x10 ) == 0 ))
49874997 return 0 ;
49884998
4989- if ((di_buf == NULL ) || ( di_buf -> di_buf_dup_p [ 0 ] == NULL ))
4999+ if (IS_ERR_OR_NULL (di_buf ))
49905000 return 0 ;
5001+ else if (IS_ERR_OR_NULL (di_buf -> di_buf_dup_p [0 ]))
5002+ return 0 ;
5003+ di_pldn_buf = di_buf -> di_buf_dup_p [pldn_dly ];
49915004
49925005 if (di_post_stru .toggle_flag && di_buf -> di_buf_dup_p [1 ])
49935006 top_bot_config (di_buf -> di_buf_dup_p [1 ]);
@@ -6296,7 +6309,9 @@ static void di_rdma_irq(void *arg)
62966309{
62976310 struct di_dev_s * di_devp = (struct di_dev_s * )arg ;
62986311
6299- if (!di_devp || (di_devp -> rdma_handle <= 0 )) {
6312+ if (IS_ERR_OR_NULL (di_devp ))
6313+ return ;
6314+ if (di_devp -> rdma_handle <= 0 ) {
63006315 pr_err ("%s rdma handle %d error.\n" , __func__ ,
63016316 di_devp -> rdma_handle );
63026317 return ;
@@ -7054,6 +7069,7 @@ static vframe_t *di_vf_get(void *arg)
70547069 vframe_ret -> early_process_fun = NULL ;
70557070 vframe_ret -> process_fun = NULL ;
70567071 }
7072+ atomic_set (& di_buf -> di_cnt , 1 );
70577073 }
70587074 disp_frame_count ++ ;
70597075 if (run_flag == DI_RUN_FLAG_STEP )
@@ -7077,7 +7093,6 @@ static vframe_t *di_vf_get(void *arg)
70777093 vframe_ret -> early_process_fun (
70787094 vframe_ret -> private_data , vframe_ret );
70797095 }
7080- atomic_set (& di_buf -> di_cnt , 1 );
70817096 return vframe_ret ;
70827097}
70837098
0 commit comments