-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh #277 dsVideoPort L3 for an API dsSetAllmEnabled #279
base: develop
Are you sure you want to change the base?
Changes from 2 commits
0c01264
e494d62
d9a3cf6
69917e2
0634e67
0dc3457
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
#!/usr/bin/env python3 | ||
#** ***************************************************************************** | ||
# * | ||
# * If not stated otherwise in this file or this component's LICENSE file the | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please update this test case to run all source python There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated the file dsVideoPort_RunAll_L3_SinkTest.py |
||
# * 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): | ||
""" | ||
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: | ||
#hdcpVersion = self.testdsVideoPort.getHDCPVersion() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you please remove the commented line if it is not required. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed the commented line. |
||
return self.testUserResponse.getUserYN(f'Is ALLM Mode (Enable/Disable) is displayed on Analyzer (Y/N): ') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to specify the is enabled or disabled not both There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated for respective modes seperately. |
||
else : | ||
#TODO: Add automation verification methods | ||
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could you please add stepstart form here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, all other methods test cases follow a similar approach of adding stepstart . Therefore, I maintained the same format in this test_case for consistency. |
||
self.testdsVideoPort.setAllmMode(port, index, 'Enable') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here we are setting the ALLM mode , why cant we verify through the getAllmMode. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, the verification is performed using an AV analyzer to directly observe the ALLM status and ensure compliance with HDMI specifications. Therefore, the getAllmMode method is not utilized in this context. |
||
|
||
# Verify ALLM Mode when enabled | ||
self.log.stepStart(f'Verify ALLM mode Enabled') | ||
result = self.testVerifyAllmMode(True) | ||
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) | ||
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) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -585,6 +585,53 @@ 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"): | ||
""" | ||
Resets the video output to Standard Dynamic Range (SDR) for the specified video port. | ||
|
||
This method allows you to 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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could you please directly assign strings to input like below. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, all other methods follow a similar approach of assigning strings to the input. Therefore, I maintained the same format in this API for consistency. |
||
promptWithAnswers[1]["input"] = str(port_index) | ||
promptWithAnswers[2]["input"] = str(mode) | ||
|
||
|
||
result = self.utMenu.select(self.testSuite, "Set AllmMode", promptWithAnswers) | ||
|
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add dsGetAllmEnabled() in the class ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added dsGetAllmEnabled() in the class |
||
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. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -674,6 +674,60 @@ 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_ERROR("\nInvalid ALLM mode selected\n"); | ||
goto exit; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't use goto There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removed the goto and updated the code. |
||
} | ||
|
||
UT_LOG_INFO("Calling dsSetAllmEnabled(IN:Handle:[0x%0X],IN:ALLM_Status:[]) ", gHandle); | ||
status = dsSetAllmEnabled(gHandle, choice); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added DS_ASSERT(status == dsERR_NONE); |
||
UT_LOG_INFO("Result dsSetAllmEnabled(IN:Handle:[0x%0X],IN:ALLM_Status:[%s]) ,dsError_t=[%s]",gHandle, UT_Control_GetMapString(boolMappingTable, choice),\ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please make the code aligned here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated |
||
UT_Control_GetMapString(dsErrorMappingTable, status)); | ||
exit: | ||
UT_LOG_INFO("OUT %s ",__FUNCTION__); | ||
|
||
} | ||
|
||
void dsVideoPort_GetAllmEnabled() | ||
{ | ||
dsError_t status = dsERR_NONE; | ||
bool AllmMode; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AllmMode ,assign with the default value. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated with default value. |
||
|
||
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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added DS_ASSERT(status == dsERR_NONE); |
||
UT_LOG_INFO("Result dsGetAllmEnabled(IN:Handle:[0x%0X],OUT:ALLM_Status:[%s]) ,dsError_t=[%s]",gHandle, AllmMode,\ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could you please make the code aligned here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. allmode is a bool so add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added UT_Control_GetMapString(boolMappingTable, AllmMode) |
||
UT_Control_GetMapString(dsErrorMappingTable, status)); | ||
exit: | ||
UT_LOG_INFO("OUT %s ",__FUNCTION__); | ||
|
||
} | ||
|
||
|
||
void dsVideoPort_IsOutputHDR() | ||
{ | ||
dsError_t status = dsERR_NONE; | ||
|
@@ -992,6 +1046,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; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if not add in
ds-video-port_High-Level_TestSpec.md
please add ALLM mode test caseThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated ALLm mode test case in ds-video-port_High-Level_TestSpec.md