Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

Debug print to show extBuffer's issue with system memory #2746

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions _studio/mfx_lib/encode_hw/h264/src/mfx_h264_encode_hw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1815,7 +1815,11 @@ void ImplementationAvc::OnLookaheadSubmitted(DdiTaskIter task)
m_stagesToGo &= ~AsyncRoutineEmulator::STG_BIT_START_LA;

if (m_inputFrameType == MFX_IOPATTERN_IN_SYSTEM_MEMORY)
{
printf("OnLookaheadSubmitted m_core->DecreaseReference+ %p Locked %d\n", task->m_yuv, task->m_yuv->Data.Locked);
m_core->DecreaseReference(&task->m_yuv->Data);
printf("OnLookaheadSubmitted m_core->DecreaseReference- %p Locked %d\n", task->m_yuv, task->m_yuv->Data.Locked);
}
m_lookaheadStarted.splice(m_lookaheadStarted.end(), m_reordering, task);
}

Expand Down Expand Up @@ -3217,7 +3221,9 @@ mfxStatus ImplementationAvc::AsyncRoutine(mfxBitstream * bs)
{
if (m_raw.Unlock(m_lastTask.m_idx) == (mfxU32)-1)
{
printf("OnLookaheadSubmitted m_core->DecreaseReference+ %p Locked %d\n", m_lastTask.m_yuv, m_lastTask.m_yuv->Data.Locked);
m_core->DecreaseReference(&m_lastTask.m_yuv->Data);
printf("OnLookaheadSubmitted m_core->DecreaseReference+ %p Locked %d\n", m_lastTask.m_yuv, m_lastTask.m_yuv->Data.Locked);
}
ReleaseResource(m_rawLa, m_lastTask.m_cmRawLa);
ReleaseResource(m_mb, m_lastTask.m_cmMb);
Expand Down Expand Up @@ -3511,6 +3517,7 @@ mfxStatus ImplementationAvc::AsyncRoutine(mfxBitstream * bs)
task->m_fillerSize[fieldId] = PaddingBytesToWorkAroundHrdIssue(
m_video, m_hrd, m_encoding, task->m_fieldPicFlag, f);

printf("PrepareSeiMessageBuffer\n");
PrepareSeiMessageBuffer(m_video, *task, fieldId, m_sei);

#ifdef MFX_ENABLE_SVC_VIDEO_ENCODE_HW
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2475,7 +2475,9 @@ void TaskManager::CompleteTask(DdiTask & task)

if (IsOff(optDdi->RefRaw))
{
printf("CompleteTask m_core->DecreaseReference+ %p Locked %d\n", task.m_yuv, task.m_yuv->Data.Locked);
m_core->DecreaseReference(&task.m_yuv->Data);
printf("CompleteTask m_core->DecreaseReference- %p Locked %d\n", task.m_yuv, task.m_yuv->Data.Locked);

if (task.m_idx != NO_INDEX && m_video.IOPattern == MFX_IOPATTERN_IN_SYSTEM_MEMORY)
m_raws[task.m_idx].SetFree(true);
Expand Down Expand Up @@ -5006,6 +5008,7 @@ mfxStatus MfxHwH264Encode::CheckEncodeFrameParam(
MFX_CHECK(bs->DataOffset <= bs->MaxLength, MFX_ERR_UNDEFINED_BEHAVIOR);
MFX_CHECK(bs->DataOffset + bs->DataLength + bufferSizeInKB * 1000u <= bs->MaxLength,
MFX_ERR_NOT_ENOUGH_BUFFER);

MFX_CHECK_NULL_PTR1(bs->Data);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2545,6 +2545,7 @@ mfxStatus MfxHwH264Encode::CopyRawSurfaceToVideoMemory(
MfxVideoParam const & video,
DdiTask const & task)
{
printf("CopyRawSurfaceToVideoMemory+\n");
mfxExtOpaqueSurfaceAlloc const & extOpaq = GetExtBufferRef(video);

mfxFrameSurface1 * surface = task.m_yuv;
Expand Down Expand Up @@ -2592,6 +2593,7 @@ mfxStatus MfxHwH264Encode::CopyRawSurfaceToVideoMemory(
// return Error(sts);
}

printf("CopyRawSurfaceToVideoMemory-\n");
return MFX_ERR_NONE;
}
bool MfxHwH264Encode::IsFrameToSkip(DdiTask& task, MfxFrameAllocResponse & poolRec, std::vector<mfxU32> fo, bool bSWBRC)
Expand Down
2 changes: 2 additions & 0 deletions _studio/mfx_lib/shared/src/libmfxsw_encode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,7 @@ enum

mfxStatus MFXVideoENCODE_EncodeFrameAsync(mfxSession session, mfxEncodeCtrl *ctrl, mfxFrameSurface1 *surface, mfxBitstream *bs, mfxSyncPoint *syncp)
{
printf("MFXVideoENCODE_EncodeFrameAsync + surface %p Locked %d\n", surface, surface ? surface->Data.Locked: 0xffff);
mfxStatus mfxRes;

MFX_AUTO_LTRACE_WITHID(MFX_TRACE_LEVEL_API, "MFX_EncodeFrameAsync");
Expand Down Expand Up @@ -968,6 +969,7 @@ mfxStatus MFXVideoENCODE_EncodeFrameAsync(mfxSession session, mfxEncodeCtrl *ctr
MFX_LTRACE_P(MFX_TRACE_LEVEL_API, *syncp);
}
MFX_LTRACE_I(MFX_TRACE_LEVEL_API, mfxRes);
printf("MFXVideoENCODE_EncodeFrameAsync - surface %p Locked %d\n", surface, surface ? surface->Data.Locked: 0xffff);
return mfxRes;

} // mfxStatus MFXVideoENCODE_EncodeFrameAsync(mfxSession session, mfxFrameSurface1 *surface, mfxBitstream *bs, mfxSyncPoint *syncp)
Expand Down
4 changes: 4 additions & 0 deletions _studio/mfx_lib/shared/src/mfx_h264_encode_vaapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2127,6 +2127,7 @@ mfxStatus VAAPIEncoder::Execute(
mfxU32 fieldId,
PreAllocatedVector const & sei)
{
printf("Execute +\n");
MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_HOTSPOTS, "VAAPIEncoder::Execute");

mfxHDL surface = pair.first;
Expand Down Expand Up @@ -3273,6 +3274,7 @@ mfxStatus VAAPIEncoder::Execute(
MFX_CHECK_STS(mfxSts);
#endif

printf("Execute -\n");
return MFX_ERR_NONE;
} // mfxStatus VAAPIEncoder::Execute(ExecuteBuffers& data, mfxU32 fieldId)

Expand All @@ -3281,6 +3283,7 @@ mfxStatus VAAPIEncoder::QueryStatus(
DdiTask & task,
mfxU32 fieldId)
{
printf("QueryStatus +\n");
MFX_AUTO_LTRACE(MFX_TRACE_LEVEL_HOTSPOTS, "VAAPIEncoder::QueryStatus");
mfxStatus sts = MFX_ERR_NONE;
bool isFound = false;
Expand Down Expand Up @@ -3377,6 +3380,7 @@ mfxStatus VAAPIEncoder::QueryStatus(
currentFeedback, codedBufferSegment->status);
MFX_CHECK_STS(sts);
}
printf("QueryStatus -\n");

return sts;
} //mfxStatus VAAPIEncoder::QueryStatus
Expand Down