diff --git a/media_common/agnostic/common/os/mos_util_user_feature_keys.h b/media_common/agnostic/common/os/mos_util_user_feature_keys.h index 746568ac8f0..df95e333e0e 100644 --- a/media_common/agnostic/common/os/mos_util_user_feature_keys.h +++ b/media_common/agnostic/common/os/mos_util_user_feature_keys.h @@ -134,6 +134,7 @@ #define __MEDIA_USER_FEATURE_VALUE_SIM_ENABLE "Simulation Enable" #define __MEDIA_USER_FEATURE_VALUE_SIM_IN_USE "Simulation In Use" +#define __MEDIA_USER_FEATURE_VALUE_ENABLE_VDBOX_ID_REPORT "Enable VDBOX ID Report" #define __MEDIA_USER_FEATURE_VALUE_ENABLE_VE_DEBUG_OVERRIDE "Enable VE Debug Override" #define __MEDIA_USER_FEATURE_VALUE_FORCE_VDBOX "Force VDBOX" #define __MEDIA_USER_FEATURE_VALUE_FORCE_VEBOX "Force VEBOX" diff --git a/media_softlet/agnostic/Xe2_M_plus/Xe2_LPM_base/codec/hal/dec/av1/pipeline/decode_av1_status_report_xe2_lpm_base.cpp b/media_softlet/agnostic/Xe2_M_plus/Xe2_LPM_base/codec/hal/dec/av1/pipeline/decode_av1_status_report_xe2_lpm_base.cpp index 267014f2f05..44ca91609f3 100644 --- a/media_softlet/agnostic/Xe2_M_plus/Xe2_LPM_base/codec/hal/dec/av1/pipeline/decode_av1_status_report_xe2_lpm_base.cpp +++ b/media_softlet/agnostic/Xe2_M_plus/Xe2_LPM_base/codec/hal/dec/av1/pipeline/decode_av1_status_report_xe2_lpm_base.cpp @@ -31,7 +31,7 @@ namespace decode { DecodeAv1StatusReportXe2_Lpm_Base::DecodeAv1StatusReportXe2_Lpm_Base( DecodeAllocator* allocator, bool enableRcs, PMOS_INTERFACE osInterface): - DecodeStatusReport(allocator, enableRcs) + DecodeStatusReport(allocator, enableRcs, osInterface) { DECODE_FUNC_CALL() diff --git a/media_softlet/agnostic/Xe3_M_plus/Xe3_LPM_base/codec/hal/dec/av1/pipeline/decode_av1_status_report_xe3_lpm_base.cpp b/media_softlet/agnostic/Xe3_M_plus/Xe3_LPM_base/codec/hal/dec/av1/pipeline/decode_av1_status_report_xe3_lpm_base.cpp index d8a3bd31c73..16e9977a5f9 100644 --- a/media_softlet/agnostic/Xe3_M_plus/Xe3_LPM_base/codec/hal/dec/av1/pipeline/decode_av1_status_report_xe3_lpm_base.cpp +++ b/media_softlet/agnostic/Xe3_M_plus/Xe3_LPM_base/codec/hal/dec/av1/pipeline/decode_av1_status_report_xe3_lpm_base.cpp @@ -31,7 +31,7 @@ namespace decode { DecodeAv1StatusReportXe3_Lpm_Base::DecodeAv1StatusReportXe3_Lpm_Base( DecodeAllocator* allocator, bool enableRcs, PMOS_INTERFACE osInterface): - DecodeStatusReport(allocator, enableRcs) + DecodeStatusReport(allocator, enableRcs, osInterface) { DECODE_FUNC_CALL() diff --git a/media_softlet/agnostic/Xe_M_plus/Xe_LPM_plus_base/codec/hal/dec/av1/pipeline/decode_av1_status_report_xe_lpm_plus_base.cpp b/media_softlet/agnostic/Xe_M_plus/Xe_LPM_plus_base/codec/hal/dec/av1/pipeline/decode_av1_status_report_xe_lpm_plus_base.cpp index af0dfb1afbe..7a65a61acea 100644 --- a/media_softlet/agnostic/Xe_M_plus/Xe_LPM_plus_base/codec/hal/dec/av1/pipeline/decode_av1_status_report_xe_lpm_plus_base.cpp +++ b/media_softlet/agnostic/Xe_M_plus/Xe_LPM_plus_base/codec/hal/dec/av1/pipeline/decode_av1_status_report_xe_lpm_plus_base.cpp @@ -34,7 +34,7 @@ namespace decode { class DecodeAllocator; DecodeAv1StatusReportXe_Lpm_Plus_Base::DecodeAv1StatusReportXe_Lpm_Plus_Base( DecodeAllocator* allocator, bool enableRcs, PMOS_INTERFACE osInterface): - DecodeStatusReport(allocator, enableRcs) + DecodeStatusReport(allocator, enableRcs, osInterface) { DECODE_FUNC_CALL() diff --git a/media_softlet/agnostic/common/codec/hal/dec/av1/packet/decode_av1_packet.cpp b/media_softlet/agnostic/common/codec/hal/dec/av1/packet/decode_av1_packet.cpp index f6e43994264..cc388835505 100644 --- a/media_softlet/agnostic/common/codec/hal/dec/av1/packet/decode_av1_packet.cpp +++ b/media_softlet/agnostic/common/codec/hal/dec/av1/packet/decode_av1_packet.cpp @@ -263,7 +263,12 @@ MOS_STATUS Av1DecodePkt::StartStatusReport(uint32_t srType, MOS_COMMAND_BUFFER* DECODE_CHK_NULL(perfProfiler); DECODE_CHK_STATUS(perfProfiler->AddPerfCollectStartCmd( (void*)m_av1Pipeline, m_osInterface, m_miItf, cmdBuffer)); - +#if (_DEBUG || _RELEASE_INTERNAL) + if (m_statusReport && m_statusReport->IsVdboxIdReportEnabled()) + { + StoreEngineId(cmdBuffer, decode::DecodeStatusReportType::CsEngineIdOffset_0); + } +#endif return MOS_STATUS_SUCCESS; } diff --git a/media_softlet/agnostic/common/codec/hal/dec/avc/packet/decode_avc_packet.cpp b/media_softlet/agnostic/common/codec/hal/dec/avc/packet/decode_avc_packet.cpp index 85a043d423e..8b1ff574f0d 100644 --- a/media_softlet/agnostic/common/codec/hal/dec/avc/packet/decode_avc_packet.cpp +++ b/media_softlet/agnostic/common/codec/hal/dec/avc/packet/decode_avc_packet.cpp @@ -270,7 +270,12 @@ MOS_STATUS AvcDecodePkt::StartStatusReport(uint32_t srType, MOS_COMMAND_BUFFER * DECODE_CHK_NULL(perfProfiler); DECODE_CHK_STATUS(perfProfiler->AddPerfCollectStartCmd( (void *)m_avcPipeline, m_osInterface, m_miItf, cmdBuffer)); - +#if (_DEBUG || _RELEASE_INTERNAL) + if (m_statusReport && m_statusReport->IsVdboxIdReportEnabled()) + { + StoreEngineId(cmdBuffer, decode::DecodeStatusReportType::CsEngineIdOffset_0); + } +#endif return MOS_STATUS_SUCCESS; } diff --git a/media_softlet/agnostic/common/codec/hal/dec/hevc/packet/decode_hevc_packet.cpp b/media_softlet/agnostic/common/codec/hal/dec/hevc/packet/decode_hevc_packet.cpp index fffe8849a89..3a88cd1d6ad 100644 --- a/media_softlet/agnostic/common/codec/hal/dec/hevc/packet/decode_hevc_packet.cpp +++ b/media_softlet/agnostic/common/codec/hal/dec/hevc/packet/decode_hevc_packet.cpp @@ -267,6 +267,11 @@ MOS_STATUS HevcDecodePkt::StartStatusReport(uint32_t srType, MOS_COMMAND_BUFFER* DECODE_CHK_STATUS(perfProfiler->AddPerfCollectStartCmd((void *)m_hevcPipeline, m_osInterface, m_miItf, cmdBuffer)); #if (_DEBUG || _RELEASE_INTERNAL) + if (m_statusReport && m_statusReport->IsVdboxIdReportEnabled()) + { + DECODE_CHK_NULL(m_phase); + StoreEngineId(cmdBuffer, decode::DecodeStatusReportType::CsEngineIdOffset_0, m_phase->GetPipe()); + } if (m_osInterface->bNullHwIsEnabled) { DecodeNullHWProxyTestPkt *nullhwProxy = DecodeNullHWProxyTestPkt::Instance(); diff --git a/media_softlet/agnostic/common/codec/hal/dec/jpeg/packet/decode_jpeg_packet.cpp b/media_softlet/agnostic/common/codec/hal/dec/jpeg/packet/decode_jpeg_packet.cpp index d8d9b31026b..7684ef891c1 100644 --- a/media_softlet/agnostic/common/codec/hal/dec/jpeg/packet/decode_jpeg_packet.cpp +++ b/media_softlet/agnostic/common/codec/hal/dec/jpeg/packet/decode_jpeg_packet.cpp @@ -247,7 +247,12 @@ MOS_STATUS JpegDecodePkt::StartStatusReport(uint32_t srType, MOS_COMMAND_BUFFER* DECODE_CHK_NULL(perfProfiler); DECODE_CHK_STATUS(perfProfiler->AddPerfCollectStartCmd( (void*)m_jpegPipeline, m_osInterface, m_miItf, cmdBuffer)); - +#if (_DEBUG || _RELEASE_INTERNAL) + if (m_statusReport && m_statusReport->IsVdboxIdReportEnabled()) + { + StoreEngineId(cmdBuffer, decode::DecodeStatusReportType::CsEngineIdOffset_0); + } +#endif return MOS_STATUS_SUCCESS; } diff --git a/media_softlet/agnostic/common/codec/hal/dec/mpeg2/packet/decode_mpeg2_packet.cpp b/media_softlet/agnostic/common/codec/hal/dec/mpeg2/packet/decode_mpeg2_packet.cpp index cd7d154ff30..8b3846ea29b 100644 --- a/media_softlet/agnostic/common/codec/hal/dec/mpeg2/packet/decode_mpeg2_packet.cpp +++ b/media_softlet/agnostic/common/codec/hal/dec/mpeg2/packet/decode_mpeg2_packet.cpp @@ -274,7 +274,12 @@ MOS_STATUS Mpeg2DecodePkt::StartStatusReport(uint32_t srType, MOS_COMMAND_BUFFER DECODE_CHK_NULL(perfProfiler); DECODE_CHK_STATUS(perfProfiler->AddPerfCollectStartCmd( (void*)m_mpeg2Pipeline, m_osInterface, m_miItf, cmdBuffer)); - +#if (_DEBUG || _RELEASE_INTERNAL) + if (m_statusReport && m_statusReport->IsVdboxIdReportEnabled()) + { + StoreEngineId(cmdBuffer, decode::DecodeStatusReportType::CsEngineIdOffset_0); + } +#endif return MOS_STATUS_SUCCESS; } diff --git a/media_softlet/agnostic/common/codec/hal/dec/shared/pipeline/decode_pipeline.cpp b/media_softlet/agnostic/common/codec/hal/dec/shared/pipeline/decode_pipeline.cpp index fe30f05685c..08d7c03e626 100644 --- a/media_softlet/agnostic/common/codec/hal/dec/shared/pipeline/decode_pipeline.cpp +++ b/media_softlet/agnostic/common/codec/hal/dec/shared/pipeline/decode_pipeline.cpp @@ -566,8 +566,18 @@ MOS_STATUS DecodePipeline::ReportVdboxIds(const DecodeStatusMfx& status) { DECODE_FUNC_CALL(); - // report the VDBOX IDs to user feature - uint32_t vdboxIds = ReadUserFeature(m_userSettingPtr, "Used VDBOX ID", MediaUserSetting::Group::Sequence).Get(); + uint32_t vdboxIds = 0; + uint32_t reportedVdboxIds = 0; + // Must add MEDIA_USER_SETTING_INTERNAL_REPORT for different reading path. + ReadUserSettingForDebug( + m_userSettingPtr, + reportedVdboxIds, + "Used VDBOX ID", + MediaUserSetting::Group::Sequence, + 0, + false, + MEDIA_USER_SETTING_INTERNAL_REPORT); + vdboxIds = reportedVdboxIds; for (auto i = 0; i < csInstanceIdMax; i++) { CsEngineId csEngineId; @@ -580,7 +590,7 @@ MOS_STATUS DecodePipeline::ReportVdboxIds(const DecodeStatusMfx& status) } } - if (vdboxIds != 0) + if (vdboxIds != reportedVdboxIds) { WriteUserFeature(__MEDIA_USER_FEATURE_VALUE_VDBOX_ID_USED, vdboxIds, m_osInterface->pOsContext); } diff --git a/media_softlet/agnostic/common/codec/hal/dec/shared/statusreport/decode_status_report.cpp b/media_softlet/agnostic/common/codec/hal/dec/shared/statusreport/decode_status_report.cpp index a396e4a7d5e..46ff2ff6814 100644 --- a/media_softlet/agnostic/common/codec/hal/dec/shared/statusreport/decode_status_report.cpp +++ b/media_softlet/agnostic/common/codec/hal/dec/shared/statusreport/decode_status_report.cpp @@ -37,6 +37,17 @@ namespace decode { m_osInterface(osInterface) { m_sizeOfReport = sizeof(DecodeStatusReportData); +#if (_DEBUG || _RELEASE_INTERNAL) + if (osInterface && osInterface->pfnGetUserSettingInstance) + { + auto userSetting = osInterface->pfnGetUserSettingInstance(osInterface); + ReadUserSettingForDebug( + userSetting, + m_enableVdboxIdReport, + __MEDIA_USER_FEATURE_VALUE_ENABLE_VDBOX_ID_REPORT, + MediaUserSetting::Group::Device); + } +#endif } DecodeStatusReport::~DecodeStatusReport() diff --git a/media_softlet/agnostic/common/codec/hal/dec/shared/statusreport/decode_status_report.h b/media_softlet/agnostic/common/codec/hal/dec/shared/statusreport/decode_status_report.h index 1095f210074..49e8aadbd6a 100644 --- a/media_softlet/agnostic/common/codec/hal/dec/shared/statusreport/decode_status_report.h +++ b/media_softlet/agnostic/common/codec/hal/dec/shared/statusreport/decode_status_report.h @@ -93,7 +93,7 @@ namespace decode { class DecodeStatusReport : public MediaStatusReport { public: - DecodeStatusReport(DecodeAllocator *alloc, bool enableRcs, PMOS_INTERFACE osInterface = nullptr); + DecodeStatusReport(DecodeAllocator *alloc, bool enableRcs, PMOS_INTERFACE osInterface); virtual ~DecodeStatusReport(); //! diff --git a/media_softlet/agnostic/common/codec/hal/dec/vp9/packet/decode_vp9_packet.cpp b/media_softlet/agnostic/common/codec/hal/dec/vp9/packet/decode_vp9_packet.cpp index 9bcd600681e..d164cf7bf40 100644 --- a/media_softlet/agnostic/common/codec/hal/dec/vp9/packet/decode_vp9_packet.cpp +++ b/media_softlet/agnostic/common/codec/hal/dec/vp9/packet/decode_vp9_packet.cpp @@ -265,7 +265,13 @@ MOS_STATUS Vp9DecodePkt::StartStatusReport(uint32_t srType, MOS_COMMAND_BUFFER* DECODE_CHK_NULL(perfProfiler); DECODE_CHK_STATUS(perfProfiler->AddPerfCollectStartCmd( (void*)m_vp9Pipeline, m_osInterface, m_miItf, cmdBuffer)); - +#if (_DEBUG || _RELEASE_INTERNAL) + if (m_statusReport && m_statusReport->IsVdboxIdReportEnabled()) + { + DECODE_CHK_NULL(m_phase); + StoreEngineId(cmdBuffer, decode::DecodeStatusReportType::CsEngineIdOffset_0, m_phase->GetPipe()); + } +#endif return MOS_STATUS_SUCCESS; } diff --git a/media_softlet/agnostic/common/codec/hal/dec/vvc/packet/decode_vvc_packet.cpp b/media_softlet/agnostic/common/codec/hal/dec/vvc/packet/decode_vvc_packet.cpp index 2cf23973d04..4c3f2ccbdb2 100644 --- a/media_softlet/agnostic/common/codec/hal/dec/vvc/packet/decode_vvc_packet.cpp +++ b/media_softlet/agnostic/common/codec/hal/dec/vvc/packet/decode_vvc_packet.cpp @@ -279,7 +279,12 @@ MOS_STATUS VvcDecodePkt::StartStatusReport(uint32_t srType, MOS_COMMAND_BUFFER* DECODE_CHK_NULL(perfProfiler); DECODE_CHK_STATUS(perfProfiler->AddPerfCollectStartCmd( (void *)m_vvcPipeline, m_osInterface, m_miItf, cmdBuffer)); - +#if (_DEBUG || _RELEASE_INTERNAL) + if (m_statusReport && m_statusReport->IsVdboxIdReportEnabled()) + { + StoreEngineId(cmdBuffer, decode::DecodeStatusReportType::CsEngineIdOffset_0); + } +#endif return MOS_STATUS_SUCCESS; } diff --git a/media_softlet/agnostic/common/hw/mhw_mmio_common.h b/media_softlet/agnostic/common/hw/mhw_mmio_common.h index f7367308ebc..ccf76805017 100644 --- a/media_softlet/agnostic/common/hw/mhw_mmio_common.h +++ b/media_softlet/agnostic/common/hw/mhw_mmio_common.h @@ -46,6 +46,7 @@ static constexpr uint32_t CS_GENERAL_PURPOSE_REGISTER11_HI_OFFSET static constexpr uint32_t CS_GENERAL_PURPOSE_REGISTER12_LO_OFFSET = 0x2660; static constexpr uint32_t CS_GENERAL_PURPOSE_REGISTER12_HI_OFFSET = 0x2664; static constexpr uint32_t CS_PREDICATE_RESULT2 = 0x23BC; +static constexpr uint32_t CS_ENGINE_ID_OFFSET = 0x1C008C; // Vebox register offsets // Used in Commen MI diff --git a/media_softlet/agnostic/common/os/mos_user_setting.cpp b/media_softlet/agnostic/common/os/mos_user_setting.cpp index 5f492074fac..65567b33369 100644 --- a/media_softlet/agnostic/common/os/mos_user_setting.cpp +++ b/media_softlet/agnostic/common/os/mos_user_setting.cpp @@ -1147,6 +1147,13 @@ MOS_STATUS MosUserSetting::InitUserSettingForDebug(MediaUserSettingSharedPtr use true, USER_SETTING_CONFIG_PERMANENT_PATH);//"If enabled, specify this is in pre-si simulation/emulation mode." + DeclareUserSettingKeyForDebug( + userSettingPtr, + __MEDIA_USER_FEATURE_VALUE_ENABLE_VDBOX_ID_REPORT, + MediaUserSetting::Group::Device, + 0, + true); //"Enable Vdbox physical engine id report" + DeclareUserSettingKeyForDebug( userSettingPtr, __MEDIA_USER_FEATURE_VALUE_FORCE_VDBOX, diff --git a/media_softlet/agnostic/common/shared/packet/media_packet.h b/media_softlet/agnostic/common/shared/packet/media_packet.h index 3ac9af897fb..6ce728fc403 100644 --- a/media_softlet/agnostic/common/shared/packet/media_packet.h +++ b/media_softlet/agnostic/common/shared/packet/media_packet.h @@ -193,6 +193,15 @@ class MediaPacket return ""; } +#if (_DEBUG || _RELEASE_INTERNAL) + //! + //! \brief Store engine id data + //! \return MOS_STATUS + //! MOS_STATUS_SUCCESS if success, else fail + //! + MOS_STATUS StoreEngineId(MOS_COMMAND_BUFFER *cmdBuffer, uint32_t statusReportType, uint8_t curPipe = 0, uint32_t csEngineIdReg = CS_ENGINE_ID_OFFSET); +#endif + protected: //! diff --git a/media_softlet/agnostic/common/shared/packet/media_packet_next.cpp b/media_softlet/agnostic/common/shared/packet/media_packet_next.cpp index b68ad0e2572..49ab462b9b7 100644 --- a/media_softlet/agnostic/common/shared/packet/media_packet_next.cpp +++ b/media_softlet/agnostic/common/shared/packet/media_packet_next.cpp @@ -143,4 +143,27 @@ MOS_STATUS MediaPacket::SetEndTagNext( MEDIA_CHK_STATUS_RETURN(m_miItf->MHW_ADDCMD_F(MI_STORE_DATA_IMM)(cmdBuffer)); return MOS_STATUS_SUCCESS; -} \ No newline at end of file +} + +#if (_DEBUG || _RELEASE_INTERNAL) +MOS_STATUS MediaPacket::StoreEngineId(MOS_COMMAND_BUFFER *cmdBuffer, uint32_t statusReportType, uint8_t curPipe, uint32_t csEngineIdReg) +{ + MEDIA_CHK_NULL_RETURN(m_miItf); + MEDIA_CHK_NULL_RETURN(m_statusReport); + + MOS_RESOURCE* osResource = nullptr; + uint32_t offset = 0; + + auto &par = m_miItf->MHW_GETPAR_F(MI_STORE_REGISTER_MEM)(); + par = {}; + + MEDIA_CHK_STATUS_RETURN(m_statusReport->GetAddress(statusReportType, osResource, offset)); + par.presStoreBuffer = osResource; + par.dwOffset = offset + curPipe * sizeof(uint32_t); + par.dwRegister = csEngineIdReg; + + MEDIA_CHK_STATUS_RETURN(m_miItf->MHW_ADDCMD_F(MI_STORE_REGISTER_MEM)(cmdBuffer)); + + return MOS_STATUS_SUCCESS; +} +#endif \ No newline at end of file diff --git a/media_softlet/agnostic/common/shared/statusreport/media_status_report.h b/media_softlet/agnostic/common/shared/statusreport/media_status_report.h index 8b1fe964d71..bb297cd1b58 100644 --- a/media_softlet/agnostic/common/shared/statusreport/media_status_report.h +++ b/media_softlet/agnostic/common/shared/statusreport/media_status_report.h @@ -114,6 +114,16 @@ class MediaStatusReport //! uint32_t GetSubmittedCount() const { return m_submittedCount; } +#if (_DEBUG || _RELEASE_INTERNAL) + //! + //! \brief Is Vdbox physical id reporting enabled + //! \return m_enableVdboxIdReport + //! + uint32_t IsVdboxIdReportEnabled() + { + return m_enableVdboxIdReport; + } +#endif //! //! \brief Get completed count of status report. //! \return The content of m_completedCount @@ -201,6 +211,9 @@ class MediaStatusReport StatusBufAddr *m_statusBufAddr = nullptr; +#if (_DEBUG || _RELEASE_INTERNAL) + bool m_enableVdboxIdReport = false; +#endif std::recursive_mutex m_lock; std::vector m_completeObservers; MEDIA_CLASS_DEFINE_END(MediaStatusReport)