Skip to content

Commit

Permalink
[VP] Add DDI in Dump File Name
Browse files Browse the repository at this point in the history
Add DDI in dump file name, so that clear view and vp blt can be recognized.
  • Loading branch information
peiyigu-intel authored and intel-mediadev committed Aug 14, 2023
1 parent eef1264 commit 95dc859
Show file tree
Hide file tree
Showing 8 changed files with 149 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2364,13 +2364,15 @@ MOS_STATUS VpVeboxCmdPacketLegacy::DumpVeboxStateHeap()
&kernelResource,
counter,
0,
VPHAL_DUMP_TYPE_VEBOX_DRIVERHEAP);
VPHAL_DUMP_TYPE_VEBOX_DRIVERHEAP,
VPHAL_SURF_DUMP_DDI_VP_BLT);

VP_SURFACE_DUMP(debuginterface,
&kernelResource,
counter,
0,
VPHAL_DUMP_TYPE_VEBOX_KERNELHEAP);
VPHAL_DUMP_TYPE_VEBOX_KERNELHEAP,
VPHAL_SURF_DUMP_DDI_VP_BLT);

counter++;
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,11 @@ MOS_STATUS PacketPipe::Execute(MediaStatusReport *statusReport, MediaScalability
if(handle.first && handle.second)
{
VP_SURFACE_DUMP(m_PacketFactory.m_debugInterface,
handle.second,
0,
handle.first,
VPHAL_DUMP_TYPE_POST_COMP);
handle.second,
0,
handle.first,
VPHAL_DUMP_TYPE_POST_COMP,
VPHAL_SURF_DUMP_DDI_VP_BLT);
}
}
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2171,13 +2171,15 @@ MOS_STATUS VpVeboxCmdPacket::DumpVeboxStateHeap()
&kernelResource,
counter,
0,
VPHAL_DUMP_TYPE_VEBOX_DRIVERHEAP);
VPHAL_DUMP_TYPE_VEBOX_DRIVERHEAP,
VPHAL_SURF_DUMP_DDI_VP_BLT);

VP_SURFACE_DUMP(debuginterface,
&kernelResource,
counter,
0,
VPHAL_DUMP_TYPE_VEBOX_KERNELHEAP);
VPHAL_DUMP_TYPE_VEBOX_KERNELHEAP,
VPHAL_SURF_DUMP_DDI_VP_BLT);

counter++;
#endif
Expand Down
6 changes: 4 additions & 2 deletions media_softlet/agnostic/common/vp/hal/pipeline/vp_pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,8 @@ MOS_STATUS VpPipeline::ExecuteVpPipeline()
params->pSrc[uiLayer],
m_vpPipeContexts[0]->GetFrameCounter(),
uiLayer,
VPHAL_DUMP_TYPE_PRE_ALL);
VPHAL_DUMP_TYPE_PRE_ALL,
VPHAL_SURF_DUMP_DDI_VP_BLT);
}
#endif
// Predication
Expand Down Expand Up @@ -582,7 +583,8 @@ MOS_STATUS VpPipeline::UpdateExecuteStatus(uint32_t frameCnt)
VPHAL_MAX_TARGETS,
params->uDstCount,
frameCnt,
VPHAL_DUMP_TYPE_POST_ALL);
VPHAL_DUMP_TYPE_POST_ALL,
params->uSrcCount > 0 ? VPHAL_SURF_DUMP_DDI_VP_BLT : VPHAL_SURF_DUMP_DDI_CLEAR_VIEW);

// Decompre output surface for debug
bool uiForceDecompressedOutput = false;
Expand Down
40 changes: 23 additions & 17 deletions media_softlet/agnostic/common/vp/hal/utils/vp_debug_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,50 +107,56 @@ MOS_STATUS VpDebugInterface::DumpVpSurface(
PVPHAL_SURFACE pSurf,
uint32_t uiFrameNumber,
uint32_t uiCounter,
uint32_t Location)
uint32_t Location,
uint32_t uiDDI)
{
VP_FUNC_CALL();

VP_DEBUG_CHK_NULL_RETURN(m_surfaceDumper)
return m_surfaceDumper->DumpSurface(
pSurf,
uiFrameNumber,
uiCounter,
Location);
pSurf,
uiFrameNumber,
uiCounter,
Location,
uiDDI);
}

MOS_STATUS VpDebugInterface::DumpVpSurface(
PVP_SURFACE pSurf,
PVP_SURFACE pSurf,
uint32_t uiFrameNumber,
uint32_t uiCounter,
uint32_t Location)
uint32_t Location,
uint32_t uiDDI)
{
VP_FUNC_CALL();

VP_DEBUG_CHK_NULL_RETURN(m_surfaceDumper)
return m_surfaceDumper->DumpSurface(
pSurf,
uiFrameNumber,
uiCounter,
Location);
pSurf,
uiFrameNumber,
uiCounter,
Location,
uiDDI);
}

MOS_STATUS VpDebugInterface::DumpVpSurfaceArray(
PVPHAL_SURFACE *ppSurfaces,
uint32_t uiMaxSurfaces,
uint32_t uiNumSurfaces,
uint32_t uiFrameNumber,
uint32_t Location)
uint32_t Location,
uint32_t uiDDI)
{
VP_FUNC_CALL();

VP_DEBUG_CHK_NULL_RETURN(m_surfaceDumper)
return m_surfaceDumper->DumpSurfaceArray(
ppSurfaces,
uiMaxSurfaces,
uiNumSurfaces,
uiFrameNumber,
Location);
ppSurfaces,
uiMaxSurfaces,
uiNumSurfaces,
uiFrameNumber,
Location,
uiDDI);
}

std::string VpDebugInterface::SetOutputPathKey()
Expand Down
17 changes: 10 additions & 7 deletions media_softlet/agnostic/common/vp/hal/utils/vp_debug_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,26 @@ class VpDebugInterface : public MediaDebugInterface
MEDIA_WA_TABLE *waTable);

MOS_STATUS DumpVpSurfaceArray(
PVPHAL_SURFACE *ppSurfaces,
uint32_t uiMaxSurfaces,
uint32_t uiNumSurfaces,
uint32_t uiFrameNumber,
uint32_t Location);
PVPHAL_SURFACE *ppSurfaces,
uint32_t uiMaxSurfaces,
uint32_t uiNumSurfaces,
uint32_t uiFrameNumber,
uint32_t Location,
uint32_t uiDDI = VPHAL_SURF_DUMP_DDI_UNKNOWN);

MOS_STATUS DumpVpSurface(
PVPHAL_SURFACE pSurf,
uint32_t uiFrameNumber,
uint32_t uiCounter,
uint32_t Location);
uint32_t Location,
uint32_t uiDDI = VPHAL_SURF_DUMP_DDI_UNKNOWN);

MOS_STATUS DumpVpSurface(
PVP_SURFACE pSurf,
uint32_t uiFrameNumber,
uint32_t uiCounter,
uint32_t Location);
uint32_t Location,
uint32_t uiDDI = VPHAL_SURF_DUMP_DDI_UNKNOWN);

protected:
std::string SetOutputPathKey() override;
Expand Down
71 changes: 54 additions & 17 deletions media_softlet/agnostic/common/vp/hal/utils/vp_dumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@
#define VPHAL_PARAMS_DUMP_START_FRAME_KEY_NAME "startxmlFrame"
#define VPHAL_PARAMS_DUMP_END_FRAME_KEY_NAME "endxmlFrame"

//==<Dump DDI>====================================================
#define VPHAL_PARAMS_DUMP_DDI_UNKNOWN "unknown"
#define VPHAL_PARAMS_DUMP_DDI_VP_BLT "vpblt"
#define VPHAL_PARAMS_DUMP_DDI_CLEAR_VIEW "clearview"

void VpDumperTool::GetOsFilePath(
const char* pcFilePath,
char* pOsFilePath)
Expand Down Expand Up @@ -1713,6 +1718,30 @@ MOS_STATUS VpSurfaceDumper::EnumToLocString(
return eStatus;
}

MOS_STATUS VpSurfaceDumper::EnumToDdiString(
uint32_t uiDDI,
char* pcDdiString)
{
VP_DEBUG_CHK_NULL_RETURN(pcDdiString)

switch (uiDDI)
{
case VPHAL_SURF_DUMP_DDI_UNKNOWN:
MOS_SecureStringPrint(pcDdiString, MAX_PATH, MAX_PATH, VPHAL_PARAMS_DUMP_DDI_UNKNOWN);
break;
case VPHAL_SURF_DUMP_DDI_VP_BLT:
MOS_SecureStringPrint(pcDdiString, MAX_PATH, MAX_PATH, VPHAL_PARAMS_DUMP_DDI_VP_BLT);
break;
case VPHAL_SURF_DUMP_DDI_CLEAR_VIEW:
MOS_SecureStringPrint(pcDdiString, MAX_PATH, MAX_PATH, VPHAL_PARAMS_DUMP_DDI_CLEAR_VIEW);
break;
default:
VP_DEBUG_ASSERTMESSAGE("Unknown dump DDI \"%d\".", uiDDI);
return MOS_STATUS_UNKNOWN;
}

return MOS_STATUS_SUCCESS;
}

MOS_STATUS VpSurfaceDumper::SurfTypeStringToEnum(
char* pcSurfType,
Expand Down Expand Up @@ -1995,7 +2024,8 @@ MOS_STATUS VpSurfaceDumper::DumpSurface(
PVPHAL_SURFACE pSurf,
uint32_t uiFrameNumber,
uint32_t uiCounter,
uint32_t Location)
uint32_t Location,
uint32_t uiDDI)
{
VP_FUNC_CALL();

Expand Down Expand Up @@ -2069,20 +2099,21 @@ MOS_STATUS VpSurfaceDumper::DumpSurface(
loc = osCtx->GetdumpLoc();
}
VP_DEBUG_CHK_STATUS(EnumToLocString(Location, m_dumpLoc));
VP_DEBUG_CHK_STATUS(EnumToDdiString(uiDDI, m_dumpDDI));
if (!isDumpFromDecomp && pSurf->bIsCompressed && loc)
{
EnumToLocString(Location, loc);
}

if (!isDumpFromDecomp || (loc && loc[0] == 0))
{
MOS_SecureStringPrint(m_dumpPrefix, MAX_PATH, MAX_PATH, "%s/surfdump_pid%x_ts%llx_loc[%s]_lyr[%d]", pDumpSpec->pcOutputPath, pid, timeStamp, m_dumpLoc, uiCounter);
MOS_SecureStringPrint(m_dumpPrefix, MAX_PATH, MAX_PATH, "%s/surfdump_pid%x_ts%llx_loc[%s]_lyr[%d]_ddi[%s(%d)]", pDumpSpec->pcOutputPath, pid, timeStamp, m_dumpLoc, uiCounter, m_dumpDDI, uiDDI);
}
else
{
if (loc)
{
MOS_SecureStringPrint(m_dumpPrefix, MAX_PATH, MAX_PATH, "%s/surfdump_pid%x_ts%llx_loc[%s_%s]_lyr[%d]", pDumpSpec->pcOutputPath, pid, timeStamp, loc, m_dumpLoc, uiCounter);
MOS_SecureStringPrint(m_dumpPrefix, MAX_PATH, MAX_PATH, "%s/surfdump_pid%x_ts%llx_loc[%s_%s]_lyr[%d]_ddi[%s(%d)]", pDumpSpec->pcOutputPath, pid, timeStamp, loc, m_dumpLoc, uiCounter, m_dumpDDI, uiDDI);
}
}
DumpSurfaceToFile(
Expand Down Expand Up @@ -2121,22 +2152,23 @@ MOS_STATUS VpSurfaceDumper::DumpSurface(
loc = osCtx->GetdumpLoc();
}
VP_DEBUG_CHK_STATUS(EnumToLocString(Location, m_dumpLoc));
VP_DEBUG_CHK_STATUS(EnumToDdiString(uiDDI, m_dumpDDI));
if (!isDumpFromDecomp && pSurf->bIsCompressed && loc)
{
EnumToLocString(Location, loc);
}

if (!isDumpFromDecomp || (loc && loc[0] == 0))
{
MOS_SecureStringPrint(m_dumpPrefix, MAX_PATH, MAX_PATH, "%s/surfdump_pid%x_ts%llx_loc_loc[%s]_lyr[%d]",
pDumpSpec->pcOutputPath, pid, timeStamp, m_dumpLoc, uiCounter);
MOS_SecureStringPrint(m_dumpPrefix, MAX_PATH, MAX_PATH, "%s/surfdump_pid%x_ts%llx_loc_loc[%s]_lyr[%d]_ddi[%s(%d)]",
pDumpSpec->pcOutputPath, pid, timeStamp, m_dumpLoc, uiCounter, m_dumpDDI, uiDDI);
}
else
{
if (loc)
{
MOS_SecureStringPrint(m_dumpPrefix, MAX_PATH, MAX_PATH, "%s/surfdump_pid%x_ts%llx_loc_loc[%s_%s]_lyr[%d]",
pDumpSpec->pcOutputPath, pid, timeStamp, loc, m_dumpLoc, uiCounter);
MOS_SecureStringPrint(m_dumpPrefix, MAX_PATH, MAX_PATH, "%s/surfdump_pid%x_ts%llx_loc_loc[%s_%s]_lyr[%d]_ddi[%s(%d)]",
pDumpSpec->pcOutputPath, pid, timeStamp, loc, m_dumpLoc, uiCounter, m_dumpDDI, uiDDI);
}
}

Expand Down Expand Up @@ -2169,10 +2201,11 @@ MOS_STATUS VpSurfaceDumper::DumpSurface(
}

MOS_STATUS VpSurfaceDumper::DumpSurface(
PVP_SURFACE pSurf,
PVP_SURFACE pSurf,
uint32_t uiFrameNumber,
uint32_t uiCounter,
uint32_t Location)
uint32_t Location,
uint32_t uiDDI)
{
VP_FUNC_CALL();

Expand Down Expand Up @@ -2246,20 +2279,21 @@ MOS_STATUS VpSurfaceDumper::DumpSurface(
loc = osCtx->GetdumpLoc();
}
VP_DEBUG_CHK_STATUS(EnumToLocString(Location, m_dumpLoc));
VP_DEBUG_CHK_STATUS(EnumToDdiString(uiDDI, m_dumpDDI));
if (!isDumpFromDecomp && pSurf->osSurface->bIsCompressed && loc)
{
EnumToLocString(Location, loc);
}

if (!isDumpFromDecomp || (loc && loc[0] == 0))
{
MOS_SecureStringPrint(m_dumpPrefix, MAX_PATH, MAX_PATH, "%s/surfdump_pid%x_ts%llx_loc[%s]_lyr[%d]", pDumpSpec->pcOutputPath, pid, timeStamp, m_dumpLoc, uiCounter);
MOS_SecureStringPrint(m_dumpPrefix, MAX_PATH, MAX_PATH, "%s/surfdump_pid%x_ts%llx_loc[%s]_lyr[%d]_ddi[%s(%d)]", pDumpSpec->pcOutputPath, pid, timeStamp, m_dumpLoc, uiCounter, m_dumpDDI, uiDDI);
}
else
{
if (loc)
{
MOS_SecureStringPrint(m_dumpPrefix, MAX_PATH, MAX_PATH, "%s/surfdump_pid%x_ts%llx_loc[%s_%s]_lyr[%d]", pDumpSpec->pcOutputPath, pid, timeStamp, loc, m_dumpLoc, uiCounter);
MOS_SecureStringPrint(m_dumpPrefix, MAX_PATH, MAX_PATH, "%s/surfdump_pid%x_ts%llx_loc[%s_%s]_lyr[%d]_ddi[%s(%d)]", pDumpSpec->pcOutputPath, pid, timeStamp, loc, m_dumpLoc, uiCounter, m_dumpDDI, uiDDI);
}
}
DumpSurfaceToFile(
Expand Down Expand Up @@ -2298,22 +2332,23 @@ MOS_STATUS VpSurfaceDumper::DumpSurface(
loc = osCtx->GetdumpLoc();
}
VP_DEBUG_CHK_STATUS(EnumToLocString(Location, m_dumpLoc));
VP_DEBUG_CHK_STATUS(EnumToDdiString(uiDDI, m_dumpDDI));
if (!isDumpFromDecomp && pSurf->osSurface->bIsCompressed && loc)
{
EnumToLocString(Location, loc);
}

if (!isDumpFromDecomp || (loc && loc[0] == 0))
{
MOS_SecureStringPrint(m_dumpPrefix, MAX_PATH, MAX_PATH, "%s/surfdump_pid%x_ts%llx_loc[%s]_lyr[%d]",
pDumpSpec->pcOutputPath, pid, timeStamp, m_dumpLoc, uiCounter);
MOS_SecureStringPrint(m_dumpPrefix, MAX_PATH, MAX_PATH, "%s/surfdump_pid%x_ts%llx_loc[%s]_lyr[%d]_ddi[%s(%d)]",
pDumpSpec->pcOutputPath, pid, timeStamp, m_dumpLoc, uiCounter, m_dumpDDI, uiDDI);
}
else
{
if (loc)
{
MOS_SecureStringPrint(m_dumpPrefix, MAX_PATH, MAX_PATH, "%s/surfdump_pid%x_ts%llx_loc[%s_%s]_lyr[%d]",
pDumpSpec->pcOutputPath, pid, timeStamp, loc, m_dumpLoc, uiCounter);
MOS_SecureStringPrint(m_dumpPrefix, MAX_PATH, MAX_PATH, "%s/surfdump_pid%x_ts%llx_loc[%s_%s]_lyr[%d]_ddi[%s(%d)]",
pDumpSpec->pcOutputPath, pid, timeStamp, loc, m_dumpLoc, uiCounter, m_dumpDDI, uiDDI);
}
}

Expand Down Expand Up @@ -2350,7 +2385,8 @@ MOS_STATUS VpSurfaceDumper::DumpSurfaceArray(
uint32_t uiMaxSurfaces,
uint32_t uiNumSurfaces,
uint32_t uiFrameNumber,
uint32_t Location)
uint32_t Location,
uint32_t uiDDI)
{
VP_FUNC_CALL();

Expand All @@ -2375,7 +2411,8 @@ MOS_STATUS VpSurfaceDumper::DumpSurfaceArray(
ppSurfaces[uiIndex],
uiFrameNumber,
uiLayer,
Location));
Location,
uiDDI));

uiLayer++;
}
Expand Down
Loading

0 comments on commit 95dc859

Please sign in to comment.