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... | |
| #define NVRM_MEM_INSERT_ON_UNRESERVE 2 |
Definition at line 291 of file nvrm_memmgr.h.
| #define NVRM_MEM_RESERVE 1 |
Definition at line 290 of file nvrm_memmgr.h.
| #define NVRM_MEM_TRACE 0 |
Definition at line 785 of file nvrm_memmgr.h.
| #define NVRM_MEM_UNRESERVE 0 |
Definition at line 289 of file nvrm_memmgr.h.
| #define NVRM_MEM_ZAP_AND_CLEAN 3 |
Definition at line 292 of file nvrm_memmgr.h.
| int NvRm_MemmgrGetIoctlFile | ( | void | ) |
@IgnoreForDoc
Returns the file descriptor of the nvmap device opened by NvRm when the library is loaded.
| -1 | Indicates that NvRm failed to open the nvmap device. |
| 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
| [in] | hMems | list of memory handles returned from NvRmMemHandleAllocAttr/FromImportId/FromSciIpcId(). Range: Valid pointer to NvRmMemHandle |
| [in] | Offsets | list 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] | Sizes | list of the number of bytes that need data cache sync. Range: Valid pointer to 32 bit unsigned number |
| [in] | NumHandles | number of handles in hMems array Range: [0, 2^32-1] |
| NvSuccess | Cache sync operation is successful. |
| NvError_BadParameter | 1. Input Parameter "hMems" have invalid handle(s).
|
| 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
| [in] | hMems | list of memory handles returned from NvRmMemHandleAllocAttr/FromImprotId/FromSciIpcId() Range: Valid pointer to NvRmMemHandle |
| [in] | Offsets | list 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] | Sizes | list of the number of bytes that need data cache sync. Range: Valid pointer to 64 bit unsigned number |
| [in] | NumHandles | number of handles in hMems array Range: [0, 2^64-1] |
| NvSuccess | Cache sync operation is successful. |
| NvError_BadParameter | 1. Input Parameter "hMems" have invalid handle(s).
|
| 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
| [in] | hMems | list of memory handles returned from NvRmMemHandleAllocAttr/FromImprotId/FromSciIpcId() Range: Valid pointer to NvRmMemHandle |
| [in] | Offsets | list 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] | Sizes | list of the number of bytes that need data cache sync. Range: Valid pointer to 32 bit unsigned number |
| [in] | NumHandles | number of handles in hMems array Range: [0, 2^32-1] |
| NvSuccess | Cache sync operation is successful. |
| NvError_BadParameter | 1. Input Parameter "hMems" have invalid handle(s).
|
| 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
| [in] | hMems | list of memory handles returned from NvRmMemHandleAllocAttr/FromImprotId/FromSciIpcId() Range: Valid pointer to NvRmMemHandle |
| [in] | Offsets | list 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] | Sizes | list of the number of bytes that need data cache sync. Range: Valid pointer to 64 bit unsigned number |
| [in] | NumHandles | number of handles in hMems array Range: [0, 2^64-1] |
| NvSuccess | Cache sync operation is successful. |
| NvError_BadParameter | 1. Input Parameter "hMems" have invalid handle(s).
|
| 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
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
| [in] | hMem | NvRmMemHandle* Desc: Pointer to the list of MemHandles. Range: A valid pointer to NvRmMemHandle |
| [in] | offset | Number of bytes within a buffer size. |
| [in] | size | Number of bytes of the buffer less then buffer size. |
| [in] | num_hMems | Number of MemHandles. |
| Integer(Positive) | The file id that identifies the memory handle. |
| -1 | If memory services lib not initialized |
| -EMFILE | 1. Input parameter "hMem" is NULL
|
| NvU64 NvRmMemGetIVCId | ( | NvRmMemHandle | hMem | ) |
@IgnoreForDoc
Create an IVC Id for memory handle.
| hMem | Handle for which IVC ID is needed to be shared with peer Guest OS sharing the memory pool. Handle should be allocated from NvRmHeap_IVC. |
| NvU64 NvRmMemGetSize | ( | NvRmMemHandle | hMem | ) |
@IgnoreForDoc
Get the size of the buffer associated with a memory handle.
Allowed-State: Runtime Sync/Async: Sync Reentrancy: Reentrant
| [in] | hMem | A memory handle returned from NvRmMemHandleAllocAttr/FromFd. |
| Size | On Successful Query |
| NvError_BadParameter | Invalid NvRmMemHandle hMem |
| NvError_NotInitialized | libnvrm_mem has failed to initailize |
| NvError_IoctlFailed | An unknown error. |
| NvError_AccessDenied | Input parameter hMem is not accessible. |
| NvError NvRmMemHandleFromIVCId | ( | NvU64 | Id, |
| NvRmMemHandle * | phMem | ||
| ) |
@IgnoreForDoc
Create a mem handle from IVC id.
| id | ID obtained from another VM (Virtual Machine) partition. |
| phMem | Memory 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. |
| 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.
| hDstMem | A memory handle returned from NvRmMemHandleAllocAttr/FromFd. |
| DstOffset | Byte offset relative to the base of hMem. May be arbitrarily aligned – need not be a multiple of 2 or 4. |
| hSrcMem | A memory handle returned from NvRmMemHandleAllocAttr/FromFd. |
| SrcOffset | Byte offset relative to the base of hMem. May be arbitrarily aligned – need not be a multiple of 2 or 4. |
| Size | The 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. |
| 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
| [in] | ImportId | Import Id to be released. Range: [1, 2^32-1] |
| NvSuccess | Release of ImportId is successful. |
| NvError_BadParameter | ImportId is not valid. |
| NvError_IoctlFailed | Devctl call has failed |
| 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
| [in] | ImportId | Array of ImportIds to be released. Range: Valid pointer to ImportId |
| [in] | NumIds | Number of ImportIds in ImportId Array. Range: [0, 2^32-1] |
| NvSuccess | Release of ImportIds is successful. |
| NvError_BadParameter | ImportIds are not valid. |
| NvError_IoctlFailed | Devctl call has failed |
| 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
| [in] | SciIpcId | SciIpc Id to be released. Range: [1, 2^32-1] |
| NvSuccess | Release of SciIpcId is successful. |
| NvError_BadParameter | SciIpcId is not valid. |
| NvError_IoctlFailed | Devctl call has failed |
| 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
| [in] | SciIpcId | Array of SciIpcIds to be released. Range: Valid pointer to SciIpcId |
| [in] | NumIds | Number of SciIpcIds in SciIpcId Array. Range: [0, 2^32-1] |
| NvSuccess | Release of SciIpcIds is successful. |
| NvError_BadParameter | SciIpcIds are not valid. |
| NvError_IoctlFailed | Devctl call has failed |
@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.
| Heap | type for which the size is needed. |
| pointer | to hold the result (size of heap). |
| 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
| [in] | hMem | Handle to query Peer VM ID. |
| [out] | PeerVmId | Received Peer VM ID. |
| NvSuccess | on success. |
| NvError_IoctlFailed | Devctl call has failed |
| NvError_BadParameter | for invalid argument. |
| 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.
| hMem | A memory handle returned from NvRmMemHandleAllocAttr/FromFd. |
| Offset | Byte offset relative to the base of hMem. May be arbitrarily aligned – need not be a multiple of 2 or 4. |
| 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.
| hMem | A memory handle returned from NvRmMemHandleAllocAttr/FromFd. |
| Offset | Byte offset relative to the base of hMem. Must be a multiple of 2. |
| 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.
| hMem | A memory handle returned from NvRmMemHandleAllocAttr/FromFd. |
| Offset | Byte offset relative to the base of hMem. Must be a multiple of 4. |
| 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.
| hMem | A memory handle returned from NvRmMemHandleAllocAttr/FromFd. |
| Offset | Byte offset relative to the base of hMem. May be arbitrarily aligned – need not be a multiple of 2 or 4. |
| pDst | The buffer where the data should be placed. May be arbitrarily aligned – need not be located at a word boundary. |
| Size | The number of bytes of data to be read. May be arbitrarily sized – need not be a multiple of 2 or 4. |
| 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.
| hMem | A memory handle returned from NvRmMemHandleAllocAttr/FromFd. |
| Offset | Byte offset relative to the base of hMem. May be arbitrarily aligned – need not be a multiple of 2 or 4. |
| SrcStride | The number of bytes separating each source element. May be arbitrarily aligned – need not be a multiple of 2 or 4. |
| pDst | The buffer where the data should be placed. May be arbitrarily aligned – need not be located at a word boundary. |
| DstStride | The number of bytes separating each destination element. May be arbitrarily aligned – need not be a multiple of 2 or 4. |
| ElementSize | The number of bytes in each element. May be arbitrarily sized – need not be a multiple of 2 or 4. |
| Count | The number of destination elements. |
| void NvRmMemReserve | ( | NvRmMemHandle * | hMems, |
| NvU32 * | Offsets, | ||
| NvU32 * | Sizes, | ||
| NvU32 | NrHandles, | ||
| NvU32 | Reserved | ||
| ) |
@IgnoreForDoc
NvRmMemReserve for a list of memory handles
| hMems | list of memory handles returned from NvRmMemHandleAllocAttr/FromFd. |
| Offsets | list of Mapping Starting addresses (each address Offsets[i] must be within the mapped region of the hMems[i]) to reserve |
| Sizes | list of the number of bytes of data that need to be reserved. |
| NrHandles | number of handles in hMems array |
| Reserve | say 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 |
| void NvRmMemReserve64 | ( | NvRmMemHandle * | hMems, |
| NvU64 * | Offsets, | ||
| NvU64 * | Sizes, | ||
| NvU64 | NrHandles, | ||
| NvU32 | Reserve | ||
| ) |
@IgnoreForDoc
NvRmMemReserve for a list of memory handles
| hMems | list of memory handles returned from NvRmMemHandleAllocAttr/FromFd. |
| Offsets | list of Mapping Starting addresses (each address Offsets[i] must be within the mapped region of the hMems[i]) to reserve |
| Sizes | list of the number of bytes of data that need to be reserved. |
| NrHandles | number of handles in hMems array |
| Reserve | say 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 |
| NvError NvRmMemSetAllocationTagLabel | ( | NvRmMemTags | tag, |
| const char * | label | ||
| ) |
@IgnoreForDoc
Set human readable string for an allocation tag.
| tag | Allocation tag to be labeled |
| label | Human-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. |
| 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.
| floor_size |
| NvError_BadParameter | Invalid argument(s). |
| NvError_NotSupported |
| 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.
| hMem | A memory handle returned from NvRmMemHandleAllocAttr/FromFd. |
| Offset | Byte offset relative to the base of hMem. May be arbitrarily aligned – need not be a multiple of 2 or 4. |
| Data | The data to write to the memory location. |
| 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.
| hMem | A memory handle returned from NvRmMemHandleAllocAttr/FromFd. |
| Offset | Byte offset relative to the base of hMem. Must be a multiple of 2. |
| Data | The data to write to the memory location. |
| 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.
| hMem | A memory handle returned from NvRmMemHandleAllocAttr/FromFd. |
| Offset | Byte offset relative to the base of hMem. Must be a multiple of 4. |
| Data | The data to write to the memory location. |
| 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.
| hMem | A memory handle returned from NvRmMemHandleAllocAttr/FromFd. |
| Offset | Byte offset relative to the base of hMem. May be arbitrarily aligned – need not be a multiple of 2 or 4. |
| pSrc | The buffer to obtain the data from. May be arbitrarily aligned – need not be located at a word boundary. |
| Size | The number of bytes of data to be written. May be arbitrarily sized – need not be a multiple of 2 or 4. |
| 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.
| hMem | A memory handle returned from NvRmMemHandleAllocAttr/FromFd. |
| Offset | Byte offset relative to the base of hMem. May be arbitrarily aligned – need not be a multiple of 2 or 4. |
| DstStride | The number of bytes separating each destination element. May be arbitrarily aligned – need not be a multiple of 2 or 4. |
| pSrc | The buffer to obtain the data from. May be arbitrarily aligned – need not be located at a word boundary. |
| SrcStride | The number of bytes separating each source element. May be arbitrarily aligned – need not be a multiple of 2 or 4. |
| ElementSize | The number of bytes in each element. May be arbitrarily sized – need not be a multiple of 2 or 4. |
| Count | The number of source elements. |