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_hpm_base.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_HPM_BASE_H__ 29 #define __MEDIA_COPY_XE2_HPM_BASE_H__ 30 31 #include "media_copy.h" 32 #include "media_blt_copy_xe2_hpm_base.h" 33 #include "media_vebox_copy_xe2_hpm_base.h" 34 #include "media_render_copy_xe2_hpm_base.h" 35 36 class MediaCopyStateXe2_Hpm_Base: public MediaCopyBaseState 37 { 38 public: 39 //! 40 //! \brief MediaCopyStateXe2_Hpm_Base constructor 41 //! \details Initialize the MediaCopy members. 42 //! \param osInterface 43 //! [in] Pointer to MOS_INTERFACE. 44 //! 45 MediaCopyStateXe2_Hpm_Base(); 46 virtual ~MediaCopyStateXe2_Hpm_Base(); 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 //! 126 //! \brief vebox format support. 127 //! \details surface format support. 128 //! \param src 129 //! [in] Pointer to source surface 130 //! \param dst 131 //! [in] Pointer to destination surface 132 //! \return bool 133 //! Return true if support, otherwise return false. 134 //! 135 virtual bool IsVeboxCopySupported(PMOS_RESOURCE src, PMOS_RESOURCE dst); 136 137 MhwInterfacesNext *m_mhwInterfaces = nullptr; 138 BltStateXe2_Hpm_Base *m_bltState = nullptr; 139 VeboxCopyStateXe2_Hpm_Base *m_veboxCopyState = nullptr; 140 RenderCopyxe2_hpm_Base *m_renderCopyState = nullptr; 141 142 MEDIA_CLASS_DEFINE_END(MediaCopyStateXe2_Hpm_Base) 143 }; 144 145 #endif // __MEDIA_COPY_XE2_HPM_BASE_H__ 146