更新examples中的sdpg相关,可发送HDR信号

This commit is contained in:
xinzhu.yin
2026-07-08 10:51:07 +08:00
parent 32aaef1c0f
commit 4a2fa1daff
5 changed files with 58 additions and 2481 deletions

View File

@@ -18,10 +18,34 @@ dev = lUniTAP.open(0)
# After opening device as in UCD Console device role should be selected. # After opening device as in UCD Console device role should be selected.
# role = dev.select_role(UniTAP.dev.UCD422.HDMISourceHDMISink) # role = dev.select_role(UniTAP.dev.UCD422.HDMISourceHDMISink)
role = dev.select_role(UniTAP.dev.UCD323.HDMISource) role = dev.select_role(UniTAP.dev.UCD323.HDMISource)
hdr10_drm_if = bytearray([
0x87, 0x01, 0x1A, 0x91,
0x02, 0x00,
0x34, 0x21, 0xAA, 0x9B,
0x96, 0x19, 0xFC, 0x08,
0x48, 0x8A, 0x08, 0x39,
0x13, 0x3D, 0x42, 0x40,
0xE8, 0x03,
0x32, 0x00,
0xE8, 0x03,
0x90, 0x01,
0x00, 0x00, 0x00, 0x00
])
role.hdtx.sdpg.add_packet(hdr10_drm_if)
# role.hdtx.sdpg.add_packet(bytearray([0x81, 0x01, 0x1B, 0x16, 0x8B, 0x84, 0x90, 0x40, 0x00, 0x00, 0x06, 0x64, 0x00, 0x00, 0x00, 0x00, # role.hdtx.sdpg.add_packet(bytearray([0x81, 0x01, 0x1B, 0x16, 0x8B, 0x84, 0x90, 0x40, 0x00, 0x00, 0x06, 0x64, 0x00, 0x00, 0x00, 0x00,
# 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, # 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
# 0x00, 0x00, 0x00, 0x00])) # 0x00, 0x00, 0x00, 0x00]))
role.hdtx.sdpg.load_packet("UniTAP/dev/modules/dut_tests/cfg/hdr10/vsif1.bin") # role.hdtx.sdpg.load_packet("UniTAP/dev/modules/dut_tests/cfg/hdr10/hdr10_edid.bin")
role.hdtx.sdpg.stop() role.hdtx.sdpg.stop()
@@ -42,3 +66,29 @@ print(role.hdtx.sdpg.status())
lUniTAP.close(dev) lUniTAP.close(dev)
lUniTAP.cleanup() lUniTAP.cleanup()
def calc_infoframe_checksum(header, payload):
return (-sum(header) - sum(payload)) & 0xFF
# header = [0x87, 0x01, 0x1A]
# payload = [
# 0x02, 0x00,
# 0x34, 0x21, 0xAA, 0x9B,
# 0x96, 0x19, 0xFC, 0x08,
# 0x48, 0x8A, 0x08, 0x39,
# 0x13, 0x3D, 0x42, 0x40,
# 0xE8, 0x03,
# 0x32, 0x00,
# 0xE8, 0x03,
# 0x90, 0x01
# ]
# checksum = calc_infoframe_checksum(header, payload)
# print(hex(checksum)) # 0x91

View File

@@ -30,8 +30,8 @@ role.hdtx.pg.apply()
# print(f"Set color: {hex(i)} {hex(i)} {hex(i)}") # print(f"Set color: {hex(i)} {hex(i)} {hex(i)}")
# role.hdtx.pg.set_pattern_params(pattern_params=UniTAP.SolidColorParams(i, i, i)) # role.hdtx.pg.set_pattern_params(pattern_params=UniTAP.SolidColorParams(i, i, i))
# time.sleep(0.01) # time.sleep(0.01)
print(f"Set color: {hex(0)} {hex(65535)} {hex(65535)}") print(f"Set color: {hex(65535)} {hex(65535)} {hex(65535)}")
role.hdtx.pg.set_pattern_params(pattern_params=UniTAP.SolidColorParams(0, 65535, 65535)) role.hdtx.pg.set_pattern_params(pattern_params=UniTAP.SolidColorParams(65535, 65535, 65535))
# #
# Since the 3.5 version, TsiLib and TSIDevice objects have the option to be closed earlier. # Since the 3.5 version, TsiLib and TSIDevice objects have the option to be closed earlier.

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
{ {
"current_test_type": "screen_module", "current_test_type": "local_dimming",
"test_types": { "test_types": {
"screen_module": { "screen_module": {
"name": "屏模组性能测试", "name": "屏模组性能测试",
@@ -87,11 +87,11 @@
"local_dimming": { "local_dimming": {
"name": "Local Dimming", "name": "Local Dimming",
"test_items": [], "test_items": [],
"timing": "DMT 1920x 1080 @ 60Hz", "timing": "CVT 3840x 2160 @ 60Hz RB2",
"data_range": "Full", "data_range": "Full",
"color_format": "RGB", "color_format": "YCbCr 4:2:2",
"bpc": 8, "bpc": 12,
"colorimetry": "sRGB", "colorimetry": "BT.2020",
"patterns": {} "patterns": {}
} }
}, },

1009
test.py

File diff suppressed because it is too large Load Diff