| 1 |
/* |
| 2 |
* Copyright (c) 2022, Intel Corporation |
| 3 |
* |
| 4 |
* Permission is hereby granted, free of charge, to any person obtaining a |
| 5 |
* copy of this software and associated documentation files (the "Software"), |
| 6 |
* to deal in the Software without restriction, including without limitation |
| 7 |
* the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 8 |
* and/or sell copies of the Software, and to permit persons to whom the |
| 9 |
* Software is furnished to do so, subject to the following conditions: |
| 10 |
* |
| 11 |
* The above copyright notice and this permission notice shall be included |
| 12 |
* in all copies or substantial portions of the Software. |
| 13 |
* |
| 14 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 15 |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 16 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 17 |
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR |
| 18 |
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
| 19 |
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 20 |
* OTHER DEALINGS IN THE SOFTWARE. |
| 21 |
*/ |
| 22 |
//! |
| 23 |
//! \file mos_oca_defs.h |
| 24 |
//! \brief Common structure for OCA |
| 25 |
//! |
| 26 |
|
| 27 |
#ifndef __MOS_OCA_DEFS_H__ |
| 28 |
#define __MOS_OCA_DEFS_H__ |
| 29 |
|
| 30 |
typedef uint64_t MOS_OCA_BUFFER_HANDLE; |
| 31 |
#define OCA_HEAP_INVALID_OFFSET ((uint32_t)-1) |
| 32 |
|
| 33 |
#define MOS_OCA_INVALID_BUFFER_HANDLE -1 |
| 34 |
|
| 35 |
#define MAX_NUM_OF_OCA_BUF_CONTEXT 32 |
| 36 |
|
| 37 |
#define OCA_LOG_SECTION_SIZE_MAX 0x3000 |
| 38 |
#define OCA_LOG_SECTION_MAGIC_NUMBER (0x5F691B7E574ACE30) |
| 39 |
|
| 40 |
#define MOS_OCA_MAX_STRING_LEN (1024) //!< The max string len for MosOcaStateHeapLog::TraceMessage. |
| 41 |
#define OCA_MAX_RESOURCE_INFO_COUNT_MAX 60 |
| 42 |
#define OCA_MAX_BUFFER_RESOURCE_INFO_COUNT_MAX 150 |
| 43 |
|
| 44 |
typedef enum _MOS_OCA_LOG_TYPE |
| 45 |
{ |
| 46 |
MOS_OCA_LOG_TYPE_INVALID = 0, |
| 47 |
MOS_OCA_LOG_TYPE_STRING, |
| 48 |
MOS_OCA_LOG_TYPE_VP_KERNEL_INFO, |
| 49 |
MOS_OCA_LOG_TYPE_VPHAL_PARAM, |
| 50 |
MOS_OCA_LOG_TYPE_CP_PARAM, |
| 51 |
MOS_OCA_LOG_TYPE_RESOURCE_INFO, |
| 52 |
MOS_OCA_LOG_TYPE_FENCE_INFO, |
| 53 |
MOS_OCA_LOG_TYPE_CODECHAL_PARAM, |
| 54 |
MOS_OCA_LOG_TYPE_EXEC_LIST_INFO, |
| 55 |
MOS_OCA_LOG_TYPE_VP_USER_FEATURE_CONTROL_INFO, |
| 56 |
MOS_OCA_LOG_TYPE_CP_IOMSG, |
| 57 |
MOS_OCA_LOG_TYPE_BUFFER_RESOURCE_INFO, |
| 58 |
MOS_OCA_LOG_TYPE_COUNT |
| 59 |
}MOS_OCA_LOG_TYPE; |
| 60 |
|
| 61 |
typedef struct _MOS_OCA_LOG_HEADER |
| 62 |
{ |
| 63 |
uint32_t type; //!< Oca log type. Refer to MOS_OCA_LOG_TYPE. |
| 64 |
uint32_t headerSize; //!< The size for extented message header. |
| 65 |
uint32_t dataSize; //!< The size of data block without message header. |
| 66 |
}MOS_OCA_LOG_HEADER, *PMOS_OCA_LOG_HEADER; |
| 67 |
|
| 68 |
typedef struct _MOS_OCA_LOG_HEADER_VPHAL_PARAM |
| 69 |
{ |
| 70 |
MOS_OCA_LOG_HEADER header; |
| 71 |
// Followed by VPHAL_OCA_RENDER_PARAM |
| 72 |
} MOS_OCA_LOG_HEADER_VPHAL_PARAM, *PMOS_OCA_LOG_HEADER_VPHAL_PARAM; |
| 73 |
|
| 74 |
typedef struct _MOS_OCA_LOG_HEADER_CODECHAL_PARAM |
| 75 |
{ |
| 76 |
MOS_OCA_LOG_HEADER header; |
| 77 |
uint32_t codec; |
| 78 |
// Followed by CODECHAL_OCA_DECODE_HEADER |
| 79 |
} MOS_OCA_LOG_HEADER_CODECHAL_PARAM, *PMOS_OCA_LOG_HEADER_CODECHAL_PARAM; |
| 80 |
|
| 81 |
typedef struct _MOS_OCA_LOG_HEADER_RESOURCE_INFO |
| 82 |
{ |
| 83 |
MOS_OCA_LOG_HEADER header; |
| 84 |
uint32_t resCount; // Resource count dumped. |
| 85 |
uint32_t resCountSkipped; // Resource count skiped to be dumped as total count exceeding MOS_OCA_MAX_RESOURCE_INFO_COUNT. |
| 86 |
// Followed by MOS_OCA_RESOURCE_INFO lists. |
| 87 |
} MOS_OCA_LOG_HEADER_RESOURCE_INFO, *PMOS_OCA_LOG_HEADER_RESOURCE_INFO; |
| 88 |
|
| 89 |
typedef struct _MOS_OCA_LOG_HEADER_VP_KERNEL_INFO |
| 90 |
{ |
| 91 |
MOS_OCA_LOG_HEADER header; |
| 92 |
int vpKernelID; |
| 93 |
union |
| 94 |
{ |
| 95 |
int fcKernelCount; |
| 96 |
uint32_t aiKernelFeatureType; |
| 97 |
}; |
| 98 |
|
| 99 |
// Followed by fc kernel list. |
| 100 |
} MOS_OCA_LOG_HEADER_VP_KERNEL_INFO, *PMOS_OCA_LOG_HEADER_VP_KERNEL_INFO; |
| 101 |
|
| 102 |
typedef struct _MOS_OCA_LOG_USER_FEATURE_CONTROL_INFO |
| 103 |
{ |
| 104 |
bool PFonVpOutput = 0; |
| 105 |
bool hwsEnabled = 0; |
| 106 |
} MOS_OCA_LOG_USER_FEATURE_CONTROL_INFO, *PMOS_OCA_LOG_USER_FEATURE_CONTROL_INFO; |
| 107 |
#endif // #ifndef __MOS_OCA_DEFS_H__ |