NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access Release
nvrm_memmgr.h File Reference

Go to the source code of this file.

Macros

#define NVRM_MEM_UNRESERVE   0
 
#define NVRM_MEM_RESERVE   1
 
#define NVRM_MEM_INSERT_ON_UNRESERVE   2
 
#define NVRM_MEM_ZAP_AND_CLEAN   3
 
#define NVRM_MEM_TRACE   0
 

Functions

NvError NvRmMemHandleFromIVCId (NvU64 Id, NvRmMemHandle *phMem)
 @IgnoreForDoc More...
 
NvError NvRmMemRead (NvRmMemHandle hMem, NvU64 Offset, void *pDst, NvU64 Size)
 @IgnoreForDoc More...
 
NvError NvRmMemWrite (NvRmMemHandle hMem, NvU64 Offset, const void *pSrc, NvU64 Size)
 @IgnoreForDoc More...
 
NvError NvRmMemReadStrided (NvRmMemHandle hMem, NvU64 Offset, NvU64 SrcStride, void *pDst, NvU64 DstStride, NvU64 ElementSize, NvU64 Count)
 @IgnoreForDoc More...
 
NvError NvRmMemWriteStrided (NvRmMemHandle hMem, NvU64 Offset, NvU64 DstStride, const void *pSrc, NvU64 SrcStride, NvU64 ElementSize, NvU64 Count)
 @IgnoreForDoc More...
 
void NvRmMemMove (NvRmMemHandle hDstMem, NvU32 DstOffset, NvRmMemHandle hSrcMem, NvU32 SrcOffset, NvU32 Size)
 @IgnoreForDoc More...
 
NvU8 NvRmMemRd08 (NvRmMemHandle hMem, NvU32 Offset)
 @IgnoreForDoc More...
 
NvU16 NvRmMemRd16 (NvRmMemHandle hMem, NvU32 Offset)
 @IgnoreForDoc More...
 
NvU32 NvRmMemRd32 (NvRmMemHandle hMem, NvU32 Offset)
 @IgnoreForDoc More...
 
NvError NvRmMemWr08 (NvRmMemHandle hMem, NvU32 Offset, NvU8 Data)
 @IgnoreForDoc More...
 
NvError NvRmMemWr16 (NvRmMemHandle hMem, NvU32 Offset, NvU16 Data)
 @IgnoreForDoc More...
 
NvError NvRmMemWr32 (NvRmMemHandle hMem, NvU32 Offset, NvU32 Data)
 @IgnoreForDoc More...
 
void NvRmMemReserve (NvRmMemHandle *hMems, NvU32 *Offsets, NvU32 *Sizes, NvU32 NrHandles, NvU32 Reserved)
 @IgnoreForDoc More...
 
void NvRmMemReserve64 (NvRmMemHandle *hMems, NvU64 *Offsets, NvU64 *Sizes, NvU64 NrHandles, NvU32 Reserve)
 @IgnoreForDoc More...
 
NvU64 NvRmMemGetIVCId (NvRmMemHandle hMem)
 @IgnoreForDoc More...
 
NvError NvRmMemSetVprFloor (NvU32 MaxVprSize)
 @IgnoreForDoc More...
 
int NvRm_MemmgrGetIoctlFile (void)
 @IgnoreForDoc More...
 
NvU64 NvRmMemGetSize (NvRmMemHandle hMem)
 @IgnoreForDoc More...
 
NvError NvRmMemQueryHeapSize (const NvRmHeap *Heap, NvU64 *Size)
 @IgnoreForDoc More...
 
NvError NvRmMemSetAllocationTagLabel (NvRmMemTags tag, const char *label)
 @IgnoreForDoc More...
 
NvError NvRmMemQueryPeerVmId (NvRmMemHandle hMem, NvU64 *PeerVmId)
 @IgnoreForDoc More...
 
NvError NvRmMemCacheListSyncForCpu (NvRmMemHandle *hMems, NvU32 *Offsets, NvU32 *Sizes, NvU32 NumHandles)
 @IgnoreForDoc More...
 
NvError NvRmMemCacheListSyncForDevice (NvRmMemHandle *hMems, NvU32 *Offsets, NvU32 *Sizes, NvU32 NumHandles)
 @IgnoreForDoc More...
 
NvError NvRmMemCacheListSyncForCpu64 (NvRmMemHandle *hMems, NvU64 *Offsets, NvU64 *Sizes, NvU64 NumHandles)
 @IgnoreForDoc More...
 
NvError NvRmMemCacheListSyncForDevice64 (NvRmMemHandle *hMems, NvU64 *Offsets, NvU64 *Sizes, NvU64 NumHandles)
 @IgnoreForDoc More...
 
NvError NvRmMemPutImportId (NvU32 ImportId)
 @IgnoreForDoc More...
 
NvError NvRmMemPutImportIdMult (NvU32 *ImportId, NvU32 NumIds)
 @IgnoreForDoc More...
 
NvError NvRmMemPutSciIpcId (NvU32 SciIpcId)
 @IgnoreForDoc More...
 
NvError NvRmMemPutSciIpcIdMult (NvU32 *SciIpcId, NvU32 NumIds)
 @IgnoreForDoc More...
 
int NvRmMemGetFdForRangeFromList (NvRmMemHandle *hMem, NvU64 offset, NvU64 size, NvU32 num_hMems)
 @IfaceTagForDoc More...
 

Macro Definition Documentation

◆ NVRM_MEM_INSERT_ON_UNRESERVE

#define NVRM_MEM_INSERT_ON_UNRESERVE   2

Definition at line 291 of file nvrm_memmgr.h.

◆ NVRM_MEM_RESERVE

#define NVRM_MEM_RESERVE   1

Definition at line 290 of file nvrm_memmgr.h.

◆ NVRM_MEM_TRACE

#define NVRM_MEM_TRACE   0

Definition at line 785 of file nvrm_memmgr.h.

◆ NVRM_MEM_UNRESERVE

#define NVRM_MEM_UNRESERVE   0

Definition at line 289 of file nvrm_memmgr.h.

◆ NVRM_MEM_ZAP_AND_CLEAN

#define NVRM_MEM_ZAP_AND_CLEAN   3

Definition at line 292 of file nvrm_memmgr.h.

Function Documentation

◆ NvRm_MemmgrGetIoctlFile()

int NvRm_MemmgrGetIoctlFile ( void  )

@IgnoreForDoc

Returns the file descriptor of the nvmap device opened by NvRm when the library is loaded.

Return values
-1Indicates that NvRm failed to open the nvmap device.
Returns
the open file descriptor of the nvmap device.

◆ NvRmMemCacheListSyncForCpu()

NvError NvRmMemCacheListSyncForCpu ( NvRmMemHandle *  hMems,
NvU32 *  Offsets,
NvU32 *  Sizes,
NvU32  NumHandles 
)

@IgnoreForDoc

NvRmMemCacheSyncForCpu for a list of handles.

Description:

This function peform the Cache sync for Cpu operation for list of handles.

Allowed-State: Runtime Sync/Async: Sync Reentrancy: Reentrant

Parameters
[in]hMemslist of memory handles returned from NvRmMemHandleAllocAttr/FromImportId/FromSciIpcId(). Range: Valid pointer to NvRmMemHandle
[in]Offsetslist of Mapping Starting addresses (each address Offsets[i] must be within the mapped region of the hMems[i]) to cache sync Range: Valid pointer to 32 bit unsigned number
[in]Sizeslist of the number of bytes that need data cache sync. Range: Valid pointer to 32 bit unsigned number
[in]NumHandlesnumber of handles in hMems array Range: [0, 2^32-1]
Return values
NvSuccessCache sync operation is successful.
NvError_BadParameter1. Input Parameter "hMems" have invalid handle(s).
  1. Input Parameter "Offsets" has invalid offset(s).
  2. Input Parameter "Sizes" has invalid size(s).

◆ NvRmMemCacheListSyncForCpu64()

NvError NvRmMemCacheListSyncForCpu64 ( NvRmMemHandle *  hMems,
NvU64 *  Offsets,
NvU64 *  Sizes,
NvU64  NumHandles 
)

@IgnoreForDoc

This function peform the Cache sync for Cpu operation for list of handles.

Allowed-State: Runtime Sync/Async: Sync Reentrancy: Reentrant

Parameters
[in]hMemslist of memory handles returned from NvRmMemHandleAllocAttr/FromImprotId/FromSciIpcId() Range: Valid pointer to NvRmMemHandle
[in]Offsetslist of Mapping Starting addresses (each address Offsets[i] must be within the mapped region of the hMems[i]) to cache sync Range: Valid pointer to 64 bit unsigned number
[in]Sizeslist of the number of bytes that need data cache sync. Range: Valid pointer to 64 bit unsigned number
[in]NumHandlesnumber of handles in hMems array Range: [0, 2^64-1]
Return values
NvSuccessCache sync operation is successful.
NvError_BadParameter1. Input Parameter "hMems" have invalid handle(s).
  1. Input Parameter "Offsets" has invalid offset(s).
  2. Input Parameter "Sizes" has invalid size(s).

◆ NvRmMemCacheListSyncForDevice()

NvError NvRmMemCacheListSyncForDevice ( NvRmMemHandle *  hMems,
NvU32 *  Offsets,
NvU32 *  Sizes,
NvU32  NumHandles 
)

@IgnoreForDoc

This function peform the Cache sync for device operation for list of handles.

Allowed-State: Runtime Sync/Async: Sync Reentrancy: Reentrant

Parameters
[in]hMemslist of memory handles returned from NvRmMemHandleAllocAttr/FromImprotId/FromSciIpcId() Range: Valid pointer to NvRmMemHandle
[in]Offsetslist of Mapping Starting addresses (each address Offsets[i] must be within the mapped region of the hMems[i]) to cache sync. Range: Valid pointer to 32 bit unsigned number
[in]Sizeslist of the number of bytes that need data cache sync. Range: Valid pointer to 32 bit unsigned number
[in]NumHandlesnumber of handles in hMems array Range: [0, 2^32-1]
Return values
NvSuccessCache sync operation is successful.
NvError_BadParameter1. Input Parameter "hMems" have invalid handle(s).
  1. Input Parameter "Offsets" has invalid offset(s).
  2. Input Parameter "Sizes" has invalid size(s).

◆ NvRmMemCacheListSyncForDevice64()

NvError NvRmMemCacheListSyncForDevice64 ( NvRmMemHandle *  hMems,
NvU64 *  Offsets,
NvU64 *  Sizes,
NvU64  NumHandles 
)

@IgnoreForDoc

This function peform the Cache sync for device operation for list of handles.

Allowed-State: Runtime Sync/Async: Sync Reentrancy: Reentrant

Parameters
[in]hMemslist of memory handles returned from NvRmMemHandleAllocAttr/FromImprotId/FromSciIpcId() Range: Valid pointer to NvRmMemHandle
[in]Offsetslist of Mapping Starting addresses (each address Offsets[i] must be within the mapped region of the hMems[i]) to cache sync Range: Valid pointer to 64 bit unsigned number
[in]Sizeslist of the number of bytes that need data cache sync. Range: Valid pointer to 64 bit unsigned number
[in]NumHandlesnumber of handles in hMems array Range: [0, 2^64-1]
Return values
NvSuccessCache sync operation is successful.
NvError_BadParameter1. Input Parameter "hMems" have invalid handle(s).
  1. Input Parameter "Offsets" has invalid offset(s).
  2. Input Parameter "Sizes" has invalid size(s).

◆ NvRmMemGetFdForRangeFromList()

int NvRmMemGetFdForRangeFromList ( NvRmMemHandle *  hMem,
NvU64  offset,
NvU64  size,
NvU32  num_hMems 
)

@IfaceTagForDoc

Interface-Description:

Create a file identifier from range within buffers. These buffers are already allocated and represented via NvRmMemHandle, hMem. The file descriptor can be passed to and used from any process/processor to generate a new memory handle. This can be used to share a memory handle between processes, or from AVP and CPU.

Typical usage would be

Sender: NvRmMemGetFdForRangeFromList Sender: Pass File Id to client process/processor through socket(SCM RIGHTS), binder, etc. Sender: Close File Id Receiver: Receive File Id over socket, binder, etc. Receiver: NvRmMemHandleFromFd Receiver: Close File Id

See also
NvRmMemHandleFromFd()

NvRmMemGetFdForRangeFromList increments the reference count of the memory handles. The file id should be closed after its intended usage. The receiver of file id should close the file id as well after creating handle from it using NvRmMemHandleFromFd. Failure to close the file id's would result in memory leaks.

Fd is returned as 'int' to allow file operations(close(int)) on file id outside NvRm. Standard libc takes file id as int.

Allowed-State: Init Sync/Async: Sync Reentrancy: Reentrant Interrupt-Handler: No Signal-Handler: No Thread-Safe: Yes

Parameters
[in]hMemNvRmMemHandle* Desc: Pointer to the list of MemHandles. Range: A valid pointer to NvRmMemHandle
[in]offsetNumber of bytes within a buffer size.
[in]sizeNumber of bytes of the buffer less then buffer size.
[in]num_hMemsNumber of MemHandles.
Return values
Integer(Positive)The file id that identifies the memory handle.
-1If memory services lib not initialized
-EMFILE1. Input parameter "hMem" is NULL
  1. Input parameter "size" is 0
  2. Input parameter "num_hMems" is 0
  3. Ioctl call has failed

◆ NvRmMemGetIVCId()

NvU64 NvRmMemGetIVCId ( NvRmMemHandle  hMem)

@IgnoreForDoc

Create an IVC Id for memory handle.

Parameters
hMemHandle for which IVC ID is needed to be shared with peer Guest OS sharing the memory pool. Handle should be allocated from NvRmHeap_IVC.
Returns
ID on success. 0 if handle is not allocated from NvRmHeap_IVC.

◆ NvRmMemGetSize()

NvU64 NvRmMemGetSize ( NvRmMemHandle  hMem)

@IgnoreForDoc

Get the size of the buffer associated with a memory handle.

Allowed-State: Runtime Sync/Async: Sync Reentrancy: Reentrant

Parameters
[in]hMemA memory handle returned from NvRmMemHandleAllocAttr/FromFd.
Return values
SizeOn Successful Query
NvError_BadParameterInvalid NvRmMemHandle hMem
NvError_NotInitializedlibnvrm_mem has failed to initailize
NvError_IoctlFailedAn unknown error.
NvError_AccessDeniedInput parameter hMem is not accessible.

◆ NvRmMemHandleFromIVCId()

NvError NvRmMemHandleFromIVCId ( NvU64  Id,
NvRmMemHandle *  phMem 
)

@IgnoreForDoc

Create a mem handle from IVC id.

Parameters
idID obtained from another VM (Virtual Machine) partition.
phMemMemory handle that will be created in context of this VM. Once phMem is available, it can be used per existing semantics for sharing between processes in this VM.
Returns
NvSuccess if success. NvError_BadParameter on failure. NvError_NotSupported when functionality is not supported.

◆ NvRmMemMove()

void NvRmMemMove ( NvRmMemHandle  hDstMem,
NvU32  DstOffset,
NvRmMemHandle  hSrcMem,
NvU32  SrcOffset,
NvU32  Size 
)

@IgnoreForDoc

Moves (copies) a block of data to a different (or the same) hMem. This API cannot fail. Overlapping copies are supported.

NOTE: While easy to use, this is NOT the fastest way to copy memory. Using the 2D engine to perform a blit can be much faster than this function.

If hDstMem or hSrcMem refers to an unallocated memory buffer, this function's behavior is undefined and an assert will trigger in a debug build.

Parameters
hDstMemA memory handle returned from NvRmMemHandleAllocAttr/FromFd.
DstOffsetByte offset relative to the base of hMem. May be arbitrarily aligned – need not be a multiple of 2 or 4.
hSrcMemA memory handle returned from NvRmMemHandleAllocAttr/FromFd.
SrcOffsetByte offset relative to the base of hMem. May be arbitrarily aligned – need not be a multiple of 2 or 4.
SizeThe number of bytes of data to be copied from hSrcMem to hDstMem. May be arbitrarily sized – need not be a multiple of 2 or 4.

◆ NvRmMemPutImportId()

NvError NvRmMemPutImportId ( NvU32  ImportId)

@IgnoreForDoc

Covers: [Libnvrm_mem_SWUD_35]

Interface Description:

Release Import Id received either from NvRmMemGetImportId() or from a process that is sharing ImportId.

This API takes care of cleanup necessary after the ImportId is shared Inter-process or Handle is created from ImportId.

Eg. On Linux ImportId is an Fd and this API performs the Fd close.

Multiple handle version of this API(NvRmMemPutImportIdMult) should be used wherever possible to reduce the IPC call overhead.

Description:

The interface covers: [LibNvrm_Mem_004], [LibNvrm_Mem_008], [LibNvrm_Mem_006], [LibNvrm_Mem_005], [LibNvrm_Mem_007], [LibNvrm_Mem_009], [LibNvrm_Mem_013], [LibNvrm_Mem_017], [LibNvrm_Mem_010]

The interface covers [Libnvrm_mem_SWUD_CS_2], [Libnvrm_mem_SWUD_CS_3], [Libnvrm_mem_SWUD_CS_4], [Libnvrm_mem_SWUD_CS_5], [Libnvrm_mem_SWUD_CS_7], [Libnvrm_mem_SWUD_CS_8], [Libnvrm_mem_SWUD_CS_6], [Libnvrm_mem_SWUD_CS_1]

This function simply return success always.

Allowed-State: Init Sync/Async: Sync Reentrancy: Reentrant

Parameters
[in]ImportIdImport Id to be released. Range: [1, 2^32-1]
Return values
NvSuccessRelease of ImportId is successful.
NvError_BadParameterImportId is not valid.
NvError_IoctlFailedDevctl call has failed

◆ NvRmMemPutImportIdMult()

NvError NvRmMemPutImportIdMult ( NvU32 *  ImportId,
NvU32  NumIds 
)

@IgnoreForDoc

Interface Description:

Multiple ImportId version of NvRmMemPutImportId(). Refer to NvRmMemPutImportId() API for usage details.

This function simply return success always.

Allowed-State: Init Sync/Async: Sync Reentrancy: Reentrant

Parameters
[in]ImportIdArray of ImportIds to be released. Range: Valid pointer to ImportId
[in]NumIdsNumber of ImportIds in ImportId Array. Range: [0, 2^32-1]
Return values
NvSuccessRelease of ImportIds is successful.
NvError_BadParameterImportIds are not valid.
NvError_IoctlFailedDevctl call has failed

◆ NvRmMemPutSciIpcId()

NvError NvRmMemPutSciIpcId ( NvU32  SciIpcId)

@IgnoreForDoc

Interface Description:

Release SciIpcId received either from NvRmMemGetSciIpcId() or from a Process/VM/SOC that is sharing SciIpcId.

This API takes care of cleanup necessary after the SciIpcId is shared Inter-process/VM/SOC or Handle is created from received SciIpcId.

Multiple handle version of this API(NvRmMemPutSciIpcIdMult) should be used wherever possible to reduce the IPC call overhead.

This function simply return NvError_Success, always.

Allowed-State: Init Sync/Async: Sync Reentrancy: Reentrant

Parameters
[in]SciIpcIdSciIpc Id to be released. Range: [1, 2^32-1]
Return values
NvSuccessRelease of SciIpcId is successful.
NvError_BadParameterSciIpcId is not valid.
NvError_IoctlFailedDevctl call has failed

◆ NvRmMemPutSciIpcIdMult()

NvError NvRmMemPutSciIpcIdMult ( NvU32 *  SciIpcId,
NvU32  NumIds 
)

@IgnoreForDoc

Interface Description:

Multiple SciIpcId version of NvRmMemPutSciIpcId(). Refer to NvRmMemPutSciIpcId() API for usage details.

This function simply return NvError_Success, always.

Allowed-State: Init Sync/Async: Sync Reentrancy: Reentrant

Parameters
[in]SciIpcIdArray of SciIpcIds to be released. Range: Valid pointer to SciIpcId
[in]NumIdsNumber of SciIpcIds in SciIpcId Array. Range: [0, 2^32-1]
Return values
NvSuccessRelease of SciIpcIds is successful.
NvError_BadParameterSciIpcIds are not valid.
NvError_IoctlFailedDevctl call has failed

◆ NvRmMemQueryHeapSize()

NvError NvRmMemQueryHeapSize ( const NvRmHeap *  Heap,
NvU64 *  Size 
)

@IgnoreForDoc

Query size of specified heap type.

This API returns the size of the specified heap type. Currently, NvRmHeap_IVC type is unsupported. In general, NvRmQueryHeaps() should be called prior to calling this API on a given heap type. This API should be only called if NvRmQueryHeaps returns success.

Parameters
Heaptype for which the size is needed.
pointerto hold the result (size of heap).
Returns
NvSuccess on success.
NvError_NotSupported for unsupported heap types (NvRmHeap_IVC).
NvError_BadParameter for invalid heap type.

◆ NvRmMemQueryPeerVmId()

NvError NvRmMemQueryPeerVmId ( NvRmMemHandle  hMem,
NvU64 *  PeerVmId 
)

@IgnoreForDoc

API to query Peer VM Id of the memory handle.

Allowed-State: Runtime Sync/Async: Sync Reentrancy: Reentrant

Parameters
[in]hMemHandle to query Peer VM ID.
[out]PeerVmIdReceived Peer VM ID.
Return values
NvSuccesson success.
NvError_IoctlFailedDevctl call has failed
NvError_BadParameterfor invalid argument.

◆ NvRmMemRd08()

NvU8 NvRmMemRd08 ( NvRmMemHandle  hMem,
NvU32  Offset 
)

@IgnoreForDoc

Reads 8 bits of data from a buffer. This API never fails.

If hMem refers to an unallocated memory buffer, this function's behavior is undefined and an assert will trigger in a debug build.

Parameters
hMemA memory handle returned from NvRmMemHandleAllocAttr/FromFd.
OffsetByte offset relative to the base of hMem. May be arbitrarily aligned – need not be a multiple of 2 or 4.
Returns
The value read from the memory location.

◆ NvRmMemRd16()

NvU16 NvRmMemRd16 ( NvRmMemHandle  hMem,
NvU32  Offset 
)

@IgnoreForDoc

Reads 16 bits of data from a buffer. This API never fails.

If hMem refers to an unallocated memory buffer, this function's behavior is undefined and an assert will trigger in a debug build.

Parameters
hMemA memory handle returned from NvRmMemHandleAllocAttr/FromFd.
OffsetByte offset relative to the base of hMem. Must be a multiple of 2.
Returns
The value read from the memory location.

◆ NvRmMemRd32()

NvU32 NvRmMemRd32 ( NvRmMemHandle  hMem,
NvU32  Offset 
)

@IgnoreForDoc

Reads 32 bits of data from a buffer. This API never fails.

If hMem refers to an unallocated memory buffer, this function's behavior is undefined and an assert will trigger in a debug build.

Parameters
hMemA memory handle returned from NvRmMemHandleAllocAttr/FromFd.
OffsetByte offset relative to the base of hMem. Must be a multiple of 4.
Returns
The value read from the memory location.

◆ NvRmMemRead()

NvError NvRmMemRead ( NvRmMemHandle  hMem,
NvU64  Offset,
void *  pDst,
NvU64  Size 
)

@IgnoreForDoc

Reads a block of data from a buffer. This API cannot fail.

If hMem refers to an unallocated memory buffer, this function's behavior is undefined and an assert will trigger in a debug build.

Parameters
hMemA memory handle returned from NvRmMemHandleAllocAttr/FromFd.
OffsetByte offset relative to the base of hMem. May be arbitrarily aligned – need not be a multiple of 2 or 4.
pDstThe buffer where the data should be placed. May be arbitrarily aligned – need not be located at a word boundary.
SizeThe number of bytes of data to be read. May be arbitrarily sized – need not be a multiple of 2 or 4.
Returns
NvSuccess if success.

◆ NvRmMemReadStrided()

NvError NvRmMemReadStrided ( NvRmMemHandle  hMem,
NvU64  Offset,
NvU64  SrcStride,
void *  pDst,
NvU64  DstStride,
NvU64  ElementSize,
NvU64  Count 
)

@IgnoreForDoc

Reads a strided series of blocks of data from a buffer. This API cannot fail.

The total number of bytes copied is Count*ElementSize.

If hMem refers to an unallocated memory buffer, this function's behavior is undefined and an assert will trigger in a debug build.

Parameters
hMemA memory handle returned from NvRmMemHandleAllocAttr/FromFd.
OffsetByte offset relative to the base of hMem. May be arbitrarily aligned – need not be a multiple of 2 or 4.
SrcStrideThe number of bytes separating each source element. May be arbitrarily aligned – need not be a multiple of 2 or 4.
pDstThe buffer where the data should be placed. May be arbitrarily aligned – need not be located at a word boundary.
DstStrideThe number of bytes separating each destination element. May be arbitrarily aligned – need not be a multiple of 2 or 4.
ElementSizeThe number of bytes in each element. May be arbitrarily sized – need not be a multiple of 2 or 4.
CountThe number of destination elements.
Returns
NvSuccess if success.

◆ NvRmMemReserve()

void NvRmMemReserve ( NvRmMemHandle *  hMems,
NvU32 *  Offsets,
NvU32 *  Sizes,
NvU32  NrHandles,
NvU32  Reserved 
)

@IgnoreForDoc

NvRmMemReserve for a list of memory handles

Parameters
hMemslist of memory handles returned from NvRmMemHandleAllocAttr/FromFd.
Offsetslist of Mapping Starting addresses (each address Offsets[i] must be within the mapped region of the hMems[i]) to reserve
Sizeslist of the number of bytes of data that need to be reserved.
NrHandlesnumber of handles in hMems array
Reservesay NVRM_MEM_RESERVE to reserve the memory regions to device so cpu can't access them say NVRM_MEM_UNRESERVE to unreserve the memory regions from device so cpu can access them say NVRM_MEM_INSERT_ON_UNRESERVE to insert pages to memory regions on unreserve the memory regions from device so cpu can avoid page faults

◆ NvRmMemReserve64()

void NvRmMemReserve64 ( NvRmMemHandle *  hMems,
NvU64 *  Offsets,
NvU64 *  Sizes,
NvU64  NrHandles,
NvU32  Reserve 
)

@IgnoreForDoc

NvRmMemReserve for a list of memory handles

Parameters
hMemslist of memory handles returned from NvRmMemHandleAllocAttr/FromFd.
Offsetslist of Mapping Starting addresses (each address Offsets[i] must be within the mapped region of the hMems[i]) to reserve
Sizeslist of the number of bytes of data that need to be reserved.
NrHandlesnumber of handles in hMems array
Reservesay NVRM_MEM_RESERVE to reserve the memory regions to device so cpu can't access them say NVRM_MEM_UNRESERVE to unreserve the memory regions from device so cpu can access them say NVRM_MEM_INSERT_ON_UNRESERVE to insert pages to memory regions on unreserve the memory regions from device so cpu can avoid page faults

◆ NvRmMemSetAllocationTagLabel()

NvError NvRmMemSetAllocationTagLabel ( NvRmMemTags  tag,
const char *  label 
)

@IgnoreForDoc

Set human readable string for an allocation tag.

Parameters
tagAllocation tag to be labeled
labelHuman-readable string to associate to this tag. The string is copied internally, and may be truncated. If there was already an existing label for this tag it is replaced by new label. If label is NULL, then existing label -if any- for this tag is removed.
Returns
NvSuccess on success.

◆ NvRmMemSetVprFloor()

NvError NvRmMemSetVprFloor ( NvU32  MaxVprSize)

@IgnoreForDoc

Set VPR Floor to ensure VPR heap is atleast of specified size.

This API is used to avoid unnecessary VPR resize and associated overhead during the app run. Apps should set the floor size to max VPR necessary during the lifetime of app. This is the only way to avoid VPR resize overhead when the VPR buffers are getting released and reallocated as the resoultion changes.

Parameters
floor_size
Returns
NvSuccess on success.
Return values
NvError_BadParameterInvalid argument(s).
NvError_NotSupported

◆ NvRmMemWr08()

NvError NvRmMemWr08 ( NvRmMemHandle  hMem,
NvU32  Offset,
NvU8  Data 
)

@IgnoreForDoc

Writes 8 bits of data to a buffer. This API never fails.

If hMem refers to an unallocated memory buffer, this function's behavior is undefined and an assert will trigger in a debug build.

Parameters
hMemA memory handle returned from NvRmMemHandleAllocAttr/FromFd.
OffsetByte offset relative to the base of hMem. May be arbitrarily aligned – need not be a multiple of 2 or 4.
DataThe data to write to the memory location.
Returns
NvSuccess if success.

◆ NvRmMemWr16()

NvError NvRmMemWr16 ( NvRmMemHandle  hMem,
NvU32  Offset,
NvU16  Data 
)

@IgnoreForDoc

Writes 16 bits of data to a buffer. This API never fails.

If hMem refers to an unallocated memory buffer, this function's behavior is undefined and an assert will trigger in a debug build.

Parameters
hMemA memory handle returned from NvRmMemHandleAllocAttr/FromFd.
OffsetByte offset relative to the base of hMem. Must be a multiple of 2.
DataThe data to write to the memory location.
Returns
NvSuccess if success.

◆ NvRmMemWr32()

NvError NvRmMemWr32 ( NvRmMemHandle  hMem,
NvU32  Offset,
NvU32  Data 
)

@IgnoreForDoc

Writes 32 bits of data to a buffer. This API never fails.

If hMem refers to an unallocated memory buffer, this function's behavior is undefined and an assert will trigger in a debug build.

Parameters
hMemA memory handle returned from NvRmMemHandleAllocAttr/FromFd.
OffsetByte offset relative to the base of hMem. Must be a multiple of 4.
DataThe data to write to the memory location.
Returns
NvSuccess if success.

◆ NvRmMemWrite()

NvError NvRmMemWrite ( NvRmMemHandle  hMem,
NvU64  Offset,
const void *  pSrc,
NvU64  Size 
)

@IgnoreForDoc

Writes a block of data to a buffer. This API cannot fail.

If hMem refers to an unallocated memory buffer, this function's behavior is undefined and an assert will trigger in a debug build.

Parameters
hMemA memory handle returned from NvRmMemHandleAllocAttr/FromFd.
OffsetByte offset relative to the base of hMem. May be arbitrarily aligned – need not be a multiple of 2 or 4.
pSrcThe buffer to obtain the data from. May be arbitrarily aligned – need not be located at a word boundary.
SizeThe number of bytes of data to be written. May be arbitrarily sized – need not be a multiple of 2 or 4.
Returns
NvSuccess if success.

◆ NvRmMemWriteStrided()

NvError NvRmMemWriteStrided ( NvRmMemHandle  hMem,
NvU64  Offset,
NvU64  DstStride,
const void *  pSrc,
NvU64  SrcStride,
NvU64  ElementSize,
NvU64  Count 
)

@IgnoreForDoc

Writes a strided series of blocks of data to a buffer. This API cannot fail.

The total number of bytes copied is Count*ElementSize.

If hMem refers to an unallocated memory buffer, this function's behavior is undefined and an assert will trigger in a debug build.

Parameters
hMemA memory handle returned from NvRmMemHandleAllocAttr/FromFd.
OffsetByte offset relative to the base of hMem. May be arbitrarily aligned – need not be a multiple of 2 or 4.
DstStrideThe number of bytes separating each destination element. May be arbitrarily aligned – need not be a multiple of 2 or 4.
pSrcThe buffer to obtain the data from. May be arbitrarily aligned – need not be located at a word boundary.
SrcStrideThe number of bytes separating each source element. May be arbitrarily aligned – need not be a multiple of 2 or 4.
ElementSizeThe number of bytes in each element. May be arbitrarily sized – need not be a multiple of 2 or 4.
CountThe number of source elements.
Returns
NvSuccess if success.