From 91a66059716b183bba55c92279ef7d074e6d6c32 Mon Sep 17 00:00:00 2001 From: JayYang Date: Thu, 7 Dec 2023 00:09:36 +0800 Subject: [PATCH] Revert "[Media Common] [VP] Remove mem decompress code and replace it with vebox copy" This reverts commit 107dfc6d8. --- media_common/agnostic/common/os/mos_os.h | 12 +- .../linux/common/os/mos_os_specific.h | 2 +- .../linux/common/os/mos_os_specific.c | 67 +------ .../common/codec/hal/codechal_debug.cpp | 4 +- .../dec/avc/pipeline/decode_avc_pipeline.cpp | 6 +- .../agnostic/common/os/mos_interface.h | 53 +----- .../common/shared/mediacopy/media_copy.cpp | 1 - .../mediacopy/media_vebox_copy_next.cpp | 5 +- .../linux/common/os/mos_interface.cpp | 163 ++---------------- .../common/os/private/mos_os_specific.cpp | 4 +- 10 files changed, 35 insertions(+), 282 deletions(-) diff --git a/media_common/agnostic/common/os/mos_os.h b/media_common/agnostic/common/os/mos_os.h index 70c18c598e8..2bba0934fda 100644 --- a/media_common/agnostic/common/os/mos_os.h +++ b/media_common/agnostic/common/os/mos_os.h @@ -1005,19 +1005,11 @@ typedef struct _MOS_INTERFACE PMOS_RESOURCE pOutputOsResource, uint32_t copyWidth, uint32_t copyHeight, + uint32_t copyInputOffset, + uint32_t copyOutputOffset, uint32_t bpp, bool bOutputCompressed); - MOS_STATUS (*pfnMonoSurfaceCopy) ( - PMOS_INTERFACE pOsInterface, - PMOS_RESOURCE pInputOsResource, - PMOS_RESOURCE pOutputOsResource, - uint32_t copyWidth, - uint32_t copyHeight, - uint32_t copyInputOffset, - uint32_t copyOutputOffset, - bool bOutputCompressed); - MOS_STATUS (*pfnVerifyMosSurface) ( PMOS_SURFACE mosSurface, bool &bIsValid); diff --git a/media_common/linux/common/os/mos_os_specific.h b/media_common/linux/common/os/mos_os_specific.h index 47a9c9a1e4b..69c3c9e794c 100644 --- a/media_common/linux/common/os/mos_os_specific.h +++ b/media_common/linux/common/os/mos_os_specific.h @@ -375,7 +375,6 @@ struct _MOS_SPECIFIC_RESOURCE MOS_PLANE_OFFSET YPlaneOffset; //!< Y surface plane offset MOS_PLANE_OFFSET UPlaneOffset; //!< U surface plane offset MOS_PLANE_OFFSET VPlaneOffset; //!< V surface plane offset - uint32_t dwOffset; //!< to sync render target for multi-threading decoding mode struct @@ -387,6 +386,7 @@ struct _MOS_SPECIFIC_RESOURCE #if MOS_MEDIASOLO_SUPPORTED //!< these fields are only used while MediaSolo is enabled(bSoloInUse of OS_Interface is true). + uint32_t dwOffset; FILE* pFile; char *pcFilePath; int32_t bManualSwizzlingInUse; diff --git a/media_driver/linux/common/os/mos_os_specific.c b/media_driver/linux/common/os/mos_os_specific.c index 488449aa021..b3a92db37a1 100644 --- a/media_driver/linux/common/os/mos_os_specific.c +++ b/media_driver/linux/common/os/mos_os_specific.c @@ -3320,6 +3320,8 @@ MOS_STATUS Mos_Specific_MediaCopyResource2D( PMOS_RESOURCE outputOsResource, uint32_t copyWidth, uint32_t copyHeight, + uint32_t copyInputOffset, + uint32_t copyOutputOffset, uint32_t bpp, bool bOutputCompressed) { @@ -3335,7 +3337,7 @@ MOS_STATUS Mos_Specific_MediaCopyResource2D( if (osInterface->apoMosEnabled) { return MosInterface::MediaCopyResource2D(osInterface->osStreamState, inputOsResource, outputOsResource, - copyWidth, copyHeight, bpp, bOutputCompressed); + copyWidth, copyHeight, copyInputOffset, copyOutputOffset, bpp, bOutputCompressed); } pContext = osInterface->pOsContext; @@ -3344,7 +3346,7 @@ MOS_STATUS Mos_Specific_MediaCopyResource2D( outputOsResource && outputOsResource->bo && outputOsResource->pGmmResInfo) { // Double Buffer Copy can support any tile status surface with/without compression - pContext->pfnMediaMemoryCopy2D(pContext, inputOsResource, outputOsResource, copyWidth, copyHeight, 0, 0, bpp, bOutputCompressed); + pContext->pfnMediaMemoryCopy2D(pContext, inputOsResource, outputOsResource, copyWidth, copyHeight, copyInputOffset, copyOutputOffset, bpp, bOutputCompressed); } eStatus = MOS_STATUS_SUCCESS; @@ -3353,66 +3355,6 @@ MOS_STATUS Mos_Specific_MediaCopyResource2D( return eStatus; } -//! -//! \brief Copy mono picture -//! \details This is the copy function dedicated to mono picture copy -//! \param PMOS_INTERFACE pOsInterface -//! [in] pointer to OS Interface structure -//! \param PMOS_RESOURCE inputOsResource -//! [in] Input Resource object -//! \param PMOS_RESOURCE outputOsResource -//! [out] output Resource object -//! \param [in] copyWidth -//! The 2D surface Width -//! \param [in] copyHeight -//! The 2D surface height -//! \param [in] copyInputOffset -//! The offset of copied surface from -//! \param [in] copyOutputOffset -//! The offset of copied to -//! \param [in] bOutputCompressed -//! true means apply compression on output surface, else output uncompressed surface -//! \return MOS_STATUS -//! MOS_STATUS_SUCCESS if successful -//! -MOS_STATUS Mos_Specific_MonoSurfaceCopy( - PMOS_INTERFACE osInterface, - PMOS_RESOURCE inputOsResource, - PMOS_RESOURCE outputOsResource, - uint32_t copyWidth, - uint32_t copyHeight, - uint32_t copyInputOffset, - uint32_t copyOutputOffset, - bool bOutputCompressed) -{ - MOS_STATUS eStatus = MOS_STATUS_UNKNOWN; - MOS_OS_CONTEXT *pContext = nullptr; - - //--------------------------------------- - MOS_OS_CHK_NULL_RETURN(osInterface); - MOS_OS_CHK_NULL_RETURN(inputOsResource); - MOS_OS_CHK_NULL_RETURN(outputOsResource); - //--------------------------------------- - - if (osInterface->apoMosEnabled) - { - return MosInterface::MonoSurfaceCopy(osInterface->osStreamState, inputOsResource, outputOsResource, copyWidth, copyHeight, copyInputOffset, copyOutputOffset, bOutputCompressed); - } - - pContext = osInterface->pOsContext; - - if (inputOsResource && inputOsResource->bo && inputOsResource->pGmmResInfo && - outputOsResource && outputOsResource->bo && outputOsResource->pGmmResInfo) - { - // Double Buffer Copy can support any tile status surface with/without compression - pContext->pfnMediaMemoryCopy2D(pContext, inputOsResource, outputOsResource, copyWidth, copyHeight, 0, 0, 16, bOutputCompressed); - } - - eStatus = MOS_STATUS_SUCCESS; - - return eStatus; -} - //! //! \brief Get Mos Context //! \details Get Mos Context info @@ -7152,7 +7094,6 @@ MOS_STATUS Mos_Specific_InitInterface( pOsInterface->pfnSetDecompSyncRes = Mos_Specific_SetDecompSyncRes; pOsInterface->pfnDoubleBufferCopyResource = Mos_Specific_DoubleBufferCopyResource; pOsInterface->pfnMediaCopyResource2D = Mos_Specific_MediaCopyResource2D; - pOsInterface->pfnMonoSurfaceCopy = Mos_Specific_MonoSurfaceCopy; pOsInterface->pfnGetMosContext = Mos_Specific_GetMosContext; pOsInterface->pfnUpdateResourceUsageType = Mos_Specific_UpdateResourceUsageType; pOsInterface->pfnRegisterResource = Mos_Specific_RegisterResource; diff --git a/media_softlet/agnostic/common/codec/hal/codechal_debug.cpp b/media_softlet/agnostic/common/codec/hal/codechal_debug.cpp index a0a0c4cd152..459c204df62 100644 --- a/media_softlet/agnostic/common/codec/hal/codechal_debug.cpp +++ b/media_softlet/agnostic/common/codec/hal/codechal_debug.cpp @@ -1979,7 +1979,7 @@ CodechalDebugInterface::CodechalDebugInterface() uint32_t bpp = surface->OsResource.pGmmResInfo->GetBitsPerPixel(); - CODECHAL_DEBUG_CHK_STATUS(m_osInterface->pfnMediaCopyResource2D(m_osInterface, &surface->OsResource, &m_temp2DSurfForCopy.OsResource, surface->dwPitch, sizeSrcSurface / (surface->dwPitch), bpp, false)); + CODECHAL_DEBUG_CHK_STATUS(m_osInterface->pfnMediaCopyResource2D(m_osInterface, &surface->OsResource, &m_temp2DSurfForCopy.OsResource, surface->dwPitch, sizeSrcSurface / (surface->dwPitch), 0, 0, bpp, false)); lockedAddr = (uint8_t *)m_osInterface->pfnLockResource(m_osInterface, &m_temp2DSurfForCopy.OsResource, &lockFlags); CODECHAL_DEBUG_CHK_NULL(lockedAddr); @@ -2659,7 +2659,7 @@ MOS_STATUS CodechalDebugInterface::DumpRgbDataOnYUVSurface( uint32_t bpp = surface->OsResource.pGmmResInfo->GetBitsPerPixel(); - CODECHAL_DEBUG_CHK_STATUS(m_osInterface->pfnMediaCopyResource2D(m_osInterface, &surface->OsResource, &m_temp2DSurfForCopy.OsResource, surface->dwPitch, sizeSrcSurface / (surface->dwPitch), bpp, false)); + CODECHAL_DEBUG_CHK_STATUS(m_osInterface->pfnMediaCopyResource2D(m_osInterface, &surface->OsResource, &m_temp2DSurfForCopy.OsResource, surface->dwPitch, sizeSrcSurface / (surface->dwPitch), 0, 0, bpp, false)); } else { diff --git a/media_softlet/agnostic/common/codec/hal/dec/avc/pipeline/decode_avc_pipeline.cpp b/media_softlet/agnostic/common/codec/hal/dec/avc/pipeline/decode_avc_pipeline.cpp index 5e0bc5f3f33..d44bf4068df 100644 --- a/media_softlet/agnostic/common/codec/hal/dec/avc/pipeline/decode_avc_pipeline.cpp +++ b/media_softlet/agnostic/common/codec/hal/dec/avc/pipeline/decode_avc_pipeline.cpp @@ -144,7 +144,7 @@ namespace decode } else { - m_osInterface->pfnMonoSurfaceCopy( + m_osInterface->pfnMediaCopyResource2D( m_osInterface, &m_basicFeature->m_resMonoPicChromaBuffer->OsResource, &m_basicFeature->m_destSurface.OsResource, @@ -152,6 +152,7 @@ namespace decode uvblockHeight * 2, 0, dstOffset, + 16, false); } } @@ -170,7 +171,7 @@ namespace decode } else { - m_osInterface->pfnMonoSurfaceCopy( + m_osInterface->pfnMediaCopyResource2D( m_osInterface, &m_basicFeature->m_resMonoPicChromaBuffer->OsResource, &m_basicFeature->m_destSurface.OsResource, @@ -178,6 +179,7 @@ namespace decode uvsize / pitch, 0, dstOffset, + 16, false); } } diff --git a/media_softlet/agnostic/common/os/mos_interface.h b/media_softlet/agnostic/common/os/mos_interface.h index 703aafd40ed..d71d48fae81 100644 --- a/media_softlet/agnostic/common/os/mos_interface.h +++ b/media_softlet/agnostic/common/os/mos_interface.h @@ -1657,26 +1657,6 @@ class MosInterface MOS_RESOURCE_HANDLE outputResource, bool outputCompressed); - //! - //! \brief Use media copy to copy resource - //! - //! \param [in] streamState - //! Handle of Os Stream State - //! \param [in] inputResource - //! Source resource. - //! \param [out] outputResource - //! Destination resource. - //! \param [in] preferMethod - //! Preferred copy engine. - //! \return MOS_STATUS - //! Return MOS_STATUS_SUCCESS if successful, otherwise failed - //! - static MOS_STATUS UnifiedMediaCopyResource( - MOS_STREAM_HANDLE streamState, - MOS_RESOURCE_HANDLE inputResource, - MOS_RESOURCE_HANDLE outputResource, - int preferMethod); - //! //! \brief Copy Resource to Another Buffer //! \details Decompress and Copy Resource to Another 2D Buffer @@ -1701,38 +1681,6 @@ class MosInterface //! MOS_STATUS_SUCCESS if successful //! static MOS_STATUS MediaCopyResource2D( - MOS_STREAM_HANDLE streamState, - MOS_RESOURCE_HANDLE inputResource, - MOS_RESOURCE_HANDLE outputResource, - uint32_t copyWidth, - uint32_t copyHeight, - uint32_t bpp, - bool outputCompressed); - - //! - //! \brief Copy Mono Resource to Another Buffer - //! \details Decompress and Copy Mono Resource to Another 2D Buffer - //! - //! \param [in] streamState - //! Handle of Os Stream State - //! \param inputResource - //! [in] Input Resource object - //! \param outputResource - //! [out] output Resource object - //! \param [in] copyWidth - //! The 2D surface Width - //! \param [in] copyHeight - //! The 2D surface height - //! \param [in] copyInputOffset - //! The offset of copied surface from - //! \param [in] copyOutputOffset - //! The offset of copied to - //! \param [in] outputCompressed - //! True means apply compression on output surface, else output uncompressed surface - //! \return MOS_STATUS - //! MOS_STATUS_SUCCESS if successful - //! - static MOS_STATUS MonoSurfaceCopy( MOS_STREAM_HANDLE streamState, MOS_RESOURCE_HANDLE inputResource, MOS_RESOURCE_HANDLE outputResource, @@ -1740,6 +1688,7 @@ class MosInterface uint32_t copyHeight, uint32_t copyInputOffset, uint32_t copyOutputOffset, + uint32_t bpp, bool outputCompressed); //! diff --git a/media_softlet/agnostic/common/shared/mediacopy/media_copy.cpp b/media_softlet/agnostic/common/shared/mediacopy/media_copy.cpp index f0ff08e3c1a..cc3f2402623 100644 --- a/media_softlet/agnostic/common/shared/mediacopy/media_copy.cpp +++ b/media_softlet/agnostic/common/shared/mediacopy/media_copy.cpp @@ -252,7 +252,6 @@ uint32_t GetMinRequiredSurfaceSizeInBytes(uint32_t pitch, uint32_t height, MOS_F case Format_P8: case Format_L8: case Format_A8: - case Format_Y16U: nBytes = pitch * height; break; default: diff --git a/media_softlet/agnostic/common/shared/mediacopy/media_vebox_copy_next.cpp b/media_softlet/agnostic/common/shared/mediacopy/media_vebox_copy_next.cpp index 476c6a3c17d..f776e4313d4 100644 --- a/media_softlet/agnostic/common/shared/mediacopy/media_vebox_copy_next.cpp +++ b/media_softlet/agnostic/common/shared/mediacopy/media_vebox_copy_next.cpp @@ -306,7 +306,7 @@ MOS_STATUS VeboxCopyStateNext::GetResourceInfo(PMOS_SURFACE surface) surface->bGMMTileEnabled = resDetails.bGMMTileEnabled; surface->bCompressible = resDetails.bCompressible; surface->bIsCompressed = resDetails.bIsCompressed; - surface->dwOffset = resDetails.RenderOffset.YUV.Y.BaseOffset + surface->OsResource.dwOffset; + surface->dwOffset = resDetails.RenderOffset.YUV.Y.BaseOffset; surface->YPlaneOffset.iSurfaceOffset = resDetails.RenderOffset.YUV.Y.BaseOffset; surface->YPlaneOffset.iXOffset = resDetails.RenderOffset.YUV.Y.XOffset; surface->YPlaneOffset.iYOffset = resDetails.RenderOffset.YUV.Y.YOffset; @@ -606,8 +606,7 @@ bool VeboxCopyStateNext::IsFormatSupported(PMOS_SURFACE surface) surface->Format != Format_A8B8G8R8 && surface->Format != Format_X8R8G8B8 && surface->Format != Format_X8B8G8R8 && - surface->Format != Format_P8 && - surface->Format != Format_Y16U) + surface->Format != Format_P8) { VEBOX_COPY_NORMALMESSAGE("Unsupported Source Format '0x%08x' for VEBOX Decompression.", surface->Format); return bRet; diff --git a/media_softlet/linux/common/os/mos_interface.cpp b/media_softlet/linux/common/os/mos_interface.cpp index b9ff6d25b42..d2a1c03dd26 100644 --- a/media_softlet/linux/common/os/mos_interface.cpp +++ b/media_softlet/linux/common/os/mos_interface.cpp @@ -2438,20 +2438,6 @@ MOS_STATUS MosInterface::GetMemoryCompressionFormat( return eStatus; } -MOS_STATUS MosInterface::UnifiedMediaCopyResource( - MOS_STREAM_HANDLE streamState, - MOS_RESOURCE_HANDLE inputResource, - MOS_RESOURCE_HANDLE outputResource, - int preferMethod) -{ - auto pOsDeviceContext = streamState->osDeviceContext; - MOS_OS_CHK_NULL_RETURN(pOsDeviceContext); - auto pMosMediaCopy = pOsDeviceContext->GetMosMediaCopy(); - MOS_OS_CHK_NULL_RETURN(pMosMediaCopy); - - return pMosMediaCopy->MediaCopy(inputResource, outputResource, (MCPY_METHOD)preferMethod); -} - MOS_STATUS MosInterface::DoubleBufferCopyResource( MOS_STREAM_HANDLE streamState, MOS_RESOURCE_HANDLE inputResource, @@ -2465,27 +2451,15 @@ MOS_STATUS MosInterface::DoubleBufferCopyResource( MOS_OS_CHK_NULL_RETURN(outputResource); MOS_OS_CHK_NULL_RETURN(streamState); - MosDecompression *mosDecompression = nullptr; - auto lbdMemDecomp = [&]() + if (inputResource && inputResource->bo && inputResource->pGmmResInfo && + outputResource && outputResource->bo && outputResource->pGmmResInfo) { - if (inputResource->bo && inputResource->pGmmResInfo && - outputResource->bo && outputResource->pGmmResInfo) - { - MOS_OS_CHK_STATUS_RETURN(MosInterface::GetMosDecompressionFromStreamState(streamState, mosDecompression)); - MOS_OS_CHK_NULL_RETURN(mosDecompression); - - // Double Buffer Copy can support any tile status surface with/without compression - return mosDecompression->MediaMemoryCopy(inputResource, outputResource, outputCompressed); - } - else - { - return MOS_STATUS_NULL_POINTER; - } - }; + MosDecompression *mosDecompression = nullptr; + MOS_OS_CHK_STATUS_RETURN(MosInterface::GetMosDecompressionFromStreamState(streamState, mosDecompression)); + MOS_OS_CHK_NULL_RETURN(mosDecompression); - if (lbdMemDecomp() != MOS_STATUS_SUCCESS && !mosDecompression) - { - status = MosInterface::UnifiedMediaCopyResource(streamState, inputResource, outputResource, MCPY_METHOD_BALANCE); + // Double Buffer Copy can support any tile status surface with/without compression + mosDecompression->MediaMemoryCopy(inputResource, outputResource, outputCompressed); } return status; @@ -2521,49 +2495,6 @@ MOS_STATUS MosInterface::VerifyMosSurface( } MOS_STATUS MosInterface::MediaCopyResource2D( - MOS_STREAM_HANDLE streamState, - MOS_RESOURCE_HANDLE inputResource, - MOS_RESOURCE_HANDLE outputResource, - uint32_t copyWidth, - uint32_t copyHeight, - uint32_t bpp, - bool outputCompressed) -{ - MOS_OS_FUNCTION_ENTER; - - MOS_STATUS status = MOS_STATUS_SUCCESS; - MOS_OS_CHK_NULL_RETURN(inputResource); - MOS_OS_CHK_NULL_RETURN(outputResource); - MOS_OS_CHK_NULL_RETURN(streamState); - - MosDecompression *mosDecompression = nullptr; - auto lbdMemDecomp = [&]() - { - if (inputResource->bo && inputResource->pGmmResInfo && - outputResource->bo && outputResource->pGmmResInfo) - { - MOS_OS_CHK_STATUS_RETURN(MosInterface::GetMosDecompressionFromStreamState(streamState, mosDecompression)); - MOS_OS_CHK_NULL_RETURN(mosDecompression); - - // Double Buffer Copy can support any tile status surface with/without compression - return mosDecompression->MediaMemoryCopy2D(inputResource, outputResource, - copyWidth, copyHeight, 0, 0, bpp, outputCompressed); - } - else - { - return MOS_STATUS_NULL_POINTER; - } - }; - - if (lbdMemDecomp() != MOS_STATUS_SUCCESS && !mosDecompression) - { - status = MosInterface::UnifiedMediaCopyResource(streamState, inputResource, outputResource, MCPY_METHOD_BALANCE); - } - - return status; -} - -MOS_STATUS MosInterface::MonoSurfaceCopy( MOS_STREAM_HANDLE streamState, MOS_RESOURCE_HANDLE inputResource, MOS_RESOURCE_HANDLE outputResource, @@ -2571,6 +2502,7 @@ MOS_STATUS MosInterface::MonoSurfaceCopy( uint32_t copyHeight, uint32_t copyInputOffset, uint32_t copyOutputOffset, + uint32_t bpp, bool outputCompressed) { MOS_OS_FUNCTION_ENTER; @@ -2580,79 +2512,16 @@ MOS_STATUS MosInterface::MonoSurfaceCopy( MOS_OS_CHK_NULL_RETURN(outputResource); MOS_OS_CHK_NULL_RETURN(streamState); - MosDecompression *mosDecompression = nullptr; - auto lbdMemDecomp = [&]() - { - if (inputResource->bo && inputResource->pGmmResInfo && - outputResource->bo && outputResource->pGmmResInfo) - { - MOS_OS_CHK_STATUS_RETURN(MosInterface::GetMosDecompressionFromStreamState(streamState, mosDecompression)); - MOS_OS_CHK_NULL_RETURN(mosDecompression); - - // Double Buffer Copy can support any tile status surface with/without compression - return mosDecompression->MediaMemoryCopy2D(inputResource, outputResource, - copyWidth, copyHeight, copyInputOffset, copyOutputOffset, 16, outputCompressed); - } - else - { - return MOS_STATUS_NULL_POINTER; - } - }; - - // Use media copy in case of mem decompression failed - if (lbdMemDecomp() != MOS_STATUS_SUCCESS && !mosDecompression) + if (inputResource && inputResource->bo && inputResource->pGmmResInfo && + outputResource && outputResource->bo && outputResource->pGmmResInfo) { - MOS_SURFACE inputResInfo, outputResInfo; - MOS_ZeroMemory(&inputResInfo, sizeof(MOS_SURFACE)); - MOS_ZeroMemory(&outputResInfo, sizeof(MOS_SURFACE)); - - struct BackupResInfo - { - MOS_FORMAT format; - uint32_t height; - uint32_t width; - uint32_t pitch; - uint32_t offset; - }; + MosDecompression *mosDecompression = nullptr; + MOS_OS_CHK_STATUS_RETURN(MosInterface::GetMosDecompressionFromStreamState(streamState, mosDecompression)); + MOS_OS_CHK_NULL_RETURN(mosDecompression); - inputResInfo.Format = Format_Invalid; - MOS_OS_CHK_STATUS_RETURN(MosInterface::GetResourceInfo(streamState, inputResource, inputResInfo)); - BackupResInfo bkIn = {inputResInfo.Format, inputResInfo.dwHeight, inputResInfo.dwWidth, inputResInfo.dwPitch}; - - outputResInfo.Format = Format_Invalid; - MOS_OS_CHK_STATUS_RETURN(MosInterface::GetResourceInfo(streamState, outputResource, outputResInfo)); - BackupResInfo bkOut = {outputResInfo.Format, outputResInfo.dwHeight, outputResInfo.dwWidth, outputResInfo.dwPitch}; - - uint32_t pixelInByte = 2; - MOS_FORMAT overrideFormat = Format_Y16U; - - inputResource->pGmmResInfo->OverrideSurfaceFormat(MosInterface::MosFmtToGmmFmt(overrideFormat)); - inputResource->pGmmResInfo->OverrideBaseWidth(copyWidth / pixelInByte); - inputResource->pGmmResInfo->OverridePitch(copyWidth); - inputResource->pGmmResInfo->OverrideBaseHeight(copyHeight); - outputResource->pGmmResInfo->OverrideSurfaceFormat(MosInterface::MosFmtToGmmFmt(overrideFormat)); - outputResource->pGmmResInfo->OverrideBaseWidth(copyWidth / pixelInByte); - outputResource->pGmmResInfo->OverridePitch(copyWidth); - outputResource->pGmmResInfo->OverrideBaseHeight(copyHeight); - - uint32_t inOffset = inputResource->dwOffset; - uint32_t outOffset = outputResource->dwOffset; - inputResource->dwOffset = copyInputOffset; - outputResource->dwOffset = copyOutputOffset; - - status = MosInterface::UnifiedMediaCopyResource(streamState, inputResource, outputResource, MCPY_METHOD_BALANCE); - - inputResource->pGmmResInfo->OverrideSurfaceFormat(MosInterface::MosFmtToGmmFmt(bkIn.format)); - inputResource->pGmmResInfo->OverrideBaseWidth(bkIn.width); - inputResource->pGmmResInfo->OverrideBaseWidth(bkIn.pitch); - inputResource->pGmmResInfo->OverrideBaseHeight(bkIn.height); - outputResource->pGmmResInfo->OverrideSurfaceFormat(MosInterface::MosFmtToGmmFmt(bkOut.format)); - outputResource->pGmmResInfo->OverrideBaseWidth(bkOut.width); - outputResource->pGmmResInfo->OverrideBaseWidth(bkOut.pitch); - outputResource->pGmmResInfo->OverrideBaseHeight(bkOut.height); - - inputResource->dwOffset = inOffset; - outputResource->dwOffset = outOffset; + // Double Buffer Copy can support any tile status surface with/without compression + mosDecompression->MediaMemoryCopy2D(inputResource, outputResource, + copyWidth, copyHeight, copyInputOffset, copyOutputOffset, bpp, outputCompressed); } return status; 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 54091ffbfcc..e50225e4f37 100644 --- a/media_softlet/linux/common/os/private/mos_os_specific.cpp +++ b/media_softlet/linux/common/os/private/mos_os_specific.cpp @@ -1510,13 +1510,15 @@ MOS_STATUS Mos_Specific_MediaCopyResource2D( PMOS_RESOURCE outputOsResource, uint32_t copyWidth, uint32_t copyHeight, + uint32_t copyInputOffset, + uint32_t copyOutputOffset, uint32_t bpp, bool outputCompressed) { MOS_OS_CHK_NULL_RETURN(osInterface); return MosInterface::MediaCopyResource2D(osInterface->osStreamState, inputOsResource, outputOsResource, - copyWidth, copyHeight, bpp, outputCompressed); + copyWidth, copyHeight, copyInputOffset, copyOutputOffset, bpp, outputCompressed); } //!