From patchwork Fri Nov 10 10:59:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 19193 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 8190ABDE6B for ; Fri, 10 Nov 2023 10:59:59 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C5324629AF; Fri, 10 Nov 2023 11:59:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1699613998; bh=hPooJCVb+jE04b3pNlZt12yekTpCtH8yoM6/YIqYbIw=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=vY/+SCJV6xefM6fdY4y6KIvyu0m6L481EFKo0PBrYaqj7CzpITsl0iQeDjHsCCtMv yHhtmCNkhVYOJ32ZF6cXAvKhPY++cRJ4k/WP15jbBlAU7c/hoaFrgEirUwIylaRswu Vn1W4JwrVnid0He7aXbLF0pcY8fOt2z7yL69WEZb3kwCzeJhvlJ4WCiP14iPpmpkuc rVFjyxrsfIZaREUvpQbyflVCZY/rsnB6LlKBCkc846jhxsQwOALuPM3hT3hoe+0yTS 29IKWx9881X6dUbHl391sR8kKXCOSZksHgPAfhCEtls/dguguGAo+VerMf+mY1837i vNXEderFgD/Mg== Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CF60A629AF for ; Fri, 10 Nov 2023 11:59:56 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="mhA5aKFn"; dkim-atps=neutral Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4079ed65471so13935115e9.1 for ; Fri, 10 Nov 2023 02:59:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1699613996; x=1700218796; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=dI4zITRkUQtlPXk9Cj6+cCwYfi73Tn/dIxpgCRSjycI=; b=mhA5aKFnxpCKl+KB8vLcWtdGl+q8GSMYIZypSEgX3DClvVW9MtRUJeFlWB5lAlNgoH J20aV37G+4SsHl/N3GZnc583BqCb6Phb7j0lThG8i+P3iqtuc7rVaD3/jIpAqCveKctl ysYsb6sR9FIyseKiVXARTPd9VZboVlHQNaPhBERLc2ZSmw7x7jDXt57Dl6b9E5hoICIZ mCT2Tnp1IhcjA3BXEcrM6fXR/p4AOnz8ZCExPjmsrAozxY5ZIARVrDbBp1Rb9gBTnzDc zCr3FRP08rBwD8wLDSz0PrkTsPqYhkEmMi4o3FYqnL93RYXKz4X9RB6K+xzc5GzZ++W0 eMTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699613996; x=1700218796; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dI4zITRkUQtlPXk9Cj6+cCwYfi73Tn/dIxpgCRSjycI=; b=E+2X7y8jNS4H4CYPzw1gNDF0wC3GiLs5Sp42QloAX5TD3LmT+BxzheMnY4WoJoyEaT Y1dz58woAO7tWG25/HLdDvoQ8SNFz/jZ3/F8tOYNd8QtJfyXPCBUSNMdihOdyF/35Zpx 2yrLHTwldRE/jKiNUbKpVvVOVcyZxFXNIq24oqRZYTxMTxjoxxBHK0P2XCxHnS5GxM9j bo3UlwlIJZ5IJV1wZv4AhgtdTNzyFUccOkfTfkWL5uunLUO/kG/yJCvLTfBiWImP3Rhw 4WVD03PDbvxkjiz0ZcM6tAnQS+BhTNEcvh77ihnbTuomEdpNfF+5xtrSztraK8zl1rK0 v6AQ== X-Gm-Message-State: AOJu0YxAS8GvZuTr3QOnKaF8CUurZtdPMSUVQZGB+zdKz3L4UqjgJjJh 7ojgVAHrbt3pkUvjysITmuDkEfRZNQiQOaCayggOUw== X-Google-Smtp-Source: AGHT+IGTr2n6kL9jub2tDxuHdO3iHD+jogwSQ/Dn584NcU5x4DyUNXrPEV0HQyhjqKPRDlxJw+1wYA== X-Received: by 2002:a05:600c:3b15:b0:405:95ae:4a94 with SMTP id m21-20020a05600c3b1500b0040595ae4a94mr6354358wms.5.1699613995998; Fri, 10 Nov 2023 02:59:55 -0800 (PST) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id r15-20020a05600c35cf00b0040531f5c51asm4883156wmq.5.2023.11.10.02.59.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Nov 2023 02:59:55 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Fri, 10 Nov 2023 10:59:57 +0000 Message-Id: <20231110110002.21381-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 0/5] Vendor controls and properties 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-Patchwork-Original-From: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hi, This change introduces a first attempt at implementing vendor specific controls and properties in libcamera. Vendor controls and properties live in their own namespace, and each vendor must now reserve a numeric control id range to avoid any id value clashes. Vendor controls may either live in the libcamera control_ids.yaml/property_ids.yaml files or preferably separate vendor specific files. To designate a vendor control, the YAML control description must contain a "vendor: " tag. For example, - RaspberryPiExampleControl: type: string vendor: rpi description: | Example vendor control with the "rpi" vendor tag. will create a control in the libcamera::controls::rpi namespace, with the numeric id value taken from the "rpi" reservation. Additionally, a #define LIBCAMERA_RPI_VENDOR_CONTROL will be available for applications to selectively compile in vendor control support. Similar applies to the property generation. The current mechanism for draft controls and propertiers have been deprecated, and now these are designated with the "draft" vendor tag. Note that this causes an API breaking change since the numeric control id values for draft control have their own designated range and namespace. So, for example, the use of controls::NOISE_REDUCTION_MODE will need to be replaced with controls::draft::NOISE_REDUCTION_MODE. Thanks, Naush Naushir Patuck (5): controls: Add vendor control/property support to generation scripts controls: build: Allow separate vendor control YAML files libcamera: control: Add vendor control id range reservation libcamera: controls: Use vendor tags for draft controls and properties documentation: Document vendor specific control and properties handling Documentation/guides/pipeline-handler.rst | 53 ++++++ include/libcamera/control_ids.h.in | 6 +- include/libcamera/meson.build | 58 +++++- include/libcamera/property_ids.h.in | 8 +- meson.build | 2 + src/ipa/rpi/common/ipa_base.cpp | 2 +- src/ipa/rpi/vc4/vc4.cpp | 2 +- src/libcamera/control_ids.cpp.in | 16 +- src/libcamera/control_ids.yaml | 20 +-- src/libcamera/control_ids_rpi.yaml | 17 ++ src/libcamera/control_ranges.yaml | 17 ++ src/libcamera/meson.build | 20 ++- src/libcamera/property_ids.cpp.in | 16 +- src/libcamera/property_ids.yaml | 2 +- src/py/libcamera/gen-py-controls.py | 31 +++- src/py/libcamera/meson.build | 26 +-- src/py/libcamera/py_controls_generated.cpp.in | 6 +- .../libcamera/py_properties_generated.cpp.in | 4 +- utils/gen-controls.py | 169 +++++++++++++----- 19 files changed, 348 insertions(+), 127 deletions(-) create mode 100644 src/libcamera/control_ids_rpi.yaml create mode 100644 src/libcamera/control_ranges.yaml