{"id":8715,"url":"https://patchwork.libcamera.org/api/covers/8715/?format=json","web_url":"https://patchwork.libcamera.org/cover/8715/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20200709132835.112593-1-paul.elder@ideasonboard.com>","date":"2020-07-09T13:28:12","name":"[libcamera-devel,v5,00/23] Clean up formats in v4l2-compat and pipeline handlers","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/?format=json","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/cover/8715/mbox/","series":[{"id":1093,"url":"https://patchwork.libcamera.org/api/series/1093/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1093","date":"2020-07-09T13:28:12","name":"Clean up formats in v4l2-compat and pipeline handlers","version":5,"mbox":"https://patchwork.libcamera.org/series/1093/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/8715/comments/","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id A4ACFBD792\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  9 Jul 2020 13:28:49 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 33DE061214;\n\tThu,  9 Jul 2020 15:28:49 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4E76361184\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  9 Jul 2020 15:28:48 +0200 (CEST)","from pyrite.rasen.tech (unknown\n\t[IPv6:2400:4051:61:600:2c71:1b79:d06d:5032])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id DB77F525;\n\tThu,  9 Jul 2020 15:28:45 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"MiWRAYK1\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1594301327;\n\tbh=3/+LX0E2w1kmwqQcefdCXVLuUT9lO8x/pJEujtwcqQk=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=MiWRAYK1vAU5lOHRhhuXk1L+QU9U1pK/ha9tpK3CPEh0dlC4MF0uvFLOQ24qiFtqM\n\tSpui/PAIXeoRh434tVT00czhPN4Wn3bij96Pf4f6n/C8IfKyLH5x3X7m04YijluGQJ\n\tc4eLOYnIACgNLHUNlCMac2ooPyFhlB26TLFJHRsU=","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Thu,  9 Jul 2020 22:28:12 +0900","Message-Id":"<20200709132835.112593-1-paul.elder@ideasonboard.com>","X-Mailer":"git-send-email 2.27.0","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v5 00/23] Clean up formats in v4l2-compat\n\tand pipeline handlers","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Alright, I'm pretty sure this v5 is enough... just one final check\nbefore merging. I tacked on the v4l2-compat test at the end too, since\nit'll be merged at the same time (and I added one line to tell the\nv4l2-compat test to test raspi as well).\n\nThis patch series:\n- improves format-related calculations (stride, frameSize)\n- cleans up the v4l2 compatibility layer related to formats\n- fixes v4l2 compatibility interception for the raspberry pi pipeline\n  handler\n- fixes unsupported formats in uvcvideo and raspberrypi pipeline\n  handlers (the others were fine already)\n- moves filling in stride and frameSize from camera configuration time\n  to configuration validation time for all pipeline handlers\n\nPatches 1~6 add functions and fields that are necessary in the rest of\nthe patches. Patch 8 forces pipeline handlers to use acquireMediaDevice\nso that media devices can automatically be mapped to devnums for the\nv4l2 compatibility layer to intercept, and patch 9 makes the\nraspberrypi pipeline handler conform to this. Patches 10~11\nfilter out unsupported formats at configuration generation time, to\nprevent them from being selected, in the pipeline handlers that hadn't\nalready done so. Patches 12~13, 15~18 move filling in the stide and\nframeSize parameters from camera configuration time to configuration\nvalidation time. Patches 21~22 move formats out of V4L2CameraProxy,\nand clean up some of its code. Finally, patch 23 adds the test for the\nv4l2 compatibility layer.\n\nChanges in v5:\n- change default \"align\" parameter in PixelFormatInfo::stride() to 1\n- add optional \"align\" parameter to PixelFormatInfo::frameSize()\n- reorder patches to avoid bisection regression:\n  - extend PixelFormatInfo\n  - add stride and frameSize to StreamConfiguration\n  - update pipeline handlers\n  - use in V4L2 compat layer\n- return error from try_fmt and s_fmt if format negotiation on the\n  V4L2Camera/Camera side fail\n- add the v4l2-compat test to the end of this patch series, in a v5 that\n  adds raspi support\n\nChanges in v4:\n- upgraded documentation of format info definitions\n- added overloaded PixelFormatInfo::stride() that takes alignment\n- added optional parameter to PixelFormatInfo::frameSize that takes\n  array of strides\n- raspberrypi: fill in default format and frame size\n- simple: fix stride and frameSize for converter (compared to v3)\n- use tryFormat to get stride and frameSize for all pipelines except for\n  ipu3\n\nPaul Elder (23):\n  libcamera: formats: Add NV24 and NV42, and reorder NV formats\n  libcamera: formats: Add fields to info to ease calculating stride\n  libcamera: StreamConfiguration: Add frameSize field\n  libcamera: V4L2VideoDevice: Add tryFormat\n  libcamera: formats: PixelFormatInfo: Add v4l2 lookup function\n  libcamera: PixelFormatInfo: Add functions stride and frameSize\n  libcamera: pipeline: raspberrypi: Simplify format fetching\n  libcamera: pipeline: raspberrypi: Acquire media devices with\n    acquireMediaDevice\n  libcamera: pipeline_handler: Fatal if registering camera without media\n    devices\n  libcamera: pipeline: raspberrypi: Filter out unsupported formats\n  libcamera: pipeline: uvcvideo: Filter out unsupported formats\n  libcamera: ipu3: Fill stride and frameSize at config validation\n  libcamera: raspberrypi: Fill stride and frameSize at config validation\n  libcamera: raspberrypi: Set default configuration size at validation\n  libcamera: rkisp1: Fill stride and frameSize at config validation\n  libcamera: simple: Fill stride and frameSize at config validation\n  libcamera: uvcvideo: Fill stride and frameSize at config validation\n  libcamera: vimc: Fill stride and frameSize at config validation\n  libcamera: StreamConfiguration: Update stride documentation\n  v4l2: v4l2_camera: Fix stream selection for buffer operations\n  v4l2: v4l2_camera_proxy: Get stride and frameSize from stream config\n  v4l2: v4l2_camera_proxy: Use stream config in tryFormat\n  tests: v4l2_compat: Add test for v4l2_compat\n\n include/libcamera/internal/formats.h          |  18 ++\n include/libcamera/internal/v4l2_videodevice.h |   7 +-\n include/libcamera/stream.h                    |   1 +\n src/libcamera/formats.cpp                     | 289 +++++++++++++++++-\n src/libcamera/pipeline/ipu3/ipu3.cpp          |  14 +-\n .../pipeline/raspberrypi/raspberrypi.cpp      |  73 +++--\n src/libcamera/pipeline/rkisp1/rkisp1.cpp      |  20 +-\n src/libcamera/pipeline/simple/converter.cpp   |  19 ++\n src/libcamera/pipeline/simple/converter.h     |   4 +\n src/libcamera/pipeline/simple/simple.cpp      |  26 +-\n src/libcamera/pipeline/uvcvideo/uvcvideo.cpp  |  36 ++-\n src/libcamera/pipeline/vimc/vimc.cpp          |  23 +-\n src/libcamera/pipeline_handler.cpp            |   4 +\n src/libcamera/stream.cpp                      |  22 +-\n src/libcamera/v4l2_videodevice.cpp            |  50 ++-\n src/v4l2/v4l2_camera.cpp                      |  26 +-\n src/v4l2/v4l2_camera.h                        |   3 +\n src/v4l2/v4l2_camera_proxy.cpp                | 225 ++++----------\n src/v4l2/v4l2_camera_proxy.h                  |  10 +-\n test/meson.build                              |   1 +\n test/v4l2_compat/meson.build                  |  10 +\n test/v4l2_compat/v4l2_compat_test.py          | 152 +++++++++\n 22 files changed, 748 insertions(+), 285 deletions(-)\n create mode 100644 test/v4l2_compat/meson.build\n create mode 100755 test/v4l2_compat/v4l2_compat_test.py"}