NVIDIA DRIVE OS Linux SDK API Reference

5.2.0 Release
For Test and Development only

Detailed Description

List of APIs to transport NvSciBuf buffers and attribute list objects across various communication boundaries that interact using NvSciIpc.

Functions

NvSciError NvSciBufIpcExportAttrListAndObj (NvSciBufObj bufObj, NvSciBufAttrValAccessPerm permissions, NvSciIpcEndpoint ipcEndpoint, void **attrListAndObjDesc, size_t *attrListAndObjDescSize)
 Exports NvSciBufAttrList and NvSciBufObj into an NvSciIpc-transferable object export descriptor. More...
 
NvSciError NvSciBufIpcImportAttrListAndObj (NvSciBufModule module, NvSciIpcEndpoint ipcEndpoint, const void *attrListAndObjDesc, size_t attrListAndObjDescSize, const NvSciBufAttrList attrList[], size_t count, NvSciBufAttrValAccessPerm minPermissions, int64_t timeoutUs, NvSciBufObj *bufObj)
 This API is invoked by the importing process after it receives the object export descriptor sent by the other process who has created descriptor. More...
 
void NvSciBufAttrListAndObjFreeDesc (void *attrListAndObjDescBuf)
 Frees the descriptor used for exporting both NvSciBufAttrList and NvSciBufObj together. More...
 
NvSciError NvSciBufObjIpcExport (NvSciBufObj bufObj, NvSciBufAttrValAccessPerm accPerm, NvSciIpcEndpoint ipcEndpoint, NvSciBufObjIpcExportDescriptor *exportData)
 Exports the NvSciBufObj into an NvSciIpc-transferable object export descriptor. More...
 
NvSciError NvSciBufObjIpcImport (NvSciIpcEndpoint ipcEndpoint, const NvSciBufObjIpcExportDescriptor *desc, NvSciBufAttrList reconciledAttrList, NvSciBufAttrValAccessPerm minPermissions, int64_t timeoutUs, NvSciBufObj *bufObj)
 Creates the NvSciBufObj based on supplied object export descriptor and returns the NvSciBufObj. More...
 
NvSciError NvSciBufAttrListIpcExportUnreconciled (const NvSciBufAttrList unreconciledAttrListArray[], size_t unreconciledAttrListCount, NvSciIpcEndpoint ipcEndpoint, void **descBuf, size_t *descLen)
 Transforms the input unreconciled NvSciBufAttrList(s) to an exportable unreconciled NvSciBufAttrList descriptor that can be transported by the application to any remote process as a serialized set of bytes over an NvSciIpc channel. More...
 
NvSciError NvSciBufAttrListIpcExportReconciled (NvSciBufAttrList reconciledAttrList, NvSciIpcEndpoint ipcEndpoint, void **descBuf, size_t *descLen)
 Transforms the reconciled NvSciBufAttrList to an exportable reconciled NvSciBufAttrList descriptor that can be transported by the application to any remote process as a serialized set of bytes over an NvSciIpc channel. More...
 
NvSciError NvSciBufAttrListIpcImportUnreconciled (NvSciBufModule module, NvSciIpcEndpoint ipcEndpoint, const void *descBuf, size_t descLen, NvSciBufAttrList *importedUnreconciledAttrList)
 Translates an exported unreconciled NvSciBufAttrList descriptor (potentially received from any process) into an unreconciled NvSciBufAttrList. More...
 
NvSciError NvSciBufAttrListIpcImportReconciled (NvSciBufModule module, NvSciIpcEndpoint ipcEndpoint, const void *descBuf, size_t descLen, const NvSciBufAttrList inputUnreconciledAttrListArray[], size_t inputUnreconciledAttrListCount, NvSciBufAttrList *importedReconciledAttrList)
 Translates an exported reconciled NvSciBufAttrList descriptor (potentially received from any process) into a reconciled NvSciBufAttrList. More...
 
void NvSciBufAttrListFreeDesc (void *descBuf)
 Frees the NvSciBuf exported NvSciBufAttrList descriptor. More...
 

Function Documentation

◆ NvSciBufAttrListAndObjFreeDesc()

void NvSciBufAttrListAndObjFreeDesc ( void *  attrListAndObjDescBuf)

Frees the descriptor used for exporting both NvSciBufAttrList and NvSciBufObj together.

Parameters
[in]attrListAndObjDescBufDescriptor to be freed. The valid value is the one returned by successful call to NvSciBufIpcAttrlistAndObjExport.
Returns
void

◆ NvSciBufAttrListFreeDesc()

void NvSciBufAttrListFreeDesc ( void *  descBuf)

Frees the NvSciBuf exported NvSciBufAttrList descriptor.

Parameters
[in]descBufNvSciBufAttrList descriptor to be freed. The valid value is non-NULL.
Returns
void

◆ NvSciBufAttrListIpcExportReconciled()

NvSciError NvSciBufAttrListIpcExportReconciled ( NvSciBufAttrList  reconciledAttrList,
NvSciIpcEndpoint  ipcEndpoint,
void **  descBuf,
size_t *  descLen 
)

Transforms the reconciled NvSciBufAttrList to an exportable reconciled NvSciBufAttrList descriptor that can be transported by the application to any remote process as a serialized set of bytes over an NvSciIpc channel.

Parameters
[in]reconciledAttrListThe reconciled NvSciBufAttrList to be exported.
[in]ipcEndpointNvSciIpcEndpoint.
[out]descBufA pointer to the new reconciled NvSciBufAttrList descriptor, which the caller can deallocate later using NvSciBufAttrListFreeDesc().
[out]descLenThe size of the new reconciled NvSciBufAttrList descriptor.
Returns
NvSciError, the completion code of this operation:

◆ NvSciBufAttrListIpcExportUnreconciled()

NvSciError NvSciBufAttrListIpcExportUnreconciled ( const NvSciBufAttrList  unreconciledAttrListArray[],
size_t  unreconciledAttrListCount,
NvSciIpcEndpoint  ipcEndpoint,
void **  descBuf,
size_t *  descLen 
)

Transforms the input unreconciled NvSciBufAttrList(s) to an exportable unreconciled NvSciBufAttrList descriptor that can be transported by the application to any remote process as a serialized set of bytes over an NvSciIpc channel.

Parameters
[in]unreconciledAttrListArrayThe unreconciled NvSciBufAttrList(s) to be exported. The valid value is non NULL.
[in]unreconciledAttrListCountNumber of unreconciled NvSciBufAttrList(s) in unreconciledAttrListArray. This value must be non-zero. For a single list, the count must be set 1.
[in]ipcEndpointThe NvSciIpcEndpoint.
[out]descBufA pointer to the new unreconciled NvSciBufAttrList descriptor, which the caller can deallocate later using NvSciBufAttrListFreeDesc().
[out]descLenThe size of the new unreconciled NvSciBufAttrList descriptor.
Returns
NvSciError, the completion code of this operation:
  • NvSciError_Success if successful.
  • NvSciError_BadParameter if any of the following occurs:
    • unreconciledAttrListArray is NULL
    • unreconciledAttrListCount is 0
    • ipcEndpoint is invalid
    • descBuf is NULL
    • descLen is NULL
  • NvSciError_InsufficientMemory if memory allocation failed.
  • Panic if any of the NvSciBufAttrList(s) in unreconciledAttrListArray is invalid.

◆ NvSciBufAttrListIpcImportReconciled()

NvSciError NvSciBufAttrListIpcImportReconciled ( NvSciBufModule  module,
NvSciIpcEndpoint  ipcEndpoint,
const void *  descBuf,
size_t  descLen,
const NvSciBufAttrList  inputUnreconciledAttrListArray[],
size_t  inputUnreconciledAttrListCount,
NvSciBufAttrList importedReconciledAttrList 
)

Translates an exported reconciled NvSciBufAttrList descriptor (potentially received from any process) into a reconciled NvSciBufAttrList.

It also validates that the reconciled NvSciBufAttrList to be imported will be a reconciled NvSciBufAttrList that is consistent with the constraints in an array of input unreconciled NvSciBufAttrList(s). This is recommended while importing what is expected to be a reconciled NvSciBufAttrList to cause NvSciBuf to validate the reconciled NvSciBufAttrList against the input un-reconciled NvSciBufAttrList(s), so that the importing process can be sure that an NvSciBufObj will satisfy the input constraints.

Parameters
[in]moduleNvScibufModule with which to associate the imported NvSciBufAttrList.
[in]ipcEndpointNvSciIpcEndpoint.
[in]descBufThe reconciled NvSciBufAttrList descriptor to be translated into a reconciled NvSciBufAttrList. The valid value is non-NULL that points to descriptor received on NvSciIpc channel.
[in]descLenThe size of the reconciled NvSciBufAttrList descriptor. This value must be non-zero.
[in]inputUnreconciledAttrListArrayThe array of unreconciled NvSciBufAttrList against which the new reconciled NvSciBufAttrList is to be validated. NULL pointer is acceptable as a parameter if the validation needs to be skipped.
[in]inputUnreconciledAttrListCountThe number of unreconciled NvSciBufAttrList(s) in inputUnreconciledAttrListArray. If inputUnreconciledAttrListCount is non-zero, then this operation will fail with an error unless all the constraints of all the unreconciled NvSciBufAttrList(s) in inputUnreconciledAttrListArray are met by the imported reconciled NvSciBufAttrList.
[out]importedReconciledAttrListImported reconciled NvSciBufAttrList.
Returns
NvSciError, the completion code of this operation:
  • NvSciError_Success if successful.
  • NvSciError_BadParameter if any of the following occurs:
    • module is NULL
    • ipcEndpoint is invalid
    • descBuf is NULL or invalid
    • descLen is 0
    • importedReconciledAttrList is NULL
  • NvSciError_InsufficientMemory if memory allocation failed.
  • NvSciError_InvalidOperation if the import process does not have permission to initiate the action to import the reconciled attribute list.
  • NvSciError_AttrListValidationFailed if input unreconciled attribute lists' contraints are not satisfied by attributes associated with imported importedReconciledAttrList.
  • Panic if:
    • any of the NvSciBufAttrList in inputUnreconciledAttrListArray is invalid
    • module is invalid

◆ NvSciBufAttrListIpcImportUnreconciled()

NvSciError NvSciBufAttrListIpcImportUnreconciled ( NvSciBufModule  module,
NvSciIpcEndpoint  ipcEndpoint,
const void *  descBuf,
size_t  descLen,
NvSciBufAttrList importedUnreconciledAttrList 
)

Translates an exported unreconciled NvSciBufAttrList descriptor (potentially received from any process) into an unreconciled NvSciBufAttrList.

Parameters
[in]moduleNvScibufModule with which to associate the imported NvSciBufAttrList.
[in]ipcEndpointNvSciIpcEndpoint.
[in]descBufThe unreconciled NvSciBufAttrList descriptor to be translated into an unreconciled NvSciBufAttrList. The valid value is non-NULL that points to descriptor received on NvSciIpc channel.
[in]descLenThe size of the unreconciled NvSciBufAttrList descriptor. This value must be non-zero.
[out]importedUnreconciledAttrListThe imported unreconciled NvSciBufAttrList.
Returns
NvSciError, the completion code of this operation:

◆ NvSciBufIpcExportAttrListAndObj()

NvSciError NvSciBufIpcExportAttrListAndObj ( NvSciBufObj  bufObj,
NvSciBufAttrValAccessPerm  permissions,
NvSciIpcEndpoint  ipcEndpoint,
void **  attrListAndObjDesc,
size_t *  attrListAndObjDescSize 
)

Exports NvSciBufAttrList and NvSciBufObj into an NvSciIpc-transferable object export descriptor.

The blob can be transferred to the other processes to create a matching NvSciBufObj.

Parameters
[in]bufObjNvSciBufObj to export.
[in]permissionsFlag indicating the expected access permission (see NvSciBufAttrValAccessPerm). The valid data range is from NvSciBufAccessPerm_Readonly upto NvSciBufAcessPerm_Auto.
[in]ipcEndpointNvSciIpcEndpoint to identify the peer process.
[out]attrListAndObjDescNvSciBuf allocates and fills in the exportable form of NvSciBufObj and its corresponding NvSciBufAttrList to be shared across an NvSciIpc channel.
[out]attrListAndObjDescSizeSize of the exported blob.
Returns
NvSciError, the completion code of this operation:

◆ NvSciBufIpcImportAttrListAndObj()

NvSciError NvSciBufIpcImportAttrListAndObj ( NvSciBufModule  module,
NvSciIpcEndpoint  ipcEndpoint,
const void *  attrListAndObjDesc,
size_t  attrListAndObjDescSize,
const NvSciBufAttrList  attrList[],
size_t  count,
NvSciBufAttrValAccessPerm  minPermissions,
int64_t  timeoutUs,
NvSciBufObj bufObj 
)

This API is invoked by the importing process after it receives the object export descriptor sent by the other process who has created descriptor.

The importing process will create its own NvSciBufObj and return as output.

Parameters
[in]moduleNvSciBufModule to be used for importing NvSciBufObj.
[in]ipcEndpointNvSciIpcEndpoint to identify the peer process.
[in]attrListAndObjDescThe exported form of NvSciBufAttrList and NvSciBufObj. The valid value must be non NULL.
[in]attrListAndObjDescSizeSize of the imported blob. This value must be non-zero.
[in]attrList[]Receiver side array of NvSciBufAttrList(s) against which the imported NvSciBufAttrList has to be validated. NULL is valid value here if the validation of the received NvSciBufAttrList needs to be skipped.
[in]countNumber of NvSciBufAttrList objects in the array. This value must be non-zero.
[in]minPermissionsMinimum permissions of the buffer that the process is expecting to import the buffer (see NvSciBufAttrValAccessPerm). The valid data range is from NvSciBufAccessPerm_Readonly to less than NvSciBufAccessPerm_Invalid and should be less than NvSciBufAttrValAccessPerm, with which it was exported.
[in]timeoutUsMaximum delay (in microseconds) before an NvSciBuf object times out. The value of the variable is ignored currently.
[out]bufObjNvSciBuf Object duplicated and exported during the importing process. This object is associated with the reconciled NvSciBufAttrList imported from the attrListAndObjDesc.
Returns
NvSciError, the completion code of this operation:

◆ NvSciBufObjIpcExport()

NvSciError NvSciBufObjIpcExport ( NvSciBufObj  bufObj,
NvSciBufAttrValAccessPerm  accPerm,
NvSciIpcEndpoint  ipcEndpoint,
NvSciBufObjIpcExportDescriptor exportData 
)

Exports the NvSciBufObj into an NvSciIpc-transferable object export descriptor.

Descriptor can be transferred to other end of IPC where matching NvSciBufObj can be created from the descriptor.

Parameters
[in]bufObjNvSciBufObj to export.
[in]accPermFlag indicating the expected access permission (see NvSciBufAttrValAccessPerm). The valid data range is from NvSciBufAccessPerm_Readonly to less than NvSciBufAccessPerm_Invalid.
[in]ipcEndpointNvSciIpcEndpoint.
[out]exportDataNvSciBuf populates the return value with exportable form of NvSciBufObj shared across an NvSciIpc channel.
Returns
NvSciError, the completion code of this operation:

◆ NvSciBufObjIpcImport()

NvSciError NvSciBufObjIpcImport ( NvSciIpcEndpoint  ipcEndpoint,
const NvSciBufObjIpcExportDescriptor desc,
NvSciBufAttrList  reconciledAttrList,
NvSciBufAttrValAccessPerm  minPermissions,
int64_t  timeoutUs,
NvSciBufObj bufObj 
)

Creates the NvSciBufObj based on supplied object export descriptor and returns the NvSciBufObj.

Parameters
[in]ipcEndpointNvSciIpcEndpoint.
[in]descA pointer to an NvSciBufObjIpcExportDescriptor. The valid value is non-NULL that points to descriptor received on NvSciIpc channel.
[in]reconciledAttrListReconciled NvSciBufAttrList returned by NvSciBufAttrListImport().
[in]minPermissionsFlag indicating the expected access permission. The valid data range is from NvSciBufAccessPerm_Readonly to less than NvSciBufAccessPerm_Invalid.
[in]timeoutUsMaximum delay (in microseconds) before an NvSciBuf object times out. The value of the variable is ignored currently.
[out]bufObjImported NvSciBufObj created from the descriptor.
Returns
NvSciError, the completion code of this operation: