Skip to content

Commit

Permalink
utils: Fix uses of old PixelFormat fields
Browse files Browse the repository at this point in the history
  • Loading branch information
tomba committed Nov 2, 2024
1 parent 45ad879 commit a8ecf74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions utils/kmsprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ def print_plane(self, p: kms.Plane, indent: int):
self.print_props(p, indent + 4)

def print_fb(self, fb: kms.Framebuffer, indent: int):
printi(indent, f'FB ({fb.id}) {fb.width}x{fb.height} {fb.format.name} bitsperpixel={fb.format.bitsperpixel} ')
printi(indent, f'FB ({fb.id}) {fb.width}x{fb.height} {fb.format.name} pixelspergroup={fb.format.pixelspergroup} ')

for idx, p in enumerate(fb.planes):
pi = fb.format.planes[idx]
printi(indent + 2, f'Plane {idx}: offset={p.offset} pitch={p.pitch} bytespergroup={pi.bytespergroup} verticalsubsampling={pi.verticalsubsampling}')
printi(indent + 2, f'Plane {idx}: offset={p.offset} pitch={p.pitch} bytespergroup={pi.bytespergroup} linespergroup={pi.linespergroup}')

def print_card(self, card: kms.Card):
ver = card.get_version()
Expand Down
4 changes: 2 additions & 2 deletions utils/test-pixfmts.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ def draw_test_pattern(fb: kms.DumbFramebuffer):
for pindex,pi in enumerate(format.planes):
map = fb.map(pindex)

bpp = pi.bytespergroup // format.pixelspergroup
bpp = pi.bytespergroup // format.pixelspergroup[0]
w = fb.width
h = fb.height // pi.verticalsubsampling
h = fb.height // pi.linespergroup

b = np.frombuffer(map, dtype=np.uint8).reshape(h, w, bpp)
b[:, :, :] = 0xff
Expand Down

0 comments on commit a8ecf74

Please sign in to comment.