NVIDIA DRIVE OS Linux SDK API Reference

5.1.12.0 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
NvMedia VPI Synchronization

Detailed Description

The NvMedia VPI NvSciSync API encompasses NvMedia VPI functions using synchronization.

Macros

#define NVMEDIA_VPI_NVSCISYNC_VERSION_MAJOR   1
 Major version number. More...
 
#define NVMEDIA_VPI_NVSCISYNC_VERSION_MINOR   0
 Minor version number. More...
 
#define NVMEDIA_VPI_MAX_PRENVSCISYNCFENCES   (3U)
 Maximum number of times NvMediaVPIInsertPreNvSciSyncFence() can be called before each VPI queue call. More...
 
#define LAST_QUEUED_TASK_IDX   (0xFFFFFFFF)
 Index of last queued task. More...
 

Functions

NvMediaStatus NvMediaVPINvSciSyncGetVersion (NvMediaVersion *version)
 Returns the version information for the NvMedia VPI NvSciSync library. More...
 
NvMediaStatus NvMediaVPIFillNvSciSyncAttrList (NvMediaVPI *vpi, NvSciSyncAttrList attrlist, NvMediaNvSciSyncClientType clienttype)
 Fills the NvMediaVPI specific NvSciSync attributes. More...
 
NvMediaStatus NvMediaVPIRegisterNvSciSyncObj (NvMediaVPI *vpi, NvMediaNvSciSyncObjType syncobjtype, NvSciSyncObj nvscisync)
 Registers an NvSciSyncObj with NvMediaVPI. More...
 
NvMediaStatus NvMediaVPIUnRegisterNvSciSyncObj (NvMediaVPI *vpi, NvSciSyncObj nvscisync)
 Unregisters an NvSciSyncObj with NvMediaVPI. More...
 
NvMediaStatus NvMediaVPISetNvSciSyncObjforSOF (NvMediaVPI *vpi, NvSciSyncObj nvscisyncSOF)
 Sets the NvSciSyncObj to be used for a Start of Frame (SOF) NvSciSyncFence. More...
 
NvMediaStatus NvMediaVPISetNvSciSyncObjforEOF (NvMediaVPI *vpi, NvSciSyncObj nvscisyncEOF)
 Sets the NvSciSyncObj to be used for an End of Frame (EOF) NvSciSyncFence. More...
 
NvMediaStatus NvMediaVPIInsertPreNvSciSyncFence (NvMediaVPI *vpi, const NvSciSyncFence *prenvscisyncfence)
 Sets an NvSciSyncFence as a prefence for a VPI submit operation. More...
 
NvMediaStatus NvMediaVPIGetSOFNvSciSyncFence (NvMediaVPI *vpi, NvSciSyncObj sofnvscisyncobj, NvSciSyncFence *sofnvscisyncfence, uint32_t opIdx)
 Gets an SOF NvSciSyncFence for a queued VPI task. More...
 
NvMediaStatus NvMediaVPIGetEOFNvSciSyncFence (NvMediaVPI *vpi, NvSciSyncObj eofnvscisyncobj, NvSciSyncFence *eofnvscisyncfence, uint32_t opIdx)
 Gets an EOF NvSciSyncFence for a queued VPI task. More...
 

Macro Definition Documentation

#define LAST_QUEUED_TASK_IDX   (0xFFFFFFFF)

Index of last queued task.

Definition at line 50 of file nvmedia_vpi_nvscisync.h.

#define NVMEDIA_VPI_MAX_PRENVSCISYNCFENCES   (3U)

Maximum number of times NvMediaVPIInsertPreNvSciSyncFence() can be called before each VPI queue call.

Definition at line 47 of file nvmedia_vpi_nvscisync.h.

#define NVMEDIA_VPI_NVSCISYNC_VERSION_MAJOR   1

Major version number.

Definition at line 39 of file nvmedia_vpi_nvscisync.h.

#define NVMEDIA_VPI_NVSCISYNC_VERSION_MINOR   0

Minor version number.

Definition at line 41 of file nvmedia_vpi_nvscisync.h.

Function Documentation

NvMediaStatus NvMediaVPIFillNvSciSyncAttrList ( NvMediaVPI vpi,
NvSciSyncAttrList  attrlist,
NvMediaNvSciSyncClientType  clienttype 
)

Fills the NvMediaVPI specific NvSciSync attributes.

This API assumes that attrlist is a valid NvSciSyncAttrList.

This function sets the public attributes:

The application must not set this attribute.

Parameters
[in]vpiAn NvMedia VPI device handle.
[in,out]attrlistA pointer to an NvSciSyncAttrList structure where NvMedia fills NvSciSync attributes.
[in]clienttypeIndicates whether the attributes in attrlist are requested for an NvMediaVPI signaler or waiter.
Returns
NvMediaStatus, the completion status of the operation:
NvMediaStatus NvMediaVPIGetEOFNvSciSyncFence ( NvMediaVPI vpi,
NvSciSyncObj  eofnvscisyncobj,
NvSciSyncFence eofnvscisyncfence,
uint32_t  opIdx 
)

Gets an EOF NvSciSyncFence for a queued VPI task.

The expiry of an EOF NvSciSyncFence associated with a queued VPI task indicates that the corresponding submitted VPI task has finished. If you use NvMediaVPIGetEOFNvSciSyncFence(), you must call it after calling NvMediaVPIFlush().

Parameters
[in]vpiAn NvMedia VPI device handle.
[in]eofnvscisyncobjThe EOF NvSciSyncObj associated with the NvSciSyncFence being requested.
[out]eofnvscisyncfenceA pointer to the EOF NvSciSyncFence.
[in]opIdxAn index of the queued operation for this object's EOF. This value can be:
Returns
NvMediaStatus, return status of operation:
NvMediaStatus NvMediaVPIGetSOFNvSciSyncFence ( NvMediaVPI vpi,
NvSciSyncObj  sofnvscisyncobj,
NvSciSyncFence sofnvscisyncfence,
uint32_t  opIdx 
)

Gets an SOF NvSciSyncFence for a queued VPI task.

The expiry of an SOF NvSciFence associated with a queued VPI task indicates that the corresponding submitted VPI task has started. If you use NvMediaVPIGetSOFNvSciSyncFence(), the application must call it after calling NvMediaVPIFlush().

Parameters
[in]vpiAn NvMedia VPI device handle.
[in]sofnvscisyncobjSOF NvSciSyncObj associated with the requested NvSciSyncFence.
[out]sofnvscisyncfenceA pointer to the SOF NvSciSyncFence.
[in]opIdxAn index of the queued operation for this object's SOF. This value is between 0 and NVMEDIA_VPI_MAX_QUEUED_TASKS. This release supports only 0 (SOF for first queued task).
Returns
NvMediaStatus, return status of operation:
NvMediaStatus NvMediaVPIInsertPreNvSciSyncFence ( NvMediaVPI vpi,
const NvSciSyncFence prenvscisyncfence 
)

Sets an NvSciSyncFence as a prefence for a VPI submit operation.

If you use NvMediaVPIInsertPreNvSciSyncFence(), the application must call it before calling a VPI algorithm queue API. The following queued VPI task is started only after the expiry of the prenvscisyncfence.

Currently, before calling NvMediaVPIFlush() for a sequence of queued VPI tasks, you may call NvMediaVPIInsertPreNvSciSyncFence() only once.

You can set a maximum of NVMEDIA_VPI_MAX_PRENVSCISYNCFENCES prefences by calling NvMediaVPIInsertPreNvSciSyncFence() before calling a VPI queue function. After a call to the VPI queue function, all NvSciSyncFences previously inserted by NvMediaVPIInsertPreNvSciSyncFence() are cleared, and they are not reused for the subsequent VPI queue calls.

Parameters
[in]vpiAn NvMedia VPI device handle. This structure is modified internally.
[in]prenvscisyncfenceA pointer to NvSciSyncFence.
Returns
NvMediaStatus, the completion status of the operation:
NvMediaStatus NvMediaVPINvSciSyncGetVersion ( NvMediaVersion version)

Returns the version information for the NvMedia VPI NvSciSync library.

Parameters
[out]versionA pointer to an NvMediaVersion structure filled by the VPI NvSciSync library.
Returns
NvMediaStatus, the completion status of the operation:
NvMediaStatus NvMediaVPIRegisterNvSciSyncObj ( NvMediaVPI vpi,
NvMediaNvSciSyncObjType  syncobjtype,
NvSciSyncObj  nvscisync 
)

Registers an NvSciSyncObj with NvMediaVPI.

Every NvSciSyncObj(even duplicate objects) used by NvMediaVPI must be registered by a call to this function before it is used. Only the exact same registered NvSciSyncObj can be passed to the run time APIs.

For a given NvMediaVPI handle, one NvSciSyncObj can be registered as one NvMediaNvSciSyncObjType only. For each NvMediaNvSciSyncObjType, a maximum of 16 NvSciSyncObjs can be registered.

Parameters
[in]vpiAn NvMedia VPI device handle.
[in]syncobjtypeDetermines how nvscisync is used by vpi.
[in]nvscisyncThe NvSciSyncObj to be registered with vpi.
Returns
NvMediaStatus, the completion status of the operation:
NvMediaStatus NvMediaVPISetNvSciSyncObjforEOF ( NvMediaVPI vpi,
NvSciSyncObj  nvscisyncEOF 
)

Sets the NvSciSyncObj to be used for an End of Frame (EOF) NvSciSyncFence.

To use NvMediaVPIGetEOFNvSciSyncFence(), the application must call this function before calling a VPI task queue function.

NvMediaVPI currently accepts only one EOF NvSciSyncObj. Therefore, NvMediaVPISetNvSciSyncObjforEOF() can be called only once for an NvMediaVPI handle. Currently, EOF is signaled only upon the completion of the last queued task.

Parameters
[in]vpiAn NvMedia VPI device handle.
[in]nvscisyncEOFA registered NvSciSyncObj which is to be associated with EOF NvSciSyncFence.
Returns
NvMediaStatus, the completion status of the operation:
NvMediaStatus NvMediaVPISetNvSciSyncObjforSOF ( NvMediaVPI vpi,
NvSciSyncObj  nvscisyncSOF 
)

Sets the NvSciSyncObj to be used for a Start of Frame (SOF) NvSciSyncFence.

To use NvMediaVPIGetSOFNvSciSyncFence(), the application must call this function before calling a VPI task queue function. NvMediaVPI currently accepts only one SOF NvSciSyncObj. Therefore, NvMediaVPISetNvSciSyncObjforSOF may be called only once for an NvMediaVPI handle before a call to a VPI task queue function. Currently nvscisyncSOF is signaled before the start of the first queued task.

Parameters
[in]vpiAn NvMedia VPI device handle.
[in]nvscisyncSOFA registered NvSciSyncObj to be associated with SOF NvSciSyncFence.
Returns
NvMediaStatus, the completion status of the operation:
NvMediaStatus NvMediaVPIUnRegisterNvSciSyncObj ( NvMediaVPI vpi,
NvSciSyncObj  nvscisync 
)

Unregisters an NvSciSyncObj with NvMediaVPI.

During teardown, every NvSciSyncObj registered with NvMediaVPI must be unregistered before calling NvMediaVPIDestroy().

Before the application calls this function, it must ensure that the application is in teardown mode, and any NvMediaVPI operation using this NvSciSyncObj has completed. If the function is called while NvSciSyncObj is still in use by any NvMediaVPI operations, the behavior is undefined.

Parameters
[in]vpiAn NvMedia VPI device handle.
[in]nvscisyncAn NvSciSyncObj to be unregistered with vpi.
Returns
NvMediaStatus, the completion status of the operation: