Skip to content
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

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
Empty file added .lastlogin
Empty file.
22 changes: 22 additions & 0 deletions docs/pages/dsVideoPort/ds-video-port_High-Level_TestSpec.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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`|
hari22yuva marked this conversation as resolved.
Show resolved Hide resolved

## Level 3 Python Test Cases High Level Overview

Expand Down
40 changes: 40 additions & 0 deletions docs/pages/dsVideoPort/ds-video-port_L3_Test-Procedure.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
@@ -0,0 +1,111 @@
#!/usr/bin/env python3
#** *****************************************************************************
# *
# * If not stated otherwise in this file or this component's LICENSE file the
hari22yuva marked this conversation as resolved.
Show resolved Hide resolved
# * 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
ishthiyaqahmed marked this conversation as resolved.
Show resolved Hide resolved
self.testdsVideoPort.setAllmMode(port, index, 'Enable')
ishthiyaqahmed marked this conversation as resolved.
Show resolved Hide resolved

# 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)
92 changes: 92 additions & 0 deletions host/tests/dsClasses/dsVideoPort.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
ishthiyaqahmed marked this conversation as resolved.
Show resolved Hide resolved
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)

hari22yuva marked this conversation as resolved.
Show resolved Hide resolved
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.
Expand Down
3 changes: 2 additions & 1 deletion host/tests/dsClasses/dsVideoPort_testConfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,5 @@ dsVideoPort: # Prefix must always exist
- "Get ColorDepth"
- "Get HDCPReceiverProtocol"
- "Get IgnoreEDIDStatus"
- "Get PreferredColorDepth"
- "Get PreferredColorDepth"
- "Set AllmMode"
16 changes: 16 additions & 0 deletions skeletons/src/dsVideoPort.c
Original file line number Diff line number Diff line change
Expand Up @@ -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!*/
Expand Down
Loading