Debian Codegraph @

media_common/agnostic/common/os/mos_os.h

raw
1 /*
2 * Copyright (c) 2009-2024, 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 mos_os.h
24 //! \brief Common interface and structure used in MOS OS
25 //!
26
27 #ifndef __MOS_OS_H__
28 #define __MOS_OS_H__
29
30 #include "mos_defs.h"
31 #include "mos_utilities.h"
32 #include "media_skuwa_specific.h"
33 #include "mos_util_debug.h"
34 #include "mos_os_hw.h" //!< HW specific details that flow through OS pathes
35 #if (_RELEASE_INTERNAL || _DEBUG)
36 #if defined(CM_DIRECT_GUC_SUPPORT)
37 #include "work_queue_mngr.h"
38 #include <FirmwareManager/GpuFW/GucModule/commoninc/KmGucClientInterface.h>
39 #endif
40 #endif
41
42 #include "media_user_setting_specific.h"
43 #include "null_hardware.h"
44 #include "mos_hybrid_cmd_manager.h"
45 //!
46 //! \brief OS specific includes and definitions
47 //!
48 #include "mos_os_specific.h"
49 #include "mos_os_virtualengine_specific.h"
50
51 #include "mos_oca_interface.h"
52 #include "mos_cache_manager.h"
53
54 class MhwInterfacesNext;
55 #define MOS_NAL_UNIT_LENGTH 4
56 #define MOS_NAL_UNIT_STARTCODE_LENGTH 3
57 #define MOS_MAX_PATH_LENGTH 256
58
59 #define MOS_MAX_SEMAPHORE_COUNT 3
60 #define MOS_MAX_OBJECT_SIGNALED 32
61
62 #define MOS_INVALID_APPID 0xFFFFFFFF
63
64 #define MOS_GPU_CONTEXT_CREATE_DEFAULT 1
65 #define MOS_GPU_CONTEXT_CREATE_CM_DEFAULT 15
66
67 #define MOS_VCS_ENGINE_USED(GpuContext) ( \
68 ((GpuContext) == MOS_GPU_CONTEXT_VIDEO) || \
69 ((GpuContext) == MOS_GPU_CONTEXT_VIDEO2) || \
70 ((GpuContext) == MOS_GPU_CONTEXT_VIDEO3) || \
71 ((GpuContext) == MOS_GPU_CONTEXT_VIDEO4) || \
72 ((GpuContext) == MOS_GPU_CONTEXT_VDBOX2_VIDEO) || \
73 ((GpuContext) == MOS_GPU_CONTEXT_VDBOX2_VIDEO2) || \
74 ((GpuContext) == MOS_GPU_CONTEXT_VDBOX2_VIDEO3) || \
75 ((GpuContext) == MOS_GPU_CONTEXT_VIDEO5) || \
76 ((GpuContext) == MOS_GPU_CONTEXT_VIDEO6) || \
77 ((GpuContext) == MOS_GPU_CONTEXT_VIDEO7) \
78 )
79
80 #define MOS_RCS_ENGINE_USED(GpuContext) ( \
81 ((GpuContext) == MOS_GPU_CONTEXT_RENDER) || \
82 ((GpuContext) == MOS_GPU_CONTEXT_RENDER2) || \
83 ((GpuContext) == MOS_GPU_CONTEXT_RENDER3) || \
84 ((GpuContext) == MOS_GPU_CONTEXT_RENDER4) || \
85 ((GpuContext) == MOS_GPU_CONTEXT_COMPUTE) || \
86 ((GpuContext) == MOS_GPU_CONTEXT_CM_COMPUTE) || \
87 ((GpuContext) == MOS_GPU_CONTEXT_COMPUTE_RA) || \
88 ((GpuContext) == MOS_GPU_CONTEXT_RENDER_RA) \
89 )
90
91 #define MOS_BCS_ENGINE_USED(GpuContext) ( \
92 ((GpuContext) == MOS_GPU_CONTEXT_BLT))
93
94 #if MOS_MEDIASOLO_SUPPORTED
95 #define MOS_VECS_ENGINE_USED(GpuContext) ( \
96 ((GpuContext) == MOS_GPU_CONTEXT_VEBOX) || \
97 ((GpuContext) == MOS_GPU_CONTEXT_VEBOX2))
98 #else
99 #define MOS_VECS_ENGINE_USED(GpuContext) ( \
100 ((GpuContext) == MOS_GPU_CONTEXT_VEBOX))
101 #endif
102
103 #define MOS_TEECS_ENGINE_USED(GpuContext) ( \
104 ((GpuContext) == MOS_GPU_CONTEXT_TEE))
105
106 #if MOS_COMMAND_BUFFER_DUMP_SUPPORTED
107 #define MOS_COMMAND_BUFFER_OUT_FILE "Command_buffer_output"
108 #define MOS_COMMAND_BUFFER_OUT_DIR "Command_buffer_dumps"
109 #define MOS_COMMAND_BUFFER_RENDER_ENGINE "CS"
110 #define MOS_COMMAND_BUFFER_VIDEO_ENGINE "VCS"
111 #define MOS_COMMAND_BUFFER_VEBOX_ENGINE "VECS"
112 #define MOS_COMMAND_BUFFER_TEE_ENGINE "TEE"
113 #define MOS_COMMAND_BUFFER_PLATFORM_LEN 4
114 #endif // MOS_COMMAND_BUFFER_DUMP_SUPPORTED
115
116 #ifndef E_NOTIMPL
117 #define E_NOTIMPL 0x80004001L
118 #endif // E_NOTIMPL
119
120 #ifndef E_UNEXPECTED
121 #define E_UNEXPECTED 0x8000FFFFL
122 #endif // E_UNEXPECTED
123
124 //!
125 //! \brief Structure to OS sync parameters
126 //!
127 typedef struct _MOS_SYNC_PARAMS
128 {
129 MOS_GPU_CONTEXT GpuContext; //!< GPU context you would like to signal on or wait in
130 PMOS_RESOURCE presSyncResource; //!< Has 2 meanings:
131 //!< 1) a resource that requires sync, like a destination surface
132 //!< 2) a resource used by HW/OS to sync between engines, like for MI_SEMAPHORE_MBOX
133 uint32_t uiSemaphoreCount;
134 uint32_t uiSemaphoreValue; //!< Tag value in the case of resource tagging
135 uint32_t uiSemaphoreOffset; //!< Offset into the sync resource for value read/write
136 int32_t bReadOnly; //!< Marks the resource as read or write for future waits
137 int32_t bDisableDecodeSyncLock; //!< Disable the lock function for decode.
138 int32_t bDisableLockForTranscode; //!< Disable the lock function for transcode perf.
139 } MOS_SYNC_PARAMS, *PMOS_SYNC_PARAMS;
140
141 typedef enum _MOS_SCALABILITY_ENABLE_MODE
142 {
143 MOS_SCALABILITY_ENABLE_MODE_FALSE = 0,
144 MOS_SCALABILITY_ENABLE_MODE_DEFAULT = 0x0001,
145 MOS_SCALABILITY_ENABLE_MODE_USER_FORCE = 0x0010
146 } MOS_SCALABILITY_ENABLE_MODE;
147
148 typedef enum _TRINITY_PATH
149 {
150 TRINITY_DISABLED = 0,
151 TRINITY9_ENABLED = 1,
152 TRINITY11_ENABLED = 2,
153 } TRINITY_PATH;
154
155 #if (_DEBUG || _RELEASE_INTERNAL)
156 //!
157 //! \brief for forcing VDBOX
158 //!
159
160 #define MOS_FORCE_VDBOX_NONE 0
161 #define MOS_FORCE_VDBOX_1 0x0001
162 #define MOS_FORCE_VDBOX_2 0x0002
163 #define MOS_FORCE_VDBOX_3 0x0003
164 //below is for scalability case,
165 //format is FE vdbox is specified as lowest 4 bits; BE0 is 2nd low 4 bits; BE1 is 3rd low 4bits.
166 #define MOS_FORCE_VDBOX_1_1_2 0x0211
167 //FE-VDBOX2, BE0-VDBOX1, BE2-VDBOX2
168 #define MOS_FORCE_VDBOX_2_1_2 0x0212
169
170 //!
171 //! \brief Enum for forcing VEBOX
172 //!
173 typedef enum _MOS_FORCE_VEBOX
174 {
175 MOS_FORCE_VEBOX_NONE = 0,
176 MOS_FORCE_VEBOX_1 = 0x0001,
177 MOS_FORCE_VEBOX_2 = 0x0002,
178 MOS_FORCE_VEBOX_3 = 0x0003,
179 MOS_FORCE_VEBOX_4 = 0x0004,
180 // For scalability case
181 MOS_FORCE_VEBOX_1_2 = 0x0012,
182 MOS_FORCE_VEBOX_1_2_3 = 0x0123,
183 MOS_FORCE_VEBOX_1_2_3_4 = 0x1234
184 } MOS_FORCE_VEBOX;
185
186 #define MOS_FORCEVEBOX_VEBOXID_BITSNUM 4 //each VEBOX ID occupies 4 bits see defintion MOS_FORCE_VEBOX
187 #define MOS_FORCEVEBOX_MASK 0xf
188
189
190 #define MOS_FORCEVDBOX_VDBOXID_BITSNUM 4 //each VDBOX ID occupies 4 bits see defintion MOS_FORCE_VDBOX
191 #define MOS_FORCEVDBOX_MASK 0xF
192
193 #define MOS_FORCEENGINE_MASK 0xf
194 #define MOS_FORCEENGINE_ENGINEID_BITSNUM 4 //each VDBOX ID occupies 4 bits see defintion MOS_FORCE_VDBOX
195 #define MOS_INVALID_FORCEENGINE_VALUE 0xffffffff
196 #define MOS_INVALID_ENGINE_INSTANCE 0xff // this invalid engine instance value aligns with KMD
197 #endif
198
199 typedef struct _MOS_VIRTUALENGINE_INTERFACE *PMOS_VIRTUALENGINE_INTERFACE;
200 typedef struct _MOS_CMD_BUF_ATTRI_VE MOS_CMD_BUF_ATTRI_VE, *PMOS_CMD_BUF_ATTRI_VE;
201
202
203 typedef struct _MOS_COMMAND_BUFFER_ATTRIBUTES
204 {
205 int32_t bTurboMode;
206 int32_t bIsMdfLoad;
207 int32_t bMediaPreemptionEnabled;
208 uint32_t dwNumRequestedEUSlices;
209 uint32_t dwNumRequestedSubSlices;
210 uint32_t dwNumRequestedEUs;
211 int32_t bValidPowerGatingRequest;
212 int32_t bEnableMediaFrameTracking;
213 uint32_t dwMediaFrameTrackingTag;
214 uint32_t dwMediaFrameTrackingAddrOffset;
215 PMOS_RESOURCE resMediaFrameTrackingSurface;
216 int32_t bUmdSSEUEnable;
217 int32_t bFrequencyBoost;
218 void* pAttriVe;
219 } MOS_COMMAND_BUFFER_ATTRIBUTES, *PMOS_COMMAND_BUFFER_ATTRIBUTES;
220
221 //!
222 //! \brief VDBOX indices
223 //!
224 typedef enum _MOS_VDBOX_NODE_IND
225 {
226 MOS_VDBOX_NODE_INVALID = -1,
227 MOS_VDBOX_NODE_1 = 0x0,
228 MOS_VDBOX_NODE_2 = 0x1
229 } MOS_VDBOX_NODE_IND;
230
231 //!
232 //! \brief VEBOX indices
233 //!
234 typedef enum _MOS_VEBOX_NODE_IND
235 {
236 MOS_VEBOX_NODE_INVALID = -1,
237 MOS_VEBOX_NODE_1 = 0x0,
238 MOS_VEBOX_NODE_2 = 0x1,
239 MOS_VEBOX_NODE_3 = 0x2,
240 MOS_VEBOX_NODE_4 = 0x3
241 } MOS_VEBOX_NODE_IND;
242
243 #define SUBMISSION_TYPE_SINGLE_PIPE (1 << 0)
244 #define SUBMISSION_TYPE_SINGLE_PIPE_MASK (0xff)
245 #define SUBMISSION_TYPE_MULTI_PIPE_SHIFT 8
246 #define SUBMISSION_TYPE_MULTI_PIPE_ALONE (1 << SUBMISSION_TYPE_MULTI_PIPE_SHIFT)
247 #define SUBMISSION_TYPE_MULTI_PIPE_MASTER (1 << (SUBMISSION_TYPE_MULTI_PIPE_SHIFT+1))
248 #define SUBMISSION_TYPE_MULTI_PIPE_SLAVE (1 << (SUBMISSION_TYPE_MULTI_PIPE_SHIFT+2))
249 #define SUBMISSION_TYPE_MULTI_PIPE_MASK (0xff << SUBMISSION_TYPE_MULTI_PIPE_SHIFT)
250 #define SUBMISSION_TYPE_MULTI_PIPE_SLAVE_INDEX_SHIFT 16
251 #define SUBMISSION_TYPE_MULTI_PIPE_SLAVE_INDEX_MASK (0xff << SUBMISSION_TYPE_MULTI_PIPE_SLAVE_INDEX_SHIFT)
252 #define SUBMISSION_TYPE_MULTI_PIPE_FLAGS_SHIFT 24
253 #define SUBMISSION_TYPE_MULTI_PIPE_FLAGS_MASK (0xff << SUBMISSION_TYPE_MULTI_PIPE_FLAGS_SHIFT)
254 #define SUBMISSION_TYPE_MULTI_PIPE_FLAGS_LAST_PIPE (1 << SUBMISSION_TYPE_MULTI_PIPE_FLAGS_SHIFT)
255 typedef int32_t MOS_SUBMISSION_TYPE;
256
257 #define EXTRA_PADDING_NEEDED 4096
258 #define MEDIA_CMF_UNCOMPRESSED_WRITE 0xC
259
260 struct _MHW_BATCH_BUFFER;
261 typedef struct _MHW_BATCH_BUFFER MHW_BATCH_BUFFER, * PMHW_BATCH_BUFFER;
262 //!
263 //! \brief Structure to command buffer
264 //!
265 typedef struct _MOS_COMMAND_BUFFER
266 {
267 MOS_RESOURCE OsResource; //!< OS Resource
268 PMHW_BATCH_BUFFER syncMhwBatchBuffer; //!< Pointer to sync mhw batch buffer
269 bool bNativeFenceSyncBBAdded; //!< True after native fence MI_BATCH_BUFFER_START has been emitted
270
271 // Common fields
272 uint32_t *pCmdBase; //!< Base address (CPU)
273 uint32_t *pCmdPtr; //!< Current address (CPU)
274 int32_t iOffset; //!< Current offset in bytes
275 int32_t iRemaining; //!< Remaining size
276 int32_t iTokenOffsetInCmdBuf; //!< Pointer to (Un)Secure token's next field Offset
277 int32_t iCmdIndex; //!< command buffer's index
278 MOS_VDBOX_NODE_IND iVdboxNodeIndex; //!< Which VDBOX buffer is binded to
279 MOS_VEBOX_NODE_IND iVeboxNodeIndex; //!< Which VEBOX buffer is binded to
280 int32_t iSubmissionType;
281 bool is1stLvlBB; //!< indicate it's a first level BB or not
282 struct _MOS_COMMAND_BUFFER *cmdBuf1stLvl; //!< Pointer to 1st level command buffer.
283 MOS_COMMAND_BUFFER_ATTRIBUTES Attributes; //!< Attributes for the command buffer to be provided to KMD at submission
284 } MOS_COMMAND_BUFFER;
285
286 //!
287 //! \brief Structure to Lock params
288 //!
289 typedef struct _MOS_LOCK_PARAMS
290 {
291 union
292 {
293 struct
294 {
295 uint32_t ReadOnly : 1; //!< Lock only for reading.
296 uint32_t WriteOnly : 1; //!< Lock only for writing.
297 uint32_t TiledAsTiled : 1; //!< Means that you want to lock a tiled surface as tiled, not linear.
298 uint32_t NoOverWrite : 1; //!< No Over write for async locks
299 uint32_t NoDecompress : 1; //!< No decompression for memory compressed surface
300 uint32_t Uncached : 1; //!< Use uncached lock
301 uint32_t ForceCached : 1; //!< Prefer normal map to global GTT map(Uncached) if both can work
302 uint32_t DumpBeforeSubmit : 1; //!< Lock only for dump before submit
303 uint32_t DumpAfterSubmit : 1; //!< Lock only for dump after submit
304 uint32_t Reserved : 23; //!< Reserved for expansion.
305 };
306 uint32_t Value;
307 };
308 } MOS_LOCK_PARAMS, *PMOS_LOCK_PARAMS;
309
310 //!
311 //! \brief flags for GFX allocation destroy
312 //!
313 typedef struct _MOS_GFXRES_FREE_FLAGS
314 {
315 union
316 {
317 struct
318 {
319 uint32_t AssumeNotInUse : 1;
320 uint32_t SynchronousDestroy : 1;
321 uint32_t Reserved : 30;
322 };
323 uint32_t Value;
324 };
325 } MOS_GFXRES_FREE_FLAGS;
326
327 //!
328 //! \brief Structure to Resource Flags
329 //!
330 typedef struct _MOS_GFXRES_FLAGS
331 {
332 int32_t bNotLockable; //!< [in] true: Resource will not be CPU accessible. false: Resource can be CPU accessed.
333 int32_t bOverlay;
334 int32_t bFlipChain;
335 int32_t bSVM;
336 int32_t bCacheable;
337 int32_t bSubAllocation; //!< [in] true: Resource is a sub-allocation. Only used for volume 3DLUT buffer.
338 } MOS_GFXRES_FLAGS, *PMOS_GFXRES_FLAGS;
339
340 //!
341 //! \brief Structure to Resource allocation parameters
342 //!
343 typedef struct _MOS_ALLOC_GFXRES_PARAMS
344 {
345 MOS_GFXRES_TYPE Type; //!< [in] Basic resource geometry
346 MOS_GFXRES_FLAGS Flags; //!< [in] Flags to describe attributes
347 union
348 {
349 uint32_t dwWidth; //!< [in] Type == 2D || VOLUME, width in pixels.
350 uint32_t dwBytes; //!< [in] Type == BUFFER, # of bytes
351 };
352 uint32_t dwHeight; //!< [in] Type == 2D || VOLUME, height in rows. Type == BUFFER, n/a
353 uint32_t dwDepth; //!< [in] 0: Implies 2D resource. >=1: volume resource
354 uint32_t dwArraySize; //!< [in] 0,1: 1 element. >1: N elements
355 MOS_TILE_TYPE TileType; //!< [in] Defines the layout of a physical page. Optimal choice depends on usage model.
356 MOS_TILE_MODE_GMM m_tileModeByForce; //!< [in] Indicates a tile Encoding (aligned w/ GMM defination) needs set by force
357 MOS_FORMAT Format; //!< [in] Pixel format
358 void *pSystemMemory; //!< [in] Optional parameter. If non null, TileType must be set to linear.
359 const char *pBufName; //!< [in] Optional parameter. A string indicates the buffer name and is used for debugging. nullptr is OK.
360 int32_t bIsCompressible; //!< [in] Resource is compressible or not.
361 MOS_RESOURCE_MMC_MODE CompressionMode; //!< [in] Compression mode.
362 int32_t bIsPersistent; //!< [in] Optional parameter. Used to indicate that resource can not be evicted
363 int32_t bBypassMODImpl;
364 int32_t dwMemType; //!< [in] Optional paramerter. Prefer memory type
365 MOS_HW_RESOURCE_DEF ResUsageType; //!< [in] the resource usage type to determine the cache policy
366 bool hardwareProtected; //!< [in] Flag as hint that Resource can be used as hw protected
367 } MOS_ALLOC_GFXRES_PARAMS, *PMOS_ALLOC_GFXRES_PARAMS;
368
369 //!
370 //! \brief Enum for MOS patch type
371 //!
372 typedef enum _MOS_PATCH_TYPE
373 {
374 MOS_PATCH_TYPE_BASE_ADDRESS = 0,
375 MOS_PATCH_TYPE_PITCH,
376 MOS_PATCH_TYPE_UV_Y_OFFSET,
377 MOS_PATCH_TYPE_BIND_ONLY,
378 MOS_PATCH_TYPE_UV_BASE_ADDRESS,
379 MOS_PATCH_TYPE_V_BASE_ADDRESS,
380 MOS_PATCH_TYPE_V_Y_OFFSET
381 } MOS_PATCH_TYPE;
382
383 //!
384 //! \brief Structure to OS sync parameters
385 //!
386 typedef struct _MOS_PATCH_ENTRY_PARAMS
387 {
388 PMOS_RESOURCE presResource; //!< resource to be patched
389 uint32_t uiAllocationIndex;
390 uint32_t uiResourceOffset; //!< resource offset
391 uint32_t uiPatchOffset; //!< patch offset
392 uint32_t bWrite; //!< is write operation
393 int32_t bUpperBoundPatch; //!< is upper bound patch
394 MOS_HW_COMMAND HwCommandType; //!< hw cmd type
395 uint32_t forceDwordOffset; //!< force dword offset
396 uint8_t *cmdBufBase; //!< cmd buffer base address
397 uint32_t offsetInSSH; //!< patch offset in SSH
398 uint32_t shiftAmount; //!< shift amount for patch
399 uint32_t shiftDirection; //!< shift direction for patch
400 MOS_PATCH_TYPE patchType; //!< patch type
401 MOS_COMMAND_BUFFER *cmdBuffer; //!< command buffer
402 } MOS_PATCH_ENTRY_PARAMS, *PMOS_PATCH_ENTRY_PARAMS;
403
404 typedef struct _MOS_GPUCTX_CREATOPTIONS MOS_GPUCTX_CREATOPTIONS, *PMOS_GPUCTX_CREATOPTIONS;
405 struct _MOS_GPUCTX_CREATOPTIONS
406 {
407 uint32_t CmdBufferNumScale;
408 uint32_t RAMode;
409 uint32_t ProtectMode;
410 uint32_t gpuNode;
411 //For slice shutdown
412 union
413 {
414 struct
415 {
416 uint8_t SliceCount;
417 uint8_t SubSliceCount; //Subslice count per slice
418 uint8_t MaxEUcountPerSubSlice;
419 uint8_t MinEUcountPerSubSlice;
420 } packed;
421
422 uint32_t SSEUValue;
423 };
424
425 uint8_t isRealTimePriority; // 1 if context is created from real time priority command queue (run GT at higher frequency)
426
427 _MOS_GPUCTX_CREATOPTIONS() : CmdBufferNumScale(MOS_GPU_CONTEXT_CREATE_DEFAULT),
428 RAMode(0),
429 ProtectMode(0),
430 gpuNode(0),
431 SSEUValue(0),
432 isRealTimePriority(0){}
433
434 _MOS_GPUCTX_CREATOPTIONS(_MOS_GPUCTX_CREATOPTIONS* createOption) : CmdBufferNumScale(createOption->CmdBufferNumScale),
435 RAMode(createOption->RAMode),
436 ProtectMode(createOption->ProtectMode),
437 gpuNode(createOption->gpuNode),
438 SSEUValue(createOption->SSEUValue),
439 isRealTimePriority(createOption->isRealTimePriority) {}
440
441 virtual ~_MOS_GPUCTX_CREATOPTIONS(){}
442 };
443
444 class OsContext;
445
446 #if MOS_COMMAND_RESINFO_DUMP_SUPPORTED
447 //!
448 //! \brief Class to Dump GPU Command Info
449 //!
450 class GpuCmdResInfoDump
451 {
452 public:
453
454 static const GpuCmdResInfoDump *GetInstance(PMOS_CONTEXT mosCtx);
455 GpuCmdResInfoDump(PMOS_CONTEXT mosCtx);
456
457 void Dump(PMOS_INTERFACE pOsInterface) const;
458
459 void StoreCmdResPtr(PMOS_INTERFACE pOsInterface, const void *pRes) const;
460
461 void ClearCmdResPtrs(PMOS_INTERFACE pOsInterface) const;
462
463 private:
464
465 struct GpuCmdResInfo;
466
467 void Dump(const void *pRes, std::ofstream &outputFile) const;
468
469 const std::vector<const void *> &GetCmdResPtrs(PMOS_INTERFACE pOsInterface) const;
470
471 const char *GetResType(MOS_GFXRES_TYPE resType) const;
472
473 const char *GetTileType(MOS_TILE_TYPE tileType) const;
474
475 private:
476
477 static std::shared_ptr<GpuCmdResInfoDump> m_instance;
478 mutable uint32_t m_cnt = 0;
479 bool m_dumpEnabled = false;
480 std::string m_path = "";
481 };
482 #endif // MOS_COMMAND_RESINFO_DUMP_SUPPORTED
483
484 class OsContextNext;
485 typedef void * OS_PER_STREAM_PARAMETERS;
486 typedef void * EXTRA_PARAMS;
487 typedef OsContextNext OsDeviceContext;
488 typedef _MOS_GPUCTX_CREATOPTIONS GpuContextCreateOption;
489 struct _MOS_INTERFACE;
490 class MosVeInterface;
491 class CommandList;
492 class CmdBufMgrNext;
493 class MosCpInterface;
494 class MosDecompression;
495
496 //!
497 //! \brief Structure to Unified InDirectState Dump Info
498 //!
499 struct INDIRECT_STATE_INFO
500 {
501 uint32_t stateSize = 0; //size of indirectstate
502 uint32_t *indirectState = nullptr; //indirectstate address
503 uint32_t *gfxAddressBottom = nullptr; //indirect gfx address bottom
504 uint32_t *gfxAddressTop = nullptr; //indirect gfx address top
505 const char *stateName = "";
506 uint32_t gfxAddressBottomValue = 0;
507 uint32_t gfxAddressTopValue = 0;
508 };
509
510 struct MosStreamState
511 {
512 OsDeviceContext *osDeviceContext = nullptr;
513 GPU_CONTEXT_HANDLE currentGpuContextHandle = MOS_GPU_CONTEXT_INVALID_HANDLE;
514 MOS_COMPONENT component = COMPONENT_UNKNOWN;
515
516 CommandList *currentCmdList = nullptr; //<! Command list used in async mode
517 CmdBufMgrNext *currentCmdBufMgr = nullptr; //<! Cmd buffer manager used in async mode
518 MosDecompression *mosDecompression = nullptr; //<! Decompression State used for decompress
519 bool enableDecomp = false; //<! Set true in StreamState init. If false then not inited
520 bool postponedExecution = false; //!< Indicate if the stream is work in postponed execution mode. This flag is only used in aync mode.
521
522 bool supportVirtualEngine = false; //!< Flag to indicate using virtual engine interface
523 MosVeInterface *virtualEngineInterface = nullptr; //!< Interface to virtual engine state
524 bool useHwSemaForResSyncInVe = false; //!< Flag to indicate if UMD need to send HW sema cmd under this OS when there is a resource sync need with Virtual Engine interface
525 bool veEnable = false; //!< Flag to indicate virtual engine enabled (Can enable VE without using virtual engine interface)
526 bool phasedSubmission = false; //!< Flag to indicate if secondary command buffers are submitted together or separately due to different OS
527 bool frameSplit = true; //!< Flag to indicate if frame split is enabled (only active when phasedSubmission is true)
528 int32_t hcpDecScalabilityMode = 0; //!< Hcp scalability mode
529 int32_t veboxScalabilityMode = 0; //!< Vebox scalability mode
530
531 bool ctxBasedScheduling = false; //!< Indicate if context based scheduling is enabled in this stream
532 bool multiNodeScaling = false; //!< Flag to indicate if multi-node scaling is enabled for virtual engine (only active when ctxBasedScheduling is true)
533
534 int32_t ctxPriority = 0;
535 bool softReset = false; //!< trigger soft reset
536
537 MosCpInterface *osCpInterface = nullptr; //!< CP interface
538
539 bool mediaReset = false; //!< Flag to indicate media reset is enabled
540
541 bool forceMediaCompressedWrite = false; //!< Flag to force media compressed write
542
543 bool enableDecodeLowLatency = false; //!< Flag to enable decode low latency by frequency boost
544
545 bool simIsActive = false; //!< Flag to indicate if Simulation is enabled
546 MOS_NULL_RENDERING_FLAGS nullHwAccelerationEnable = {}; //!< To indicate which components to enable Null HW support
547
548 bool usesPatchList = false; //!< Uses patch list instead of graphic address directly
549 bool usesGfxAddress = false; //!< Uses graphic address directly instead of patch list
550 bool enableKmdMediaFrameTracking = false; //!< Enable KMD Media frame tracking
551 bool usesCmdBufHeaderInResize = false; //!< Use cmd buffer header in resize
552 bool usesCmdBufHeader = false; //!< Use cmd buffer header
553
554 // GPU Reset Statistics
555 uint32_t gpuResetCount = 0;
556 uint32_t gpuActiveBatch = 0;
557 uint32_t gpuPendingBatch = 0;
558
559 #if MOS_COMMAND_BUFFER_DUMP_SUPPORTED
560 // Command buffer dump
561 bool dumpCommandBuffer = false; //!< Flag to indicate if Dump command buffer is enabled
562 bool dumpCommandBufferToFile = false; //!< Indicates that the command buffer should be dumped to a file
563 bool dumpCommandBufferAsMessages = false; //!< Indicates that the command buffer should be dumped via MOS normal messages
564 char sDirName[MOS_MAX_HLT_FILENAME_LEN] = {0}; //!< Dump Directory name - maximum 260 bytes length
565 std::vector<INDIRECT_STATE_INFO> indirectStateInfo = {}; //!< this only valid when command buffer dump enabled
566 #endif // MOS_COMMAND_BUFFER_DUMP_SUPPORTED
567
568 #if _DEBUG || _RELEASE_INTERNAL
569 bool enableDbgOvrdInVirtualEngine = false; //!< enable debug override in virtual engine
570
571 int32_t eForceVdbox = 0; //!< Force select Vdbox
572 int32_t eForceVebox = 0; //!< Force select Vebox
573 #endif // _DEBUG || _RELEASE_INTERNAL
574
575 bool bParallelSubmission = false; //!< Flag to indicate if parallel submission is enabled
576 OS_PER_STREAM_PARAMETERS perStreamParameters = nullptr; //!< Parameters of OS specific per stream
577
578 static void *pvSoloContext; //!< pointer to MediaSolo context
579
580 #if MOS_MEDIASOLO_SUPPORTED
581
582 int32_t bSupportMediaSoloVirtualEngine = 0; //!< Flag to indicate if MediaSolo uses VE solution in cmdbuffer submission.
583 uint32_t dwEnableMediaSoloFrameNum = 0; //!< The frame number at which MediaSolo will be enabled, 0 is not valid.
584 int32_t bSoloInUse = 0; //!< Flag to indicate if MediaSolo is enabled
585 #endif // MOS_MEDIASOLO_SUPPORTED
586 MhwInterfacesNext *mhwInterface = nullptr;
587 };
588
589 // OS agnostic MOS objects
590 typedef OsDeviceContext *MOS_DEVICE_HANDLE;
591 typedef MosStreamState *MOS_STREAM_HANDLE;
592 //typedef uint32_t GPU_CONTEXT_HANDLE;
593 typedef MOS_COMMAND_BUFFER *COMMAND_BUFFER_HANDLE;
594 typedef MOS_RESOURCE *MOS_RESOURCE_HANDLE;
595 typedef MosVeInterface *MOS_VE_HANDLE;
596
597 // OS specific MOS objects
598 typedef void * OsSpecificRes; //!< stand for different os specific resource structure (or info)
599 typedef void * OS_HANDLE; //!< stand for different os handles
600 typedef MOS_SURFACE MosResourceInfo;
601 typedef void * DDI_DEVICE_CONTEXT; //!< stand for different os specific device context
602 typedef void * MOS_INTERFACE_HANDLE;
603
604 class GpuContextMgr;
605
606 namespace CMRT_UMD
607 {
608 class CmDevice;
609 };
610 struct _CM_HAL_STATE;
611 typedef struct _CM_HAL_STATE *PCM_HAL_STATE;
612 class MhwCpInterface;
613 class CodechalSecureDecodeInterface;
614 class CodechalSetting;
615 class CodechalHwInterface;
616 class CodechalHwInterfaceNext;
617 class L0NpuInterface;
618
619 struct MOS_SURF_DUMP_SURFACE_DEF
620 {
621 uint32_t offset; //!< Offset from start of the plane
622 uint32_t height; //!< Height in rows
623 uint32_t width; //!< Width in bytes
624 uint32_t pitch; //!< Pitch in bytes
625 };
626
627 struct ResourceDumpAttri
628 {
629 MOS_RESOURCE res = {};
630 MOS_LOCK_PARAMS lockFlags = {};
631 std::string fullFileName = {};
632 uint32_t width = 0;
633 uint32_t height = 0;
634 uint32_t pitch = 0;
635 MOS_GFXRES_FREE_FLAGS resFreeFlags = {};
636 MOS_PLANE_OFFSET yPlaneOffset = {}; // Y surface plane offset
637 MOS_PLANE_OFFSET uPlaneOffset = {}; // U surface plane offset
638 MOS_PLANE_OFFSET vPlaneOffset = {}; // V surface plane offset
639 };
640
641 //!
642 //! \brief Structure to Unified HAL OS resources
643 //!
644 typedef struct _MOS_INTERFACE
645 {
646 //APO WRAPPER
647 MOS_STREAM_HANDLE osStreamState = MOS_INVALID_HANDLE;
648
649 // Saved OS context
650 PMOS_CONTEXT pOsContext;
651 MOS_GPU_CONTEXT CurrentGpuContextOrdinal = MOS_GPU_CONTEXT_MAX;
652 //!< An internal handle that indexes into the list of GPU Context object
653 uint32_t CurrentGpuContextHandle;
654 //!< A handle to the graphics context device that can be used to calls back
655 //!< into the kernel subsystem
656 HANDLE CurrentGpuContextRuntimeHandle;
657
658 //!< Only used in async and softlet mos mode for backward compatiable
659 GPU_CONTEXT_HANDLE m_GpuContextHandleMap[MOS_GPU_CONTEXT_MAX] = {0};
660 GPU_CONTEXT_HANDLE m_encContext;
661 GPU_CONTEXT_HANDLE m_pakContext;
662 // OS dependent settings, flags, limits
663 int32_t b64bit;
664 int32_t bDeallocateOnExit;
665 MOS_USER_FEATURE_INTERFACE UserFeatureInterface;
666 MosCpInterface *osCpInterface;
667
668 int32_t bUsesCmdBufHeader;
669 int32_t bUsesCmdBufHeaderInResize;
670 int32_t bEnableKmdMediaFrameTracking;
671 int32_t bNoParsingAssistanceInKmd;
672 bool bPitchAndUVPatchingNeeded = false;
673 uint32_t dwCommandBufferReservedSpace;
674 uint32_t dwNumNalUnitBytesIncluded;
675
676 // GPU Reset Statistics
677 uint32_t dwGPUResetCount;
678 uint32_t dwGPUActiveBatch;
679 uint32_t dwGPUPendingBatch;
680
681 // Resource addressing
682 int32_t bUsesPatchList;
683 int32_t bUsesGfxAddress;
684 int32_t bMapOnCreate; // For limited GPU VA resource can not be mapped during creation
685 int32_t bInlineCodecStatusUpdate; // check whether use inline codec status update or seperate BB
686 int32_t bAllowExtraPatchToSameLoc; // patch another resource to same location in cmdbuffer
687
688 // Component info
689 MOS_COMPONENT Component;
690
691 // Stream info
692 uint32_t streamIndex = 0;
693
694 // Synchronization
695 int32_t bTagEngineSync;
696 int32_t bTagResourceSync;
697 int32_t bOsEngineSync;
698 int32_t bOsResourceSync;
699
700 // Simulation (HAS) related
701 int32_t bSimIsActive; //!< Flag to indicate if HAS is enabled
702
703 MOS_NULL_RENDERING_FLAGS NullHWAccelerationEnable; //!< To indicate which components to enable Null HW support
704
705 // for MODS Wrapper
706 int32_t modulizedMosEnabled;
707 int32_t modularizedGpuCtxEnabled;
708 OsContext* osContextPtr;
709
710 HybridCmdMgr *hybridCmdMgr = nullptr;
711 //for npu levelzero
712 L0NpuInterface* npuInterface = nullptr;
713
714 // used for media reset enabling/disabling in UMD
715 // pls remove it after hw scheduling
716 int32_t bMediaReset;
717 TRINITY_PATH trinityPath;
718
719 bool umdMediaResetEnable;
720
721 bool forceMediaCompressedWrite;
722
723 #if MOS_MEDIASOLO_SUPPORTED
724 // MediaSolo related
725 int32_t bSoloInUse; //!< Flag to indicate if MediaSolo is enabled
726 static void *pvSoloContext; //!< pointer to MediaSolo context
727 static uint32_t soloRefCnt;
728 uint32_t dwEnableMediaSoloFrameNum; //!< The frame number at which MediaSolo will be enabled, 0 is not valid.
729 #endif // MOS_MEDIASOLO_SUPPORTED
730
731 #if MOS_COMMAND_BUFFER_DUMP_SUPPORTED
732 // Command buffer dump
733 int32_t bDumpCommandBuffer; //!< Flag to indicate if Dump command buffer is enabled
734 int32_t bDumpCommandBufferToFile; //!< Indicates that the command buffer should be dumped to a file
735 int32_t bDumpCommandBufferAsMessages; //!< Indicates that the command buffer should be dumped via MOS normal messages
736 char sPlatformName[MOS_COMMAND_BUFFER_PLATFORM_LEN]; //!< Platform name - maximum 4 bytes length
737 char sDirName[MOS_MAX_HLT_FILENAME_LEN]; //!< Dump Directory name - maximum 260 bytes length
738 #endif // MOS_COMMAND_BUFFER_DUMP_SUPPORTED
739
740 #if (_RELEASE_INTERNAL||_DEBUG)
741 #if defined(CM_DIRECT_GUC_SUPPORT)
742 CMRTWorkQueueMngr *m_pWorkQueueMngr;
743 CMRT_WORK_QUEUE_INFO m_WorkQueueInfo[5]; //IGFX_ABSOLUTE_MAX_ENGINES
744 #endif
745 #endif
746
747 bool bEnableVdboxBalancing; //!< Enable per BB VDBox balancing
748 #if (_DEBUG || _RELEASE_INTERNAL)
749 int eForceVdbox; //!< Force select Vdbox
750 uint32_t dwForceTileYfYs; // force to allocate Yf (=1) or Ys (=2), remove after full validation
751 int32_t bTriggerCodecHang; // trigger GPU HANG in codec
752 int32_t bTriggerVPHang; //!< trigger GPU HANG in VP
753 #endif // (_DEBUG || _RELEASE_INTERNAL)
754
755 bool apoMosEnabled; //!< apo mos or not
756 std::vector<ResourceDumpAttri> resourceDumpAttriArray;
757
758 MEMORY_OBJECT_CONTROL_STATE (* pfnCachePolicyGetMemoryObject) (
759 MOS_HW_RESOURCE_DEF Usage,
760 GMM_CLIENT_CONTEXT *pGmmClientContext);
761
762 uint8_t (* pfnCachePolicyGetL1Config) (
763 MOS_HW_RESOURCE_DEF Usage,
764 GMM_CLIENT_CONTEXT *pGmmClientContext);
765
766 MOS_STATUS (* pfnCreateGpuContext) (
767 PMOS_INTERFACE pOsInterface,
768 MOS_GPU_CONTEXT GpuContext,
769 MOS_GPU_NODE GpuNode,
770 PMOS_GPUCTX_CREATOPTIONS createOption);
771
772 GPU_CONTEXT_HANDLE (*pfnCreateGpuComputeContext) (
773 PMOS_INTERFACE osInterface,
774 MOS_GPU_CONTEXT gpuContext,
775 MOS_GPUCTX_CREATOPTIONS *createOption);
776
777 MOS_STATUS (* pfnDestroyGpuContext) (
778 PMOS_INTERFACE pOsInterface,
779 MOS_GPU_CONTEXT GpuContext);
780
781 MOS_STATUS (* pfnDestroyGpuContextByHandle) (
782 PMOS_INTERFACE pOsInterface,
783 GPU_CONTEXT_HANDLE gpuContextHandle);
784
785 MOS_STATUS (* pfnDestroyGpuComputeContext) (
786 PMOS_INTERFACE osInterface,
787 GPU_CONTEXT_HANDLE gpuContextHandle);
788
789 MOS_STATUS (* pfnSetGpuContext) (
790 PMOS_INTERFACE pOsInterface,
791 MOS_GPU_CONTEXT GpuContext);
792
793 MOS_STATUS (*pfnSetGpuContextFromHandle)(PMOS_INTERFACE osInterface,
794 MOS_GPU_CONTEXT contextName,
795 GPU_CONTEXT_HANDLE contextHandle);
796
797 MOS_STATUS (*pfnSetGpuContextHandle) (
798 PMOS_INTERFACE pOsInterface,
799 GPU_CONTEXT_HANDLE gpuContextHandle,
800 MOS_GPU_CONTEXT GpuContext);
801
802 #if (_RELEASE_INTERNAL || _DEBUG)
803 #if defined(CM_DIRECT_GUC_SUPPORT)
804 MOS_STATUS(*pfnDestroyGuC) (
805 PMOS_INTERFACE pOsInterface);
806 MOS_STATUS(*pfnInitGuC) (
807 PMOS_INTERFACE pOsInterface,
808 MOS_GPU_NODE Engine);
809 MOS_STATUS(*pfnSubmitWorkQueue) (
810 PMOS_INTERFACE pOsInterface,
811 MOS_GPU_NODE Engine,
812 uint64_t BatchBufferAddress);
813 #endif
814 #endif
815
816 MOS_GPU_CONTEXT (* pfnGetGpuContext) (
817 PMOS_INTERFACE pOsInterface);
818
819 void* (*pfnGetGpuContextbyHandle)(
820 PMOS_INTERFACE pOsInterface,
821 const GPU_CONTEXT_HANDLE gpuContextHandle);
822
823 GMM_CLIENT_CONTEXT* (* pfnGetGmmClientContext) (
824 PMOS_INTERFACE pOsInterface);
825
826 MOS_STATUS (* pfnIsGpuContextValid) (
827 PMOS_INTERFACE pOsInterface,
828 MOS_GPU_CONTEXT GpuContext);
829
830 void (* pfnSetEncodeEncContext) (
831 PMOS_INTERFACE pOsInterface,
832 MOS_GPU_CONTEXT GpuContext);
833
834 void (* pfnSetEncodePakContext) (
835 PMOS_INTERFACE pOsInterface,
836 MOS_GPU_CONTEXT GpuContext);
837
838 void (* pfnSyncOnResource) (
839 PMOS_INTERFACE pOsInterface,
840 PMOS_RESOURCE pOsResource,
841 MOS_GPU_CONTEXT requestorGPUCtx,
842 int32_t bWriteOperation);
843
844 void (* pfnSyncOnOverlayResource) (
845 PMOS_INTERFACE pOsInterface,
846 PMOS_RESOURCE pOsResource,
847 MOS_GPU_CONTEXT requestorGPUCtx);
848
849 void (* pfnSetResourceSyncTag) (
850 PMOS_INTERFACE pOsInterface,
851 PMOS_SYNC_PARAMS pParams);
852
853 MOS_STATUS (* pfnPerformOverlaySync) (
854 PMOS_INTERFACE pOsInterface,
855 PMOS_SYNC_PARAMS pParams);
856
857 MOS_STATUS (* pfnResourceSignal) (
858 PMOS_INTERFACE pOsInterface,
859 PMOS_SYNC_PARAMS pParams);
860
861 MOS_STATUS (* pfnResourceWait) (
862 PMOS_INTERFACE pOsInterface,
863 PMOS_SYNC_PARAMS pParams);
864
865 MOS_STATUS (* pfnEngineSignal) (
866 PMOS_INTERFACE pOsInterface,
867 PMOS_SYNC_PARAMS pParams);
868
869 MOS_STATUS (* pfnEngineWait) (
870 PMOS_INTERFACE pOsInterface,
871 PMOS_SYNC_PARAMS pParams);
872
873 MOS_STATUS (* pfnWaitAllCmdCompletion) (
874 PMOS_INTERFACE pOsInterface);
875
876 MOS_STATUS (* pfnCreateSyncResource) (
877 PMOS_INTERFACE pOsInterface,
878 PMOS_RESOURCE pOsResource);
879
880 MOS_STATUS (* pfnDestroySyncResource) (
881 PMOS_INTERFACE pOsInterface,
882 PMOS_RESOURCE pOsResource);
883
884 void (* pfnSyncGpuContext) (
885 PMOS_INTERFACE pOsInterface,
886 MOS_GPU_CONTEXT busyGPUCtx,
887 MOS_GPU_CONTEXT requestorGPUCtx);
888
889 MOS_STATUS (* pfnRegisterBBCompleteNotifyEvent) (
890 PMOS_INTERFACE pOsInterface,
891 MOS_GPU_CONTEXT GpuContext);
892
893 MOS_STATUS (* pfnWaitForBBCompleteNotifyEvent) (
894 PMOS_INTERFACE pOsInterface,
895 MOS_GPU_CONTEXT GpuContext,
896 uint32_t uiTimeOut);
897
898 void (* pfnDestroy) (
899 PMOS_INTERFACE pOsInterface,
900 int32_t bDestroyVscVppDeviceTag);
901
902 void (* pfnGetPlatform) (
903 PMOS_INTERFACE pOsInterface,
904 PLATFORM *pPlatform);
905
906 MEDIA_FEATURE_TABLE *(* pfnGetSkuTable) (
907 PMOS_INTERFACE pOsInterface);
908
909 MEDIA_WA_TABLE *(* pfnGetWaTable) (
910 PMOS_INTERFACE pOsInterface);
911
912 MEDIA_SYSTEM_INFO *(* pfnGetGtSystemInfo)(
913 PMOS_INTERFACE pOsInterface);
914
915 MOS_STATUS (*pfnGetMediaEngineInfo)(
916 PMOS_INTERFACE pOsInterface, MEDIA_ENGINE_INFO &info);
917
918 void (* pfnResetOsStates) (
919 PMOS_INTERFACE pOsInterface);
920
921 MOS_STATUS(* pfnInitializeMultiThreadingSyncTags) (
922 PMOS_INTERFACE pOsInterface,
923 PMOS_RESOURCE pOsResource,
924 uint8_t ucRenderTargetIndex,
925 PMOS_SEMAPHORE *pCurFrmSem,
926 PMOS_SEMAPHORE *pRefFrmSem,
927 PMOS_MUTEX *pFrmMutex);
928
929 MOS_STATUS (* pfnMultiThreadingWaitCurrentFrame) (
930 PMOS_RESOURCE pOsResource);
931
932 MOS_STATUS (* pfnMultiThreadingPostCurrentFrame) (
933 PMOS_RESOURCE pOsResource);
934
935 MOS_STATUS (* pfnMultiThreadResourceSync) (
936 PMOS_INTERFACE pOsInterface,
937 PMOS_RESOURCE pOsResource);
938
939 MOS_STATUS(*pfnSetHybridDecoderRunningFlag) (
940 PMOS_INTERFACE pOsInterface,
941 int32_t bFlag);
942
943 MOS_STATUS(*pfnGetHybridDecoderRunningFlag) (
944 PMOS_INTERFACE pOsInterface,
945 int32_t *pFlag);
946
947 uint32_t (* pfnGetInterfaceVersion) (
948 PMOS_INTERFACE pOsInterface);
949
950 #if MOS_MESSAGES_ENABLED
951
952 #define pfnAllocateResource(pOsInterface, pParams, pOsResource) \
953 pfnAllocateResource(pOsInterface, pParams, __FUNCTION__, __FILE__, __LINE__, pOsResource)
954
955 MOS_STATUS (* pfnAllocateResource) (
956 PMOS_INTERFACE pOsInterface,
957 PMOS_ALLOC_GFXRES_PARAMS pParams,
958 const char *functionName,
959 const char *filename,
960 int32_t line,
961 PMOS_RESOURCE pOsResource);
962
963 MOS_STATUS (* pfnDumpCommandBuffer) (
964 PMOS_INTERFACE pOsInterface,
965 PMOS_COMMAND_BUFFER pCmdBuffer);
966
967 void (* pfnAddIndirectState) (
968 PMOS_INTERFACE pOsInterface,
969 uint32_t indirectStateSize,
970 uint32_t *pIndirectState,
971 uint32_t *gfxAddressBottom,
972 uint32_t *gfxAddressTop,
973 const char *stateName);
974
975 void (*pfnAddIndirectStateByAddressValue)(
976 PMOS_INTERFACE pOsInterface,
977 uint32_t indirectStateSize,
978 uint32_t *pIndirectState,
979 uint32_t gfxAddressBottom,
980 uint32_t gfxAddressTop,
981 const char *stateName);
982
983 #define pfnFreeResource(pOsInterface, pResource) \
984 pfnFreeResource(pOsInterface, __FUNCTION__, __FILE__, __LINE__, pResource)
985
986 void (* pfnFreeResource) (
987 PMOS_INTERFACE pOsInterface,
988 const char *functionName,
989 const char *filename,
990 int32_t line,
991 PMOS_RESOURCE pResource);
992
993 #define pfnFreeResourceWithFlag(pOsInterface, pResource, uiFlag) \
994 pfnFreeResourceWithFlag(pOsInterface, pResource, __FUNCTION__, __FILE__, __LINE__, uiFlag)
995
996 void (* pfnFreeResourceWithFlag) (
997 PMOS_INTERFACE pOsInterface,
998 PMOS_RESOURCE pResource,
999 const char *functionName,
1000 const char *filename,
1001 int32_t line,
1002 uint32_t uiFlag);
1003
1004 #else
1005
1006 MOS_STATUS (* pfnAllocateResource) (
1007 PMOS_INTERFACE pOsInterface,
1008 PMOS_ALLOC_GFXRES_PARAMS pParams,
1009 PMOS_RESOURCE pOsResource);
1010
1011 void (* pfnFreeResource) (
1012 PMOS_INTERFACE pOsInterface,
1013 PMOS_RESOURCE pResource);
1014
1015 void (* pfnFreeResourceWithFlag) (
1016 PMOS_INTERFACE pOsInterface,
1017 PMOS_RESOURCE pResource,
1018 uint32_t uiFlag);
1019
1020 #endif // MOS_MESSAGES_ENABLED
1021
1022 MOS_STATUS (* pfnGetResourceInfo) (
1023 PMOS_INTERFACE pOsInterface,
1024 PMOS_RESOURCE pOsResource,
1025 PMOS_SURFACE pDetails);
1026
1027 MOS_STATUS (* pfnLockSyncRequest) (
1028 PMOS_INTERFACE pOsInterface,
1029 PMOS_RESOURCE pResource,
1030 PMOS_LOCK_PARAMS pFlags);
1031
1032 void *(* pfnLockResource) (
1033 PMOS_INTERFACE pOsInterface,
1034 PMOS_RESOURCE pResource,
1035 PMOS_LOCK_PARAMS pFlags);
1036
1037 MOS_STATUS (* pfnUnlockResource) (
1038 PMOS_INTERFACE pOsInterface,
1039 PMOS_RESOURCE pResource);
1040
1041 MOS_STATUS (* pfnDecompResource) (
1042 PMOS_INTERFACE pOsInterface,
1043 PMOS_RESOURCE pResource);
1044
1045 MOS_STATUS (* pfnSetDecompSyncRes) (
1046 PMOS_INTERFACE pOsInterface,
1047 PMOS_RESOURCE syncResource);
1048
1049 MOS_STATUS(*pfnDoubleBufferCopyResource) (
1050 PMOS_INTERFACE pOsInterface,
1051 PMOS_RESOURCE pInputOsResource,
1052 PMOS_RESOURCE pOutputOsResource,
1053 bool bOutputCompressed);
1054
1055 MOS_STATUS(*pfnMediaCopyResource2D) (
1056 PMOS_INTERFACE pOsInterface,
1057 PMOS_RESOURCE pInputOsResource,
1058 PMOS_RESOURCE pOutputOsResource,
1059 uint32_t copyPitch,
1060 uint32_t copyHeight,
1061 uint32_t bpp,
1062 bool bOutputCompressed);
1063
1064 MOS_STATUS (*pfnMonoSurfaceCopy) (
1065 PMOS_INTERFACE pOsInterface,
1066 PMOS_RESOURCE pInputOsResource,
1067 PMOS_RESOURCE pOutputOsResource,
1068 uint32_t copyPitch,
1069 uint32_t copyHeight,
1070 uint32_t copyInputOffset,
1071 uint32_t copyOutputOffset,
1072 bool bOutputCompressed);
1073
1074 MOS_STATUS (*pfnVerifyMosSurface) (
1075 PMOS_SURFACE mosSurface,
1076 bool &bIsValid);
1077
1078 MOS_STATUS(*pfnGetMosContext) (
1079 PMOS_INTERFACE pOsInterface,
1080 PMOS_CONTEXT* mosContext);
1081
1082 MOS_STATUS (* pfnFillResource) (
1083 PMOS_INTERFACE pOsInterface,
1084 PMOS_RESOURCE pResource,
1085 uint32_t dwSize,
1086 uint8_t iValue);
1087
1088 MOS_STATUS (*pfnUpdateResourceUsageType) (
1089 PMOS_RESOURCE pOsResource,
1090 MOS_HW_RESOURCE_DEF resUsageType);
1091
1092 MOS_STATUS (* pfnRegisterResource) (
1093 PMOS_INTERFACE pOsInterface,
1094 PMOS_RESOURCE pResource,
1095 int32_t bWrite,
1096 int32_t bWritebSetResourceSyncTag);
1097
1098 void (* pfnResetResourceAllocationIndex) (
1099 PMOS_INTERFACE pOsInterface,
1100 PMOS_RESOURCE pResource);
1101
1102 int32_t (* pfnGetResourceAllocationIndex) (
1103 PMOS_INTERFACE pOsInterface,
1104 PMOS_RESOURCE pResource);
1105
1106 uint64_t (* pfnGetResourceGfxAddress) (
1107 PMOS_INTERFACE pOsInterface,
1108 PMOS_RESOURCE pResource);
1109
1110 uint64_t (*pfnGetResourceClearAddress)(
1111 PMOS_INTERFACE pOsInterface,
1112 PMOS_RESOURCE pResource);
1113
1114 MOS_STATUS (* pfnSetPatchEntry) (
1115 PMOS_INTERFACE pOsInterface,
1116 PMOS_PATCH_ENTRY_PARAMS pParams);
1117
1118 #if MOS_MEDIASOLO_SUPPORTED
1119 MOS_STATUS (* pfnInitializeMediaSolo) (
1120 PMOS_INTERFACE pOsInterface);
1121 #endif // MOS_MEDIASOLO_SUPPORTED
1122
1123 uint32_t (* pfnGetGpuStatusTag) (
1124 PMOS_INTERFACE pOsInterface,
1125 MOS_GPU_CONTEXT GpuContext);
1126
1127 void (* pfnIncrementGpuStatusTag) (
1128 PMOS_INTERFACE pOsInterface,
1129 MOS_GPU_CONTEXT GpuContext);
1130
1131 uint32_t (* pfnGetGpuStatusTagOffset) (
1132 PMOS_INTERFACE pOsInterface,
1133 MOS_GPU_CONTEXT GpuContext);
1134
1135 uint32_t (* pfnGetGpuStatusSyncTag) (
1136 PMOS_INTERFACE pOsInterface,
1137 MOS_GPU_CONTEXT GpuContext);
1138
1139 MOS_STATUS (* pfnVerifyCommandBufferSize) (
1140 PMOS_INTERFACE pOsInterface,
1141 uint32_t dwRequestedSize,
1142 uint32_t dwFlags);
1143
1144 MOS_STATUS (* pfnResizeCommandBufferAndPatchList) (
1145 PMOS_INTERFACE pOsInterface,
1146 uint32_t dwRequestedCommandBufferSize,
1147 uint32_t dwRequestedPatchListSize,
1148 uint32_t dwFlags);
1149
1150 MOS_STATUS (* pfnGetCommandBuffer) (
1151 PMOS_INTERFACE pOsInterface,
1152 PMOS_COMMAND_BUFFER pCmdBuffer,
1153 uint32_t dwFlags);
1154
1155 MOS_STATUS (* pfnSetIndirectStateSize) (
1156 PMOS_INTERFACE pOsInterface,
1157 uint32_t uSize);
1158
1159 MOS_STATUS (* pfnGetIndirectState) (
1160 PMOS_INTERFACE pOsInterface,
1161 uint32_t *puOffset,
1162 uint32_t *puSize);
1163
1164 MOS_STATUS (* pfnGetIndirectStatePointer) (
1165 PMOS_INTERFACE pOsInterface,
1166 uint8_t **pIndirectState);
1167
1168 void (* pfnReturnCommandBuffer) (
1169 PMOS_INTERFACE pOsInterface,
1170 PMOS_COMMAND_BUFFER pCmdBuffer,
1171 uint32_t dwFlags);
1172
1173 MOS_STATUS (* pfnSubmitCommandBuffer) (
1174 PMOS_INTERFACE pOsInterface,
1175 PMOS_COMMAND_BUFFER pCmdBuffer,
1176 int32_t bNullRendering);
1177
1178 MOS_STATUS (* pfnWaitAndReleaseCmdBuffer) (
1179 PMOS_INTERFACE pOsInterface,
1180 PMOS_COMMAND_BUFFER pCmdBuffer);
1181
1182 void (* pfnSetPerfTag) (
1183 PMOS_INTERFACE pOsInterface,
1184 uint32_t PerfTag);
1185
1186 uint32_t(* pfnGetPerfTag) (
1187 PMOS_INTERFACE pOsInterface);
1188
1189 void (* pfnResetPerfBufferID) (
1190 PMOS_INTERFACE pOsInterface);
1191
1192 void (* pfnIncPerfFrameID) (
1193 PMOS_INTERFACE pOsInterface);
1194
1195 void (* pfnIncPerfBufferID) (
1196 PMOS_INTERFACE pOsInterface);
1197
1198 void (* pfnSetPerfHybridKernelID) (
1199 PMOS_INTERFACE pOsInterface,
1200 uint32_t KernelID);
1201
1202 int32_t (* pfnIsPerfTagSet) (
1203 PMOS_INTERFACE pOsInterface);
1204
1205 MOS_STATUS (* pfnGetBitsPerPixel) (
1206 PMOS_INTERFACE pOsInterface,
1207 MOS_FORMAT Format,
1208 uint32_t *piBpp);
1209
1210 MOS_STATUS (*pfnLoadLibrary) (
1211 PMOS_INTERFACE pOsInterface,
1212 const char *pFileName,
1213 PHMODULE phModule);
1214
1215 MOS_STATUS (*pfnFreeLibrary) (
1216 HINSTANCE hInstance);
1217
1218 MOS_NULL_RENDERING_FLAGS (* pfnGetNullHWRenderFlags) (
1219 PMOS_INTERFACE pOsInterface);
1220
1221 MOS_STATUS (* pfnSetCmdBufferDebugInfo) (
1222 PMOS_INTERFACE pOsInterface,
1223 int32_t bSamplerState,
1224 int32_t bSurfaceState,
1225 uint32_t dwStateIndex,
1226 uint32_t dwType);
1227
1228 uint32_t (* pfnGetCmdBufferDebugInfo) (
1229 PMOS_INTERFACE pOsInterface,
1230 int32_t bSamplerState,
1231 int32_t bSurfaceState,
1232 uint32_t dwStateIndex);
1233
1234 MOS_STATUS (*pfnGetGpuStatusBufferResource) (
1235 PMOS_INTERFACE pOsInterface,
1236 PMOS_RESOURCE &pOsResource);
1237
1238 MOS_STATUS (* pfnVerifyPatchListSize) (
1239 PMOS_INTERFACE pOsInterface,
1240 uint32_t dwRequestedSize);
1241
1242 MOS_STATUS (* pfnResetCommandBuffer) (
1243 PMOS_INTERFACE pOsInterface,
1244 PMOS_COMMAND_BUFFER pCmdBuffer);
1245
1246 MOS_STATUS (* pfnGetMemoryCompressionMode) (
1247 PMOS_INTERFACE pOsInterface,
1248 PMOS_RESOURCE pOsResource,
1249 PMOS_MEMCOMP_STATE pResMmcMode);
1250
1251 MOS_STATUS (* pfnSetMemoryCompressionMode) (
1252 PMOS_INTERFACE pOsInterface,
1253 PMOS_RESOURCE pOsResource,
1254 MOS_MEMCOMP_STATE ResMmcMode);
1255
1256 MOS_STATUS (* pfnSetMemoryCompressionHint) (
1257 PMOS_INTERFACE pOsInterface,
1258 PMOS_RESOURCE pOsResource,
1259 int32_t bHintOn);
1260
1261 MOS_STATUS (* pfnGetMemoryCompressionFormat) (
1262 PMOS_INTERFACE pOsInterface,
1263 PMOS_RESOURCE pOsResource,
1264 uint32_t *pResMmcFormat);
1265
1266 MOS_STATUS (* pfnCreateVideoNodeAssociation)(
1267 PMOS_INTERFACE pOsInterface,
1268 int32_t bSetVideoNode,
1269 MOS_GPU_NODE *pVideoNodeOrdinal);
1270
1271 MOS_VDBOX_NODE_IND (* pfnGetVdboxNodeId)(
1272 PMOS_INTERFACE pOsInterface,
1273 PMOS_COMMAND_BUFFER pCmdBuffer);
1274
1275 MOS_STATUS (* pfnDestroyVideoNodeAssociation)(
1276 PMOS_INTERFACE pOsInterface,
1277 MOS_GPU_NODE VideoNodeOrdinal);
1278
1279 MOS_STATUS(*pfnSkipResourceSync)(
1280 PMOS_RESOURCE pOsResource);
1281
1282 MOS_STATUS(*pfnSetObjectCapture)(
1283 PMOS_RESOURCE pOsResource);
1284
1285 bool(*pfnIsValidStreamID)(
1286 PMOS_RESOURCE pOsResource);
1287
1288 void(*pfnInvalidateStreamID)(
1289 PMOS_RESOURCE pOsResource);
1290
1291 MOS_STATUS(*pfnSetStreamID)(
1292 PMOS_RESOURCE pOsResource,
1293 PMOS_INTERFACE pOsInterface,
1294 uint8_t streamID);
1295
1296 uint8_t(*pfnGetStreamID)(
1297 PMOS_RESOURCE pOsResource);
1298
1299 int32_t (*pfnIsGPUHung)(
1300 PMOS_INTERFACE pOsInterface);
1301
1302 bool (*pfnIsMultipleCodecDevicesInUse)(
1303 PMOS_INTERFACE pOsInterface);
1304
1305 MOS_STATUS (*pfnSetMultiEngineEnabled)(
1306 PMOS_INTERFACE pOsInterface,
1307 MOS_COMPONENT component,
1308 bool enabled);
1309
1310 MOS_STATUS (*pfnGetMultiEngineStatus)(
1311 PMOS_INTERFACE pOsInterface,
1312 PLATFORM *platform,
1313 MOS_COMPONENT component,
1314 bool &isMultiDevices,
1315 bool &isMultiEngine);
1316
1317 MOS_GPU_NODE(*pfnGetLatestVirtualNode)(
1318 PMOS_INTERFACE pOsInterface,
1319 MOS_COMPONENT component);
1320
1321 void (*pfnSetLatestVirtualNode)(
1322 PMOS_INTERFACE pOsInterface,
1323 MOS_GPU_NODE node);
1324
1325 MOS_GPU_NODE (*pfnGetDecoderVirtualNodePerStream)(
1326 PMOS_INTERFACE pOsInterface);
1327
1328 void (*pfnSetDecoderVirtualNodePerStream)(
1329 PMOS_INTERFACE pOsInterface,
1330 MOS_GPU_NODE node);
1331
1332 HANDLE (*pfnGetUmdDmaCompleteEventHandle)(
1333 PMOS_INTERFACE osInterface,
1334 MOS_GPU_CONTEXT gpuContext);
1335
1336 //!
1337 //! \brief Get Aux Table base address
1338 //!
1339 //! \param [in] pOsInterface
1340 //! MOS_INTERFACE pointer
1341 //! \return uint64_t
1342 //! return Aux Table base address
1343 //!
1344 uint64_t(*pfnGetAuxTableBaseAddr)(
1345 PMOS_INTERFACE pOsInterface);
1346
1347 //!
1348 //! \brief Get Gpu Priority
1349 //! \param [in] pOsInterface
1350 //! pointer to the current gpu context.
1351 //! \param [out] pPriority
1352 //! pointer to the priority get from gpu context.
1353 //!
1354 void (*pfnGetGpuPriority)(
1355 PMOS_INTERFACE pOsInterface,
1356 int32_t *pPriority);
1357
1358 //!
1359 //! \brief Set Gpu Priority
1360 //!
1361 //! \param [in] pOsInterface
1362 //! pointer to the current gpu context
1363 //! \param [in] priority
1364 //! pointer to the priority set to gpu context
1365 //!
1366 void (*pfnSetGpuPriority)(
1367 PMOS_INTERFACE pOsInterface,
1368 int32_t priority);
1369
1370 //!
1371 //! \brief Set slice count to shared memory and KMD
1372 //! \param [in] pOsInterface
1373 //! pointer to the requested slice count for current context
1374 //! \param [out] pSliceCount
1375 //! pointer to the ruling slice count shared by all contexts
1376 void (*pfnSetSliceCount)(
1377 PMOS_INTERFACE pOsInterface,
1378 uint32_t *pSliceCount);
1379
1380 //!
1381 //! \brief Get resource index
1382 //! \param [in] osResource
1383 //! pointer to the resource
1384 //! \return uint32_t
1385 //! return resource index
1386 uint32_t(*pfnGetResourceIndex)(
1387 PMOS_RESOURCE osResource);
1388
1389 //!
1390 //! \brief Get SetMarker enabled flag
1391 //! \details Get SetMarker enabled flag from OsInterface
1392 //! \param PMOS_INTERFACE pOsInterface
1393 //! [in] OS Interface
1394 //! \return bool
1395 //! SetMarker enabled flag
1396 //!
1397 bool (*pfnIsSetMarkerEnabled)(
1398 PMOS_INTERFACE pOsInterface);
1399
1400 //!
1401 //! \brief Get SetMarker resource address
1402 //! \details Get SetMarker resource address from OsInterface
1403 //! \param PMOS_INTERFACE pOsInterface
1404 //! [in] OS Interface
1405 //! \return PMOS_RESOURCE
1406 //! SetMarker resource address
1407 //!
1408 PMOS_RESOURCE (*pfnGetMarkerResource)(
1409 PMOS_INTERFACE pOsInterface);
1410
1411 //!
1412 //! \brief Is Device Async or not
1413 //! \details Is Device Async or not.
1414 //! \param [in] streamState
1415 //! Handle of Os Stream State.
1416 //! \return bool
1417 //! Return true if is async, otherwise false
1418 //!
1419 bool (*pfnIsAsyncDevice)(
1420 MOS_STREAM_HANDLE streamState);
1421
1422 //!
1423 //! \brief Mos format to os format
1424 //! \details Mos format to os format
1425 //! \param [in] format
1426 //! Mos format.
1427 //! \return uint32_t
1428 //! Return OS FORMAT
1429 //!
1430 uint32_t (*pfnMosFmtToOsFmt)(
1431 MOS_FORMAT format);
1432
1433 //!
1434 //! \brief Os format to Mos format
1435 //! \details Os format to Mos format
1436 //! \param [in] format
1437 //! Os format.
1438 //! \return MOS_FORMAT
1439 //! Return MOS FORMAT
1440 //!
1441 MOS_FORMAT (*pfnOsFmtToMosFmt)(
1442 uint32_t format);
1443
1444 //!
1445 //! \brief Mos format to GMM format
1446 //! \details Mos format to GMM format
1447 //! \param [in] format
1448 //! Mos format.
1449 //! \return GMM_RESOURCE_FORMAT
1450 //! Return GMM FORMAT
1451 //!
1452 GMM_RESOURCE_FORMAT (*pfnMosFmtToGmmFmt)(
1453 MOS_FORMAT format);
1454
1455 //!
1456 //! \brief GMM format to mos format
1457 //! \details GMM format to mos format
1458 //! \param [in] format
1459 //! GMM_RESOURCE_FORMAT.
1460 //! \return MOS_FORMAT
1461 //! Return MOS FORMAT
1462 //!
1463 MOS_FORMAT (*pfnGmmFmtToMosFmt)(
1464 GMM_RESOURCE_FORMAT format);
1465
1466 //!
1467 //! \brief Wait For cmd Completion
1468 //! \details [GPU Context Interface] Waiting for the completion of cmd in provided GPU context
1469 //! \details Caller: HAL only
1470 //! \param [in] streamState
1471 //! Handle of Os Stream State
1472 //! \param [in] gpuCtx
1473 //! GpuContext handle of the gpu context to wait cmd completion
1474 //! \return MOS_STATUS
1475 //! Return MOS_STATUS_SUCCESS if successful, otherwise failed
1476 //!
1477 MOS_STATUS (*pfnWaitForCmdCompletion)(
1478 MOS_STREAM_HANDLE streamState,
1479 GPU_CONTEXT_HANDLE gpuCtx);
1480
1481 //!
1482 //! \brief Get Resource array index
1483 //! \details Returns the array index
1484 //! \param PMOS_RESOURCE
1485 //! [in] Pointer to MOS_RESOURCE
1486 //! \return uint32_t - array index
1487 //!
1488 uint32_t (*pfnGetResourceArrayIndex)(
1489 PMOS_RESOURCE resource);
1490
1491 //!
1492 //! \brief Setup VE Attribute Buffer
1493 //! \details [Cmd Buffer Interface] Setup VE Attribute Buffer into cmd buffer.
1494 //! \details Caller: MHW only
1495 //! \details This interface is called to setup into cmd buffer.
1496 //! \param [in] streamState
1497 //! Handle of Os Stream State
1498 //! \param [out] cmdBuffer
1499 //! Cmd buffer to setup VE attribute.
1500 //! \return MOS_STATUS
1501 //! Return MOS_STATUS_SUCCESS if successful, otherwise failed
1502 //!
1503 MOS_STATUS (*pfnSetupAttributeVeBuffer)(
1504 MOS_STREAM_HANDLE streamState,
1505 COMMAND_BUFFER_HANDLE cmdBuffer);
1506
1507 //!
1508 //! \brief Get VE Attribute Buffer
1509 //! \details [Cmd Buffer Interface] Get VE Attribute Buffer from cmd buffer.
1510 //! \details Caller: HAL only
1511 //! \details This interface is called to get VE attribute buffer from cmd buffer if it contains one.
1512 //! If there is no VE attribute buffer returned, it means the cmd buffer has no such buffer
1513 //! in current MOS module. It is not error state if it is nullptr.
1514 //! \param [out] cmdBuffer
1515 //! Cmd buffer to setup VE attribute.
1516 //! \return MOS_CMD_BUF_ATTRI_VE*
1517 //! Return pointer of VE attribute buffer, nullptr if current cmdBuffer didn't contain attribute.
1518 //!
1519 MOS_CMD_BUF_ATTRI_VE* (*pfnGetAttributeVeBuffer)(
1520 COMMAND_BUFFER_HANDLE cmdBuffer);
1521
1522 //!
1523 //! \brief Setup commandlist and command pool from os interface
1524 //! \details Set the commandlist and commandPool used in this stream from os interface.
1525 //! \param [in] osInterface
1526 //! pointer to the mos interface
1527 //! \param [out] streamState
1528 //! Handle of Os Stream State.
1529 //! \return MOS_STATUS
1530 //! Return MOS_STATUS_SUCCESS if successful, otherwise failed
1531 //!
1532 MOS_STATUS (*pfnSetupCurrentCmdListAndPool)(
1533 PMOS_INTERFACE osInterface,
1534 MOS_STREAM_HANDLE streamState);
1535
1536 //!
1537 //! \brief Get MOS_HW_RESOURCE_DEF
1538 //! \details [Resource Interface] Get Mos HW Resource DEF
1539 //! Caller: HAL & MHW
1540 //! \param [in] gmmResUsage
1541 //! Gmm Resource usage as index
1542 //! \return MOS_HW_RESOURCE_DEF
1543 //! Mos HW resource definition
1544 //!
1545 MOS_HW_RESOURCE_DEF (*pfnGmmToMosResourceUsageType)(
1546 GMM_RESOURCE_USAGE_TYPE gmmResUsage);
1547
1548 //!
1549 //! \brief Get Adapter Info
1550 //! \details [System info Interface] Get Adapter Info
1551 //! \details Caller: DDI & HAL
1552 //! \details This func is called to differentiate the behavior according to Adapter Info.
1553 //! \param [in] streamState
1554 //! Handle of Os Stream State
1555 //! \return ADAPTER_INFO*
1556 //! Read-only Adapter Info got, nullptr if failed to get
1557 //!
1558 ADAPTER_INFO* (*pfnGetAdapterInfo)(
1559 MOS_STREAM_HANDLE streamState);
1560
1561 //!
1562 //! \brief Surface compression is supported
1563 //! \details Surface compression is supported
1564 //! \param [in] skuTable
1565 //! Pointer to MEDIA_FEATURE_TABLE
1566 //! \return bool
1567 //! If true, compression is enabled
1568 //!
1569 bool (*pfnIsCompressibelSurfaceSupported)(
1570 MEDIA_FEATURE_TABLE *skuTable);
1571
1572 //!
1573 //! \brief Destroy Virtual Engine State
1574 //! \details [Virtual Engine Interface] Destroy Virtual Engine State of provided streamState
1575 //! \details Caller: Hal (Scalability) only
1576 //! \details This func is called when a stream (Hal instance) need to destroy a VE state
1577 //! \details into provided stream.
1578 //! \param [in] streamState
1579 //! Handle of Os Stream State
1580 //! \return MOS_STATUS
1581 //! Return MOS_STATUS_SUCCESS if successful, otherwise failed
1582 //!
1583 MOS_STATUS (*pfnDestroyVirtualEngineState)(
1584 MOS_STREAM_HANDLE streamState);
1585
1586 //!
1587 //! \brief Get resource handle
1588 //! \details Get resource handle
1589 //! \param [in] streamState
1590 //! Handle of Os Stream State
1591 //! \param [in] osResource
1592 //! Pointer to mos resource
1593 //! \return uint64_t
1594 //! Return resource handle
1595 //!
1596 uint64_t (*pfnGetResourceHandle)(
1597 MOS_STREAM_HANDLE streamState,
1598 PMOS_RESOURCE osResource);
1599
1600 //!
1601 //! \brief Get RT log resource info
1602 //! \details Get RT log resource info
1603 //! \param [in] streamState
1604 //! Handle of Os Stream State
1605 //! \param [in,out] osResource
1606 //! Reference to pointer of mos resource
1607 //! \param [in,out] size
1608 //! Reference to size
1609 //! \return void
1610 //!
1611 void (*pfnGetRtLogResourceInfo)(
1612 PMOS_INTERFACE osInterface,
1613 PMOS_RESOURCE &osResource,
1614 uint32_t &size);
1615
1616 //!
1617 //! \brief OS reset resource
1618 //! \details Resets the OS resource
1619 //! \param PMOS_RESOURCE resource
1620 //! [in] Pointer to OS Resource
1621 //! \return void
1622 //! Return NONE
1623 //!
1624 void (*pfnResetResource)(
1625 PMOS_RESOURCE resource);
1626
1627 //!
1628 //! \brief Set Hybrid Cmd To GpuContext
1629 //! \details Set Hybrid Cmd To GpuContext
1630 //! \param PMOS_INTERFACE pOsInterface
1631 //! [in] ptr to pOsInterface
1632 //! \param uint64_t gpuCtxOnHybridCmd
1633 //! gpuCtxOnHybridCmd
1634 //! \return MOS_STATUS
1635 //! Return MOS_STATUS
1636 //!
1637 MOS_STATUS (*pfnSetHybridCmdMgrToGpuContext)(
1638 PMOS_INTERFACE pOsInterface,
1639 uint64_t gpuCtxOnHybridCmd);
1640
1641 //!
1642 //! \brief Set Hybrid Cmd Submit Mode
1643 //! \details Set Hybrid Cmd Submit Mode
1644 //! \param PMOS_INTERFACE pOsInterface
1645 //! [in] ptr to pOsInterface
1646 //! \param uint64_t hybridMgrSubmitMode
1647 //! hybridMgrSubmitMode
1648 //! \return MOS_STATUS
1649 //! Return MOS_STATUS
1650 //!
1651 MOS_STATUS (*pfnSetHybridMgrSubmitMode)(
1652 PMOS_INTERFACE pOsInterface,
1653 uint64_t hybridMgrSubmitMode);
1654
1655 //!
1656 //! \brief Start the Cmd Consumer
1657 //! \details Start the Cmd Consumer
1658 //! \param PMOS_INTERFACE pOsInterface
1659 //! [in] ptr to pOsInterface
1660 //! \return MOS_STATUS
1661 //! Return MOS_STATUS
1662 //!
1663 MOS_STATUS (*pfnStartHybridCmdMgr)(
1664 PMOS_INTERFACE pOsInterface);
1665
1666 //!
1667 //! \brief Stop the Cmd Consumer
1668 //! \details Stop the Cmd Consumer
1669 //! \param PMOS_INTERFACE pOsInterface
1670 //! [in] ptr to pOsInterface
1671 //! \return MOS_STATUS
1672 //! Return MOS_STATUS
1673 //!
1674 MOS_STATUS (*pfnStopHybridCmdMgr)(
1675 PMOS_INTERFACE pOsInterface);
1676
1677 //!
1678 //! \brief Submit Cmd Package to Cmd Consumer
1679 //! \details Submit Cmd Package to Cmd Consumer
1680 //! \param PMOS_INTERFACE pOsInterface
1681 //! [in] ptr to pOsInterface
1682 //! \param CmdPackage& cmdPackage
1683 //! [in] reference to cmdPackage
1684 //! \return MOS_STATUS
1685 //! Return MOS_STATUS
1686 //!
1687 MOS_STATUS (*pfnSubmitPackage)(
1688 PMOS_INTERFACE pOsInterface,
1689 CmdPackage &cmdPackage);
1690
1691 #if (_DEBUG || _RELEASE_INTERNAL)
1692 //!
1693 //! \brief Get engine count
1694 //! \details [Virtual Engine Interface] Get engine count from Virtual Engine State in provided stream
1695 //! \details Caller: Hal (Scalability) only
1696 //! \details Get engine count from virtual engine state
1697 //! \param [in] streamState
1698 //! Handle of Os Stream State
1699 //! \return uint8_t
1700 //! Engine count
1701 //!
1702 uint8_t (*pfnGetVeEngineCount)(
1703 MOS_STREAM_HANDLE streamState);
1704
1705 //!
1706 //! \brief Get Engine Logic Id
1707 //! \details [Virtual Engine Interface] Get engine Logic Id from Virtual Engine State in provided stream
1708 //! \details Caller: Hal (Scalability) only
1709 //! \details Get engine Logic Id from virtual engine state
1710 //! \param [in] streamState
1711 //! Handle of Os Stream State
1712 //! \param [in] instanceIdx
1713 //! Engine instance index
1714 //! \return uint8_t
1715 //!
1716 uint8_t (*pfnGetEngineLogicIdByIdx)(
1717 MOS_STREAM_HANDLE streamState,
1718 uint32_t instanceIdx);
1719
1720 //!
1721 //! \brief Set Gpu Virtual Address for Debug
1722 //! \details Manually make page fault
1723 //!
1724 //! \param [in] pResource
1725 //! Resource to set Gpu Address
1726 //! \param [in] address
1727 //! Address to set
1728 //! \return MOS_STATUS
1729 //!
1730 MOS_STATUS (*pfnSetGpuVirtualAddress)(
1731 PMOS_RESOURCE pResource,
1732 uint64_t address);
1733 #endif
1734
1735 #if MOS_MEDIASOLO_SUPPORTED
1736 //!
1737 //! \brief Solo set ready to execute
1738 //! \details Solo set ready to execute
1739 //! \param [in] osInterface
1740 //! Pointer to OsInterface
1741 //! \param [in] readyToExecute
1742 //! ready to execute
1743 //! \return void
1744 //!
1745 void (*pfnMosSoloSetReadyToExecute)(
1746 PMOS_INTERFACE osInterface,
1747 bool readyToExecute);
1748
1749 //!
1750 //! \brief Solo Check node limitation
1751 //! \details Solo Check node limitation
1752 //! \param [in] osInterface
1753 //! Pointer to OsInterface
1754 //! \param [out] pGpuNodeToUse
1755 //! Pointer to the GPU node to use
1756 //! \return void
1757 //!
1758 void (*pfnMosSoloCheckNodeLimitation)(
1759 PMOS_INTERFACE osInterface,
1760 uint32_t *pGpuNodeToUse);
1761
1762 //!
1763 //! \brief Set MSDK event handling
1764 //! \details Receive MSDK event to be set in mediasolo
1765 //! \param [in] osInterface
1766 //! Pointer to OsInterface
1767 //! \param [out] gpuAppTaskEvent
1768 //! Event handle
1769 //! \return MOS_STATUS
1770 //! Return MOS_STATUS_SUCCESS if successful, otherwise failed
1771 //!
1772 MOS_STATUS (*pfnMosSoloSetGpuAppTaskEvent)(
1773 PMOS_INTERFACE osInterface,
1774 HANDLE gpuAppTaskEvent);
1775
1776 //!
1777 //! \brief Solo force dump
1778 //! \details After dwBufferDumpFrameNum submissions are dumped. Force enable mediasolo debug out dump.
1779 //! If no solo interface exists, creates one.
1780 //! \param [in] dwBufferDumpFrameNum
1781 //! Frame Number of the buffer to dump
1782 //! \param [in, out] osInterface
1783 //! Pointer to OsInterface
1784 //! \return void
1785 //!
1786 MOS_STATUS (*pfnMosSoloForceDumps)(
1787 uint32_t dwBufferDumpFrameNum,
1788 PMOS_INTERFACE osInterface);
1789
1790 //!
1791 //! \brief Solo Pre Process for Decode
1792 //! \details Do solo specific operations before decode.
1793 //! Include disable aubload optimization.
1794 //! And set dumped resource in Aubcapture.
1795 //! \param [in] osInterface
1796 //! Indicate if this is first execute call
1797 //! \param [in] psDestSurface
1798 //! Pointer to the surface to add to Aubcapture dump
1799 //! \return MOS_STATUS
1800 //! Return MOS_STATUS_SUCCESS if successful, otherwise failed
1801 //!
1802 MOS_STATUS (*pfnMosSoloPreProcessDecode)(
1803 PMOS_INTERFACE osInterface,
1804 PMOS_SURFACE psDestSurface);
1805
1806 //!
1807 //! \brief Solo Post Process for Decode
1808 //! \details Do solo specific operations after decode.
1809 //! Include remove dumped resource in Aubcapture.
1810 //! \param [in] osInterface
1811 //! Pointer to OsInterface
1812 //! \param [in] psDestSurface
1813 //! Pointer to the surface to remove from Aubcapture dump
1814 //! \return MOS_STATUS
1815 //! Return MOS_STATUS_SUCCESS if successful, otherwise failed
1816 //!
1817 MOS_STATUS (*pfnMosSoloPostProcessDecode)(
1818 PMOS_INTERFACE osInterface,
1819 PMOS_SURFACE psDestSurface);
1820
1821 //!
1822 //! \brief Solo Pre Process for Encode
1823 //! \details Do solo specific operations before encode.
1824 //! Include set dumped resource in Aubcapture.
1825 //! \param [in] osInterface
1826 //! Pointer to OsInterface
1827 //! \param [in] pBitstreamBuffer
1828 //! Pointer to the resource to add to Aubcapture dump
1829 //! \param [in] pReconSurface
1830 //! Pointer to the surface to add to Aubcapture dump
1831 //! \return MOS_STATUS
1832 //! Return MOS_STATUS_SUCCESS if successful, otherwise failed
1833 //!
1834 MOS_STATUS (*pfnMosSoloPreProcessEncode)(
1835 PMOS_INTERFACE osInterface,
1836 PMOS_RESOURCE pBitstreamBuffer,
1837 PMOS_SURFACE pReconSurface);
1838
1839 //!
1840 //! \brief Solo Post Process for Encode
1841 //! \details Do solo specific operations after encode.
1842 //! Include remove dumped resource in Aubcapture.
1843 //! \param [in] osInterface
1844 //! Pointer to OsInterface
1845 //! \param [in] pBitstreamBuffer
1846 //! Pointer to the resource to remove from Aubcapture dump
1847 //! \param [in] pReconSurface
1848 //! Pointer to the surface to remove from Aubcapture dump
1849 //! \return MOS_STATUS
1850 //! Return MOS_STATUS_SUCCESS if successful, otherwise failed
1851 //!
1852 MOS_STATUS (*pfnMosSoloPostProcessEncode)(
1853 PMOS_INTERFACE osInterface,
1854 PMOS_RESOURCE pBitstreamBuffer,
1855 PMOS_SURFACE pReconSurface);
1856
1857 //!
1858 //! \brief Solo Disable Aubcapture Optimizations
1859 //! \details Solo Disable Aubcapture Optimizations
1860 //! \param [in] osInterface
1861 //! Pointer to OsInterface pointer list
1862 //! \param [in] bFirstExecuteCall
1863 //! Indicate if this is first execute call
1864 //! \return MOS_STATUS
1865 //! Return MOS_STATUS_SUCCESS if successful, otherwise failed
1866 //!
1867 MOS_STATUS (*pfnMosSoloDisableAubcaptureOptimizations)(
1868 PMOS_INTERFACE osInterface,
1869 int32_t bFirstExecuteCall);
1870 #endif
1871 //!
1872 //! \brief Notify shared Stream index
1873 //!
1874 //! \param PMOS_INTERFACE pOsInterface
1875 //! [in] OS Interface
1876 //! \return void
1877 //!
1878 void (*pfnNotifyStreamIndexSharing)(
1879 PMOS_INTERFACE pOsInterface);
1880
1881 //!
1882 //! \brief Check if mismatch order programming model supported in current device
1883 //!
1884 //! \return bool
1885 //!
1886 bool (*pfnIsMismatchOrderProgrammingSupported)();
1887
1888 //! \brief Unified OS add command to command buffer
1889 //! \details Offset returned is dword aligned but size requested can be byte aligned
1890 //! \param PMOS_COMMAND_BUFFER pCmdBuffer
1891 //! [in/out] Pointer to Command Buffer
1892 //! \param void *pCmd
1893 //! [in] Command Pointer
1894 //! \param uint32_t dwCmdSize
1895 //! [in] Size of command in bytes
1896 //! \return MOS_STATUS
1897 //! Return MOS_STATUS_SUCCESS if successful, otherwise failed
1898 //!
1899 MOS_STATUS (*pfnAddCommand)(
1900 PMOS_COMMAND_BUFFER pCmdBuffer,
1901 const void *pCmd,
1902 uint32_t dwCmdSize);
1903
1904 //!
1905 //! \brief Check virtual engine is supported
1906 //! \details Check virtual engine is supported
1907 //! \param PMOS_INTERFACE pOsInterface
1908 //! [in] OS Interface
1909 //! \return MOS_STATUS
1910 //! MOS_STATUS_SUCCESS if succeeded, otherwise error code
1911 //!
1912 MOS_STATUS (*pfnVirtualEngineSupported)(
1913 PMOS_INTERFACE osInterface,
1914 bool isDecode,
1915 bool veDefaultEnable);
1916
1917 //!
1918 //! \brief Retrieve the CachePolicyMemoryObject for a resource
1919 //! \details Retrieve the CachePolicyMemoryObject for a resource
1920 //! \param PMOS_INTERFACE osInterface
1921 //! [in] OS Interface
1922 //! \param PMOS_RESOURCE resource
1923 //! [in] resource
1924 //! \return MEMORY_OBJECT_CONTROL_STATE
1925 //! return a value of MEMORY_OBJECT_CONTROL_STATE
1926 //!
1927 MEMORY_OBJECT_CONTROL_STATE (*pfnGetResourceCachePolicyMemoryObject)(
1928 PMOS_INTERFACE osInterface,
1929 PMOS_RESOURCE resource);
1930
1931 //!
1932 //! \brief Get Buffer Type
1933 //! \details Returns the type of buffer, 1D, 2D or volume
1934 //! \param PMOS_RESOURCE pOsResource
1935 //! [in] Pointer to OS Resource
1936 //! \return GFX resource Type
1937 //!
1938 MOS_GFXRES_TYPE (*pfnGetResType)(
1939 PMOS_RESOURCE pOsResource);
1940
1941 //!
1942 //! \brief Get TimeStamp frequency base
1943 //! \details Get TimeStamp frequency base from OsInterface
1944 //! \param PMOS_INTERFACE pOsInterface
1945 //! [in] OS Interface
1946 //! \return uint32_t
1947 //! time stamp frequency base
1948 //!
1949 uint32_t (*pfnGetTsFrequency)(
1950 PMOS_INTERFACE pOsInterface);
1951
1952 //!
1953 //! \brief Set hint parameters
1954 //! \details
1955 //! \param PMOS_INTERFACE pOsInterface
1956 //! [in] Pointer to OS interface structure
1957 //! \param MOS_VIRTUALENGINE_SET_PARAMS veParams
1958 //! [out] VIRTUALENGINE SET PARAMS
1959 //! \return MOS_STATUS
1960 //! MOS_STATUS_SUCCESS if succeeded, otherwise error code
1961 //!
1962 MOS_STATUS (*pfnSetHintParams)(
1963 PMOS_INTERFACE pOsInterface,
1964 PMOS_VIRTUALENGINE_SET_PARAMS veParams);
1965
1966 //!
1967 //! \brief Checks whether the requested resource is releasable
1968 //! \param PMOS_INTERFACE pOsInterface
1969 //! [in] OS Interface
1970 //! \param PMOS_RESOURCE pOsResource
1971 //! [in] Pointer to OS Resource
1972 //! \return MOS_STATUS
1973 //! MOS_STATUS_SUCCESS if requested can be released, otherwise MOS_STATUS_UNKNOWN
1974 //!
1975 MOS_STATUS (*pfnIsResourceReleasable)(
1976 PMOS_INTERFACE pOsInterface,
1977 PMOS_RESOURCE pOsResource);
1978
1979 //!
1980 //! \brief Virtual Engine Init for media Scalability
1981 //! \details
1982 //! \param PMOS_INTERFACE pOsInterface
1983 //! [in] Pointer to OS interface structure
1984 //! \param PMOS_VIRTUALENGINE_HINT_PARAMS veHitParams
1985 //! [out] Pointer to Virtual Engine hint parameters
1986 //! \param PMOS_VIRTUALENGINE_INTERFACE veInterface
1987 //! [out] Pointer to Virtual Engine Interface
1988 //! \return MOS_STATUS
1989 //! MOS_STATUS_SUCCESS if succeeded, otherwise error code
1990 //!
1991 MOS_STATUS (*pfnVirtualEngineInit)(
1992 PMOS_INTERFACE pOsInterface,
1993 PMOS_VIRTUALENGINE_HINT_PARAMS* veHitParams,
1994 MOS_VIRTUALENGINE_INIT_PARAMS& veInParams);
1995 //!
1996 //! \brief initialize virtual engine interface
1997 //! \details initialize virtual engine interface
1998 //! \param [in] PMOS_INTERFACE
1999 //! pointer to mos interface
2000 //! \param [in] PMOS_VIRTUALENGINE_INIT_PARAMS pVEInitParms
2001 //! pointer to VE init parameters
2002 //! \return MOS_STATUS
2003 //! MOS_STATUS_SUCCESS if success, else fail reason
2004 //!
2005 MOS_STATUS (*pfnVirtualEngineInterfaceInitialize)(
2006 PMOS_INTERFACE pOsInterface,
2007 PMOS_VIRTUALENGINE_INIT_PARAMS pVEInitParms);
2008
2009 //!
2010 //! \brief Destroy veInterface
2011 //! \details
2012 //! \param PMOS_VIRTUALENGINE_INTERFACE *veInterface
2013 //! [in] Pointer to PMOS_VIRTUALENGINE_INTERFACE
2014 //! \return MOS_STATUS
2015 //! MOS_STATUS_SUCCESS if succeeded, otherwise error code
2016 //!
2017 MOS_STATUS (*pfnDestroyVeInterface)(
2018 PMOS_VIRTUALENGINE_INTERFACE *veInterface);
2019
2020 //!
2021 //! \brief Creates a CmDevice from a MOS context.
2022 //! \details If an existing CmDevice has already associated to the MOS context,
2023 //! the existing CmDevice will be returned. Otherwise, a new CmDevice
2024 //! instance will be created and associatied with that MOS context.
2025 //! \param mosContext
2026 //! [in] pointer to MOS conetext.
2027 //! \param device
2028 //! [in,out] reference to the pointer to the CmDevice.
2029 //! \param devCreateOption
2030 //! [in] option to customize CmDevice.
2031 //! \return int32_t
2032 //! CM_SUCCESS if the CmDevice is successfully created.
2033 //! CM_NULL_POINTER if pMosContext is null.
2034 //! CM_FAILURE otherwise.
2035 //!
2036 int32_t (*pfnCreateCmDevice)(
2037 MOS_CONTEXT *mosContext,
2038 CMRT_UMD::CmDevice *&device,
2039 uint32_t devCreateOption,
2040 uint8_t priority);
2041
2042 //!
2043 //! \brief Destroys the CmDevice.
2044 //! \details This function also destroys surfaces, kernels, programs, samplers,
2045 //! threadspaces, tasks and the queues that were created using this
2046 //! device instance but haven't explicitly been destroyed by calling
2047 //! respective destroy functions.
2048 //! \param device
2049 //! [in] reference to the pointer to the CmDevice.
2050 //! \return int32_t
2051 //! CM_SUCCESS if CmDevice is successfully destroyed.
2052 //! CM_FAILURE otherwise.
2053 //!
2054 int32_t (*pfnDestroyCmDevice)(
2055 CMRT_UMD::CmDevice *&device);
2056
2057 //!
2058 //! \brief Initialize cm hal ddi interfaces
2059 //! \details Initialize cm hal ddi interfaces
2060 //! \param cmState
2061 //! [in,out] the pointer to the cm state.
2062 //! \return MOS_STATUS
2063 //! MOS_STATUS_SUCCESS if succeeded, otherwise error code
2064 //!
2065 MOS_STATUS (*pfnInitCmInterface)(
2066 PCM_HAL_STATE cmState);
2067
2068 //!
2069 //! \brief Create MhwCpInterface Object
2070 //! Must use Delete_MhwCpInterface to delete created Object to avoid ULT Memory Leak errors
2071 //!
2072 //! \return Return CP Wrapper Object if CPLIB not loaded
2073 //!
2074 MhwCpInterface* (*pfnCreateMhwCpInterface)(PMOS_INTERFACE osInterface);
2075
2076 //!
2077 //! \brief Delete the MhwCpInterface Object
2078 //!
2079 //! \param [in] *pMhwCpInterface
2080 //! MhwCpInterface
2081 //!
2082 void (*pfnDeleteMhwCpInterface)(MhwCpInterface *mhwCpInterface);
2083
2084 //!
2085 //! \brief Create CodechalSecureDeocde Object
2086 //! Must use Delete_CodechalSecureDecodeInterface to delete created Object to avoid ULT Memory Leak errors
2087 //!
2088 //! \return Return CP Wrapper Object
2089 //!
2090 CodechalSecureDecodeInterface* (*pfnCreateSecureDecodeInterface)(
2091 CodechalSetting *codechalSettings,
2092 CodechalHwInterface *hwInterfaceInput);
2093
2094 //!
2095 //! \brief Delete the CodecHalSecureDecode Object
2096 //!
2097 //! \param [in] *codechalSecureDecodeInterface
2098 //! CodechalSecureDecodeInterface
2099 //!
2100 void (*pfnDeleteSecureDecodeInterface)(CodechalSecureDecodeInterface *codechalSecureDecodeInterface);
2101
2102 #if (_DEBUG || _RELEASE_INTERNAL)
2103 //!
2104 //! \brief gpuCtxCreateOption Init for media Scalability
2105 //! \details
2106 //! \param PMOS_INTERFACE pOsInterface
2107 //! [in] Pointer to OS interface structure
2108 //! \param uint8_t id
2109 //! [out] EngineLogicId
2110 //! \return MOS_STATUS
2111 //! MOS_STATUS_SUCCESS if succeeded, otherwise error code
2112 //!
2113 MOS_STATUS (*pfnGetEngineLogicId)(
2114 PMOS_INTERFACE pOsInterface,
2115 uint8_t& id);
2116 #endif
2117 //!
2118 //! \brief Is Device Async or not
2119 //! \details Is Device Async or not.
2120 //!
2121 //! \param PMOS_INTERFACE pOsInterface
2122 //! [in] OS Interface
2123 //!
2124 //! \return bool
2125 //! Return true if is async, otherwise false
2126 //!
2127 bool (*pfnIsAsynDevice)(
2128 PMOS_INTERFACE osInterface);
2129
2130 void (*pfnDisableNativeFenceSyncByCmd)(
2131 PMOS_INTERFACE osInterface,
2132 GPU_CONTEXT_HANDLE gpuContextHandle);
2133
2134 //!
2135 //! \brief Get User Setting instance
2136 //!
2137 //! \param PMOS_INTERFACE pOsInterface
2138 //! [in] OS Interface
2139 //! \return MediaUserSettingSharedPtr
2140 //!
2141 MediaUserSettingSharedPtr (*pfnGetUserSettingInstance)(
2142 PMOS_INTERFACE pOsInterface);
2143
2144 bool (*pfnInsertCacheSetting)(CACHE_COMPONENTS id, std::map<uint64_t, MOS_CACHE_ELEMENT> *cacheTablesPtr);
2145
2146 bool (*pfnGetCacheSetting)(MOS_COMPONENT id, uint32_t feature, bool bOut, ENGINE_TYPE engineType, MOS_CACHE_ELEMENT &element, bool isHeapSurf);
2147
2148 bool (*pfnIsGpuSyncByCmd)(PMOS_INTERFACE osInterface, GPU_CONTEXT_HANDLE gpuContextHandle);
2149
2150 void (*pfnOnNativeFenceSyncBBAdded)(PMOS_COMMAND_BUFFER pCmdBuffer, uint64_t gfxAddr);
2151
2152 // Virtual Engine related
2153 int32_t bSupportVirtualEngine; //!< Enable virtual engine flag
2154 int32_t bUseHwSemaForResSyncInVE; //!< Flag to indicate if UMD need to send HW sema cmd under this OS when there is a resource sync need with Virtual Engine interface
2155 PMOS_VIRTUALENGINE_INTERFACE pVEInterf;
2156 bool ctxBasedScheduling; //!< Flag to indicate if context based scheduling enabled for virtual engine, that is VE2.0.
2157 bool multiNodeScaling; //!< Flag to indicate if multi-node scaling is enabled for virtual engine, that is VE3.0.
2158 bool veDefaultEnable = true; //!< Flag to indicate if virtual engine is enabled by default
2159 bool phasedSubmission = false; //!< Flag to indicate if secondary command buffers are submitted together (Win) or separately (Linux)
2160 bool frameSplit = true; //!< Flag to indicate if frame split is enabled
2161 bool bSetHandleInvalid = false;
2162 bool bParallelSubmission = false; //!< Flag to indicate if parallel submission is enabled
2163 MOS_CMD_BUF_ATTRI_VE bufAttriVe[MOS_GPU_CONTEXT_MAX];
2164
2165 MOS_STATUS (*pfnCheckVirtualEngineSupported)(
2166 PMOS_INTERFACE pOsInterface);
2167
2168 #if MOS_MEDIASOLO_SUPPORTED
2169 int32_t bSupportMediaSoloVirtualEngine; //!< Flag to indicate if MediaSolo uses VE solution in cmdbuffer submission.
2170 #endif // MOS_MEDIASOLO_SUPPORTED
2171 bool VEEnable;
2172 bool bCanEnableSecureRt;
2173
2174 int32_t bHcpDecScalabilityMode; //!< enable scalability decode {mode: default, user force, false}
2175 #if (_DEBUG || _RELEASE_INTERNAL)
2176 MOS_FORCE_VEBOX eForceVebox; //!< Force select Vebox
2177 int32_t bEnableDbgOvrdInVE; //!< It is for all scalable engines: used together with KMD VE for UMD to specify an engine directly
2178 int32_t bSoftReset; //!< trigger soft reset
2179 #endif // (_DEBUG || _RELEASE_INTERNAL)
2180 bool streamStateIniter = false;
2181
2182 int32_t bVeboxScalabilityMode; //!< Enable scalability vebox
2183
2184 bool bOptimizeCpuTiming; //!< Optimize Cpu Timing
2185
2186 bool bNullHwIsEnabled; //!< Null Hw is enabled or not
2187
2188 //!< os interface extension
2189 void *pOsExt;
2190 MhwInterfacesNext *mhwInterface;
2191 } MOS_INTERFACE;
2192
2193 #ifdef __cplusplus
2194 extern "C" {
2195 #endif
2196
2197 //! \brief Unified OS Initializes OS Interface
2198 //! \details OS Interface initilization
2199 //! \param PMOS_INTERFACE pOsInterface
2200 //! [in/out] Pointer to OS Interface
2201 //! \param MOS_CONTEXT_HANDLE pOsDriverContext
2202 //! [in] Pointer to Driver context
2203 //! \param MOS_COMPONENT component
2204 //! [in] OS component
2205 //! \return MOS_STATUS
2206 //! Return MOS_STATUS_SUCCESS if successful, otherwise failed
2207 //!
2208 MOS_STATUS Mos_InitOsInterface(
2209 PMOS_INTERFACE pOsInterface,
2210 MOS_CONTEXT_HANDLE pOsDriverContext,
2211 MOS_COMPONENT component);
2212
2213 //! \brief Destroy the mos interface
2214 //! \details MOS Interface release
2215 //! \param PMOS_INTERFACE pOsInterface
2216 //! [in/out] Pointer to OS Interface
2217 //! \return MOS_STATUS
2218 //! Return MOS_STATUS_SUCCESS if successful, otherwise failed
2219 //!
2220 MOS_STATUS Mos_DestroyInterface(PMOS_INTERFACE pOsInterface);
2221
2222 //! \brief Unified OS add command to command buffer
2223 //! \details Offset returned is dword aligned but size requested can be byte aligned
2224 //! \param PMOS_COMMAND_BUFFER pCmdBuffer
2225 //! [in/out] Pointer to Command Buffer
2226 //! \param void *pCmd
2227 //! [in] Command Pointer
2228 //! \param uint32_t dwCmdSize
2229 //! [in] Size of command in bytes
2230 //! \return MOS_STATUS
2231 //! Return MOS_STATUS_SUCCESS if successful, otherwise failed
2232 //!
2233 MOS_STATUS Mos_AddCommand(
2234 PMOS_COMMAND_BUFFER pCmdBuffer,
2235 const void *pCmd,
2236 uint32_t dwCmdSize);
2237
2238 //! \brief Unified OS get uf path info
2239 //! \details return a pointer to the user feature key path info
2240 //! \param PMOS_CONTEXT mosContext
2241 //! [in/out] Pointer to mosContext
2242 //! \return MOS_USER_FEATURE_KEY_PATH_INFO*
2243 //! Return a poniter to user feature path info
2244 //!
2245 MOS_USER_FEATURE_KEY_PATH_INFO *Mos_GetDeviceUfPathInfo(
2246 PMOS_CONTEXT mosContext);
2247
2248
2249 #if !EMUL
2250 //!
2251 //! \brief Get memory object based on resource usage
2252 //! \details Get memory object based on resource usage
2253 //! \param MOS_HW_RESOURCE_DEF MosUsage
2254 //! [in] Current usage for resource
2255 //! [in] Gmm client context
2256 //! \return MEMORY_OBJECT_CONTROL_STATE
2257 //! Populated memory object
2258 //!
2259 MEMORY_OBJECT_CONTROL_STATE Mos_CachePolicyGetMemoryObject(
2260 MOS_HW_RESOURCE_DEF MosUsage,
2261 GMM_CLIENT_CONTEXT *pGmmClientContext);
2262
2263 #endif
2264
2265 #ifdef __cplusplus
2266 }
2267 #endif
2268
2269 typedef struct _MOS_GPUCTX_CREATOPTIONS_ENHANCED MOS_GPUCTX_CREATOPTIONS_ENHANCED, *PMOS_GPUCTX_CREATOPTIONS_ENHANCED;
2270 struct _MOS_GPUCTX_CREATOPTIONS_ENHANCED : public _MOS_GPUCTX_CREATOPTIONS
2271 {
2272 union
2273 {
2274 struct
2275 {
2276 uint32_t UsingSFC : 1;
2277 uint32_t Reserved1 : 1; // remove HWRestrictedEngine
2278 #if (_DEBUG || _RELEASE_INTERNAL)
2279 uint32_t Reserved : 29;
2280 uint32_t DebugOverride : 1; // Debug & validation usage only
2281 #else
2282 uint32_t Reserved : 30;
2283 #endif
2284 };
2285 uint32_t Flags;
2286 };
2287
2288 uint32_t LRCACount;
2289
2290 #if (_DEBUG || _RELEASE_INTERNAL)
2291 // Logical engine instances used by this context; valid only if flag DebugOverride is set.
2292 uint8_t EngineInstance[MOS_MAX_ENGINE_INSTANCE_PER_CLASS];
2293 #endif
2294
2295 _MOS_GPUCTX_CREATOPTIONS_ENHANCED()
2296 : Flags(0),
2297 LRCACount(0)
2298 {
2299 #if (_DEBUG || _RELEASE_INTERNAL)
2300 for (auto i = 0; i < MOS_MAX_ENGINE_INSTANCE_PER_CLASS; i++)
2301 {
2302 EngineInstance[i] = MOS_INVALID_ENGINE_INSTANCE;
2303 }
2304 #endif
2305 }
2306
2307 _MOS_GPUCTX_CREATOPTIONS_ENHANCED(_MOS_GPUCTX_CREATOPTIONS* createOption)
2308 : _MOS_GPUCTX_CREATOPTIONS(createOption)
2309 {
2310 if (typeid(*createOption) == typeid(_MOS_GPUCTX_CREATOPTIONS_ENHANCED))
2311 {
2312 Flags = ((MOS_GPUCTX_CREATOPTIONS_ENHANCED *)createOption)->Flags;
2313 LRCACount = ((MOS_GPUCTX_CREATOPTIONS_ENHANCED *)createOption)->LRCACount;
2314 #if (_DEBUG || _RELEASE_INTERNAL)
2315 for (auto i = 0; i < MOS_MAX_ENGINE_INSTANCE_PER_CLASS; i++)
2316 {
2317 EngineInstance[i] = ((MOS_GPUCTX_CREATOPTIONS_ENHANCED *)createOption)->EngineInstance[i];
2318 }
2319 #endif
2320 }
2321 else
2322 {
2323 Flags = 0;
2324 LRCACount = 0;
2325 #if (_DEBUG || _RELEASE_INTERNAL)
2326 for (auto i = 0; i < MOS_MAX_ENGINE_INSTANCE_PER_CLASS; i++)
2327 {
2328 EngineInstance[i] = MOS_INVALID_ENGINE_INSTANCE;
2329 }
2330 #endif
2331 }
2332 }
2333
2334 };
2335
2336 #define MOS_VE_SUPPORTED(pOsInterface) \
2337 (pOsInterface ? pOsInterface->bSupportVirtualEngine : false)
2338
2339 #define MOS_VE_CTXBASEDSCHEDULING_SUPPORTED(pOsInterface) \
2340 (pOsInterface ? pOsInterface->ctxBasedScheduling : false)
2341
2342 #define MOS_VE_MULTINODESCALING_SUPPORTED(pOsInterface) \
2343 (pOsInterface ? pOsInterface->multiNodeScaling : false)
2344
2345 #if MOS_MEDIASOLO_SUPPORTED
2346 #define MOS_MEDIASOLO_VE_SUPPORTED(pOsInterface) \
2347 (pOsInterface ? pOsInterface->bSupportMediaSoloVirtualEngine : false)
2348 #endif
2349
2350 __inline void Mos_SetVirtualEngineSupported(PMOS_INTERFACE pOsInterface, bool bEnabled)
2351 {
2352 if (pOsInterface && pOsInterface->veDefaultEnable)
2353 {
2354 pOsInterface->bSupportVirtualEngine = bEnabled;
2355 }
2356 }
2357
2358 //!
2359 //! \brief Check whether the parameter of mos surface is valid for copy
2360 //!
2361 //! \param [in] mosSurface
2362 //! Pointer to MosSurface
2363 //!
2364 //! \return bool
2365 //! Whether the paramter of mosSurface is valid
2366 //!
2367 MOS_STATUS Mos_VerifyMosSurface(
2368 PMOS_SURFACE mosSurface,
2369 bool &bIsValid);
2370
2371 //!
2372 //! \brief Check virtual engine is supported
2373 //! \details Check virtual engine is supported
2374 //! \param PMOS_INTERFACE pOsInterface
2375 //! [in] OS Interface
2376 //! \return MOS_STATUS
2377 //! MOS_STATUS_SUCCESS if succeeded, otherwise error code
2378 //!
2379 MOS_STATUS Mos_CheckVirtualEngineSupported(
2380 PMOS_INTERFACE osInterface,
2381 bool isDecode,
2382 bool veDefaultEnable);
2383
2384 //!
2385 //! \brief Retrieve the CachePolicyMemoryObject for a resource
2386 //! \details Retrieve the CachePolicyMemoryObject for a resource
2387 //! \param PMOS_INTERFACE osInterface
2388 //! [in] OS Interface
2389 //! \param PMOS_RESOURCE resource
2390 //! [in] resource
2391 //! \return MEMORY_OBJECT_CONTROL_STATE
2392 //! return a value of MEMORY_OBJECT_CONTROL_STATE
2393 //!
2394 MEMORY_OBJECT_CONTROL_STATE Mos_GetResourceCachePolicyMemoryObject(
2395 PMOS_INTERFACE osInterface,
2396 PMOS_RESOURCE resource);
2397
2398 //!
2399 //! \brief Is Device Async or not
2400 //! \details Is Device Async or not.
2401 //! \param [in] streamState
2402 //! Handle of Os Stream State.
2403 //! \return bool
2404 //! Return true if is async, otherwise false
2405 //!
2406 bool Mos_IsAsyncDevice(
2407 MOS_STREAM_HANDLE streamState);
2408
2409 //!
2410 //! \brief Mos format to os format
2411 //! \details Mos format to os format
2412 //! \param [in] format
2413 //! Mos format.
2414 //! \return uint32_t
2415 //! Return OS FORMAT
2416 //!
2417 uint32_t Mos_MosFmtToOsFmt(
2418 MOS_FORMAT format);
2419
2420 //!
2421 //! \brief Os format to Mos format
2422 //! \details Os format to Mos format
2423 //! \param [in] format
2424 //! Os format.
2425 //! \return MOS_FORMAT
2426 //! Return MOS FORMAT
2427 //!
2428 MOS_FORMAT Mos_OsFmtToMosFmt(
2429 uint32_t format);
2430
2431 //!
2432 //! \brief Mos format to GMM format
2433 //! \details Mos format to GMM format
2434 //! \param [in] format
2435 //! Mos format.
2436 //! \return GMM_RESOURCE_FORMAT
2437 //! Return GMM FORMAT
2438 //!
2439 GMM_RESOURCE_FORMAT Mos_MosFmtToGmmFmt(
2440 MOS_FORMAT format);
2441
2442 //!
2443 //! \brief GMM format to mos format
2444 //! \details GMM format to mos format
2445 //! \param [in] format
2446 //! GMM_RESOURCE_FORMAT.
2447 //! \return MOS_FORMAT
2448 //! Return MOS FORMAT
2449 //!
2450 MOS_FORMAT Mos_GmmFmtToMosFmt(
2451 GMM_RESOURCE_FORMAT format);
2452
2453 //!
2454 //! \brief Wait For cmd Completion
2455 //! \details [GPU Context Interface] Waiting for the completion of cmd in provided GPU context
2456 //! \details Caller: HAL only
2457 //! \param [in] streamState
2458 //! Handle of Os Stream State
2459 //! \param [in] gpuCtx
2460 //! GpuContext handle of the gpu context to wait cmd completion
2461 //! \return MOS_STATUS
2462 //! Return MOS_STATUS_SUCCESS if successful, otherwise failed
2463 //!
2464 MOS_STATUS Mos_WaitForCmdCompletion(
2465 MOS_STREAM_HANDLE streamState,
2466 GPU_CONTEXT_HANDLE gpuCtx);
2467
2468 //!
2469 //! \brief Get Resource array index
2470 //! \details Returns the array index
2471 //! \param PMOS_RESOURCE
2472 //! [in] Pointer to MOS_RESOURCE
2473 //! \return uint32_t - array index
2474 //!
2475 uint32_t Mos_GetResourceArrayIndex(
2476 PMOS_RESOURCE resource);
2477
2478 //!
2479 //! \brief Setup VE Attribute Buffer
2480 //! \details [Cmd Buffer Interface] Setup VE Attribute Buffer into cmd buffer.
2481 //! \details Caller: MHW only
2482 //! \details This interface is called to setup into cmd buffer.
2483 //! \param [in] streamState
2484 //! Handle of Os Stream State
2485 //! \param [out] cmdBuffer
2486 //! Cmd buffer to setup VE attribute.
2487 //! \return MOS_STATUS
2488 //! Return MOS_STATUS_SUCCESS if successful, otherwise failed
2489 //!
2490 MOS_STATUS Mos_SetupAttributeVeBuffer(
2491 MOS_STREAM_HANDLE streamState,
2492 COMMAND_BUFFER_HANDLE cmdBuffer);
2493
2494 //!
2495 //! \brief Get VE Attribute Buffer
2496 //! \details [Cmd Buffer Interface] Get VE Attribute Buffer from cmd buffer.
2497 //! \details Caller: HAL only
2498 //! \details This interface is called to get VE attribute buffer from cmd buffer if it contains one.
2499 //! If there is no VE attribute buffer returned, it means the cmd buffer has no such buffer
2500 //! in current MOS module. It is not error state if it is nullptr.
2501 //! \param [out] cmdBuffer
2502 //! Cmd buffer to setup VE attribute.
2503 //! \return MOS_CMD_BUF_ATTRI_VE*
2504 //! Return pointer of VE attribute buffer, nullptr if current cmdBuffer didn't contain attribute.
2505 //!
2506 MOS_CMD_BUF_ATTRI_VE *Mos_GetAttributeVeBuffer(
2507 COMMAND_BUFFER_HANDLE cmdBuffer);
2508
2509 //!
2510 //! \brief Setup commandlist and command pool from os interface
2511 //! \details Set the commandlist and commandPool used in this stream from os interface.
2512 //! \param [in] osInterface
2513 //! pointer to the mos interface
2514 //! \param [out] streamState
2515 //! Handle of Os Stream State.
2516 //! \return MOS_STATUS
2517 //! Return MOS_STATUS_SUCCESS if successful, otherwise failed
2518 //!
2519 MOS_STATUS Mos_SetupCurrentCmdListAndPool(
2520 PMOS_INTERFACE osInterface,
2521 MOS_STREAM_HANDLE streamState);
2522
2523 //!
2524 //! \brief Get MOS_HW_RESOURCE_DEF
2525 //! \details [Resource Interface] Get Mos HW Resource DEF
2526 //! Caller: HAL & MHW
2527 //! \param [in] gmmResUsage
2528 //! Gmm Resource usage as index
2529 //! \return MOS_HW_RESOURCE_DEF
2530 //! Mos HW resource definition
2531 //!
2532 MOS_HW_RESOURCE_DEF Mos_GmmToMosResourceUsageType(
2533 GMM_RESOURCE_USAGE_TYPE gmmResUsage);
2534
2535 //!
2536 //! \brief Get Adapter Info
2537 //! \details [System info Interface] Get Adapter Info
2538 //! \details Caller: DDI & HAL
2539 //! \details This func is called to differentiate the behavior according to Adapter Info.
2540 //! \param [in] streamState
2541 //! Handle of Os Stream State
2542 //! \return ADAPTER_INFO*
2543 //! Read-only Adapter Info got, nullptr if failed to get
2544 //!
2545 ADAPTER_INFO *Mos_GetAdapterInfo(
2546 MOS_STREAM_HANDLE streamState);
2547
2548 //!
2549 //! \brief Surface compression is supported
2550 //! \details Surface compression is supported
2551 //! \param [in] skuTable
2552 //! Pointer to MEDIA_FEATURE_TABLE
2553 //! \return bool
2554 //! If true, compression is enabled
2555 //!
2556 bool Mos_IsCompressibelSurfaceSupported(
2557 MEDIA_FEATURE_TABLE *skuTable);
2558
2559 //!
2560 //! \brief Destroy Virtual Engine State
2561 //! \details [Virtual Engine Interface] Destroy Virtual Engine State of provided streamState
2562 //! \details Caller: Hal (Scalability) only
2563 //! \details This func is called when a stream (Hal instance) need to destroy a VE state
2564 //! \details into provided stream.
2565 //! \param [in] streamState
2566 //! Handle of Os Stream State
2567 //! \return MOS_STATUS
2568 //! Return MOS_STATUS_SUCCESS if successful, otherwise failed
2569 //!
2570 MOS_STATUS Mos_DestroyVirtualEngineState(
2571 MOS_STREAM_HANDLE streamState);
2572
2573 //!
2574 //! \brief Get resource handle
2575 //! \details Get resource handle
2576 //! \param [in] streamState
2577 //! Handle of Os Stream State
2578 //! \param [in] osResource
2579 //! Pointer to mos resource
2580 //! \return uint64_t
2581 //! Return resource handle
2582 //!
2583 uint64_t Mos_GetResourceHandle(
2584 MOS_STREAM_HANDLE streamState,
2585 PMOS_RESOURCE osResource);
2586
2587 //!
2588 //! \brief Get RT log resource info
2589 //! \details Get RT log resource info
2590 //! \param [in] streamState
2591 //! Handle of Os Stream State
2592 //! \param [in,out] osResource
2593 //! Reference to pointer of mos resource
2594 //! \param [in,out] size
2595 //! Reference to size
2596 //! \return void
2597 //!
2598 void Mos_GetRtLogResourceInfo(
2599 PMOS_INTERFACE osInterface,
2600 PMOS_RESOURCE &osResource,
2601 uint32_t &size);
2602
2603 //!
2604 //! \brief OS reset resource
2605 //! \details Resets the OS resource
2606 //! \param PMOS_RESOURCE resource
2607 //! [in] Pointer to OS Resource
2608 //! \return void
2609 //! Return NONE
2610 //!
2611 void Mos_ResetMosResource(
2612 PMOS_RESOURCE resource);
2613
2614
2615 bool Mos_InsertCacheSetting(CACHE_COMPONENTS id, std::map<uint64_t, MOS_CACHE_ELEMENT> *cacheTablesPtr);
2616
2617 bool Mos_GetCacheSetting(MOS_COMPONENT id, uint32_t feature, bool bOut, ENGINE_TYPE engineType, MOS_CACHE_ELEMENT &element, bool isHeapSurf);
2618
2619 //!
2620 //! \brief Set Hybrid Cmd To GpuContext
2621 //! \details Set Hybird Cmd To GpuContext
2622 //! \param PMOS_INTERFACE pOsInterface
2623 //! [in] ptr to pOsInterface
2624 //! \param uint64_t gpuCtxOnHybridCmd
2625 //! gpuCtxOnHybridCmd
2626 //! \return MOS_STATUS
2627 //! Return MOS_STATUS
2628 //!
2629 MOS_STATUS MOS_SetHybridCmdMgrToGpuContext(
2630 PMOS_INTERFACE pOsInterface,
2631 uint64_t gpuCtxOnHybridCmd);
2632
2633 //!
2634 //! \brief Set Hybrid Cmd Submit Mode
2635 //! \details Set Hybrid Cmd Submit Mode
2636 //! \param PMOS_INTERFACE pOsInterface
2637 //! [in] ptr to pOsInterface
2638 //! \param uint64_t hybridMgrSubmitMode
2639 //! hybridMgrSubmitMode
2640 //! \return MOS_STATUS
2641 //! Return MOS_STATUS
2642 //!
2643 MOS_STATUS MOS_SetHybridCmdMgrSubmitMode(
2644 PMOS_INTERFACE pOsInterface,
2645 uint64_t hybridMgrSubmitMode);
2646
2647 //!
2648 //! \brief Start the Cmd Buffer Consumer
2649 //! \details Start the Cmd Buffer Consumer
2650 //! \param PMOS_INTERFACE pOsInterface
2651 //! [in] Pointer to OS interface structure
2652 //! \return MOS_STATUS
2653 //! Return MOS_STATUS
2654 //!
2655 MOS_STATUS MOS_StartHybridCmdMgr(
2656 PMOS_INTERFACE pOsInterface);
2657
2658 //!
2659 //! \brief Stop the Cmd Buffer Consumer
2660 //! \details Stop the Cmd Buffer Consumer
2661 //! \param PMOS_INTERFACE pOsInterface
2662 //! [in] Pointer to OS interface structure
2663 //! \return MOS_STATUS
2664 //! Return MOS_STATUS
2665 //!
2666 MOS_STATUS MOS_StopHybridCmdMgr(
2667 PMOS_INTERFACE pOsInterface);
2668
2669 //!
2670 //! \brief Submit Cmd Package to Cmd Consumer
2671 //! \details Submit Cmd Package to Cmd Consumer
2672 //! \param PMOS_INTERFACE pOsInterface
2673 //! [in] ptr to pOsInterface
2674 //! \param CmdPackage& cmdPackage
2675 //! [in] reference to cmdPackage
2676 //! \return MOS_STATUS
2677 //! Return MOS_STATUS
2678 //!
2679 MOS_STATUS MOS_SubmitPackage(
2680 PMOS_INTERFACE pOsInterface,
2681 CmdPackage &cmdPackage);
2682
2683 #if (_DEBUG || _RELEASE_INTERNAL)
2684 //!
2685 //! \brief Get engine count
2686 //! \details [Virtual Engine Interface] Get engine count from Virtual Engine State in provided stream
2687 //! \details Caller: Hal (Scalability) only
2688 //! \details Get engine count from virtual engine state
2689 //! \param [in] streamState
2690 //! Handle of Os Stream State
2691 //! \return uint8_t
2692 //! Engine count
2693 //!
2694 uint8_t Mos_GetVeEngineCount(
2695 MOS_STREAM_HANDLE streamState);
2696
2697 //!
2698 //! \brief Get Engine Logic Id
2699 //! \details [Virtual Engine Interface] Get engine Logic Id from Virtual Engine State in provided stream
2700 //! \details Caller: Hal (Scalability) only
2701 //! \details Get engine Logic Id from virtual engine state
2702 //! \param [in] streamState
2703 //! Handle of Os Stream State
2704 //! \param [in] instanceIdx
2705 //! Engine instance index
2706 //! \return uint8_t
2707 //!
2708 uint8_t Mos_GetEngineLogicId(
2709 MOS_STREAM_HANDLE streamState,
2710 uint32_t instanceIdx);
2711
2712 //!
2713 //! \brief Set Gpu Virtual Address for Debug
2714 //! \details Manually make page fault
2715 //!
2716 //! \param [in] pResource
2717 //! Resource to set Gpu Address
2718 //! \param [in] address
2719 //! Address to set
2720 //! \return MOS_STATUS
2721 //!
2722 MOS_STATUS MOS_SetGpuVirtualAddress(
2723 PMOS_RESOURCE pResource,
2724 uint64_t address);
2725
2726 #endif
2727
2728 struct ContextRequirement
2729 {
2730 bool IsEnc = false;
2731 bool IsPak = false;
2732 bool IsContextSwitchBack = false;
2733 };
2734
2735 #endif // __MOS_OS_H__