| 1 |
/* |
| 2 |
* Copyright (c) 2020, 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 |
#ifndef __VP_PIPELINE_ADAPTER_H__ |
| 23 |
#define __VP_PIPELINE_ADAPTER_H__ |
| 24 |
|
| 25 |
#include "vp_pipeline.h" |
| 26 |
#include "vp_pipeline_common.h" |
| 27 |
#include "vp_pipeline_adapter_base.h" |
| 28 |
|
| 29 |
const SseuSetting VpHalDefaultSSEUTable[baseKernelMaxNumID] = |
| 30 |
{ |
| 31 |
// Slice Sub-Slice EU Rsvd(freq) |
| 32 |
{2, 3, 8, 0}, // COMBINED_FC_KERNEL Default |
| 33 |
|
| 34 |
// 2 VEBOX KERNELS |
| 35 |
{2, 3, 8, 0}, // VEBOX_SECUREBLOCKCOPY_KERNEL, |
| 36 |
{2, 3, 8, 0}, // VEBOX_UPDATEDNSTATE_KERNEL, |
| 37 |
}; |
| 38 |
|
| 39 |
class VpPipelineAdapter : public VpPipelineAdapterBase |
| 40 |
{ |
| 41 |
public: |
| 42 |
VpPipelineAdapter( |
| 43 |
vp::VpPlatformInterface &vpPlatformInterface, |
| 44 |
MOS_STATUS &eStatus); |
| 45 |
|
| 46 |
//! |
| 47 |
//! \brief VpPipelineAdapter Destuctor |
| 48 |
//! \details Destroys VpPipelineG12Adapter and all internal states and objects |
| 49 |
//! \return void |
| 50 |
//! |
| 51 |
virtual ~VpPipelineAdapter(); |
| 52 |
|
| 53 |
//! |
| 54 |
//! \brief Performs VP Rendering |
| 55 |
//! \details Performs VP Rendering |
| 56 |
//! - call default render of video |
| 57 |
//! \param [in] pcRenderParams |
| 58 |
//! Pointer to Render Params |
| 59 |
//! \return MOS_STATUS |
| 60 |
//! Return MOS_STATUS_SUCCESS if successful, otherwise failed |
| 61 |
//! |
| 62 |
virtual MOS_STATUS Render( |
| 63 |
PCVPHAL_RENDER_PARAMS pcRenderParams) override; |
| 64 |
|
| 65 |
//! |
| 66 |
//! \brief Allocate VP Resources |
| 67 |
//! \details Allocate VP Resources |
| 68 |
//! - Allocate and initialize HW states |
| 69 |
//! - Allocate and initialize renderer states |
| 70 |
//! \param [in] pVpHalSettings |
| 71 |
//! Pointer to VPHAL Settings |
| 72 |
//! \return MOS_STATUS |
| 73 |
//! Return MOS_STATUS_SUCCESS if successful, otherwise failed |
| 74 |
//! |
| 75 |
virtual MOS_STATUS Allocate( |
| 76 |
const VpSettings *pVpHalSettings) override; |
| 77 |
|
| 78 |
//! |
| 79 |
//! \brief Get Status Report |
| 80 |
//! \details Get Status Report, will return back to app indicating if related frame id is done by gpu |
| 81 |
//! \param [out] pQueryReport |
| 82 |
//! Pointer to pQueryReport, the status query report array. |
| 83 |
//! \param [in] wStatusNum |
| 84 |
//! The size of array pQueryReport. |
| 85 |
//! \return MOS_STATUS |
| 86 |
//! Return MOS_STATUS_SUCCESS if successful, otherwise failed |
| 87 |
virtual MOS_STATUS GetStatusReport( |
| 88 |
PQUERY_STATUS_REPORT_APP pQueryReport, |
| 89 |
uint16_t numStatus) override; |
| 90 |
|
| 91 |
//! |
| 92 |
//! \brief Get feature reporting |
| 93 |
//! \details Get feature reporting |
| 94 |
//! \return VphalFeatureReport* |
| 95 |
//! Pointer to VPHAL_FEATURE_REPOR: rendering features reported |
| 96 |
//! |
| 97 |
virtual VphalFeatureReport *GetRenderFeatureReport() override; |
| 98 |
|
| 99 |
//! |
| 100 |
//! \brief Finish the execution for each frame |
| 101 |
//! \details Finish the execution for each frame |
| 102 |
//! \param [in] params |
| 103 |
//! Pointer to PVP_PIPELINE_PARAMS |
| 104 |
//! \return MOS_STATUS |
| 105 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 106 |
//! |
| 107 |
virtual MOS_STATUS Execute(PVP_PIPELINE_PARAMS params); |
| 108 |
|
| 109 |
virtual void Destroy(); |
| 110 |
virtual bool IsOclFCEnabled() |
| 111 |
{ |
| 112 |
return m_vpPipeline->IsOclFCEnabled(); |
| 113 |
} |
| 114 |
|
| 115 |
virtual MOS_STATUS RegisterCacheSettings() override; |
| 116 |
|
| 117 |
protected: |
| 118 |
//! |
| 119 |
//! \brief Allocate VP Resources |
| 120 |
//! \details Allocate VP Resources |
| 121 |
//! - Allocate and initialize HW states |
| 122 |
//! - Allocate and initialize renderer states |
| 123 |
//! \param [in] pVpHalSettings |
| 124 |
//! Pointer to VPHAL Settings |
| 125 |
//! \return MOS_STATUS |
| 126 |
//! Return MOS_STATUS_SUCCESS if successful, otherwise failed |
| 127 |
//! |
| 128 |
virtual MOS_STATUS Init( |
| 129 |
const VpSettings *pVpHalSettings, VP_MHWINTERFACE vpMhwinterface); |
| 130 |
|
| 131 |
//! |
| 132 |
//! \brief Finish the execution for each frame |
| 133 |
//! \details Finish the execution for each frame |
| 134 |
//! \param [in] params |
| 135 |
//! Pointer to PVP_PIPELINE_PARAMS |
| 136 |
//! \return MOS_STATUS |
| 137 |
//! MOS_STATUS_SUCCESS if success, else fail reason |
| 138 |
//! |
| 139 |
virtual MOS_STATUS Execute(PVP_PIPELINE_PARAMS params, PRENDERHAL_INTERFACE renderHal); |
| 140 |
|
| 141 |
std::shared_ptr<vp::VpPipeline> m_vpPipeline = {}; |
| 142 |
|
| 143 |
VP_PIPELINE_PARAMS m_vpPipelineParams = {}; //!< vp Pipeline params |
| 144 |
bool m_bApgEnabled = false; //!< VP APG path enabled |
| 145 |
|
| 146 |
MEDIA_CLASS_DEFINE_END(VpPipelineAdapter) |
| 147 |
}; |
| 148 |
#endif // !__VP_PIPELINE_ADAPTER_H__ |
| 149 |
|