From patchwork Mon Oct 7 22:46:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 2128 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CB31D60E1F for ; Tue, 8 Oct 2019 00:46:50 +0200 (CEST) Received: from pendragon.ideasonboard.com (modemcable118.64-20-96.mc.videotron.ca [96.20.64.118]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CC837B2D for ; Tue, 8 Oct 2019 00:46:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1570488410; bh=GloGytRqWNaDt344sVUfnu/GCdH8tfA84zAsKgdovmU=; h=From:To:Subject:Date:From; b=doX0wE7li8DqTcufwtrxwoR014EBJ8TeXcFbntcUfPpvJKlV5M/3vdAd9pNzmP2Ef RDCdWX5i2e83G4NTnxfnt5RoNkNVnSu0WKouE/wU9zouGDMba1a0jge/VY80Nkuvpr wkunH7doLeYGZhJg/zfAICCWrMePQJCXhFNlTcw8= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Tue, 8 Oct 2019 01:46:33 +0300 Message-Id: <20191007224642.6597-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/9] Use ControlList for both libcamera and V4L2 controls X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Oct 2019 22:46:51 -0000 Hello, This patch series generalises usage of ControlList for all controls, both libcamera and V4L2. The rationale is that using a single container to store controls allows better sharing of code, especially when we will implement serialisation and deserialisation. Additionally, a single container type will simplify the IPA API. Patch 1/9 restores the global list of libcamera controls that used to be auto-generated. It isn't strictly required by the rest of the series, but has been developed with it, so I've included it. Patches 2/9 to 4/9 then extend ControlList and ControlId with features required for V4L2 controls. Patch 5/9 is a drive-by optimisation, and is followed by patch 6/9 that adds a V4L2ControlId class specialising ControlId. Patch 7/9 is the bulk of the work, and patch 8/9 is a follow-up cleanup. Patch 9/9 adds a V4L2 controls validator that has been developed with the series but isn't strictly required either. We can thus leave it out for now if desired until we have a use case. Laurent Pinchart (9): libcamera: control_ids: Generate map of all supported controls libcamera: controls: Support getting and setting controls by ControlId libcamera: controls: Store control name in ControlId libcamera: controls: Make ControlList::find() protected libcamera: v4l2_device: Avoid copy of V4L2ControlInfo libcamera: v4l2_controls: Add V4L2ControlId libcamera: v4l2_device: Replace V4L2ControlList with ControlList libcamera: v4l2_controls: Remove V4L2ControlInfo type field libcamera: v4l2_controls: Add control validator include/libcamera/control_ids.h.in | 3 + include/libcamera/controls.h | 12 +- src/libcamera/camera_sensor.cpp | 4 +- src/libcamera/control_ids.cpp.in | 7 + src/libcamera/controls.cpp | 62 ++++- src/libcamera/gen-controls.py | 7 +- src/libcamera/include/camera_sensor.h | 5 +- src/libcamera/include/v4l2_controls.h | 55 ++--- src/libcamera/include/v4l2_device.h | 8 +- src/libcamera/pipeline/ipu3/ipu3.cpp | 9 +- src/libcamera/pipeline/uvcvideo.cpp | 24 +- src/libcamera/pipeline/vimc.cpp | 25 +- src/libcamera/v4l2_controls.cpp | 323 ++++++++++++-------------- src/libcamera/v4l2_device.cpp | 67 +++--- 14 files changed, 326 insertions(+), 285 deletions(-)