1 /* 2 * Copyright (c) 2024, Intel Corporation 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining a 5 * copy of this software and associated documentation files (the "Software"), 6 * to deal in the Software without restriction, including without limitation 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 * and/or sell copies of the Software, and to permit persons to whom the 9 * Software is furnished to do so, subject to the following conditions: 10 * 11 * The above copyright notice and this permission notice shall be included 12 * in all copies or substantial portions of the Software. 13 * 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20 * OTHER DEALINGS IN THE SOFTWARE. 21 */ 22 //! 23 //! \file media_copy_xe2_lpm.h 24 //! \brief Common interface and structure used in media copy 25 //! \details Common interface and structure used in media copy which are platform independent 26 //! 27 28 #ifndef __MEDIA_COPY_XE2_LPM_H__ 29 #define __MEDIA_COPY_XE2_LPM_H__ 30 31 #include "media_copy.h" 32 #include "media_vebox_copy_xe2_lpm.h" 33 #include "media_render_copy_xe2_lpm.h" 34 #include "media_blt_copy_xe2_lpm.h" 35 36 class MediaCopyStateXe2_Lpm: public MediaCopyBaseState 37 { 38 public: 39 //! 40 //! \brief MediaCopyStateXe_Xpm_Plus constructor 41 //! \details Initialize the MediaCopy members. 42 //! \param osInterface 43 //! [in] Pointer to MOS_INTERFACE. 44 //! 45 MediaCopyStateXe2_Lpm(); 46 virtual ~MediaCopyStateXe2_Lpm(); 47 48 //! 49 //! \brief init function. 50 virtual MOS_STATUS Initialize(PMOS_INTERFACE osInterface, MhwInterfacesNext *mhwInterfaces); 51 52 //! 53 //! \brief render format support. 54 //! \details surface format support. 55 //! \param src 56 //! [in] Pointer to source surface 57 //! \param dst 58 //! [in] Pointer to destination surface 59 //! \return bool 60 //! Return true if support, otherwise return false. 61 //! 62 virtual bool RenderFormatSupportCheck(PMOS_RESOURCE src, PMOS_RESOURCE dst); 63 64 //! 65 //! \brief feature support check on specific check. 66 //! \details media copy feature support. 67 //! \param src 68 //! [in] Pointer to source surface 69 //! \param dst 70 //! [in] Pointer to destination surface 71 //! \param caps 72 //! [in] reference of featue supported engine 73 //! \return MOS_STATUS 74 //! Return MOS_STATUS_SUCCESS if support, otherwise return unspoort. 75 //! 76 virtual MOS_STATUS FeatureSupport(PMOS_RESOURCE src, PMOS_RESOURCE dst, MCPY_ENGINE_CAPS& caps); 77 78 protected: 79 80 //! 81 //! \brief use blt engie to do surface copy. 82 //! \details implementation media blt copy. 83 //! \param src 84 //! [in] Pointer to source surface 85 //! \param dst 86 //! [in] Pointer to destination surface 87 //! \return MOS_STATUS 88 //! Return MOS_STATUS_SUCCESS if support, otherwise return unspoort. 89 //! 90 virtual MOS_STATUS MediaBltCopy(PMOS_RESOURCE src, PMOS_RESOURCE dst); 91 92 //! 93 //! \brief use Render engie to do surface copy. 94 //! \details implementation media Render copy. 95 //! \param src 96 //! [in] Pointer to source surface 97 //! \param dst 98 //! [in] Pointer to destination surface 99 //! \return MOS_STATUS 100 //! Return MOS_STATUS_SUCCESS if support, otherwise return unspoort. 101 //! 102 virtual MOS_STATUS MediaRenderCopy(PMOS_RESOURCE src, PMOS_RESOURCE dst); 103 104 //! 105 //! \brief use vebox engie to do surface copy. 106 //! \details implementation media vebox copy. 107 //! \param src 108 //! [in] Pointer to source surface 109 //! \param dst 110 //! [in] Pointer to destination surface 111 //! \return MOS_STATUS 112 //! Return MOS_STATUS_SUCCESS if support, otherwise return unspoort. 113 //! //! 114 //! \brief use vebox engie to do surface copy. 115 //! \details implementation media vebox copy. 116 //! \param src 117 //! [in] Pointer to source surface 118 //! \param dst 119 //! [in] Pointer to destination surface 120 //! \return MOS_STATUS 121 //! Return MOS_STATUS_SUCCESS if support, otherwise return unspoort. 122 //! 123 virtual MOS_STATUS MediaVeboxCopy(PMOS_RESOURCE src, PMOS_RESOURCE dst); 124 125 virtual bool IsVeboxCopySupported(PMOS_RESOURCE src, PMOS_RESOURCE dst); 126 127 MhwInterfacesNext *m_mhwInterfaces = nullptr; 128 VeboxCopyStateXe2_Lpm *m_veboxCopyState = nullptr; 129 RenderCopyxe2_Lpm *m_renderCopy = nullptr; 130 BltStateXe2_Lpm *m_bltCopy = nullptr; 131 132 MEDIA_CLASS_DEFINE_END(MediaCopyStateXe2_Lpm) 133 }; 134 135 #endif // __MEDIA_COPY_XE2_LPM_H__ 136