diff --git a/media_driver/linux/common/os/mos_context_specific.cpp b/media_driver/linux/common/os/mos_context_specific.cpp index fc3441735b2..759fac4958b 100644 --- a/media_driver/linux/common/os/mos_context_specific.cpp +++ b/media_driver/linux/common/os/mos_context_specific.cpp @@ -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(>SystemInfo, sizeof(gtSystemInfo)); eStatus = HWInfo_GetGfxInfo(pOsDriverContext->fd, pOsDriverContext->bufmgr, &platformInfo, &skuTable, &waTable, >SystemInfo, pOsDriverContext->m_userSettingPtr); if (eStatus != MOS_STATUS_SUCCESS) diff --git a/media_driver/linux/common/os/mos_os_specific.c b/media_driver/linux/common/os/mos_os_specific.c index db8644a1ed9..3313d24dd66 100644 --- a/media_driver/linux/common/os/mos_os_specific.c +++ b/media_driver/linux/common/os/mos_os_specific.c @@ -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); @@ -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); diff --git a/media_softlet/agnostic/common/os/mos_solo_generic.h b/media_softlet/agnostic/common/os/mos_solo_generic.h index a5d6b7b1896..557dfa9eccf 100644 --- a/media_softlet/agnostic/common/os/mos_solo_generic.h +++ b/media_softlet/agnostic/common/os/mos_solo_generic.h @@ -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 diff --git a/media_softlet/linux/common/os/mos_context_specific_next.cpp b/media_softlet/linux/common/os/mos_context_specific_next.cpp index 840be1bdc62..9e9e3ff7ef0 100644 --- a/media_softlet/linux/common/os/mos_context_specific_next.cpp +++ b/media_softlet/linux/common/os/mos_context_specific_next.cpp @@ -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"); @@ -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) { diff --git a/media_softlet/linux/common/os/mos_graphicsresource_specific_next.cpp b/media_softlet/linux/common/os/mos_graphicsresource_specific_next.cpp index e61b88c7dfa..48a6e0a8e75 100644 --- a/media_softlet/linux/common/os/mos_graphicsresource_specific_next.cpp +++ b/media_softlet/linux/common/os/mos_graphicsresource_specific_next.cpp @@ -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;