1 /* 2 * Copyright (c) 2020-2021, 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_sfc_render.h 24 //! \brief Common interface and structure used in sfc interface 25 //! \details Common interface and structure used in sfc interface which are platform independent 26 //! 27 #ifndef __MEDIA_SFC_RENDER_H__ 28 #define __MEDIA_SFC_RENDER_H__ 29 30 #include "mos_os_specific.h" 31 #include "mhw_vebox_itf.h" 32 #include "mhw_sfc_itf.h" 33 #include "mhw_mi_itf.h" 34 35 namespace vp 36 { 37 class VpPlatformInterface; 38 class VpPipeline; 39 struct FeatureParamScaling; 40 }; 41 struct _VP_MHWINTERFACE; 42 class MhwCpInterface; 43 class MhwMiInterface; 44 class MhwSfcInterface; 45 class MhwVeboxInterface; 46 struct _VPHAL_STATUS_TABLE; 47 class MediaVdboxSfcRender; 48 struct VEBOX_SFC_PARAMS; 49 struct VDBOX_SFC_PARAMS; 50 struct _RENDERHAL_INTERFACE; 51 52 class MediaSfcRender 53 { 54 public: 55 //! 56 //! \brief MediaSfcRender constructor 57 //! \details Initialize the MediaSfcRender members. 58 //! \param osInterface 59 //! [in] Pointer to MOS_INTERFACE. 60 //! \param mode 61 //! [in] 1: VEBOX-SFC only, 2: VDBOX-SFC only, 3: Both VEBOX-SFC and VDBOX-SFC. 62 //! 63 MediaSfcRender(PMOS_INTERFACE osInterface, MEDIA_SFC_INTERFACE_MODE mode, MediaMemComp *mmc); 64 65 virtual ~MediaSfcRender(); 66 67 virtual void Destroy(); 68 69 //! 70 //! \brief Check whether the Parameter for VDBOX-SFC supported 71 //! \details Only valid when MEDIA_SFC_INTERFACE_MODE::vdboxSfcEnabled being 1. 72 //! \param param 73 //! [in] Pointer to VDBOX_SFC_PARAMS. 74 //! \return MOS_STATUS 75 //! Return MOS_STATUS_SUCCESS if supported, otherwise failed 76 //! 77 virtual MOS_STATUS IsParameterSupported(VDBOX_SFC_PARAMS ¶m); 78 79 //! 80 //! \brief Check whether the Parameter for VEBOX-SFC supported 81 //! \details Only valid when MEDIA_SFC_INTERFACE_MODE::veboxSfcEnabled being 1. 82 //! \param param 83 //! [in] Pointer to VEBOX_SFC_PARAMS. 84 //! \return MOS_STATUS 85 //! Return MOS_STATUS_SUCCESS if supported, otherwise failed 86 //! 87 virtual MOS_STATUS IsParameterSupported(VEBOX_SFC_PARAMS ¶m); 88 89 //! 90 //! \brief Render Vdbox-SFC States 91 //! \details Only valid when MEDIA_SFC_INTERFACE_MODE::vdboxSfcEnabled being 1. 92 //! \param cmdBuffer 93 //! [in/out] Command Buffer to be Filled. 94 //! \param param 95 //! [in] Pointer to VDBOX_SFC_PARAMS. 96 //! \return MOS_STATUS 97 //! Return MOS_STATUS_SUCCESS if supported, otherwise failed 98 //! 99 MOS_STATUS Render(MOS_COMMAND_BUFFER *cmdBuffer, VDBOX_SFC_PARAMS ¶m); 100 101 //! 102 //! \brief Render Vebox-SFC States 103 //! \details Only valid when MEDIA_SFC_INTERFACE_MODE::veboxSfcEnabled being 1. 104 //! \param param 105 //! [in] Pointer to VEBOX_SFC_PARAMS. 106 //! \return MOS_STATUS 107 //! Return MOS_STATUS_SUCCESS if supported, otherwise failed 108 //! 109 MOS_STATUS Render(VEBOX_SFC_PARAMS ¶m); 110 111 //! 112 //! \brief MediaSfcInterface initialize 113 //! \details Initialize the MediaSfcInterface. 114 //! \return MOS_STATUS 115 //! Return MOS_STATUS_SUCCESS if successful, otherwise failed 116 //! 117 virtual MOS_STATUS Initialize(); 118 IsInitialized()119 bool IsInitialized() { return m_initialized; } 120 121 protected: 122 MOS_STATUS InitScalingParams(vp::FeatureParamScaling &scalingParams, VDBOX_SFC_PARAMS &sfcParam); 123 MOS_STATUS InitScalingParams(vp::FeatureParamScaling &scalingParams, VEBOX_SFC_PARAMS &sfcParam); 124 125 _VP_MHWINTERFACE *m_vpMhwinterface = nullptr; 126 vp::VpPlatformInterface *m_vpPlatformInterface = nullptr; 127 vp::VpPipeline *m_vpPipeline = nullptr; 128 _RENDERHAL_INTERFACE *m_renderHal = nullptr; 129 MhwCpInterface *m_cpInterface = nullptr; 130 _VPHAL_STATUS_TABLE *m_statusTable = nullptr; 131 PMOS_INTERFACE m_osInterface = nullptr; 132 MediaVdboxSfcRender *m_vdboxSfcRender = nullptr; 133 bool m_initialized = false; 134 MEDIA_SFC_INTERFACE_MODE m_mode = {}; 135 MediaMemComp *m_mmc = nullptr; 136 std::shared_ptr<mhw::vebox::Itf> m_veboxItf = nullptr; 137 std::shared_ptr<mhw::sfc::Itf> m_sfcItf = nullptr; 138 std::shared_ptr<mhw::mi::Itf> m_miItf = nullptr; 139 MEDIA_CLASS_DEFINE_END(MediaSfcRender) 140 }; 141 142 #endif // __MEDIA_SFC_RENDER_H__ 143