|
|
NVIDIA DriveOS Linux SDK API Reference
|
7.2.5.0 Early Access Release
|
Go to the documentation of this file.
12 #ifndef INCLUDED_nvrm_stream_H
13 #define INCLUDED_nvrm_stream_H
22 #if defined(__cplusplus)
189 #define NVRM_CMDBUF_GRANULARITY (8*1024)
194 #define NVRM_CMDBUF_SIZE_MIN (48*1024)
196 #define NVRM_SUPPORT_CHECKSUM 0
198 #if NVRM_SUPPORT_CHECKSUM
199 #define NVRM_CALCULATE_CHECKSUM(FinalChecksum, NewValue) \
200 (FinalChecksum) ^= (NewValue)
202 #define NVRM_CALCULATE_CHECKSUM(FinalChecksum, NewValue) {}
209 #define NVRM_CH_OPCODE_ACQUIRE_MUTEX(MutexId) \
213 ((14UL << 28) | (MutexId) )
214 #define NVRM_CH_OPCODE_RELEASE_MUTEX(MutexId) \
216 ((14UL << 28) | (1 << 24) | (MutexId) )
217 #define NVRM_CH_OPCODE_SET_CLASS(ClassId, Offset, Mask) \
221 (((NvU32)0 << 28) | ((Offset) << 16) | ((ClassId) << 6) | (Mask))
222 #define NVRM_CH_OPCODE_INCR(Addr, Count) \
224 (((NvU32)1 << 28) | ((Addr) << 16) | (Count))
225 #define NVRM_CH_OPCODE_NONINCR(Addr, Count) \
227 (((NvU32)2 << 28) | ((Addr) << 16) | (Count))
228 #define NVRM_CH_OPCODE_IMM(Addr, Value) \
230 (((NvU32)4 << 28) | ((Addr) << 16) | (Value))
231 #define NVRM_CH_OPCODE_MASK(Addr, Mask) \
233 (((NvU32)3 << 28) | ((Addr) << 16) | (Mask))
240 #define NVRM_STREAM_BEGIN(pStream, pCurrentArg, Words) \
241 do { pCurrentArg = NvRmStreamBegin(pStream, Words, 0, 0, 0); } while (0)
243 #define NVRM_STREAM_BEGIN_WAIT(pStream, pCurrentArg, Words, Waits) \
244 do { pCurrentArg = NvRmStreamBegin(pStream, Words, Waits, 0, 0); } while (0)
246 #define NVRM_STREAM_BEGIN_RELOC_GATHER(pStream, pCurrentArg, Words, Relocs, Gathers) \
248 pCurrentArg = NvRmStreamBegin(pStream, Words, 0, Relocs, Gathers); \
251 #define NVRM_STREAM_BEGIN_RELOC_GATHER_WAIT(pStream, pCurrentArg, Words, Relocs, Gathers, Waits) \
253 pCurrentArg = NvRmStreamBegin(pStream, Words, Waits, Relocs, Gathers); \
256 #define NVRM_STREAM_END(pStream, pCurrentArg) \
257 do { NvRmStreamEnd(pStream, pCurrentArg); } while (0)
259 #define NVRM_STREAM_PUSH_U(pStream, u1) \
261 NvRmStream *s = (NvRmStream *)(pStream); \
262 (void) NvRmStreamPush(s, (u1)); \
272 #define NVRM_STREAM_PUSH_FALCON_METHOD_RELOC_SHIFT_T(pStream, pCurrentArg, Method, hMemArg, OffsetArg, ShiftArg, TypeArg) \
274 pCurrentArg = NvRmStreamPushFalconMethodRelocType((pStream), \
275 (pCurrentArg), (Method), (hMemArg), (OffsetArg), (ShiftArg), (TypeArg)); \
278 #define NVRM_STREAM_PUSH_FALCON_METHOD_RELOC_SHIFT(pStream, pCurrentArg, Method, hMemArg, OffsetArg, ShiftArg) \
280 pCurrentArg = NvRmStreamPushFalconMethodReloc((pStream), \
281 (pCurrentArg), (Method), (hMemArg), (OffsetArg), (ShiftArg)); \
284 #define NVRM_STREAM_PUSH_FALCON_METHOD(pStream, pCurrentArg, Method0, Method1) \
286 pCurrentArg = NvRmStreamPushFalconMethod((pStream), (pCurrentArg), \
287 (Method0), (Method1)); \
297 #define NVRM_STREAM_PUSH_RELOC_SHIFT(pStream, pCurrentArg, hMemArg, OffsetArg, ShiftArg) \
299 pCurrentArg = NvRmStreamPushReloc((pStream), (pCurrentArg), \
300 (hMemArg), (OffsetArg), (ShiftArg)); \
303 #define NVRM_STREAM_PUSH_RELOC(pStream, pCurrentArg, hMemArg, OffsetArg) \
304 NVRM_STREAM_PUSH_RELOC_SHIFT(pStream, pCurrentArg, hMemArg, OffsetArg, 0)
313 #define NVRM_STREAM_PUSH_RELOC_SHIFT_T(pStream, pCurrentArg, hMemArg, OffsetArg, ShiftArg, TypeArg) \
315 pCurrentArg = NvRmStreamPushRelocType((pStream), (pCurrentArg), \
316 (hMemArg), (OffsetArg), (ShiftArg), (TypeArg)); \
319 #define NVRM_STREAM_PUSH_RELOC_T(pStream, pCurrentArg, hMemArg, OffsetArg, TypeArg) \
320 NVRM_STREAM_PUSH_RELOC_SHIFT_T(pStream, pCurrentArg, hMemArg, OffsetArg, 0, TypeArg)
322 #define NVRM_STREAM_PUSH_GATHER(pStream, pCurrentArg, hMemArg, OffsetArg, WordsArg) \
324 pCurrentArg = NvRmStreamPushGather((pStream), (pCurrentArg), \
325 (hMemArg), (OffsetArg), (WordsArg)); \
328 #define NVRM_STREAM_PUSH_FD_RELOC_SHIFT(pStream, pCurrentArg, fd, OffsetArg, ShiftArg) \
330 pCurrentArg = NvRmStreamPushFdReloc((pStream), (pCurrentArg), \
331 (fd), (OffsetArg), (ShiftArg)); \
334 #define NVRM_STREAM_PUSH_FD_RELOC(pStream, pCurrentArg, fd, OffsetArg) \
335 NVRM_STREAM_PUSH_FD_RELOC_SHIFT(pStream, pCurrentArg, fd, OffsetArg, 0)
337 #define NVRM_STREAM_PUSH_FD_GATHER(pStream, pCurrentArg, fd, OffsetArg, WordsArg) \
339 pCurrentArg = NvRmStreamPushFdGather((pStream), (pCurrentArg), \
340 (fd), (OffsetArg), (WordsArg)); \
343 #define NVRM_STREAM_PUSH_SETCLASS(pStream, pCurrentArg, ModuleArg, ClassArg) \
345 pCurrentArg = NvRmStreamPushSetClass((pStream), (pCurrentArg), \
346 (ModuleArg), (ClassArg)); \
349 #define NVRM_STREAM_PUSH_INCR(pStream, pCurrentArg, SyncPointArg, RegArg, CondArg, StreamArg) \
351 pCurrentArg = NvRmStreamPushIncr((pStream), (pCurrentArg), \
352 (SyncPointArg), (RegArg), (CondArg), (StreamArg)); \
355 #define NVRM_STREAM_PUSH_WAIT(pStream, pCurrentArg, FenceArg) \
357 pCurrentArg = NvRmStreamPushWait((pStream), \
358 (pCurrentArg), (FenceArg)); \
365 #define NVRM_MUTEX_INVALID ((NvU32)-1)
388 #define NVCONFIG_NVRMSTREAMINITEX_SUPPORTED
820 NvBool streamSyncPoint);
1086 #if defined(__cplusplus)
NvBool UseImmediate
Use Immediate sync pt increments instead of Operation Done to determine when a command buffer is flus...
NvError
The NvError enumeration contains ALL return / error codes.
NvData32 * NvRmStreamBegin(NvRmStream *pStream, NvU32 words, NvU32 waits, NvU32 relocs, NvU32 gathers)
Begin a new stream.
NvError NvRmStreamFlushSync(NvRmStream *pStream, struct NvRmSyncRec **pSync)
Same as NvRmStreamFlush, but returns a NvRmSync.
struct NvRmStreamInitParamsRec NvRmStreamInitParams
An exposed, non-opaque structure describing parameters that can be overridden when initializing an Nv...
NvRmStreamFlag
Valid flags for NvRmStream structure.
NvRmModuleID LastEngineUsed
NvU32 ContextShadowCopySize
@ NVRM_STREAM_GATHER_TABLE_SIZE
An exposed, non-opaque structure describing parameters that can be overridden when initializing an Nv...
struct NvRmStreamRec NvRmStream
An exposed (not opaque) structure for a stream.
@ NvRmStreamRelocType_Pitch
@ NvRmStreamRelocType_Default
NvRmContextHandle hContext
The hardware context, if any, currently being used by this stream.
NvU32 SyncPointsUsed
The SyncPointsUsed field is expected to be incremented by the client whenever the client inserts a sy...
void NvRmStreamFree(NvRmStream *pStream)
Frees the resources associated with a stream struct.
NvData32 * NvRmStreamPushReloc(NvRmStream *pStream, NvData32 *pCurrent, NvRmMemHandle hMem, NvU32 Offset, NvU32 RelocShift)
Push a relocation to stream.
NvData32 * pCurrent
This points to the current location we are writing to.
NvData32 * NvRmStreamPushSetClass(NvRmStream *pStream, NvData32 *pCurrent, NvRmModuleID moduleId, NvU32 classId)
Push a setclass.
NvError NvRmStreamGetError(NvRmStream *pStream)
NvRmStreamGetError returns the value of the stream ErrorFlag.
NvData32 * pBase
pBase points to the base of the command buffer chunk that we are currently filling in.
NvData32 * NvRmStreamPushFalconMethodReloc(NvRmStream *pStream, NvData32 *pCurrent, NvU32 Method, NvRmMemHandle hMem, NvU32 Offset, NvU32 RelocShift)
Push operations to write into Falcon METHOD0 and METHOD1 registers.
void NvRmStreamFlush(NvRmStream *pStream, NvRmFence *pFence)
Flushes a stream so that all commands previously inserted are guaranteed to reach the hardware in fin...
@ NVRM_STREAM_RELOCATION_TABLE_SIZE
NvData32 * NvRmStreamPushRelocType(NvRmStream *pStream, NvData32 *pCurrent, NvRmMemHandle hMem, NvU32 Offset, NvU32 RelocShift, NvU32 RelocType)
Push a relocation to stream.
NvData32 * NvRmStreamPushFdReloc(NvRmStream *pStream, NvData32 *pCurrent, int fd, NvU32 Offset, NvU32 RelocShift)
Push a relocation to stream.
void NvRmStreamEnd(NvRmStream *pStream, NvData32 *pCurrent)
End a stream.
void NvRmStreamSetFenceFd(NvRmStream *pStream, int fence_fd)
Add a host wait for the fence fd at the current point in the stream.
const WFDSource const NvSciSyncFence *const fence
NvError NvRmStreamInitEx(NvRmDeviceHandle hDevice, NvRmChannelHandle hChannel, const NvRmStreamInitParams *pInitParams, NvRmStream *pStream)
This api is to initialize a stream struct.
NvData32 * NvRmStreamPushWait(NvRmStream *pStream, NvData32 *pCurrent, NvRmFence fence)
Push a host wait to stream.
struct NvRmMemRec * NvRmMemHandle
struct NvRmContextRec * NvRmContextHandle
A type-safe handle for a hardware context, for the engines where such a concept is applicable.
An exposed (not opaque) structure for a stream.
void NvRmStreamInitParamsSetDefaults(NvRmStreamInitParams *pInitParams)
Sets the specified initialization parameters to default values.
NvRmModuleID
Defines SOC hardware controller class identifiers.
NVIDIA Driver Development Kit: Resource Manager Module Control APIs
NvBool NullKickoff
The NULL-Kickoff driver for a given stream: all of the "work" is done but the hardware doesn't ever f...
NvBool ClientManaged
Client-managed sync point.
NvError NvRmStreamPush(NvRmStream *pStream, NvU32 word)
typedef void(WFD_APIENTRY PFNWFDBINDSOURCETOPIPELINEWITHTIMESTAMPNV)(const WFDDevice device
NvRmStreamRelocTypeRec
Supported Reloc types.
struct NvRmDeviceRec * NvRmDeviceHandle
void NvRmStreamSetError(NvRmStream *pStream, NvError err)
NvRmStreamSetError updates ErrorFlag if ErrorFlag is NvSuccess.
NvData32 * NvRmStreamPushFalconMethodRelocType(NvRmStream *pStream, NvData32 *pCurrent, NvU32 Method, NvRmMemHandle hMem, NvU32 Offset, NvU32 RelocShift, NvU32 RelocType)
Push operations to write into Falcon METHOD0 and METHOD1 registers.
@ NVRM_STREAM_BEGIN_MAX_WORDS
Union that can be used to view a 32-bit word as your choice of a 32-bit unsigned integer,...
NvU32 * pContextShadowCopy
XXX hContext should be made a transparent structure with a private pointer and a public part.
NvU32 checksumFalconMethods
@ NvRmStreamRelocType_Blocklinear
void(* pSyncPointBaseCallback)(struct NvRmStreamRec *pStream, NvU32 SyncPointBase, NvU32 SyncPointsUsed)
Sync point callback: this callback will inform the client what sync point base it actually ended up g...
NvError ErrorFlag
ErrorFlag keeps first detected NvError code since last NvRmStreamGetError() call.
struct NvRmChannelRec * NvRmChannelHandle
A type-safe handle for a channel.
NvData32 * NvRmStreamPushFdGather(NvRmStream *pStream, NvData32 *pCurrent, int fd, NvU32 Offset, NvU32 Words)
Push a gather to stream.
NvError NvRmStreamInit(NvRmDeviceHandle hDevice, NvRmChannelHandle hChannel, NvRmStream *pStream)
Initializes a stream struct.
NvError NvRmStreamSetWaitSync(NvRmStream *pStream, const struct NvRmSyncRec *pSync)
Add a host wait for the given NvRmSync at the current point in the stream.
NvData32 * NvRmStreamPushIncr(NvRmStream *pStream, NvData32 *pCurrent, NvU32 syncPointId, NvU32 reg, NvU32 cond, NvBool streamSyncPoint)
Push a sync point increment to stream.
int NvRmStreamFlushFenceFd(NvRmStream *pStream, const char *name)
Same as NvRmStreamFlush, but returns a sync fd.
void NvRmStreamPushCpuIncr(NvRmStream *pStream, NvU32 SyncPointID)
Mark a kernel managed syncpoint as used.
void * pClientPriv
Private data member available for use by the client of the API.
void * pRmPriv
Opaque pointer to RM private data associated with this stream.
NvData32 * NvRmStreamPushFalconMethod(NvRmStream *pStream, NvData32 *pCurrent, NvU32 Method0, NvU32 Method1)
Push operations to write into Falcon METHOD0 and METHOD1 registers.
NvData32 * NvRmStreamPushGather(NvRmStream *pStream, NvData32 *pCurrent, NvRmMemHandle hMem, NvU32 Offset, NvU32 Words)
Push a gather to stream.
NvData32 * NvRmStreamPushWaits(NvRmStream *pStream, NvData32 *pCurrent, NvU32 numFences, NvRmFence *fences)
Push a host wait to stream.