diff --git a/media_common/agnostic/common/os/mos_os.h b/media_common/agnostic/common/os/mos_os.h index b05faa6f3a..52144a297f 100644 --- a/media_common/agnostic/common/os/mos_os.h +++ b/media_common/agnostic/common/os/mos_os.h @@ -1040,6 +1040,10 @@ typedef struct _MOS_INTERFACE PMOS_INTERFACE pOsInterface, PMOS_RESOURCE pResource); + uint64_t (*pfnGetResourceClearAddress)( + PMOS_INTERFACE pOsInterface, + PMOS_RESOURCE pResource); + MOS_STATUS (* pfnSetPatchEntry) ( PMOS_INTERFACE pOsInterface, PMOS_PATCH_ENTRY_PARAMS pParams); diff --git a/media_driver/linux/common/os/mos_os_specific.c b/media_driver/linux/common/os/mos_os_specific.c index 87d73e1fdc..655e934f11 100644 --- a/media_driver/linux/common/os/mos_os_specific.c +++ b/media_driver/linux/common/os/mos_os_specific.c @@ -4271,6 +4271,24 @@ uint64_t Mos_Specific_GetResourceGfxAddress( return pResource->bo->offset64; } +//! +//! \brief Get Clear Color Address +//! \details The clear color address +//! \param PMOS_INTERFACE pOsInterface +//! [in] OS Interface +//! \param PMOS_RESOURCE pResource +//! [in] OS resource structure +//! \return uint64_t +//! The clear color address +//! +uint64_t Mos_Specific_GetResourceClearAddress( + PMOS_INTERFACE pOsInterface, + PMOS_RESOURCE pResource) +{ + uint64_t ui64ClearColorAddress = 0; + return ui64ClearColorAddress; +} + //! //! \brief Resizes the buffer to be used for rendering GPU commands //! \details return true if succeeded - command buffer will be large enough to hold dwMaxSize @@ -7047,6 +7065,7 @@ MOS_STATUS Mos_Specific_InitInterface( pOsInterface->pfnResetResourceAllocationIndex = Mos_Specific_ResetResourceAllocationIndex; pOsInterface->pfnGetResourceAllocationIndex = Mos_Specific_GetResourceAllocationIndex; pOsInterface->pfnGetResourceGfxAddress = Mos_Specific_GetResourceGfxAddress; + pOsInterface->pfnGetResourceClearAddress = Mos_Specific_GetResourceClearAddress; pOsInterface->pfnGetCommandBuffer = Mos_Specific_GetCommandBuffer; pOsInterface->pfnResetCommandBuffer = Mos_Specific_ResetCommandBuffer; pOsInterface->pfnReturnCommandBuffer = Mos_Specific_ReturnCommandBuffer; diff --git a/media_softlet/agnostic/common/renderhal/renderhal.cpp b/media_softlet/agnostic/common/renderhal/renderhal.cpp index fa9775785c..ede8b78ca4 100644 --- a/media_softlet/agnostic/common/renderhal/renderhal.cpp +++ b/media_softlet/agnostic/common/renderhal/renderhal.cpp @@ -6783,11 +6783,19 @@ MOS_STATUS RenderHal_SendSurfaceStateEntry( *(pdwCmd + 11) = *(pdwCmd + 11) | (uint32_t)((auxAddress & 0x0000FFFF00000000) >> 32); } - if (pMosResource->pGmmResInfo->GetUnifiedAuxSurfaceOffset(GMM_AUX_CC)) + uint64_t clearAddress = 0; + if (pOsInterface->trinityPath != TRINITY_DISABLED) + { + clearAddress = pOsInterface->pfnGetResourceClearAddress(pOsInterface, pMosResource); + } + else if (pMosResource->pGmmResInfo->GetUnifiedAuxSurfaceOffset(GMM_AUX_CC)) { // Set GFX address of ClearAddress // Should use original resource address here - uint64_t clearAddress = ui64GfxAddressWithoutOffset + (uint32_t)pMosResource->pGmmResInfo->GetUnifiedAuxSurfaceOffset(GMM_AUX_CC); + clearAddress = ui64GfxAddressWithoutOffset + (uint32_t)pMosResource->pGmmResInfo->GetUnifiedAuxSurfaceOffset(GMM_AUX_CC); + } + if (clearAddress) + { *(pdwCmd + 12) = (*(pdwCmd + 12) & 0x0000001F) | (uint32_t)(clearAddress & 0x00000000FFFFFFE0); *(pdwCmd + 13) = *(pdwCmd + 13) | (uint32_t)((clearAddress & 0x0000FFFF00000000) >> 32); } diff --git a/media_softlet/linux/common/os/private/mos_os_specific.cpp b/media_softlet/linux/common/os/private/mos_os_specific.cpp index 26e4e82bf5..31f09a4aae 100644 --- a/media_softlet/linux/common/os/private/mos_os_specific.cpp +++ b/media_softlet/linux/common/os/private/mos_os_specific.cpp @@ -1980,6 +1980,24 @@ uint64_t Mos_Specific_GetResourceGfxAddress( return MosInterface::GetResourceGfxAddress(osInterface->osStreamState, resource); } +//! +//! \brief Get Clear Color Address +//! \details The clear color address +//! \param PMOS_INTERFACE pOsInterface +//! [in] OS Interface +//! \param PMOS_RESOURCE pResource +//! [in] OS resource structure +//! \return uint64_t +//! The clear color address +//! +uint64_t Mos_Specific_GetResourceClearAddress( + PMOS_INTERFACE pOsInterface, + PMOS_RESOURCE pResource) +{ + uint64_t ui64ClearColorAddress = 0; + return ui64ClearColorAddress; +} + //! //! \brief Resizes the buffer to be used for rendering GPU commands //! \details return true if succeeded - command buffer will be large enough to hold dwMaxSize @@ -3419,6 +3437,7 @@ MOS_STATUS Mos_Specific_LoadFunction( osInterface->pfnResetResourceAllocationIndex = Mos_Specific_ResetResourceAllocationIndex; osInterface->pfnGetResourceAllocationIndex = Mos_Specific_GetResourceAllocationIndex; osInterface->pfnGetResourceGfxAddress = Mos_Specific_GetResourceGfxAddress; + osInterface->pfnGetResourceClearAddress = Mos_Specific_GetResourceClearAddress; osInterface->pfnGetCommandBuffer = Mos_Specific_GetCommandBuffer; osInterface->pfnResetCommandBuffer = Mos_Specific_ResetCommandBuffer; osInterface->pfnReturnCommandBuffer = Mos_Specific_ReturnCommandBuffer;