NVIDIA DriveOS Linux NSR SDK API Reference

7.0.3.0 Release
NvSciBuf Attribute List APIs

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 slot 0 of input 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) from slot 0 of input NvSciBufAttrList. More...
 
NvSciError NvSciBufAttrListSlotGetAttrs (NvSciBufAttrList attrList, size_t slotIndex, NvSciBufAttrKeyValuePair *pairArray, size_t pairCount)
 Returns an array of NvSciBufAttrKeyValuePair(s) from input NvSciBufAttrList at the given slot index. 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 and containing the contents of all the 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 and containing the contents of all the 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 at least 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.

◆ 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:
  • NvSciError_Success if successful.

◆ 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:
  • NvSciError_Success if successful.

◆ NvSciBufAttrListFree()

void NvSciBufAttrListFree ( NvSciBufAttrList  attrList)

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

Parameters
[in]attrListThe NvSciBufAttrList to be freed.
Returns
void
  • Panics if:
    • NvSciBufAttrList is invalid.
    • if Init Mode API is called in Runtime Mode.
Precondition
@id{NvSciBufAttrListFree_Precond_001} @asil{QM} Valid NvSciBufAttrList is obtained.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Provided there is no active operation involving the input NvSciBufAttrList attrList
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: Yes
    • Runtime: No
    • De-Init: No

◆ NvSciBufAttrListGetAttrs()

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

Returns an array of NvSciBufAttrKeyValuePair for a given set of NvSciBufAttrKey(s) from slot 0 of input NvSciBufAttrList.

This function accepts a set of NvSciBufAttrKey(s) passed in the NvSciBufAttrKeyValuePair structure.

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 is a valid enumeration value defined by the NvSciBufAttrKey enum.
[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
    • any of the NvSciBufAttrKey(s) in pairArray is not a valid enumeration value defined by the NvSciBufAttrKey enum
    • attrList is reconciled and any of the NvSciBufAttrKey(s) specified in NvSciBufAttrKeyValuePair is input only
    • attrList is unreconciled and any of the NvSciBufAttrKey(s) specified in NvSciBufAttrKeyValuePair is output only
  • Panics if any of the following occurs:
    • attrList is invalid
Precondition
@id{NvSciBufAttrListGetAttrs_PreCond_001} @asil{B} Valid NvSciBufAttrList is obtained.
Postcondition
@id{NvSciBufAttrListGetAttrs_PostCond_001} If an attribute was never set, the corresponding value will be set to NULL and length to 0. @arr @id{NvSciBufAttrListGetAttrs_RES_001} @asil{D} The return values, stored in NvSciBufAttrKeyValuePair, consist of const void* pointers to the attribute values from NvSciBufAttrList. The application must not write to this data.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: No
    • Runtime: Yes
    • De-Init: No

◆ 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
Precondition
@id{NvSciBufAttrListGetSlotCount_PreCond_001} @asil{B} Valid NvSciBufAttrList is obtained.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: No
    • Runtime: Yes
    • De-Init: No

◆ 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:
  • NvSciError_Success if successful.

◆ 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:
  • NvSciError_Success if successful.
  • newConflictList is NULL
  • NvSciError_InsufficientMemory if not enough system memory.
  • NvSciError_InvalidState if a new NvSciBufAttrList cannot be associated with the NvSciBufModule associated with the NvSciBufAttrList(s) in the given inputArray to create a new reconciled NvSciBufAttrList
  • NvSciError_NotSupported if an attribute key is set resulting in a combination of given constraints that are not supported
  • NvSciError_Overflow if internal integer overflow is detected.
  • NvSciError_ReconciliationFailed if reconciliation failed.
  • NvSciError_ResourceError if,
    • System lacks resource other than memory.
    • NVIDIA driver stack failed during this operation.
  • Panic if:
    • unreconciled NvSciBufAttrList(s) in inputArray is not valid.
Precondition
@id{NvSciBufAttrListReconcile_PreCond_001} @asil{QM} Valid unreconciled NvSciBufAttrList(s) are obtained.
Postcondition
@id{NvSciBufAttrListReconcile_PostCond_001} newReconciledList is valid only if the reconciliation is successful.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: Yes
    • Runtime: No
    • De-Init: No

◆ NvSciBufAttrListSetAttrs()

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

Sets the values for NvSciBufAttrKey(s) in the slot 0 of input 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 a valid enumeration value defined by the NvSciBufAttrKey enum 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:
  • NvSciError_Success if successful.

◆ NvSciBufAttrListSlotGetAttrs()

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

Returns an array of NvSciBufAttrKeyValuePair(s) from input 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 is a valid enumeration value defined by the NvSciBufAttrKey enum
[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
    • any of the NvSciBufAttrKey(s) in pairArray is not a valid enumeration value defined by the NvSciBufAttrKey enum
    • pairCount is 0
    • slotIndex >= slot count of NvSciBufAttrList
    • NvSciBufAttrKey specified in pairArray is invalid.
    • attrList is reconciled and any of the NvSciBufAttrKey(s) specified in NvSciBufAttrKeyValuePair is input only
    • attrList is unreconciled and any of the NvSciBufAttrKey(s) specified in NvSciBufAttrKeyValuePair is output only
  • Panics if any of the following occurs:
    • attrList is invalid
Precondition
@id{NvSciBufAttrListSlotGetAttrs_PreCond_001} @asil{B} Valid NvSciBufAttrList is obtained.
Postcondition
@id{NvSciBufAttrListSlotGetAttrs_PostCond_001} If an attribute was never set, the corresponding value will be set to NULL and length to 0. @arr @id{NvSciBufAttrListSlotGetAttrs_RES_001} @asil{D} The returned pairArray consist of const void* pointers to the actual attribute values from NvSciBufAttrList. The application must not overwrite this data.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: No
    • Runtime: Yes
    • De-Init: No

◆ 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.
[in]unreconciledAttrListArraySet of unreconciled NvSciBufAttrList(s) that need to be used for validation. unreconciledAttrListArray is valid if it is non-NULL.
[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.