Skip to content

Commit

Permalink
[Decode] Fix the 3rd VD debug override issue
Browse files Browse the repository at this point in the history
Support the 3rd VDBox in the debug override Force VDBOX user key
  • Loading branch information
zxye authored and intel-mediadev committed Feb 5, 2025
1 parent a126f35 commit 7b698ed
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 9 deletions.
1 change: 1 addition & 0 deletions media_common/agnostic/common/os/mos_os.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ typedef enum _TRINITY_PATH
#define MOS_FORCE_VDBOX_NONE 0
#define MOS_FORCE_VDBOX_1 0x0001
#define MOS_FORCE_VDBOX_2 0x0002
#define MOS_FORCE_VDBOX_3 0x0003
//below is for scalability case,
//format is FE vdbox is specified as lowest 4 bits; BE0 is 2nd low 4 bits; BE1 is 3rd low 4bits.
#define MOS_FORCE_VDBOX_1_1_2 0x0211
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,31 @@ MediaContext::MediaContext(uint8_t componentType, void *hwInterface, PMOS_INTERF
m_streamId = m_osInterface->streamIndex;
m_gpuContextAttributeTable.clear();

MEDIA_SYSTEM_INFO *gtSystemInfo = nullptr;
MEDIA_ENGINE_INFO mediaEngineInfo = {};

auto skuTable = m_osInterface->pfnGetSkuTable(m_osInterface);
if (!skuTable)
{
MOS_OS_ASSERTMESSAGE("Failed to get skuTable");
return;
}
if (MEDIA_IS_SKU(skuTable,FtrMediaIPSeparation))
{
if (m_osInterface->pfnGetMediaEngineInfo(m_osInterface, mediaEngineInfo) == MOS_STATUS_SUCCESS)
{
m_numVdbox = (uint8_t)mediaEngineInfo.VDBoxInfo.NumberOfVDBoxEnabled;
}
}
else
{
gtSystemInfo = m_osInterface->pfnGetGtSystemInfo(m_osInterface);
if(gtSystemInfo)
{
m_numVdbox = (uint8_t)(gtSystemInfo->VDBoxInfo.NumberOfVDBoxEnabled);
}
}

if (m_numVdbox > 1
&& m_osInterface != nullptr
&& m_osInterface->bHcpDecScalabilityMode)
Expand Down Expand Up @@ -500,6 +525,7 @@ MOS_STATUS MediaContext::CheckScalabilityOverrideValidity()
bool scalableDecMode = false;
bool useVD1 = false;
bool useVD2 = false;
bool useVD3 = false;

MHW_MI_CHK_NULL(m_osInterface);
scalableDecMode = m_osInterface->bHcpDecScalabilityMode ? true : false;
Expand All @@ -519,6 +545,7 @@ MOS_STATUS MediaContext::CheckScalabilityOverrideValidity()
if (forceVdbox != MOS_FORCE_VDBOX_NONE &&
forceVdbox != MOS_FORCE_VDBOX_1 &&
forceVdbox != MOS_FORCE_VDBOX_2 &&
forceVdbox != MOS_FORCE_VDBOX_3 &&
// 2 pipes, VDBOX1-BE1, VDBOX2-BE2
forceVdbox != MOS_FORCE_VDBOX_1_1_2 &&
forceVdbox != MOS_FORCE_VDBOX_2_1_2)
Expand Down Expand Up @@ -551,13 +578,16 @@ MOS_STATUS MediaContext::CheckScalabilityOverrideValidity()
{
MHW_VDBOX_IS_VDBOX_SPECIFIED(forceVdbox, MOS_FORCE_VDBOX_1, MOS_FORCEVDBOX_VDBOXID_BITSNUM, MOS_FORCEVDBOX_MASK, useVD1);
MHW_VDBOX_IS_VDBOX_SPECIFIED(forceVdbox, MOS_FORCE_VDBOX_2, MOS_FORCEVDBOX_VDBOXID_BITSNUM, MOS_FORCEVDBOX_MASK, useVD2);
MHW_VDBOX_IS_VDBOX_SPECIFIED(forceVdbox, MOS_FORCE_VDBOX_3, MOS_FORCEVDBOX_VDBOXID_BITSNUM, MOS_FORCEVDBOX_MASK, useVD3);
}
if (MEDIA_IS_SKU(skuTable,FtrMediaIPSeparation))
{
if (!mediaEngineInfo.VDBoxInfo.IsValid ||
(useVD1 && !mediaEngineInfo.VDBoxInfo.Instances.Bits.VDBox0Enabled) ||
(useVD2 && !mediaEngineInfo.VDBoxInfo.Instances.Bits.VDBox2Enabled))
(useVD2 && !mediaEngineInfo.VDBoxInfo.Instances.Bits.VDBox2Enabled) ||
(useVD3 && !mediaEngineInfo.VDBoxInfo.Instances.Bits.VDBox1Enabled))
{
//1:VD0 2:VD2 3:VD1
eStatus = MOS_STATUS_INVALID_PARAMETER;
MHW_ASSERTMESSAGE("the forced VDBOX is not enabled in current platform.");
return eStatus;
Expand All @@ -567,7 +597,8 @@ MOS_STATUS MediaContext::CheckScalabilityOverrideValidity()
{
if (!gtSystemInfo->VDBoxInfo.IsValid ||
(useVD1 && !gtSystemInfo->VDBoxInfo.Instances.Bits.VDBox0Enabled) ||
(useVD2 && !gtSystemInfo->VDBoxInfo.Instances.Bits.VDBox2Enabled))
(useVD2 && !gtSystemInfo->VDBoxInfo.Instances.Bits.VDBox2Enabled) ||
(useVD3 && !gtSystemInfo->VDBoxInfo.Instances.Bits.VDBox1Enabled))
{
eStatus = MOS_STATUS_INVALID_PARAMETER;
MHW_ASSERTMESSAGE("the forced VDBOX is not enabled in current platform.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,6 @@ class MediaContext

uint8_t GetNumVdbox()
{
m_numVdbox = 1;
MEDIA_SYSTEM_INFO *gtSystemInfo = m_osInterface->pfnGetGtSystemInfo(m_osInterface);
if (gtSystemInfo != nullptr)
{
// Both VE mode and media solo mode should be able to get the VDBOX number via the same interface
m_numVdbox = (uint8_t)(gtSystemInfo->VDBoxInfo.NumberOfVDBoxEnabled);
}
return m_numVdbox;
}

Expand Down

0 comments on commit 7b698ed

Please sign in to comment.