NVIDIA DriveOS Linux NSR SDK API Reference

7.0.3.0 Release
Vic Diagnostics Synchronization

Detailed Description

The Vic Diagnostics NvSci API encompasses all Vic Diagnostics handling for NvSciSync related functions.

6

Functions

NvMediaStatus VicDiagnosticsFillNvSciSyncAttrList (VicDiagnostics const *const handle, NvSciSyncAttrList const attrList, NvMediaNvSciSyncClientType const clientType)
 Fills the Vic Diagnostics specific NvSciSync attributes. More...
 
NvMediaStatus VicDiagnosticsRegisterNvSciSyncObj (VicDiagnostics const *const handle, NvMediaNvSciSyncObjType const syncObjType, NvSciSyncObj const syncObj)
 Register an NvSciSyncObj with Vic Diagnostics. More...
 
NvMediaStatus VicDiagnosticsUnregisterNvSciSyncObj (VicDiagnostics const *const handle, NvSciSyncObj const syncObj)
 Unregisters an NvSciSyncObj with VicDiagnostics. More...
 
NvMediaStatus VicDiagnosticsSetNvSciSyncObjforEOF (VicDiagnostics const *const handle, VicDiagnosticsParameters const params, NvSciSyncObj const syncObj)
 Specifies the NvSciSyncObj to be used for EOF event. More...
 
NvMediaStatus VicDiagnosticsInsertPreNvSciSyncFence (VicDiagnostics const *const handle, VicDiagnosticsParameters const params, NvSciSyncFence const *const syncFence)
 Insert an NvSciSyncFence as a pre-fence. More...
 
NvMediaStatus VicDiagnosticsGetEOFNvSciSyncFence (VicDiagnostics const *const handle, VicDiagnosticsResult const *const result, NvSciSyncFence *const syncFence)
 Gets an EOF NvSciSyncFence for an VicDiagnosticsExecute() operation. More...
 

Function Documentation

◆ VicDiagnosticsFillNvSciSyncAttrList()

NvMediaStatus VicDiagnosticsFillNvSciSyncAttrList ( VicDiagnostics const *const  handle,
NvSciSyncAttrList const  attrList,
NvMediaNvSciSyncClientType const  clientType 
)

Fills the Vic Diagnostics specific NvSciSync attributes.

This function updates the input NvSciSyncAttrList with values equivalent to the following public attribute key-values:

NvSciSyncAttrKey_RequiredPerm set to

  • NvSciSyncAccessPerm_WaitOnly for clientType NVMEDIA_WAITER
  • NvSciSyncAccessPerm_SignalOnly for clientType NVMEDIA_SIGNALER
  • NvSciSyncAccessPerm_WaitSignal for clientType NVMEDIA_SIGNALER_WAITER

NvSciSyncAttrKey_PrimitiveInfo set to

  • NvSciSyncAttrValPrimitiveType_Syncpoint

The application must not set these attributes for the same NvSciSyncAttrList that is passed to this function.

When clientType is NVMEDIA_SIGNALER or NVMEDIA_SIGNALER_WAITER, some of the attribute values returned in attrList are tied to the specific VicDiagnostics context instance passed in handle. NvSciSyncObjs created using such attribute values must not be used after the VicDiagnostics context instance has been destroyed.

Parameters
[in]handlePointer to the VicDiagnostics context.
[out]attrListPointer to an NvSciSyncAttrList struct that will be populated with the NvSciSync attributes.
[in]clientTypeAn NvMediaNvSciSyncClientType, to indicate whether the attributes filled should be for a waiter or a signaler. The value should be either:
  • NVMEDIA_WAITER
  • NVMEDIA_SIGNALER
  • NVMEDIA_SIGNALER_WAITER.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKAttributes filled successfully.
NVMEDIA_STATUS_BAD_PARAMETERThe attributes have already been filled, or one of the parameters has an invalid value. This could be:
  • handle is NULL
  • attrList is invalid
  • clientType is invalid.
NVMEDIA_STATUS_INVALID_STATEThe function was called in incorrect system state.
NVMEDIA_STATUS_ERRORAn internal failure occurred when trying to populate the attribute list.
Precondition
  • handle must be valid VicDiagnostics handle created with VicDiagnosticsCreate().
  • attrList must be valid NvSciSyncAttrList handle.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different VicDiagnostics handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: Yes
    • Runtime: No
    • De-Init: No

◆ VicDiagnosticsGetEOFNvSciSyncFence()

NvMediaStatus VicDiagnosticsGetEOFNvSciSyncFence ( VicDiagnostics const *const  handle,
VicDiagnosticsResult const *const  result,
NvSciSyncFence *const  syncFence 
)

Gets an EOF NvSciSyncFence for an VicDiagnosticsExecute() operation.

The expiry of an EOF NvSciSyncFence associated with an VicDiagnosticsExecute() operation indicates that the corresponding VicDiagnosticsExecute() operation has finished.

To be able to get the EOF fence using this function, the NvSciSyncObj to be used for EOF event needs to have been set for the VicDiagnosticsParameters handle used with the VicDiagnosticsExecute() operation with VicDiagnosticsSetNvSciSyncObjforEOF().

For example, in this sequence of code:

expiry of syncFence indicates that the preceding VicDiagnosticsExecute() operation has finished.

For a given NvSciSyncObj used for the EOF event, the EOF fence for a VicDiagnosticsExecute() operation can be queried using this function only until the next operation using the same NvSciSyncObj for the EOF event is submitted. When more operations are submitted, the VicDiagnosticsResult structs for the previous operations are no longer considered valid by this function.

The fence returned in syncFence is tied to the specific VicDiagnostics context instance passed in handle and must not be used after the VicDiagnostics context instance has been destroyed.

This function will clear syncFence before updating and returning it's new value.

Parameters
[in]handlePointer to the VicDiagnostics context.
[in]resultPointer to the VicDiagnosticsResult struct.
[out]syncFencePointer to an NvSciSyncFence that will be populated with the EOF fence.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKEOF fence returned successfully.
NVMEDIA_STATUS_BAD_PARAMETERNo NvSciSyncObj was set for the operation EOF event, or one of the parameters has an invalid value. This could be:
  • handle is NULL
  • result is NULL or invalid
  • syncFence is NULL.
NVMEDIA_STATUS_ERRORAn internal failure occurred when trying to get the fence object.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different VicDiagnostics handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: No
    • Runtime: Yes
    • De-Init: No
See also
VicDiagnosticsRegisterNvSciSyncObj()
VicDiagnosticsSetNvSciSyncObjforEOF()

◆ VicDiagnosticsInsertPreNvSciSyncFence()

NvMediaStatus VicDiagnosticsInsertPreNvSciSyncFence ( VicDiagnostics const *const  handle,
VicDiagnosticsParameters const  params,
NvSciSyncFence const *const  syncFence 
)

Insert an NvSciSyncFence as a pre-fence.

This function inserts the specified NvSciSyncFence as a pre-fence to the diagnostic operation. The VicDiagnosticsExecute() operation is started only after the expiry of the syncFence.

For example, in this sequence of code:

the VicDiagnosticsExecute () operation is assured to start only after the expiry of syncFence.

You can set a maximum of 16 prefences by calling VicDiagnosticsInsertPreNvSciSyncFence().

Parameters
[in]handlePointer to the VicDiagnostics context.
[in]paramsAn VicDiagnosticsParameters handle.
[in]syncFencePointer to an NvSciSyncFence.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKPre-fence inserted successfully.
NVMEDIA_STATUS_BAD_PARAMETERThe sync object or its duplicate is not registered as an PRESYNC type with Vic Diagnostics, or one of the parameters has an invalid value. This could be:
  • handle is NULL
  • params is invalid
  • syncFence is NULL.
NVMEDIA_STATUS_INSUFFICIENT_BUFFERINGMaximum number of registered pre-fences has been reached.
NVMEDIA_STATUS_ERRORAn internal failure occurred when trying to insert the pre-fence.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different VicDiagnostics handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: No
    • Runtime: Yes
    • De-Init: No
See also
VicDiagnosticsRegisterNvSciSyncObj()

◆ VicDiagnosticsRegisterNvSciSyncObj()

NvMediaStatus VicDiagnosticsRegisterNvSciSyncObj ( VicDiagnostics const *const  handle,
NvMediaNvSciSyncObjType const  syncObjType,
NvSciSyncObj const  syncObj 
)

Register an NvSciSyncObj with Vic Diagnostics.

Every NvSciSyncObj used by Vic Diagnostics must be registered by a call to this function before it is used. Also the NvSciSyncObjs associated with any NvSciSyncFences passed to VicDiagnosticsInsertPreNvSciSyncFence() must be registered.

Parameters
[in]handlePointer to the VicDiagnostics context.
[in]syncObjTypeAn NvMediaNvSciSyncClientType, to indicate what event the sync object will represent. Must be one of
  • NVMEDIA_PRESYNCOBJ
  • NVMEDIA_EOFSYNCOBJ
  • NVMEDIA_EOF_PRESYNCOBJ
[in]syncObjThe NvSciSyncObj to be registered.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKSync object registered successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value. This could be:
  • handle is NULL
  • syncObjType is invalid
  • syncObj is invalid, or the sync object or its duplicate has been already registered.
NVMEDIA_STATUS_INSUFFICIENT_BUFFERINGMaximum number of registered sync objects has been reached.
NVMEDIA_STATUS_INVALID_STATEThe function was called in incorrect system state.
NVMEDIA_STATUS_ERRORAn internal failure occurred when trying to register the sync object.
Precondition
  • handle must be valid VicDiagnostics handle created with VicDiagnosticsCreate().
  • syncObj must be valid NvSciSyncObj handle.


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different VicDiagnostics handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: Yes
    • Runtime: No
    • De-Init: No
See also
VicDiagnosticsUnregisterNvSciSyncObj()
VicDiagnosticsAttributes.maxRegisteredSyncs

◆ VicDiagnosticsSetNvSciSyncObjforEOF()

NvMediaStatus VicDiagnosticsSetNvSciSyncObjforEOF ( VicDiagnostics const *const  handle,
VicDiagnosticsParameters const  params,
NvSciSyncObj const  syncObj 
)

Specifies the NvSciSyncObj to be used for EOF event.

Parameters
[in]handlePointer to the VicDiagnostics context.
[in]paramsAn VicDiagnosticsParameters handle.
[in]syncObjThe NvSciSyncObj to be used for the EOF fence.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKEOF fence set successfully.
NVMEDIA_STATUS_BAD_PARAMETERThe sync object or its duplicate is not registered as an EOF event type with Vic Diagnostics, or one of the parameters has an invalid value. This could be:
  • handle is NULL
  • params is invalid
  • syncObj is invalid.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different VicDiagnostics handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: No
    • Runtime: Yes
    • De-Init: No
See also
VicDiagnosticsRegisterNvSciSyncObj()

◆ VicDiagnosticsUnregisterNvSciSyncObj()

NvMediaStatus VicDiagnosticsUnregisterNvSciSyncObj ( VicDiagnostics const *const  handle,
NvSciSyncObj const  syncObj 
)

Unregisters an NvSciSyncObj with VicDiagnostics.

Every NvSciSyncObj registered with VicDiagnostics by VicDiagnosticsRegisterNvSciSyncObj() must be unregistered before you call VicDiagnosticsDestroy().

Before the application calls this function, it must ensure that any VicDiagnosticsExecute() operation that uses the NvSciSyncObj has completed. If this function is called while NvSciSyncObj is still in use by any VicDiagnosticsExecute() operation, an error will be returned.

Parameters
[in]handlePointer to the VicDiagnostics context.
[in]syncObjThe NvSciSyncObj to be unregistered.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKSync object unregistered successfully.
NVMEDIA_STATUS_BAD_PARAMETEROne of the parameters has an invalid value. This could be:
  • handle is NULL
  • syncObj is invalid, or the sync object or its duplicate was not registered.
NVMEDIA_STATUS_INVALID_STATEThe function was called in incorrect system state.
NVMEDIA_STATUS_PENDINGThe sync object is still being used by a pending operation.
NVMEDIA_STATUS_ERRORAn internal failure occurred when trying to unregister the sync object.
Precondition


Usage considerations

  • Allowed context for the API call
    • Interrupt handler: No
    • Signal handler: No
    • Thread-safe: Yes, with the following conditions:
      • Each thread uses different VicDiagnostics handle
    • Re-entrant: No
    • Async/Sync: Sync
  • Required privileges: None
  • API group
    • Init: Yes
    • Runtime: No
    • De-Init: Yes
See also
VicDiagnosticsRegisterNvSciSyncObj()
VicDiagnosticsInsertPreNvSciSyncFence
NvMediaStatus VicDiagnosticsInsertPreNvSciSyncFence(VicDiagnostics const *const handle, VicDiagnosticsParameters const params, NvSciSyncFence const *const syncFence)
Insert an NvSciSyncFence as a pre-fence.
VicDiagnosticsSetNvSciSyncObjforEOF
NvMediaStatus VicDiagnosticsSetNvSciSyncObjforEOF(VicDiagnostics const *const handle, VicDiagnosticsParameters const params, NvSciSyncObj const syncObj)
Specifies the NvSciSyncObj to be used for EOF event.
handle
const WFDCommitType const WFDHandle handle
Definition: wfdext.h:124
VicDiagnosticsGetEOFNvSciSyncFence
NvMediaStatus VicDiagnosticsGetEOFNvSciSyncFence(VicDiagnostics const *const handle, VicDiagnosticsResult const *const result, NvSciSyncFence *const syncFence)
Gets an EOF NvSciSyncFence for an VicDiagnosticsExecute() operation.
VicDiagnosticsExecute
NvMediaStatus VicDiagnosticsExecute(VicDiagnostics const *const handle, VicDiagnosticsParameters const params, VicDiagnosticsResult *const result)
Performs a VIC HW diagnostic operation.
params
DW_API_PUBLIC dwPointCloudRangeImageCreatorParams const *const params
Definition: PointCloudRangeImageCreator.h:292