NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access Release
nvrm_memmgr_safe.h File Reference

Go to the source code of this file.

Data Structures

struct  NvRmMemDescRec
 linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end: More...
 
struct  NvRmMemChInfoRec
 linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end: More...
 
struct  NvRmMemHandleAttrRec
 Covers: [Libnvrm_mem_SWUD_106]. More...
 
struct  NvRmMemHandleParamsRec
 Covers: [Libnvrm_mem_SWUD_107]. More...
 
struct  NvRmMemHeapParamsRec
 Covers: [Libnvrm_mem_SWUD_108]. More...
 
struct  NvRmMemIovaInfo
 linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end: More...
 
struct  NvRmMemHwidParams
 linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end: More...
 
struct  NvRmMemStatHeapsInfo
 
struct  NvRmMemStatHeaps
 
struct  NvRmMemStatHeapsHeader
 
struct  NvRmMemHwId
 
struct  NvRmMemStatBuffer
 
struct  NvRmMemStatBufferHeader
 
struct  NvRmMemStatIovaInfo
 
struct  NvRmMemStatIovaInfoHeader
 
struct  NvRmMemStatProcInfo
 
struct  NvRmMemStatProcInfoHeader
 
struct  NvRmMemStatMiscInfo
 
struct  NvRmMemStatHeader
 

Macros

#define SAFE_ASM   asm
 
#define NVRM_MEMHANDLE_NULL   NULL
 
#define NVRM_MEMHANDLE_PRI   "%p"
 
#define NVMAP_DEV_NODE   "/dev/nvmap"
 
#define NvRmMemorySync()   SAFE_ASM volatile("dsb sy" : : : "memory")
 Description: This should be called after CPU writes to NvOsMemAttribute_WriteCombined memory, in order to ensure coherency with hardware engines. More...
 
#define NvRmHeap_Default   NvRmHeap_IOMMU
 
#define NVRM_HEAP_FREE_SIZE_UNAVAILABLE   ((NvU64)-1)
 Sentinel value for NvRmMemHeapParamsRec::Free and LargestFreeBlock when value is unknown (e.g., VPR heap from dbheap). More...
 
#define NVRM_MEM_HANDLE_DEFAULT_ALLOCATOR   NULL
 
#define NUMA_NO_NODE   -1
 Default numa node, when user does not specify any specific numa node. More...
 
#define NVRM_DEFINE_MEM_HANDLE_ATTR(x)
 Description: Helper macro function for defining handle attribute. More...
 
#define NVRM_MEM_HANDLE_SET_ATTR(attr, al, ch, sz, tg)
 Description: Helper macro function for setting handle attributes. More...
 
#define NVRM_MEM_HANDLE_SET_HEAP_ATTR(attr, hs, nh)
 Description: Helper macro for setting heap attributes. More...
 
#define NVRM_MEM_HANDLE_SET_HEAP_ATTR_EXT(attr, hs, nh, hn)
 Description: Helper macro for setting heaps and heap number. More...
 
#define NVRM_MEM_HANDLE_SET_RECLAIM_CACHE_ATTR(attr, rc)
 
#define NVRM_MEM_HANDLE_SET_CONTIGUOUS_ATTR(attr, cont)
 Description: Helper macro for Contiguous property in handle attribute. More...
 
#define NVRM_MEM_HANDLE_SET_CACHE_SYNC_ATTR(attr)
 Description: Helper macro function for cache sync attribute. More...
 
#define NVRM_MEM_HANDLE_SET_CACHE_AT_RESERVE_ATTR(attr)
 
#define NVRM_MEM_HANDLE_SET_HOS_SHARED_MEMORY_ATTR(attr, shared)
 
#define NVRM_MEM_HANDLE_SET_ALLOCATOR(attr, allocator)
 
#define NVRM_MEM_HANDLE_SET_VA_ATTR(attr, va)
 Description: Helper macro for virtual address property in handle attribute. More...
 
#define NVRM_MEM_HANDLE_SET_PHYS_MEM_DESC(attr, pmd, num)
 Description: Helper macro for physical memory descriptor property in handle attribute. More...
 
#define NVRM_MEM_HANDLE_SET_GPU_ACCESS(attr, ga)
 Description: Helper macro for setting gpu access attribute. More...
 
#define NVRM_MEM_HANDLE_SET_ACCESS_FLAGS(attr, af)
 Description: Helper macro for access flag attribute. More...
 
#define NVRM_MEM_HANDLE_SET_NUMA_NODE(attr, nid)
 
#define NVRM_MEM_HANDLE_SET_CACHE_ATTR(attr, ca)
 
#define NVRM_MEM_HANDLE_FREE_RET   1
 
#define NvRmMemHandleQueryParams   NvRmMemQueryHandleParams
 
#define NVRM_MEM_HEAP_MAX_NAME_SIZE   64U
 
#define NVRM_MEM_STAT_NUM_HEAPS_INFO_BLOCKS   1UL
 
#define NVRM_MEM_STAT_NUM_HEAP_BLOCKS   16UL
 
#define NVRM_MEM_STAT_NUM_BUFFER_BLOCKS   128UL
 
#define NVRM_MEM_STAT_HEAP_DYNAMIC_GPU_MAPPING   0x1
 
#define NVRM_MEM_STAT_HEAP_STATIC_GPU_MAPPING   0x0
 
#define NVRM_MEM_STAT_HEAP_PEER_NA   (~0U)
 
#define NVRM_MEM_STAT_BUFFER_FULL_BLOCK   0UL
 
#define NVRM_MEM_STAT_BUFFER_SUB_BLOCK   1UL
 
#define NVRM_MEM_STAT_BUFFER_FRAGMENTED   1UL
 
#define NVRM_MEM_STAT_BUFFER_NOT_FRAGMENTED   0UL
 
#define NVRM_MEM_STAT_BUFFER_GPU_ACCESSIBLE   1UL
 
#define NVRM_MEM_STAT_BUFFER_GPU_NON_ACCESSIBLE   0UL
 
#define NVRM_MEM_STAT_BUFFER_GPU_NA   (~0UL)
 
#define NVRM_BYTES_PER_WORD   ((uint32_t)sizeof(unsigned int))
 
#define NVRM_BITS_PER_WORD   (uint32_t)(NVRM_BYTES_PER_WORD * 8U)
 
#define NVMAP_NUM_HWIDS   384U
 
#define NUM_SMMU_INSTANCES   3U
 
#define HWID_MAP   ((NVMAP_NUM_HWIDS + NVRM_BITS_PER_WORD - 1U) / NVRM_BITS_PER_WORD)
 
#define SID_MAP   (HWID_MAP/NUM_SMMU_INSTANCES)
 

Typedefs

typedef struct NvRmMemRec * NvRmMemHandle
 
typedef NvU64 NvRmMemSciIpcId
 typedef for 64 bits unique Id More...
 
typedef enum NvRmMemKind NvRmMemKind
 
typedef enum NvRmHeap NvRmHeap
 Covers: [Libnvrm_mem_SWUD_501]. More...
 
typedef enum NvRmMemTags NvRmMemTags
 Covers: [Libnvrm_mem_SWUD_502]. More...
 
typedef struct NvRmMemDescRec NvRmMemDesc
 Covers: [Libnvrm_mem_SWUD_503]. More...
 
typedef enum NvRmMemGpuAccess NvRmMemGpuAccess
 Covers: [Libnvrm_mem_SWUD_504]. More...
 
typedef struct NvRmMemChInfoRec NvRmMemChInfo
 linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end: More...
 
typedef enum NvRmMemEvent NvRmMemEvent
 linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end: More...
 
typedef struct NvRmMemHandleAttrRec NvRmMemHandleAttr
 Covers: [Libnvrm_mem_SWUD_507]. More...
 
typedef struct NvRmMemHandleParamsRec NvRmMemHandleParams
 Covers: [Libnvrm_mem_SWUD_508]. More...
 
typedef struct NvRmMemHeapParamsRec NvRmMemHeapParams
 Covers: [Libnvrm_mem_SWUD_509]. More...
 

Enumerations

enum  NvRmMemKind {
  NvRmMemKind_Pitch = 0,
  NvRmMemKind_C32_2CRA = 0xdb,
  NvRmMemKind_C64_2CRA = 0xe9,
  NvRmMemKind_Generic_16Bx2 = 0xfe,
  NvRmMemKind_Invalid = 0xff,
  NvRmMemKind_Num,
  NvRmMemKind_Force32 = 0x7FFFFFFF
}
 
enum  NvRmHeap {
  NvRmHeap_IOMMU = 2,
  NvRmHeap_ExternalCarveOut,
  NvRmHeap_VPR = 5,
  NvRmHeap_IVC = 7,
  NvRmHeap_VidMem,
  NvRmHeap_CvsRam,
  NvRmHeap_SyncptRam,
  NvRmHeap_FsiMem,
  NvRmHeap_GpuMem,
  NvRmHeap_PcieMmio,
  NvRmHeap_ViMem,
  NvRmHeap_Num,
  NvRmHeap_Force32 = 0x7FFFFFFF
}
 Covers: [Libnvrm_mem_SWUD_101]. More...
 
enum  NvRmMemTags {
  NvRmMemTags_None = 0x0,
  NvRmMemTags_Egl = 0x100,
  NvRmMemTags_Camera = 0x200,
  NvRmMemTags_Codecs = 0x300,
  NvRmMemTags_Display = 0x400,
  NvRmMemTags_Mm = 0x500,
  NvRmMemTags_MmSecurity,
  NvRmMemTags_OpenMax = 0x600,
  NvRmMemTags_Wsi = 0x700,
  NvRmMemTags_Glsi,
  NvRmMemTags_Cuda = 0x800,
  NvRmMemTags_Rm = 0x900,
  NvRmMemTags_NvRmGpuSwizzler,
  NvRmMemTags_System = 0xa00,
  NvRmMemTags_Odm = 0xb00,
  NvRmMemTags_Gralloc = 0xc00,
  NvRmMemTags_OpenMaxCamera = 0xd00,
  NvRmMemTags_X11 = 0xe00,
  NvRmMemTags_Ddk2d = 0xf00,
  NvRmMemTags_DdkVic,
  NvRmMemTags_RmApiTegraClient = 0x1000,
  NvRmMemTags_RmApiTegraInternal,
  NvRmMemTags_RmApiTegraImage,
  NvRmMemTags_RmApiTegraColor,
  NvRmMemTags_RmApiTegraDepth,
  NvRmMemTags_RmApiTegraStencil,
  NvRmMemTags_RmApiTegraAccum,
  NvRmMemTags_RmApiTegraClipId,
  NvRmMemTags_RmApiTegraAux,
  NvRmMemTags_RmApiTegraGvo,
  NvRmMemTags_RmApiTegraGvi,
  NvRmMemTags_RmApiTegraIg,
  NvRmMemTags_RmApiTegraTexture,
  NvRmMemTags_RmApiTegraVideo,
  NvRmMemTags_RmApiTegraFont,
  NvRmMemTags_RmApiTegraCursor,
  NvRmMemTags_RmApiTegraDma,
  NvRmMemTags_RmApiTegraInstance,
  NvRmMemTags_RmApiTegraPrimary,
  NvRmMemTags_RmApiTegraZcull,
  NvRmMemTags_RmApiTegraUnused,
  NvRmMemTags_RmApiTegraShaderProgram,
  NvRmMemTags_RmApiTegraOwnerRm,
  NvRmMemTags_RmApiTegraNotifier,
  NvRmMemTags_RmApiTegraReserved,
  NvRmMemTags_Tvmr = 0x1100,
  NvRmMemTags_VideoEnc = 0x1200,
  NvRmMemTags_Tests = 0x1300,
  NvRmMemTags_VideoDec = 0x1400,
  NvRmMemTags_Jpeg = 0x1500,
  NvRmMemTags_NvMapTest,
  NvRmMemTags_CpuVprTest,
  NvRmMemTags_NvRmGpuTests,
  NvRmMemTags_Vpr,
  NvRmMemTags_NvDLA0 = 0x1600,
  NvRmMemTags_NvDLA1 = 0x1601,
  NvRmMemTags_PVA = 0x1700,
  NvRmMemTags_NvSci = 0x1800,
  NvRmMemTags_CuLDPC = 0x1900,
  NvRmMemTags_NVN = 0x1a00,
  NvRmMemTags_CuDLA = 0x1b00
}
 @IgnoreForDoc Covers: [Libnvrm_mem_SWUD_X] More...
 
enum  NvRmMemGpuAccess {
  NvRmMemGpuAccess_NO_GPU = 0,
  NvRmMemGpuAccess_IGPU,
  NvRmMemGpuAccess_DGPU,
  NvRmMemGpuAccess_GPU,
  NvRmMemGpuAccess_Force32 = 0x7FFFFFFF
}
 Covers: [Libnvrm_mem_SWUD_103]. More...
 
enum  NvRmMemEvent {
  NVRMMEM_EVENT_FREE = 0,
  NVRMMEM_EVENT_SINGLETON,
  NVRMMEM_EVENT_MAX,
  NvRmMemEvent_Force32 = 0x7FFFFFFFU
}
 linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end: More...
 
enum  {
  NVRM_MEM_STAT_HEAPS = 1 << 0,
  NVRM_MEM_STAT_BUFFERS = 1 << 1,
  NVRM_MEM_STAT_IOVA = 1 << 2,
  NVRM_MEM_STAT_PROCS = 1 << 3,
  NVRM_MEM_STAT_REUSE = 1 << 10
}
 

Functions

static NvRmMemHandleAttr NvRmMemHandleAttrConstruct (void)
 Description: Helper function for constructing a default handle attribute struct. More...
 
static void NvRmMemHandleAttrSet (NvRmMemHandleAttr *const attr, NvU32 const alignment, NvOsMemAttribute const coherency, NvU64 const size, NvRmMemTags const tags)
 Description: Helper function for setting handle attributes. More...
 
NvError NvRmMemHandleAllocAttr (NvRmDeviceHandle hDevice, NvRmMemHandleAttr *attr, NvRmMemHandle *phMem)
 @IfaceTagForDoc More...
 
NvError NvRmMemMgrInit (void)
 @IfaceTagForDoc qnx_sr_only_doxygen_start: Covers: [Libnvrm_mem_SWUD_66] qnx_sr_only_doxygen_end: More...
 
NvError NvRmMemHandleDuplicate (NvRmMemHandle hMemSrc, NvU32 Flags, NvRmMemHandle *phMemDuplicated)
 @IfaceTagForDoc qnx_sr_only_doxygen_start: Covers: [Libnvrm_mem_SWUD_13] qnx_sr_only_doxygen_end: More...
 
NvError NvRmMemHandleFree (NvRmMemHandle hMem)
 @IfaceTagForDoc qnx_sr_only_doxygen_start: Covers: [Libnvrm_mem_SWUD_14] qnx_sr_only_doxygen_end: More...
 
NvError NvRmMemMap (NvRmMemHandle hMem, NvU64 Offset, NvU64 Size, NvU32 Flags, void **pVirtAddr)
 @IfaceTagForDoc qnx_sr_only_doxygen_start: Covers: [Libnvrm_mem_SWUD_15] qnx_sr_only_doxygen_end: More...
 
NvError NvRmMemUnmap (NvRmMemHandle hMem, void *pVirtAddr, NvU64 Size)
 @IfaceTagForDoc qnx_sr_only_doxygen_start: Covers: [Libnvrm_mem_SWUD_16] qnx_sr_only_doxygen_end: More...
 
NvError NvRmMemReserveIovaRegion (NvU64 hwid, struct NvRmMemIovaInfo *IovaInfo)
 linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end: More...
 
NvError NvRmMemFreeIovaRegion (NvU64 hwid, struct NvRmMemIovaInfo *IovaInfo)
 linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end: More...
 
NvError NvRmMemDmaMap (NvRmMemHandle hMem, NvU64 hwid, NvU64 Offset, NvU64 Size, NvU32 Flags, NvU64 *pIovaAddr)
 linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end: More...
 
NvError NvRmMemDmaMapMult (NvRmMemHandle *hMem, NvU64 hwid, NvU64 Offset, NvU64 Size, NvU32 Flags, NvU64 *pIovaAddr, NvU32 NumHandles)
 linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end: More...
 
NvError NvRmMemDmaUnmap (NvRmMemHandle hMem, NvU64 hwid, NvU64 IovaAddr, NvU64 Size)
 linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end: More...
 
NvError NvRmMemDmaUnmapMult (NvRmMemHandle *hMem, NvU64 hwid, NvU64 *pIovaAddr, NvU64 *Size, NvU32 NumHandles)
 linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end: More...
 
NvError NvRmMemCacheSyncForCpu (NvRmMemHandle hMem, void *pMapping, NvU64 Size)
 @IfaceTagForDoc qnx_sr_only_doxygen_start: Covers: [Libnvrm_mem_SWUD_21] qnx_sr_only_doxygen_end: More...
 
NvError NvRmMemCacheSyncForDevice (NvRmMemHandle hMem, void *pMapping, NvU64 Size)
 @IfaceTagForDoc qnx_sr_only_doxygen_start: Covers: [Libnvrm_mem_SWUD_22] qnx_sr_only_doxygen_end: More...
 
NvError NvRmMemGetPhysInfo (NvRmMemHandle hMem, NvRmMemDesc *MemDesc, NvU64 NumDesc, NvU64 *NumDescUsed)
 linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end: More...
 
NvError NvRmMemGetPhysInfoMult (NvRmMemHandle *hMem, NvRmMemDesc **MemDesc, NvU64 NumDesc, NvU64 **NumDescUsed, NvU32 NumHandles)
 linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end: More...
 
NvError NvRmMemEnableEvent (NvRmMemHandle hMem, NvRmMemEvent event, void *priv, NvU32 PrivSize, void(*OnEvent)(NvRmMemEvent event, void *priv, NvU32 PrivSize))
 linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end: More...
 
NvError NvRmMemDisableEvent (NvRmMemHandle hMem, NvRmMemEvent event)
 linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end: More...
 
NvError NvRmMemGetImportId (NvRmMemHandle hMem, NvRmMemChInfo *ChInfo, NvU32 Flags, NvU64 *ImportId)
 linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end: More...
 
NvError NvRmMemGetImportIdMult (NvRmMemHandle *hMem, NvRmMemChInfo *ChInfo, NvU32 Flags, NvU64 *ImportId, NvU32 NumHandles)
 linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end: More...
 
NvError NvRmMemHandleFromImportId (NvU64 ImportId, NvRmMemChInfo *ChInfo, NvU32 Flags, NvRmMemHandle *phMem)
 linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end: More...
 
NvError NvRmMemHandleFromImportIdMult (NvU64 *ImportId, NvRmMemChInfo *ChInfo, NvU32 Flags, NvRmMemHandle *phMem, NvU32 NumIds)
 linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end: More...
 
NvError NvRmMemQueryHandleParams (NvRmMemHandle hMem, NvU64 ImportId, NvRmMemHandleParams *params, NvU32 ParamsSize)
 @IfaceTagForDoc qnx_sr_only_doxygen_start: Covers: [Libnvrm_mem_SWUD_45] qnx_sr_only_doxygen_end: More...
 
NvError NvRmMemQueryHeapParams (NvRmHeap heap, NvBool contig, NvRmMemGpuAccess GpuAccess, NvRmMemHeapParams *params, NvU32 ParamsSize)
 @IfaceTagForDoc qnx_sr_only_doxygen_start: Covers: [Libnvrm_mem_SWUD_46] qnx_sr_only_doxygen_end: More...
 
NvError NvRmMemQueryHeapParamsNuma (NvRmHeap heap, NvS32 NumaId, NvBool contig, NvRmMemGpuAccess GpuAccess, NvRmMemHeapParams *params, NvU32 ParamsSize)
 qnx_sr_only_doxygen_start: @IgnoreForDoc qnx_sr_only_doxygen_end: More...
 
NvError NvRmMemQueryHeaps (const NvRmHeap *Heap, NvU32 *NumHeapsAvailable)
 @IfaceTagForDoc qnx_sr_only_doxygen_start: Covers: [Libnvrm_mem_SWUD_48] qnx_sr_only_doxygen_end: More...
 
NvError NvRmMemGetHwid (NvU32 stream_id, NvU32 phandle, NvU32 *hwid)
 linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end: More...
 
NvError NvRmMemGetDmaHwid (struct NvRmMemHwidParams *HwidParams)
 linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end: More...
 
NvError NvRmMemGetStatistics (struct NvRmMemStatHeader *stat_header, NvU32 flag)
 linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end: More...
 

Macro Definition Documentation

◆ HWID_MAP

#define HWID_MAP   ((NVMAP_NUM_HWIDS + NVRM_BITS_PER_WORD - 1U) / NVRM_BITS_PER_WORD)

Definition at line 5469 of file nvrm_memmgr_safe.h.

◆ NUM_SMMU_INSTANCES

#define NUM_SMMU_INSTANCES   3U

Definition at line 5468 of file nvrm_memmgr_safe.h.

◆ NUMA_NO_NODE

#define NUMA_NO_NODE   -1

Default numa node, when user does not specify any specific numa node.

Definition at line 990 of file nvrm_memmgr_safe.h.

◆ NVMAP_DEV_NODE

#define NVMAP_DEV_NODE   "/dev/nvmap"

Definition at line 165 of file nvrm_memmgr_safe.h.

◆ NVMAP_NUM_HWIDS

#define NVMAP_NUM_HWIDS   384U

Definition at line 5467 of file nvrm_memmgr_safe.h.

◆ NVRM_BITS_PER_WORD

#define NVRM_BITS_PER_WORD   (uint32_t)(NVRM_BYTES_PER_WORD * 8U)

Definition at line 5466 of file nvrm_memmgr_safe.h.

◆ NVRM_BYTES_PER_WORD

#define NVRM_BYTES_PER_WORD   ((uint32_t)sizeof(unsigned int))

Definition at line 5465 of file nvrm_memmgr_safe.h.

◆ NVRM_DEFINE_MEM_HANDLE_ATTR

#define NVRM_DEFINE_MEM_HANDLE_ATTR (   x)
Value:
NvRmMemTags_None,NV_FALSE,0U, \
0U,NV_FALSE,NV_FALSE,NULL,NV_FALSE,NV_FALSE, \
NVRM_MEM_HANDLE_DEFAULT_ALLOCATOR,0U, NULL, 0U, \
NvRmMemGpuAccess_NO_GPU, NVOS_MEM_READ_WRITE, NUMA_NO_NODE}

Description: Helper macro function for defining handle attribute.

Definition at line 996 of file nvrm_memmgr_safe.h.

◆ NVRM_HEAP_FREE_SIZE_UNAVAILABLE

#define NVRM_HEAP_FREE_SIZE_UNAVAILABLE   ((NvU64)-1)

Sentinel value for NvRmMemHeapParamsRec::Free and LargestFreeBlock when value is unknown (e.g., VPR heap from dbheap).

Consumers must treat this as "unavailable" and must not use it as a byte count.

Definition at line 879 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_HANDLE_DEFAULT_ALLOCATOR

#define NVRM_MEM_HANDLE_DEFAULT_ALLOCATOR   NULL

Definition at line 984 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_HANDLE_FREE_RET

#define NVRM_MEM_HANDLE_FREE_RET   1

Definition at line 1654 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_HANDLE_SET_ACCESS_FLAGS

#define NVRM_MEM_HANDLE_SET_ACCESS_FLAGS (   attr,
  af 
)
Value:
do { \
(attr).AccessFlags = (af); \
} while (1 == 0)

Description: Helper macro for access flag attribute.

Definition at line 1144 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_HANDLE_SET_ALLOCATOR

#define NVRM_MEM_HANDLE_SET_ALLOCATOR (   attr,
  allocator 
)
Value:
do { \
(attr).Allocator = (allocator); \
} while (1 == 0)

Definition at line 1107 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_HANDLE_SET_ATTR

#define NVRM_MEM_HANDLE_SET_ATTR (   attr,
  al,
  ch,
  sz,
  tg 
)
Value:
do { \
(attr).Alignment = (al); \
(attr).Coherency = (ch); \
(attr).Size = (sz); \
(attr).Tags = ((NvRmMemTags)tg); \
} while (1 == 0)

Description: Helper macro function for setting handle attributes.

Definition at line 1027 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_HANDLE_SET_CACHE_AT_RESERVE_ATTR

#define NVRM_MEM_HANDLE_SET_CACHE_AT_RESERVE_ATTR (   attr)
Value:
do { \
(attr).CacheSyncAtReserve = 1; \
} while (1 == 0)

Definition at line 1097 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_HANDLE_SET_CACHE_ATTR

#define NVRM_MEM_HANDLE_SET_CACHE_ATTR (   attr,
  ca 
)
Value:
do { \
(attr).Coherency = (ca); \
} while (1 == 0)

Definition at line 1154 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_HANDLE_SET_CACHE_SYNC_ATTR

#define NVRM_MEM_HANDLE_SET_CACHE_SYNC_ATTR (   attr)
Value:
do { \
(attr).CacheSync = 1; \
} while (1 == 0)

Description: Helper macro function for cache sync attribute.

Definition at line 1092 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_HANDLE_SET_CONTIGUOUS_ATTR

#define NVRM_MEM_HANDLE_SET_CONTIGUOUS_ATTR (   attr,
  cont 
)
Value:
do { \
(attr).Contiguous = (cont); \
} while (1 == 0)

Description: Helper macro for Contiguous property in handle attribute.

Definition at line 1083 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_HANDLE_SET_GPU_ACCESS

#define NVRM_MEM_HANDLE_SET_GPU_ACCESS (   attr,
  ga 
)
Value:
do { \
(attr).GpuAccess = (ga); \
} while (1 == 0)

Description: Helper macro for setting gpu access attribute.

Definition at line 1135 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_HANDLE_SET_HEAP_ATTR

#define NVRM_MEM_HANDLE_SET_HEAP_ATTR (   attr,
  hs,
  nh 
)
Value:
do { \
(attr).Heaps = (hs); \
(attr).NumHeaps = (nh); \
} while (1 == 0)

Description: Helper macro for setting heap attributes.

Definition at line 1057 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_HANDLE_SET_HEAP_ATTR_EXT

#define NVRM_MEM_HANDLE_SET_HEAP_ATTR_EXT (   attr,
  hs,
  nh,
  hn 
)
Value:
do { \
(attr).Heaps = (hs); \
(attr).NumHeaps = (nh); \
(attr).HeapNumber = (hn); \
} while (1 == 0)

Description: Helper macro for setting heaps and heap number.

Definition at line 1067 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_HANDLE_SET_HOS_SHARED_MEMORY_ATTR

#define NVRM_MEM_HANDLE_SET_HOS_SHARED_MEMORY_ATTR (   attr,
  shared 
)
Value:
do { \
(attr).HosSharedMemory = (shared); \
} while (1 == 0)

Definition at line 1102 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_HANDLE_SET_NUMA_NODE

#define NVRM_MEM_HANDLE_SET_NUMA_NODE (   attr,
  nid 
)
Value:
do { \
(attr).NumaNodeId = (nid); \
} while (1 == 0)

Definition at line 1149 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_HANDLE_SET_PHYS_MEM_DESC

#define NVRM_MEM_HANDLE_SET_PHYS_MEM_DESC (   attr,
  pmd,
  num 
)
Value:
do { \
(attr).PhysMemDesc = (pmd); \
(attr).NumMemDesc = (num); \
} while (1 == 0)

Description: Helper macro for physical memory descriptor property in handle attribute.

Definition at line 1125 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_HANDLE_SET_RECLAIM_CACHE_ATTR

#define NVRM_MEM_HANDLE_SET_RECLAIM_CACHE_ATTR (   attr,
  rc 
)
Value:
do { \
(attr).ReclaimCache = (rc); \
} while (1 == 0)

Definition at line 1074 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_HANDLE_SET_VA_ATTR

#define NVRM_MEM_HANDLE_SET_VA_ATTR (   attr,
  va 
)
Value:
do { \
(attr).vaddr = (va); \
} while (1 == 0)

Description: Helper macro for virtual address property in handle attribute.

Definition at line 1116 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_HEAP_MAX_NAME_SIZE

#define NVRM_MEM_HEAP_MAX_NAME_SIZE   64U

Definition at line 5445 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_STAT_BUFFER_FRAGMENTED

#define NVRM_MEM_STAT_BUFFER_FRAGMENTED   1UL

Definition at line 5459 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_STAT_BUFFER_FULL_BLOCK

#define NVRM_MEM_STAT_BUFFER_FULL_BLOCK   0UL

Definition at line 5456 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_STAT_BUFFER_GPU_ACCESSIBLE

#define NVRM_MEM_STAT_BUFFER_GPU_ACCESSIBLE   1UL

Definition at line 5462 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_STAT_BUFFER_GPU_NA

#define NVRM_MEM_STAT_BUFFER_GPU_NA   (~0UL)

Definition at line 5464 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_STAT_BUFFER_GPU_NON_ACCESSIBLE

#define NVRM_MEM_STAT_BUFFER_GPU_NON_ACCESSIBLE   0UL

Definition at line 5463 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_STAT_BUFFER_NOT_FRAGMENTED

#define NVRM_MEM_STAT_BUFFER_NOT_FRAGMENTED   0UL

Definition at line 5460 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_STAT_BUFFER_SUB_BLOCK

#define NVRM_MEM_STAT_BUFFER_SUB_BLOCK   1UL

Definition at line 5457 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_STAT_HEAP_DYNAMIC_GPU_MAPPING

#define NVRM_MEM_STAT_HEAP_DYNAMIC_GPU_MAPPING   0x1

Definition at line 5451 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_STAT_HEAP_PEER_NA

#define NVRM_MEM_STAT_HEAP_PEER_NA   (~0U)

Definition at line 5454 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_STAT_HEAP_STATIC_GPU_MAPPING

#define NVRM_MEM_STAT_HEAP_STATIC_GPU_MAPPING   0x0

Definition at line 5452 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_STAT_NUM_BUFFER_BLOCKS

#define NVRM_MEM_STAT_NUM_BUFFER_BLOCKS   128UL

Definition at line 5449 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_STAT_NUM_HEAP_BLOCKS

#define NVRM_MEM_STAT_NUM_HEAP_BLOCKS   16UL

Definition at line 5448 of file nvrm_memmgr_safe.h.

◆ NVRM_MEM_STAT_NUM_HEAPS_INFO_BLOCKS

#define NVRM_MEM_STAT_NUM_HEAPS_INFO_BLOCKS   1UL

Definition at line 5447 of file nvrm_memmgr_safe.h.

◆ NVRM_MEMHANDLE_NULL

#define NVRM_MEMHANDLE_NULL   NULL

Definition at line 161 of file nvrm_memmgr_safe.h.

◆ NVRM_MEMHANDLE_PRI

#define NVRM_MEMHANDLE_PRI   "%p"

Definition at line 162 of file nvrm_memmgr_safe.h.

◆ NvRmHeap_Default

#define NvRmHeap_Default   NvRmHeap_IOMMU

Definition at line 298 of file nvrm_memmgr_safe.h.

◆ NvRmMemHandleQueryParams

#define NvRmMemHandleQueryParams   NvRmMemQueryHandleParams

Definition at line 4901 of file nvrm_memmgr_safe.h.

◆ NvRmMemorySync

#define NvRmMemorySync ( )    SAFE_ASM volatile("dsb sy" : : : "memory")

Description: This should be called after CPU writes to NvOsMemAttribute_WriteCombined memory, in order to ensure coherency with hardware engines.

Definition at line 173 of file nvrm_memmgr_safe.h.

◆ SAFE_ASM

#define SAFE_ASM   asm

Definition at line 27 of file nvrm_memmgr_safe.h.

◆ SID_MAP

#define SID_MAP   (HWID_MAP/NUM_SMMU_INSTANCES)

Definition at line 5471 of file nvrm_memmgr_safe.h.

Typedef Documentation

◆ NvRmHeap

typedef enum NvRmHeap NvRmHeap

Covers: [Libnvrm_mem_SWUD_501].

typedef for NvRmHeap enum

Definition at line 292 of file nvrm_memmgr_safe.h.

◆ NvRmMemChInfo

linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end:

Covers: [Libnvrm_mem_SWUD_505]

typdedef for NvRmMemChInfoRec struct

Definition at line 606 of file nvrm_memmgr_safe.h.

◆ NvRmMemDesc

typedef struct NvRmMemDescRec NvRmMemDesc

Covers: [Libnvrm_mem_SWUD_503].

The structure covers: |LibNvrm_Mem_004|

typdef for NvRmMemDescRec structure

Definition at line 530 of file nvrm_memmgr_safe.h.

◆ NvRmMemEvent

typedef enum NvRmMemEvent NvRmMemEvent

linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end:

Covers: [Libnvrm_mem_SWUD_506]

typedef for NvRmMemEvent enum

Definition at line 649 of file nvrm_memmgr_safe.h.

◆ NvRmMemGpuAccess

Covers: [Libnvrm_mem_SWUD_504].

typedef for NvRmMemGpuAccess enum

Definition at line 561 of file nvrm_memmgr_safe.h.

◆ NvRmMemHandle

typedef struct NvRmMemRec* NvRmMemHandle

Definition at line 160 of file nvrm_memmgr_safe.h.

◆ NvRmMemHandleAttr

Covers: [Libnvrm_mem_SWUD_507].

typedef for NvRmMemHandleAttrRec struct

Definition at line 810 of file nvrm_memmgr_safe.h.

◆ NvRmMemHandleParams

Covers: [Libnvrm_mem_SWUD_508].

typedef for NvRmMemHandleParamsRec struct

Definition at line 872 of file nvrm_memmgr_safe.h.

◆ NvRmMemHeapParams

Covers: [Libnvrm_mem_SWUD_509].

typedef for NvRmMemHeapParamsRec struct

Definition at line 920 of file nvrm_memmgr_safe.h.

◆ NvRmMemKind

typedef enum NvRmMemKind NvRmMemKind

◆ NvRmMemSciIpcId

typedef NvU64 NvRmMemSciIpcId

typedef for 64 bits unique Id

Definition at line 178 of file nvrm_memmgr_safe.h.

◆ NvRmMemTags

typedef enum NvRmMemTags NvRmMemTags

Covers: [Libnvrm_mem_SWUD_502].

typedef for NvRmMemTags enum

Definition at line 482 of file nvrm_memmgr_safe.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
NVRM_MEM_STAT_HEAPS 
NVRM_MEM_STAT_BUFFERS 
NVRM_MEM_STAT_IOVA 
NVRM_MEM_STAT_PROCS 
NVRM_MEM_STAT_REUSE 

Definition at line 5719 of file nvrm_memmgr_safe.h.

◆ NvRmHeap

enum NvRmHeap

Covers: [Libnvrm_mem_SWUD_101].

NvRm heap enumeration. These members imply the different types of the heaps which can be used for allocation of buffer. Magic numbers are assigned to some of the members for maintaining backward compatibility.

Enumerator
NvRmHeap_IOMMU 

IOMMU heap allocates non-contiguous memory from System heap.

Maps memory into H/W modules visible contiguous virtual address space (IOVA space).

NvRmHeap_ExternalCarveOut 

Carve-out memory heap within external memory.

NvRmHeap_VPR 

Video Protection Region(VPR) heap.

NvRmHeap_IVC 

Inter partition heap.

Relevant only in virtualized environment. 2 Guest OSs can share a common memory pool.

NvRmHeap_VidMem 

Video Memory heap.

NvRmHeap_CvsRam 

CvsRam Heap.

NvRmHeap_SyncptRam 

SyncpointRam memory heap.

NvRmHeap_FsiMem 

FSI memory heap.

NvRmHeap_GpuMem 

GPU memory heap.

This heap is intended to be used for allocating memory buffers for GPU use. It would allocate memory in physically contiguous chunks with chunk size specified via device tree.

NvRmHeap_PcieMmio 

PCIe MMIO carveout for C2C.

NvRmHeap_ViMem 

VI mempool memory heap.

NvRmHeap_Num 

Heap number.

NvRmHeap_Force32 

Max enum value.

Definition at line 227 of file nvrm_memmgr_safe.h.

◆ NvRmMemEvent

linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end:

Covers: [Libnvrm_mem_SWUD_105]

Events that can be requested on a Handle.

Enumerator
NVRMMEM_EVENT_FREE 

Buffer Memory Free Event for a buffer referenced by handle.

It can be enabled per handle.

NVRMMEM_EVENT_SINGLETON 

Singleton Event for a buffer referenced by handle.

This event is triggered when there is only one client present holding reference to a handle. It can be enabled per handle.

NVRMMEM_EVENT_MAX 

Supported Event count.

NvRmMemEvent_Force32 

Max enum value.

Definition at line 617 of file nvrm_memmgr_safe.h.

◆ NvRmMemGpuAccess

Covers: [Libnvrm_mem_SWUD_103].

Enum defining the GPU access hints for memory allocation requests. When Clients request for GPU accessible memory, The memory allocated is guaranteed to have GPU accesses enabled for it. When Clients request memory that does not require GPU access, GPU access may be allowed/disallowed based on specific system (safety/non-safety) memory access policy. It is possible that memory allocated can have GPU access, If the system is not enforcing strict memory protection for GPU accesses.

Enumerator
NvRmMemGpuAccess_NO_GPU 

GPU access is not necessary.

NvRmMemGpuAccess_IGPU 

iGPU access must be allowed

NvRmMemGpuAccess_DGPU 

dGPU access must be allowed

NvRmMemGpuAccess_GPU 

iGPU and dGPU access must be allowed

NvRmMemGpuAccess_Force32 

Max enum value.

Definition at line 543 of file nvrm_memmgr_safe.h.

◆ NvRmMemKind

Enumerator
NvRmMemKind_Pitch 

While technically valid, pitch kind implies not blocklinear.

NvRmMemKind_C32_2CRA 

Compressible kind for 32bpp color surfaces.

2 compression bits per tile, ZBC, reduction or arithmetic compression. Equivalent to Generic 16Bx2 when uncompressed.

NvRmMemKind_C64_2CRA 

Compressible kind for 64bpp color surfaces.

2 compression bits per tile, ZBC, reduction or arithmetic compression. Equivalent to Generic 16Bx2 when uncompressed.

NvRmMemKind_Generic_16Bx2 

Generic 16B x 2.

NvRmMemKind_Invalid 

Hardware defined "invalid" kind.

NvRmMemKind_Num 
NvRmMemKind_Force32 

Definition at line 191 of file nvrm_memmgr_safe.h.

◆ NvRmMemTags

@IgnoreForDoc Covers: [Libnvrm_mem_SWUD_X]

NvRmMemTags are used for differentiating allocations from various subsystems/modules. All allocation requests from clients should be tagged with one of the NvRmMemTags enumeration. Developers are encouraged to add more tags as necessary to differentiate memory usage from various modules. It has been deprecated.

Enumerator
NvRmMemTags_None 

Note: The magic number is assigned for maintaining backward compatibility.

NvRmMemTags_Egl 

Note: The magic number is assigned for maintaining backward compatibility.

Tag for allocation from Graphics client.

NvRmMemTags_Camera 

Note: The magic number is assigned for maintaining backward compatibility.

Tag for allocation from Camera client.

NvRmMemTags_Codecs 

Note: The magic number is assigned for maintaining backward compatibility.

NvRmMemTags_Display 

Note: The magic number is assigned for maintaining backward compatibility.

Tag for allocation from Display client.

NvRmMemTags_Mm 

Note: The magic number is assigned for maintaining backward compatibility.

Tag for allocation from multimedia client.

NvRmMemTags_MmSecurity 
NvRmMemTags_OpenMax 
NvRmMemTags_Wsi 

Note: The magic number is assigned for maintaining backward compatibility.

Tag for allocation from WSI.

NvRmMemTags_Glsi 
NvRmMemTags_Cuda 

Note: The magic number is assigned for maintaining backward compatibility.

Tag for allocation from Cuda client.

NvRmMemTags_Rm 

Note: The magic number is assigned for maintaining backward compatibility.

Tag for allocation from RM client.

NvRmMemTags_NvRmGpuSwizzler 
NvRmMemTags_System 

Note: The magic number is assigned for maintaining backward compatibility.

NvRmMemTags_Odm 

Note: The magic number is assigned for maintaining backward compatibility.

Tag for allocation from ODM.

NvRmMemTags_Gralloc 

Note: The magic number is assigned for maintaining backward compatibility.

NvRmMemTags_OpenMaxCamera 

Note: The magic number is assigned for maintaining backward compatibility.

NvRmMemTags_X11 

Note: The magic number is assigned for maintaining backward compatibility.

Tag for allocation from X11 client.

NvRmMemTags_Ddk2d 

Note: The magic number is assigned for maintaining backward compatibility.

NvRmMemTags_DdkVic 
NvRmMemTags_RmApiTegraClient 

Note: The magic number is assigned for maintaining backward compatibility.

Tag for allocation from Tegra client.

NvRmMemTags_RmApiTegraInternal 
NvRmMemTags_RmApiTegraImage 
NvRmMemTags_RmApiTegraColor 
NvRmMemTags_RmApiTegraDepth 
NvRmMemTags_RmApiTegraStencil 
NvRmMemTags_RmApiTegraAccum 
NvRmMemTags_RmApiTegraClipId 
NvRmMemTags_RmApiTegraAux 
NvRmMemTags_RmApiTegraGvo 
NvRmMemTags_RmApiTegraGvi 
NvRmMemTags_RmApiTegraIg 
NvRmMemTags_RmApiTegraTexture 
NvRmMemTags_RmApiTegraVideo 
NvRmMemTags_RmApiTegraFont 
NvRmMemTags_RmApiTegraCursor 
NvRmMemTags_RmApiTegraDma 
NvRmMemTags_RmApiTegraInstance 
NvRmMemTags_RmApiTegraPrimary 
NvRmMemTags_RmApiTegraZcull 
NvRmMemTags_RmApiTegraUnused 
NvRmMemTags_RmApiTegraShaderProgram 
NvRmMemTags_RmApiTegraOwnerRm 
NvRmMemTags_RmApiTegraNotifier 
NvRmMemTags_RmApiTegraReserved 
NvRmMemTags_Tvmr 

Note: The magic number is assigned for maintaining backward compatibility.

Tag for allocation from video mixer renderer client.

NvRmMemTags_VideoEnc 

Note: The magic number is assigned for maintaining backward compatibility.

Tag for allocation from Video Encoder client.

NvRmMemTags_Tests 

Note: The magic number is assigned for maintaining backward compatibility.

NvRmMemTags_VideoDec 

Note: The magic number is assigned for maintaining backward compatibility.

Tag for allocation from Video Decoder client.

NvRmMemTags_Jpeg 

Note: The magic number is assigned for maintaining backward compatibility.

Tag for allocation from jpeg

NvRmMemTags_NvMapTest 
NvRmMemTags_CpuVprTest 
NvRmMemTags_NvRmGpuTests 
NvRmMemTags_Vpr 
NvRmMemTags_NvDLA0 

Note: The magic number is assigned for maintaining backward compatibility.

Tag for allocation from DLA client.

NvRmMemTags_NvDLA1 

Note: The magic number is assigned for maintaining backward compatibility.

Tag for allocation from DLA client.

NvRmMemTags_PVA 

Note: The magic number is assigned for maintaining backward compatibility.

Tag for allocation from PVA client.

NvRmMemTags_NvSci 

Note: The magic number is assigned for maintaining backward compatibility.

Tag for allocation from NvSci client.

NvRmMemTags_CuLDPC 
NvRmMemTags_NVN 

Note: The magic number is assigned for maintaining backward compatibility.

Tag for allocation from NVN client.

NvRmMemTags_CuDLA 

Note: The magic number is assigned for maintaining backward compatibility.

Tag for allocation from CuDLA client.

Definition at line 312 of file nvrm_memmgr_safe.h.

Function Documentation

◆ NvRmMemCacheSyncForCpu()

NvError NvRmMemCacheSyncForCpu ( NvRmMemHandle  hMem,
void *  pMapping,
NvU64  Size 
)

@IfaceTagForDoc qnx_sr_only_doxygen_start: Covers: [Libnvrm_mem_SWUD_21] qnx_sr_only_doxygen_end:

Interface-Description:

This should be called after HW writes to memory and before CPU access it, to avoid CPU getting stale data from data cache. In other words, before CPU can take over ownership of buffer from HW. Memory(pMapping) must be mapped into the calling process.

If the memory represented by handle has been allocated as NvOsMemAttribute_WriteBack, this API cleans and invalidates the range of the memory from the data cache.

If the memory represented by handle has been allocated as NvOsMemAttribute_WriteCombined, the API doesn't perform clean+invalidation. It just ensures that subsequent reads go to buffer memory.

This is needed for IO-coherency enabled clients.

qnx_sr_only_doxygen_start: Description:

The interface covers: |LibNvrm_Mem_004|, |LibNvrm_Mem_005|, |LibNvrm_Mem_006|, |LibNvrm_Mem_007|, |LibNvrm_Mem_010|, |LibNvrm_Mem_001|, |LibNvrm_Mem_009|, |LibNvrm_Mem_013|, |LibNvrm_Mem_017|, |LibNvrm_Mem_008|

This function invalidates the range of the memory from the data cache in WriteBack case, and ensures that subsequent reads go to buffer memory in WriteCombined case.

Function-uml:

.NvRmMemCacheSyncForCpu [plantuml, NvRmMemCacheSyncForCpu, svg, subs=attributes, align=center] .... .... qnx_sr_only_doxygen_end:

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

Parameters
[in]hMemNvRmMemHandle Desc: A memory handle returned from qnx_sr_only_doxygen_start: NvRmMemHandleAllocAttr/FromImportId/FromSciIpcId(). qnx_sr_only_doxygen_end: linux_nsr_only_doxygen_start: NvRmMemHandleAllocAttr/FromFd/FromSciIpcId(). linux_nsr_only_doxygen_end: Range: [1, 2^32-1]
[in]pMappingvoid* Desc: Starting address (start address and start address + Size, must be within the mapped region of the hMem) to cache sync. Range: Valid void pointer
[in]SizeNvU64 Desc: The number of bytes that need data cache sync. Range: [0, 2^64-1]
Return values
NvSuccessCache sync operation is successful.
NvError_BadParameter1. Input parameter "hMem" is not a valid handle
  1. Input parameter "pMapping" is not a valid virtual address qnx_sr_only_doxygen_start:
  2. Input parameter "Size" is either > "hMem" buffer size or 0 qnx_sr_only_doxygen_end: linux_nsr_only_doxygen_start:
  1. Input parameter "Size" is invalid
NvError_AccessDeniedCaller process doesn't have privilege to call this API.
NvError_IoctlFailedIoctl call has failed linux_nsr_only_doxygen_end:
NvError_NotInitializedIf memory services lib not initialized

◆ NvRmMemCacheSyncForDevice()

NvError NvRmMemCacheSyncForDevice ( NvRmMemHandle  hMem,
void *  pMapping,
NvU64  Size 
)

@IfaceTagForDoc qnx_sr_only_doxygen_start: Covers: [Libnvrm_mem_SWUD_22] qnx_sr_only_doxygen_end:

Interface-Description:

This should be called after CPU writes to memory and before HW access it, to avoid HW getting stale data from memory. In other words, before HW can take over ownership of buffer from CPU. Memory(pMapping) must be mapped into the calling process.

If the memory represented by handle has been allocated as NvOsMemAttribute_WriteBack, this API cleans and invalidates the range of the memory from the data cache.

If the memory represented by handle has been allocated as NvOsMemAttribute_WriteCombined, the API doesn't perform clean+invalidation. It just ensures the data written to WriteCombined buffer through CPU reaches buffer memory. i.e writes are no longer pending in CPU write pipeline to reach the buffer memory.

If the handle memory has been allocated as cached, The default ownership of buffer is with CPU.

qnx_sr_only_doxygen_start: Description:

The interface covers: |LibNvrm_Mem_004|, |LibNvrm_Mem_005|, |LibNvrm_Mem_006|, |LibNvrm_Mem_007|, |LibNvrm_Mem_010|, |LibNvrm_Mem_001|, |LibNvrm_Mem_009|, |LibNvrm_Mem_013|, |LibNvrm_Mem_017|, |LibNvrm_Mem_008|

This function peform cache clean operation for the range of the memory specified, in WriteBack case while in WriteCombined cases it just ensures the data written to WriteCombined buffer through CPU reaches buffer memory.

Function-uml:

.NvRmMemCacheSyncForDevice [plantuml, NvRmMemCacheSyncForDevice, svg, subs=attributes, align=center] .... .... qnx_sr_only_doxygen_end:

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

Parameters
[in]hMemNvRmMemHandle Desc: A memory handle returned from NvRmMemHandleAllocAttr/FromImportId/FromSciIpcId() qnx_sr_only_doxygen_start: NvRmMemHandleAllocAttr/FromImportId/FromSciIpcId(). qnx_sr_only_doxygen_end: linux_nsr_only_doxygen_start: NvRmMemHandleAllocAttr/FromFd/FromSciIpcId(). linux_nsr_only_doxygen_end: Range: [1, 2^32-1]
[in]pMappingvoid* Desc: Starting address (start address and start address + Size, must be within the mapped region of the hMem) to cache sync. Range: Valid void pointer
[in]SizeNvU64 Desc: The number of bytes that need data cache sync. Range: [0, 2^64-1]
Return values
NvSuccessCache sync operation is successful.
NvError_BadParameter1. Input parameter "hMem" is not a valid handle
  1. Input parameter "pMapping" is not a valid virtual address qnx_sr_only_doxygen_start:
  2. Input parameter "Size" is either > "hMem" buffer size or 0 qnx_sr_only_doxygen_end: linux_nsr_only_doxygen_start:
  1. Input parameter "Size" is invalid
NvError_AccessDeniedCaller process doesn't have privilege to call this API.
NvError_IoctlFailedIoctl call has failed linux_nsr_only_doxygen_end:
NvError_NotInitializedIf memory services lib not initialized

◆ NvRmMemDisableEvent()

NvError NvRmMemDisableEvent ( NvRmMemHandle  hMem,
NvRmMemEvent  event 
)

linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end:

@IfaceTagForDoc Covers: [Libnvrm_mem_SWUD_30]

Interface-Description:

Constraints: Before calling any memory services interfaces, it is expected to call NvRmMemMgrInit() once in client process to initialize memory services library and also, to create channel between client process and nvmap resource manager.

Disable requested event notification for memory handle.

It is possible that while a disable request is under process, Event can arrive and client can get a callback. Client should be able to handle callback while event disable request is in progress.

If an application wants to access this interface, it needs to be launched with "NvMap/Interfaces" ability with DISABLE_EVENT_INTERFACE_ABILITY ID.

"-A nonroot,allow,able=NvMap/Interfaces:<ability ID>" should be part of process launch command.

Description:

The interface covers: |LibNvrm_Mem_002|, |LibNvrm_Mem_008|, |LibNvrm_Mem_004|, |LibNvrm_Mem_005|, |LibNvrm_Mem_006|, |LibNvrm_Mem_009|, |LibNvrm_Mem_013|, |LibNvrm_Mem_017|, |LibNvrm_Mem_007|, |LibNvrm_Mem_010|

This function disable requested event notification for memory handle. It validates the input handle id argument and call the corresponding ioctl to disable event.

Function-uml:

.NvRmMemDisableEvent [plantuml, NvRmMemDisableEvent, svg, subs=attributes, align=center] .... ....

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

Parameters
[in]hMemNvRmMemHandle Desc: Handle to disable event for. Range: [1, 2^32-1]
[in]eventNvRmMemEvent Desc: Event to disable for the handle. Range: Valid member of NvRmMemEvent enum
Return values
NvSuccessOperation is successful.
NvError_BadParameterInvalid args.
NvError_NotInitializedIf memory services lib not initialized

◆ NvRmMemDmaMap()

NvError NvRmMemDmaMap ( NvRmMemHandle  hMem,
NvU64  hwid,
NvU64  Offset,
NvU64  Size,
NvU32  Flags,
NvU64 *  pIovaAddr 
)

linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end:

@IfaceTagForDoc Covers: [Libnvrm_mem_SWUD_17]

Interface-Description:

Constraints: Before calling any memory services interfaces, it is expected to call NvRmMemMgrInit() once in client process to initialize memory services library and also, to create channel between client process and nvmap resource manager.

API to map the buffer memory into HW Engine's IOVA space.

It is legal to request multiple concurrent maps on a memory buffer. If the size passed is zero, then entire buffer would be mapped. Partial memory buffer map is supported. The API would return physical address(not IOVA) if the HW device doesn't have SMMU translation enabled.

For SMMU stage-1 disabled clients (ISO clients), the interface returns the IPA address of the buffer, IPA address is an IOVA address for the SMMU stage-2.

If an application wants to access this interface, it needs to be launched with "NvMap/Interfaces" ability with below ability ID

  • DMA_MAP_INTERFACE_ABILITY ID "SMMU/SID" ability with SID it owns for SMMU instance 0 "SMMU1/SID" ability with SID it owns for SMMU instance 1 "SMMU2/SID" ability with SID it owns for SMMU instance 2

"-A nonroot,allow,able=NvMap/Interfaces:<ability ID>" "-A nonroot,allow,able=SMMU0/SID:<SID the process owns>" "-A nonroot,allow,able=SMMU1/SID:<SID the process owns>" "-A nonroot,allow,able=SMMU2/SID:<SID the process owns>" should be part of process launch command.

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

Description:

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

This function map the buffer memory into HW Engine's IOVA space. It validate the handle parameter.

Function-uml:

.NvRmMemDmaMap [plantuml, NvRmMemDmaMap, svg, subs=attributes, align=center] .... ....

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

Parameters
[in]hMemNvRmMemHandle Desc: An opaque memory handle. Range: [1, 2^32-1]
[in]hwidNvU64 Desc: Predefined Hardware ID, specified in device tree, represents a HW engine. Range: Valid SID as per HW support
[in]OffsetNvU64 Desc: Offset within the handle memory, from which mapping will start. Range: [0, 2^64-1]
[in]SizeNvU64 Desc: Size of memory to be mapped. Range: [0, 2^64-1]
[in]FlagsNvU32 Desc: Access control Flags. It can be NVOS_MEM_READ/READ_WRITE. Range: Valid Flags
[out]pIovaAddrNvU64 * Desc: If mapping successful, it will have IOVA start address for memory access from hardware. Range: Valid u64 pointer
Return values
NvSuccessMapping into IOVA space is successful and IOVA address is returned in pIovaAddr.
NvError_InsufficientMemoryOut of IOVA address space and hence the mapping failed.
NvError_BadParameter1. Input Parameter "hMem" is not a valid handle.
  1. Input Parameter "hwid" is not a valid hardware engine id.
  2. Input Parameter "Size" is invalid.
  3. Input Parameter "Size" > "hMem" buffer size.
  4. Input Parameter "Offset" > "hMem" buffer size.
  5. Input Parameter "Offset" > "hMem" buffer size - "Size".
  6. Input Parameter "Flags" is neither NVOS_MEM_READ nor NVOS_MEM_READ_WRITE.
NvError_AccessDeniedCaller process doesn't have privilege to call this API.
NvError_NotInitializedIf memory services lib not initialized

◆ NvRmMemDmaMapMult()

NvError NvRmMemDmaMapMult ( NvRmMemHandle *  hMem,
NvU64  hwid,
NvU64  Offset,
NvU64  Size,
NvU32  Flags,
NvU64 *  pIovaAddr,
NvU32  NumHandles 
)

linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end:

@IfaceTagForDoc Covers: [Libnvrm_mem_SWUD_18]

Interface-Description:

Constraints: Before calling any memory services interfaces, it is expected to call NvRmMemMgrInit() once in client process to initialize memory services library and also, to create channel between client process and nvmap resource manager.

Multiple Handle version of NvRmMemDmaMap(). Refer to NvRmMemDmaMap() API for usage details.

If an application wants to access this interface, it needs to be launched with "NvMap/Interfaces" ability with below ability ID

  • DMA_MAP_INTERFACE_ABILITY ID "SMMU/SID" ability with SID it owns for SMMU instance 0 "SMMU1/SID" ability with SID it owns for SMMU instance 1 "SMMU2/SID" ability with SID it owns for SMMU instance 2

"-A nonroot,allow,able=NvMap/Interfaces:<ability ID>" "-A nonroot,allow,able=SMMU0/SID:<SID the process owns>" "-A nonroot,allow,able=SMMU1/SID:<SID the process owns>" "-A nonroot,allow,able=SMMU2/SID:<SID the process owns>"

Description:

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

The function is used to map multiple handles into the HW Engine's IOVA space. It validate the input parameters like handle id, hw id, IOVA address, flags and call the corresponding the ioctl for mapping the handles.

Function-uml:

.NvRmMemDmaMapMult [plantuml, NvRmMemDmaMapMult, svg, subs=attributes, align=center] .... ....

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

Parameters
[in]hMemNvRmMemHandle* Desc: Array of Memory handles representing memory buffers. Range: Valid pointer to NvRmMemHandle
[in]hwidNvU64 Desc: Predefined Hardware ID, specified in device tree, represents a HW engine. Range: Valid SID as per HW support
[in]OffsetNvU64 Desc: Offset within the handle memory, from which mapping will start. The offset value should not be greater than handle size. Range: [0, 2^64-1]
[in]SizeNvU64 Desc: Size of memory to be mapped. Range: [0, 2^64-1]
[in]FlagsNvU32 Desc: Access control Flags. It can be NVOS_MEM_READ/READ_WRITE. Range: Valid Flags
[out]pIovaAddrNvU64* Desc: Array that returns IOVA addresses. Range: Valid unsigned 64 bit pointer
[in]NumHandlesNvU32 Desc: Number of handles in hMem array. Range: [1, 2^32-1]
Return values
NvSuccessMapping into IOVA space is successful and IOVA address is returned in pIovaAddr.
NvError_InsufficientMemoryOut of IOVA address space and hence the mapping failed.
NvError_BadParameter1. Input Parameter "hMem" is not a valid handle array.
  1. Input Parameter "hwid" is not a valid hardware engine id.
  2. Input Parameter "Size" is invalid.
  3. Input Parameter "Size" > "hMem" buffer size.
  4. Input Parameter "Offset" > "hMem" buffer size.
  5. Input Parameter "Offset" > "hMem" buffer size - "Size".
  6. Input Parameter "Flags" is neither NVOS_MEM_READ nor NVOS_MEM_READ_WRITE.
NvError_AccessDeniedCaller process doesn't have privilege to call this API.
NvError_NotInitializedIf memory services lib not initialized

◆ NvRmMemDmaUnmap()

NvError NvRmMemDmaUnmap ( NvRmMemHandle  hMem,
NvU64  hwid,
NvU64  IovaAddr,
NvU64  Size 
)

linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end:

@IfaceTagForDoc Covers: [Libnvrm_mem_SWUD_19]

Interface-Description:

Constraints: Before calling any memory services interfaces, it is expected to call NvRmMemMgrInit() once in client process to initialize memory services library and also, to create channel between client process and nvmap resource manager.

API to unmap the IOVA address range specified from HW Engine's IOVA space.

Partial unmap of buffer mappings is not supported. Size passed to Unmap request should match with Size used during map request. Passing Size as zero would perform full unmap on a mapping passed.

The buffer should not be DMA unmapped for a HW device while it is being used by the hardware device.

For SMMU stage-1 enabled clients, the interface

  • Unmaps the virtual address from client’s IO virtual address space (IOVA).
  • Programs the dual virtual SMMU identically.
  • Ensures that mutual exclusion is enforced when accessing virtual SMMU registers from multiple VCPUs of the same VM.

For SMMU stage-1 disabled clients(ISO clients), it just performs refrence count decrement.

If an application wants to access this interface, it needs to be launched with "NvMap/Interfaces" ability with below ability ID

  • DMA_UNMAP_INTERFACE_ABILITY ID "SMMU/SID" ability with SID it owns for SMMU instance 0 "SMMU1/SID" ability with SID it owns for SMMU instance 1 "SMMU2/SID" ability with SID it owns for SMMU instance 2

"-A nonroot,allow,able=NvMap/Interfaces:<ability ID>" "-A nonroot,allow,able=SMMU0/SID:<SID the process owns>" "-A nonroot,allow,able=SMMU1/SID:<SID the process owns>" "-A nonroot,allow,able=SMMU2/SID:<SID the process owns>"

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

Description:

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

This function unmap the specified IOVA address range from HW Engine's IOVA space. It validate the input handle id and then call multiple handle version of this API with number of handles as 1, which would call the corresponding unamp ioctl.

Function-uml:

.NvRmMemDmaUnmap [plantuml, NvRmMemDmaUnmap, svg, subs=attributes, align=center] .... ....

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

Parameters
[in]hMemNvRmMemHandle Desc: An opaque memory handle. Last two bits are reserved for cache attributes. Range: [1, 2^32-1]
[in]hwidNvU64 Desc: Predefined Hardware ID, specified in device tree, represents a HW engine. Range: Valid SID as per HW support
[in]IovaAddrNvU64 Desc: Start address of IOVA range to unmap. Range: [0, 2^64-1]
[in]SizeNvU64 Desc: Size of IOVA memory to unmap. Range: [0, 2^64-1]
Return values
NvSuccessRemoval of IOVA mapping successful.
NvError_BadParameter1. Input Parameter "hMem" is not a valid handle.
  1. Input Parameter "hwid" is not a valid hardware engine id.
  2. Input Parameter "IovaAddr" is invalid.
  3. Input Parameter "Size" is not 0 or "Size" does not match with the size used during map request.
NvError_AccessDeniedCaller process doesn't have privilege to call this API.
NvError_NotInitializedIf memory services lib not initialized

◆ NvRmMemDmaUnmapMult()

NvError NvRmMemDmaUnmapMult ( NvRmMemHandle *  hMem,
NvU64  hwid,
NvU64 *  pIovaAddr,
NvU64 *  Size,
NvU32  NumHandles 
)

linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end:

@IfaceTagForDoc Covers: [Libnvrm_mem_SWUD_20]

Interface-Description:

Constraints: Before calling any memory services interfaces, it is expected to call NvRmMemMgrInit() once in client process to initialize memory services library and also, to create channel between client process and nvmap resource manager.

Multiple Handle version of NvRmMemDmaUnmap(). Refer to NvRmMemDmaUnmap() API for usage details.

If an application wants to access this interface, it needs to be launched with "NvMap/Interfaces" ability with below ability ID

  • DMA_UNMAP_INTERFACE_ABILITY ID "SMMU/SID" ability with SID it owns for SMMU instance 0 "SMMU1/SID" ability with SID it owns for SMMU instance 1 "SMMU2/SID" ability with SID it owns for SMMU instance 2

"-A nonroot,allow,able=NvMap/Interfaces:<ability ID>" "-A nonroot,allow,able=SMMU0/SID:<SID the process owns>" "-A nonroot,allow,able=SMMU1/SID:<SID the process owns>" "-A nonroot,allow,able=SMMU2/SID:<SID the process owns>"

Description:

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

This function unmap multiple handles from HW Engine's IOVA space. It validate the input arguments like handle id, hwid, IOVA address etc and call the corresponding ioctl.

Function-uml:

.NvRmMemDmaUnmapMult [plantuml, NvRmMemDmaUnmapMult, svg, subs=attributes, align=center] .... ....

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

Parameters
[in]hMemNvRmMemHandle* Desc: Array of Memory handles representing buffer memory. Range: Valid pointer to NvRmMemHandle
[in]hwidNvU64 Desc: Predefined Hardware ID, specified in device tree, represents a HW engine. Range: Valid SID as per HW support
[in]IovaAddrNvU64 Desc: Array of IOVA start Addresses of IOVA ranges to unmap. Range: Valid pointer to array of addresses where every element range in [0, 2^64-1]
[in]SizeNvU64 Desc: Size of IOVA memory to unmap. Range: Valid pointer to size
[in]NumHandlesNvU32 Desc: Number of handles in hMem array. Range: [1, 2^32-1]
Return values
NvSuccessRemoval of IOVA mapping successful.
NvError_BadParameter1. Input Parameter "hMem" is not a valid handle.
  1. Input Parameter "hwid" is not a valid hardware engine id.
  2. Input Parameter "IovaAddr" is invalid.
  3. Input Parameter "Size" is not NULL.
NvError_AccessDeniedCaller process doesn't have privilege to call this API.
NvError_NotInitializedIf memory services lib not initialized

◆ NvRmMemEnableEvent()

NvError NvRmMemEnableEvent ( NvRmMemHandle  hMem,
NvRmMemEvent  event,
void *  priv,
NvU32  PrivSize,
void(*)(NvRmMemEvent event, void *priv, NvU32 PrivSize)  OnEvent 
)

linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end:

@IfaceTagForDoc Covers: [Libnvrm_mem_SWUD_29]

Interface-Description:

Constraints: Before calling any memory services interfaces, it is expected to call NvRmMemMgrInit() once in client process to initialize memory services library and also, to create channel between client process and nvmap resource manager.

Enable event notification for a memory handle and register a callback.

On enabling NVRMMEM_EVENT_FREE event for a handle, Memory manager would send the event after the buffer referenced by handle is free'ed. For a shared buffer, It is possible that handle is released much earlier than the buffer memory. The hMem passed here wouldn't be the same(either invalid or might have been recycled) when the buffer free event arrives.

Memory Services neither waits for ack from clients nor holds releasing any resources related to buffer. It is expected that clients would pass private data during the event register and use the same to release appropriate resources when the event is notified.

If an application wants to access this interface, it needs to be launched with "NvMap/Interfaces" ability with ENABLE_EVENT_INTERFACE_ABILITY ID.

"-A nonroot,allow,able=NvMap/Interfaces:<ability ID>" should be part of process launch command.

Description:

The interface covers: |LibNvrm_Mem_002|, |LibNvrm_Mem_008|, |LibNvrm_Mem_004|, |LibNvrm_Mem_005|, |LibNvrm_Mem_006|, |LibNvrm_Mem_009|, |LibNvrm_Mem_013|, |LibNvrm_Mem_017|, |LibNvrm_Mem_007|, |LibNvrm_Mem_010|

This function enable event notification for a memory handle and register a callback. It validates the input arguments like handle, event handler and call the corresponding ioctl.

Function-uml:

.NvRmMemEnableEvent [plantuml, NvRmMemEnableEvent, svg, subs=attributes, align=center] .... ....

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

Parameters
[in]hMemNvRmMemHandle Desc: Handle to enable event for. Range: [1, 2^32-1]
[in]eventNvRmMemEvent Desc: Event to enable for the handle. Range: Valid member of NvRmMemEvent enum
[in]privvoid* Desc: pointer to priv data struct to be passed during callback. Range: Valid void pointer
[in]PrivSizeNvU32 Desc: size of priv data struct to be passed during callback. Range: [0, 2^32-1]
[in]OnEventvoid (*OnEvent)(NvRmMemEvent event, void *priv, NvU32 PrivSize) Desc: callback function to be called on event. The callback function need to be reentrant, if the same callback is registered for multiple handles/events. It is possible that the callback(s) registered for various handles/events be called simultaneously based on the design. Range: Valid function pointer
Return values
NvSuccessOperation is successful.
NvError_BadParameterInvalid args.
NvError_NotInitializedIf memory services lib not initialized
NvError_BadValueIf NvRmMemGetEventId failed

◆ NvRmMemFreeIovaRegion()

NvError NvRmMemFreeIovaRegion ( NvU64  hwid,
struct NvRmMemIovaInfo *  IovaInfo 
)

linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end:

Covers: [Libnvrm_mem_SWUD_92]

@IfaceTagForDoc

Interface-Description:

Constraints: Before calling any memory services interfaces, it is expected to call NvRmMemMgrInit() once in client process to initialize memory services library and also, to create channel between client process and nvmap resource manager.

Interface to free IOVA region without physical baking for fixed mapping

If an application wants to access this interface, it needs to be launched with "NvMap/Interfaces" ability with below ability id.

  • RESERVE_IOVA_REGION_INTERFACE_ABILITY ID

"-A nonroot,allow,able=NvMap/Interfaces:<bility ID>" should be part of process launch command.

Description:

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

Interface to free IOVA region without physical baking for fixed mapping

Function-uml:

.NvRmMemFreeIovaRegion [plantuml, NvRmMemFreeIovaRegion, svg, subs=attributes, align=center] .... ....

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

Parameters
[in]hwidNvU64 Desc: hwid of the device Range: [0, 2^64-1]
[in]IovaInfostruct NvRmMemIovaInfo * Desc: IOVA info for the region allocation Range: Valid pointer to NvRmMemIovaInfo
Return values
NvSuccessFreeing of IOVA address-space is successful
NvError_BadValueInput arguments are invalid
NvError_IoctlFailedDevctl call has failed
NvError_NotInitializedIf memory services lib not initialized

◆ NvRmMemGetDmaHwid()

NvError NvRmMemGetDmaHwid ( struct NvRmMemHwidParams *  HwidParams)

linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end:

@IfaceTagForDoc

Covers: [Libnvrm_mem_SWUD_90]

Interface-Description:

Constraints: Before calling any memory services interfaces, it is expected to call NvRmMemMgrInit() once in client process to initialize memory services library and also, to create channel between client process and nvmap resource manager.

The Interface returns hwid using stream id and phandle. Clients are requested to provide stream id and phandle as an input. Each hwid is uniquely mapped to sid on a smmu instance.

If an application wants to access this interface, it needs to be launched with "SMMU/SID" ability with SID it owns for SMMU instance 0 "SMMU1/SID" ability with SID it owns for SMMU instance 1 "SMMU2/SID" ability with SID it owns for SMMU instance 2 "SMMU3/SID" ability with SID it owns for SMMU instance 3 "SMMU4/SID" ability with SID it owns for SMMU instance 4

The below command should be part of process launch command: "-A nonroot,allow,able=SMMU/SID:<SID the process owns>" "-A nonroot,allow,able=SMMU1/SID:<SID the process owns>" "-A nonroot,allow,able=SMMU2/SID:<SID the process owns>" "-A nonroot,allow,able=SMMU3/SID:<SID the process owns>" "-A nonroot,allow,able=SMMU4/SID:<SID the process owns>"

Description:

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

The Interface returns hwid using stream id and phandle. Clients are requested to provide stream id and phandle as an input. Each hwid is uniquely mapped to sid on a smmu instance.

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

Parameters
[in/out]HwidParams struct NvRmMemHwidParams * Desc: struct NvRmMemHwidParams holding stream_id and phandle as input, and hwid as output for DMA mapping Range: valid pointer to struct NvRmMemHwidParams
Return values
NvSuccessValid HWID returned
NvError_BadParameterInvalid argument
NvError_NotInitializedIf memory services lib not initialized

◆ NvRmMemGetHwid()

NvError NvRmMemGetHwid ( NvU32  stream_id,
NvU32  phandle,
NvU32 *  hwid 
)

linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end:

@IfaceTagForDoc

Covers: [Libnvrm_mem_SWUD_90]

Interface-Description:

Constraints: Before calling any memory services interfaces, it is expected to call NvRmMemMgrInit() once in client process to initialize memory services library and also, to create channel between client process and nvmap resource manager.

The Interface returns hwid using stream id and phandle. Each hwid is uniquely mapped to sid on a smmu instance.

If an application wants to access this interface, it needs to be launched with "SMMU/SID" ability with SID it owns for SMMU instance 0 "SMMU1/SID" ability with SID it owns for SMMU instance 1 "SMMU2/SID" ability with SID it owns for SMMU instance 2

The below command should be part of process launch command: "-A nonroot,allow,able=SMMU/SID:<SID the process owns>" "-A nonroot,allow,able=SMMU1/SID:<SID the process owns>" "-A nonroot,allow,able=SMMU2/SID:<SID the process owns>"

Description:

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

The Interface returns hwid using stream id and phandle. Each hwid is uniquely mapped to sid on a smmu instance.

Function-uml:

.NvRmMemGetHwid [plantuml, NvRmMemGetHwid, svg, subs=attributes, align=center] .... ....

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

Parameters
[in]stream_idNvU32 Desc: Stream ID of the client Range: 1 to 128
[in]phandleNvU32 Desc: phandle of the iommu dt node client is referring to Range: Valid phandle
[out]hwidNvU32* Desc: HWID to be used for requesting device map/unmap Range: Valid pointer to NvU32
Return values
NvSuccessValid HWID returned
NvError_BadParameterInvalid argument
NvError_NotInitializedIf memory services lib not initialized

◆ NvRmMemGetImportId()

NvError NvRmMemGetImportId ( NvRmMemHandle  hMem,
NvRmMemChInfo *  ChInfo,
NvU32  Flags,
NvU64 *  ImportId 
)

linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end:

@IfaceTagForDoc Covers: [Libnvrm_mem_SWUD_31]

Interface-Description:

Constraints: Before calling any memory services interfaces, it is expected to call NvRmMemMgrInit() once in client process to initialize memory services library and also, to create channel between client process and nvmap resource manager.

Create an Import Id for the memory handle to allow exporting it Inter-process.

On Qnx: It allows sharing a handle Inter-Process.

To share a handle between an user process and ResMgr, ResMgr's public Channel Id can be used to share handles with ResMgr. Opening dev node of a ResMgr would implicitly create a channel connection between User process and ResMgr. This avoids the need to explicitly establish an additional IPC channel connection between user process and ResMgr and handles can be passed to ResMgr through DevCtl interface (which uses already established channel connection during dev node open) as they have been. ResMgr need to create a handle in its process space from ImportId before it can access the memory associated with handle.

Import Id would be shared on the IPC Channel to share a handle between them.

On Linux: This API is same as NvRmMemGetFd() and returns Fd as ImportId.

On HOS: This API is same as NvRmMemGetId() and returns Id as ImportId.

Notes: Depending on the OS, The process that calls this API would get either ImportId or Id or Fd. The client process should note the following differences in handling these two different types of identifiers returned. The following pseudo code shows the differences between the two types of identifiers.

handle = NvRmMemHandleAllocAttr(...); #if NVOS_IS_LINUX – Sender side fd = NvRmMemGetImportId(handle, ...); <Share Fd with receiving process over Socket> – Note: Once Fd is sent, close() and NvRmMemHandleFree() on Sender side – doesn't impact Receiver's ability to create handle from fd received. close(fd); NvRmMemHandleFree(handle);

– Receiver side NvRmMemHandleFromImportId(fd, &handle_recv, ...); – Can use the handle created from fd as necessary.

#elif (NVOS_IS_QNX || NVOS_IS_HOS) – Sender side import_id = NvRmMemGetImportId(handle, ...); <Share import_id with receiving process over IPC channel>

<wait until receiver has created memory handle> – close() shouldn't be called on import_id as it is not an fd. – Note: Calling NvRmMemHandleFree(handle) before the receiving process calls – NvRmMemHandleFromImportId(...) can fail handle creation on receiving side. NvRmMemHandleFree(handle);

– Receiver side – Note: The Receiver should create handle from import_id before acking the import_id – receive to the sender. This way, NvRmMemHandleFree() on sender side doesn't – impact handle creation on receiver side. NvRmMemHandleFromImportId(import_id, &handle_recv, ...); <Signal the sender that handle is created using the import_id> – Can use the handle created from import_id as necessary. #endif

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

If an application wants to access this interface, it needs to be launched with "NvMap/Interfaces" ability with EXPORT_BUF_INTERFACE_ABILITY ID.

"-A nonroot,allow,able=NvMap/Interfaces:<ability ID>" should be part of process launch command.

Description:

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

This function create an Import Id for the memory handle to allow exporting it Inter-process. It validates input arguments like handle id, channel info, flags and then call the corresponding ioctl.

Function-uml:

.NvRmMemGetImportId [plantuml, NvRmMemGetImportId, svg, subs=attributes, align=center] .... ....

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

Parameters
[in]hMemNvRmMemHandle Desc: Handle to create an Import Id for. Range: [1, 2^32-1]
[in]ChInfoNvRmMemChInfo* Desc: Channel Info that identifies the IPC channel connection between a ResMgr and Its client process or between two user processes. This arg is ignored on Linux and HOS and should be passed as NULL. Range: Valid pointer to NvRmMemChInfo structure
[in]FlagsNvU32 Desc: Holds access permissions(NVOS_MEM_READ/READ_WRITE) allowed with ImportId. The original owner of a handle(whoever allocated it first) can share it with ReadOnly/WriteOnly/ReadWrite permissions. The subsequent receivers of handle can further share handle only within the access permissions they have been allowed. Range: 1, 3
[out]ImportIdNvU64* Desc: Returns an Import Id that can be exported Inter-process. Range: Valid unsigned 32 bit pointer
Return values
NvSuccessCreation of import_id is successful.
NvError_InsufficientMemoryOut of memory and hence the creation of import_id has failed.
NvError_AccessDeniedInput parameter hMem is not accessible.
NvError_BadParameter1. The input parameter Flags is set to any NVOS_FLAGS other than READ/READ_WRITE
  1. The output parameter ImportId points to NULL address
  2. The input parameter importer_pid is 0
NvError_IoctlFailedDevctl call has failed
NvError_NotInitializedIf memory services lib not initialized

◆ NvRmMemGetImportIdMult()

NvError NvRmMemGetImportIdMult ( NvRmMemHandle *  hMem,
NvRmMemChInfo *  ChInfo,
NvU32  Flags,
NvU64 *  ImportId,
NvU32  NumHandles 
)

linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end:

@IfaceTagForDoc Covers: [Libnvrm_mem_SWUD_32]

Interface-Description:

Constraints: Before calling any memory services interfaces, it is expected to call NvRmMemMgrInit() once in client process to initialize memory services library and also, to create channel between client process and nvmap resource manager.

Mutiple Handle version of NvRmMemGetImportId(). Refer to NvRmMemGetImportId() API for usage details.

If an application wants to access this interface, it needs to be launched with "NvMap/Interfaces" ability with EXPORT_BUF_INTERFACE_ABILITY ID.

"-A nonroot,allow,able=NvMap/Interfaces:<ability ID>" should be part of process launch command.

Description:

The interface covers: |LibNvrm_Mem_004|, |LibNvrm_Mem_008|, |LibNvrm_Mem_005|, |LibNvrm_Mem_006|, |LibNvrm_Mem_007|, |LibNvrm_Mem_009|, |LibNvrm_Mem_013|, |LibNvrm_Mem_017|, |LibNvrm_Mem_010|, |LibNvrm_Mem_021|

This function creates Import Ids for the input memory handles. It validates input arguments like handle id, channel info, flags and then call the corresponding ioctl.

Function-uml:

.NvRmMemGetImportIdMult [plantuml, NvRmMemGetImportIdMult, svg, subs=attributes, align=center] .... ....

Allowed-State: Init and nvmap resource manager. Sync/Async: Sync Reentrancy: Reentrant Interrupt-Handler: No Signal-Handler: No Thread-Safe: Yes

Parameters
[in]hMemNvRmMemHandle* Desc: Array of Handles to create an Import Id for. Range: Valid pointer to NvRmMemHandle
[in]ChInfoNvRmMemChInfo* Desc: Channel Info that identifies the IPC channel connection between a ResMgr and Its client process or between two user processes. This arg is ignored on Linux and HOS and should be passed as NULL. Range: Valid pointer to NvRmMemChInfo structure
[in]FlagsNvU32 Desc: Holds access permissions(NVOS_MEM_READ/READ_WRITE) allowed with ImportId. The original owner of a handle(whoever allocated it first) can share it with ReadOnly/WriteOnly/ReadWrite permissions. The subsequent receivers of handle can further share handle only within the access permissions they have been allowed. Range: 1, 3
[out]ImportIdNvU64* Desc: Array of ImportId that returns ImportIds that can be exported Inter-process. Range: Valid unsigned 32 bit pointer
[in]NumHandlesNvU32 Range: [1, 2^32-1]
Return values
NvSuccessCreation of import_id is successful.
NvError_InsufficientMemoryOut of memory and hence the creation of import_id has failed.
NvError_AccessDeniedInput parameter hMem is not accessible.
NvError_BadParameter1. The input parameter Flags is set to any NVOS_FLAGS other than READ/READ_WRITE
  1. The output parameter ImportId points to NULL address
  2. The input parameter ChInfo points to NULL address
NvError_IoctlFailedDevctl call has failed
NvError_NotInitializedIf memory services lib not initialized

◆ NvRmMemGetPhysInfo()

NvError NvRmMemGetPhysInfo ( NvRmMemHandle  hMem,
NvRmMemDesc *  MemDesc,
NvU64  NumDesc,
NvU64 *  NumDescUsed 
)

linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end:

@IfaceTagForDoc Covers: [Libnvrm_mem_SWUD_27]

Interface-Description:

Constraints: Before calling any memory services interfaces, it is expected to call NvRmMemMgrInit() once in client process to initialize memory services library and also, to create channel between client process and nvmap resource manager.

Get the allocated Physical Memory chunks info for the handle. Can be used to get the number of physical chunks allocated with MemDesc passed as NULL.

The physical memory info is valid as long as the client doesn't free hMem after it is gotten.

If an application wants to access this interface, it needs to be launched with "NvMap/Interfaces" ability with GET_PHYS_INFO_INTERFACE_ABILITY ID.

"-A nonroot,allow,able=NvMap/Interfaces:<ability ID>" should be part of process launch command.

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

This API is supported on QNX Only.

Description:

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

This function is used to get the allocated physical memory chunks number, info for the handle. It validate the input parameters and decide whether only number of desc is required or the info about the descriptors is also required and call the corresponding ioctl.

Function-uml:

.NvRmMemGetPhysInfo [plantuml, NvRmMemGetPhysInfo, svg, subs=attributes, align=center] .... ....

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

Parameters
[in]hMemNvRmMemHandle Desc: A memory handle returned by NvRmMemHandleAllocAttr/FromImprotId/FromSciIpcId() Range: [1, 2^32-1]
[out]MemDescNvRmMemDesc * Desc: MemDesc A Memory Descriptor array to hold the physical memory chunks info. Range: Valid pointer to NvRmMemDesc
[in]NumDescNvU64 Desc: MemDesc array size. Range: [0, 2^64-1]
[out]NumDescUsedNvU64* Desc: NumDescUsed Returns the number of MemDesc entries used to return physical memory chunks info. Range: Valid unsigned 64 bit pointer
Return values
NvSuccessOn Successful Query.
NvError_BadParameter1. NumDescUsed is NULL
  1. MemDesc array size is not big enough to hold the phys memory chunks info
  2. Invalid memory handle is passed
NvError_AccessDeniedIf a non-privileged process tries accessing this API
NvError_NotInitializedIf memory services lib not initialized

◆ NvRmMemGetPhysInfoMult()

NvError NvRmMemGetPhysInfoMult ( NvRmMemHandle *  hMem,
NvRmMemDesc **  MemDesc,
NvU64  NumDesc,
NvU64 **  NumDescUsed,
NvU32  NumHandles 
)

linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end:

@IfaceTagForDoc Covers: [Libnvrm_mem_SWUD_28]

Interface-Description:

Constraints: Before calling any memory services interfaces, it is expected to call NvRmMemMgrInit() once in client process to initialize memory services library and also, to create channel between client process and nvmap resource manager.

Get the allocated Physical Memory chunks info for each handle in the array. Can be used to get the number of physical chunks allocated with MemDesc passed as NULL.

The physical memory info is valid as long as the client doesn't free hMem.

If an application wants to access this interface, it needs to be launched with "NvMap/Interfaces" ability with GET_PHYS_INFO_INTERFACE_ABILITY ID.

"-A nonroot,allow,able=NvMap/Interfaces:<ability ID>" should be part of process launch command.

This API is supported on QNX Only.

Description:

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

This function is used to get the allocated physical memory chunks number, info for the multiple input handles. It validates the input parameters and decides whether only number of desc is required or the info about the descriptors is also required for each handle and call the corresponding ioctl.

Function-uml:

.NvRmMemGetPhysInfoMult [plantuml, NvRmMemGetPhysInfoMult, svg, subs=attributes, align=center] .... ....

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

Parameters
[in]hMemNvRmMemHandle* Desc: An array of memory handles returned by NvRmMemHandleAllocAttr/FromImportId/FromSciIpcId. Range: Valid pointer to NvRmMemHandle
[out]MemDescNvRmMemDesc** Desc: An Array of Memory Descriptor array to hold the physical memory chunks info. Range: Valid double pointer to NvRmMemDesc
[in]NumDescNvU64 Desc: MemDesc array size. Range: [0, 2^64-1]
[out]NumDescUsedNvU64** Desc: Returns the number of MemDesc entries used to return physical memory chunks info. Range: Valid unsigned 64 bit double pointer
[in]NumHandlesNvU32 Desc: Number of handles Range: [1, 2^32-1]
Return values
NvSuccessOn Successful Query.
NvError_BadParameter1. NumDescUsed is NULL
  1. MemDesc array size is not big enough to hold the phys memory chunks info
  2. Invalid memory handle is passed
NvError_AccessDeniedIf a non-privileged process tries accessing this API
NvError_NotInitializedIf memory services lib not initialized

◆ NvRmMemGetStatistics()

NvError NvRmMemGetStatistics ( struct NvRmMemStatHeader *  stat_header,
NvU32  flag 
)

linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end:

@IfaceTagForDoc Covers: [Libnvrm_mem_SWUD_50]

Interface-Description:

Query NvMap allocated buffer details

This API provides all the details of NvMap allocated physical buffers.

Typical usage is shown as below

Client Application

  • Allocate memory of size (NVRM_MEM_STAT_NUM_HEAPS_INFO_BLOCKS x sizeof(NvRmMemStatHeapsInfo))
  • Allocate memory of size (NVRM_MEM_STAT_NUM_HEAP_BLOCKS x sizeof(NvRmMemStatHeaps))
  • Allocate memory of size (NVRM_MEM_STAT_NUM_BUFFER_BLOCKS x sizeof(NvRmMemStatBuffer))
  • Allocate NvRmMemStatHeader and poulate it with abive 3 three pointers
  • Call NvRmMemGetStatistics() API with above allocated NvRmMemStatHeader address, and NVRM_MEM_STAT_NUM_BUFFER_BLOCKS as NumBufferBlocks.

NvMap resmgr

  • Collects all the NvMap allocated Buffers details and fills these details into NvRmMemStatHeapsInfo, NvRmMemStatHeaps, NvRmMemStatBuffer of NvRmMemStatHeader.
  • If the total number of buffer blocks are more than the client application sent, NvMap just fills NVRM_MEM_STAT_NUM_BUFFER_BLOCKS buffers and for remaining blocks, client need to call NvRmMemGetStatistics() API again. with the same input parameters.
  • If total number of buffers is less than NVRM_MEM_STAT_NUM_BUFFER_BLOCKS, NvMap will update NumBufferBlocks for the client.

Client Application

Client Application

  • If NumBufferBlocks is equal to NVRM_MEM_STAT_NUM_BUFFER_BLOCKS, still few buffers details are pending, so need to call NvRmMemGetStatistics() API again with the same arguments for remaining information.
  • If NumBufferBlocks is less than NVRM_MEM_STAT_NUM_BUFFER_BLOCKS, read only those many buffers.

Description:

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

This function provides all the details of NvMap allocated physical buffers. It validates the input arguments like pointer to stat struct and it's members. It then calls the corresponding ioctl to get the statistics.

Function-uml:

.NvRmMemGetStatistics [plantuml, NvRmMemGetStatistics, svg, subs=attributes, align=center] .... ....

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

Parameters
[in]stat_headerstruct NvRmMemStatHeader * Desc: Pointer to hold the statistics. Range: Valid pointer to NvRmMemStatHeader structure This structure holds pointers for NvRmMemStatHeapsInfo, NvRmMemStatHeaps, and NvRmMemStatBuffer. NvRmMemStatHeapsInfo pointer point to the memory of size (NVRM_MEM_STAT_NUM_HEAPS_INFO_BLOCKS x sizeof(NvRmMemStatHeapsInfo)) NvRmMemStatHeaps pointer points to the memory of size (NVRM_MEM_STAT_NUM_HEAP_BLOCKS x sizeof(NvRmMemStatHeaps)) NvRmMemStatBuffer pointer points to the memory of size (NVRM_MEM_STAT_NUM_BUFFER_BLOCKS x sizeof(NvRmMemStatBuffer))
[in]NumBufferBlockssize_t* Desc: Number of the input blocks sending. Range: It should be NVRM_MEM_STAT_NUM_BUFFER_BLOCKS
[out]NumBufferBlockssize_t Desc: NumBufferBlocks received buffers count. Range: [1, SIZE_MAX]
Return values
NvSuccessOn success
NvError_IoctlFailedDevctl call has failed
NvError_BadParameterInvalid argument

◆ NvRmMemHandleAllocAttr()

NvError NvRmMemHandleAllocAttr ( NvRmDeviceHandle  hDevice,
NvRmMemHandleAttr *  attr,
NvRmMemHandle *  phMem 
)

@IfaceTagForDoc

qnx_sr_only_doxygen_start: Covers: [Libnvrm_mem_SWUD_12] qnx_sr_only_doxygen_end:

Interface-Description:

Constraints: Before calling any memory services interfaces, it is expected to call NvRmMemMgrInit() once in client process to initialize memory services library and also, to create channel between client process and qnx_sr_only_doxygen_start: nvmap resource manager. qnx_sr_only_doxygen_end: linux_nsr_only_doxygen_start: nvmap Linux KMD. linux_nsr_only_doxygen_end:

Allocates the storage memory as requested and returns a handle representing it. The storage must satisfy all specified attibutes in attr sturcture.

Memory allocated by this API is intended to be used by modules which control hardware devices such as media accelerators or I/O controllers.

To allocate contiguous memory, clients must set Contiguous field to true in NvRmMemHandleAttr. The contiguous memory allocation requests are only honored for allocations from carveout memory.

Contiguous allocation requests are bound to fail with fragmentation of memory. Contiguous memory should only be requested if there is an absolute need for it. i.e HW doesn’t have SMMU/GMMU translations support or needs contiguous physical memory for its functionality.

Clients can set the alignment for contiguous memory allocation by setting Alignment field in NvRmMemHandleAttr. Alignment requests from clients are only honored for contiguous physical memory allocation. For non-contiguous memory allocations, alignment parameter is ignored. For every allocation, page alignment is the minimum guarantee.

This interface can be used to allocate memory, which is

  • GPU accessible
  • VI accessible qnx_sr_only_doxygen_start:
  • GPU non-accessible qnx_sr_only_doxygen_end:
  • VI non-accessible

linux_nsr_only_doxygen_start: For DOS 7.0 Linux NSR, the supported HeapTypes are

- NvRmHeap_IOMMU
- NvRmHeap_ExternalCarveOut
- NvRmHeap_GpuMem
- NvRmHeap_ViMem

In linux, GPU can access the whole DRAM. To allocate memory which is GPU accessible, HeapType in NvRmMemHandleAttr can be set to any one of the supported heap types.

To allocate memory which is VI accessible, HeapType in NvRmMemHandleAttr can be set only to NvRmHeap_ViMem. (Any info on peer VM ID?)

If the allocation is requested with HeapType set as NvRmHeap_GpuMem, then the requested allocation size, if non-zero, will be aligned to the next multiple of 2 MB.

By default, the memory allocated will be GPU accessible and VI non-accessible. linux_nsr_only_doxygen_end:

qnx_sr_only_doxygen_start: To allocate memory which is GPU accessible, HeapType in NvRmMemHandleAttr must be set to one of

- NvRmHeap_IOMMU
- NvRmHeap_ExternalCarveOut

and GpuAccess must be set with appropriate value based on the access required:

- NvRmMemGpuAccess_IGPU for iGPU access
- NvRmMemGpuAccess_DGPU for dGPU access
- NvRmMemGpuAccess_GPU for iGPU+dGPU access

To allocate memory which is VI accessible, Heaps in NvRmMemHandleAttr must be set to NvRmHeap_IVC and peer VM ID (taken as part of HeapNumber parameter) must be set to 0.

By default, the memory allocated will be GPU non-accessible and VI non-accessible.

This interface also allows creation of buffers from physical memory info provided by clients. Once a buffer is created, it can be accessed like a regular buffer created by Memory Services. This feature is limited to syncpoint shim memory, which is managed by NvHost. Syncpoint shim memory buffers have device memory attribute and can only be requested by NvHost exclusively.

If an application wants to access this interface, it needs to be launched with "NvMap/Interfaces" ability with below abbility ID.

  • CREATE_FOREIGN_BUF_VIDMEM_INTERFACE_ABILITY ID for VIDMEM memory buffers
  • CREATE_FOREIGN_BUF_SYNCPOINT_INTERFACE_ABILITY ID for synpoint SHIM memory buffers
  • CREATE_FOREIGN_BUF_PCIE_MMIO_INTERFACE_ABILITY ID for PCIE MMIO registers
  • IOVMM_BUF_INTERFACE_ABILITY ID for memory buffers from IOVMM
  • CARVEOUT_BUF_INTERFACE_ABILITY ID for memory buffers from carveout
  • VI_BUF_INTERFACE_ABILITY ID for VI memory buffers
  • FSI_BUF_INTERFACE_ABILITY ID for FSI memory buffers

"-A nonroot,allow,able=NvMap/Interfaces:<ability ID>" should be part of process launch command. qnx_sr_only_doxygen_end:

Assert encountered in debug mode if alignment was not a power of two, or coherency is not one of NvOsMemAttribute_WriteBack or NvOsMemAttribute_WriteCombined.

See also
NvRmMemHandleFree()

qnx_sr_only_doxygen_start: Description:

The interface covers: |LibNvrm_Mem_004|, |LibNvrm_Mem_005|, |LibNvrm_Mem_006|, |LibNvrm_Mem_007|, |LibNvrm_Mem_012|, |LibNvrm_Mem_010|, |LibNvrm_Mem_008|, |LibNvrm_Mem_009|, |LibNvrm_Mem_013|, |LibNvrm_Mem_017|

This function allocate the storage memory as requested and returns a handle or create a handle from the foreign buffer. The storage must satisfy all specified attibutes. It validate input parameters and call to corresponding functions either for creating a handle from foreign buffer or allocating a buffer as per the input arguments.

Function-uml:

.NvRmMemHandleAllocAttr [plantuml, NvRmMemHandleAllocAttr, svg, subs=attributes, align=center] .... .... qnx_sr_only_doxygen_end:

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

Parameters
[in]hDeviceNvRmDeviceHandle Desc: An RM device handle. Deprecated arg and pass as NULL. Range: NULL
[in]attrNvRmMemHandleAttr* Desc: Holds the attributes of memory to be allocated. Range: Valid pointer to NvRmMemHandleAttr.
[out]phMemNvRmMemHandle* Desc: An opaque memory handle. Last two bits are reserved for cache attributes. Range: Valid memory handle
Return values
NvSuccessMemory allocation and Handle creation is successful.
NvError_InsufficientMemoryOut of memory and hence the allocation failed.
NvError_AccessDeniedCaller does not have permissions to use the API
NvError_BadParameter1. Input parameter "attr" is NULL
  1. Output parameter "phMem" is NULL
  2. The field "Size" of input parameter "attr" is invalid
  3. The field "Alignment" of input parameter "attr" is not power of two linux_nsr_only_doxygen_start:
  4. Linux KMD unable to create memory handle or allocate memory with the given input parameters
NvError_IoctlFailedIoctl call has failed
NvError_BusyMemory services is busy and clients should retry the operation later linux_nsr_only_doxygen_end: qnx_sr_only_doxygen_start:
  1. The field "HeapNumber" is NULL when allocating from heap "NvRmHeap_IVC" set in the field "Heaps" in input parameter "attr"
  2. Unable to create the memory handle
  3. The field "Heaps" of input parameter attr is not set exclusively to only NvRmHeap_IVC
NvError_IoctlFailedDevctl call has failed qnx_sr_only_doxygen_end:
NvError_NotInitializedIf memory services lib not initialized

◆ NvRmMemHandleAttrConstruct()

static NvRmMemHandleAttr NvRmMemHandleAttrConstruct ( void  )
inlinestatic

Description: Helper function for constructing a default handle attribute struct.

Definition at line 1008 of file nvrm_memmgr_safe.h.

References NVRM_DEFINE_MEM_HANDLE_ATTR.

◆ NvRmMemHandleAttrSet()

static void NvRmMemHandleAttrSet ( NvRmMemHandleAttr *const  attr,
NvU32 const  alignment,
NvOsMemAttribute const  coherency,
NvU64 const  size,
NvRmMemTags const  tags 
)
inlinestatic

Description: Helper function for setting handle attributes.

Definition at line 1040 of file nvrm_memmgr_safe.h.

References NVRM_MEM_HANDLE_SET_ATTR.

◆ NvRmMemHandleDuplicate()

NvError NvRmMemHandleDuplicate ( NvRmMemHandle  hMemSrc,
NvU32  Flags,
NvRmMemHandle *  phMemDuplicated 
)

@IfaceTagForDoc qnx_sr_only_doxygen_start: Covers: [Libnvrm_mem_SWUD_13] qnx_sr_only_doxygen_end:

Interface-Description:

Constraints: Before calling any memory services interfaces, it is expected to call NvRmMemMgrInit() once in client process to initialize memory services library and also, to create channel between client process and qnx_sr_only_doxygen_start: nvmap resource manager. qnx_sr_only_doxygen_end: linux_nsr_only_doxygen_start: nvmap Linux KMD. linux_nsr_only_doxygen_end:

Duplicate memory handle for intra-process use. This is analogous to file descriptor duplication with dup().

The primary use case for this function is duplication of imported NvRmMemHandle, e.g., in GL/CUDA interoperability cases. For instance, when an NvRmMemHandle is imported to a driver, the handle must be duplicated unless it is immediately used, since the receiving driver has no control of the life cycle of the original handle. In particular, the original handle may be closed immediately after it is imported.

The duplication can be done with reduced permission (read-only) or with actual permissions the process has on that buffer handle.

Within a process when a handle is duplicated, handle returned points to same buffer memory as handle passed to API and the buffer memory won’t be released till both the handles are released. In case of handle duplication, the user shall be aware that two threads that share the same buffer can release the handle independently without impacting other’s use of buffer.

qnx_sr_only_doxygen_start: If an application wants to access this interface, it needs to be launched with "NvMap/Interfaces" ability with below ability id.

  • NVMAP_INTERFACE_ABILITY ID

"-A nonroot,allow,able=NvMap/Interfaces:<ability ID>" should be part of process launch command.

Description:

The interface covers: |LibNvrm_Mem_004|, |LibNvrm_Mem_008|, |LibNvrm_Mem_005|, |LibNvrm_Mem_007|, |LibNvrm_Mem_006|, |LibNvrm_Mem_009|, |LibNvrm_Mem_013|, |LibNvrm_Mem_017|, |LibNvrm_Mem_010|, |LibNvrm_Mem_021|

This function duplicate the memory handle analogous to dup(). The duplication can be done with reduced permission (read-only) or with actual permissions the process has on that buffer handle. It validate the input handle, flags and call the corresponding ioctl to duplicate the handle.

Function-uml:

.NvRmMemHandleDuplicate [plantuml, NvRmMemHandleDuplicate, svg, subs=attributes, align=center] .... .... qnx_sr_only_doxygen_end:

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

Parameters
[in]hMemSrcNvRmMemHandle Desc: The source handle to be duplicated Range: [1, 2^32-1]
[in]FlagsNvU32 Desc: Holds access permissions(NVOS_MEM_READ/NVOS_MEM_READ_WRITE) requested for duplicated handle. The allowed permissions would depend on the access permissions the source handle has. Range: 1, 3
[out]phMemDuplicatedNvRmMemHandle* Desc: Pointer to receive duplicated handle on success Range: Valid pointer to NvRmMemHandle

linux_nsr_only_doxygen_start: If this API is called for a foreign FD, the handle duplicate ioctl call to nvmap Linux KMD will fail with EOPNOTSUPP error. On non-embedded Linux builds, the duplicate operation will fall back to the dup system call. On embedded Linux builds, this fallback is not available and the call will fail. linux_nsr_only_doxygen_end:

Return values
NvSuccessDuplicate of input handle is created successfully with given access permission
NvError_InsufficientMemoryOut of memory and hence the duplication failed
NvError_AccessDeniedrequested access permissions are not allowed
NvError_BadParameter1. Input parameter "hMemSrc" is invalid
  1. Input parameter "Flags" is invalid
  2. Output parameter "phMemDuplicated" is NULL linux_nsr_only_doxygen_start:
  3. Linux KMD unable to duplicate handle with the given input parameters
NvError_IoctlFailedIoctl call has failed linux_nsr_only_doxygen_end:
NvError_NotInitializedIf memory services lib not initialized

◆ NvRmMemHandleFree()

NvError NvRmMemHandleFree ( NvRmMemHandle  hMem)

@IfaceTagForDoc qnx_sr_only_doxygen_start: Covers: [Libnvrm_mem_SWUD_14] qnx_sr_only_doxygen_end:

Interface-Description:

Constraints: Before calling any memory services interfaces, it is expected to call NvRmMemMgrInit() once in client process to initialize memory services library and also, to create channel between client process and qnx_sr_only_doxygen_start: nvmap resource manager. qnx_sr_only_doxygen_end: linux_nsr_only_doxygen_start: nvmap Linux KMD. linux_nsr_only_doxygen_end:

Frees a memory handle obtained from qnx_sr_only_doxygen_start: NvRmMemHandleAllocAttr/FromImportId/FromSciIpcId(). qnx_sr_only_doxygen_end: linux_nsr_only_doxygen_start: NvRmMemHandleAllocAttr/FromFd/FromSciIpcId(). linux_nsr_only_doxygen_end:

This should be called one time for each API qnx_sr_only_doxygen_start: NvRmMemHandleAllocAttr/FromImportId/FromSciIpcId() qnx_sr_only_doxygen_end: linux_nsr_only_doxygen_start: NvRmMemHandleAllocAttr/FromFd/FromSciIpcId() linux_nsr_only_doxygen_end: call. When the internal reference count on the handle reaches zero all resources for the handle will be released.

Any oustanding user/kernel mappings(Even after calling NvRmMemHandleFree) on the handle can hold the handle's storage getting freed. When all the refs and mappings are dropped the handle's storage will be freed.

linux_nsr_only_doxygen_start:

See also
NvRmMemHandleAllocAttr()
NvRmMemHandleFromFd()
NvRmMemHandleFromSciIpcId() linux_nsr_only_doxygen_end:

qnx_sr_only_doxygen_start: Memory Services does not guarantee to make the released memory as GPU non-accessible, when the size of the buffer is not aligned to 2 MB.

See also
NvRmMemHandleAllocAttr()
NvRmMemHandleFromImportId()
NvRmMemHandleFromSciIpcId()

Description:

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

This function free a memory handle obtained from NvRmMemHandleAllocAttr/FromImportId/FromSciIpcId(). It validate the input handle and call the corresponding ioctl for freeing the handle.

Function-uml:

.NvRmMemHandleFree [plantuml, NvRmMemHandleFree, svg, subs=attributes, align=center] .... .... qnx_sr_only_doxygen_end:

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

Parameters
[in]hMemNvRmMemHandle Desc: A previously allocated memory handle. If hMem is NULL, this API has no effect. Range: [1, 2^32-1]
Return values
NvError_BadParameterInput parameter "hMem" is 0
NvSuccesson success
NvError_IoctlFailedIoctl call has failed
NvError_NotInitializedIf memory services lib not initialized

◆ NvRmMemHandleFromImportId()

NvError NvRmMemHandleFromImportId ( NvU64  ImportId,
NvRmMemChInfo *  ChInfo,
NvU32  Flags,
NvRmMemHandle *  phMem 
)

linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end:

@IfaceTagForDoc Covers: [Libnvrm_mem_SWUD_33]

Interface-Description:

Constraints: Before calling any memory services interfaces, it is expected to call NvRmMemMgrInit() once in client process to initialize memory services library and also, to create channel between client process and nvmap resource manager.

Create a memory handle from ImportId.

On Qnx: It ensures that ImportId is valid with correct exporter pid and if it is to be exported to this importing process before creating a handle under importing process space. The access permissions allowed on handle to be created here depends on permissions that are allowed by the exporter of ImportId.

On Linux: This API is same as NvRmMemHandleFromFd().

On HOS: This API is same as NvRmMemHandleFromId().

Refer to NvRmMemGetImportId() comments for additional details on NvRmMemGetImportId() and NvRmMemHandleFromImportId() pair usage across different OSes.

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

If an application wants to access this interface, it needs to be launched with "NvMap/Interfaces" ability with IMPORT_BUF_INTERFACE_ABILITY ID.

"-A nonroot,allow,able=NvMap/Interfaces:<ability ID>" should be part of process launch command.

Description:

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

This function create a memory handle from the input import id. It validates the input arguments like channel info, import id, handle, flags and then call the corresponding ioctl to get handle from the given import id.

Function-uml:

.NvRmMemHandleFromImportId [plantuml, NvRmMemHandleFromImportId, svg, subs=attributes, align=center] .... ....

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

Parameters
[in]ImportIdNvU64 Desc: Id to create a Handle from. Range: [1, 2^32-1]
[in]ChInfoNvRmMemChInfo* Desc: Channel Info that identifies the IPC channel connection between a ResMgr and Its client process or between two user processes. This arg is ignored on Linux and HOS and should be passed as NULL. Range: Valid pointer to NvRmMemChInfo structure
[in]FlagsNvU32 Desc: Holds access permissions(NVOS_MEM_READ/READ_WRITE) requested for phMem. If the access permissions requested here are not allowed on ImportId by its exporter, handle creation would fail. Range: 1, 3
[out]phMemNvRmMemHandle* Desc: Returns Handle created in importing process space. Range: Valid pointer to NvRmMemHandle
Return values
NvSuccessOperation is successful.
NvError_InsufficientMemoryOut of memory and hence the creation of handle has failed.
NvError_AccessDeniedNo permission to use input parameter ImportId with requested access permissions.
NvError_BadParameter1. The input parameter ImportId is invalid
  1. The input parameter Flags is set to any NVOS_FLAGS other than READ/READ_WRITE
  2. The input parameter exporter_pid is 0
  3. The output parameter phMem points to NULL address
NvError_IoctlFailedDevctl call has failed
NvError_NotInitializedIf memory services lib not initialized

◆ NvRmMemHandleFromImportIdMult()

NvError NvRmMemHandleFromImportIdMult ( NvU64 *  ImportId,
NvRmMemChInfo *  ChInfo,
NvU32  Flags,
NvRmMemHandle *  phMem,
NvU32  NumIds 
)

linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end:

@IfaceTagForDoc Covers: [Libnvrm_mem_SWUD_34]

Interface-Description:

Constraints: Before calling any memory services interfaces, it is expected to call NvRmMemMgrInit() once in client process to initialize memory services library and also, to create channel between client process and nvmap resource manager.

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

If an application wants to access this interface, it needs to be launched with "NvMap/Interfaces" ability with IMPORT_BUF_INTERFACE_ABILITY ID.

"-A nonroot,allow,able=NvMap/Interfaces:<ability ID>" should be part of process launch command.

Description:

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

This function creates memory handles from the input ImportIds. It validates input arguments like import ids, channel info, flags, number of import ids etc and call the corresponding ioctl.

Function-uml:

.NvRmMemHandleFromImportIdMult [plantuml, NvRmMemHandleFromImportIdMult, svg, subs=attributes, align=center] .... ....

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

Parameters
[in]ImportIdNvU64* Desc: Array of ImportIds to create a Handles from. Range: Valid pointer to ImportId
[in]ChInfoNvRmMemChInfo* Desc: Channel Info that identifies the IPC channel connection between a ResMgr and Its client process or between two user processes. This arg is ignored on Linux and HOS and should be passed as NULL. Range: Valid pointer to NvRmMemChInfo structure
[in]FlagsNvU32 Desc: Holds access permissions(NVOS_MEM_READ/READ_WRITE) requested for phMem. If the access permissions requested here are not allowed on ImportId by its exporter, handle creation would fail. Range: 1, 3
[out]phMemNvRmMemHandle* Desc: Array of handles that return Handles created in importing process space. Range: Valid pointer NvRmMemHandle
[in]NumIdsNvU32 Desc: Number of ImportIds in ImportId array. Range: [1, 2^32-1]
Return values
NvSuccessOperation is successful.
NvError_InsufficientMemoryOut of memory and hence the creation of handle has failed.
NvError_AccessDeniedNo permission to use input parameter ImportId with requested access permissions.
NvError_BadParameter1. The input parameter ImportId is NULL
  1. The input parameter Flags is set to any NVOS_FLAGS other than READ/READ_WRITE
  2. The output parameter phMem points to NULL address
NvError_IoctlFailedDevctl call has failed
NvError_NotInitializedIf memory services lib not initialized

◆ NvRmMemMap()

NvError NvRmMemMap ( NvRmMemHandle  hMem,
NvU64  Offset,
NvU64  Size,
NvU32  Flags,
void **  pVirtAddr 
)

@IfaceTagForDoc qnx_sr_only_doxygen_start: Covers: [Libnvrm_mem_SWUD_15] qnx_sr_only_doxygen_end:

Interface-Description:

Constraints: Before calling any memory services interfaces, it is expected to call NvRmMemMgrInit() once in client process to initialize memory services library and also, to create channel between client process and qnx_sr_only_doxygen_start: nvmap resource manager. qnx_sr_only_doxygen_end: linux_nsr_only_doxygen_start: nvmap Linux KMD. linux_nsr_only_doxygen_end:

Attempts to map a memory buffer into the process's virtual address space.

It is recommended that mappings be short-lived as some systems have a limited number of concurrent mappings that can be supported, or because virtual address space may be scarce.

It is legal to have multiple concurrent mappings of a single memory buffer.

There is no guarantee that the mapping will succeed. For example, on some operating systems, the OS's security mechanisms make it impossible for untrusted applications to map certain types of memory. A mapping might also fail due to exhaustion of memory or virtual address space. Therefore, you must implement code paths that can handle mapping failures. For example, if the mapping fails, you may want to consider avoiding the use of this API altogether, unless there is a compelling reason why you need mappings.

See also
NvRmMemUnmap()

If the Offset + Size is greater then the buffer size, then the mapping is expected to fail. qnx_sr_only_doxygen_start: If the Size argument is zero, then the entire handle size will be mapped.

If an application wants to access this interface, it needs to be launched with "NvMap/Interfaces" ability with below ability id.

  • NVMAP_INTERFACE_ABILITY ID

"-A nonroot,allow,able=NvMap/Interfaces:<sub-ability ID>" should be part of process launch command.

Description:

The interface covers: |LibNvrm_Mem_004|, |LibNvrm_Mem_008|, |LibNvrm_Mem_009|, |LibNvrm_Mem_013|, |LibNvrm_Mem_017|, |LibNvrm_Mem_005|, |LibNvrm_Mem_007|, |LibNvrm_Mem_010|, |LibNvrm_Mem_019|, |LibNvrm_Mem_020|

This function map a memory buffer into the process's virtual address space. It validate the input parameters and page align the input offset and size and call the corresponding ioctl for mapping the handle.

Function-uml:

.NvRmMemMap [plantuml, NvRmMemMap, svg, subs=attributes, align=center] .... .... qnx_sr_only_doxygen_end:

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

Parameters
[in]hMemNvRmMemHandle Desc: A memory handle returned from NvRmMemHandleAllocAttr Range: [1, 2^32-1]
[in]OffsetNvU64 Desc: Byte offset within the memory handle to start the map at. Range: [0, 2^64-1]
[in]SizeNvU64 Desc: Size in bytes of mapping requested. Range: [0, 2^64-1]
[in]FlagsNvU32 Desc: Special flags NVOS_MEM_READ, NVOS_MEM_READ_WRITE, NVOS_MEM_MMAP_FIXED Range: Valid flags
[in/out]pVirtAddr void** Desc: If the mapping is successful, provides a virtual address through which the memory buffer can be accessed. If NVOS_MEM_MMAP_FIXED flag is set then user needs to provide the pVirtAddr (virtual address) at which the handle needs to be mapped Range: Valid virtual address pointer
Return values
NvSuccessMemory map successful and input parameter "pVirtAddr" is valid
NvError_BadParameter1. Input parameter "hMem" is invalid
  1. Input parameter "pVirtAddr" is invalid
  2. Input parameters "Offset", "Size" together create invalid requested mapping size
  3. Input parameter "Flags" is not one of the flags listed in parameters section
NvError_InvalidAddressIf the NVOS_MEM_MMAP_FIXED flag is set and virtual address provided is NULL
NvError_MemoryMapFailedIf memory map fails
NvError_NotInitializedIf memory services lib not initialized

◆ NvRmMemMgrInit()

NvError NvRmMemMgrInit ( void  )

@IfaceTagForDoc qnx_sr_only_doxygen_start: Covers: [Libnvrm_mem_SWUD_66] qnx_sr_only_doxygen_end:

Interface-Description:

The interface intializes the memory services library. It is required to be called before any other function call of this library. NvRmMemMgrInit() call is expected to be done after nvmap device node is created, else this interface will fail. If the memory services library is already initialized then further calls to this interface will just return success.

qnx_sr_only_doxygen_start: HOS Behaviour: This interface is not used in HOS And will just return NvSuccess without doing any operations.

If an application wants to access this interface, it needs to be launched with "NvMap/Interfaces" ability with below ability id.

  • NVMAP_INTERFACE_ABILITY ID

"-A nonroot,allow,able=NvMap/Interfaces:<ability ID>" should be part of process launch command.

Description:

The interface covers: |LibNvrm_Mem_003|, |LibNvrm_Mem_004|, |LibNvrm_Mem_008|, |LibNvrm_Mem_014|, |LibNvrm_Mem_017|, |LibNvrm_Mem_010|, |LibNvrm_Mem_009|, |LibNvrm_Mem_013|, |LibNvrm_Mem_017|, |LibNvrm_Mem_015|, |LibNvrm_Mem_016|, |LibNvrm_Mem_018|, |LibNvrm_Mem_019|, |LibNvrm_Mem_020|, |LibNvrm_Mem_021|

This function performs NvRmMem initialization like opening nvmap node, creating a channel and thread to receive events.

Function-uml:

.NvRmMemMgrInit [plantuml, NvRmMemMgrInit, svg, subs=attributes, align=center] .... .... qnx_sr_only_doxygen_end:

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

Return values
NvSuccessLibrary Initialization is successsful
NvError_DeviceNotFoundLibrary Initialization failed

◆ NvRmMemQueryHandleParams()

NvError NvRmMemQueryHandleParams ( NvRmMemHandle  hMem,
NvU64  ImportId,
NvRmMemHandleParams *  params,
NvU32  ParamsSize 
)

@IfaceTagForDoc qnx_sr_only_doxygen_start: Covers: [Libnvrm_mem_SWUD_45] qnx_sr_only_doxygen_end:

Interface-Description:

Constraints: Before calling any memory services interfaces, it is expected to call NvRmMemMgrInit() once in client process to initialize memory services library and also, to create channel between client process and qnx_sr_only_doxygen_start: nvmap resource manager. qnx_sr_only_doxygen_end: linux_nsr_only_doxygen_start: nvmap Linux KMD. linux_nsr_only_doxygen_end:

This interface provides following parameters information of a given memory buffer:

- Heap type

qnx_sr_only_doxygen_start:

  • Heap number qnx_sr_only_doxygen_end:
  • Size of the buffer
  • Contiguous or not
  • Alignment of the buffer
  • Offset Value
  • Access Flags
  • Coherency type

qnx_sr_only_doxygen_start: If an application wants to access this interface, it needs to be launched with "NvMap/Interfaces" ability with below ability ID.

  • NVMAP_INTERFACE_ABILITY

"-A nonroot,allow,able=NvMap/Interfaces:<ability ID>" should be part of process launch command.

Description:

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

This function provide the details of the input memory handle like heap type, heap number, size etc. It validates the input arguments like handle, pointer to parameter struct and call the ioctl to get the handle parameters.

Function-uml:

.NvRmMemQueryHandleParams [plantuml, NvRmMemQueryHandleParams, svg, subs=attributes, align=center] .... .... qnx_sr_only_doxygen_end:

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

Parameters
[in]hMemNvRmMemHandle Desc: A memory handle returned from NvRmMemHandleAllocAttr Range: [0, 2^32-1], if ImportId is 0 [1, 2^32-1], if ImportId is non-zero
[in]ImportIdNvU64 linux_nsr_only_doxygen_start: Desc: For Linux, this parameter is completely ignored. linux_nsr_only_doxygen_end: qnx_sr_only_doxygen_start: Desc: ImportId returned by NvRmMemGetImportId which can be exported inter-processes qnx_sr_only_doxygen_end: Range: [0, 2^32-1], if hMem is 0 [1, 2^32-1], if hMem is non-zero
[out]paramsNvRmMemHandleParams* Desc: NvRmMemHandleParams parameters on a handle updated by this API: 1) Heap type, 2) Size of the buffer, 3) Contiguous or not, 4) Alignment of the buffer, 5) Offset Value, 6) Access Flags, 7) Coherency type. Range: Valid pointer to NvRmMemHandleParams
[in]ParamsSizeNvU32 Desc: size of params struct that allows extension of params struct in future with no backward comptibility issue. Range: [0, 2^32-1]
Return values
NvSuccessIndicates that Query operation is successful.
NvError_BadParameter1. Output parameter "params" is NULL linux_nsr_only_doxygen_start:
  1. Input parameter "hMem" is invalid
NvError_IoctlFailedIoctl call has failed linux_nsr_only_doxygen_end: qnx_sr_only_doxygen_start:
  1. Invalid heap type returned from handle
  2. Invalid coherency type returned from handle
NvError_BadValue1. Both input parameters "hMem" and "ImportId" are 0
  1. Input handle (hMem or ImportId) is invalid or not accessible
  2. Handle has IOVMM heap with non-zero offset
  3. Handle has invalid access flags
NvError_AccessDeniedIf client lacks required ability "NvMap/Interfaces" with NVMAP_INTERFACE_ABILITY qnx_sr_only_doxygen_end:
NvError_NotInitializedIf memory services lib not initialized

◆ NvRmMemQueryHeapParams()

NvError NvRmMemQueryHeapParams ( NvRmHeap  heap,
NvBool  contig,
NvRmMemGpuAccess  GpuAccess,
NvRmMemHeapParams *  params,
NvU32  ParamsSize 
)

@IfaceTagForDoc qnx_sr_only_doxygen_start: Covers: [Libnvrm_mem_SWUD_46] qnx_sr_only_doxygen_end:

Interface-Description:

Constraints: Before calling any memory services interfaces, it is expected to call NvRmMemMgrInit() once in client process to initialize memory services library and also, to create channel between client process and qnx_sr_only_doxygen_start: nvmap resource manager. qnx_sr_only_doxygen_end: linux_nsr_only_doxygen_start: nvmap Linux KMD. linux_nsr_only_doxygen_end:

API to query heap params

linux_nsr_only_doxygen_start: This interface queries the heap params for a given input heap and provides the following parameters information:

- Total heap size
- Free memory in the heap
- Largest free block size in heap
- Size of granule in heap

Granule size is only valid for heaps which support allocation in granules. Also, please note that the free memory value returned by this API is an estimated value, so callers should use it carefully.

If multiple numa nodes are online:

  • Clients should use our numa-aware API NvRmMemQueryHeapParamsNuma instead, to query parameters of a particular numa node.
  • If NvRmMemQueryHeapParams is called, parameters of numa_id 0 will be returned.
  • In long-term, NvRmMemQueryHeapParams will be disabled altogether for when multiple numa nodes are online. Clients are advised to use only NvRmMemQueryHeapParamsNuma for such usecase. linux_nsr_only_doxygen_end:

qnx_sr_only_doxygen_start: If an application wants to access this interface, it needs to be launched with "NvMap/Interfaces" ability with ability ID.

  • QUERY_HEAPS_INTERFACE_ABILITY

"-A nonroot,allow,able=NvMap/Interfaces:<ability ID>" should be part of process launch command.

Description:

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

This function query the heap params and get the details like total heap size, free memory in the heap, largest free block size. It validates the input arguments like type of GPU access, heap type etc. and then calls the corresponding ioctl.

Function-uml:

.NvRmMemQueryHeapParams [plantuml, NvRmMemQueryHeapParams, svg, subs=attributes, align=center] .... .... qnx_sr_only_doxygen_end:

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

Parameters
[in]heapNvRmHeap Desc: heap to query params. Range: Valid member of NvRmHeap enum
[in]contigNvBool Desc: heap params for contig memory support Range: true, false
[in]GpuAccessNvRmMemGpuAccess Desc: heap params for Gpu accessible memory support linux_nsr_only_doxygen_start: For Linux, this parameter is completely ignored. linux_nsr_only_doxygen_end: Range: Valid member of NvRmMemGpuAccess enum
[out]paramsNvRmMemHeapParams* Desc: NvRmMemHeapParams parameters of a heap returned by this API :
  1. Total memory reserved for heap in bytes
  2. Free memory available at heap in bytes
  3. Size of largest free block at heap linux_nsr_only_doxygen_start:
  4. Size of granule in heap linux_nsr_only_doxygen_end: Range: Valid pointer to NvRmMemHeapParams
[in]ParamsSizeNvU32 Desc: size of params struct that allows extension of params struct in future with no backward comptibility issue. Range: [0, 2^32-1]
Return values
NvSuccessIndicates that Query operation is successful. qnx_sr_only_doxygen_start:
NvError_BadParameterInvalid argument(s). qnx_sr_only_doxygen_end: linux_nsr_only_doxygen_start:
NvError_BadParameter1. Input parameter "heap" is invalid
  1. Output parameter "params" is NULL
  2. Linux KMD unable to query heap params with the given input parameters
NvError_InsufficientMemoryOut of memory and hence the query operation failed
NvError_IoctlFailedIoctl call has failed linux_nsr_only_doxygen_end:
NvError_NotInitializedIf memory services lib not initialized

◆ NvRmMemQueryHeapParamsNuma()

NvError NvRmMemQueryHeapParamsNuma ( NvRmHeap  heap,
NvS32  NumaId,
NvBool  contig,
NvRmMemGpuAccess  GpuAccess,
NvRmMemHeapParams *  params,
NvU32  ParamsSize 
)

qnx_sr_only_doxygen_start: @IgnoreForDoc qnx_sr_only_doxygen_end:

@IfaceTagForDoc

Interface-Description:

Numa aware API to query heap params

This interface queries the heap params for a given input heap on a given numa node and provides the following parameters information:

- Total heap size
- Free memory in the heap
- Largest free block size in heap
- Size of granule in heap

Granule size is only valid for heaps which support allocation in granules. Also, please note that the free memory value returned by this API is an estimated value, so callers should use it carefully.

In order to query heap information for the heap on numa node 0, input arg NumaId should be provided as 0, for the numa node 1, it should be 1 and so on. When a user of this API provides incorrect numa node, then this API returns an error.

This API can be used even on a non-NUMA system by specifying NumaId input arg as 0, passing any other value results in an error.

Parameters
[in]heapNvRmHeap Desc: heap to query params. Range: Valid member of NvRmHeap enum
[in]NumaIdNvS32 Desc: numa id of the heap. Valid Range: [-(2^31), (2^31) - 1]
[in]contigNvBool Desc: heap params for contig memory support Range: true, false
[in]GpuAccessNvRmMemGpuAccess Desc: heap params for Gpu accessible memory support linux_nsr_only_doxygen_start: For Linux, this parameter is completely ignored. linux_nsr_only_doxygen_end: Range: Valid member of NvRmMemGpuAccess enum
[out]paramsNvRmMemHeapParams* Desc: NvRmMemHeapParams parameters of a heap returned by this API :
  1. Total memory reserved for heap in bytes
  2. Free memory available at heap in bytes
  3. Size of largest free block at heap linux_nsr_only_doxygen_start:
  4. Size of granule in heap linux_nsr_only_doxygen_end: Range: Valid pointer to NvRmMemHeapParams
[in]ParamsSizeNvU32 Desc: size of params struct that allows extension of params struct in future with no backward comptibility issue. Range: [0, 2^32-1]
Return values
NvSuccessIndicates that Query operation is successful. qnx_sr_only_doxygen_start:
NvError_BadParameterInvalid argument(s). qnx_sr_only_doxygen_end: linux_nsr_only_doxygen_start:
NvError_BadParameter1. Input parameter "heap" is invalid
  1. Output parameter "params" is NULL
  2. Linux KMD unable to query heap params with the given input parameters
NvError_InsufficientMemoryOut of memory and hence the query operation failed
NvError_IoctlFailedIoctl call has failed linux_nsr_only_doxygen_end:
NvError_NotInitializedIf memory services lib not initialized

◆ NvRmMemQueryHeaps()

NvError NvRmMemQueryHeaps ( const NvRmHeap *  Heap,
NvU32 *  NumHeapsAvailable 
)

@IfaceTagForDoc qnx_sr_only_doxygen_start: Covers: [Libnvrm_mem_SWUD_48] qnx_sr_only_doxygen_end:

Interface-Description:

Constraints: Before calling any memory services interfaces, it is expected to call NvRmMemMgrInit() once in client process to initialize memory services library and also, to create channel between client process and qnx_sr_only_doxygen_start: nvmap resource manager. qnx_sr_only_doxygen_end: linux_nsr_only_doxygen_start: nvmap Linux KMD. linux_nsr_only_doxygen_end:

Interface to query number of heaps available of a particular heap type. linux_nsr_only_doxygen_start: For DOS 7.0 Linux NSR, this API only supports IOMMU heap. linux_nsr_only_doxygen_end:

qnx_sr_only_doxygen_start: There could be multiple heaps available of a particular type, particularly of "NvRmHeap_IVC" type. This API returns the bitmask of available heaps where each bit set indicates the "other" peer that can use the heap. The API should return 0 for all other heaps (or return NvError_NotSupported?).

If an application wants to access this interface, it needs to be launched with "NvMap/Interfaces" ability with QUERY_HEAPS_INTERFACE_ABILITY ID.

"-A nonroot,allow,able=NvMap/Interfaces:<ability ID>" should be part of process launch command.

Description:

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

Function-uml:

This function query number of heaps available of a particular heap type. This API is only supported for IVC heaps.

.NvRmMemQueryHeaps [plantuml, NvRmMemQueryHeaps, svg, subs=attributes, align=center] .... .... qnx_sr_only_doxygen_end:

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

Parameters
[in]Heapconst NvRmHeap* Desc: Type of the heap for which number of such heaps available is to be queried. Range: Valid pointer to NvRmHeap
[out]NumHeapsAvailableNvU32* Desc: bitmask of heaps with each bit specifying the other peer that can use the partition. Range: Valid unsigned 32 bit pointer
Return values
NvSuccessOn Successful Query
NvError_BadParameter1. Input parameter "Heap" is NULL
  1. Output parameter "NumHeapsAvailable" is NULL qnx_sr_only_doxygen_start:
NvError_NotSupportedIf the heap type is not "NvRmHeap_IVC" qnx_sr_only_doxygen_end: linux_nsr_only_doxygen_start:
NvError_NotSupportedIf the heap type is not supported linux_nsr_only_doxygen_end:
NvError_NotInitializedIf memory services lib not initialized

◆ NvRmMemReserveIovaRegion()

NvError NvRmMemReserveIovaRegion ( NvU64  hwid,
struct NvRmMemIovaInfo *  IovaInfo 
)

linux_nsr_only_doxygen_start: @IgnoreForDoc linux_nsr_only_doxygen_end:

Covers: [Libnvrm_mem_SWUD_91]

@IfaceTagForDoc

Interface-Description:

Constraints: Before calling any memory services interfaces, it is expected to call NvRmMemMgrInit() once in client process to initialize memory services library and also, to create channel between client process and nvmap resource manager.

Interface to reserve IOVA region without physical baking for fixed mapping

If an application wants to access this interface, it needs to be launched with "NvMap/Interfaces" ability with below ability id.

  • RESERVE_IOVA_REGION_INTERFACE_ABILITY ID

"-A nonroot,allow,able=NvMap/Interfaces:<ability ID>" should be part of process launch command.

Description:

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

Interface to reserve IOVA region without physical baking for fixed mapping

Function-uml:

.NvRmMemReserveIovaRegion [plantuml, NvRmMemReserveIovaRegion, svg, subs=attributes, align=center] .... ....

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

Parameters
[in]hwidNvU64 Desc: hwid of the device Range: [0, 2^64-1]
[in]IovaInfostruct NvRmMemIovaInfo * Desc: IOVA info for the region allocation Range: Valid pointer to NvRmMemIovaInfo struct
Return values
NvSuccessReservation of IOVA address-space is successful
NvError_BadValueInput arguments are invalid
NvError_IoctlFailedDevctl call has failed
NvError_NotInitializedIf memory services lib not initialized

◆ NvRmMemUnmap()

NvError NvRmMemUnmap ( NvRmMemHandle  hMem,
void *  pVirtAddr,
NvU64  Size 
)

@IfaceTagForDoc qnx_sr_only_doxygen_start: Covers: [Libnvrm_mem_SWUD_16] qnx_sr_only_doxygen_end:

Interface-Description:

Constraints: Before calling any memory services interfaces, it is expected to call NvRmMemMgrInit() once in client process to initialize memory services library and also, to create channel between client process and qnx_sr_only_doxygen_start: nvmap resource manager. qnx_sr_only_doxygen_end: linux_nsr_only_doxygen_start: nvmap Linux KMD. linux_nsr_only_doxygen_end:

Unmaps a memory buffer from the process's virtual address space.

See also
NvRmMemMap()

qnx_sr_only_doxygen_start: If an application wants to access this interface, it needs to be launched with "NvMap/Interfaces" ability with below ability id.

  • NVMAP_INTERFACE_ABILITY ID

"-A nonroot,allow,able=NvMap/Interfaces:<ability ID>" should be part of process launch command.

Description:

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

This function unmap a memory buffer from the process's virtual address space. It validate the input arguments and page align the input virtual address and size and call the coorresponding ioctl for unmapping the handle.

Function-uml:

.NvRmMemUnmap [plantuml, NvRmMemUnmap, svg, subs=attributes, align=center] .... .... qnx_sr_only_doxygen_end:

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

Parameters
[in]hMemNvRmMemHandle Desc: A memory handle returned from NvRmMemHandleAllocAttr Range: [1, 2^32-1]
[in]pVirtAddrvoid* Desc: The virtual address returned by a previous call to NvRmMemMap with hMem. Range: Valid address
[in]SizeNvU64 Desc: The size in bytes of the mapped region. Must be the same as the Size value originally passed to NvRmMemMap. Range: [0, 2^64-1]
Return values
NvSuccessUnmap operation is successful
NvError_BadParameter1. Input parameter "hMem" is invalid
  1. Input parameter "pVirtAddr" is invalid linux_nsr_only_doxygen_start:
  2. Input parameter "Size" is invalid
NvError_InvalidAddressMemory Unmap failed linux_nsr_only_doxygen_end: qnx_sr_only_doxygen_start:
NvError_IoctlFailedDevctl call has failed qnx_sr_only_doxygen_end:
NvError_NotInitializedIf memory services lib not initialized
NUMA_NO_NODE
#define NUMA_NO_NODE
Default numa node, when user does not specify any specific numa node.
Definition: nvrm_memmgr_safe.h:990
NVOS_MEM_READ_WRITE
#define NVOS_MEM_READ_WRITE
The memory may be both read and writen.
Definition: nvos_common_tegra_safety.h:329
NvRmMemHandleAttrRec
Covers: [Libnvrm_mem_SWUD_106].
Definition: nvrm_memmgr_safe.h:662
NvOsMemAttribute_WriteCombined
@ NvOsMemAttribute_WriteCombined
Definition: nvos_common_tegra_safety.h:288
NvRmMemTags
NvRmMemTags
@IgnoreForDoc Covers: [Libnvrm_mem_SWUD_X]
Definition: nvrm_memmgr_safe.h:312