From f9c116f912ce0116b4803efbc099d2745ff9770f Mon Sep 17 00:00:00 2001 From: Tony Kim Date: Fri, 30 Apr 2021 20:56:59 +0900 Subject: [PATCH] [SKB-AI2 MAX] UHD aging debug6 patch --- amp/src/ddl/dmx/comp/core/inc/dmx_stream.h | 8 ++++ .../vcodec/comp_vdec/source/internal_vdec_api.c | 52 ++++++++++++++++++++++ 2 files changed, 60 insertions(+) diff --git a/amp/src/ddl/dmx/comp/core/inc/dmx_stream.h b/amp/src/ddl/dmx/comp/core/inc/dmx_stream.h index 9a4e38c..99a190e 100755 --- a/amp/src/ddl/dmx/comp/core/inc/dmx_stream.h +++ b/amp/src/ddl/dmx/comp/core/inc/dmx_stream.h @@ -52,9 +52,17 @@ #include "dmx_al_cnn.h" /**< Below default size defined for DMX stream buffer*/ +#if 1 //tony debug +#define DMX_STRM_VES_BUF_SIZE (16*1024*1024) /*For video channel*/ +#else #define DMX_STRM_VES_BUF_SIZE (8*1024*1024) /*For video channel*/ +#endif #define DMX_STRM_VES_SMALLBUF_SIZE (4*1024*1024) /*For video channel*/ +#if 1 +#define DMX_STRM_VES_BUF_PADDINGSIZE (4*1024*1024) +#else #define DMX_STRM_VES_BUF_PADDINGSIZE (64*1024) +#endif #define DMX_STRM_VES_BIGBUF_PADDINGSIZE (2*1024*1024) #define DMX_STRM_AES_BUF_SIZE (512*1024) /*For audio channel*/ #define DMX_STRM_AES_BUF_PADDINGSIZE (4*1024) diff --git a/amp/src/ddl/vcodec/comp_vdec/source/internal_vdec_api.c b/amp/src/ddl/vcodec/comp_vdec/source/internal_vdec_api.c index fc0a083..b2d59ac 100755 --- a/amp/src/ddl/vcodec/comp_vdec/source/internal_vdec_api.c +++ b/amp/src/ddl/vcodec/comp_vdec/source/internal_vdec_api.c @@ -5859,6 +5859,7 @@ HRESULT decode_video(VDecoder *pVDec) { VMETA_CBLOCK *pCblk = pVDec->pStrmCtrlBlock->pVir; MV_UNUSED(pCblk); + VDECPRT("tony trace inside decode_stream_main_loop - 2-1. enter decode_video() \n", __LINE__); if (pHalDecoder->check_strm_buffer && (pVDec->bInFlush == false) && (pCblk->uFrameInMode == FRAME_IN_NO_32B_ALIGN) @@ -5893,6 +5894,7 @@ HRESULT decode_video(VDecoder *pVDec) { return SUCCESS; VdecAssertReturn(hRet); + VDECPRT("tony trace inside decode_stream_main_loop - 2-2. before pHalDecoder->decode_stream() \n", __LINE__); while (1) { int dret = 0; int ud; @@ -5909,6 +5911,7 @@ HRESULT decode_video(VDecoder *pVDec) { VDEC_LOGE("%p: pHalDecode recoverable error=%d, continue to decode", pVDec, dret); } + VDECPRT("tony trace inside decode_stream_main_loop - 2-3. before waitIRQ() \n", __LINE__); if(pHalDecoder->waitIRQ){ if (pVdecStrmStatus->wait_for_int) { //VDECPRT("%p:before Int\n", pVDec); @@ -5919,6 +5922,7 @@ HRESULT decode_video(VDecoder *pVDec) { } } + VDECPRT("tony trace inside decode_stream_main_loop - 2-4. after waitIRQ() \n", __LINE__); performance_monitor(pVDec, pVdecStrmStatus, ud); #ifndef TRUSTZONE if((pVdecStrmStatus->event_id == VDEC_EVENT_SYNCWORD) && (pCblk->uiUserDataMask != 0)){ @@ -5948,6 +5952,7 @@ HRESULT decode_video(VDecoder *pVDec) { break; } + VDECPRT("tony trace inside decode_stream_main_loop - 2-5. if we reach here.... () \n", __LINE__); // if we reach here, // 1) One frame decoding finished, switch point comes // 2) VDEC_EVENT_ALLOC_STR_BUF @@ -6423,6 +6428,7 @@ INT decode_stream_main_loop(VDecoder *pVDec) { SETSTATE(pVDec->eState, VDEC_STATE_WAIT_INPUT_BUFFER); return 0; } + VDECPRT("tony trace inside decode_stream_main_loop - 1. after VDEC_STATE_WAIT_INPUT_BUFFER \n", __LINE__); if (pVDec->uiDecodedIndex > 0) { // judge the display buffer number, in case the VDEC_EVENT_ALLOC_DIS_BUF event unsigned int uNum; @@ -6432,20 +6438,24 @@ INT decode_stream_main_loop(VDecoder *pVDec) { return 0; } } + VDECPRT("tony trace inside decode_stream_main_loop - 2. after VDEC_STATE_WAIT_OUTPUT_BUFFER \n", __LINE__); if (decode_video(pVDec) != SUCCESS) break; + VDECPRT("tony trace inside decode_stream_main_loop - 3. after decode_video \n", __LINE__); msg.m_MsgID = CMD_NONE; while (MV_CC_MsgQ_TryGetMsg(pVDec->hDecodeMsgQueue, &msg) == S_OK) { AMP_ASSERT(msg.m_MsgID != (UINT32) CMD_NONE); if (msg.m_MsgID == CMD_FREEZE) { msg.m_Param2 = TRUE; VDECLOGIFERR(MV_CC_MsgQ_PostMsg(pVDec->hDecodeMsgQueue, &msg)); + VDECPRT("tony trace inside decode_stream_main_loop - 4. hDecodeMsgQueue \n", __LINE__); return 0; } decode_stream_process_msg(pVDec, &msg); if (msg.m_MsgID == CMD_TERMINATE) { VDECPRT("%p Exit Decode task\n", pVDec); + VDECPRT("tony trace inside decode_stream_main_loop : 5. CMD_TERMINATE proceeded \n", __LINE__); return -1; } msg.m_MsgID = CMD_NONE; @@ -6547,6 +6557,42 @@ VOID VideoStatusProcess(VOID *hVDec) { } } + +const char* msg2str[] = +{ + //CMD_NONE = -1, // invalid cmd/msg. + "CMD_RUN", // start video processing. + "CMD_TERMINATE", // exit working thread. + "CMD_PAUSE", + "CMD_RESUME", + "CMD_STOP", // stop and go to IDLE. + "CMD_IBUFNOTIFY", // notify stream buffer pushed to vMeta, + // if in WAIT_INPUT_BUFFER. + "CMD_OBUFNOTIFY", // notify display buffer returned to us, + // if in WAIT_OUTPUT_BUFFER. + "CMD_IOCTRL", // io control command that operates vMeta. + + "MSG_EMPTY_THIS_BUFFER", // A stream buffer pushed to us. + "MSG_FILL_THIS_BUFFER", // A display buffer returned to us. + + "CMD_STARTGOP", // notify stream task the start of gop. + "CMD_RELOADGOP", // notify stream task to reload gop. + + "CMD_FREEZE", // notify come to freeze state + "CMD_UNFREEZE", // nofity return from freeze state + + "ACK_OK", // CMD is done successfully. +}; +const char* msgtostr(int msgID){ + if(msgID >= CMD_RUN && msgID <= ACK_OK) + return msg2str[msgID]; + else { + return "invalid command"; + } +} + +int tony_counter=0; +#include VOID VDec_Decode_Task(VOID *hVDec) { MV_CC_MSG_t msg; VDecoder *pVDec = (VDecoder *) hVDec; @@ -6561,9 +6607,12 @@ VOID VDec_Decode_Task(VOID *hVDec) { VDECLOGIFERR(MV_Timer_CreateEx(&pVDec->hStatusLogTimer, pVDec->uiStatusLogPeriod * 1000, VideoStatusProcess, hVDec, "VideoStatusProcess")); VDECLOGIFERR(MV_Timer_Start(&pVDec->hStatusLogTimer)); + pid_t tid = gettid(); while (1) { msg.m_MsgID = CMD_NONE; + VDEC_LOGH("tony trace VDec comp event loop before(tid=%d) - tony_counter=%d\n", tid, ++tony_counter); MV_CC_MsgQ_GetMsg(pVDec->hDecodeMsgQueue, &msg); + VDEC_LOGH("tony trace VDec comp event loop after(msgID = %d(%s), (tid=%d)) - tony_counter=%d\n", msg.m_MsgID, msgtostr(msg.m_MsgID), tid, --tony_counter); AMP_ASSERT(msg.m_MsgID != (UINT32) CMD_NONE); if (msg.m_MsgID == CMD_FREEZE) { VDEC_LOGH("%p:receive freeze\n", pVDec); @@ -6585,10 +6634,13 @@ VOID VDec_Decode_Task(VOID *hVDec) { if (bStreamFreeze == FALSE) { decode_stream_process_msg(pVDec, &msg); + VDEC_LOGH("tony trace before decode_stream_main_loop() state = %d\n", pVDec->eState); if (decode_stream_main_loop(pVDec) < 0) { + VDEC_LOGH("tony trace ERROR in decode_stream_main_loop() state = %d\n", pVDec->eState); VDEC_LOGH("%p:Exit Decode task\n", pVDec); return; } + VDEC_LOGH("tony trace after decode_stream_main_loop() state = %d\n", pVDec->eState); } } } -- 2.7.4