[libcamera-devel,v2,09/13] py: cam_kms: fix multistream display
diff mbox series

Message ID 20220517143325.71784-10-tomi.valkeinen@ideasonboard.com
State Superseded
Headers show
Series
  • Misc Python bindings patches
Related show

Commit Message

Tomi Valkeinen May 17, 2022, 2:33 p.m. UTC
Instead of doing an atomic commit for each stream, do a single commit
for the two planes. This fixes the issue that only the first plane was
actually shown.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/py/cam/cam_kms.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Kieran Bingham May 17, 2022, 4:55 p.m. UTC | #1
Quoting Tomi Valkeinen (2022-05-17 15:33:21)
> Instead of doing an atomic commit for each stream, do a single commit
> for the two planes. This fixes the issue that only the first plane was
> actually shown.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> ---
>  src/py/cam/cam_kms.py | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/src/py/cam/cam_kms.py b/src/py/cam/cam_kms.py
> index f1844717..d8ff0284 100644
> --- a/src/py/cam/cam_kms.py
> +++ b/src/py/cam/cam_kms.py
> @@ -75,12 +75,13 @@ class KMSRenderer:
>  
>          buffers = drmreq['camreq'].buffers
>  
> +        req = pykms.AtomicReq(self.card)
> +
>          for stream, fb in buffers.items():
>              drmfb = self.cam_2_drm.get(fb, None)
> -
> -            req = pykms.AtomicReq(self.card)
>              self.add_plane(req, stream, drmfb)
> -            req.commit()
> +
> +        req.commit()
>  
>      def handle_page_flip(self, frame, time):
>          old = self.current
> -- 
> 2.34.1
>

Patch
diff mbox series

diff --git a/src/py/cam/cam_kms.py b/src/py/cam/cam_kms.py
index f1844717..d8ff0284 100644
--- a/src/py/cam/cam_kms.py
+++ b/src/py/cam/cam_kms.py
@@ -75,12 +75,13 @@  class KMSRenderer:
 
         buffers = drmreq['camreq'].buffers
 
+        req = pykms.AtomicReq(self.card)
+
         for stream, fb in buffers.items():
             drmfb = self.cam_2_drm.get(fb, None)
-
-            req = pykms.AtomicReq(self.card)
             self.add_plane(req, stream, drmfb)
-            req.commit()
+
+        req.commit()
 
     def handle_page_flip(self, frame, time):
         old = self.current