From 2cc1938f4692c0310df98726cc03d9d55d52e794 Mon Sep 17 00:00:00 2001 From: "Xu, Zhengguo" Date: Mon, 12 Jul 2021 11:14:53 +0800 Subject: [PATCH] Expose the reg to disable scalability This reg only works in release-internal/debug version. Expose it in release version now. This patch was imported from iHD media-driver git server (https://github.com/intel/media-driver.git) as of pull request https://github.com/intel/media-driver/pull/1221 Upstream-status: Submitted Signed-off-by: jinchung --- .../agnostic/common/codec/hal/codechal_decode_scalability.cpp | 5 +---- media_driver/agnostic/common/os/mos_os.h | 3 ++- media_driver/agnostic/common/os/mos_utilities.cpp | 2 +- media_driver/agnostic/gen11/hw/vdbox/mhw_vdbox_mfx_g11_X.h | 5 +---- .../agnostic/gen12/codec/hal/codechal_decode_scalability_g12.cpp | 8 +++----- media_driver/agnostic/gen12/hw/vdbox/mhw_vdbox_mfx_g12_X.h | 5 +---- media_driver/linux/common/os/mos_os_specific.c | 2 +- 7 files changed, 10 insertions(+), 20 deletions(-) mode change 100644 => 100755 media_driver/agnostic/common/codec/hal/codechal_decode_scalability.cpp mode change 100644 => 100755 media_driver/agnostic/common/os/mos_os.h mode change 100644 => 100755 media_driver/agnostic/common/os/mos_utilities.cpp mode change 100644 => 100755 media_driver/agnostic/gen11/hw/vdbox/mhw_vdbox_mfx_g11_X.h mode change 100644 => 100755 media_driver/agnostic/gen12/codec/hal/codechal_decode_scalability_g12.cpp mode change 100644 => 100755 media_driver/agnostic/gen12/hw/vdbox/mhw_vdbox_mfx_g12_X.h mode change 100644 => 100755 media_driver/linux/common/os/mos_os_specific.c diff --git a/media_driver/agnostic/common/codec/hal/codechal_decode_scalability.cpp b/media_driver/agnostic/common/codec/hal/codechal_decode_scalability.cpp old mode 100644 new mode 100755 index a7719c1..f6d71ef --- a/media_driver/agnostic/common/codec/hal/codechal_decode_scalability.cpp +++ b/media_driver/agnostic/common/codec/hal/codechal_decode_scalability.cpp @@ -1968,10 +1968,7 @@ MOS_STATUS CodecHalDecodeScalability_InitializeState ( vdboxNum = vdboxMfxInterface->GetNumVdbox(); if (vdboxNum < 2 -#if (_DEBUG || _RELEASE_INTERNAL) - || !osInterface->bHcpDecScalabilityMode -#endif - ) + || !osInterface->bHcpDecScalabilityMode) { eStatus = MOS_STATUS_INVALID_PARAMETER; CODECHAL_DECODE_ASSERTMESSAGE("not support scalability on this platform."); diff --git a/media_driver/agnostic/common/os/mos_os.h b/media_driver/agnostic/common/os/mos_os.h old mode 100644 new mode 100755 index dafa184..f59f1ff --- a/media_driver/agnostic/common/os/mos_os.h +++ b/media_driver/agnostic/common/os/mos_os.h @@ -1406,9 +1406,10 @@ typedef struct _MOS_INTERFACE #endif // MOS_MEDIASOLO_SUPPORTED bool VEEnable; bool bCanEnableSecureRt; + + int32_t bHcpDecScalabilityMode; //!< enable scalability decode {mode: default, user force, false} #if (_DEBUG || _RELEASE_INTERNAL) MOS_FORCE_VEBOX eForceVebox; //!< Force select Vebox - int32_t bHcpDecScalabilityMode; //!< enable scalability decode {mode: default, user force, false} int32_t bEnableDbgOvrdInVE; //!< It is for all scalable engines: used together with KMD VE for UMD to specify an engine directly int32_t bSoftReset; //!< trigger soft reset #endif // (_DEBUG || _RELEASE_INTERNAL) diff --git a/media_driver/agnostic/common/os/mos_utilities.cpp b/media_driver/agnostic/common/os/mos_utilities.cpp old mode 100644 new mode 100755 index 74c46e7..15ced88 --- a/media_driver/agnostic/common/os/mos_utilities.cpp +++ b/media_driver/agnostic/common/os/mos_utilities.cpp @@ -3858,7 +3858,7 @@ static MOS_USER_FEATURE_VALUE MOSUserFeatureDescFields[__MOS_USER_FEATURE_KEY_MA MOS_USER_FEATURE_VALUE_TYPE_BOOL, "0", "TRUE for Enabling KMD Virtual Engine Debug Override. (Default FALSE: not override"), - MOS_DECLARE_UF_KEY_DBGONLY(__MEDIA_USER_FEATURE_VALUE_ENABLE_HCP_SCALABILITY_DECODE_ID, + MOS_DECLARE_UF_KEY(__MEDIA_USER_FEATURE_VALUE_ENABLE_HCP_SCALABILITY_DECODE_ID, "Enable HCP Scalability Decode", __MEDIA_USER_FEATURE_SUBKEY_INTERNAL, __MEDIA_USER_FEATURE_SUBKEY_REPORT, diff --git a/media_driver/agnostic/gen11/hw/vdbox/mhw_vdbox_mfx_g11_X.h b/media_driver/agnostic/gen11/hw/vdbox/mhw_vdbox_mfx_g11_X.h old mode 100644 new mode 100755 index ca6f30b..79e60b3 --- a/media_driver/agnostic/gen11/hw/vdbox/mhw_vdbox_mfx_g11_X.h +++ b/media_driver/agnostic/gen11/hw/vdbox/mhw_vdbox_mfx_g11_X.h @@ -119,11 +119,8 @@ public: m_osInterface = osInterface; if (m_numVdbox > 1 -#if (_DEBUG || _RELEASE_INTERNAL) && m_osInterface != nullptr - && m_osInterface->bHcpDecScalabilityMode -#endif - ) + && m_osInterface->bHcpDecScalabilityMode) { m_scalabilitySupported = true; } diff --git a/media_driver/agnostic/gen12/codec/hal/codechal_decode_scalability_g12.cpp b/media_driver/agnostic/gen12/codec/hal/codechal_decode_scalability_g12.cpp old mode 100644 new mode 100755 index 857397b..6a6d3a8 --- a/media_driver/agnostic/gen12/codec/hal/codechal_decode_scalability_g12.cpp +++ b/media_driver/agnostic/gen12/codec/hal/codechal_decode_scalability_g12.cpp @@ -927,10 +927,7 @@ MOS_STATUS CodecHalDecodeScalability_InitializeState_G12( vdboxNum = vdboxMfxInterface->GetNumVdbox(); if (vdboxNum < 2 -#if (_DEBUG || _RELEASE_INTERNAL) - || !osInterface->bHcpDecScalabilityMode -#endif - ) + || !osInterface->bHcpDecScalabilityMode) { eStatus = MOS_STATUS_INVALID_PARAMETER; CODECHAL_DECODE_ASSERTMESSAGE("not support scalability on this platform."); @@ -1587,13 +1584,14 @@ MOS_STATUS CodecHalDecodeScalability_DecidePipeNum_G12( bCanEnableRealTile = !(static_cast(pScalState))->bDisableRtMode; if (!pScalStateG12->bEnableRtMultiPhase) u8MaxTileColumn = 2; +#endif if(!bCanEnableScalability && pOsInterface && (pOsInterface->bHcpDecScalabilityMode == MOS_SCALABILITY_ENABLE_MODE_USER_FORCE)) { bCanEnableScalability = true; } -#endif + bCanEnableRealTile = bCanEnableRealTile && pInitParamsG12->bIsTileEnabled && (pInitParams->u8NumTileColumns > 1) && (pInitParams->u8NumTileColumns <= u8MaxTileColumn) && (pInitParams->u8NumTileRows <= HEVC_NUM_MAX_TILE_ROW) && pInitParamsG12->bHasSubsetParams; diff --git a/media_driver/agnostic/gen12/hw/vdbox/mhw_vdbox_mfx_g12_X.h b/media_driver/agnostic/gen12/hw/vdbox/mhw_vdbox_mfx_g12_X.h old mode 100644 new mode 100755 index 88f37f2..4af87aa --- a/media_driver/agnostic/gen12/hw/vdbox/mhw_vdbox_mfx_g12_X.h +++ b/media_driver/agnostic/gen12/hw/vdbox/mhw_vdbox_mfx_g12_X.h @@ -118,11 +118,8 @@ public: m_osInterface = osInterface; if (m_numVdbox > 1 -#if (_DEBUG || _RELEASE_INTERNAL) && m_osInterface != nullptr - && m_osInterface->bHcpDecScalabilityMode -#endif - ) + && m_osInterface->bHcpDecScalabilityMode) { m_scalabilitySupported = true; } diff --git a/media_driver/linux/common/os/mos_os_specific.c b/media_driver/linux/common/os/mos_os_specific.c old mode 100644 new mode 100755 index b07739a..610f2ae --- a/media_driver/linux/common/os/mos_os_specific.c +++ b/media_driver/linux/common/os/mos_os_specific.c @@ -7286,7 +7286,6 @@ static MOS_STATUS Mos_Specific_InitInterface_Ve( osInterface->bGucSubmission = true; } -#if (_DEBUG || _RELEASE_INTERNAL) //Read Scalable/Legacy Decode mode on Gen11+ //1:by default for scalable decode mode //0:for legacy decode mode @@ -7304,6 +7303,7 @@ static MOS_STATUS Mos_Specific_InitInterface_Ve( osInterface->bHcpDecScalabilityMode = MOS_SCALABILITY_ENABLE_MODE_USER_FORCE; } +#if (_DEBUG || _RELEASE_INTERNAL) osInterface->frameSplit = false; MOS_ZeroMemory(&userFeatureData, sizeof(userFeatureData)); MOS_UserFeature_ReadValue_ID( -- 2.7.4