@@ -752,11 +752,8 @@ show_vframe_status(struct device *dev,
752
752
{
753
753
int ret = 0 ;
754
754
struct vframe_states states ;
755
- struct vframe_provider_s * vfp ;
756
755
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 );
760
757
761
758
if (ret == 0 ) {
762
759
ret += sprintf (buf + ret , "vframe_pool_size=%d\n" ,
@@ -768,6 +765,7 @@ show_vframe_status(struct device *dev,
768
765
ret += sprintf (buf + ret , "vframe buf_avail_num=%d\n" ,
769
766
states .buf_avail_num );
770
767
} else {
768
+ ret = 0 ;
771
769
ret += sprintf (buf + ret , "vframe no states\n" );
772
770
}
773
771
@@ -2181,7 +2179,10 @@ static int di_init_buf(int width, int height, unsigned char prog_flag)
2181
2179
di_post_mem = de_devp -> mem_start + di_buf_size * local_buf_num ;
2182
2180
di_post_buf_size = width * canvas_height * 2 ;
2183
2181
/* 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 );
2185
2186
pr_info ("DI: di post buffer size %u byte.\n" , di_post_buf_size );
2186
2187
} else {
2187
2188
di_post_stru .di_post_num = MAX_POST_BUF_NUM ;
@@ -3440,9 +3441,14 @@ static void pre_de_done_buf_config(void)
3440
3441
}
3441
3442
}
3442
3443
} 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
+ }
3446
3452
}
3447
3453
}
3448
3454
field_count ++ ;
@@ -3561,14 +3567,14 @@ static void pre_de_done_buf_config(void)
3561
3567
queue_in (
3562
3568
di_buf_tmp ,
3563
3569
QUEUE_PRE_READY );
3564
- }
3565
3570
#ifdef DI_BUFFER_DEBUG
3566
3571
di_print (
3567
3572
"%s: dummy %s[%d] => pre_ready_list\n" ,
3568
3573
__func__ ,
3569
3574
vframe_type_name [di_buf_tmp -> type ],
3570
3575
di_buf_tmp -> index );
3571
3576
#endif
3577
+ }
3572
3578
}
3573
3579
}
3574
3580
di_pre_stru .di_wr_buf -> seq =
@@ -3703,6 +3709,8 @@ static struct di_buf_s *get_free_linked_buf(int idx)
3703
3709
queue_out (di_buf_linked );
3704
3710
}
3705
3711
}
3712
+ if (IS_ERR_OR_NULL (di_buf ))
3713
+ return NULL ;
3706
3714
di_buf -> di_wr_linked_buf = di_buf_linked ;
3707
3715
}
3708
3716
return di_buf ;
@@ -4668,12 +4676,13 @@ static void inc_post_ref_count(struct di_buf_s *di_buf)
4668
4676
{
4669
4677
/* int post_blend_mode; */
4670
4678
4671
- if (di_buf == NULL ) {
4679
+ if (IS_ERR_OR_NULL ( di_buf ) ) {
4672
4680
pr_dbg ("%s: Error\n" , __func__ );
4673
4681
if (recovery_flag == 0 )
4674
4682
recovery_log_reason = 13 ;
4675
4683
4676
4684
recovery_flag ++ ;
4685
+ return ;
4677
4686
}
4678
4687
4679
4688
if (di_buf -> di_buf_dup_p [1 ])
@@ -4688,12 +4697,13 @@ static void inc_post_ref_count(struct di_buf_s *di_buf)
4688
4697
4689
4698
static void dec_post_ref_count (struct di_buf_s * di_buf )
4690
4699
{
4691
- if (di_buf == NULL ) {
4700
+ if (IS_ERR_OR_NULL ( di_buf ) ) {
4692
4701
pr_dbg ("%s: Error\n" , __func__ );
4693
4702
if (recovery_flag == 0 )
4694
4703
recovery_log_reason = 14 ;
4695
4704
4696
4705
recovery_flag ++ ;
4706
+ return ;
4697
4707
}
4698
4708
if (di_buf -> pulldown_mode == PULL_DOWN_BUF1 )
4699
4709
return ;
@@ -4966,7 +4976,7 @@ de_post_process(void *arg, unsigned int zoom_start_x_lines,
4966
4976
unsigned int zoom_end_y_lines , vframe_t * disp_vf )
4967
4977
{
4968
4978
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 ;
4970
4980
unsigned int di_width , di_height , di_start_x , di_end_x ;
4971
4981
unsigned int di_start_y , di_end_y , hold_line = post_hold_line ;
4972
4982
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,
4986
4996
((force_update_post_reg & 0x10 ) == 0 ))
4987
4997
return 0 ;
4988
4998
4989
- if ((di_buf == NULL ) || ( di_buf -> di_buf_dup_p [ 0 ] == NULL ))
4999
+ if (IS_ERR_OR_NULL (di_buf ))
4990
5000
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 ];
4991
5004
4992
5005
if (di_post_stru .toggle_flag && di_buf -> di_buf_dup_p [1 ])
4993
5006
top_bot_config (di_buf -> di_buf_dup_p [1 ]);
@@ -6296,7 +6309,9 @@ static void di_rdma_irq(void *arg)
6296
6309
{
6297
6310
struct di_dev_s * di_devp = (struct di_dev_s * )arg ;
6298
6311
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 ) {
6300
6315
pr_err ("%s rdma handle %d error.\n" , __func__ ,
6301
6316
di_devp -> rdma_handle );
6302
6317
return ;
@@ -7054,6 +7069,7 @@ static vframe_t *di_vf_get(void *arg)
7054
7069
vframe_ret -> early_process_fun = NULL ;
7055
7070
vframe_ret -> process_fun = NULL ;
7056
7071
}
7072
+ atomic_set (& di_buf -> di_cnt , 1 );
7057
7073
}
7058
7074
disp_frame_count ++ ;
7059
7075
if (run_flag == DI_RUN_FLAG_STEP )
@@ -7077,7 +7093,6 @@ static vframe_t *di_vf_get(void *arg)
7077
7093
vframe_ret -> early_process_fun (
7078
7094
vframe_ret -> private_data , vframe_ret );
7079
7095
}
7080
- atomic_set (& di_buf -> di_cnt , 1 );
7081
7096
return vframe_ret ;
7082
7097
}
7083
7098
0 commit comments