| 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_specific.h |
| 24 |
//! \brief Linux specfic OCA struct |
| 25 |
//! |
| 26 |
|
| 27 |
#ifndef __MOS_OCA_DEFS_SPECIFIC_H__ |
| 28 |
#define __MOS_OCA_DEFS_SPECIFIC_H__ |
| 29 |
|
| 30 |
#include "mos_oca_defs.h" |
| 31 |
#include <cstdint> |
| 32 |
|
| 33 |
typedef struct _MOS_OCA_BUFFER_CONFIG |
| 34 |
{ |
| 35 |
uint32_t maxResInfoCount = 0; //!< Max resource info count. |
| 36 |
uint32_t maxBufferResInfoCount = 0; //!< Max buffer resource info count |
| 37 |
}MOS_OCA_BUFFER_CONFIG; |
| 38 |
|
| 39 |
/****************************************************************************************************/ |
| 40 |
/* OCA LOG HEADERS */ |
| 41 |
/****************************************************************************************************/ |
| 42 |
typedef struct _MOS_OCA_RESOURCE_INFO |
| 43 |
{ |
| 44 |
uint64_t gfxAddress; |
| 45 |
uint64_t sizeAllocation; |
| 46 |
uint64_t sizeSurface; |
| 47 |
uint64_t sizeSurfacePhy; |
| 48 |
uint64_t sizeMainSurface; |
| 49 |
uint64_t allocationHandle; |
| 50 |
uint32_t hwCmdType; |
| 51 |
uint32_t locationInCmd; |
| 52 |
uint32_t offsetInRes; |
| 53 |
uint32_t pitch; |
| 54 |
uint32_t width; |
| 55 |
uint32_t height; |
| 56 |
uint32_t format; |
| 57 |
uint32_t gmmFormat; |
| 58 |
uint32_t gmmTileMode; |
| 59 |
uint32_t gmmClient; |
| 60 |
uint32_t gmmResUsageType; |
| 61 |
uint32_t mmcMode; |
| 62 |
uint32_t mmcHint; |
| 63 |
uint64_t auxYOffset; |
| 64 |
uint64_t auxUVOffset; |
| 65 |
uint64_t auxCCSOffset; |
| 66 |
uint64_t auxCCOffset; |
| 67 |
struct { |
| 68 |
uint32_t isLocalOnly : 1; |
| 69 |
uint32_t isNonLocalOnly : 1; |
| 70 |
uint32_t isNotLockable : 1; |
| 71 |
uint32_t isShared : 1; |
| 72 |
uint32_t isCameraCapture : 1; |
| 73 |
uint32_t isRenderTarget : 1; |
| 74 |
} flags; |
| 75 |
}MOS_OCA_RESOURCE_INFO, *PMOS_OCA_RESOURCE_INFO; |
| 76 |
|
| 77 |
typedef struct _MOS_OCA_BUFFER_RESOURCE_INFO |
| 78 |
{ |
| 79 |
uint64_t gfxAddress; |
| 80 |
uint64_t sizeAllocation; |
| 81 |
uint64_t allocationHandle; |
| 82 |
uint32_t hwCmdType; |
| 83 |
uint32_t locationInCmd; |
| 84 |
uint32_t size; |
| 85 |
uint32_t gmmFormat; |
| 86 |
uint32_t gmmResUsageType; |
| 87 |
struct |
| 88 |
{ |
| 89 |
uint32_t isLocalOnly : 1; |
| 90 |
uint32_t isNonLocalOnly : 1; |
| 91 |
uint32_t isNotLockable : 1; |
| 92 |
uint32_t isRenderTarget : 1; |
| 93 |
} flags; |
| 94 |
} MOS_OCA_BUFFER_RESOURCE_INFO, *PMOS_OCA_BUFFER_RESOURCE_INFO; |
| 95 |
|
| 96 |
struct MOS_OCA_BUF_CONTEXT |
| 97 |
{ |
| 98 |
bool inUse = false; |
| 99 |
bool is1stLevelBBStarted = false; |
| 100 |
struct |
| 101 |
{ |
| 102 |
uint64_t *base = nullptr; |
| 103 |
uint32_t offset = 0; |
| 104 |
struct { |
| 105 |
uint32_t maxResInfoCount = 0; |
| 106 |
MOS_OCA_RESOURCE_INFO *resInfoList = nullptr; |
| 107 |
uint32_t resCount = 0; |
| 108 |
uint32_t resCountSkipped = 0; |
| 109 |
uint32_t maxBufferResInfoCount = 0; |
| 110 |
MOS_OCA_BUFFER_RESOURCE_INFO *bufferResInfoList = nullptr; |
| 111 |
uint32_t bufferResCount = 0; |
| 112 |
} resInfo; |
| 113 |
} logSection; |
| 114 |
|
| 115 |
}; |
| 116 |
|
| 117 |
struct OCA_LOG_SECTION_HEADER |
| 118 |
{ |
| 119 |
uint64_t magicNum = 0; |
| 120 |
uint64_t rtlogPatchAddr = 0; |
| 121 |
}; |
| 122 |
|
| 123 |
#pragma pack(push) |
| 124 |
#pragma pack(8) |
| 125 |
struct MOS_OCA_EXEC_LIST_INFO |
| 126 |
{ |
| 127 |
int handle; |
| 128 |
uint64_t size; |
| 129 |
uint64_t offset64; |
| 130 |
int flags; |
| 131 |
int mem_region; |
| 132 |
bool is_batch; |
| 133 |
}; |
| 134 |
#pragma pack(pop) |
| 135 |
|
| 136 |
typedef struct _MOS_OCA_LOG_HEADER_EXEC_LIST_INFO |
| 137 |
{ |
| 138 |
MOS_OCA_LOG_HEADER header; |
| 139 |
uint32_t count; // exec bo count dumped. |
| 140 |
uint32_t reserved; // reserved |
| 141 |
} MOS_OCA_LOG_HEADER_EXEC_LIST_INFO, *PMOS_OCA_LOG_HEADER_EXEC_LIST_INFO; |
| 142 |
|
| 143 |
#endif // #ifndef __MOS_OCA_DEFS_SPECIFIC_H__ |