OpenWFD Usage Guidelines
- The macro
WFD_WFDEXT_PROTOTYPESmust be defined before including thewfd.handwfdext.hheaders. - To clear the contents on a
WFDPipeline(performing a null flip),wfdBindSourceToPipelinemust be called with0as the argument forWFDSourcebefore callingwfdDeviceCommiton theWFDPipeline. This is demonstrated in theopenwfd_nvsci_sampleapplication present in the SDK. - During the deinitialization of OpenWFD applications, you must follow these steps:
- Perform a null flip on all
WFDPortsandWFDPipelinesthat were previously bound to aWFDSource.- If nonblocking commits are being used and
WFD_PIPELINE_POSTFENCE_SCANOUT_BEGIN_NVXis set toWFD_TRUE, the post-flip fence of the null flip commit should be waited on. - If nonblocking commits are being used and
WFD_PIPELINE_POSTFENCE_SCANOUT_BEGIN_NVXis set toWFD_FALSE, the post-flip fence of thewfdDeviceCommitcall before the null flip commit should be waited on.
- If nonblocking commits are being used and
- Destroy all
WFDSourceobjects by invokingwfdDestroySourceon them only after all null flip commits are complete. BlockingwfdDeviceCommitcalls ensures that the null flip is complete when thewfdDeviceCommitcall returns. For nonblockingwfdDeviceCommitcalls, synchronization must be handled by the OpenWFD client as described previously. - Destroy all
WFDPipelineandWFDPortobjects by usingwfdDestroyPipelineandwfdDestroyPort, respectively, before finally destroying theWFDDeviceobject usingwfdDestroyDevice.
- Perform a null flip on all
- For committing to multiple
WFDPipelinehandles bound to the sameWFDPort, it is recommended to callwfdDeviceCommit* withWFDCommitTypeset toWFD_COMMIT_ENTIRE_PORT. - When you use
WFD_COMMIT_ENTIRE_PORTin awfdDeviceCommitcall, all theWFDPipelineobjects part of the commit must either have a surface bound(normal flip) or have no surfaces bound (null flip). A mix of normal and a null flip in oneWFD_COMMIT_ENTIRE_PORTwfdDeviceCommitcall is not allowed due to a limitation on the NvDisplay resource manager. To ensure that any errors are caught, the OpenWFD APIwfdGetErrormust be invoked after calls to the following OpenWFD APIs that take in aWFDDevicehandle as one of the inputs and return void:- wfdDeviceCommit
- wfdDeviceCommitWithNvSciSyncFenceNVX
- wfdDestroyPort
- wfdSetPortMode
- wfdGetPortAttrib{iv/fv}
- wfdSetPortAttrib{i/v/iv/fv}
- wfdBindPipelineToPort
- wfdDestroyPipeline
- wfdDestroySource
- wfdBindSourceToPipeline
- wfdGetPipelineAttrib{iv/fv}
- wfdSetPipelineAttrib{i/v/iv/fv}
-
When flipping to display, you should use a minimum of two
WFDSourcehandles (double buffering) to prevent tearing or corruption.For more details, see section 8.1 in the OpenWF Display Specification.
-
The following prerequisites must be fulfilled for use cases to suspend to RAM (SC7 mode):
- Before entering suspend-to-RAM (SC7) mode, it is recommended to perform a null flip to display.
- To exit SC7 mode, a
modesetmust be performed before flipping to display.
- On Linux platforms, the following restriction applies when you invoke
wfdDeviceCommitorwfdDeviceCommitWithNvSciSyncFenceNVX:- A main
WFDPipelineof aWFDPortrefers to the WFD pipeline that is represented by the first WFD pipeline ID returned bywfdEnumeratePipelines. An overlayWFDPipelinerefers to the WFD pipelines represented by the remaining WFD pipeline IDs enumerated bywfdEnumeratePipelines. On Linux, calling thewfdDeviceCommitorwfdDeviceCommitWithNvSciSyncFenceNVXAPI involving the overlay WFD pipelines is supported only if the mainWFDPipelinealready has aWFDSourcebound. Similarly, null flip commit on main WFD pipelines is only supported when all overlay WFD pipelines are also bound to null surfaces.
- A main
- To minimize flip latency, you should set
WFD_PIPELINE_POSTFENCE_SCANOUT_BEGIN_NVXtoWFD_FALSE.