@@ -1776,6 +1776,8 @@ static int rkvpss_ofl_run(struct rkvpss_offline_dev *ofl,
17761776 if (!ret ) {
17771777 v4l2_err (& ofl -> v4l2_dev , "working timeout\n" );
17781778 ret = - EAGAIN ;
1779+ if (cfg -> input .dmabuf )
1780+ rkvpss_soft_reset (ofl -> hw );
17791781 } else {
17801782 ret = 0 ;
17811783 }
@@ -2397,6 +2399,28 @@ static void rkvpss_ofl_wrap_dvbm_deinit(struct rkvpss_offline_dev *ofl, int *id)
23972399 rkvpss_ofl_dvbm_deinit (ofl , * id );
23982400}
23992401
2402+ static void rkvpss_ofl_get_wrap_seq (struct rkvpss_offline_dev * ofl , int * seq )
2403+ {
2404+ struct rkvpss_hw_dev * hw = ofl -> hw ;
2405+ u32 mask , val ;
2406+
2407+ v4l2_dbg (4 , rkvpss_debug , & ofl -> v4l2_dev , "dev_id:%d\n" , * seq );
2408+
2409+ mask = RKVPSS_VPSS2ENC_SEL | RKVPSS2X_SENSOR_ID (7 );
2410+ val = RKVPSS_VPSS2ENC_SEL | RKVPSS2X_SENSOR_ID (* seq );
2411+ rkvpss_hw_set_bits (hw , RKVPSS_VPSS_CTRL , mask , val );
2412+
2413+ if (hw -> is_first ) {
2414+ hw -> is_first = false;
2415+ rkvpss_hw_write (hw , RKVPSS2X_VPSS2ENC_DEBUG , 0x1 );
2416+ v4l2_dbg (4 , rkvpss_debug , & ofl -> v4l2_dev , "wrap is first\n" );
2417+ }
2418+
2419+ * seq = RKVPSS2X_RO_VPSS2ENC_FRM_CNT (rkvpss_hw_read (ofl -> hw , RKVPSS2X_VPSS2ENC_DEBUG ));
2420+
2421+ v4l2_dbg (4 , rkvpss_debug , & ofl -> v4l2_dev , "hw frmame coount:%d\n" , * seq );
2422+ }
2423+
24002424long rkvpss_ofl_action (struct rkvpss_offline_dev * ofl ,
24012425 int file_id , unsigned int cmd , void * arg )
24022426{
@@ -2432,6 +2456,9 @@ long rkvpss_ofl_action(struct rkvpss_offline_dev *ofl,
24322456 case RKVPSS_CMD_WRAP_DVBM_DEINIT :
24332457 rkvpss_ofl_wrap_dvbm_deinit (ofl , arg );
24342458 break ;
2459+ case RKVPSS_CMD_GET_WRAP_SEQ :
2460+ rkvpss_ofl_get_wrap_seq (ofl , arg );
2461+ break ;
24352462 default :
24362463 ret = - EFAULT ;
24372464 }
0 commit comments