Date(DD/MM/YY) | Comment | Version |
---|---|---|
25/08/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 SettingsHAL
- Hardware Abstraction LayerEDID
- Extended Display Information DataCPU
- Central Processing UnitSoC
- System on chipAV
- Audio-VisualHDMI
- High-Definition Multimedia InterfaceSPD
- Source Product Description.HdmiIn
- HDMI InputALLM
- Auto Low Latency Mode
The diagram below describes a high-level software architecture of the HdmiIn stack.
%%{ init : { "theme" : "forest", "flowchart" : { "curve" : "linear" }}}%%
flowchart TD
y[Caller]<-->x[Device Settings HdmiIn HAL];
x[Device Settings HdmiIn 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 HdmiIn
HAL
provides a set of APIs
to initialize, query and set information about the HDMI input ports such as getting the number of input ports, getting the current status of a selected input port, setting the video scale, selecting which HDMI input to be selected as active and registering callbacks for asynchronous notifications.
The component 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 dsHdmiInInit()
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:
dsHdmiInRegisterConnectCB()
must facilitate asynchronous status notifications using the callback when the connection status of the callbackdsHdmiInConnectCB_t
. This callback must be used when the connection status when the HDMI input port changes.dsHdmiInRegisterSignalChangeCB()
must facilitate asynchronous status notifications using the callbackdsHdmiInSignalChangeCB_t
. This callback must be used when the signal status changes.dsHdmiInRegisterStatusChangeCB()
must facilitate asynchronous status notifications using the callbackdsHdmiInStatusChangeCB_t
. This callback must be used when the HDMI input status changes.dsHdmiInRegisterVideoModeUpdateCB()
must facilitate asynchronous status notifications using the callbackdsHdmiInVideoModeUpdateCB_t
. This callback must be used when the video mode changes. This callback must be used when the ALLM mode changes.dsHdmiInRegisterAllmChangeCB()
must facilitate asynchronous status notifications using the callbackdsHdmiInAllmChangeCB_t
.dsHdmiInRegisterAVLatencyChangeCB()
must facilitate asynchronous notifications using the callbackdsAVLatencyChangeCB_t
when the AV latency changes.dsHdmiInRegisterAviContentTypeChangeCB()
must facilitate asynchronous notifications using the call backdsHdmiInAviContentTypeChangeCB_t
when HDMI input content type 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 this interface.
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 HdmiIn
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.
This interface is not required to have any platform or product customizations.
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
dsHdmiInInit()
before making any otherAPIs
calls. IfdsHdmiInInit()
call fails, theHAL
must return the respective error code, so that thecaller
can retry the operation. -
The
caller
can calldsHdmiInSelectPort()
,dsHdmiInScaleVideo()
,dsSetEdidVersion()
anddsHdmiInSelectZoomMode()
to set the needed information. -
The
caller
can calldsHdmiInGetNumberOfInputs()
,dsHdmiInGetStatus()
,dsGetEDIDBytesInfo()
,dsIsHdmiARCPort()
,dsGetHDMISPDInfo()
,dsGetEdidVersion()
,dsGetAllmStatus()
,dsGetSupportedGameFeaturesList()
,dsGetAVLatency()
anddsHdmiInGetCurrentVideoMode()
to query the needed information. -
Callbacks can be set with:
dsHdmiInRegisterConnectCB()
- used when the HDMIin port connection status changesdsHdmiInRegisterSignalChangeCB()
- used when the HDMIin signal status changesdsHdmiInRegisterStatusChangeCB()
- used when the HDMI input status changesdsHdmiInRegisterVideoModeUpdateCB()
- used when the HDMIin video mode changesdsHdmiInRegisterAllmChangeCB()
- used when the HDMI input ALLM mode changesdsHdmiInRegisterAVLatencyChangeCB()
- used when the AV latency changesdsHdmiInRegisterAviContentTypeChangeCB()
- used when the Avi Content type changes
-
De-initialize the
HAL
usingdsHdmiInTerm()
%%{ init : { "theme" : "default", "flowchart" : { "curve" : "stepBefore" }}}%%
sequenceDiagram
participant Caller as Caller
participant HAL as DS HdmiIn HAL
participant Driver as SoC
Caller->>HAL:dsHdmiInInit()
Note over HAL: SOC initializes the underlying subsystems
HAL->>Driver:Initializes the underlying subsystems.
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsHdmiInSelectPort()
Note over HAL: Sets the passed port as active and available for presentation
HAL->>Driver:Setting the selected port as active
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsHdmiInGetStatus()
Note over HAL: Gets the status of the current port
HAL->>Driver:Getting the status of the current port
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsHdmiInScaleVideo()
Note over HAL: Sets the video scale
HAL->>Driver:Setting the video scale
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsGetEDIDBytesInfo()
Note over HAL: Gets the EDID Bytes info
HAL->>Driver:Getting the EDID Bytes info
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsHdmiInGetNumberOfInputs()
Note over HAL: Gets the number of HDMI inputs
HAL->>Driver:Getting the number of HDMI inputs
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsHdmiInGetCurrentVideoMode()
Note over HAL: Gets the current video mode
HAL->>Driver:Getting the current video mode
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsSetEdidVersion()
Note over HAL: Sets the EDID version
HAL->>Driver:Sets the EDID version
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsGetEdidVersion()
Note over HAL: Gets the current EDID Version
HAL->>Driver:Getting the current EDID Version
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsGetAllmStatus()
Note over HAL: Gets the ALLM status
HAL->>Driver:Getting the ALLM status
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsGetSupportedGameFeaturesList()
Note over HAL: Gets the supported game features
HAL-->>Caller:return
Caller->>HAL:dsIsHdmiARCPort()
Note over HAL: Gets whether the specified HDMI input port supports ARC
HAL->>Driver:Getting whether the specified HDMI input port supports ARC
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsGetHDMISPDInfo()
Note over HAL: Gets the HDMI SPD info
HAL->>Driver:Getting the HDMI SPD info
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsHdmiInSelectZoomMode()
Note over HAL: Sets the zoom mode
HAL->>Driver:Setting the zoom mode
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsGetAVLatency()
Note over HAL: Gets the AV latency
HAL->>Driver:Getting the AV latency
Driver-->>HAL:return
HAL-->>Caller:return
Caller->>HAL:dsHdmiInRegisterConnectCB()
Note over HAL: Creates the callback for when the HDMI connection status changes.
HAL-->>Caller:return
Caller->>HAL:dsHdmiInRegisterSignalChangeCB()
Note over HAL: Creates the callback for when the HDMI in signal status changes.
HAL-->>Caller:return
Caller->>HAL:dsHdmiInRegisterStatusChangeCB()
Note over HAL: Creates the callback for when the HDMI in status changes.
HAL-->>Caller:return
Caller->>HAL:dsHdmiInRegisterVideoModeUpdateCB()
Note over HAL: Creates the callback for when the video mode changes.
HAL-->>Caller:return
Caller->>HAL:dsHdmiInRegisterAllmChangeCB()
Note over HAL: Creates the callback for when the ALLM mode changes.
HAL-->>Caller:return
Caller->>HAL:dsHdmiInRegisterAVLatencyChangeCB()
Note over HAL: Creates the callback for when the AV latency changes.
HAL-->>Caller:return
Caller->>HAL:dsHdmiInRegisterAviContentTypeChangeCB()
Note over HAL: Creates the callback for when the Avi Content type changes.
HAL-->>Caller:return
Note over HAL: HDMI Input connection status changed
Driver-->>HAL:return
HAL-->>Caller:dsHdmiInConnectCB_t callback returned
Note over HAL: The HDMI Input signal status changed
Driver-->>HAL:return
HAL-->>Caller:dsHdmiInSignalChangeCB_t callback returned
Note over HAL: HDMI Input status changed
Driver-->>HAL:return
HAL-->>Caller:dsHdmiInStatusChangeCB_t callback returned
Note over HAL: Hdmi Input video mode changed
Driver-->>HAL:return
HAL-->>Caller:dsHdmiInVideoModeUpdateCB_t callback returned
Note over HAL: HDMI Input mode changed
Driver-->>HAL:return
HAL-->>Caller:dsHdmiInAllmChangeCB_t callback returned
Note over HAL: AV latency changed
Driver-->>HAL:return
HAL-->>Caller:dsAVLatencyChangeCB_t callback returned
Note over HAL: Avi content type changed
Driver-->>HAL:return
HAL-->>Caller:dsHdmiInAviContentTypeChangeCB_t callback returned
Caller ->>HAL:dsHdmiInTerm()
Note over HAL: Terminates the underlying sub-systems
HAL->>Driver:Terminates the underlying sub-systems
Driver-->>HAL:return
HAL-->>Caller:return