Skip to content

Commit

Permalink
Rename pixelspergroup to group_size
Browse files Browse the repository at this point in the history
  • Loading branch information
tomba committed Nov 7, 2024
1 parent ed53b03 commit 6b817cb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions kms/framebuffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class DumbFramebuffer(Framebuffer):
def __init__(self, card: Card, width: int, height: int, format: kms.PixelFormat) -> None:
planes = []

assert width % format.pixelspergroup[0] == 0
assert width % format.group_size[0] == 0

# DRM_IOCTL_MODE_CREATE_DUMB takes a 'bpp' (bits-per-pixel) argument,
# which is then used with the width and height to allocate the buffer.
Expand All @@ -77,8 +77,8 @@ def __init__(self, card: Card, width: int, height: int, format: kms.PixelFormat)

for pi in format.planes:
creq = kms.uapi.drm_mode_create_dumb()
creq.width = int(ceil(width / format.pixelspergroup[0]))
creq.height = int(ceil(height / format.pixelspergroup[1])) * pi.linespergroup
creq.width = int(ceil(width / format.group_size[0]))
creq.height = int(ceil(height / format.group_size[1])) * pi.linespergroup
creq.bpp = pi.bytespergroup * 8

fcntl.ioctl(card.fd, kms.uapi.DRM_IOCTL_MODE_CREATE_DUMB, creq, True)
Expand Down
2 changes: 1 addition & 1 deletion utils/kmsprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ 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} pixelspergroup={fb.format.pixelspergroup} ')
printi(indent, f'FB ({fb.id}) {fb.width}x{fb.height} {fb.format.name} group_size={fb.format.group_size} ')

for idx, p in enumerate(fb.planes):
pi = fb.format.planes[idx]
Expand Down
2 changes: 1 addition & 1 deletion utils/test-pixfmts.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def draw_test_pattern(fb: kms.DumbFramebuffer):
for pindex,pi in enumerate(format.planes):
map = fb.map(pindex)

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

Expand Down

0 comments on commit 6b817cb

Please sign in to comment.