From 5e6a6abcfb0e843f2078f2f57be8de0df66c8fff Mon Sep 17 00:00:00 2001 From: Janne Grunau Date: Fri, 19 Aug 2022 08:51:05 +0200 Subject: [PATCH] experiments/dcp.py: replace image loading with rainbow A couple of p.memset32() are much faster than uploading an image over the virtualized uart. Avoids creating resolution dependent framebuffer data files. Signed-off-by: Janne Grunau --- proxyclient/experiments/dcp.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/proxyclient/experiments/dcp.py b/proxyclient/experiments/dcp.py index d7550aa5..8e4605e8 100755 --- a/proxyclient/experiments/dcp.py +++ b/proxyclient/experiments/dcp.py @@ -281,11 +281,13 @@ print(f"Dispaly {width}x{height}, fb size: {fb_size}") buf = u.memalign(0x4000, fb_size) -img = open("asahi.bin", "rb") +colors = [0xDD0000, 0xFE6230, 0xFEF600, 0x00BB00, 0x009BFE, 0x000083, 0x30009B] -block = 512 * 1024 -for off in range(0, fb_size, block): - iface.writemem(buf + off, img.read(min(block, fb_size - off))) + +for i, color in enumerate(colors): + lines = height // len(colors) + offset = i * lines * width * 4 + p.memset32(buf + offset, color, lines * width * 4) iova = disp_dart.iomap(0, buf, fb_size)