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 <j@jannau.net>
This commit is contained in:
Janne Grunau 2022-08-19 08:51:05 +02:00 committed by Hector Martin
parent 27439718e4
commit 5e6a6abcfb

View file

@ -281,11 +281,13 @@ print(f"Dispaly {width}x{height}, fb size: {fb_size}")
buf = u.memalign(0x4000, 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): for i, color in enumerate(colors):
iface.writemem(buf + off, img.read(min(block, fb_size - off))) 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) iova = disp_dart.iomap(0, buf, fb_size)