diff --git a/.lastlogin b/.lastlogin new file mode 100644 index 00000000..e69de29b diff --git a/docs/pages/dsVideoPort/ds-video-port_High-Level_TestSpec.md b/docs/pages/dsVideoPort/ds-video-port_High-Level_TestSpec.md index 92ee2952..be80eb50 100644 --- a/docs/pages/dsVideoPort/ds-video-port_High-Level_TestSpec.md +++ b/docs/pages/dsVideoPort/ds-video-port_High-Level_TestSpec.md @@ -12,6 +12,7 @@ - [Check HDR Capability](#check-hdr-capability) - [HDCP Management](#hdcp-management) - [Color Capabilities](#color-capabilities) + - [Check ALLM mode](#check-allm-mode) ## Acronyms, Terms and Abbreviations @@ -24,6 +25,7 @@ - `SDR` - Standard Dynamic Range - `EDID` - Extended Display Identification Data - `EOTF` - Electro-Optical Transfer Function +- `ALLM` - Auto Low Latency Mode - `NA` - Not Applicable - `Y` - Yes @@ -48,6 +50,7 @@ Interface specification is available here: [dsVideoPort HAL Spec](https://github |3|[Check HDR Capability](#check-hdr-capability)|Check `HDR` Capability| |4|[HDCP Management](#hdcp-management)|Check `HDCP` Status| |5|[Color Capabilities](#color-capabilities)|Check the color capabilities| +|6|[Check ALLM mode](#check-allm-mode)|Check the ALLM mode| ### Emulator Requirements @@ -195,3 +198,22 @@ Playback the pre-define streams #### Control Plane Requirements-Color Capabilities Verify the Color Space,Color Depth,QuantizationRange,MatrixCoefficients,Background Color with analyzer/external device + +### Check ALLM mode + +|Test Functionality|Description|HAL API's|L2|L3|Source|Sink|Control plane requirements| +|------------------|-----------|---------|--|--|------|----|--------------------------| +|Check ALLM mode|Enables/Disables ALLM mode for HDMI output video port. This method allows you to enables or disables the Auto Low Latency Mode (ALLM) for a HDMI output video port on source devices, as per the HDMI 2.1 specification.|dsSetAllmEnabled()|`Y`|`Y`|`Y`|`NA`|`Y`| +||Checks whether ALLM mode of HDMI output video port is enabled or not.|dsGetAllmEnabled()|`Y`|`Y`|`Y`|`NA`|`Y`| + +#### Test Startup Requirement-Check the ALLM mode + +`NA` + +#### Emulator Requirements-Check the ALLM mode + +[Emulator Requirements](#emulator-requirements) + +#### Control Plane Requirements-Check the ALLM mode + +Check ALLM mode is Enabled or Disabled and verify with analyzer diff --git a/docs/pages/dsVideoPort/ds-video-port_L3_Low-Level_TestSpecification.md b/docs/pages/dsVideoPort/ds-video-port_L3_Low-Level_TestSpecification.md index af1fe1cd..7e491995 100644 --- a/docs/pages/dsVideoPort/ds-video-port_L3_Low-Level_TestSpecification.md +++ b/docs/pages/dsVideoPort/ds-video-port_L3_Low-Level_TestSpecification.md @@ -56,6 +56,7 @@ Below are top test use-case for the video port. |7|Resets the video output to `SDR` for Source |Play the `HDR` stream and verify the video content formats|`dsResetOutputToSDR()`|`Y`|`NA`|1| |8|Select preferred color depth for Source|Select the Color depth from Supported list & verify|`dsSetPreferredColorDepth()`|`Y`|`NA`|`NA`| |9|sets the background color for Source |Select the background color form supported list & verify|`dsSetBackgroundColor()`|`Y`|`NA`|`NA`| +|10|Enables/Disables ALLM mode for HDMI output video port |Select the ALLM mode for HDMI output video port and verify|`dsSetAllmEnabled()`|`Y`|`NA`|`NA`| ## Level 3 Python Test Cases High Level Overview diff --git a/docs/pages/dsVideoPort/ds-video-port_L3_Test-Procedure.md b/docs/pages/dsVideoPort/ds-video-port_L3_Test-Procedure.md index f27e032c..6a90f645 100644 --- a/docs/pages/dsVideoPort/ds-video-port_L3_Test-Procedure.md +++ b/docs/pages/dsVideoPort/ds-video-port_L3_Test-Procedure.md @@ -16,6 +16,7 @@ - [dsVideoPort_test7_ResetToSDRMode.py](#dsvideoport_test7_resettosdrmodepy) - [dsVideoPort_test8_VerifyColorDepth.py](#dsvideoport_test8_verifycolordepthpy) - [dsVideoPort_test9_VerifyBackgroundColor.py](#dsvideoport_test9_verifybackgroundcolorpy) + - [dsVideoPort_test10_VerifyALLM_Mode.py](#dsvideoport_test10_verifyallm_modepy) ## Overview @@ -32,6 +33,7 @@ This document describes the L3 Test case Procedure Documentation for the Device - `HDR` \- High Dynamic Range - `HLG` \- Hybrid Log-Gamma - `SDR` \- Standard Dynamic Range +- `ALLM` \- Auto Low Latency Mode - `Y` \- yes supported - `NA` \- Not Supported @@ -496,3 +498,41 @@ dsVideoPort_test9_VerifyBackgroundColor.py --config /host/tests/configs/example_ - Is dsVIDEO_BGCOLOR_BLACK displayed on the Analyzer (Y/N)? - Is dsVIDEO_BGCOLOR_NONE displayed on the Analyzer (Y/N)? - If the answers to all three questions are "Yes," the test will pass. + +### dsVideoPort_test10_VerifyALLM_Mode.py + +**Overview:** + +This test is designed to verify the functionality of the dsSetAllmEnabled API in enabling or disabling Auto Low Latency Mode (`ALLM`) for an HDMI output port. The test will check the API's ability to correctly toggle ALLM based on the sink device's compatibility with HDMI 2.1 specifications. Users will validate the `ALLM` status using an AV analyzer. + +**Platform Supported:** + +Source + +**User Input Required:** + +Yes: The user is required to verify the `ALLM` mode on an external AV analyzer connected to the device. (This will be automated later). + +**Acceptance Criteria:** + +The test must successfully enable/disable ALLM mode, and the user must confirm that respective mode is displayed on the AV analyzer for the test to pass. + +**Expected Results:** + +The test will enable/disable ALLM mode on the HDMI output video port. The user will confirm the correct ALLM mode using a supported AV analyzer. + +**Test Steps:** + +- Run the Python file `dsVideoPort_test10_VerifyALLM_Mode.py` with the appropriate configuration: + +```bash +dsVideoPort_test10_VerifyALLM_Mode.py --config /host/tests/configs/example_rack_config.yml --deviceConfig /host/tests/configs/deviceConfig.yml +``` + +- Download and copy all required assets to the target directory. +- Enable ALLM mode. +- Prompt the user to verify that respective ALLM mode is displayed on the AV analyzer. +- The test will pass if the user confirms that the ALLM mode is enabled. +- Disable ALLM mode. +- Prompt the user to verify that respective ALLM mode is displayed on the AV analyzer. +- The test will pass if the user confirms that the ALLM mode is disabled. diff --git a/host/tests/L3_TestCases/dsVideoPort/dsVideoPort_L3_testSetup.yml b/host/tests/L3_TestCases/dsVideoPort/dsVideoPort_L3_testSetup.yml index 11b2cdd1..97030646 100644 --- a/host/tests/L3_TestCases/dsVideoPort/dsVideoPort_L3_testSetup.yml +++ b/host/tests/L3_TestCases/dsVideoPort/dsVideoPort_L3_testSetup.yml @@ -30,4 +30,6 @@ dsVideoPort: # Prefix must always exist test8_VerifyColorDepth: streams: #list of streams to be copied test9_VerifyBackgroundColor: + streams: #list of streams to be copied + test10_VerifyALLM_Mode: streams: #list of streams to be copied \ No newline at end of file diff --git a/host/tests/L3_TestCases/dsVideoPort/dsVideoPort_RunAll_L3_SinkTest.py b/host/tests/L3_TestCases/dsVideoPort/dsVideoPort_RunAll_L3_SinkTest.py index 9ecdfdd4..58d727b0 100644 --- a/host/tests/L3_TestCases/dsVideoPort/dsVideoPort_RunAll_L3_SinkTest.py +++ b/host/tests/L3_TestCases/dsVideoPort/dsVideoPort_RunAll_L3_SinkTest.py @@ -34,7 +34,7 @@ from raft.framework.core.logModule import logModule def RunAll_L3_Sink(): - skipTests = ["test4","test5","test6","test7","test8","test9"] + skipTests = ["test4","test5","test6","test7","test8","test9","test10"] # Summery log for all the tests dsVideoPortSummerLog = logModule("dsVideoPortSummerLog_Sink", level=logModule.INFO) diff --git a/host/tests/L3_TestCases/dsVideoPort/dsVideoPort_test10_VerifyALLM_Mode.py b/host/tests/L3_TestCases/dsVideoPort/dsVideoPort_test10_VerifyALLM_Mode.py new file mode 100644 index 00000000..c6d97f47 --- /dev/null +++ b/host/tests/L3_TestCases/dsVideoPort/dsVideoPort_test10_VerifyALLM_Mode.py @@ -0,0 +1,111 @@ +#!/usr/bin/env python3 +#** ***************************************************************************** +# * +# * If not stated otherwise in this file or this component's LICENSE file the +# * following copyright and licenses apply: +# * +# * Copyright 2024 RDK Management +# * +# * Licensed under the Apache License, Version 2.0 (the "License"); +# * you may not use this file except in compliance with the License. +# * You may obtain a copy of the License at +# * +# * +# http://www.apache.org/licenses/LICENSE-2.0 +# * +# * Unless required by applicable law or agreed to in writing, software +# * distributed under the License is distributed on an "AS IS" BASIS, +# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# * See the License for the specific language governing permissions and +# * limitations under the License. +# * +#* ****************************************************************************** + +import os +import sys + +# Get directory path and append to system path +dir_path = os.path.dirname(os.path.realpath(__file__)) +sys.path.append(os.path.join(dir_path, "../../")) + +# Import required classes from modules +from dsVideoPortHelperClass import dsVideoPortHelperClass +from raft.framework.core.logModule import logModule + +class dsVideoPort_test10_VerifyALLM_Mode(dsVideoPortHelperClass): + """ + A class to test and verify Enables/Disables ALLM mode for HDMI output video port. + + Attributes: + testName (str): Name of the test. + testSetupPath (str): Path to the test setup configuration file. + moduleName (str): Name of the module being tested. + rackDevice (str): Device under test (DUT). + """ + + def __init__(self, log:logModule=None): + """ + Initializes the test10_VerifyALLM_Mode test setup and configuration. + + Initializes sessions, reads the test setup, and prepares the user response. + """ + self.testName = "test10_VerifyALLM_Mode" + self.qcID = '10' + + super().__init__(self.testName, self.qcID, log) + + + #TODO: Current version supports only manual verification. + def testVerifyAllmMode(self, manual=False, mode:str=''): + """ + Verifies Enables/Disables ALLM mode for HDMI output video port.. + + Args: + manual (bool, optional): If True, manual verification is done using user response; otherwise, + automated verification is used (yet to be implemented). + + Returns: + bool: Result of the ALLM mode verification. + """ + if manual == True and mode == 'Enable': + return self.testUserResponse.getUserYN(f'Is ALLM Mode Enabled and it is displayed on Analyzer (Y/N): ') + elif manual == True and mode == 'Disable': + return self.testUserResponse.getUserYN(f'Is ALLM Mode Disabled and it is displayed on Analyzer (Y/N): ') + return False + + def testFunction(self): + """ + Main test function that enables video ports and verifies the ALLM Mode. + + Downloads assets, runs prerequisites, enables/disables ports, and verifies ALLM Mode. + + Returns: + bool: Final result of the ALLM Mode verification. + """ + + # Loop through supported video ports and verify ALLM Mode + for port, index in self.testdsVideoPort.getSupportedPorts(): + self.testEnablePort(port, index) + # Set the ALLM Mode as Enable + self.testdsVideoPort.setAllmMode(port, index, 'Enable') + + # Verify ALLM Mode when enabled + self.log.stepStart(f'Verify ALLM mode Enabled') + result = self.testVerifyAllmMode(True,'Enable') + self.log.stepResult(result, f'Verified ALLM mode Enabled') + + # Set the ALLM Mode as Disable + self.testdsVideoPort.setAllmMode(port, index, 'Disable') + + # Verify ALLM Mode when disabled + self.log.stepStart(f'Verify ALLM mode Disabled') + result = self.testVerifyAllmMode(True,'Disable') + self.log.stepResult(result, f'Verified ALLM mode Disabled') + + return result + +if __name__ == '__main__': + summerLogName = os.path.splitext(os.path.basename(__file__))[0] + "_summery" + summeryLog = logModule(summerLogName, level=logModule.INFO) + test = dsVideoPort_test10_VerifyALLM_Mode(summeryLog) + test.run(False) diff --git a/host/tests/dsClasses/dsVideoPort.py b/host/tests/dsClasses/dsVideoPort.py index 7199aa39..fd486ae0 100644 --- a/host/tests/dsClasses/dsVideoPort.py +++ b/host/tests/dsClasses/dsVideoPort.py @@ -585,6 +585,98 @@ def resetOutputToSDR(self,video_port:int, port_index:int=0): result = self.utMenu.select(self.testSuite, "ResetOutputToSDR", promptWithAnswers) + def setAllmMode(self, video_port:int, port_index:int=0, mode:str="Disable"): + """ + Enables/Disables ALLM mode for HDMI output video port. + + This method allows you to enables or disables the Auto Low Latency Mode (ALLM) + for a HDMI output video port on source devices, as per the HDMI 2.1 specification. + + + Args: + video_port (int): The enumeration value representing the video port. + Refer to the dsVideoPortType enum for valid options. + port_index (int, optional): The index of the specific port to reset. Defaults to 0. + mode (str, optional) : ALLM mode, defaults to "Disable" + + Returns: + None + + Example: + setAllmMode(video_port=dsVIDEOPORT_TYPE_HDMI, port_index=0, mode:str="Disable") + """ + promptWithAnswers = [ + { + "query_type": "list", + "query": "Select the Video Port", + "input": "dsVIDEOPORT_TYPE_HDMI" + }, + { + "query_type": "direct", + "query": "Select the Video Port Index[0-9]:", + "input": "0" + }, + { + "query_type": "list", + "query": "Choose ALLM mode to be Enable/Disable:", + "input": "Disable" + } + ] + + # Convert input arguments to strings and update the prompts + promptWithAnswers[0]["input"] = str(video_port) + promptWithAnswers[1]["input"] = str(port_index) + promptWithAnswers[2]["input"] = str(mode) + + + result = self.utMenu.select(self.testSuite, "Set AllmMode", promptWithAnswers) + + def getAllmMode(self,video_port:int, port_index:int=0): + """ + Checks whether ALLM mode of HDMI output video port is enabled or not. + + This method allows you to check whether the Auto Low Latency Mode (ALLM) + for a HDMI output video port on source devices is enabled or disabled, as + per the HDMI 2.1 specification. + + Args: + video_port (int): The enumeration value representing the video port. + Refer to the dsVideoPortType enum for valid options. + port_index (int, optional): The index of the specific port to query. + Defaults to 0. + + Returns: + list: A list containing the information on status of the ALLM mode. + + Example: + getAllmMode(self,video_port:int, port_index:int=0): + """ + + # Prepare prompts for user input to select the video port and index + promptWithAnswers = [ + { + "query_type": "list", + "query": "Select the Video Port", + "input": "dsVIDEOPORT_TYPE_HDMI" + }, + { + "query_type": "direct", + "query": "Select the Video Port Index[0-9]:", + "input": "0" + } + ] + + # Convert input arguments to strings and update the prompts + promptWithAnswers[0]["input"] = str(video_port) + promptWithAnswers[1]["input"] = str(port_index) + + result = self.utMenu.select(self.testSuite, "Get AllmMode", promptWithAnswers) + + # Extract and return the output values from the result + output_list = self.extract_output_values(result) + + return bool(output_list) + def select_PreferredColorDepth(self,video_port:int, port_index:int=0,color_depth:int=0): """ Sets the preferred color depth for the specified video port. diff --git a/host/tests/dsClasses/dsVideoPort_testConfig.yml b/host/tests/dsClasses/dsVideoPort_testConfig.yml index fea18ff9..b85cf3f7 100644 --- a/host/tests/dsClasses/dsVideoPort_testConfig.yml +++ b/host/tests/dsClasses/dsVideoPort_testConfig.yml @@ -157,4 +157,5 @@ dsVideoPort: # Prefix must always exist - "Get ColorDepth" - "Get HDCPReceiverProtocol" - "Get IgnoreEDIDStatus" - - "Get PreferredColorDepth" \ No newline at end of file + - "Get PreferredColorDepth" + - "Set AllmMode" \ No newline at end of file diff --git a/skeletons/src/dsVideoPort.c b/skeletons/src/dsVideoPort.c index 397496d2..cecc73db 100644 --- a/skeletons/src/dsVideoPort.c +++ b/skeletons/src/dsVideoPort.c @@ -91,6 +91,22 @@ dsError_t dsIsVideoPortActive(intptr_t handle, bool* active) return (dsError_t)0; } +dsError_t dsSetAllmEnabled (intptr_t handle, bool enabled) +{ + /*TODO: Implement Me!*/ + (void)handle; + (void)enabled; + return (dsError_t)0; +} + +dsError_t dsGetAllmEnabled (intptr_t handle, bool *enabled) +{ + /*TODO: Implement Me!*/ + (void)handle; + (void)enabled; + return (dsError_t)0; +} + dsError_t dsEnableHDCP(intptr_t handle, bool contentProtect, char* hdcpKey, size_t keySize) { /*TODO: Implement Me!*/ diff --git a/src/test_l3_dsVideoPort.c b/src/test_l3_dsVideoPort.c index b6a1428f..351592d9 100644 --- a/src/test_l3_dsVideoPort.c +++ b/src/test_l3_dsVideoPort.c @@ -674,6 +674,62 @@ void dsVideoPort_GetVideoEOTF() UT_LOG_INFO("OUT %s ",__FUNCTION__); } +void dsVideoPort_SetAllmEnabled() +{ + dsError_t status = dsERR_NONE; + int32_t choice = 0; + int32_t j = 0; + + UT_LOG_INFO("IN %s gTestGroup:%d ",__FUNCTION__,UT_TESTS_L3); + + dsVideoPort_getHandle(); + UT_LOG_INFO(" \t Supported ALLM Modes are:"); + for (j = 0; j < 2; j++) + { + UT_LOG_INFO("\t%d. %-20s", j,((j==0)?"Disable":"Enable")); + } + + UT_LOG_INFO("------------------------------------------"); + UT_LOG_INFO(" Choose ALLM mode to be Enable/Disable:"); + scanf("%d", &choice); + readAndDiscardRestOfLine(stdin); + + if(choice == 0 || choice == 1) + { + UT_LOG_INFO("Calling dsSetAllmEnabled(IN:Handle:[0x%0X],IN:ALLM_Status:[]) ", gHandle); + status = dsSetAllmEnabled(gHandle, choice); + UT_LOG_INFO("Result dsSetAllmEnabled(IN:Handle:[0x%0X],IN:ALLM_Status:[%s]) ,dsError_t=[%s]", + gHandle, UT_Control_GetMapString(boolMappingTable, choice), + UT_Control_GetMapString(dsErrorMappingTable, status)); + DS_ASSERT(status == dsERR_NONE); + } + else + { + UT_LOG_ERROR("\nInvalid ALLM mode selected\n"); + } + UT_LOG_INFO("OUT %s ",__FUNCTION__); +} + +void dsVideoPort_GetAllmEnabled() +{ + dsError_t status = dsERR_NONE; + bool AllmMode = false; + + UT_LOG_INFO("IN %s gTestGroup:%d ",__FUNCTION__,UT_TESTS_L3); + + dsVideoPort_getHandle(); + + UT_LOG_INFO("Calling dsGetAllmEnabled(IN:Handle:[0x%0X],OUT:ALLM_Status:[]) ", gHandle); + status = dsGetAllmEnabled(gHandle, &AllmMode); + UT_LOG_INFO("Result dsGetAllmEnabled(IN:Handle:[0x%0X],OUT:ALLM_Status:[%s]) ,dsError_t=[%s]", + gHandle, UT_Control_GetMapString(boolMappingTable, AllmMode), + UT_Control_GetMapString(dsErrorMappingTable, status)); + DS_ASSERT(status == dsERR_NONE); + UT_LOG_INFO("OUT %s ",__FUNCTION__); + +} + + void dsVideoPort_IsOutputHDR() { dsError_t status = dsERR_NONE; @@ -992,6 +1048,8 @@ int test_l3_dsVideoPort_register(void) UT_add_test( pSuite, "Get HDCPReceiverProtocol",dsVideoPort_GetHDCPReceiverProtocol); UT_add_test( pSuite, "Get IgnoreEDIDStatus",dsVideoPort_GetIgnoreEDIDStatus); UT_add_test( pSuite, "Get PreferredColorDepth",dsVideoPort_GetPreferredColorDepth); + UT_add_test( pSuite, "Set AllmMode",dsVideoPort_SetAllmEnabled); + UT_add_test( pSuite, "Get AllmMode",dsVideoPort_GetAllmEnabled); return 0; }