From fbd6c4d1c8bfedf49ed86b32fb7b8c0d0aee67fb Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Mon, 30 May 2022 17:27:13 +0300 Subject: py: Implement FrameBufferPlane Implement FrameBufferPlane class and adjust the methods and uses accordingly. Note that we don't expose the fd as a SharedFD, but as an int. Signed-off-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- src/py/cam/cam_kms.py | 6 +++--- src/py/cam/cam_qtgl.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/py/cam') diff --git a/src/py/cam/cam_kms.py b/src/py/cam/cam_kms.py index 49b00211..38fc382d 100644 --- a/src/py/cam/cam_kms.py +++ b/src/py/cam/cam_kms.py @@ -131,10 +131,10 @@ class KMSRenderer: fds = [] strides = [] offsets = [] - for i in range(fb.num_planes): - fds.append(fb.fd(i)) + for plane in fb.planes: + fds.append(plane.fd) strides.append(cfg.stride) - offsets.append(fb.offset(i)) + offsets.append(plane.offset) drmfb = pykms.DmabufFramebuffer(self.card, w, h, fmt, fds, strides, offsets) diff --git a/src/py/cam/cam_qtgl.py b/src/py/cam/cam_qtgl.py index 4b43f51d..6cfbd347 100644 --- a/src/py/cam/cam_qtgl.py +++ b/src/py/cam/cam_qtgl.py @@ -269,7 +269,7 @@ class MainWindow(QtWidgets.QWidget): EGL_WIDTH, w, EGL_HEIGHT, h, EGL_LINUX_DRM_FOURCC_EXT, fmt, - EGL_DMA_BUF_PLANE0_FD_EXT, fb.fd(0), + EGL_DMA_BUF_PLANE0_FD_EXT, fb.planes[0].fd, EGL_DMA_BUF_PLANE0_OFFSET_EXT, 0, EGL_DMA_BUF_PLANE0_PITCH_EXT, cfg.stride, EGL_NONE, -- cgit v1.2.1