NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access Release
nvrm_stream.h File Reference

Go to the source code of this file.

Data Structures

struct  NvRmStreamRec
 An exposed (not opaque) structure for a stream. More...
 
struct  NvRmStreamInitParamsRec
 An exposed, non-opaque structure describing parameters that can be overridden when initializing an NvRmStream during a call to NvRmStreamInitParamsEx. More...
 

Macros

#define NVRM_CMDBUF_GRANULARITY   (8*1024)
 The minimum granularity for cmdBufSize in NvRmStreamInitParams. More...
 
#define NVRM_CMDBUF_SIZE_MIN   (48*1024)
 The minimum size for cmdBufSize. More...
 
#define NVRM_SUPPORT_CHECKSUM   0
 
#define NVRM_CALCULATE_CHECKSUM(FinalChecksum, NewValue)   {}
 
#define NVRM_CH_OPCODE_ACQUIRE_MUTEX(MutexId)
 The various channel opcodes. More...
 
#define NVRM_CH_OPCODE_RELEASE_MUTEX(MutexId)
 
#define NVRM_CH_OPCODE_SET_CLASS(ClassId, Offset, Mask)
 
#define NVRM_CH_OPCODE_INCR(Addr, Count)
 
#define NVRM_CH_OPCODE_NONINCR(Addr, Count)
 
#define NVRM_CH_OPCODE_IMM(Addr, Value)
 
#define NVRM_CH_OPCODE_MASK(Addr, Mask)
 
#define NVRM_STREAM_BEGIN(pStream, pCurrentArg, Words)   do { pCurrentArg = NvRmStreamBegin(pStream, Words, 0, 0, 0); } while (0)
 
#define NVRM_STREAM_BEGIN_WAIT(pStream, pCurrentArg, Words, Waits)   do { pCurrentArg = NvRmStreamBegin(pStream, Words, Waits, 0, 0); } while (0)
 
#define NVRM_STREAM_BEGIN_RELOC_GATHER(pStream, pCurrentArg, Words, Relocs, Gathers)
 
#define NVRM_STREAM_BEGIN_RELOC_GATHER_WAIT(pStream, pCurrentArg, Words, Relocs, Gathers, Waits)
 
#define NVRM_STREAM_END(pStream, pCurrentArg)   do { NvRmStreamEnd(pStream, pCurrentArg); } while (0)
 
#define NVRM_STREAM_PUSH_U(pStream, u1)
 
#define NVRM_STREAM_PUSH_FALCON_METHOD_RELOC_SHIFT_T(pStream, pCurrentArg, Method, hMemArg, OffsetArg, ShiftArg, TypeArg)
 XXX Does writing 0xDEADBEEF to the skipped location help or hurt performance? (Does the answer to this question vary from platform to platform and from command buffer memory type to memory type?) If it hurts, perhaps we should only write this in debug builds, and just skip the slot in release builds? More...
 
#define NVRM_STREAM_PUSH_FALCON_METHOD_RELOC_SHIFT(pStream, pCurrentArg, Method, hMemArg, OffsetArg, ShiftArg)
 
#define NVRM_STREAM_PUSH_FALCON_METHOD(pStream, pCurrentArg, Method0, Method1)
 
#define NVRM_STREAM_PUSH_RELOC_SHIFT(pStream, pCurrentArg, hMemArg, OffsetArg, ShiftArg)
 NVRM_STREAM_PUSH_RELOC_SHIFT NVRM_STREAM_PUSH_RELOC. More...
 
#define NVRM_STREAM_PUSH_RELOC(pStream, pCurrentArg, hMemArg, OffsetArg)   NVRM_STREAM_PUSH_RELOC_SHIFT(pStream, pCurrentArg, hMemArg, OffsetArg, 0)
 
#define NVRM_STREAM_PUSH_RELOC_SHIFT_T(pStream, pCurrentArg, hMemArg, OffsetArg, ShiftArg, TypeArg)
 NVRM_STREAM_PUSH_RELOC_SHIFT_T NVRM_STREAM_PUSH_RELOC_T. More...
 
#define NVRM_STREAM_PUSH_RELOC_T(pStream, pCurrentArg, hMemArg, OffsetArg, TypeArg)   NVRM_STREAM_PUSH_RELOC_SHIFT_T(pStream, pCurrentArg, hMemArg, OffsetArg, 0, TypeArg)
 
#define NVRM_STREAM_PUSH_GATHER(pStream, pCurrentArg, hMemArg, OffsetArg, WordsArg)
 
#define NVRM_STREAM_PUSH_FD_RELOC_SHIFT(pStream, pCurrentArg, fd, OffsetArg, ShiftArg)
 
#define NVRM_STREAM_PUSH_FD_RELOC(pStream, pCurrentArg, fd, OffsetArg)   NVRM_STREAM_PUSH_FD_RELOC_SHIFT(pStream, pCurrentArg, fd, OffsetArg, 0)
 
#define NVRM_STREAM_PUSH_FD_GATHER(pStream, pCurrentArg, fd, OffsetArg, WordsArg)
 
#define NVRM_STREAM_PUSH_SETCLASS(pStream, pCurrentArg, ModuleArg, ClassArg)
 
#define NVRM_STREAM_PUSH_INCR(pStream, pCurrentArg, SyncPointArg, RegArg, CondArg, StreamArg)
 
#define NVRM_STREAM_PUSH_WAIT(pStream, pCurrentArg, FenceArg)
 
#define NVRM_MUTEX_INVALID   ((NvU32)-1)
 Invalid Module Mutex ID. More...
 
#define NVCONFIG_NVRMSTREAMINITEX_SUPPORTED
 

Typedefs

typedef struct NvRmStreamRec NvRmStream
 An exposed (not opaque) structure for a stream. More...
 
typedef struct NvRmStreamInitParamsRec NvRmStreamInitParams
 An exposed, non-opaque structure describing parameters that can be overridden when initializing an NvRmStream during a call to NvRmStreamInitParamsEx. More...
 

Enumerations

enum  { NVRM_STREAM_RELOCATION_TABLE_SIZE = 256 }
 Maximum number of relocations per command buffer. More...
 
enum  { NVRM_STREAM_GATHER_TABLE_SIZE = 16 }
 Maximum number of gathers per command buffer. More...
 
enum  NvRmStreamFlag { NvRmStreamFlag_Invalid = (1 << 0) }
 Valid flags for NvRmStream structure. More...
 
enum  { NVRM_STREAM_BEGIN_MAX_WORDS = 4096 }
 The maximum number of words you can ask a stream for in one shot. More...
 
enum  NvRmStreamRelocTypeRec {
  NvRmStreamRelocType_Default,
  NvRmStreamRelocType_Pitch,
  NvRmStreamRelocType_Blocklinear
}
 Supported Reloc types. More...
 

Functions

void NvRmStreamInitParamsSetDefaults (NvRmStreamInitParams *pInitParams)
 Sets the specified initialization parameters to default values. More...
 
NvError NvRmStreamInitEx (NvRmDeviceHandle hDevice, NvRmChannelHandle hChannel, const NvRmStreamInitParams *pInitParams, NvRmStream *pStream)
 This api is to initialize a stream struct. More...
 
NvError NvRmStreamInit (NvRmDeviceHandle hDevice, NvRmChannelHandle hChannel, NvRmStream *pStream)
 Initializes a stream struct. More...
 
NvData32 * NvRmStreamBegin (NvRmStream *pStream, NvU32 words, NvU32 waits, NvU32 relocs, NvU32 gathers)
 Begin a new stream. More...
 
void NvRmStreamEnd (NvRmStream *pStream, NvData32 *pCurrent)
 End a stream. More...
 
NvError NvRmStreamPush (NvRmStream *pStream, NvU32 word)
 
NvData32 * NvRmStreamPushReloc (NvRmStream *pStream, NvData32 *pCurrent, NvRmMemHandle hMem, NvU32 Offset, NvU32 RelocShift)
 Push a relocation to stream. More...
 
NvData32 * NvRmStreamPushRelocType (NvRmStream *pStream, NvData32 *pCurrent, NvRmMemHandle hMem, NvU32 Offset, NvU32 RelocShift, NvU32 RelocType)
 Push a relocation to stream. More...
 
NvData32 * NvRmStreamPushFdReloc (NvRmStream *pStream, NvData32 *pCurrent, int fd, NvU32 Offset, NvU32 RelocShift)
 Push a relocation to stream. More...
 
NvData32 * NvRmStreamPushGather (NvRmStream *pStream, NvData32 *pCurrent, NvRmMemHandle hMem, NvU32 Offset, NvU32 Words)
 Push a gather to stream. More...
 
NvData32 * NvRmStreamPushFdGather (NvRmStream *pStream, NvData32 *pCurrent, int fd, NvU32 Offset, NvU32 Words)
 Push a gather to stream. More...
 
NvData32 * NvRmStreamPushSetClass (NvRmStream *pStream, NvData32 *pCurrent, NvRmModuleID moduleId, NvU32 classId)
 Push a setclass. More...
 
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. More...
 
NvData32 * NvRmStreamPushFalconMethodReloc (NvRmStream *pStream, NvData32 *pCurrent, NvU32 Method, NvRmMemHandle hMem, NvU32 Offset, NvU32 RelocShift)
 Push operations to write into Falcon METHOD0 and METHOD1 registers. More...
 
NvData32 * NvRmStreamPushFalconMethod (NvRmStream *pStream, NvData32 *pCurrent, NvU32 Method0, NvU32 Method1)
 Push operations to write into Falcon METHOD0 and METHOD1 registers. More...
 
NvData32 * NvRmStreamPushIncr (NvRmStream *pStream, NvData32 *pCurrent, NvU32 syncPointId, NvU32 reg, NvU32 cond, NvBool streamSyncPoint)
 Push a sync point increment to stream. More...
 
void NvRmStreamPushCpuIncr (NvRmStream *pStream, NvU32 SyncPointID)
 Mark a kernel managed syncpoint as used. More...
 
NvData32 * NvRmStreamPushWait (NvRmStream *pStream, NvData32 *pCurrent, NvRmFence fence)
 Push a host wait to stream. More...
 
NvData32 * NvRmStreamPushWaits (NvRmStream *pStream, NvData32 *pCurrent, NvU32 numFences, NvRmFence *fences)
 Push a host wait to stream. More...
 
void NvRmStreamSetFenceFd (NvRmStream *pStream, int fence_fd)
 Add a host wait for the fence fd at the current point in the stream. More...
 
NvError NvRmStreamSetWaitSync (NvRmStream *pStream, const struct NvRmSyncRec *pSync)
 Add a host wait for the given NvRmSync at the current point in the stream. More...
 
void NvRmStreamFree (NvRmStream *pStream)
 Frees the resources associated with a stream struct. More...
 
NvError NvRmStreamGetError (NvRmStream *pStream)
 NvRmStreamGetError returns the value of the stream ErrorFlag. More...
 
void NvRmStreamSetError (NvRmStream *pStream, NvError err)
 NvRmStreamSetError updates ErrorFlag if ErrorFlag is NvSuccess. More...
 
void NvRmStreamFlush (NvRmStream *pStream, NvRmFence *pFence)
 Flushes a stream so that all commands previously inserted are guaranteed to reach the hardware in finite time. More...
 
int NvRmStreamFlushFenceFd (NvRmStream *pStream, const char *name)
 Same as NvRmStreamFlush, but returns a sync fd. More...
 
NvError NvRmStreamFlushSync (NvRmStream *pStream, struct NvRmSyncRec **pSync)
 Same as NvRmStreamFlush, but returns a NvRmSync. More...
 

Macro Definition Documentation

◆ NVCONFIG_NVRMSTREAMINITEX_SUPPORTED

#define NVCONFIG_NVRMSTREAMINITEX_SUPPORTED

Definition at line 384 of file nvrm_stream.h.

◆ NVRM_CALCULATE_CHECKSUM

#define NVRM_CALCULATE_CHECKSUM (   FinalChecksum,
  NewValue 
)    {}

Definition at line 202 of file nvrm_stream.h.

◆ NVRM_CH_OPCODE_ACQUIRE_MUTEX

#define NVRM_CH_OPCODE_ACQUIRE_MUTEX (   MutexId)
Value:
/* mutex ops are extended opcodes: ex-op, op, mutex id \
* aquire op is 0. \
*/ \
((14UL << 28) | (MutexId) )

The various channel opcodes.

Note that we do not provide the Gather or Restart opcodes – drivers are not allowed to use these opcodes.

Definition at line 209 of file nvrm_stream.h.

◆ NVRM_CH_OPCODE_IMM

#define NVRM_CH_OPCODE_IMM (   Addr,
  Value 
)
Value:
/* op, addr, count */ \
(((NvU32)4 << 28) | ((Addr) << 16) | (Value))

Definition at line 224 of file nvrm_stream.h.

◆ NVRM_CH_OPCODE_INCR

#define NVRM_CH_OPCODE_INCR (   Addr,
  Count 
)
Value:
/* op, addr, count */ \
(((NvU32)1 << 28) | ((Addr) << 16) | (Count))

Definition at line 218 of file nvrm_stream.h.

◆ NVRM_CH_OPCODE_MASK

#define NVRM_CH_OPCODE_MASK (   Addr,
  Mask 
)
Value:
/* op, addr, count */ \
(((NvU32)3 << 28) | ((Addr) << 16) | (Mask))

Definition at line 227 of file nvrm_stream.h.

◆ NVRM_CH_OPCODE_NONINCR

#define NVRM_CH_OPCODE_NONINCR (   Addr,
  Count 
)
Value:
/* op, addr, count */ \
(((NvU32)2 << 28) | ((Addr) << 16) | (Count))

Definition at line 221 of file nvrm_stream.h.

◆ NVRM_CH_OPCODE_RELEASE_MUTEX

#define NVRM_CH_OPCODE_RELEASE_MUTEX (   MutexId)
Value:
/* ex-op, op, mutex id */ \
((14UL << 28) | (1 << 24) | (MutexId) )

Definition at line 212 of file nvrm_stream.h.

◆ NVRM_CH_OPCODE_SET_CLASS

#define NVRM_CH_OPCODE_SET_CLASS (   ClassId,
  Offset,
  Mask 
)
Value:
/* op, offset, classid, mask \
* setclass opcode is 0 \
*/ \
(((NvU32)0 << 28) | ((Offset) << 16) | ((ClassId) << 6) | (Mask))

Definition at line 215 of file nvrm_stream.h.

◆ NVRM_CMDBUF_GRANULARITY

#define NVRM_CMDBUF_GRANULARITY   (8*1024)

The minimum granularity for cmdBufSize in NvRmStreamInitParams.

Definition at line 189 of file nvrm_stream.h.

◆ NVRM_CMDBUF_SIZE_MIN

#define NVRM_CMDBUF_SIZE_MIN   (48*1024)

The minimum size for cmdBufSize.

Definition at line 194 of file nvrm_stream.h.

◆ NVRM_MUTEX_INVALID

#define NVRM_MUTEX_INVALID   ((NvU32)-1)

Invalid Module Mutex ID.

Definition at line 361 of file nvrm_stream.h.

◆ NVRM_STREAM_BEGIN

#define NVRM_STREAM_BEGIN (   pStream,
  pCurrentArg,
  Words 
)    do { pCurrentArg = NvRmStreamBegin(pStream, Words, 0, 0, 0); } while (0)

Definition at line 236 of file nvrm_stream.h.

◆ NVRM_STREAM_BEGIN_RELOC_GATHER

#define NVRM_STREAM_BEGIN_RELOC_GATHER (   pStream,
  pCurrentArg,
  Words,
  Relocs,
  Gathers 
)
Value:
do { \
pCurrentArg = NvRmStreamBegin(pStream, Words, 0, Relocs, Gathers); \
} while (0)

Definition at line 242 of file nvrm_stream.h.

◆ NVRM_STREAM_BEGIN_RELOC_GATHER_WAIT

#define NVRM_STREAM_BEGIN_RELOC_GATHER_WAIT (   pStream,
  pCurrentArg,
  Words,
  Relocs,
  Gathers,
  Waits 
)
Value:
do { \
pCurrentArg = NvRmStreamBegin(pStream, Words, Waits, Relocs, Gathers); \
} while (0)

Definition at line 247 of file nvrm_stream.h.

◆ NVRM_STREAM_BEGIN_WAIT

#define NVRM_STREAM_BEGIN_WAIT (   pStream,
  pCurrentArg,
  Words,
  Waits 
)    do { pCurrentArg = NvRmStreamBegin(pStream, Words, Waits, 0, 0); } while (0)

Definition at line 239 of file nvrm_stream.h.

◆ NVRM_STREAM_END

#define NVRM_STREAM_END (   pStream,
  pCurrentArg 
)    do { NvRmStreamEnd(pStream, pCurrentArg); } while (0)

Definition at line 252 of file nvrm_stream.h.

◆ NVRM_STREAM_PUSH_FALCON_METHOD

#define NVRM_STREAM_PUSH_FALCON_METHOD (   pStream,
  pCurrentArg,
  Method0,
  Method1 
)
Value:
do { \
pCurrentArg = NvRmStreamPushFalconMethod((pStream), (pCurrentArg), \
(Method0), (Method1)); \
} while (0)

Definition at line 280 of file nvrm_stream.h.

◆ NVRM_STREAM_PUSH_FALCON_METHOD_RELOC_SHIFT

#define NVRM_STREAM_PUSH_FALCON_METHOD_RELOC_SHIFT (   pStream,
  pCurrentArg,
  Method,
  hMemArg,
  OffsetArg,
  ShiftArg 
)
Value:
do { \
pCurrentArg = NvRmStreamPushFalconMethodReloc((pStream), \
(pCurrentArg), (Method), (hMemArg), (OffsetArg), (ShiftArg)); \
} while (0)

Definition at line 274 of file nvrm_stream.h.

◆ NVRM_STREAM_PUSH_FALCON_METHOD_RELOC_SHIFT_T

#define NVRM_STREAM_PUSH_FALCON_METHOD_RELOC_SHIFT_T (   pStream,
  pCurrentArg,
  Method,
  hMemArg,
  OffsetArg,
  ShiftArg,
  TypeArg 
)
Value:
do { \
pCurrentArg = NvRmStreamPushFalconMethodRelocType((pStream), \
(pCurrentArg), (Method), (hMemArg), (OffsetArg), (ShiftArg), (TypeArg)); \
} while (0)

XXX Does writing 0xDEADBEEF to the skipped location help or hurt performance? (Does the answer to this question vary from platform to platform and from command buffer memory type to memory type?) If it hurts, perhaps we should only write this in debug builds, and just skip the slot in release builds?

Definition at line 268 of file nvrm_stream.h.

◆ NVRM_STREAM_PUSH_FD_GATHER

#define NVRM_STREAM_PUSH_FD_GATHER (   pStream,
  pCurrentArg,
  fd,
  OffsetArg,
  WordsArg 
)
Value:
do { \
pCurrentArg = NvRmStreamPushFdGather((pStream), (pCurrentArg), \
(fd), (OffsetArg), (WordsArg)); \
} while (0)

Definition at line 333 of file nvrm_stream.h.

◆ NVRM_STREAM_PUSH_FD_RELOC

#define NVRM_STREAM_PUSH_FD_RELOC (   pStream,
  pCurrentArg,
  fd,
  OffsetArg 
)    NVRM_STREAM_PUSH_FD_RELOC_SHIFT(pStream, pCurrentArg, fd, OffsetArg, 0)

Definition at line 330 of file nvrm_stream.h.

◆ NVRM_STREAM_PUSH_FD_RELOC_SHIFT

#define NVRM_STREAM_PUSH_FD_RELOC_SHIFT (   pStream,
  pCurrentArg,
  fd,
  OffsetArg,
  ShiftArg 
)
Value:
do { \
pCurrentArg = NvRmStreamPushFdReloc((pStream), (pCurrentArg), \
(fd), (OffsetArg), (ShiftArg)); \
} while (0)

Definition at line 324 of file nvrm_stream.h.

◆ NVRM_STREAM_PUSH_GATHER

#define NVRM_STREAM_PUSH_GATHER (   pStream,
  pCurrentArg,
  hMemArg,
  OffsetArg,
  WordsArg 
)
Value:
do { \
pCurrentArg = NvRmStreamPushGather((pStream), (pCurrentArg), \
(hMemArg), (OffsetArg), (WordsArg)); \
} while (0)

Definition at line 318 of file nvrm_stream.h.

◆ NVRM_STREAM_PUSH_INCR

#define NVRM_STREAM_PUSH_INCR (   pStream,
  pCurrentArg,
  SyncPointArg,
  RegArg,
  CondArg,
  StreamArg 
)
Value:
do { \
pCurrentArg = NvRmStreamPushIncr((pStream), (pCurrentArg), \
(SyncPointArg), (RegArg), (CondArg), (StreamArg)); \
} while (0)

Definition at line 345 of file nvrm_stream.h.

◆ NVRM_STREAM_PUSH_RELOC

#define NVRM_STREAM_PUSH_RELOC (   pStream,
  pCurrentArg,
  hMemArg,
  OffsetArg 
)    NVRM_STREAM_PUSH_RELOC_SHIFT(pStream, pCurrentArg, hMemArg, OffsetArg, 0)

Definition at line 299 of file nvrm_stream.h.

◆ NVRM_STREAM_PUSH_RELOC_SHIFT

#define NVRM_STREAM_PUSH_RELOC_SHIFT (   pStream,
  pCurrentArg,
  hMemArg,
  OffsetArg,
  ShiftArg 
)
Value:
do { \
pCurrentArg = NvRmStreamPushReloc((pStream), (pCurrentArg), \
(hMemArg), (OffsetArg), (ShiftArg)); \
} while (0)

NVRM_STREAM_PUSH_RELOC_SHIFT NVRM_STREAM_PUSH_RELOC.

APIs to push a relocation to the stream By default, reloc type is added as NvRmStreamRelocType_Default

Definition at line 293 of file nvrm_stream.h.

◆ NVRM_STREAM_PUSH_RELOC_SHIFT_T

#define NVRM_STREAM_PUSH_RELOC_SHIFT_T (   pStream,
  pCurrentArg,
  hMemArg,
  OffsetArg,
  ShiftArg,
  TypeArg 
)
Value:
do { \
pCurrentArg = NvRmStreamPushRelocType((pStream), (pCurrentArg), \
(hMemArg), (OffsetArg), (ShiftArg), (TypeArg)); \
} while (0)

NVRM_STREAM_PUSH_RELOC_SHIFT_T NVRM_STREAM_PUSH_RELOC_T.

Use these APIs when type of reloc (of type NvRmStreamRelocTypeRec) is known explicitly

Definition at line 309 of file nvrm_stream.h.

◆ NVRM_STREAM_PUSH_RELOC_T

#define NVRM_STREAM_PUSH_RELOC_T (   pStream,
  pCurrentArg,
  hMemArg,
  OffsetArg,
  TypeArg 
)    NVRM_STREAM_PUSH_RELOC_SHIFT_T(pStream, pCurrentArg, hMemArg, OffsetArg, 0, TypeArg)

Definition at line 315 of file nvrm_stream.h.

◆ NVRM_STREAM_PUSH_SETCLASS

#define NVRM_STREAM_PUSH_SETCLASS (   pStream,
  pCurrentArg,
  ModuleArg,
  ClassArg 
)
Value:
do { \
pCurrentArg = NvRmStreamPushSetClass((pStream), (pCurrentArg), \
(ModuleArg), (ClassArg)); \
} while (0)

Definition at line 339 of file nvrm_stream.h.

◆ NVRM_STREAM_PUSH_U

#define NVRM_STREAM_PUSH_U (   pStream,
  u1 
)
Value:
do { \
NvRmStream *s = (NvRmStream *)(pStream); \
(void) NvRmStreamPush(s, (u1)); \
} while (NV_FALSE)

Definition at line 255 of file nvrm_stream.h.

◆ NVRM_STREAM_PUSH_WAIT

#define NVRM_STREAM_PUSH_WAIT (   pStream,
  pCurrentArg,
  FenceArg 
)
Value:
do { \
pCurrentArg = NvRmStreamPushWait((pStream), \
(pCurrentArg), (FenceArg)); \
} while (0)

Definition at line 351 of file nvrm_stream.h.

◆ NVRM_SUPPORT_CHECKSUM

#define NVRM_SUPPORT_CHECKSUM   0

Definition at line 196 of file nvrm_stream.h.

Typedef Documentation

◆ NvRmStream

typedef struct NvRmStreamRec NvRmStream

An exposed (not opaque) structure for a stream.

◆ NvRmStreamInitParams

An exposed, non-opaque structure describing parameters that can be overridden when initializing an NvRmStream during a call to NvRmStreamInitParamsEx.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Maximum number of relocations per command buffer.

Enumerator
NVRM_STREAM_RELOCATION_TABLE_SIZE 

Definition at line 29 of file nvrm_stream.h.

◆ anonymous enum

anonymous enum

Maximum number of gathers per command buffer.

Enumerator
NVRM_STREAM_GATHER_TABLE_SIZE 

Definition at line 34 of file nvrm_stream.h.

◆ anonymous enum

anonymous enum

The maximum number of words you can ask a stream for in one shot.

Enumerator
NVRM_STREAM_BEGIN_MAX_WORDS 

Definition at line 234 of file nvrm_stream.h.

◆ NvRmStreamFlag

Valid flags for NvRmStream structure.

(None)

Enumerator
NvRmStreamFlag_Invalid 

Definition at line 39 of file nvrm_stream.h.

◆ NvRmStreamRelocTypeRec

Supported Reloc types.

Pitch linear and Block linear refer to the layout of surfaces behind the relocs.

Default is used for relocs that do not refer to graphics surfaces

Enumerator
NvRmStreamRelocType_Default 
NvRmStreamRelocType_Pitch 
NvRmStreamRelocType_Blocklinear 

Definition at line 370 of file nvrm_stream.h.

Function Documentation

◆ NvRmStreamBegin()

NvData32* NvRmStreamBegin ( NvRmStream *  pStream,
NvU32  words,
NvU32  waits,
NvU32  relocs,
NvU32  gathers 
)

Begin a new stream.

Caveat: If pStream already contains a stream, it is copied to command buffer.

Requirement Id:

Sync/Async: Sync

Reentrancy: Reentrant

Parameters
[in]pStreamPointer to stream. Range: Needs to be a valid pointer
[in]wordsNumber of words to push Range: Any valid 32bit number
[in]waitsNumber of wait checks to push Range: Any valid 32bit number
[in]relocsNumber of relocations to push Range: Any valid 32bit number
[in]gathersNumber of gathers Range: Any valid 32bit number
Returns
New stream cursor

◆ NvRmStreamEnd()

void NvRmStreamEnd ( NvRmStream *  pStream,
NvData32 *  pCurrent 
)

End a stream.

Caveat: None

Requirement Id:

Sync/Async: Sync

Reentrancy: Reentrant

Parameters
[in]pStreamPointer to stream Range: Needs to be a valid pointer
[in]pCurrentThe cursor Range: Must be a valid pointer
Returns
None

◆ NvRmStreamFlush()

void NvRmStreamFlush ( NvRmStream *  pStream,
NvRmFence *  pFence 
)

Flushes a stream so that all commands previously inserted are guaranteed to reach the hardware in finite time.

This function sets pStream->SyncPointsUsed to 0 A fence may be given to allow callers to block until the flushed commands have finished via NvRmChannelSyncPointWait(). A null fence parameter is permitted, if you're not interested in knowing when the commands have completed.

Caveat: This must not be called between a NVRM_STREAM_BEGIN/NVRM_STREAM_END pair(debug builds will assert if this happens). The NVRM_STREAM_BEGIN() macros may indirectly call this function (through NvRmStreamGetSpace).

Requirement Id:

Sync/Async: Sync

Reentrancy: Reentrant

Parameters
[in]pStreamThe stream to flush Range: Needs to be a valid pointer
[out]pFenceFence for synchronization Range: Needs to be a valid pointer
Returns
None

◆ NvRmStreamFlushFenceFd()

int NvRmStreamFlushFenceFd ( NvRmStream *  pStream,
const char *  name 
)

Same as NvRmStreamFlush, but returns a sync fd.

Caveat: This is deprecated, use NvRmStreamFlushSync() instead.

Requirement Id:

Sync/Async: Sync

Reentrancy: Reentrant

Parameters
[in]pStreamThe stream to flush Range: Needs to be a valid pointer
[in]nameThe name to be given to fence Range: Not NULL.
Returns
fence fd for synchronization

◆ NvRmStreamFlushSync()

NvError NvRmStreamFlushSync ( NvRmStream *  pStream,
struct NvRmSyncRec **  pSync 
)

Same as NvRmStreamFlush, but returns a NvRmSync.

The NvRmSync objects are sync fd based on OS that support it, syncpoint-based otherwise.

Caveat: None

Requirement Id:

Sync/Async: Sync

Reentrancy: Reentrant

Parameters
[in]pStreamThe stream to flush Range: Needs to be a valid pointer
[out]pSyncSync object for synchronization Range: Needs to be a valid pointer
Returns
NvError_Success or NvError_InsufficientMemory

◆ NvRmStreamFree()

void NvRmStreamFree ( NvRmStream *  pStream)

Frees the resources associated with a stream struct.

Must be called once for each successful NvRmStreamInit(). This API will never fail.

Caveat: Must be called once for each successful NvRmStreamInit(). This API will never fail.

Requirement Id:

Sync/Async: Sync

Reentrancy: Reentrant

Parameters
[in]pStreamThe stream to free the resources for Range: Needs to be a valid pointer
Returns
None

◆ NvRmStreamGetError()

NvError NvRmStreamGetError ( NvRmStream *  pStream)

NvRmStreamGetError returns the value of the stream ErrorFlag.

When an error occurs, the ErrorFlag is set to the appropriate NvError code value. No other errors are recorded until NvRmStreamGetError is called, ErrorFlag is returned, and ErrorFlag is reset to NvSuccess.

Caveat: None

Requirement Id:

Sync/Async: Sync

Reentrancy: Reentrant

Parameters
[in]pStreamThe stream to get the ErrorFlag from Range: Needs to be a valid pointer
Returns
NvSuccess, if there has been no detectable error since the last call to NvRmStreamGetError.

◆ NvRmStreamInit()

NvError NvRmStreamInit ( NvRmDeviceHandle  hDevice,
NvRmChannelHandle  hChannel,
NvRmStream *  pStream 
)

Initializes a stream struct.

This is identical to a call to NvRmStreamInitEx, except that the function will use default NvRmStreamInitParams instead of being specified by the client/caller.

Caveat: It must be called before attempting to use the stream with any other API.

Requirement Id:

Sync/Async: Sync

Reentrancy: Reentrant

Parameters
[in]hDeviceHandle to the resource manager. Range: Needs to be a valid pointer
[in]hChannelHandle to the channel the stream will be used with. Range: Needs to be a valid pointer
pStreamThe stream to initialize. Range: Needs to be a valid pointer
Returns
NvSuccess or NvError_RmStreamInitFailure

◆ NvRmStreamInitEx()

NvError NvRmStreamInitEx ( NvRmDeviceHandle  hDevice,
NvRmChannelHandle  hChannel,
const NvRmStreamInitParams *  pInitParams,
NvRmStream *  pStream 
)

This api is to initialize a stream struct.

Caveat: It must be called before attempting to use the stream with any other API.

Requirement Id:

Sync/Async: Sync

Reentrancy: Reentrant

Parameters
[in]hDeviceHandle to the resource manager. Range: Needs to be a valid pointer
[in]hChannelHandle to the channel the stream will be used with. Range: Needs to be a valid pointer
[in]pInitParamsParameters to pass for stream initialization. Range: Needs to be a valid pointer
[in]pStreamThe stream to initialize. Range: Needs to be a valid pointer
Returns
NvSuccess or error code on failure

◆ NvRmStreamInitParamsSetDefaults()

void NvRmStreamInitParamsSetDefaults ( NvRmStreamInitParams *  pInitParams)

Sets the specified initialization parameters to default values.

Parameters
pInitParamsThe parameters that will be set to default values.

◆ NvRmStreamPush()

NvError NvRmStreamPush ( NvRmStream *  pStream,
NvU32  word 
)

◆ NvRmStreamPushCpuIncr()

void NvRmStreamPushCpuIncr ( NvRmStream *  pStream,
NvU32  SyncPointID 
)

Mark a kernel managed syncpoint as used.

Caveat: None

Requirement Id:

Sync/Async: Sync

Reentrancy: Reentrant

Parameters
[in]pStreamThe stream Range: Needs to be a valid pointer
[in]SyncPointIDThe id of sync point Range: Any valid syncpoint ID.
Returns
None

◆ NvRmStreamPushFalconMethod()

NvData32* NvRmStreamPushFalconMethod ( NvRmStream *  pStream,
NvData32 *  pCurrent,
NvU32  Method0,
NvU32  Method1 
)

Push operations to write into Falcon METHOD0 and METHOD1 registers.

Caveat: Uses 3 words of space in stream.

Requirement Id:

Sync/Async: Sync

Reentrancy: Reentrant

Parameters
[in]pStreamThe stream Range: Needs to be a valid pointer
[in]pCurrentThe cursor Range: Needs to be a valid pointer
[in]Method0The Falcon method Range:
[in]Method1The parameter for the method Range:
Returns
New cursor

◆ NvRmStreamPushFalconMethodReloc()

NvData32* NvRmStreamPushFalconMethodReloc ( NvRmStream *  pStream,
NvData32 *  pCurrent,
NvU32  Method,
NvRmMemHandle  hMem,
NvU32  Offset,
NvU32  RelocShift 
)

Push operations to write into Falcon METHOD0 and METHOD1 registers.

Method 1 content will be the relocation.

Caveat: Uses 3 words of space in stream.

Requirement Id:

Sync/Async: Sync

Reentrancy: Reentrant

Parameters
[in]pStreamThe stream Range: Needs to be a valid pointer
[in]pCurrentThe cursor Range: Needs to be a valid pointer
[in]MethodThe Falcon method Range:
[in]hMemThe target memory handle Range: Needs to be a valid pointer
[in]OffsetThe target memory offset Range: [0, 4095]
[in]RelocShiftHow much to shift the address Range: [0, 31]
Returns
New cursor

◆ NvRmStreamPushFalconMethodRelocType()

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.

Method 1 content will be the relocation of given type

Caveat: Uses 3 words of space in stream.

Requirement Id:

Sync/Async: Sync

Reentrancy: Reentrant

Parameters
[in]pStreamThe stream Range: Needs to be a valid pointer
[in]pCurrentThe cursor Range: Needs to be a valid pointer
[in]MethodThe Falcon method Range:
[in]hMemThe target memory handle Range: Needs to be a valid pointer
[in]OffsetThe target memory offset Range: [0 - 4095]
[in]RelocShiftHow much to shift the address Range: [0, 31]
[in]RelocTypeType of relocation Range: Any value of the NvRmStreamRelocTypeRec enum
Returns
New cursor

◆ NvRmStreamPushFdGather()

NvData32* NvRmStreamPushFdGather ( NvRmStream *  pStream,
NvData32 *  pCurrent,
int  fd,
NvU32  Offset,
NvU32  Words 
)

Push a gather to stream.

Caveat: None

Requirement Id:

Sync/Async: Sync

Reentrancy: Reentrant

Parameters
[in]pStreamThe stream Range: Needs to be a valid pointer
[in]pCurrentThe cursor Range: Needs to be a valid pointer
[in]fdThe dmabuf fd for gather Range: Positive value
[in]OffsetThe target memory offset Range: [0 - 4095]
[in]WordsNumber of words in gather. Range: Any valid 32 bit number
Returns
New cursor

◆ NvRmStreamPushFdReloc()

NvData32* NvRmStreamPushFdReloc ( NvRmStream *  pStream,
NvData32 *  pCurrent,
int  fd,
NvU32  Offset,
NvU32  RelocShift 
)

Push a relocation to stream.

Caveat: None

Requirement Id:

Sync/Async: Sync

Reentrancy: Reentrant

Parameters
[in]pStreamThe stream Range: Needs to be a valid pointer
[in]pCurrentThe cursor Range: Needs to be a valid pointer
[in]fdThe target dmabuf fd Range: Positive value.
[in]OffsetThe target memory offset Range: [0, 4095]
[in]RelocShiftHow much to shift the address Range: [0, 31]
Returns
New cursor

◆ NvRmStreamPushGather()

NvData32* NvRmStreamPushGather ( NvRmStream *  pStream,
NvData32 *  pCurrent,
NvRmMemHandle  hMem,
NvU32  Offset,
NvU32  Words 
)

Push a gather to stream.

Caveat: None

Requirement Id:

Sync/Async: Sync

Reentrancy: Reentrant

Parameters
[in]pStreamThe stream Range: Needs to be a valid pointer
[in]pCurrentThe cursor Range: Needs to be a valid pointer
[in]hMemThe memory handle for gather Range: Needs to be a valid pointer
[in]OffsetThe target memory offset[ Range: [0, 4095]
[in]WordsNumber of words in gather Range: Any valid 32 bit number
Returns
New cursor

◆ NvRmStreamPushIncr()

NvData32* NvRmStreamPushIncr ( NvRmStream *  pStream,
NvData32 *  pCurrent,
NvU32  syncPointId,
NvU32  reg,
NvU32  cond,
NvBool  streamSyncPoint 
)

Push a sync point increment to stream.

Caveat: Uses 2 words of space in stream.

Requirement Id:

Sync/Async: Sync

Reentrancy: Reentrant

Parameters
[in]pStreamThe stream Range: Needs to be a valid pointer
[in]pCurrentThe cursor Range: Needs to be a valid pointer
[in]syncPointIdThe id of sync point Range: Any valid syncpoint ID
[in]regThe register number to use. If unsure, use 0x000 Range:
[in]condThe condition Range:
[in]streamSyncPointTrue if this is a stream sync point Range: NV_TRUE if this is a stream sync point
Returns
New cursor

◆ NvRmStreamPushReloc()

NvData32* NvRmStreamPushReloc ( NvRmStream *  pStream,
NvData32 *  pCurrent,
NvRmMemHandle  hMem,
NvU32  Offset,
NvU32  RelocShift 
)

Push a relocation to stream.

Caveat: None

Requirement Id:

Sync/Async: Sync

Reentrancy: Reentrant

Parameters
[in]pStreamThe stream Range: Needs to be a valid pointer
[in]pCurrentThe cursor Range: Needs to be a valid pointer
[in]hMemThe target memory handle Range: Needs to be a valid pointer
[in]OffsetThe target memory offset Range: [0, 4095]
[in]RelocShiftHow much to shift the address Range: [0, 31]
Returns
New cursor

◆ NvRmStreamPushRelocType()

NvData32* NvRmStreamPushRelocType ( NvRmStream *  pStream,
NvData32 *  pCurrent,
NvRmMemHandle  hMem,
NvU32  Offset,
NvU32  RelocShift,
NvU32  RelocType 
)

Push a relocation to stream.

Caveat: None

Requirement Id:

Sync/Async: Sync

Reentrancy: Reentrant

Parameters
[in]pStreamThe stream Range: Needs to be a valid pointer
[in]pCurrentThe cursor Range: Needs to be a valid pointer
[in]hMemThe target memory handle Range: Needs to be a valid pointer
[in]OffsetThe target memory offset Range: [0, 4095]
[in]RelocShiftHow much to shift the address Range: [0, 31]
[in]RelocTypeType of the relocation Range: Any value of the NvRmStreamRelocTypeRec enum
Returns
New cursor

◆ NvRmStreamPushSetClass()

NvData32* NvRmStreamPushSetClass ( NvRmStream *  pStream,
NvData32 *  pCurrent,
NvRmModuleID  moduleId,
NvU32  classId 
)

Push a setclass.

Will also update LastEngineUsed and LastClassUsed.

Caveat: Uses 1 word of space in stream.

Requirement Id:

Sync/Async: Sync

Reentrancy: Reentrant

Parameters
[in]pStreamThe stream Range: Needs to be a valid pointer
[in]pCurrentThe cursor Range: Needs to be a valid pointer
[in]moduleIdThe id of the module Range: Any valid module ID of the NvRmModuleID enum
[in]classIdThe id of the class Range: Any valid Host1x class ID as documented in the various Host1x IAS's
Returns
New cursor

◆ NvRmStreamPushWait()

NvData32* NvRmStreamPushWait ( NvRmStream *  pStream,
NvData32 *  pCurrent,
NvRmFence  fence 
)

Push a host wait to stream.

If current class is not HOST1X, will send a SETCLASS for HOST1X, invoke wait, and SETCLASS back to the LastClassUsed.

Caveat: Uses 5 words of space in stream.

Requirement Id:

Sync/Async: Sync

Reentrancy: Reentrant

Parameters
[in]pStreamThe stream Range: Needs to be a valid pointer
[in]pCurrentThe cursor Range: Needs to be a valid pointer
[in]fenceThe fence to wait for Range: Must be a valid pointer
Returns
New cursor

◆ NvRmStreamPushWaits()

NvData32* NvRmStreamPushWaits ( NvRmStream *  pStream,
NvData32 *  pCurrent,
NvU32  numFences,
NvRmFence *  fences 
)

Push a host wait to stream.

If current class is not HOST1X, will send a SETCLASS for HOST1X, invoke wait, and SETCLASS back to the LastClassUsed.

Caveat: Uses 2 words of space in stream, plus 3 words for each fence

Requirement Id:

Sync/Async: Sync

Reentrancy: Reentrant

Parameters
[in]pStreamThe stream Range: Needs to be a valid pointer
[in]pCurrentThe cursor Range: Needs to be a valid pointer
[in]NumFencesNumber of fences to wait for Range: Any valid 32bit number
[in]FencesThe fence to wait for Range: Must be a valid pointer
Returns
New cursor

◆ NvRmStreamSetError()

void NvRmStreamSetError ( NvRmStream *  pStream,
NvError  err 
)

NvRmStreamSetError updates ErrorFlag if ErrorFlag is NvSuccess.

Caveat: None

Requirement Id:

Sync/Async: Sync

Reentrancy: Reentrant

Parameters
[in]pStreamThe stream to set the ErrorFlag Range: Needs to be a valid pointer
[in]errError flag to be updated Range: Any valid error flag
Returns
None

◆ NvRmStreamSetFenceFd()

void NvRmStreamSetFenceFd ( NvRmStream *  pStream,
int  fence_fd 
)

Add a host wait for the fence fd at the current point in the stream.

The caller retains ownership of the fence fd. Calling this multiple times will add a wait for each fence.

Caveat: It is illegal to call this within a NVRM_STREAM_BEGIN/NVRM_STREAM_END pair.

This is deprecated, use NvRmStreamSetWaitSync() instead.

Requirement Id:

Sync/Async: Sync

Reentrancy: Reentrant

Parameters
[in]pStreamThe stream Range: Needs to be a valid pointer
[in]fence_fdThe fence to wait for Range: Must be -1.
Returns
New cursor

◆ NvRmStreamSetWaitSync()

NvError NvRmStreamSetWaitSync ( NvRmStream *  pStream,
const struct NvRmSyncRec *  pSync 
)

Add a host wait for the given NvRmSync at the current point in the stream.

The caller retains ownership of the sync object.

Caveat: It is illegal to call this within a NVRM_STREAM_BEGIN/NVRM_STREAM_END pair.

Requirement Id:

Sync/Async: Sync

Reentrancy: Reentrant

Parameters
[in]pStreamThe stream Range: Needs to be a valid pointer
[in]pSyncThe sync object to wait for Range: Needs to be a valid pointer
Returns
NvSuccess or NvError_NotImplemented
NvRmStreamBegin
NvData32 * NvRmStreamBegin(NvRmStream *pStream, NvU32 words, NvU32 waits, NvU32 relocs, NvU32 gathers)
Begin a new stream.
NvRmFenceRec::Value
NvU32 Value
Definition: nvrm_host1x_safe_compat.h:57
NvRmStreamPushReloc
NvData32 * NvRmStreamPushReloc(NvRmStream *pStream, NvData32 *pCurrent, NvRmMemHandle hMem, NvU32 Offset, NvU32 RelocShift)
Push a relocation to stream.
NvRmStreamPushSetClass
NvData32 * NvRmStreamPushSetClass(NvRmStream *pStream, NvData32 *pCurrent, NvRmModuleID moduleId, NvU32 classId)
Push a setclass.
NvRmStreamPushFalconMethodReloc
NvData32 * NvRmStreamPushFalconMethodReloc(NvRmStream *pStream, NvData32 *pCurrent, NvU32 Method, NvRmMemHandle hMem, NvU32 Offset, NvU32 RelocShift)
Push operations to write into Falcon METHOD0 and METHOD1 registers.
NvRmStreamPushRelocType
NvData32 * NvRmStreamPushRelocType(NvRmStream *pStream, NvData32 *pCurrent, NvRmMemHandle hMem, NvU32 Offset, NvU32 RelocShift, NvU32 RelocType)
Push a relocation to stream.
NvRmStreamPushFdReloc
NvData32 * NvRmStreamPushFdReloc(NvRmStream *pStream, NvData32 *pCurrent, int fd, NvU32 Offset, NvU32 RelocShift)
Push a relocation to stream.
NvRmStreamPushWait
NvData32 * NvRmStreamPushWait(NvRmStream *pStream, NvData32 *pCurrent, NvRmFence fence)
Push a host wait to stream.
NvRmStreamRec
An exposed (not opaque) structure for a stream.
Definition: nvrm_stream.h:47
NvRmStreamPush
NvError NvRmStreamPush(NvRmStream *pStream, NvU32 word)
void
typedef void(WFD_APIENTRY PFNWFDBINDSOURCETOPIPELINEWITHTIMESTAMPNV)(const WFDDevice device
NvRmStreamPushFalconMethodRelocType
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.
NvRmStreamPushFdGather
NvData32 * NvRmStreamPushFdGather(NvRmStream *pStream, NvData32 *pCurrent, int fd, NvU32 Offset, NvU32 Words)
Push a gather to stream.
NvRmStreamPushIncr
NvData32 * NvRmStreamPushIncr(NvRmStream *pStream, NvData32 *pCurrent, NvU32 syncPointId, NvU32 reg, NvU32 cond, NvBool streamSyncPoint)
Push a sync point increment to stream.
NvRmStreamPushFalconMethod
NvData32 * NvRmStreamPushFalconMethod(NvRmStream *pStream, NvData32 *pCurrent, NvU32 Method0, NvU32 Method1)
Push operations to write into Falcon METHOD0 and METHOD1 registers.
NvRmStreamPushGather
NvData32 * NvRmStreamPushGather(NvRmStream *pStream, NvData32 *pCurrent, NvRmMemHandle hMem, NvU32 Offset, NvU32 Words)
Push a gather to stream.