NVIDIA DRIVE OS Linux SDK API Reference

6.0.3 Release
Image 2D Processing Synchronization

Detailed Description

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

Modules

 History
 Provides change history for the NvMedia 2D NvSciSync API.
 

Macros

#define NVMEDIA_2D_NVSCISYNC_VERSION_MAJOR   1
 Major version number of NvMedia 2D NvSciSync header. More...
 
#define NVMEDIA_2D_NVSCISYNC_VERSION_MINOR   0
 Minor version number of NvMedia 2D NvSciSync header. More...
 
#define NVMEDIA_2D_MAX_PRENVSCISYNCFENCES   (3u)
 Maximum number of NvSciSync pre-fences. More...
 

Functions

NvMediaStatus NvMedia2DNvSciSyncGetVersion (NvMediaVersion *version)
 Returns the version number of the NvMedia 2D NvSciSync library. More...
 
NvMediaStatus NvMedia2DFillNvSciSyncAttrList (const NvMedia2D *i2d, NvSciSyncAttrList attrlist, NvMediaNvSciSyncClientType clienttype)
 Fills the NvMedia 2D specific NvSciSync attributes. More...
 
NvMediaStatus NvMedia2DRegisterNvSciSyncObj (const NvMedia2D *i2d, NvMediaNvSciSyncObjType syncobjtype, NvSciSyncObj nvscisync)
 Register an NvSciSyncObj with NvMedia 2D. More...
 
NvMediaStatus NvMedia2DUnregisterNvSciSyncObj (const NvMedia2D *i2d, NvSciSyncObj nvscisync)
 Unregisters an NvSciSyncObj with NvMedia2D. More...
 
NvMediaStatus NvMedia2DSetNvSciSyncObjforEOF (const NvMedia2D *i2d, NvSciSyncObj nvscisyncEOF)
 Specifies the NvSciSyncObj to be used for EOF event. More...
 
NvMediaStatus NvMedia2DInsertPreNvSciSyncFence (const NvMedia2D *i2d, const NvSciSyncFence *prenvscisyncfence)
 Insert an NvSciSyncFence as a pre-fence. More...
 
NvMediaStatus NvMedia2DGetEOFNvSciSyncFence (const 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   (3u)

Maximum number of NvSciSync pre-fences.

This defines the maximum number of NvSciSync objects that can be used as pre-fences to a single NvMedia 2D operation. So this directly maps to the maximum number of times that NvMedia2DInsertPreNvSciSyncFence() can be called before the call to NvMedia2DBlitEx().

See also
NvMedia2DInsertPreNvSciSyncFence()

Definition at line 63 of file nvmedia_2d_nvscisync.h.

◆ NVMEDIA_2D_NVSCISYNC_VERSION_MAJOR

#define NVMEDIA_2D_NVSCISYNC_VERSION_MAJOR   1

Major version number of NvMedia 2D NvSciSync header.

This defines the major version of the API defined in this header. This is intended to be used when validating the version number returned by the NvMedia2DNvSciSyncGetVersion() function.

See also
NvMedia2DNvSciSyncGetVersion()

Definition at line 42 of file nvmedia_2d_nvscisync.h.

◆ NVMEDIA_2D_NVSCISYNC_VERSION_MINOR

#define NVMEDIA_2D_NVSCISYNC_VERSION_MINOR   0

Minor version number of NvMedia 2D NvSciSync header.

This defines the minor version of the API defined in this header. This is intended to be used when validating the version number returned by the NvMedia2DNvSciSyncGetVersion() function.

See also
NvMedia2DNvSciSyncGetVersion()

Definition at line 52 of file nvmedia_2d_nvscisync.h.

Function Documentation

◆ NvMedia2DFillNvSciSyncAttrList()

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

Fills the NvMedia 2D specific NvSciSync attributes.

This function sets the public attributes:

The application must not set this attribute.

Parameters
[in]i2dPointer to the NvMedia2D 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 signaller. 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:
  • i2d is NULL
  • attrlist is NULL
  • clienttype is invalid.
NVMEDIA_STATUS_ERRORAn internal failure occured when trying to populate the attribute list.


Usage considerations

  • Allowed context for the API call
    • Thread-safe: No
  • API group
    • Init: Yes
    • Runtime: No
    • De-Init: No

◆ NvMedia2DGetEOFNvSciSyncFence()

NvMediaStatus NvMedia2DGetEOFNvSciSyncFence ( const 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]i2dPointer to the NvMedia2D context.
[in]eofvvscisyncobjThe NvSciSyncObj that was set for the EOF event.
[out]eofnvscisyncfencePointer to an NvSciSyncFence that will be populated with the version information.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKEOF fence returned successfully.
NVMEDIA_STATUS_BAD_PARAMETERThe sync object is not registered as an EOF type with NvMedia 2D, or one of the parameters has an invalid value. This could be:
  • i2d is NULL
  • eofnvscisyncobj is invalid.
  • eofnvscisyncfence is NULL.
NVMEDIA_STATUS_ERRORThe sync object has not yet been used by an NvMedia2DBlitEx() operation.


Usage considerations

  • Allowed context for the API call
    • Thread-safe: No
  • API group
    • Init: No
    • Runtime: Yes
    • De-Init: No
See also
NvMedia2DRegisterNvSciSyncObj()
NvMedia2DSetNvSciSyncObjforEOF()

◆ NvMedia2DInsertPreNvSciSyncFence()

NvMediaStatus NvMedia2DInsertPreNvSciSyncFence ( const NvMedia2D i2d,
const NvSciSyncFence prenvscisyncfence 
)

Insert an NvSciSyncFence as a pre-fence.

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]i2dPointer to the NvMedia2D context.
[in]prenvscisyncfencePointer to an NvSciSyncFence.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKPre-fence inserted successfully.
NVMEDIA_STATUS_BAD_PARAMETERThe sync object is not registered as an PRESYNC type with NvMedia 2D, or one of the parameters has an invalid value. This could be:
  • i2d is NULL
  • prenvscisyncfence is NULL.
NVMEDIA_STATUS_NOT_SUPPORTEDMaximum number of registered pre-fences has been reached.


Usage considerations

  • Allowed context for the API call
    • Thread-safe: No
  • API group
    • Init: No
    • Runtime: Yes
    • De-Init: No
See also
NvMedia2DRegisterNvSciSyncObj()

◆ NvMedia2DNvSciSyncGetVersion()

NvMediaStatus NvMedia2DNvSciSyncGetVersion ( NvMediaVersion version)

Returns the version number of the NvMedia 2D NvSciSync library.

This function returns the major and minor version number of the NvMedia 2D NvSciSync library. The client must pass an NvMediaVersion struct to this function, and the version information will be returned in this struct.

This allows the client to verify that the version of the library matches and is compatible with the the version number of the header file they are using.


Usage considerations

  • Allowed context for the API call
    • Thread-safe: Yes
  • API group
    • Init: Yes
    • Runtime: Yes
    • De-Init: Yes
Parameters
[out]versionPointer to an NvMediaVersion struct that will be populated with the version information.
Returns
An NvMediaStatus return code.
Return values
NVMEDIA_STATUS_OKVersion information returned successfully.
NVMEDIA_STATUS_BAD_PARAMETERversion parameter is NULL.
See also
NVMEDIA_2D_NVSCISYNC_VERSION_MAJOR
NVMEDIA_2D_NVSCISYNC_VERSION_MINOR
NvMediaVersion

◆ NvMedia2DRegisterNvSciSyncObj()

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

Register an NvSciSyncObj with NvMedia 2D.

Every NvSciSyncObj (even duplicate objects) used by NvMedia 2D 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]i2dPointer to the NvMedia2D context.
[in]syncobjtypeAn NvMediaNvSciSyncClientType, to indicate what event the sync object will represent.
[in]nvscisyncThe 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:
  • i2d is NULL
  • syncobjtype is invalid
  • nvscisync is invalid.
NVMEDIA_STATUS_NOT_SUPPORTEDThe primitive type of the sync object is not supported by NvMedia 2D.
NVMEDIA_STATUS_ERRORThe sync object cannot be registered due to:
  • maximum number of registered sync object has been reached
  • the sync object has already been registed.


Usage considerations

  • Allowed context for the API call
    • Thread-safe: No
  • API group
    • Init: Yes
    • Runtime: No
    • De-Init: No
See also
NvMedia2DUnregisterNvSciSyncObj()

◆ NvMedia2DSetNvSciSyncObjforEOF()

NvMediaStatus NvMedia2DSetNvSciSyncObjforEOF ( const NvMedia2D i2d,
NvSciSyncObj  nvscisyncEOF 
)

Specifies the NvSciSyncObj to be used for EOF event.

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]i2dPointer to the NvMedia2D context.
[in]nvscisyncEOFThe 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 is not registered as an EOF event type with NvMedia 2D, or one of the parameters has an invalid value. This could be:
  • i2d is NULL
  • nvscisyncEOF is invalid.


Usage considerations

  • Allowed context for the API call
    • Thread-safe: No
  • API group
    • Init: No
    • Runtime: Yes
    • De-Init: No
See also
NvMedia2DRegisterNvSciSyncObj()

◆ NvMedia2DUnregisterNvSciSyncObj()

NvMediaStatus NvMedia2DUnregisterNvSciSyncObj ( const 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]i2dPointer to the NvMedia2D context.
[in]nvscisyncThe 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:
  • i2d is NULL
  • nvscisync is invalid.
NVMEDIA_STATUS_ERRORAn internal failure occured when trying to unregister the sync object.


Usage considerations

  • Allowed context for the API call
    • Thread-safe: No
  • API group
    • Init: No
    • Runtime: No
    • De-Init: Yes
See also
NvMedia2DRegisterNvSciSyncObj()
NvMedia2DInsertPreNvSciSyncFence
NvMediaStatus NvMedia2DInsertPreNvSciSyncFence(const NvMedia2D *i2d, const NvSciSyncFence *prenvscisyncfence)
Insert an NvSciSyncFence as a pre-fence.
NvMedia2DBlitEx
NvMediaStatus NvMedia2DBlitEx(const NvMedia2D *i2d, const NvMediaImage *dstSurface, const NvMediaRect *dstRect, const NvMediaImage *srcSurface, const NvMediaRect *srcRect, const NvMedia2DBlitParameters *params, NvMedia2DBlitParametersOut *paramsOut)
Performs a 2D blit operation.
NvMedia2DGetEOFNvSciSyncFence
NvMediaStatus NvMedia2DGetEOFNvSciSyncFence(const NvMedia2D *i2d, NvSciSyncObj eofnvscisyncobj, NvSciSyncFence *eofnvscisyncfence)
Gets an EOF NvSciSyncFence for an NvMedia2DBlitEx() operation.