NVIDIA DRIVE OS Linux SDK API Reference

5.1.15.0 Release
For Test and Development only
Image 2D Processing Synchronization

Detailed Description

The NvMedia 2D NvSciSync API encompasses all NvMedia2D NvSciSync handling functions.

Macros

#define NVMEDIA_2D_NVSCISYNC_VERSION_MAJOR   1
 Major Version number. More...
 
#define NVMEDIA_2D_NVSCISYNC_VERSION_MINOR   0
 Minor Version number. More...
 
#define NVMEDIA_2D_MAX_PRENVSCISYNCFENCES   (3)
 NvMedia2DInsertPreNvSciSyncFence API can be called at most NVMEDIA_2D_MAX_PRENVSCISYNCFENCES times before each call to NvMedia2DBlitEx(). More...
 

Functions

NvMediaStatus NvMedia2DNvSciSyncGetVersion (NvMediaVersion *version)
 Returns the version information for the NvMedia 2D NvSciSync library. More...
 
NvMediaStatus NvMedia2DFillNvSciSyncAttrList (NvMedia2D *i2d, NvSciSyncAttrList attrlist, NvMediaNvSciSyncClientType clienttype)
 Fills the NvMedia2D specific NvSciSync attributes. More...
 
NvMediaStatus NvMedia2DRegisterNvSciSyncObj (NvMedia2D *i2d, NvMediaNvSciSyncObjType syncobjtype, NvSciSyncObj nvscisync)
 Register an NvSciSyncObj with NvMedia2D. More...
 
NvMediaStatus NvMedia2DUnregisterNvSciSyncObj (NvMedia2D *i2d, NvSciSyncObj nvscisync)
 Unregisters an NvSciSyncObj with NvMedia2D. More...
 
NvMediaStatus NvMedia2DSetNvSciSyncObjforEOF (NvMedia2D *i2d, NvSciSyncObj nvscisyncEOF)
 Specifies the NvSciSyncObj to be used for a EOF NvSciSyncFence. More...
 
NvMediaStatus NvMedia2DInsertPreNvSciSyncFence (NvMedia2D *i2d, const NvSciSyncFence *prenvscisyncfence)
 Sets an NvSciSyncFence as a prefence for an NvMedia2DBlitEx() operation. More...
 
NvMediaStatus NvMedia2DGetEOFNvSciSyncFence (NvMedia2D *i2d, NvSciSyncObj eofnvscisyncobj, NvSciSyncFence *eofnvscisyncfence)
 Gets an EOF NvSciSyncFence for an NvMedia2DBlitEx() operation. More...
 

Macro Definition Documentation

◆ NVMEDIA_2D_MAX_PRENVSCISYNCFENCES

#define NVMEDIA_2D_MAX_PRENVSCISYNCFENCES   (3)

NvMedia2DInsertPreNvSciSyncFence API can be called at most NVMEDIA_2D_MAX_PRENVSCISYNCFENCES times before each call to NvMedia2DBlitEx().

Definition at line 47 of file nvmedia_2d_nvscisync.h.

◆ NVMEDIA_2D_NVSCISYNC_VERSION_MAJOR

#define NVMEDIA_2D_NVSCISYNC_VERSION_MAJOR   1

Major Version number.

Definition at line 38 of file nvmedia_2d_nvscisync.h.

◆ NVMEDIA_2D_NVSCISYNC_VERSION_MINOR

#define NVMEDIA_2D_NVSCISYNC_VERSION_MINOR   0

Minor Version number.

Definition at line 40 of file nvmedia_2d_nvscisync.h.

Function Documentation

◆ NvMedia2DFillNvSciSyncAttrList()

NvMediaStatus NvMedia2DFillNvSciSyncAttrList ( NvMedia2D i2d,
NvSciSyncAttrList  attrlist,
NvMediaNvSciSyncClientType  clienttype 
)

Fills the NvMedia2D specific NvSciSync attributes.

This function assumes that attrlist is a valid NvSciSyncAttrList.

This function sets the public attributes:

The application must not set this attribute.

Parameters
[in]i2dAn NvMedia2D device handle.
[out]attrlistA pointer to an NvSciSyncAttrList structure where NvMedia places NvSciSync attributes.
[in]clienttypeIndicates the NvSciSyncAttrList requested for an NvMedia2D signaler or waiter.
Return values
NVMEDIA_STATUS_OKif the function is successful.
NVMEDIA_STATUS_BAD_PARAMETERif attrlist is NULL, or any of the public attributes listed above are already set.
NVMEDIA_STATUS_OUT_OF_MEMORYif there is not enough memory for the requested operation.

◆ NvMedia2DGetEOFNvSciSyncFence()

NvMediaStatus NvMedia2DGetEOFNvSciSyncFence ( NvMedia2D i2d,
NvSciSyncObj  eofnvscisyncobj,
NvSciSyncFence eofnvscisyncfence 
)

Gets an EOF NvSciSyncFence for an NvMedia2DBlitEx() operation.

The EOF NvSciSyncFence associated with an NvMedia2DBlitEx() operation is an NvSciSyncFence, and its expiry indicates that the corresponding NvMedia2DBlitEx() operation has finished.

NvMedia2DGetEOFNvSciSyncFence() returns the EOF NvSciSyncFence associated with the last NvMedia2DBlitEx() call. If you use NvMedia2DGetEOFNvSciSyncFence(), you must call it after calling NvMedia2DBlitEx().

For example, in this sequence of code:

nvmstatus = NvMedia2DBlitEx(nvm2dhdl, dstsurf, dstrect, srcsurf, srcrect,
blitparams, blitparamsout);
nvmstatus = NvMedia2DGetEOFNvSciSyncFence(nvm2dhdl, nvscisyncEOF, eofnvscisyncfence);

expiry of eofnvscisyncfence indicates that the preceding NvMedia2DBlitEx() operation has finished.

Parameters
[in]i2dAn NvMedia 2D device handle.
[in]eofnvscisyncobjEOF NvSciSyncObj associated with the NvSciSyncFence which is being requested.
[out]eofnvscisyncfenceA pointer to the EOF NvSciSyncFence.
Return values
NVMEDIA_STATUS_OKindicates that the call was successful.
NVMEDIA_STATUS_BAD_PARAMETERindicates that i2d is not a valid NvMedia2D handle, eofnvscisyncfence is NULL, or eofnvscisyncobj is not registered with i2d as type NVMEDIA_EOFSYNCOBJ or NVMEDIA_EOF_PRESYNCOBJ.
NVMEDIA_STATUS_ERRORindicates that the function was called before NvMedia2DBlitEx() was called.

◆ NvMedia2DInsertPreNvSciSyncFence()

NvMediaStatus NvMedia2DInsertPreNvSciSyncFence ( NvMedia2D i2d,
const NvSciSyncFence prenvscisyncfence 
)

Sets an NvSciSyncFence as a prefence for an NvMedia2DBlitEx() operation.

If you use NvMedia2DInsertPreNvSciSyncFence(), you must call it before calling NvMedia2DBlitEx(). The NvMedia2DBlitEx() operation is started only after the expiry of the prenvscisyncfence.

For example, in this sequence of code:

nvmstatus = NvMedia2DInsertPreNvSciSyncFence(nvm2dhdl, prenvscisyncfence);
nvmstatus = NvMedia2DBlitEx(nvm2dhdl, dstsurf, dstrect, srcsurf, srcrect,
blitparams, blitparamsout);

the NvMedia2DBlitEx() operation is assured to start only after the expiry of prenvscisyncfence.

You can set a maximum of NVMEDIA_2D_MAX_PRENVSCISYNCFENCES prefences by calling NvMedia2DInsertPreNvSciSyncFence() before NvMedia2DBlitEx(). After the call to NvMedia2DBlitEx(), all NvSciSyncFences previously inserted by NvMedia2DInsertPreNvSciSyncFence() are removed, and they are not reused for the subsequent NvMedia2DBlitEx() calls.

Parameters
[in]i2dAn NvMedia 2D NvMedia2D device handle.
[in]prenvscisyncfenceA pointer to an NvSciSyncFence.
Return values
NVMEDIA_STATUS_OKif the function is successful.
NVMEDIA_STATUS_BAD_PARAMETERif i2d is not a valid NvMedia2D handle, prenvscisyncfence is NULL, or prenvscisyncfence was not generated with an NvSciSyncObj that was registered with i2d as either NVMEDIA_PRESYNCOBJ or NVMEDIA_EOF_PRESYNCOBJ type.
NVMEDIA_STATUS_NOT_SUPPORTEDif NvMedia2DInsertPreNvSciSyncFence() has already been called at least NVMEDIA_2D_MAX_PRENVSCISYNCFENCES times with the same i2d handle before an NvMedia2DBlitEx() call.

◆ NvMedia2DNvSciSyncGetVersion()

NvMediaStatus NvMedia2DNvSciSyncGetVersion ( NvMediaVersion version)

Returns the version information for the NvMedia 2D NvSciSync library.

Parameters
[out]versionA pointer to an NvMediaVersion structure filled by the 2D NvSciSync library.
Returns
A status code: NVMEDIA_STATUS_OK if successful, or NVMEDIA_STATUS_BAD_PARAMETER if the pointer is invalid.

◆ NvMedia2DRegisterNvSciSyncObj()

NvMediaStatus NvMedia2DRegisterNvSciSyncObj ( NvMedia2D i2d,
NvMediaNvSciSyncObjType  syncobjtype,
NvSciSyncObj  nvscisync 
)

Register an NvSciSyncObj with NvMedia2D.

Every NvSciSyncObj (even duplicate objects) used by NvMedia2D must be registered by a call to this function before it is used. Only the exact same registered NvSciSyncObj can be passed to NvMedia2DSetNvSciSyncObjforEOF(), NvMedia2DGetEOFNvSciSyncFence(), or NvMedia2DUnregisterNvSciSyncObj().

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

Parameters
[in]i2dNvMedia 2D NvMedia2D device handle.
[in]syncobjtypeDetermines how nvscisync is used by i2d.
[in]nvscisyncThe NvSciSyncObj to be registered with i2d.
Return values
NVMEDIA_STATUS_OKif the function is successful.
NVMEDIA_STATUS_BAD_PARAMETERif i2d is NULL or syncobjtype is not a valid NvMediaNvSciSyncObjType.
NVMEDIA_STATUS_NOT_SUPPORTEDif nvscisync is not a compatible NvSciSyncObj which NvMedia2D can support.
NVMEDIA_STATUS_ERRORif the maximum number of NvSciScynObjs are already registered for the given syncobjtype, or if nvscisync is already registered with the same i2d handle for a different syncobjtype.

◆ NvMedia2DSetNvSciSyncObjforEOF()

NvMediaStatus NvMedia2DSetNvSciSyncObjforEOF ( NvMedia2D i2d,
NvSciSyncObj  nvscisyncEOF 
)

Specifies the NvSciSyncObj to be used for a EOF NvSciSyncFence.

To use NvMedia2DGetEOFNvSciSyncFence(), the application must call NvMedia2DSetNvSciSyncObjforEOF() before it calls NvMedia2DBlitEx().

NvMedia2DSetNvSciSyncObjforEOF() currently may be called only once before each call to NvMedia2DBlitEx(). The application may choose to call this function only once before the first call to NvMedia2DBlitEx().

Parameters
[in]i2dAn NvMedia 2D NvMedia2D device handle.
[in]nvscisyncEOFA registered NvSciSyncObj object which is to be associated with EOF NvSciSyncFence.
Returns
A status code; NVMEDIA_STATUS_OK if the function is successful, NVMEDIA_STATUS_BAD_PARAMETER if i2d is NULL, or if nvscisyncEOF is not registered with i2d as either type NVMEDIA_EOFSYNCOBJ or type NVMEDIA_EOF_PRESYNCOBJ.

◆ NvMedia2DUnregisterNvSciSyncObj()

NvMediaStatus NvMedia2DUnregisterNvSciSyncObj ( NvMedia2D i2d,
NvSciSyncObj  nvscisync 
)

Unregisters an NvSciSyncObj with NvMedia2D.

Every NvSciSyncObj registered with NvMedia2D by NvMedia2DRegisterNvSciSyncObj() must be unregistered before you call NvMedia2DDestroy().

Before the application calls this function, it must ensure that any NvMedia2DBlitEx() operation that uses the NvSciSyncObj has completed. If this function is called while NvSciSyncObj is still in use by any NvMedia2DBlitEx() operation, behavior is undefined.

Parameters
[in]i2dAn NvMedia 2D NvMedia2D device handle.
[in]nvscisyncAn NvSciSyncObj to be unregistered with i2d.
Return values
NVMEDIA_STATUS_OKif the call is successful.
NVMEDIA_STATUS_BAD_PARAMETERif i2d is NULL or nvscisync is not registered with i2d.
NVMEDIA_STATUS_ERRORif i2d was destroyed before this function was called.
NvMedia2DGetEOFNvSciSyncFence
NvMediaStatus NvMedia2DGetEOFNvSciSyncFence(NvMedia2D *i2d, NvSciSyncObj eofnvscisyncobj, NvSciSyncFence *eofnvscisyncfence)
Gets an EOF NvSciSyncFence for an NvMedia2DBlitEx() operation.
NvMedia2DInsertPreNvSciSyncFence
NvMediaStatus NvMedia2DInsertPreNvSciSyncFence(NvMedia2D *i2d, const NvSciSyncFence *prenvscisyncfence)
Sets an NvSciSyncFence as a prefence for an NvMedia2DBlitEx() operation.
NvMedia2DBlitEx
NvMediaStatus NvMedia2DBlitEx(const NvMedia2D *i2d, NvMediaImage *dstSurface, const NvMediaRect *dstRect, NvMediaImage *srcSurface, const NvMediaRect *srcRect, const NvMedia2DBlitParameters *params, NvMedia2DBlitParametersOut *paramsOut)
Performs a 2D blit operation with supplementary return values.