From 6b817cbf8e235b6e58ee369f0e987c0d4070a333 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 7 Nov 2024 11:38:13 +0200 Subject: [PATCH] Rename pixelspergroup to group_size --- kms/framebuffer.py | 6 +++--- utils/kmsprint.py | 2 +- utils/test-pixfmts.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/kms/framebuffer.py b/kms/framebuffer.py index efd2ed0..1592fc0 100644 --- a/kms/framebuffer.py +++ b/kms/framebuffer.py @@ -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. @@ -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) diff --git a/utils/kmsprint.py b/utils/kmsprint.py index e9539aa..32c3e9c 100755 --- a/utils/kmsprint.py +++ b/utils/kmsprint.py @@ -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] diff --git a/utils/test-pixfmts.py b/utils/test-pixfmts.py index d12d14e..bab7d63 100755 --- a/utils/test-pixfmts.py +++ b/utils/test-pixfmts.py @@ -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