| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
#ifndef __VP_RENDER_COMMON_H__ |
| 23 |
#define __VP_RENDER_COMMON_H__ |
| 24 |
|
| 25 |
#include <stdint.h> |
| 26 |
#include "surface_type.h" |
| 27 |
|
| 28 |
namespace vp |
| 29 |
{ |
| 30 |
#define CM_MAX_KERNEL_NAME_SIZE 256 |
| 31 |
#define READ_FIELD_FROM_BUF( dst, type ) \ |
| 32 |
dst = *((type *) &pBuf[bytePos]); \ |
| 33 |
bytePos += sizeof(type); |
| 34 |
|
| 35 |
#define CISA_MAGIC_NUMBER 0x41534943 //"CISA" |
| 36 |
#define GENX_TGLLP_CISAID 12 |
| 37 |
#define CM_MAX_ARGS_PER_KERNEL 255 // compiler only supports up to 255 arguments |
| 38 |
#define CM_PAYLOAD_OFFSET 32 // CM Compiler generates offset by 32 bytes. This need to be subtracted from kernel data offset. |
| 39 |
#define CM_PAYLOAD_OFFSET_LARGE 64 |
| 40 |
#define CM_MAX_THREAD_PAYLOAD_SIZE 2016 // 63 GRF |
| 41 |
#define CM_KERNEL_BINARY_PADDING_SIZE 128 // Padding after kernel binary to WA page fault issue. |
| 42 |
#define SURFACE_MASK 0x7 |
| 43 |
|
| 44 |
struct KERNEL_THREAD_SPACE |
| 45 |
{ |
| 46 |
uint32_t uWidth; |
| 47 |
uint32_t uHeight; |
| 48 |
uint32_t uDepth; |
| 49 |
uint32_t uLocalWidth; |
| 50 |
uint32_t uLocalHeight; |
| 51 |
}; |
| 52 |
|
| 53 |
|
| 54 |
enum KRN_ARG_KIND |
| 55 |
{ |
| 56 |
|
| 57 |
ARG_KIND_GENERAL = 0x0, |
| 58 |
ARG_KIND_SAMPLER = 0x1, |
| 59 |
ARG_KIND_VME_INDEX = 0x6, |
| 60 |
ARG_KIND_SURFACE = 0x8, |
| 61 |
|
| 62 |
ARG_KIND_SURFACE_2D = 0x9, |
| 63 |
ARG_KIND_SURFACE_1D = 0xa, |
| 64 |
ARG_KIND_SURFACE_SAMPLER8X8_AVS = 0xb, |
| 65 |
ARG_KIND_SURFACE_SAMPLER = 0xc, |
| 66 |
ARG_KIND_IMPLICT_LOCALSIZE = 0xe, |
| 67 |
ARG_KIND_IMPLICT_GROUPSIZE = 0xf, |
| 68 |
ARG_KIND_IMPLICIT_LOCALID = 0x10, |
| 69 |
ARG_KIND_GENERAL_DEPVEC = 0x20, |
| 70 |
ARG_KIND_SURFACE_2D_SCOREBOARD = 0x2A, |
| 71 |
ARG_KIND_GENERAL_DEPCNT = 0x30, |
| 72 |
|
| 73 |
|
| 74 |
ARG_KIND_INLINE = 0xa00 |
| 75 |
}; |
| 76 |
|
| 77 |
enum KRN_ARG_ADDRESSMODE |
| 78 |
{ |
| 79 |
AddressingModeStateful = 0, |
| 80 |
AddressingModeStateless, |
| 81 |
AddressingModeBindless, |
| 82 |
AddressIngModeMax |
| 83 |
}; |
| 84 |
|
| 85 |
enum IMPLICIT_ARG_TYPE |
| 86 |
{ |
| 87 |
ValueType = 0, |
| 88 |
IndirectDataPtr, |
| 89 |
ScratchPtr |
| 90 |
}; |
| 91 |
|
| 92 |
struct KRN_ARG |
| 93 |
{ |
| 94 |
uint32_t uIndex; |
| 95 |
uint32_t uOffsetInPayload; |
| 96 |
void* pData; |
| 97 |
uint32_t uSize; |
| 98 |
KRN_ARG_KIND eArgKind; |
| 99 |
bool isOutput; |
| 100 |
KRN_ARG_ADDRESSMODE addressMode; |
| 101 |
IMPLICIT_ARG_TYPE implicitArgType; |
| 102 |
}; |
| 103 |
|
| 104 |
|
| 105 |
struct KRN_BTI |
| 106 |
{ |
| 107 |
uint32_t uIndex; |
| 108 |
uint32_t uBTI; |
| 109 |
}; |
| 110 |
|
| 111 |
|
| 112 |
struct KRN_EXECUTE_ENV |
| 113 |
{ |
| 114 |
uint32_t uBarrierCount; |
| 115 |
bool bDisableMidThreadPreemption; |
| 116 |
uint32_t uGrfCount; |
| 117 |
bool bHasGlobalAtomics; |
| 118 |
bool bHasNoStatelessWrite; |
| 119 |
uint32_t uInlineDataPayloadSize; |
| 120 |
uint32_t uOffsetToSkipPerThreadDataLoad; |
| 121 |
uint32_t uSimdSize; |
| 122 |
uint32_t uSubgroupIndependentForwardProgress; |
| 123 |
uint32_t uEuThreadCount; |
| 124 |
bool bHasFenceForImageAccess; |
| 125 |
bool bHasSample; |
| 126 |
bool bHas4GBBuffers; |
| 127 |
uint8_t uiWorkGroupWalkOrderDimensions[3]; |
| 128 |
uint64_t uiPrivateSize; |
| 129 |
uint32_t uiSlmSize; |
| 130 |
bool bRequireDisableEufusion; |
| 131 |
bool bHasDPAS; |
| 132 |
uint32_t uiRequiredWorkGroupSize[3]; |
| 133 |
}; |
| 134 |
|
| 135 |
struct KRN_PER_THREAD_ARG_INFO |
| 136 |
{ |
| 137 |
uint32_t packedLocalIdOffset = 0; |
| 138 |
uint32_t packedLocalIdSize = 0; |
| 139 |
uint32_t localIdOffset = 0; |
| 140 |
uint32_t localIdSize = 0; |
| 141 |
}; |
| 142 |
|
| 143 |
using SurfaceIndex = uint32_t; |
| 144 |
using SamplerIndex = uint32_t; |
| 145 |
using KernelIndex = uint32_t; |
| 146 |
|
| 147 |
typedef struct MOS_ALIGNED(16) _SURFACE_PARAMS |
| 148 |
{ |
| 149 |
SurfaceType surfType; |
| 150 |
bool isOutput; |
| 151 |
bool needVerticalStirde; |
| 152 |
bool combineChannelY; |
| 153 |
uint32_t planeIndex; |
| 154 |
bool usePackedPlanar; |
| 155 |
} SURFACE_PARAMS, *PSURFACE_PARAMS; |
| 156 |
using KERNEL_ARG_INDEX_SURFACE_MAP = std::map<uint32_t, SURFACE_PARAMS>; |
| 157 |
|
| 158 |
enum KERNEL_SUBMISSION_MODE |
| 159 |
{ |
| 160 |
SINGLE_KERNEL_ONLY = 0, |
| 161 |
MULTI_KERNELS_SINGLE_MEDIA_STATE, |
| 162 |
}; |
| 163 |
|
| 164 |
typedef struct _VP_RENDER_CACHE_CNTL |
| 165 |
{ |
| 166 |
|
| 167 |
bool bDnDi; |
| 168 |
bool bLace; |
| 169 |
bool bCompositing; |
| 170 |
bool bHdr; |
| 171 |
|
| 172 |
|
| 173 |
VPHAL_DNDI_CACHE_CNTL DnDi; |
| 174 |
VPHAL_LACE_CACHE_CNTL Lace; |
| 175 |
VPHAL_COMPOSITE_CACHE_CNTL Composite; |
| 176 |
VPHAL_HDR_CACHE_CNTL Hdr; |
| 177 |
} VP_RENDER_CACHE_CNTL, *PVP_RENDER_CACHE_CNTL; |
| 178 |
|
| 179 |
} |
| 180 |
#endif |