mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-22 14:43:08 +00:00
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:
parent
27439718e4
commit
5e6a6abcfb
1 changed files with 6 additions and 4 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue