1 /*
2 * Copyright (c) 2009-2019, 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     vphal.h
24 //! \brief    vphal interface clarification
25 //! \details  vphal interface clarification inlcuding:
26 //!           some marcro, enum, structure, function
27 //!
28 #ifndef __VPHAL_H__
29 #define __VPHAL_H__
30 
31 #include "vphal_common.h"
32 #include "vphal_common_tools.h"
33 #include "mos_utilities.h"
34 #include "mos_util_debug.h"
35 #include "mhw_vebox.h"
36 #include "mhw_sfc.h"
37 
38 //*-----------------------------------------------------------------------------
39 //| DEFINITIONS
40 //*-----------------------------------------------------------------------------
41 // Incremental size for allocating/reallocating resource
42 #define VPHAL_BUFFER_SIZE_INCREMENT     128
43 
44 // YUV input ranges
45 #define YUV_RANGE_16_235                1
46 #define YUV_RANGE_0_255                 2
47 #define YUV_RANGE_FROM_DDI              3
48 
49 // RGB input ranges
50 #define RGB_RANGE_16_235                1
51 #define RGB_RANGE_0_255                 0
52 
53 // Media Features width
54 #define VPHAL_RNDR_8K_WIDTH (7680)
55 
56 // Media Features height
57 #define VPHAL_RNDR_2K_HEIGHT  1080
58 // The reason that the definition is not (VPHAL_RNDR_2K_HEIGHT*2) is because some 4K clips have 1200 height.
59 #define VPHAL_RNDR_4K_HEIGHT  1200
60 #define VPHAL_RNDR_6K_HEIGHT  (VPHAL_RNDR_2K_HEIGHT*3)
61 #define VPHAL_RNDR_8K_HEIGHT  (VPHAL_RNDR_2K_HEIGHT*4)
62 #define VPHAL_RNDR_10K_HEIGHT (VPHAL_RNDR_2K_HEIGHT*5)
63 #define VPHAL_RNDR_12K_HEIGHT (VPHAL_RNDR_2K_HEIGHT*6)
64 #define VPHAL_RNDR_14K_HEIGHT (VPHAL_RNDR_2K_HEIGHT*7)
65 #define VPHAL_RNDR_16K_HEIGHT (VPHAL_RNDR_2K_HEIGHT*8)
66 #define VPHAL_RNDR_18K_HEIGHT (VPHAL_RNDR_2K_HEIGHT*9)
67 #define VPHAL_RNDR_20K_HEIGHT (VPHAL_RNDR_2K_HEIGHT*10)
68 #define VPHAL_RNDR_22K_HEIGHT (VPHAL_RNDR_2K_HEIGHT*11)
69 #define VPHAL_RNDR_24K_HEIGHT (VPHAL_RNDR_2K_HEIGHT*12)
70 #define VPHAL_RNDR_26K_HEIGHT (VPHAL_RNDR_2K_HEIGHT*13)
71 #define VPHAL_RNDR_28K_HEIGHT (VPHAL_RNDR_2K_HEIGHT*14)
72 
73 //------------------------------------------------------------------------------
74 // Simplified macros for debug message, Assert, Null check and MOS eStatus check
75 // within VPhal without the need to explicitly pass comp and sub-comp name
76 //------------------------------------------------------------------------------
77 
78 //------------------------------------------------------------------------------
79 // Macros specific to MOS_VP_SUBCOMP_HW sub-comp
80 //------------------------------------------------------------------------------
81 #define VPHAL_HW_ASSERT(_expr)                                                       \
82     MOS_ASSERT(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_HW, _expr)
83 
84 #define VPHAL_HW_ASSERTMESSAGE(_message, ...)                                        \
85     MOS_ASSERTMESSAGE(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_HW, _message, ##__VA_ARGS__)
86 
87 #define VPHAL_HW_NORMALMESSAGE(_message, ...)                                        \
88     MOS_NORMALMESSAGE(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_HW, _message, ##__VA_ARGS__)
89 
90 #define VPHAL_HW_VERBOSEMESSAGE(_message, ...)                                       \
91     MOS_VERBOSEMESSAGE(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_HW, _message, ##__VA_ARGS__)
92 
93 #define VPHAL_HW_FUNCTION_ENTER                                                      \
94     MOS_FUNCTION_ENTER(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_HW)
95 
96 #define VPHAL_HW_CHK_STATUS(_stmt)                                                   \
97     MOS_CHK_STATUS(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_HW, _stmt)
98 
99 #define VPHAL_HW_CHK_NULL(_ptr)                                                      \
100     MOS_CHK_NULL(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_HW, _ptr)
101 
102 #define VPHAL_HW_CHK_NULL_NO_STATUS(_ptr)                                            \
103     MOS_CHK_NULL_NO_STATUS(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_HW, _ptr)
104 
105 //------------------------------------------------------------------------------
106 // Macros specific to MOS_VP_SUBCOMP_PUBLIC sub-comp
107 //------------------------------------------------------------------------------
108 #define VPHAL_PUBLIC_ASSERT(_expr)                                                   \
109     MOS_ASSERT(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_PUBLIC, _expr)
110 
111 #define VPHAL_PUBLIC_ASSERTMESSAGE(_message, ...)                                    \
112     MOS_ASSERTMESSAGE(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_PUBLIC, _message, ##__VA_ARGS__)
113 
114 #define VPHAL_PUBLIC_NORMALMESSAGE(_message, ...)                                    \
115     MOS_NORMALMESSAGE(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_PUBLIC, _message, ##__VA_ARGS__)
116 
117 #define VPHAL_PUBLIC_VERBOSEMESSAGE(_message, ...)                                   \
118     MOS_VERBOSEMESSAGE(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_PUBLIC, _message, ##__VA_ARGS__)
119 
120 #define VPHAL_PUBLIC_FUNCTION_ENTER                                                  \
121     MOS_FUNCTION_ENTER(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_PUBLIC)
122 
123 #define VPHAL_PUBLIC_CHK_STATUS(_stmt)                                               \
124     MOS_CHK_STATUS(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_PUBLIC, _stmt)
125 
126 #define VPHAL_PUBLIC_CHK_STATUS_RETURN(_stmt)                                        \
127     MOS_CHK_STATUS_RETURN(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_PUBLIC, _stmt)
128 
129 #define VPHAL_PUBLIC_CHK_NULL(_ptr)                                                  \
130     MOS_CHK_NULL(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_PUBLIC, _ptr)
131 
132 #define VPHAL_PUBLIC_CHK_NULL_NO_STATUS(_ptr)                                        \
133     MOS_CHK_NULL_NO_STATUS(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_PUBLIC, _ptr)
134 
135 #define VPHAL_PUBLIC_CHK_NULL_NO_STATUS_RETURN(_ptr)                                 \
136     MOS_CHK_NULL_NO_STATUS_RETURN(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_PUBLIC, _ptr)
137 
138 //------------------------------------------------------------------------------
139 // Macros specific to MOS_VP_SUBCOMP_DEBUG sub-comp
140 //------------------------------------------------------------------------------
141 #define VPHAL_DEBUG_ASSERT(_expr)                                                    \
142     MOS_ASSERT(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_DEBUG, _expr)
143 
144 #define VPHAL_DEBUG_ASSERTMESSAGE(_message, ...)                                     \
145     MOS_ASSERTMESSAGE(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_DEBUG, _message, ##__VA_ARGS__)
146 
147 #define VPHAL_DEBUG_NORMALMESSAGE(_message, ...)                                     \
148     MOS_NORMALMESSAGE(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_DEBUG, _message, ##__VA_ARGS__)
149 
150 #define VPHAL_DEBUG_VERBOSEMESSAGE(_message, ...)                                    \
151     MOS_VERBOSEMESSAGE(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_DEBUG, _message, ##__VA_ARGS__)
152 
153 #define VPHAL_DEBUG_FUNCTION_ENTER                                                   \
154     MOS_FUNCTION_ENTER(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_DEBUG)
155 
156 #define VPHAL_DEBUG_FUNCTION_EXIT                                                    \
157     MOS_FUNCTION_EXIT(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_DEBUG)
158 
159 #define VPHAL_DEBUG_CHK_STATUS(_stmt)                                                \
160     MOS_CHK_STATUS(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_DEBUG, _stmt)
161 
162 #define VPHAL_DEBUG_CHK_NULL(_ptr)                                                   \
163     MOS_CHK_NULL(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_DEBUG, _ptr)
164 
165 #define VPHAL_DEBUG_CHK_NULL_NO_STATUS(_ptr)                                         \
166     MOS_CHK_NULL_NO_STATUS(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_DEBUG, _ptr)
167 
168 //------------------------------------------------------------------------------
169 // Macros specific to MOS_VP_SUBCOMP_RENDER sub-comp
170 //------------------------------------------------------------------------------
171 #define VPHAL_RENDER_ASSERT(_expr)                                                   \
172     MOS_ASSERT(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_RENDER, _expr)
173 
174 #define VPHAL_RENDER_ASSERTMESSAGE(_message, ...)                                    \
175     MOS_ASSERTMESSAGE(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_RENDER, _message, ##__VA_ARGS__)
176 
177 #define VPHAL_RENDER_NORMALMESSAGE(_message, ...)                                    \
178     MOS_NORMALMESSAGE(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_RENDER, _message, ##__VA_ARGS__)
179 
180 #define VPHAL_RENDER_VERBOSEMESSAGE(_message, ...)                                   \
181     MOS_VERBOSEMESSAGE(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_RENDER, _message, ##__VA_ARGS__)
182 
183 #define VPHAL_RENDER_FUNCTION_ENTER                                                  \
184     MOS_FUNCTION_ENTER(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_RENDER)
185 
186 #define VPHAL_RENDER_EXITMESSAGE(_message, ...)                                      \
187     MOS_DEBUGMESSAGE(MOS_MESSAGE_LVL_FUNCTION_EXIT, MOS_COMPONENT_VP, MOS_VP_SUBCOMP_RENDER, _message, ##__VA_ARGS__)
188 
189 #define VPHAL_RENDER_CHK_STATUS(_stmt)                                               \
190     MOS_CHK_STATUS(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_RENDER, _stmt)
191 
192 #define VPHAL_RENDER_CHK_STATUS_RETURN(_stmt)                                        \
193     MOS_CHK_STATUS_RETURN(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_RENDER, _stmt)
194 
195 #define VPHAL_RENDER_CHK_STATUS_MESSAGE(_stmt, _message, ...)                        \
196     MOS_CHK_STATUS_MESSAGE(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_RENDER, _stmt, _message, ##__VA_ARGS__)
197 
198 #define VPHAL_RENDER_CHK_NULL(_ptr)                                                  \
199     MOS_CHK_NULL(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_RENDER, _ptr)
200 
201 #define VPHAL_RENDER_CHK_NULL_RETURN(_ptr)                                           \
202     MOS_CHK_NULL_RETURN(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_RENDER, _ptr)
203 
204 #define VPHAL_RENDER_CHK_NULL_NO_STATUS(_ptr)                                        \
205     MOS_CHK_NULL_NO_STATUS(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_RENDER, _ptr)
206 
207 //------------------------------------------------------------------------------
208 // Macros specific to MOS_VP_SUBCOMP_DDI sub-comp
209 //------------------------------------------------------------------------------
210 #define VP_DDI_ASSERT(_expr)                                                         \
211     MOS_ASSERT(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_DDI, _expr)
212 
213 #define VP_DDI_ASSERTMESSAGE(_message, ...)                                          \
214     MOS_ASSERTMESSAGE(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_DDI, _message, ##__VA_ARGS__)
215 
216 #define VP_DDI_NORMALMESSAGE(_message, ...)                                          \
217     MOS_NORMALMESSAGE(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_DDI, _message, ##__VA_ARGS__)
218 
219 #define VP_DDI_VERBOSEMESSAGE(_message, ...)                                         \
220     MOS_VERBOSEMESSAGE(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_DDI, _message, ##__VA_ARGS__)
221 
222 #define VP_DDI_FUNCTION_ENTER                                                        \
223     MOS_FUNCTION_ENTER(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_DDI)
224 
225 #define VP_DDI_CHK_STATUS(_stmt)                                                     \
226     MOS_CHK_STATUS(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_DDI, _stmt)
227 
228 #define VP_DDI_CHK_STATUS_MESSAGE(_stmt, _message, ...)                              \
229     MOS_CHK_STATUS_MESSAGE(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_DDI, _stmt, _message, ##__VA_ARGS__)
230 
231 #define VP_DDI_CHK_NULL(_ptr)                                                        \
232     MOS_CHK_NULL(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_DDI, _ptr)
233 
234 #define VP_DDI_CHK_NULL_NO_STATUS(_ptr)                                              \
235     MOS_CHK_NULL_NO_STATUS(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_DDI, _ptr)
236 
237 #define VPHAL_DDI_CHK_HR(_ptr)                                                       \
238     MOS_CHK_HR(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_DDI, _ptr)
239 
240 #define VPHAL_DDI_CHK_NULL_WITH_HR(_ptr)                                             \
241     MOS_CHK_NULL_WITH_HR(MOS_COMPONENT_VP, MOS_VP_SUBCOMP_DDI, _ptr)
242 
243 //!
244 //! \brief Base VP kernel list
245 //!
246 enum VpKernelID
247 {
248     // FC
249     kernelCombinedFc = 0,
250 
251     // 2 VEBOX KERNELS
252     kernelVeboxSecureBlockCopy,
253     kernelVeboxUpdateDnState,
254 
255     // User Ptr
256     kernelUserPtr,
257     // Fast 1toN
258     kernelFast1toN,
259 
260     // HDR
261     kernelHdrMandatory,
262     kernelHdrPreprocess,
263 
264     baseKernelMaxNumID
265 };
266 
267 //!
268 //! \brief VPHAL SS/EU setting
269 //!
270 struct VphalSseuSetting
271 {
272     uint8_t   numSlices;
273     uint8_t   numSubSlices;
274     uint8_t   numEUs;
275     uint8_t   reserved;       // Place holder for frequency setting
276 };
277 
278 //-----------------------------------------------------------------------------
279 // VPHAL-DDI RENDERING INTERFACE
280 //
281 //      Params that may apply to more than one layer are part of VPHAL_SURFACE
282 //      DDI layers must set this interface before calling pfnRender
283 //-----------------------------------------------------------------------------
284 //!
285 //! Structure VphalSettings
286 //! \brief VPHAL Settings - controls allocation of internal resources in VPHAL
287 //!
288 struct VphalSettings
289 {
290     //!
291     //! \brief    VphalSettings Constructor
292     //! \details  Creates instance of VphalSettings
293     //!
VphalSettingsVphalSettings294     VphalSettings() :
295         maxPhases(0),
296         mediaStates(0),
297         sameSampleThreshold(0),
298         disableDnDi(0),
299         kernelUpdate(0),
300         disableHdr(0),
301         veboxParallelExecution(0)
302     {
303     };
304 
305     int32_t                maxPhases;
306     int32_t                mediaStates;
307     int32_t                sameSampleThreshold;
308     uint32_t               disableDnDi;                                          //!< For validation purpose
309     uint32_t               kernelUpdate;                                         //!< For VEBox Copy and Update kernels
310     uint32_t               disableHdr;                                           //!< Disable Hdr
311     uint32_t               veboxParallelExecution;                               //!< Control VEBox parallel execution with render engine
312 };
313 
314 #pragma pack(push)
315 #pragma pack(1)
316 
317 //!
318 //! Structure VphalFeatureReport
319 //! \brief    Vphal Feature Report Structure
320 //!
321 struct VphalFeatureReport
322 {
323     //!
324     //! \brief    VphalFeatureReport Constructor
325     //! \details  Creates instance of VphalFeatureReport
326     //!
VphalFeatureReportVphalFeatureReport327     VphalFeatureReport()
328     {
329         // call InitReportValue() to initialize report value
330         InitReportValue();
331     };
332 
333     //!
334     //! \brief    initialize VphalFeatureReport value
335     //! \details  initialize VphalFeatureReport value, can use it to reset report value
336     //!
337     void InitReportValue();
338 
339     bool                            IECP;               //!< IECP enable/disable
340     bool                            IEF;                //!< Enhancement filter
341     bool                            Denoise;            //!< Denoise
342     bool                            ChromaDenoise;      //!< Chroma Denoise
343     VPHAL_DI_REPORT_MODE            DeinterlaceMode;    //!< Deinterlace mode
344     VPHAL_SCALING_MODE              ScalingMode;        //!< Scaling mode
345     VPHAL_OUTPUT_PIPE_MODE          OutputPipeMode;     //!< Output Pipe
346     bool                            VPMMCInUse;         //!< MMC enable flag
347     bool                            RTCompressible;     //!< RT MMC Compressible flag
348     uint8_t                         RTCompressMode;     //!< RT MMC Compression mode
349     bool                            FFDICompressible;   //!< FFDI MMC Compressible flag
350     uint8_t                         FFDICompressMode;   //!< FFDI MMC Compression mode
351     bool                            FFDNCompressible;   //!< FFDN MMC Compressible flag
352     uint8_t                         FFDNCompressMode;   //!< FFDN MMC Compression mode
353     bool                            STMMCompressible;   //!< STMM MMC Compressible flag
354     uint8_t                         STMMCompressMode;   //!< STMM MMC Compression mode
355     bool                            ScalerCompressible; //!< Scaler MMC Compressible flag for Gen10
356     uint8_t                         ScalerCompressMode; //!< Scaler MMC Compression mode for Gen10
357     bool                            PrimaryCompressible;//!< Input Primary Surface Compressible flag
358     uint8_t                         PrimaryCompressMode;//!< Input Primary Surface Compression mode
359     VPHAL_COMPOSITION_REPORT_MODE   CompositionMode;    //!< Inplace/Legacy Compostion flag
360     bool                            VEFeatureInUse;     //!< If any VEBOX feature is in use, excluding pure bypass for SFC
361     bool                            DiScdMode;          //!< Scene change detection
362     VPHAL_HDR_MODE                  HDRMode;            //!< HDR mode
363 };
364 
365 #pragma pack(pop)
366 
367 
368 //!
369 //! Class VphalState
370 //! \brief VPHAL class definition
371 //!
372 class VphalState
373 {
374 public:
375     // factory function
376     static VphalState* VphalStateFactory(
377         PMOS_INTERFACE          pOsInterface,
378         PMOS_CONTEXT            pOsDriverContext,
379         MOS_STATUS              *peStatus);
380 
381     //!
382     //! \brief    VphalState Constructor
383     //! \details  Creates instance of VphalState
384     //!           - Caller must call Allocate to allocate all VPHAL states and objects.
385     //! \param    [in] pOsInterface
386     //!           OS interface, if provided externally - may be nullptr
387     //! \param    [in] pOsDriverContext
388     //!           OS driver context (UMD context, pShared, ...)
389     //! \param    [in,out] peStatus
390     //!           Pointer to the MOS_STATUS flag.
391     //!           Will assign this flag to MOS_STATUS_SUCCESS if successful, otherwise failed
392     //!
393     VphalState(
394         PMOS_INTERFACE          pOsInterface,
395         PMOS_CONTEXT            pOsDriverContext,
396         MOS_STATUS              *peStatus);
397 
398     //!
399     //! \brief    Copy constructor
400     //!
401     VphalState(const VphalState&) = delete;
402 
403     //!
404     //! \brief    Copy assignment operator
405     //!
406     VphalState& operator=(const VphalState&) = delete;
407 
408     //!
409     //! \brief    VphalState Destuctor
410     //! \details  Destroys VPHAL and all internal states and objects
411     //!
412     virtual ~VphalState();
413 
414     //!
415     //! \brief    Allocate VPHAL Resources
416     //! \details  Allocate VPHAL Resources
417     //!           - Allocate and initialize HW states
418     //!           - Allocate and initialize renderer states
419     //! \param    [in] pVpHalSettings
420     //!           Pointer to VPHAL Settings
421     //! \return   MOS_STATUS
422     //!           Return MOS_STATUS_SUCCESS if successful, otherwise failed
423     //!
424     virtual MOS_STATUS Allocate(
425         const VphalSettings     *pVpHalSettings);
426 
427     //!
428     //! \brief    Performs VP Rendering
429     //! \details  Performs VP Rendering
430     //!           - call default render of video
431     //! \param    [in] pcRenderParams
432     //!           Pointer to Render Params
433     //! \return   MOS_STATUS
434     //!           Return MOS_STATUS_SUCCESS if successful, otherwise failed
435     //!
436     virtual MOS_STATUS Render(
437         PCVPHAL_RENDER_PARAMS   pcRenderParams);
438 
439     //!
440     //! \brief    Get feature reporting from renderer
441     //! \details  Get feature reporting from renderer
442     //! \return   VphalFeatureReport*
443     //!           Pointer to VPHAL_FEATURE_REPOR: rendering features reported
444     //!
445     virtual VphalFeatureReport*       GetRenderFeatureReport();
446 
447     //!
448     //! \brief    Get Status Report
449     //! \details  Get Status Report, will return back to app indicating if related frame id is done by gpu
450     //! \param    [out] pQueryReport
451     //!           Pointer to pQueryReport, the status query report array.
452     //! \param    [in] wStatusNum
453     //!           The size of array pQueryReport.
454     //! \return   MOS_STATUS
455     //!           Return MOS_STATUS_SUCCESS if successful, otherwise failed
456     virtual MOS_STATUS GetStatusReport(
457         PQUERY_STATUS_REPORT_APP        pQueryReport,
458         uint16_t                        numStatus);
459 
460     //!
461     //! \brief    Get Status Report's entry length from head to tail
462     //! \details  Get Status Report's entry length from head to tail
463     //! \param    [out] puiLength
464     //!           Pointer to the entry length
465     //! \return   MOS_STATUS
466     //!           Return MOS_STATUS_SUCCESS if successful, otherwise failed
467     //!
468     MOS_STATUS GetStatusReportEntryLength(
469         uint32_t                         *puiLength);
470 
GetSkuTable()471     MEDIA_FEATURE_TABLE*          GetSkuTable()
472     {
473         return m_skuTable;
474     };
475 
GetOsInterface()476     PMOS_INTERFACE              GetOsInterface()
477     {
478         return m_osInterface;
479     };
480 
GetRenderer()481     VphalRenderer*             GetRenderer()
482     {
483         return m_renderer;
484     };
485 
SetMhwVeboxInterface(MhwVeboxInterface * veboxInterface)486     void SetMhwVeboxInterface(MhwVeboxInterface* veboxInterface)
487     {
488         if (veboxInterface == nullptr)
489         {
490             return;
491         }
492 
493         if (m_veboxInterface != nullptr)
494         {
495             MOS_STATUS eStatus = m_veboxInterface->DestroyHeap();
496             MOS_Delete(m_veboxInterface);
497             m_veboxInterface = nullptr;
498             if (eStatus != MOS_STATUS_SUCCESS)
499             {
500                 VPHAL_PUBLIC_ASSERTMESSAGE("Failed to destroy Vebox Interface, eStatus:%d.\n", eStatus);
501             }
502         }
503 
504         m_veboxInterface = veboxInterface;
505     }
506 
SetMhwSfcInterface(MhwSfcInterface * sfcInterface)507     void SetMhwSfcInterface(MhwSfcInterface* sfcInterface)
508     {
509         if (sfcInterface == nullptr)
510         {
511             return;
512         }
513 
514         if (m_sfcInterface != nullptr)
515         {
516             MOS_Delete(m_sfcInterface);
517             m_sfcInterface = nullptr;
518         }
519 
520         m_sfcInterface = sfcInterface;
521     }
522 
523     HANDLE                      m_gpuAppTaskEvent;
524 
525 protected:
526     // Internals
527     PLATFORM                    m_platform;
528     MEDIA_FEATURE_TABLE         *m_skuTable;
529     MEDIA_WA_TABLE              *m_waTable;
530 
531     // States
532     PMOS_INTERFACE              m_osInterface;
533     PRENDERHAL_INTERFACE        m_renderHal;
534     PMHW_VEBOX_INTERFACE        m_veboxInterface;
535     MhwCpInterface              *m_cpInterface;
536     PMHW_SFC_INTERFACE          m_sfcInterface;
537     VphalRenderer               *m_renderer;
538 
539     // Render GPU context/node
540     MOS_GPU_NODE                m_renderGpuNode;
541     MOS_GPU_CONTEXT             m_renderGpuContext;
542 
543     // StatusTable indicating if command is done by gpu or not
544     VPHAL_STATUS_TABLE          m_statusTable = {};
545 
546     //!
547     //! \brief    Create instance of VphalRenderer
548     //! \details  Create instance of VphalRenderer
549     //! \return   MOS_STATUS
550     //!           Return MOS_STATUS_SUCCESS if successful, otherwise failed
551     //!
552     virtual MOS_STATUS CreateRenderer() = 0;
553 };
554 
555 #endif  // __VPHAL_H__
556