Skip to content

Commit

Permalink
[Media Common][VP] Add Linux APO MOS support for media solo
Browse files Browse the repository at this point in the history
* [Media Common][VP] Add Linux APO MOS support for media solo

Implement APO MOS for media solo
  • Loading branch information
MicroYY authored and intel-mediadev committed Oct 11, 2023
1 parent cd2a7ce commit 9d85c0a
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 2 deletions.
4 changes: 2 additions & 2 deletions media_driver/linux/common/os/mos_context_specific.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,8 @@ MOS_STATUS OsContextSpecific::Init(PMOS_CONTEXT pOsDriverContext)
MEDIA_SYSTEM_INFO gtSystemInfo;

MOS_ZeroMemory(&platformInfo, sizeof(platformInfo));
MOS_ZeroMemory(&skuTable, sizeof(skuTable));
MOS_ZeroMemory(&waTable, sizeof(waTable));
skuTable.reset();
waTable.reset();
MOS_ZeroMemory(&gtSystemInfo, sizeof(gtSystemInfo));
eStatus = HWInfo_GetGfxInfo(pOsDriverContext->fd, pOsDriverContext->bufmgr, &platformInfo, &skuTable, &waTable, &gtSystemInfo, pOsDriverContext->m_userSettingPtr);
if (eStatus != MOS_STATUS_SUCCESS)
Expand Down
3 changes: 3 additions & 0 deletions media_driver/linux/common/os/mos_os_specific.c
Original file line number Diff line number Diff line change
Expand Up @@ -1656,6 +1656,8 @@ MOS_STATUS Mos_Specific_SetGpuContextHandle(
{
MOS_OS_FUNCTION_ENTER;

if (Mos_Solo_IsEnabled(nullptr)) return MOS_STATUS_SUCCESS;

MOS_OS_CHK_NULL_RETURN(pOsInterface);
MOS_OS_CHK_NULL_RETURN(pOsInterface->osContextPtr);

Expand Down Expand Up @@ -4693,6 +4695,7 @@ MOS_STATUS Mos_Specific_DestroyGpuContextByHandle(
PMOS_INTERFACE pOsInterface,
GPU_CONTEXT_HANDLE gpuContextHandle)
{
if (Mos_Solo_IsEnabled(nullptr)) return MOS_STATUS_SUCCESS;
if (pOsInterface && pOsInterface->apoMosEnabled)
{
return MosInterface::DestroyGpuContext(pOsInterface->osStreamState, gpuContextHandle);
Expand Down
1 change: 1 addition & 0 deletions media_softlet/agnostic/common/os/mos_solo_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@

#define Mos_Solo_SetPlatform(a, b)
#define Mos_Solo_SetSkuwaTable(a, b, c)
#define Mos_Solo_SetSkuwaGtInfo(a, b, c, d, e, f)

#endif // MOS_MEDIASOLO_SUPPORTED
#endif
Expand Down
17 changes: 17 additions & 0 deletions media_softlet/linux/common/os/mos_context_specific_next.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ MOS_STATUS OsContextSpecificNext::Init(DDI_DEVICE_CONTEXT ddiDriverContext)
iDeviceId = osDriverContext->iDeviceId;
}

// replace platform/sku/wa/gtsysinfo for os context
if (Mos_Solo_IsEnabled(nullptr))
{
m_skuTable.reset();
m_waTable.reset();
Mos_Solo_SetPlatform(&m_platformInfo, (PMOS_CONTEXT)osDriverContext);
Mos_Solo_SetSkuwaGtInfo((PMOS_CONTEXT)osDriverContext, m_platformInfo, m_skuTable, m_waTable, m_gtSystemInfo, iDeviceId);
}

if (eStatus != MOS_STATUS_SUCCESS)
{
MOS_OS_ASSERTMESSAGE("Fatal error - unsuccesfull Sku/Wa/GtSystemInfo initialization");
Expand Down Expand Up @@ -208,6 +217,14 @@ MOS_STATUS OsContextSpecificNext::Init(DDI_DEVICE_CONTEXT ddiDriverContext)
gmmInitAgrs.FileDescriptor = gmmAdapterBDF.Data;
gmmInitAgrs.ClientType = (GMM_CLIENT)GMM_LIBVA_LINUX;

// replace sku/wa/gtsysinfo for gmm client context
if (Mos_Solo_IsEnabled(nullptr))
{
gmmInitAgrs.pSkuTable = &m_skuTable;
gmmInitAgrs.pWaTable = &m_waTable;
gmmInitAgrs.pGtSysInfo = &m_gtSystemInfo;
}

GMM_STATUS status = InitializeGmm(&gmmInitAgrs, &gmmOutArgs);
if (status != GMM_SUCCESS)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ MOS_STATUS GraphicsResourceSpecificNext::ConvertToMosResource(MOS_RESOURCE* pMos
pMosResource->Format = m_format;
pMosResource->iWidth = m_width;
pMosResource->iHeight = m_height;
pMosResource->iSize = m_size;
pMosResource->iPitch = m_pitch;
pMosResource->iDepth = m_depth;
pMosResource->TileType = m_tileType;
Expand Down

0 comments on commit 9d85c0a

Please sign in to comment.