Date(DD/MM/YY) | Comment | Version |
---|---|---|
13/10/23 | First Release | 1.0.0 |
- Acronyms, Terms and Abbreviations
- Description
- Component Runtime Execution Requirements
- Non-functional requirements
- Interface API Documentation
HAL
- Hardware Abstraction LayerAPI
- Caller Programming InterfaceCaller
- Any user of the interface via theAPIs
CPU
- Central Processing UnitDS
- Device SettingsSoC
- System on ChipHDMI
- High-Definition Multimedia InterfaceDTCP
- Digital Transmission Content ProtectionHDCP
- High-bandwidth Digital Content ProtectionHDR
- High Dynamic RangeSDR
- Standard Dynamic RangeEDID
- Extended Display Identification Data
The diagram below describes a high-level software architecture of the DS
Video Port stack.
%%{ init : { "theme" : "forest", "flowchart" : { "curve" : "linear" }}}%%
flowchart TD
y[Caller]<-->x[Device Settings Video Port HAL];
x[Device Settings Video Port HAL]<-->z[SOC Drivers];
style y fill:#99CCFF,stroke:#333,stroke-width:0.3px,align:left
style z fill:#fcc,stroke:#333,stroke-width:0.3px,align:left
style x fill:#9f9,stroke:#333,stroke-width:0.3px,align:left
DS
Video Port HAL
provides a set of APIs
to initialize, query and set information about the Video ports like getting video port handle, fetching connected display information such as color depth, color space, matrix coefficients, quantization range, supported video resolutions using the video port handle. It also provides APIs
to enable or disable content protection like HDCP
and DTCP
, to set the background color and preferred color depth of the video port.
The interface must adeptly manage resources to prevent issues like memory leaks and excessive utilization. It must also meet performance goals for response time, throughput and resource use as per the platform's capabilities.
Failure to meet these requirements will likely result in undefined and unexpected behavior.
Caller
must initialize this interface by calling dsVideoPortInit()
before calling any other APIs
. The caller
is expected to have complete control over the life cycle of this module.
This interface is not required to be thread safe. Any caller
invoking the APIs
must ensure calls are made in a thread safe manner. This interface is allowed to create internal threads for its operations without excessively consuming system resources. Any threads created by this interface must be handled gracefully and respective error codes must be returned if any corresponding API
fails.
This interface is required to support a single instantiation with a single process.
This interface is not required to allocate any memory. Any pointers created by the interface must be cleaned up upon termination.
Although this interface is not required to be involved in any of the power management operations, the state transitions must not affect its operation. e.g. on resumption from a low power state, the interface must operate as if no transition has occurred.
This interface must support asynchronous notifications operations:
dsHDCPStatusCallback_t
is triggered when the connection status when the HDCP status of video port changes.dsVideoFormatUpdateCB
is triggered when the video format changes.
This interface is allowed to establish its own thread context for its operation, ensuring minimal impact on system resources. Additionally, this interface is responsible for releasing the resources it creates for its operation once the respective operation concludes.
This interface is not required to have any blocking calls. Synchronous calls must complete within a reasonable time period.
The API
must return error synchronously as a return argument. This interface is responsible for handling system errors (e.g. out of memory) internally.
There is no requirement for the interface to persist any setting information. Caller is responsible to persist any settings related to the HAL.
The following non-functional requirements will be supported by the module.
This interface is required to support DEBUG, INFO and ERROR messages. INFO and DEBUG must be disabled by default and enabled when required.
This interface will ensure optimal use of memory and CPU
according to the specific capabilities of the platform.
- This interface is required to perform static analysis, our preferred tool is Coverity.
- Have a zero-warning policy with regards to compiling. All warnings are required to be treated as errors.
- Copyright validation is required to be performed, e.g.: Black duck, and FossID.
- Use of memory analysis tools like Valgrind are encouraged to identify leaks/corruptions.
HAL
Tests will endeavour to create worst case scenarios to assist investigations.- Improvements by any party to the testing suite are required to be fed back.
The HAL
implementation is expected to released under the Apache License 2.0.
The source code must build into a shared library for DS
as Video Port module is a part of DS
and must be named as libdshal.so
. The build mechanism must be independent of Yocto.
- Any changes in the
APIs
must be reviewed and approved by the component architects. - Any modification must support backward compatibility for the generic operations like image upgrade and downgrade.
- This interface must return the dsERR_OPERATION_NOT_SUPPORTED error code, if any of the interface -
APIs
are not supported by the underlying hardware.
The configuration settings file for DS
Video Port can be used for adding platform specific configurations. The sample files are dsVideoPortSettings_template.h and dsVideoResolutionSettings_template.h
API
documentation will be provided by Doxygen which will be generated from the header file.
The caller
is expected to have complete control over the life cycle of the HAL
.
-
Initialize the
HAL
dsVideoPortInit()
before making any otherAPIs
calls. IfdsVideoPortInit()
call fails, theHAL
must return the respective error code, so that thecaller
can retry the operation. -
The
caller
can calldsEnableDTCP()
,dsEnableHDCP()
,dsEnableVideoPort()
,dsSetResolution()
,dsSetActiveSource()
,dsSetForceDisable4KSupport()
,dsSetHdmiPreference()
,dsSetBackgroundColor()
,dsSetForceHDRMode()
anddsSetPreferredColorDepth()
to set the needed information. -
The
caller
can calldsGetVideoPort()
,dsGetSurroundMode()
,dsGetResolution()
,dsIsVideoPortEnabled()
,dsIsDisplayConnected()
,dsIsDisplaySurround()
,dsGetSurroundMode()
,dsIsVideoPortActive()
,dsIsDTCPEnabled()
,dsIsHDCPEnabled()
,dsGetResolution()
,dsGetHDCPStatus()
,dsGetHDCPProtocol()
,dsGetHDCPReceiverProtocol()
,dsGetHDCPCurrentProtocol()
,dsGetTVHDRCapabilities()
,dsGetForceDisable4KSupport()
,dsGetVideoEOTF()
,dsGetMatrixCoefficients()
,dsGetColorDepth()
to query the needed information. -
Callbacks can be set with:
dsRegisterHdcpStatusCallback()
is triggered when there is a change in HDCP status of the video portdsVideoFormatUpdateCB()
is triggered when there is a change in video format of the content
-
De-initialize the
HAL
usingdsVideoPortTerm()
.
%%{ init : { "theme" : "default", "flowchart" : { "curve" : "stepBefore" }}}%%
sequenceDiagram
participant Caller as Caller
participant HAL as DS Video Port HAL
participant Driver as SoC
Caller->>HAL:dsVideoPortInit()
Note over HAL: SOC initializes the underlying Video Port sub-system
HAL->>Driver:Initializes the Video Port sub-system
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsGetVideoPort()
Note over HAL: Gets the handle for video port
HAL->>Driver:Getting the handle of video port
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsIsVideoPortEnabled()
Note over HAL: Indicates whether video port is enabled or not
HAL->>Driver:Getting the status of the video port
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsIsDisplayConnected()
Note over HAL: Indicates whether video port is connected to display or not
HAL->>Driver: Getting the connection status of display
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsIsDisplaySurround()
Note over HAL: Indicates whether connected display supports surround sound
HAL->>Driver: Getting the surround capability of display connected to video port
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsGetSurroundMode()
Note over HAL: Gets the surround mode of display
HAL->>Driver:Getting the surround mode of display connected to video port
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsEnableDTCP()
Note over HAL: Enables/Disables the DTCP for specified video port
HAL->>Driver: DTCP is enabled / disabled based on input parameter
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsEnableHDCP()
Note over HAL: Enables/Disables the HDCP for specified video port
HAL->>Driver: HDCP is enabled / disabled based on input parameter
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsSetResolution()
Note over HAL: Sets the resolution of video port
HAL->>Driver: Setting the resolution of display corresponding to specified video port
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsGetResolution()
Note over HAL: Gets the resolution of video port
HAL->>Driver:Getting the resolution of display corresponding to specified video port
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsGetHDCPReceiverProtocol()
Note over HAL: Gets the HDCP protocol version of Receiver/TV
HAL->>Driver:Getting the HDCP protocol version of display corresponding to specified video port
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsGetTVHDRCapabilities()
Note over HAL: Gets the HDR capabilities of TV
HAL->>Driver:Getting the HDR capabilities of TV/Display corresponding to specified video port
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsSupportedTvResolutions()
Note over HAL: Gets the supported resolutions of TV
HAL->>Driver:Getting the supported resolutions of TV corresponding to specified video port
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsGetVideoEOTF()
Note over HAL: Gets the current Electro-Optical Transfer Function (EOT) value
HAL->>Driver:Getting the EOT function value of display corresponding to specified video port
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsRegisterHdcpStatusCallback()
Note over HAL: Creates the callback for getting the HDCP status on HDMI Ports
HAL-->>Caller:return
Caller->>HAL:dsVideoFormatUpdateRegisterCB()
Note over HAL: Creates the callback for getting the video format updates
HAL-->>Caller:return
HAL-->>Caller:dsHDCPStatusCallback_t callback returned
Note over HAL: The HDCP status changed
Driver-->>HAL:return
HAL-->>Caller:dsVideoFormatUpdateCB callback returned
Note over HAL: Video Format changed
Driver-->>HAL:return
Caller ->>HAL:dsVideoPortTerm()
Note over HAL: Terminates the underlying Video Port sub-system
HAL->>Driver:Terminates the underlying Video Port sub-system
Driver-->>HAL:return
HAL-->>Caller:return