| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
#ifndef __VP_PIPELINE_ADAPTER_BASE_H__ |
| 29 |
#define __VP_PIPELINE_ADAPTER_BASE_H__ |
| 30 |
#include "vp_base.h" |
| 31 |
#include "mhw_vebox_itf.h" |
| 32 |
#include "vp_utils.h" |
| 33 |
#include "mhw_sfc_itf.h" |
| 34 |
#include "mhw_render_itf.h" |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
typedef enum |
| 40 |
{ |
| 41 |
VPDDI_PROGRESSIVE = 0, |
| 42 |
VPDDI_BOB = 1, |
| 43 |
VPDDI_ADI = 2 |
| 44 |
} DI_MODE; |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
typedef enum |
| 50 |
{ |
| 51 |
VPDDI_SCALING = 0, |
| 52 |
VPDDI_ADVANCEDSCALING = 1, |
| 53 |
VPDDI_SUPERRESOLUTIONSCALING = 2 |
| 54 |
} SCALING_MODE; |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
class VpPipelineAdapterBase : public VpBase |
| 61 |
{ |
| 62 |
public: |
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
VpPipelineAdapterBase( |
| 76 |
vp::VpPlatformInterface &vpPlatformInterface, |
| 77 |
MOS_STATUS &eStatus, |
| 78 |
bool clearViewMode = false); |
| 79 |
|
| 80 |
virtual MOS_STATUS GetVpMhwInterface( |
| 81 |
VP_MHWINTERFACE &vpMhwinterface); |
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
virtual MOS_STATUS Allocate( |
| 94 |
const VpSettings *pVpSettings) = 0; |
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
virtual MOS_STATUS Render( |
| 106 |
PCVPHAL_RENDER_PARAMS pcRenderParams) = 0; |
| 107 |
|
| 108 |
virtual MOS_STATUS RegisterCacheSettings() |
| 109 |
{ |
| 110 |
return MOS_STATUS_SUCCESS; |
| 111 |
}; |
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
virtual MOS_STATUS GetStatusReport( |
| 123 |
PQUERY_STATUS_REPORT_APP pQueryReport, |
| 124 |
uint16_t numStatus); |
| 125 |
|
| 126 |
virtual MOS_STATUS GetStatusReportEntryLength( |
| 127 |
uint32_t *puiLength); |
| 128 |
|
| 129 |
virtual VphalFeatureReport *GetRenderFeatureReport() = 0; |
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
virtual ~VpPipelineAdapterBase(); |
| 137 |
|
| 138 |
virtual PMOS_INTERFACE GetOsInterface() |
| 139 |
{ |
| 140 |
return m_osInterface; |
| 141 |
} |
| 142 |
|
| 143 |
virtual MEDIA_FEATURE_TABLE *GetSkuTable() |
| 144 |
{ |
| 145 |
return m_skuTable; |
| 146 |
} |
| 147 |
|
| 148 |
virtual PLATFORM &GetPlatform() |
| 149 |
{ |
| 150 |
return m_platform; |
| 151 |
} |
| 152 |
|
| 153 |
virtual PRENDERHAL_INTERFACE GetRenderHal() |
| 154 |
{ |
| 155 |
return m_vprenderHal; |
| 156 |
} |
| 157 |
|
| 158 |
void SetMhwVeboxItf(std::shared_ptr<mhw::vebox::Itf> veboxItf) |
| 159 |
{ |
| 160 |
MOS_STATUS eStatus = MOS_STATUS_SUCCESS; |
| 161 |
if (veboxItf == nullptr) |
| 162 |
{ |
| 163 |
return; |
| 164 |
} |
| 165 |
|
| 166 |
if (m_veboxItf != nullptr) |
| 167 |
{ |
| 168 |
eStatus = m_veboxItf->DestroyHeap(); |
| 169 |
|
| 170 |
m_veboxItf = nullptr; |
| 171 |
if (MOS_FAILED(eStatus)) |
| 172 |
{ |
| 173 |
VP_PUBLIC_ASSERTMESSAGE("Failed to destroy Vebox Interface, eStatus:%d.\n", eStatus); |
| 174 |
} |
| 175 |
} |
| 176 |
|
| 177 |
m_veboxItf = veboxItf; |
| 178 |
} |
| 179 |
|
| 180 |
void SetMhwSfcItf(std::shared_ptr<mhw::sfc::Itf> sfcItf) |
| 181 |
{ |
| 182 |
if (sfcItf == nullptr) |
| 183 |
{ |
| 184 |
return; |
| 185 |
} |
| 186 |
|
| 187 |
if (m_sfcItf != nullptr) |
| 188 |
{ |
| 189 |
m_sfcItf = nullptr; |
| 190 |
} |
| 191 |
|
| 192 |
m_sfcItf = sfcItf; |
| 193 |
} |
| 194 |
|
| 195 |
void SetMhwMiItf(std::shared_ptr<mhw::mi::Itf> miItf) |
| 196 |
{ |
| 197 |
if (miItf == nullptr) |
| 198 |
{ |
| 199 |
return; |
| 200 |
} |
| 201 |
if (m_miItf != nullptr) |
| 202 |
{ |
| 203 |
m_miItf = nullptr; |
| 204 |
} |
| 205 |
|
| 206 |
m_miItf = miItf; |
| 207 |
} |
| 208 |
|
| 209 |
void SetMhwRenderItf(std::shared_ptr<mhw::render::Itf> renderItf) |
| 210 |
{ |
| 211 |
if (renderItf == nullptr) |
| 212 |
{ |
| 213 |
return; |
| 214 |
} |
| 215 |
|
| 216 |
if (m_renderItf != nullptr) |
| 217 |
{ |
| 218 |
m_renderItf = nullptr; |
| 219 |
} |
| 220 |
|
| 221 |
m_renderItf = renderItf; |
| 222 |
} |
| 223 |
|
| 224 |
protected: |
| 225 |
|
| 226 |
PLATFORM m_platform = {}; |
| 227 |
MEDIA_FEATURE_TABLE *m_skuTable = nullptr; |
| 228 |
MEDIA_WA_TABLE * m_waTable = nullptr; |
| 229 |
|
| 230 |
|
| 231 |
PMOS_INTERFACE m_osInterface = nullptr; |
| 232 |
PRENDERHAL_INTERFACE m_vprenderHal = nullptr; |
| 233 |
MhwCpInterface * m_cpInterface = nullptr; |
| 234 |
std::shared_ptr<mhw::vebox::Itf> m_veboxItf = nullptr; |
| 235 |
std::shared_ptr<mhw::sfc::Itf> m_sfcItf = nullptr; |
| 236 |
std::shared_ptr<mhw::mi::Itf> m_miItf = nullptr; |
| 237 |
std::shared_ptr<mhw::render::Itf> m_renderItf = nullptr; |
| 238 |
|
| 239 |
|
| 240 |
VPHAL_STATUS_TABLE m_statusTable = {}; |
| 241 |
vp::VpPlatformInterface &m_vpPlatformInterface; |
| 242 |
MediaUserSettingSharedPtr m_userSettingPtr = nullptr; |
| 243 |
|
| 244 |
|
| 245 |
bool m_clearVideoViewMode = false; |
| 246 |
MEDIA_CLASS_DEFINE_END(VpPipelineAdapterBase) |
| 247 |
}; |
| 248 |
|
| 249 |
#endif |