1 /*
2 * Copyright (c) 2020-2022, 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 //!
24 //! \file     vp_platform_interface_xe_hpm.h
25 //! \brief    platform specific vp interfaces.
26 //!
27 #ifndef __VP_PLATFORM_INTERFACE_XE_HPM_H__
28 #define __VP_PLATFORM_INTERFACE_XE_HPM_H__
29 
30 #include "vp_platform_interface.h"
31 #include "media_class_trace.h"
32 
33 #define VP_VEBOX_STATISTICS_SIZE_G12 (32 * 8)
34 namespace vp
35 {
36 
37 class VpPlatformInterfaceXe_Hpm : public VpPlatformInterface
38 {
39 public:
40 
41     VpPlatformInterfaceXe_Hpm(PMOS_INTERFACE pOsInterface);
42 
~VpPlatformInterfaceXe_Hpm()43     virtual ~VpPlatformInterfaceXe_Hpm()
44     {}
45 
46     virtual MOS_STATUS InitVpVeboxSfcHwCaps(VP_VEBOX_ENTRY_REC *veboxHwEntry, uint32_t veboxEntryCount, VP_SFC_ENTRY_REC *sfcHwEntry, uint32_t sfcEntryCount);
47     virtual MOS_STATUS InitVpRenderHwCaps();
48     virtual VPFeatureManager *CreateFeatureChecker(_VP_MHWINTERFACE *hwInterface);
49     virtual VpCmdPacket *CreateVeboxPacket(MediaTask * task, _VP_MHWINTERFACE *hwInterface, VpAllocator *&allocator, VPMediaMemComp *mmc);
50     virtual MOS_STATUS CreateSfcRender(SfcRenderBase *&sfcRender, VP_MHWINTERFACE &vpMhwinterface, PVpAllocator allocator);
51     virtual VpCmdPacket *CreateRenderPacket(MediaTask * task, _VP_MHWINTERFACE *hwInterface, VpAllocator *&allocator, VPMediaMemComp *mmc, VpKernelSet* kernel);
52     virtual MediaCopyBaseState* CreateMediaCopy();
53 
54     virtual MOS_STATUS VeboxQueryStatLayout(
55         VEBOX_STAT_QUERY_TYPE queryType,
56         uint32_t* pQuery);
57 
VeboxQueryStaticSurfaceSize()58     virtual uint32_t VeboxQueryStaticSurfaceSize()
59     {
60         return VP_VEBOX_STATISTICS_SIZE_G12;
61     }
ConfigVirtualEngine()62     virtual MOS_STATUS ConfigVirtualEngine()
63     {
64         return MOS_STATUS_SUCCESS;    // the config would be set in MhwVeboxInterfaceG12::CreateGpuContext().
65     }
66 
IsEufusionBypassWaEnabled()67     virtual bool IsEufusionBypassWaEnabled()
68     {
69         return true;
70     }
71 
IsGpuContextCreatedInPipelineInit()72     virtual bool IsGpuContextCreatedInPipelineInit()
73     {
74         return false;
75     }
76 
IsAdvanceNativeKernelSupported()77     virtual bool IsAdvanceNativeKernelSupported()
78     {
79         return false;
80     }
81 
IsDecompForInterlacedSurfWaEnabled()82     virtual bool IsDecompForInterlacedSurfWaEnabled()
83     {
84         return true;
85     }
86 
IsLegacyEuCountInUse()87     virtual bool IsLegacyEuCountInUse()
88     {
89         return true;
90     }
91 
92     virtual MOS_STATUS GetInputFrameWidthHeightAlignUnit(
93         PVP_MHWINTERFACE          pvpMhwInterface,
94         uint32_t                 &widthAlignUnit,
95         uint32_t                 &heightAlignUnit,
96         bool                      bVdbox,
97         CODECHAL_STANDARD         codecStandard,
98         CodecDecodeJpegChromaType jpegChromaType);
99 
100     virtual MOS_STATUS GetVeboxHeapInfo(
101         PVP_MHWINTERFACE          pvpMhwInterface,
102         const MHW_VEBOX_HEAP    **ppVeboxHeap);
103 
104     virtual bool IsVeboxScalabilityWith4KNotSupported(
105         VP_MHWINTERFACE           vpMhwInterface);
106 
107     virtual MOS_STATUS ConfigureVpScalability(VP_MHWINTERFACE &vpMhwInterface);
108 
IsRenderMMCLimitationCheckNeeded()109     virtual bool IsRenderMMCLimitationCheckNeeded()
110     {
111         return true;
112     }
113 
114 protected:
115     bool m_disableSfcDithering = false;
116 
117 MEDIA_CLASS_DEFINE_END(vp__VpPlatformInterfaceXe_Hpm)
118 };
119 
120 }
121 #endif // !__VP_PLATFORM_INTERFACE_XE_HPM_H__
122