Skip to content

Commit

Permalink
gh #277 Addressed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
KarthikeyanR470 committed Dec 20, 2024
1 parent e494d62 commit d9a3cf6
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def __init__(self, log:logModule=None):


#TODO: Current version supports only manual verification.
def testVerifyAllmMode(self, manual=False):
def testVerifyAllmMode(self, manual=False, mode:str=''):
"""
Verifies Enables/Disables ALLM mode for HDMI output video port..
Expand All @@ -67,12 +67,12 @@ def testVerifyAllmMode(self, manual=False):
Returns:
bool: Result of the ALLM mode verification.
"""
if manual == True:
#hdcpVersion = self.testdsVideoPort.getHDCPVersion()
return self.testUserResponse.getUserYN(f'Is ALLM Mode (Enable/Disable) is displayed on Analyzer (Y/N): ')
else :
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':
#TODO: Add automation verification methods
return False
return self.testUserResponse.getUserYN(f'Is ALLM Mode Disabled and it is displayed on Analyzer (Y/N): ')
return False

def testFunction(self):
"""
Expand All @@ -92,15 +92,15 @@ def testFunction(self):

# Verify ALLM Mode when enabled
self.log.stepStart(f'Verify ALLM mode Enabled')
result = self.testVerifyAllmMode(True)
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)
result = self.testVerifyAllmMode(True,'Disable')
self.log.stepResult(result, f'Verified ALLM mode Disabled')

return result
Expand Down
53 changes: 50 additions & 3 deletions host/tests/dsClasses/dsVideoPort.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,10 +587,11 @@ def resetOutputToSDR(self,video_port:int, port_index:int=0):

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.
Enables/Disables ALLM mode for HDMI output 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.
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:
Expand Down Expand Up @@ -631,7 +632,53 @@ def setAllmMode(self, video_port:int, port_index:int=0, mode:str="Disable"):

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 the user to obtain the current resolution settings
of a particular video output, which is useful for ensuring compatibility
with display devices or for troubleshooting display issues.
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 current resolution settings, including
width, height, and possibly other related information.
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 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.
Expand Down
43 changes: 13 additions & 30 deletions src/test_l3_dsVideoPort.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ void dsVideoPort_GetVideoEOTF()

void dsVideoPort_SetAllmEnabled()
{
dsError_t status = dsERR_NONE;
dsError_t status = dsERR_NONE;
int32_t choice = 0;
int32_t j = 0;

Expand All @@ -694,37 +694,20 @@ void dsVideoPort_SetAllmEnabled()
scanf("%d", &choice);
readAndDiscardRestOfLine(stdin);

if(choice < 0 || choice > 1)
if(choice == 0 || choice == 1)
{
UT_LOG_ERROR("\nInvalid ALLM mode selected\n");
goto exit;
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);
}

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));
exit:
UT_LOG_INFO("OUT %s ",__FUNCTION__);

}

void dsVideoPort_GetAllmEnabled()
{
dsError_t status = dsERR_NONE;
bool AllmMode;

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, AllmMode,\
UT_Control_GetMapString(dsErrorMappingTable, status));
exit:
UT_LOG_INFO("OUT %s ",__FUNCTION__);

else
{
UT_LOG_ERROR("\nInvalid ALLM mode selected\n");
}
UT_LOG_INFO("OUT %s ",__FUNCTION__);
}


Expand Down

0 comments on commit d9a3cf6

Please sign in to comment.