"CRTC_H": crtc_h, "rotation": rot, "zpos": 2 }) req.commit_sync(allow_modeset=True) fb_w = 480 fb_h = 150 x_scale = 1 y_scale = 1 fb = pykms.OmapFramebuffer(card, fb_w, fb_h, "NV12", flags=pykms.OmapFramebuffer.Tiled) #fb = pykms.DumbFramebuffer(card, fb_w, fb_h, "NV12") pykms.draw_test_pattern(fb) def even(i): return i & ~1 pykms.draw_text(fb, even((fb_w // 2) - (8 * 3) // 2), 4, "TOP", pykms.white) pykms.draw_text(fb, even((fb_w // 2) - (8 * 6) // 2), fb_h - 8 - 4, "BOTTOM", pykms.white) pykms.draw_text(fb, 4, even(((fb_h // 2) - 4)), "L", pykms.white) pykms.draw_text(fb, fb_w - 8 - 4, even(((fb_h // 2) - 4)), "R", pykms.white)
card = pykms.Card() if len(sys.argv) > 1: conn_name = sys.argv[1] else: conn_name = "" res = pykms.ResourceManager(card) conn = res.reserve_connector(conn_name) crtc = res.reserve_crtc(conn) plane = res.reserve_generic_plane(crtc) mode = conn.get_default_mode() modeb = mode.to_blob(card) if omap: origfb = pykms.OmapFramebuffer(card, mode.hdisplay, mode.vdisplay, "XR24"); else: origfb = pykms.DumbFramebuffer(card, mode.hdisplay, mode.vdisplay, "XR24"); if dmabuf: fb = pykms.ExtFramebuffer(card, origfb.width, origfb.height, origfb.format, [origfb.fd(0)], [origfb.stride(0)], [origfb.offset(0)]) else: fb = origfb pykms.draw_test_pattern(fb); card.disable_planes() req = pykms.AtomicReq(card)