]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android/external-libkmsxx.git/blob - py/iact.py
py: use ResourceManager
[android/external-libkmsxx.git] / py / iact.py
1 #!/usr/bin/python3 -i
3 # This is a base script for interactive kms++ python environment
5 import pykms
6 from time import sleep
7 from math import sin
8 from math import cos
9 from helpers import *
11 card = pykms.Card()
12 res = pykms.ResourceManager(card)
13 conn = res.reserve_connector()
14 crtc = res.reserve_crtc(conn)
16 mode = conn.get_default_mode()
18 fb = pykms.DumbFramebuffer(card, 200, 200, "XR24");
19 pykms.draw_test_pattern(fb);
21 #crtc.set_mode(conn, fb, mode)
23 i = 0
24 for p in card.planes:
25     globals()["plane"+str(i)] = p
26     i=i+1
28 i = 0
29 for c in card.crtcs:
30     globals()["crtc"+str(i)] = c
31     i=i+1
33 for p in crtc.possible_planes:
34     if p.plane_type == pykms.PlaneType.Overlay:
35         plane = p
36         break
38 def set_plane(x, y):
39     crtc.set_plane(plane, fb, x, y, fb.width, fb.height, 0, 0, fb.width, fb.height)
41 set_plane(0, 0)
43 # for x in range(0, crtc.width() - fb.width()): set_plane(x, int((sin(x/50) + 1) * 100)); sleep(0.01)