NVIDIA DRIVE OS Linux SDK API Reference

5.1.15.0 Release
For Test and Development only

Detailed Description

Methods to perform operations on NvSciBuf attribute lists.

Functions

NvSciError NvSciBufAttrListCreate (NvSciBufModule module, NvSciBufAttrList *newAttrList)
 Creates a new, single slot, unreconciled NvSciBufAttrList associated with the input NvSciBufModule with empty NvSciBufAttrKeys. More...
 
void NvSciBufAttrListFree (NvSciBufAttrList attrList)
 Frees the NvSciBufAttrList and removes its association with the NvSciBufModule with which it was created. More...
 
NvSciError NvSciBufAttrListSetAttrs (NvSciBufAttrList attrList, NvSciBufAttrKeyValuePair *pairArray, size_t pairCount)
 Sets the values for NvSciBufAttrKey(s) in the NvSciBufAttrList. More...
 
size_t NvSciBufAttrListGetSlotCount (NvSciBufAttrList attrList)
 Returns the slot count per NvSciBufAttrKey in a NvSciBufAttrList. More...
 
NvSciError NvSciBufAttrListGetAttrs (NvSciBufAttrList attrList, NvSciBufAttrKeyValuePair *pairArray, size_t pairCount)
 Returns an array of NvSciBufAttrKeyValuePair for a given set of NvSciBufAttrKey(s). More...
 
NvSciError NvSciBufAttrListSlotGetAttrs (NvSciBufAttrList attrList, size_t slotIndex, NvSciBufAttrKeyValuePair *pairArray, size_t pairCount)
 Returns an array of NvSciBufAttrKeyValuePair(s) from a multi-slot unreconciled NvSciBufAttrList at the given slot index. More...
 
NvSciError NvSciBufAttrListDebugDump (NvSciBufAttrList attrList, void **buf, size_t *len)
 Allocates a buffer and then dumps the contents of the specified attribute list into the buffer. More...
 
NvSciError NvSciBufAttrListReconcile (const NvSciBufAttrList inputArray[], size_t inputCount, NvSciBufAttrList *newReconciledAttrList, NvSciBufAttrList *newConflictList)
 Reconciles the given unreconciled NvSciBufAttrList(s) into a new reconciled NvSciBufAttrList. More...
 
NvSciError NvSciBufAttrListClone (NvSciBufAttrList origAttrList, NvSciBufAttrList *newAttrList)
 Clones an unreconciled/reconciled NvSciBufAttrList. More...
 
NvSciError NvSciBufAttrListAppendUnreconciled (const NvSciBufAttrList inputUnreconciledAttrListArray[], size_t inputUnreconciledAttrListCount, NvSciBufAttrList *newUnreconciledAttrList)
 Appends multiple unreconciled NvSciBufAttrList(s) together, forming a single new unreconciled NvSciBufAttrList with a slot count equal to the sum of all the slot counts of NvSciBufAttrList(s) in the input array. More...
 
NvSciError NvSciBufAttrListIsReconciled (NvSciBufAttrList attrList, bool *isReconciled)
 Checks if the NvSciBufAttrList is reconciled. More...
 
NvSciError NvSciBufAttrListValidateReconciled (NvSciBufAttrList reconciledAttrList, const NvSciBufAttrList unreconciledAttrListArray[], size_t unreconciledAttrListCount, bool *isReconcileListValid)
 Validates a reconciled NvSciBufAttrList against a set of unreconciled NvSciBufAttrList(s). More...
 

Function Documentation

◆ NvSciBufAttrListAppendUnreconciled()

NvSciError NvSciBufAttrListAppendUnreconciled ( const NvSciBufAttrList  inputUnreconciledAttrListArray[],
size_t  inputUnreconciledAttrListCount,
NvSciBufAttrList newUnreconciledAttrList 
)

Appends multiple unreconciled NvSciBufAttrList(s) together, forming a single new unreconciled NvSciBufAttrList with a slot count equal to the sum of all the slot counts of NvSciBufAttrList(s) in the input array.

Parameters
[in]inputUnreconciledAttrListArray[]Array containing the unreconciled NvSciBufAttrList(s) to be appended together. Valid value: Array of valid NvSciBufAttrList(s) where the array size is atleast 1.
[in]inputUnreconciledAttrListCountNumber of unreconciled NvSciBufAttrList(s) in inputUnreconciledAttrListArray. Valid value: inputUnreconciledAttrListCount is valid input if it is non-zero.
[out]newUnreconciledAttrListAppended NvSciBufAttrList.
Returns
NvSciError, the completion code of the operation:
  • NvSciError_Success if successful.
  • NvSciError_BadParameter if any of the following occurs:
    • inputUnreconciledAttrListArray is NULL
    • inputUnreconciledAttrListCount is 0
    • newUnreconciledAttrList is NULL
    • any of the NvSciBufAttrList(s) in @inputUnreconciledAttrListArray is reconciled
  • NvSciError_InsufficientMemory if memory allocation failed.
  • panics if any NvSciBufAttrList in the inputUnreconciledAttrListArray is invalid

◆ NvSciBufAttrListClone()

NvSciError NvSciBufAttrListClone ( NvSciBufAttrList  origAttrList,
NvSciBufAttrList newAttrList 
)

Clones an unreconciled/reconciled NvSciBufAttrList.

The resulting NvSciBufAttrList contains all the values of the input NvSciBufAttrList. If the input NvSciBufAttrList is an unreconciled NvSciBufAttrList, then modification to the output NvSciBufAttrList will be allowed using NvSciBufAttrListSetAttrs().

Parameters
[in]origAttrListNvSciBufAttrList to be cloned.
[out]newAttrListThe new NvSciBufAttrList.
Returns
NvSciError, the completion code of the operation:

◆ NvSciBufAttrListCreate()

NvSciError NvSciBufAttrListCreate ( NvSciBufModule  module,
NvSciBufAttrList newAttrList 
)

Creates a new, single slot, unreconciled NvSciBufAttrList associated with the input NvSciBufModule with empty NvSciBufAttrKeys.

Parameters
[in]moduleNvSciBufModule to associate with the newly created NvSciBufAttrList.
[out]newAttrListThe new NvSciBufAttrList.
Returns
NvSciError, the completion status of the operation:

◆ NvSciBufAttrListDebugDump()

NvSciError NvSciBufAttrListDebugDump ( NvSciBufAttrList  attrList,
void **  buf,
size_t *  len 
)

Allocates a buffer and then dumps the contents of the specified attribute list into the buffer.

Parameters
[in]attrListAttribute list to fetch contents from.
[out]bufA pointer to the buffer allocated for the debug dump.
[out]lenThe length of the buffer allocated for the debug dump.
Returns
NvSciError, the completion code of the operation:

◆ NvSciBufAttrListFree()

void NvSciBufAttrListFree ( NvSciBufAttrList  attrList)

Frees the NvSciBufAttrList and removes its association with the NvSciBufModule with which it was created.

Note
Every owner of the NvSciBufAttrList shall call NvSciBufAttrListFree() only after all the functions invoked by the owner with NvSciBufAttrList as an input are completed.
Parameters
[in]attrListThe NvSciBufAttrList to be freed.
Returns
void
  • panics if NvSciBufAttrList is invalid.

◆ NvSciBufAttrListGetAttrs()

NvSciError NvSciBufAttrListGetAttrs ( NvSciBufAttrList  attrList,
NvSciBufAttrKeyValuePair pairArray,
size_t  pairCount 
)

Returns an array of NvSciBufAttrKeyValuePair for a given set of NvSciBufAttrKey(s).

This function accepts a set of NvSciBufAttrKey(s) passed in the NvSciBufAttrKeyValuePair structure. The return values, stored back into NvSciBufAttrKeyValuePair, consist of const void* pointers to the attribute values from the NvSciBufAttrList. The application must not write to this data.

Parameters
[in]attrListNvSciBufAttrList to fetch the NvSciBufAttrKeyValuePair(s) from.
[in,out]pairArrayArray of NvSciBufAttrKeyValuePair. Valid value: pairArray is valid input if it is not NULL and key member of every NvSciBufAttrKeyValuePair in the array > NvSciBufAttrKey_LowerBound and < NvSciBufAttrKey_UpperBound.
[in]pairCountNumber of elements/entries in pairArray. Valid value: pairCount is valid input if it is non-zero.
Returns
NvSciError, the completion code of the operation:

◆ NvSciBufAttrListGetSlotCount()

size_t NvSciBufAttrListGetSlotCount ( NvSciBufAttrList  attrList)

Returns the slot count per NvSciBufAttrKey in a NvSciBufAttrList.

Parameters
[in]attrListThe NvSciBufAttrList to retrieve the slot count from.
Returns
size_t
  • Number of slots in the NvSciBufAttrList
  • panics if attrList is invalid

◆ NvSciBufAttrListIsReconciled()

NvSciError NvSciBufAttrListIsReconciled ( NvSciBufAttrList  attrList,
bool *  isReconciled 
)

Checks if the NvSciBufAttrList is reconciled.

Parameters
[in]attrListNvSciBufAttrList to check.
[out]isReconciledboolean value indicating whether the attrList is reconciled or not.
Returns
NvSciError, the completion code of the operation:

◆ NvSciBufAttrListReconcile()

NvSciError NvSciBufAttrListReconcile ( const NvSciBufAttrList  inputArray[],
size_t  inputCount,
NvSciBufAttrList newReconciledAttrList,
NvSciBufAttrList newConflictList 
)

Reconciles the given unreconciled NvSciBufAttrList(s) into a new reconciled NvSciBufAttrList.

On success, this API call returns reconciled NvSciBufAttrList, which has to be freed by the caller using NvSciBufAttrListFree().

Parameters
[in]inputArrayArray containing unreconciled NvSciBufAttrList(s) to be reconciled. inputArray is valid if it is non-NULL.
[in]inputCountThe number of unreconciled NvSciBufAttrList(s) in inputArray. This value must be non-zero. For a single NvSciBufAttrList, the count must be set 1.
[out]newReconciledAttrListReconciled NvSciBufAttrList. This field is populated only if the reconciliation succeeded.
[out]newConflictListUnreconciled 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 the operation:

◆ NvSciBufAttrListSetAttrs()

NvSciError NvSciBufAttrListSetAttrs ( NvSciBufAttrList  attrList,
NvSciBufAttrKeyValuePair pairArray,
size_t  pairCount 
)

Sets the values for NvSciBufAttrKey(s) in the NvSciBufAttrList.

It only reads values from NvSciBufAttrKeyValuePair array and saves copies during this call.

Note
All combinations of NvSciBufAttrListSetAttrs(), NvSciBufAttrListGetAttrs(), NvSciBufAttrListAppendUnreconciled() and NvSciBufAttrListReconcile() can be called concurrently, however, function completion order is not guaranteed by NvSciBuf and thus outcome of calling these functions concurrently is undefined.
Parameters
[in]attrListUnreconciled NvSciBufAttrList.
[in]pairArrayArray of NvSciBufAttrKeyValuePair structures. Valid value: pairArray is valid input if it is not NULL and key member of every NvSciBufAttrKeyValuePair in the array is an input or input/output attribute and it is > NvSciBufAttrKey_LowerBound and < NvSciBufAttrKey_UpperBound and value member of every NvSciBufAttrKeyValuePair in the array is not NULL.
[in]pairCountNumber of elements/entries in pairArray. Valid value: pairCount is valid input if it is non-zero.
Returns
NvSciError, the completion status of the operation:

◆ NvSciBufAttrListSlotGetAttrs()

NvSciError NvSciBufAttrListSlotGetAttrs ( NvSciBufAttrList  attrList,
size_t  slotIndex,
NvSciBufAttrKeyValuePair pairArray,
size_t  pairCount 
)

Returns an array of NvSciBufAttrKeyValuePair(s) from a multi-slot unreconciled NvSciBufAttrList at the given slot index.

The return values, stored in NvSciBufAttrKeyValuePair, consist of const void* pointers to the attribute values from the NvSciBufAttrList. The application must not write to this data.

Note
When exporting an array containing multiple unreconciled NvSciBufAttrList(s), the importing endpoint still imports just one unreconciled NvSciBufAttrList. This unreconciled NvSciBufAttrList is referred to as a multi-slot NvSciBufAttrList. It logically represents an array of NvSciBufAttrList(s), where each key has an array of values, one per slot.
Parameters
[in]attrListNvSciBufAttrList to fetch the NvSciBufAttrKeyValuePair(s) from.
[in]slotIndexIndex in the NvSciBufAttrList. Valid value: 0 to slot count of NvSciBufAttrList - 1.
[in,out]pairArrayArray of NvSciBufAttrKeyValuePair. Holds the NvSciBufAttrKey(s) passed into the function and returns an array of NvSciBufAttrKeyValuePair structures. Valid value: pairArray is valid input if it is not NULL and key member of every NvSciBufAttrKeyValuePair in the array > NvSciBufAttrKey_LowerBound and < NvSciBufAttrKey_UpperBound.
[in]pairCountNumber of elements/entries in pairArray. Valid value: pairCount is valid input if it is non-zero.
Returns
NvSciError, the completion code of the operation:
  • NvSciError_Success if successful.
  • NvSciError_BadParameter if any of the following occurs:
    • attrList is NULL
    • pairArray is NULL
    • pairCount is 0
    • slotIndex >= slot count of NvSciBufAttrList
  • NvSciError_BadParameter if NvSciBufAttrKey specified in @ pairArray is < NvSciBufAttrKey_LowerBound OR > NvSciBufAttrKey_UpperBound.
  • panics if attrList is valid

◆ NvSciBufAttrListValidateReconciled()

NvSciError NvSciBufAttrListValidateReconciled ( NvSciBufAttrList  reconciledAttrList,
const NvSciBufAttrList  unreconciledAttrListArray[],
size_t  unreconciledAttrListCount,
bool *  isReconcileListValid 
)

Validates a reconciled NvSciBufAttrList against a set of unreconciled NvSciBufAttrList(s).

Parameters
[in]reconciledAttrListReconciled NvSciBufAttrList list to be validated. unreconciledAttrListArray is valid if it is non-NULL.
[in]unreconciledAttrListArraySet of unreconciled NvSciBufAttrList(s) that need to be used for validation.
[in]unreconciledAttrListCountNumber of unreconciled NvSciBufAttrList(s). This value must be non-zero. For a single NvSciBufAttrList, the count must be set to 1.
[out]isReconcileListValidFlag indicating if the reconciled NvSciBufAttrList satisfies the constraints of set of unreconciled NvSciBufAttrList(s).
Returns
NvSciError, the completion code of the operation:
  • NvSciError_Success if successful.
  • NvSciError_BadParameter if any of the following occurs:
    • reconciledAttrList is NULL or
    • unreconciledAttrListArray[] is NULL or
    • unreconciledAttrListCount is zero or
    • isReconcileListValid is NULL
    • any of the NvSciBufAttrList in unreconciledAttrListArray is reconciled.
    • not all the NvSciBufAttrLists in unreconciledAttrListArray are bound to the same NvSciBufModule.
  • NvSciError_ReconciliationFailed if validation of reconciled NvSciBufAttrList failed against input unreconciled NvSciBufAttrList(s).
  • NvSciError_InsufficientMemory if internal memory allocation failed.
  • NvSciError_Overflow if internal integer overflow occurs.
  • Panics if:
    • unreconciled NvSciBufAttrList(s) in unreconciledAttrListArray is invalid.
    • reconciledAttrList is not valid.