diff --git a/proxyclient/experiments/dcp.py b/proxyclient/experiments/dcp.py index 8e4605e8..ea939943 100755 --- a/proxyclient/experiments/dcp.py +++ b/proxyclient/experiments/dcp.py @@ -15,10 +15,14 @@ from m1n1.fw.dcp.manager import DCPManager from m1n1.fw.dcp.ipc import ByRef from m1n1.proxyutils import RegMonitor -is_t8103 = u.adt["arm-io"].compatible[0] == "arm-io,t8103" +disp_name = "/arm-io/disp0" + +external = hasattr(u.adt[disp_name], "external") and u.adt[disp_name].external != 0 +compat = u.adt[disp_name].compatible[0].split(",")[-1] + mon = RegMonitor(u) -if is_t8103: +if compat == 't8103': #mon.add(0x230000000, 0x18000) #mon.add(0x230018000, 0x4000) #mon.add(0x230068000, 0x8000) @@ -85,7 +89,7 @@ dcp.start() dcp.start_ep(0x37) dcp.dcpep.initialize() -mgr = DCPManager(dcp.dcpep) +mgr = DCPManager(dcp.dcpep, compat) mon.poll() @@ -104,14 +108,14 @@ assert mgr.setPowerState(1, False, ByRef(0)) == 0 mon.poll() -if is_t8103: +if external: assert mgr.set_display_device(2) == 0 else: assert mgr.set_display_device(0) == 2 assert mgr.set_parameter_dcp(14, [0], 1) == 0 #mgr.set_digital_out_mode(86, 38) -if is_t8103: +if external: assert mgr.set_display_device(2) == 0 else: assert mgr.set_display_device(0) == 2 @@ -123,7 +127,7 @@ assert mgr.get_gamma_table(t) == 2 assert mgr.set_contrast(0) == 0 assert mgr.setBrightnessCorrection(65536) == 0 -if is_t8103: +if external: assert mgr.set_display_device(2) == 0 else: assert mgr.set_display_device(0) == 2 @@ -277,7 +281,7 @@ swaps = mgr.swaps mon.poll() fb_size = align_up(width * height * 4, 8 * 0x4000) -print(f"Dispaly {width}x{height}, fb size: {fb_size}") +print(f"Display {width}x{height}, fb size: {fb_size}") buf = u.memalign(0x4000, fb_size)