NVIDIA DriveOS Linux SDK API Reference

7.2.5.0 Early Access Release

Contains various extensions provided by NVIDIA OpenWFD driver.

Nvidia's OpenWFD driver libtegrawfd.so supports the following extensions:

WFD_NVX_create_source_from_nvscibuf

This extension allows users to create WFDSource objects out of NvSciBufObj buffer objects.

Two APIs are exposed to users as part of this extension. These are detailed below:

wfdNvSciBufSetDisplayAttributesNVX

API prototype:

WFDErrorCode wfdNvSciBufSetDisplayAttributesNVX(NvSciBufAttrList *const attrList)

Parameters:

Return values:

Description:

Before allocation of NvSciBufObj, the list of engines that require access to the NvSciBufObj needs to be specified by clients of NvSciBuf.

For NvSciBufObj that are to be accessed by the display hardware, relevant display engine flags need to be added in NvSciBufAttrList along with any other engine's flags before reconciliation of the attribute lists.

This interface updates the input NvSciBufAttrList with values equivalent to the following public attribute key-values: NvSciBufGeneralAttrKey_PeerHwEngineArray set to the following NvSciBufPeerHwEngine values.

wfdNvSciBufSetDisplayAttributesNVX fills attrList with the required display engine attributes and OpenWFD clients that require NvSciBufObj buffers to be consumed by the display should call wfdNvSciBufSetDisplayAttributesNVX before allocating the NvSciBufObj.

wfdCreateSourceFromNvSciBufNVX

API prototype:

WFDSource wfdCreateSourceFromNvSciBufNVX(const WFDDevice device, const WFDPipeline pipeline, NvSciBufObj *const bufObj)

Parameters :

Return values:

Error codes:

A limited set of values are supported by this extension for only the following NvSciBuf attribute keys:

Key Value
NvSciBufGeneralAttrKey_Types NvSciBufType_Image
NvSciBufImageAttrKey_PlaneCount 1, 2
NvSciBufImageAttrKey_PlaneColorFormat NvSciColor_A8R8G8B8, NvSciColor_A8B8G8R8, NvSciColor_Y8, NvSciColor_U8_V8, NvSciColor_U8Y8V8Y8, NvSciColor_Y8U8Y8V8, NvSciColor_V8U8
NvSciBufImageAttrKey_PlaneColorStd NvSciColorStd_SRGB, NvSciColorStd_REC709_SR, NvSciColorStd_REC709_ER

If the value of key NvSciBufImageAttrKey_PlaneColorStd is other than the supported values as listed in the preceding table, the following conditions apply:

In previous releases, the display driver did not apply any de-gamma regardless of what NvSciColorStd value was specified. Starting in 6.0.7.0, the display driver honors the NvSciColorStd values mentioned in the preceding table.

Description:

wfdCreateSourceFromNvSciBufNVX creates WFDSource handles out of NvSciBufObjs.

bufferObject should be allocated with reconciliation including a NvSciBufAttrList filled via wfdNvSciBufSetDisplayAttributesNVX.

WFD_NVX_commit_non_blocking

This extension allows users to schedule flips to the display that do not block until the display is done with its work.

The default behaviour of the core OpenWFD API wfdDeviceCommit is to block until the display is done with the flip.

This extensions adds a new WFDPipeline attribute WFD_PIPELINE_COMMIT_NON_BLOCKING_NVX which can be used to alter the default behaviour of wfdDeviceCommit.

By default, WFD_PIPELINE_COMMIT_NON_BLOCKING_NVX is set to WFD_FALSE making calls to wfdDeviceCommit on the WFDPipeline blocking.

wfdSetPipelineAttribi function can be used to set the value of a WFDPipeline object's WFD_PIPELINE_COMMIT_NON_BLOCKING_NVX attribute to WFD_TRUE, which makes calls to wfdDeviceCommit on the WFDPipeline non blocking.

When calling wfdDeviceCommit with WFDCommitType set to either WFD_COMMIT_ENTIRE_PORT or WFD_COMMIT_ENTIRE_DEVICE, all WFDPipeline objects attached to the WFDPort and WFDDevice handles need to have their WFD_PIPELINE_COMMIT_NON_BLOCKING_NVX attribute set to WFD_TRUE for non blocking commits to occur.

Synchronization of calls to wfdDeviceCommit in this scenario must be handled explicitly by the user with the help of WFD_NVX_nvscisync.

Additions to the list of WFDPipelineConfigAttrib enums:

WFD_NVX_nvscisync

This extension allows you to explicitly handle synchronization of work submission to the display by using NvSciSyncFence.

The post-flip fence returned by wfdDeviceCommitWithNvSciSyncFenceNVX will be signaled at the end of scanout of the buffer. This can happen only when a wfdDeviceCommit on a new WFDSource handle is scheduled so that the display hardware can stop scanning the WFDSource used for the previous wfdDeviceCommit.

Five APIs are exposed to users as part of this extension and are described below:

wfdNvSciSyncSetWaiterAttributesNVX

API prototype:

WFDErrorCode wfdNvSciSyncSetWaiterAttributesNVX(const NvSciSyncAttrList * const attrList)

Parameters:

Return values:

Description:

The OpenWFD driver only supports syncpoint synchronization primitives and any NvSciSyncFences passed to OpenWFD must be generated from NvSciSyncObjs that have been created with reconciliation of attribute lists that specify the syncpoint type support by the OpenWFD driver.

wfdNvSciSyncSetWaiterAttributesNVX allows OpenWFD clients intending to pass waiter NvSciSyncFences to fill NvSciSyncAttrLists with the supported syncpoint primitive type for reconciliation. This API updates the input NvSciSyncAttrList with values equivalent to the following public attributes of key-value pairs:

The application must not set this attribute in the NvSciSyncAttrList passed as an input to this function. Also, note that the user application is responsible for setting the NvSciSyncAttrKey_RequiredPerm attribute.

wfdNvSciSyncSetSignalerAttributesNVX

API prototype:

WFDErrorCode wfdNvSciSyncSetSignalerAttributesNVX(const NvSciSyncAttrList * const attrList)

Parameters

Return values:

Description:

Similar to wfdNvSciSyncSetWaiterAttributesNVX, wfdNvSciSyncSetSignalerAttributesNVX allows OpenWFD clients intending to pass NvSciSyncFences that are signaled by the display hardware to fill NvSciSyncAttrLists with the supported syncpoint primitive type for reconciliation. This API updates the input NvSciSyncAttrList with values equivalent to the following public attributes of key-value pairs:

The application must not set this attribute in the NvSciSyncAttrList passed as an input to this function. Also, note that the user application is responsible for setting the NvSciSyncAttrKey_RequiredPerm attribute.

wfdBindNvSciSyncFenceToSourceNVX

API prototype:

WFDErrorCode wfdBindNvSciSyncFenceToSourceNVX(const WFDDevice device, const WFDSource source, const NvSciSyncFence *const fence)

Parameters:

Return values:

Description:

wfdBindNvSciSyncFenceToSourceNVX allows users to associate a NvSciSyncFence object with a WFDSource handle.

Any work submissions done to the display with the WFDSource handle will block on the NvSciSyncFence bound to the WFDSource.

The user is responsible to signal the NvSciSyncFence and allow the display to consume the buffer.

wfdRegisterPostFlipNvSciSyncObjNVX

API prototype:

WFDErrorCode wfdRegisterPostFlipNvSciSyncObjNVX(const WFDDevice device, const NvSciSyncObj *const obj)

Parameters:

Return values:

Description:

wfdRegisterPostFlipNvSciSyncObjNVX allows WFD clients to register a NvSciSyncObj with the OpenWFD driver. The OpenWFD driver uses this NvSciSyncObj to generate NvSciSyncFence objects that are passed to the WFD client and are signaled when the display hardware is done consuming the buffer.

The OpenWFD driver allows only one NvSciSyncObj to be registered at any time. nullptr can be passed for obj to unregister any existing NvSciSyncObj objects. This allows the WFD client to register a different NvSciSyncObj handle with the OpenWFD driver.

The NvSciSyncFence generated with the use of the registered NvSciSyncObj handle is returned to the client via wfdDeviceCommitWithNvSciSyncFeenceNVX.

obj should be created with a NvSciSyncAttrList filled by wfdNvSciSyncSetSignalerAttributesNVX.

wfdDeviceCommitWithNvSciSyncFenceNVX

API prototype:

void wfdDeviceCommitWithNvSciSyncFenceNVX(const WFDDevice device, const WFDCommitType type, const WFDHandle handle, NvSciSyncFence *const fence)

Parameters:

Return values: None

Error codes:

Description:

The working of this API is similar to the OpenWFD Core API wfdDeviceCommit with the addition of a NvSciSyncFence parameter.

When a NvSciSyncObj is registered with the OpenWFD driver, wfdDeviceCommitWithNvSciSyncFenceNVX can be used by the client to acquire an NvSciSyncFence object passed via fence. This is the post-flip fence of display and the fence signals when display is done consuming the buffer. After the fence has been signaled, the fence must be cleared by the client with a call to NvSciSyncFenceClear().

When this API is called with no registered NvSciSyncObj, fence returns a nullptr.

WFD_NVX_port_mode_timings

This extension allows you to query the horizontal total and vertical total values of the display by using the following WFDPortMode attributes.

Additions to the list of WFDPortModeAttrib enums:

These attributes are read-only and can be queried via wfdGetPortModeAttribi only.