The NvMedia LDC NvSci API encompasses all NvMedia LDC handling for NvSciBuf NvSciSync related functions.
6
NvMediaStatus NvMediaLdcFillNvSciBufAttrList | ( | NvMediaLdc *const | handle, |
NvSciBufAttrList const | attrList | ||
) |
Fills the NvMedia LDC specific NvSciBuf attributes.
This function updates the input NvSciBufAttrList with values equivalent to the following public attribute key-values:
NvSciBufGeneralAttrKey_PeerHwEngineArray set to
[in] | handle | Not used. Can be NULL. |
[out] | attrList | Pointer to an NvSciBufAttrList struct that will be populated with the NvSciBuf attributes. |
NVMEDIA_STATUS_OK | Attributes filled successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | The attributes have already been filled, or attrList is invalid. |
NVMEDIA_STATUS_INVALID_STATE | The function was called in incorrect system state. |
NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to populate the attribute list. |
Usage considerations
NvMediaStatus NvMediaLdcFillNvSciSyncAttrList | ( | NvMediaLdc *const | handle, |
NvSciSyncAttrList const | attrList, | ||
NvMediaNvSciSyncClientType const | clientType | ||
) |
Fills the NvMedia LDC specific NvSciSync attributes.
This function updates the input NvSciSyncAttrList with values equivalent to the following public attribute key-values:
NvSciSyncAttrKey_RequiredPerm set to
NvSciSyncAttrKey_PrimitiveInfo set to
The application must not set these attributes for the same NvSciSyncAttrList that is passed to this function.
[in] | handle | Pointer to the NvMediaLdc context. |
[out] | attrList | Pointer to an NvSciSyncAttrList struct that will be populated with the NvSciSync attributes. |
[in] | clientType | An NvMediaNvSciSyncClientType, to indicate whether the attributes filled should be for a waiter or a signaler. The value should be either:
|
NVMEDIA_STATUS_OK | Attributes filled successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | The attributes have already been filled, or one of the parameters has an invalid value. This could be:
|
NVMEDIA_STATUS_INVALID_STATE | The function was called in incorrect system state. |
NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to populate the attribute list. |
Usage considerations
NvMediaStatus NvMediaLdcGetEOFNvSciSyncFence | ( | NvMediaLdc *const | handle, |
NvMediaLdcResult const *const | result, | ||
NvSciSyncFence *const | syncFence | ||
) |
Gets an EOF NvSciSyncFence for an NvMediaLdcProcess() operation.
The expiry of an EOF NvSciSyncFence associated with an NvMediaLdcProcess() operation indicates that the corresponding NvMediaLdcProcess() 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 NvMediaLdcParameters handle used with the NvMediaLdcProcess() operation with NvMediaLdcSetNvSciSyncObjforEOF().
For example, in this sequence of code:
expiry of syncFence indicates that the preceding NvMediaLdcProcess() operation has finished.
For a given NvSciSyncObj used for the EOF event, the EOF fence for an NvMediaLdcProcess() 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 NvMediaLdcResult structs for the previous operations are no longer considered valid by this function.
[in] | handle | Pointer to the NvMediaLdc context. |
[in] | result | Pointer to the NvMediaLdcResult struct. |
[out] | syncFence | Pointer to an NvSciSyncFence that will be populated with the EOF fence. |
NVMEDIA_STATUS_OK | EOF fence returned successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | No NvSciSyncObj was set for the operation EOF event, or one of the parameters has an invalid value. This could be:
|
NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to get the fence object. |
Usage considerations
NvMediaStatus NvMediaLdcInsertPreNvSciSyncFence | ( | NvMediaLdc *const | handle, |
NvMediaLdcParameters 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 LDC operation. The NvMediaLdcProcess() operation is started only after the expiry of the syncFence. The pre-fences need to be set separately for each NvMediaLdcProcess() call, even if the same NvMediaLdcParameters handle is used.
For example, in this sequence of code:
the NvMediaLdcProcess() operation is assured to start only after the expiry of syncFence.
You can set a maximum of 16 prefences by calling NvMediaLdcInsertPreNvSciSyncFence().
[in] | handle | Pointer to the NvMediaLdc context. |
[in] | params | An NvMediaLdcParameters handle. |
[in] | syncFence | Pointer to an NvSciSyncFence. |
NVMEDIA_STATUS_OK | Pre-fence inserted successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | The sync object is not registered as an PRESYNC type with NvMedia LDC, or one of the parameters has an invalid value. This could be:
|
NVMEDIA_STATUS_INSUFFICIENT_BUFFERING | Maximum number of registered pre-fences has been reached. |
NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to insert the pre-fence. |
Usage considerations
NvMediaStatus NvMediaLdcRegisterNvSciBufObj | ( | NvMediaLdc *const | handle, |
NvSciBufObj const | bufObj | ||
) |
Register an NvSciBufObj with NvMedia LDC.
Every NvSciBufObj (even duplicate objects) used by NvMedia LDC must be registered by a call to this function before it is used. Only the exact same registered NvSciBufObj can be passed to NvMediaLdcSetSrcSurface(), NvMediaLdcSetDstSurface(), NvMediaLdcSetPreviousSurface(), NvMediaLdcSetXSobelDstSurface(), and NvMediaLdcSetDownsampledXSobelDstSurface() functions.
[in] | handle | Pointer to the NvMediaLdc context. |
[in] | bufObj | The NvSciBufObj to be registered. |
NVMEDIA_STATUS_OK | Buffer registered successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | Returned when:
|
NVMEDIA_STATUS_INSUFFICIENT_BUFFERING | Maximum number of registered buffers has been reached. |
NVMEDIA_STATUS_INVALID_STATE | The function was called in incorrect system state. |
NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to register the buffer. |
Usage considerations
NvMediaStatus NvMediaLdcRegisterNvSciSyncObj | ( | NvMediaLdc *const | handle, |
NvMediaNvSciSyncObjType const | syncObjType, | ||
NvSciSyncObj const | syncObj | ||
) |
Register an NvSciSyncObj with NvMedia LDC.
Every NvSciSyncObj (even duplicate objects) used by NvMedia LDC must be registered by a call to this function before it is used.
Only the exact same registered NvSciSyncObj can be passed to NvMediaLdcSetNvSciSyncObjforEOF() or NvMediaLdcUnregisterNvSciSyncObj(). Also the NvSciSyncObjs associated with any NvSciSyncFences passed to NvMediaLdcInsertPreNvSciSyncFence() must be registered.
For a given NvMediaLdc handle, one NvSciSyncObj can be registered as one NvMediaNvSciSyncObjType only.
[in] | handle | Pointer to the NvMediaLdc context. |
[in] | syncObjType | An NvMediaNvSciSyncClientType, to indicate what event the sync object will represent. |
[in] | syncObj | The NvSciSyncObj to be registered. |
NVMEDIA_STATUS_OK | Sync object registered successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
NVMEDIA_STATUS_INSUFFICIENT_BUFFERING | Maximum number of registered sync objects has been reached. |
NVMEDIA_STATUS_INVALID_STATE | The function was called in incorrect system state. |
NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to register the sync object. |
Usage considerations
NvMediaStatus NvMediaLdcSetDownsampledXSobelDstSurface | ( | NvMediaLdc *const | handle, |
NvMediaLdcParameters const | params, | ||
NvSciBufObj const | surface | ||
) |
Sets the surface for 4x4 downsampled xSobel output.
The surface must be a single-plane surface with format compatible with the first plane of the source surface. The surface dimensions must equal the destination rectangle dimensions rounded up to the nearest multiple of 4, and then divided by 4. For example, if the destination rectangle is 640x478 pixels, the 4x4 downsampled xSobel surface must be 160x120 pixels.
The 4x4 downsampled xSobel output can only be used if also full-size xSobel output has been enabled with NvMediaLdcSetXSobelDstSurface().
The xSobel output can only be used if warp map processing has been enabled with NvMediaLdcSetWarpMapParameters() or IPT processing has been enabled with NvMediaLdcSetIptParameters(), and TNR processing has NOT been enabled with NvMediaLdcSetTnrParameters().
The surface needs to be set separately for each NvMediaLdcProcess() call, even if the same NvMediaLdcParameters handle is used.
[in] | handle | Pointer to the NvMediaLdc context. |
[in] | params | An NvMediaLdcParameters handle. |
[in] | surface | The NvSciBufObj to be used for the destination downsampled xSobel surface. |
NVMEDIA_STATUS_OK | Parameters set successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
Usage considerations
NvMediaStatus NvMediaLdcSetDstSurface | ( | NvMediaLdc *const | handle, |
NvMediaLdcParameters const | params, | ||
NvSciBufObj const | surface | ||
) |
Sets the destination surface.
The surface needs to be set separately for each NvMediaLdcProcess() call, even if the same NvMediaLdcParameters handle is used.
[in] | handle | Pointer to the NvMediaLdc context. |
[in] | params | An NvMediaLdcParameters handle. |
[in] | surface | The NvSciBufObj to be used for the destination surface. |
NVMEDIA_STATUS_OK | Parameters set successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
Usage considerations
NvMediaStatus NvMediaLdcSetNvSciSyncObjforEOF | ( | NvMediaLdc *const | handle, |
NvMediaLdcParameters const | params, | ||
NvSciSyncObj const | syncObj | ||
) |
Specifies the NvSciSyncObj to be used for EOF event.
[in] | handle | Pointer to the NvMediaLdc context. |
[in] | params | An NvMediaLdcParameters handle. |
[in] | syncObj | The NvSciSyncObj to be used for the EOF fence. |
NVMEDIA_STATUS_OK | EOF fence set successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | The sync object is not registered as an EOF event type with NvMedia LDC, or one of the parameters has an invalid value. This could be:
|
Usage considerations
NvMediaStatus NvMediaLdcSetPreviousSurface | ( | NvMediaLdc *const | handle, |
NvMediaLdcParameters const | params, | ||
NvSciBufObj const | surface | ||
) |
Sets the previous surface for TNR operation.
The previous surface is the surface used as the destination surface with the previous NvMediaLdcProcess() call.
The surface needs to be set separately for each NvMediaLdcProcess() call, even if the same NvMediaLdcParameters handle is used.
[in] | handle | Pointer to the NvMediaLdc context. |
[in] | params | An NvMediaLdcParameters handle. |
[in] | surface | The NvSciBufObj to be used as a previous surface. |
NVMEDIA_STATUS_OK | Parameters set successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
Usage considerations
NvMediaStatus NvMediaLdcSetSrcSurface | ( | NvMediaLdc *const | handle, |
NvMediaLdcParameters const | params, | ||
NvSciBufObj const | surface | ||
) |
Sets the source surface.
The surface needs to be set separately for each NvMediaLdcProcess() call, even if the same NvMediaLdcParameters handle is used.
[in] | handle | Pointer to the NvMediaLdc context. |
[in] | params | An NvMediaLdcParameters handle. |
[in] | surface | The NvSciBufObj to be used for the source surface. |
NVMEDIA_STATUS_OK | Parameters set successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
Usage considerations
NvMediaStatus NvMediaLdcSetXSobelDstSurface | ( | NvMediaLdc *const | handle, |
NvMediaLdcParameters const | params, | ||
NvSciBufObj const | surface | ||
) |
Sets the surface for xSobel output.
The surface must be a single-plane surface with format compatible with the first plane of the source surface. The surface dimensions must equal the destination rectangle dimensions.
The xSobel output can only be used if warp map processing has been enabled with NvMediaLdcSetWarpMapParameters() or IPT processing has been enabled with NvMediaLdcSetIptParameters(), and TNR processing has NOT been enabled with NvMediaLdcSetTnrParameters().
The surface needs to be set separately for each NvMediaLdcProcess() call, even if the same NvMediaLdcParameters handle is used.
[in] | handle | Pointer to the NvMediaLdc context. |
[in] | params | An NvMediaLdcParameters handle. |
[in] | surface | The NvSciBufObj to be used for the destination xSobel surface. |
NVMEDIA_STATUS_OK | Parameters set successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
Usage considerations
NvMediaStatus NvMediaLdcUnregisterNvSciBufObj | ( | NvMediaLdc *const | handle, |
NvSciBufObj const | bufObj | ||
) |
Unregisters an NvSciBufObj with NvMediaLdc.
Every NvSciBufObj registered with NvMediaLdc by NvMediaLdcRegisterNvSciBufObj() must be unregistered before you call NvMediaLdcDestroy().
[in] | handle | Pointer to the NvMediaLdc context. |
[in] | bufObj | The NvSciBufObj to be unregistered. |
NVMEDIA_STATUS_OK | Buffer unregistered successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
NVMEDIA_STATUS_INVALID_STATE | The function was called in incorrect system state. |
NVMEDIA_STATUS_PENDING | The buffer is still being used by a pending operation. |
NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to unregister the buffer. |
Usage considerations
NvMediaStatus NvMediaLdcUnregisterNvSciSyncObj | ( | NvMediaLdc *const | handle, |
NvSciSyncObj const | syncObj | ||
) |
Unregisters an NvSciSyncObj with NvMediaLdc.
Every NvSciSyncObj registered with NvMediaLdc by NvMediaLdcRegisterNvSciSyncObj() must be unregistered before you call NvMediaLdcDestroy().
Before the application calls this function, it must ensure that any NvMediaLdcProcess() operation that uses the NvSciSyncObj has completed. If this function is called while NvSciSyncObj is still in use by any NvMediaLdcProcess() operation, behavior is undefined.
[in] | handle | Pointer to the NvMediaLdc context. |
[in] | syncObj | The NvSciSyncObj to be unregistered. |
NVMEDIA_STATUS_OK | Sync object unregistered successfully. |
NVMEDIA_STATUS_BAD_PARAMETER | One of the parameters has an invalid value. This could be:
|
NVMEDIA_STATUS_INVALID_STATE | The function was called in incorrect system state. |
NVMEDIA_STATUS_PENDING | The sync object is still being used by a pending operation. |
NVMEDIA_STATUS_ERROR | An internal failure occurred when trying to unregister the sync object. |
Usage considerations