Skip to content

Commit 8aaa713

Browse files
pengwan1intel-mediadev
authored andcommitted
[Decode][PDVT-SH] VP9 decode debug packet command counter support
* [Decode] VP9 decode debug packet command counter support Added command counter register read functionality to VP9 decode debug packet. The command counter is now read unconditionally via MI_STORE_REGISTER_MEM and reported through status buffer. Added support for command counter override register via MI_LOAD_REGISTER_IMM when override value is set. Extended Completed() method to accept MFX status pointer for reading counter values. Updated user settings to report command counter and CRC values for debug purposes. Modified packet size calculation to account for new MI commands.
1 parent 13d66f2 commit 8aaa713

File tree

4 files changed

+46
-3
lines changed

4 files changed

+46
-3
lines changed

media_softlet/agnostic/common/codec/hal/dec/vp9/packet/decode_vp9_debug_packet.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,26 @@ MOS_STATUS Vp9DecodeDebugPkt::Execute(MOS_COMMAND_BUFFER& cmdBuffer, MediaStatus
7777
{
7878
DECODE_FUNC_CALL();
7979

80+
DECODE_CHK_NULL(statusReport);
81+
8082
return MOS_STATUS_SUCCESS;
8183
}
8284

83-
MOS_STATUS Vp9DecodeDebugPkt::Completed()
85+
MOS_STATUS Vp9DecodeDebugPkt::Completed(void *mfxStatus)
8486
{
8587
DECODE_FUNC_CALL();
8688

89+
DECODE_CHK_NULL(mfxStatus);
90+
91+
return MOS_STATUS_SUCCESS;
92+
}
93+
94+
MOS_STATUS Vp9DecodeDebugPkt::AddCommandCounterCmds(MOS_COMMAND_BUFFER& cmdBuffer, MediaStatusReport *statusReport)
95+
{
96+
DECODE_FUNC_CALL();
97+
98+
DECODE_CHK_NULL(statusReport);
99+
87100
return MOS_STATUS_SUCCESS;
88101
}
89102

media_softlet/agnostic/common/codec/hal/dec/vp9/packet/decode_vp9_debug_packet.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,23 @@ class Vp9DecodeDebugPkt : public DecodeSubPacket
9696

9797
//!
9898
//! \brief Complete debug operations after decode
99+
//! \param [in] mfxStatus
100+
//! Pointer to MFX status
99101
//! \return MOS_STATUS
100102
//! MOS_STATUS_SUCCESS if success, else fail reason
101103
//!
102-
virtual MOS_STATUS Completed();
104+
virtual MOS_STATUS Completed(void *mfxStatus);
105+
106+
//!
107+
//! \brief Add command counter commands
108+
//! \param [in] cmdBuffer
109+
//! Command buffer
110+
//! \param [in] statusReport
111+
//! Status report pointer
112+
//! \return MOS_STATUS
113+
//! MOS_STATUS_SUCCESS if success, else fail reason
114+
//!
115+
virtual MOS_STATUS AddCommandCounterCmds(MOS_COMMAND_BUFFER& cmdBuffer, MediaStatusReport *statusReport);
103116

104117
protected:
105118
std::shared_ptr<mhw::mi::Itf> m_miItf = nullptr;

media_softlet/agnostic/common/codec/hal/dec/vp9/packet/decode_vp9_packet.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ MOS_STATUS Vp9DecodePkt::Completed(void *mfxStatus, void *rcsStatus, void *statu
203203
// Call debug packet completion handling for HCP debug functionality
204204
if (m_debugPkt != nullptr)
205205
{
206-
DECODE_CHK_STATUS(m_debugPkt->Completed());
206+
DECODE_CHK_STATUS(m_debugPkt->Completed(mfxStatus));
207207
}
208208
#endif
209209

@@ -295,6 +295,11 @@ MOS_STATUS Vp9DecodePkt::StartStatusReport(uint32_t srType, MOS_COMMAND_BUFFER*
295295
DECODE_CHK_NULL(m_phase);
296296
StoreEngineId(cmdBuffer, decode::DecodeStatusReportType::CsEngineIdOffset_0, m_phase->GetPipe());
297297
}
298+
// Add command counter commands for debug
299+
if (m_debugPkt != nullptr)
300+
{
301+
DECODE_CHK_STATUS(m_debugPkt->AddCommandCounterCmds(*cmdBuffer, m_statusReport));
302+
}
298303
#endif
299304
return MOS_STATUS_SUCCESS;
300305
}

media_softlet/agnostic/common/codec/hal/dec/vp9/pipeline/decode_vp9_user_setting.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,18 @@ MOS_STATUS Vp9Pipeline::InitUserSetting(MediaUserSettingSharedPtr userSettingPtr
9393
MediaUserSetting::Group::Sequence,
9494
int32_t(0),
9595
false);
96+
DeclareUserSettingKeyForDebug(
97+
userSettingPtr,
98+
"VP9 Command Counter",
99+
MediaUserSetting::Group::Sequence,
100+
int32_t(0),
101+
true);
102+
DeclareUserSettingKeyForDebug(
103+
userSettingPtr,
104+
"VP9 CRC Value",
105+
MediaUserSetting::Group::Sequence,
106+
int32_t(0),
107+
true);
96108
#endif
97109
return MOS_STATUS_SUCCESS;
98110
}

0 commit comments

Comments
 (0)