List of APIs to create/operate on NvSciBufObj.
|
NvSciError | NvSciBufObjDup (NvSciBufObj bufObj, NvSciBufObj *dupObj) |
| Creates a new NvSciBufObj holding reference to the same Memory object to which input NvSciBufObj holds the reference. More...
|
|
NvSciError | NvSciBufAttrListReconcileAndObjAlloc (const NvSciBufAttrList attrListArray[], size_t attrListCount, NvSciBufObj *bufObj, NvSciBufAttrList *newConflictList) |
| Reconciles the input unreconciled NvSciBufAttrList(s) into a new reconciled NvSciBufAttrList and allocates NvSciBufObj that meets all the constraints in the reconciled NvSciBufAttrList. More...
|
|
void | NvSciBufObjFree (NvSciBufObj bufObj) |
| Removes reference to the Memory object by destroying the NvSciBufObj. More...
|
|
NvSciError | NvSciBufObjGetAttrList (NvSciBufObj bufObj, NvSciBufAttrList *bufAttrList) |
| Retrieves the reconciled NvSciBufAttrList whose attributes define the constraints of the allocated buffer from the NvSciBufObj. More...
|
|
NvSciError | NvSciBufObjGetCpuPtr (NvSciBufObj bufObj, void **ptr) |
| Gets the CPU virtual address (VA) of the read/write buffer referenced by the NvSciBufObj. More...
|
|
NvSciError | NvSciBufObjGetConstCpuPtr (NvSciBufObj bufObj, const void **ptr) |
| Gets the CPU virtual address (VA) of the read-only buffer referenced by the NvSciBufObj. More...
|
|
NvSciError | NvSciBufObjFlushCpuCacheRange (NvSciBufObj bufObj, uint64_t offset, uint64_t len) |
| Flushes the given len bytes at starting offset in the buffer referenced by the NvSciBufObj. More...
|
|
NvSciError | NvSciBufObjAlloc (NvSciBufAttrList reconciledAttrList, NvSciBufObj *bufObj) |
| Allocates a buffer that satisfies all the constraints defined by the attributes of the specified reconciled NvSciBufAttrList, and outputs a new NvSciBufObj referencing the Memory object containing the allocated buffer properties. More...
|
|
NvSciError | NvSciBufObjDupWithReducePerm (NvSciBufObj bufObj, NvSciBufAttrValAccessPerm reducedPerm, NvSciBufObj *newBufObj) |
| Creates a new memory object containing a buffer handle representing new NvSciBufAttrValAccessPerm to the same buffer for which buffer handle is contained in the input memory object referenced by input NvSciBufObj and creates a new NvSciBufObj referencing it provided NvSciBufAttrValAccessPerm are less than permissions represented by buffer handle in the memory object referenced by input NvSciBufObj. More...
|
|
◆ NvSciBufAttrListReconcileAndObjAlloc()
Reconciles the input unreconciled NvSciBufAttrList(s) into a new reconciled NvSciBufAttrList and allocates NvSciBufObj that meets all the constraints in the reconciled NvSciBufAttrList.
- Note
- This interface just combines NvSciBufAttrListReconcile() and NvSciBufObjAlloc() interfaces together.
- Parameters
-
[in] | attrListArray | Array containing unreconciled NvSciBufAttrList(s) to reconcile. Valid value: Array of valid unreconciled NvSciBufAttrList(s) where array size is at least 1. |
[in] | attrListCount | The number of unreconciled NvSciBufAttrList(s) in attrListArray . Valid value: 1 to SIZE_MAX. |
[out] | bufObj | The new NvSciBufObj. |
[out] | newConflictList | Unreconciled NvSciBufAttrList consisting of the key/value pairs which caused the reconciliation failure. This field is populated only if the reconciliation failed. |
- Returns
- NvSciError, the completion code of this operation:
- NvSciError_Success if successful.
- NvSciError_BadParameter if any of the following occurs:
- attrListCount is 0
- attrListArray is NULL
- bufObj is NULL
- any of the NvSciBufAttrList in attrListArray is reconciled.
- not all the NvSciBufAttrLists in attrListArray are bound to the same NvSciBufModule.
- an attribute key necessary for reconciling against the given data type(s) of the NvSciBufAttrList(s) involved in reconciliation is unset
- an attribute key is set to an unsupported value considering the data type(s) of the NvSciBufAttrList(s) involved in reconciliation
- newConflictList is NULL
- NvSciError_InsufficientMemory if memory allocation failed.
- NvSciError_InvalidState if a new NvSciBufAttrList cannot be associated with the NvSciBufModule associated with the NvSciBufAttrList(s) in the given attrListArray to create the new NvSciBufAttrList.
- NvSciError_NotSupported if an attribute key is set specifying a combination of constraints that are not supported
- NvSciError_Overflow if internal integer overflow is detected.
- NvSciError_ReconciliationFailed if reconciliation failed.
- NvSciError_ResourceError if any of the following occurs:
- NVIDIA driver stack failed while assigning new permission to the buffer handle
- system lacks resource other than memory
- Panics if any of the unreconciled NvSciBufAttrLists is invalid.
◆ NvSciBufObjAlloc()
Allocates a buffer that satisfies all the constraints defined by the attributes of the specified reconciled NvSciBufAttrList, and outputs a new NvSciBufObj referencing the Memory object containing the allocated buffer properties.
- Parameters
-
[in] | reconciledAttrList | The reconciled NvSciBufAttrList. |
[out] | bufObj | The new NvSciBufObj. |
- Returns
- NvSciError, the completion code of this operation:
- NvSciError_Success if successful.
- NvSciError_BadParameter if any of the following occurs:
- reconciledList is NULL
- reconciledList is not a reconciled NvSciBufAttrList
- bufObj is NULL
- NvSciError_InsufficientMemory if there is insufficient memory to complete the operation.
- NvSciError_InvalidState if a new NvSciBufObj cannot be associated with the NvSciBufModule with which reconciledAttrList is associated to create the new NvSciBufObj.
- NvSciError_ResourceError if any of the following occurs:
- NVIDIA driver stack failed during buffer allocation
- system lacks resource other than memory
- Panics if reconciledAttrList is invalid.
◆ NvSciBufObjDup()
Creates a new NvSciBufObj holding reference to the same Memory object to which input NvSciBufObj holds the reference.
- Note
- The new NvSciBufObj created with NvSciBufObjDup() has same NvSciBufAttrValAccessPerm as the input NvSciBufObj.
- Parameters
-
[in] | bufObj | NvSciBufObj from which new NvSciBufObj needs to be created. |
[out] | dupObj | The new NvSciBufObj. |
- Returns
- NvSciError, the completion code of the operation:
◆ NvSciBufObjDupWithReducePerm()
Creates a new memory object containing a buffer handle representing new NvSciBufAttrValAccessPerm to the same buffer for which buffer handle is contained in the input memory object referenced by input NvSciBufObj and creates a new NvSciBufObj referencing it provided NvSciBufAttrValAccessPerm are less than permissions represented by buffer handle in the memory object referenced by input NvSciBufObj.
This interface has same effect as calling NvSciBufObjDup() if NvSciBufAttrValAccessPerm are same as permissions represented by buffer handle in the memory object referenced by input NvSciBufObj.
- Parameters
-
[in] | bufObj | NvSciBufObj. |
[in] | reducedPerm | Reduced access permissions that need to be imposed on the new NvSciBufObj (see NvSciBufAttrValAccessPerm). Valid value: NvSciBufAttrValAccessPerm enum value >= NvSciBufAccessPerm_Readonly and <= NvSciBufAttrValAccessPerm represented by NvSciBufGeneralAttrKey_ActualPerm key in reconciled NvSciBufAttrList associated with the input NvSciBufObj. |
[out] | newBufObj | The new NvSciBufObj with new permissions. |
- Returns
- NvSciError, the completion code of this operation:
- NvSciError_Success if successful.
- NvSciError_BadParameter if any of the following occurs:
- bufObj is NULL
- newBufObj is NULL
- reducedPerm is greater than the permissions specified in the value of the NvSciBufGeneralAttrKey_ActualPerm key
- NvSciError_InsufficientMemory if memory allocation failed.
- NvSciError_InvalidState if the total number of NvSciBufObjs referencing the memory object is INT32_MAX and the caller tries to take one more reference using this API.
- NvSciError_ResourceError if any of the following occurs:
- NVIDIA driver stack failed while assigning new permission to the buffer handle
- system lacks resource other than memory
- Panics of bufObj is invalid.
◆ NvSciBufObjFlushCpuCacheRange()
Flushes the given len
bytes at starting offset
in the buffer referenced by the NvSciBufObj.
Flushing is done only when NvSciBufGeneralAttrKey_CpuNeedSwCacheCoherency key is set in reconciled NvSciBufAttrList to true.
- Parameters
-
[in] | bufObj | The NvSciBufObj. |
[in] | offset | The starting offset in memory of the NvSciBufObj. Valid value: 0 to buffer size - 1. |
[in] | len | The length (in bytes) to flush. Valid value: 1 to buffer size - offset. |
- Returns
- NvSciError, the completion code of this operation:
◆ NvSciBufObjFree()
Removes reference to the Memory object by destroying the NvSciBufObj.
- Note
- Every owner of the NvSciBufObj shall call NvSciBufObjFree() only after all the functions invoked by the owner with NvSciBufObj as an input are completed.
- Parameters
-
[in] | bufObj | The NvSciBufObj to deallocate. |
- Returns
- void
- Panics if bufObj is invalid.
◆ NvSciBufObjGetAttrList()
Retrieves the reconciled NvSciBufAttrList whose attributes define the constraints of the allocated buffer from the NvSciBufObj.
- Note
- The retrieved NvSciBufAttrList from an NvSciBufObj is read-only, and the attribute values in the list cannot be modified using set attribute APIs. In addition, the retrieved NvSciBufAttrList must not be freed with NvSciBufAttrListFree.
- Parameters
-
[in] | bufObj | The NvSciBufObj to retrieve the NvSciBufAttrList from. |
[out] | bufAttrList | The retrieved reconciled NvSciBufAttrList. |
- Returns
- NvSciError, the completion code of this operation:
◆ NvSciBufObjGetConstCpuPtr()
Gets the CPU virtual address (VA) of the read-only buffer referenced by the NvSciBufObj.
- Note
- This interface can be called successfully only if NvSciBufObj was obtained from successful call to NvSciBufObjAlloc() or NvSciBufObj was obtained from successful call to NvSciBufObjIpcImport()/ NvSciBufIpcImportAttrListAndObj() where at least NvSciBufAccessPerm_Readonly permissions are granted to the imported NvSciBufObj (The permissions of the NvSciBufObj are indicated by NvSciBufGeneralAttrKey_ActualPerm key in the reconciled NvSciBufAttrList associated with it) and CPU access is requested by setting NvSciBufGeneralAttrKey_NeedCpuAccess to true.
- Parameters
-
[in] | bufObj | The NvSciBufObj. |
[out] | ptr | the CPU virtual address (VA). |
- Returns
- NvSciError, the completion code of this operation:
- NvSciError_Success if successful.
- NvSciError_BadParameter if any of the following occurs:
- bufObj is NULL.
- ptr is NULL.
- NvSciError_BadParameter NvSciBufObj either did not request for CPU access by setting NvSciBufGeneralAttrKey_NeedCpuAccess to true OR does not have at least NvSciBufAccessPerm_ReadOnly permissions to the buffer.
- Panics if bufObj is invalid.
◆ NvSciBufObjGetCpuPtr()
Gets the CPU virtual address (VA) of the read/write buffer referenced by the NvSciBufObj.
- Note
- This interface can be called successfully only if NvSciBufObj was obtained from successful call to NvSciBufObjAlloc() or NvSciBufObj was obtained from successful call to NvSciBufObjIpcImport()/ NvSciBufIpcImportAttrListAndObj() where NvSciBufAccessPerm_ReadWrite permissions are granted to the imported NvSciBufObj (The permissions of the NvSciBufObj are indicated by NvSciBufGeneralAttrKey_ActualPerm key in the reconciled NvSciBufAttrList associated with it) and CPU access is requested by setting NvSciBufGeneralAttrKey_NeedCpuAccess to true.
- Parameters
-
[in] | bufObj | The NvSciBufObj. |
[out] | ptr | The CPU virtual address (VA). |
- Returns
- NvSciError, the completion code of this operation:
- NvSciError_Success if successful.
- NvSciError_BadParameter if any of the following occurs:
- bufObj is NULL.
- ptr is NULL.
- NvSciError_BadParameter NvSciBufObj either did not request for CPU access by setting NvSciBufGeneralAttrKey_NeedCpuAccess to true OR does not have NvSciBufAccessPerm_ReadWrite to the buffer.
- Panics if bufObj is invalid.