{"id":22107,"url":"https://patchwork.libcamera.org/api/1.1/patches/22107/?format=json","web_url":"https://patchwork.libcamera.org/patch/22107/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20241127085017.2192069-2-paul.elder@ideasonboard.com>","date":"2024-11-27T08:50:14","name":"[v2,1/4] libcamera: controls: Populate direction field in control definitions","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"a56938f276bc59bbc9cba83c7fe2ed9db3c8cbb7","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/1.1/people/17/?format=json","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/22107/mbox/","series":[{"id":4827,"url":"https://patchwork.libcamera.org/api/1.1/series/4827/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4827","date":"2024-11-27T08:50:13","name":"Add direction field to ControlId","version":2,"mbox":"https://patchwork.libcamera.org/series/4827/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/22107/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/22107/checks/","tags":{},"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 A047FC3213\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 Nov 2024 08:50:33 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3F5A6660AD;\n\tWed, 27 Nov 2024 09:50:33 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D86D8660A2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Nov 2024 09:50:28 +0100 (CET)","from neptunite.hamster-moth.ts.net (unknown\n\t[IPv6:2404:7a81:160:2100:7dcc:a4ea:e361:d355])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0BD7178C;\n\tWed, 27 Nov 2024 09:50:04 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"J/ibCZMx\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1732697406;\n\tbh=LN1yCsRXewlpscWsCJ9Oy9Kqq1ABOT/mlzTCbWb4ljo=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=J/ibCZMxXdVZz5+Y6gPMnAZB6IOdKvSr5WsbS1za0CoqF4HVDYY20IFGRRp1XopFA\n\t55yR9i7EBk5E8+iWKc5+lx4oW3V/+14Iwgm2t9oRpXLifPMCECyH9EN6iid6zLMo13\n\ttT9KwbcClggHVv724D6JS9TIxr9kS9h45SdgNS7U=","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Paul Elder <paul.elder@ideasonboard.com>","Subject":"[PATCH v2 1/4] libcamera: controls: Populate direction field in\n\tcontrol definitions","Date":"Wed, 27 Nov 2024 17:50:14 +0900","Message-Id":"<20241127085017.2192069-2-paul.elder@ideasonboard.com>","X-Mailer":"git-send-email 2.39.2","In-Reply-To":"<20241127085017.2192069-1-paul.elder@ideasonboard.com>","References":"<20241127085017.2192069-1-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"In preparation for adding support for querying direction information\nfrom controls, populate the corresponding field in the control ID\ndefintions.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n\n---\nChanges in v2:\n- add missing entries\n- add entries for all controls, since this field should be mandatory\n---\n src/libcamera/control_ids_core.yaml  | 44 ++++++++++++++++++++++++++++\n src/libcamera/control_ids_draft.yaml | 15 ++++++++++\n src/libcamera/control_ids_rpi.yaml   |  3 ++\n 3 files changed, 62 insertions(+)","diff":"diff --git a/src/libcamera/control_ids_core.yaml b/src/libcamera/control_ids_core.yaml\nindex d45cf8e56187..7335dd6ef4fa 100644\n--- a/src/libcamera/control_ids_core.yaml\n+++ b/src/libcamera/control_ids_core.yaml\n@@ -10,6 +10,7 @@ vendor: libcamera\n controls:\n   - AeEnable:\n       type: bool\n+      direction: inout\n       description: |\n         Enable or disable the AE.\n \n@@ -17,6 +18,7 @@ controls:\n \n   - AeLocked:\n       type: bool\n+      direction: out\n       description: |\n         Report the lock status of a running AE algorithm.\n \n@@ -31,6 +33,7 @@ controls:\n   # - Better handling of custom types.\n   - AeMeteringMode:\n       type: int32_t\n+      direction: inout\n       description: |\n         Specify a metering mode for the AE algorithm to use.\n \n@@ -56,6 +59,7 @@ controls:\n   # - Better handling of custom types.\n   - AeConstraintMode:\n       type: int32_t\n+      direction: inout\n       description: |\n         Specify a constraint mode for the AE algorithm to use.\n \n@@ -98,6 +102,7 @@ controls:\n   # - Better handling of custom types.\n   - AeExposureMode:\n       type: int32_t\n+      direction: inout\n       description: |\n         Specify an exposure mode for the AE algorithm to use.\n \n@@ -120,6 +125,7 @@ controls:\n \n   - ExposureValue:\n       type: float\n+      direction: inout\n       description: |\n         Specify an Exposure Value (EV) parameter.\n \n@@ -134,6 +140,7 @@ controls:\n \n   - ExposureTime:\n       type: int32_t\n+      direction: inout\n       description: |\n         Exposure time for the frame applied in the sensor device.\n \n@@ -153,6 +160,7 @@ controls:\n \n   - AnalogueGain:\n       type: float\n+      direction: inout\n       description: |\n         Analogue gain value applied in the sensor device.\n \n@@ -173,6 +181,7 @@ controls:\n \n   - AeFlickerMode:\n       type: int32_t\n+      direction: inout\n       description: |\n         Set the flicker avoidance mode for AGC/AEC.\n \n@@ -215,6 +224,7 @@ controls:\n \n   - AeFlickerPeriod:\n       type: int32_t\n+      direction: inout\n       description: |\n         Manual flicker period in microseconds.\n \n@@ -235,6 +245,7 @@ controls:\n \n   - AeFlickerDetected:\n       type: int32_t\n+      direction: out\n       description: |\n         Flicker period detected in microseconds.\n \n@@ -257,6 +268,7 @@ controls:\n \n   - Brightness:\n       type: float\n+      direction: inout\n       description: |\n         Specify a fixed brightness parameter.\n \n@@ -265,6 +277,7 @@ controls:\n \n   - Contrast:\n       type: float\n+      direction: inout\n       description:  |\n         Specify a fixed contrast parameter.\n \n@@ -273,6 +286,7 @@ controls:\n \n   - Lux:\n       type: float\n+      direction: out\n       description: |\n         Report an estimate of the current illuminance level in lux.\n \n@@ -280,6 +294,7 @@ controls:\n \n   - AwbEnable:\n       type: bool\n+      direction: inout\n       description: |\n         Enable or disable the AWB.\n \n@@ -290,6 +305,7 @@ controls:\n   # - Better handling of custom types.\n   - AwbMode:\n       type: int32_t\n+      direction: inout\n       description: |\n         Specify the range of illuminants to use for the AWB algorithm.\n \n@@ -323,6 +339,7 @@ controls:\n \n   - AwbLocked:\n       type: bool\n+      direction: out\n       description: |\n         Report the lock status of a running AWB algorithm.\n \n@@ -334,6 +351,7 @@ controls:\n \n   - ColourGains:\n       type: float\n+      direction: inout\n       description: |\n         Pair of gain values for the Red and Blue colour channels, in that\n         order.\n@@ -345,6 +363,7 @@ controls:\n \n   - ColourTemperature:\n       type: int32_t\n+      direction: out\n       description: |\n         Report the estimate of the colour temperature for the frame, in kelvin.\n \n@@ -352,6 +371,7 @@ controls:\n \n   - Saturation:\n       type: float\n+      direction: inout\n       description:  |\n         Specify a fixed saturation parameter.\n \n@@ -360,6 +380,7 @@ controls:\n \n   - SensorBlackLevels:\n       type: int32_t\n+      direction: out\n       description: |\n         Reports the sensor black levels used for processing a frame.\n \n@@ -370,6 +391,7 @@ controls:\n \n   - Sharpness:\n       type: float\n+      direction: inout\n       description:  |\n         Intensity of the sharpening applied to the image.\n \n@@ -384,6 +406,7 @@ controls:\n \n   - FocusFoM:\n       type: int32_t\n+      direction: out\n       description: |\n         Reports a Figure of Merit (FoM) to indicate how in-focus the frame is.\n \n@@ -396,6 +419,7 @@ controls:\n \n   - ColourCorrectionMatrix:\n       type: float\n+      direction: inout\n       description: |\n         The 3x3 matrix that converts camera RGB to sRGB within the imaging\n         pipeline.\n@@ -409,6 +433,7 @@ controls:\n \n   - ScalerCrop:\n       type: Rectangle\n+      direction: inout\n       description: |\n         Sets the image portion that will be scaled to form the whole of\n         the final output image.\n@@ -424,6 +449,7 @@ controls:\n \n   - DigitalGain:\n       type: float\n+      direction: inout\n       description: |\n         Digital gain value applied during the processing steps applied\n         to the image as captured from the sensor.\n@@ -441,6 +467,7 @@ controls:\n \n   - FrameDuration:\n       type: int64_t\n+      direction: out\n       description: |\n         The instantaneous frame duration from start of frame exposure to start\n         of next exposure, expressed in microseconds.\n@@ -449,6 +476,7 @@ controls:\n \n   - FrameDurationLimits:\n       type: int64_t\n+      direction: inout\n       description: |\n         The minimum and maximum (in that order) frame duration, expressed in\n         microseconds.\n@@ -485,6 +513,7 @@ controls:\n \n   - SensorTemperature:\n       type: float\n+      direction: out\n       description: |\n         Temperature measure from the camera sensor in Celsius.\n \n@@ -497,6 +526,7 @@ controls:\n \n   - SensorTimestamp:\n       type: int64_t\n+      direction: out\n       description: |\n         The time when the first row of the image sensor active array is exposed.\n \n@@ -511,6 +541,7 @@ controls:\n \n   - AfMode:\n       type: int32_t\n+      direction: inout\n       description: |\n         The mode of the AF (autofocus) algorithm.\n \n@@ -575,6 +606,7 @@ controls:\n \n   - AfRange:\n       type: int32_t\n+      direction: inout\n       description: |\n         The range of focus distances that is scanned.\n \n@@ -602,6 +634,7 @@ controls:\n \n   - AfSpeed:\n       type: int32_t\n+      direction: inout\n       description: |\n         Determine whether the AF is to move the lens as quickly as possible or\n         more steadily.\n@@ -620,6 +653,7 @@ controls:\n \n   - AfMetering:\n       type: int32_t\n+      direction: inout\n       description: |\n         The parts of the image used by the AF algorithm to measure focus.\n       enum:\n@@ -636,6 +670,7 @@ controls:\n \n   - AfWindows:\n       type: Rectangle\n+      direction: inout\n       description: |\n         The focus windows used by the AF algorithm when AfMetering is set to\n         AfMeteringWindows.\n@@ -665,6 +700,7 @@ controls:\n \n   - AfTrigger:\n       type: int32_t\n+      direction: in\n       description: |\n         Start an autofocus scan.\n \n@@ -690,6 +726,7 @@ controls:\n \n   - AfPause:\n       type: int32_t\n+      direction: in\n       description: |\n         Pause lens movements when in continuous autofocus mode.\n \n@@ -734,6 +771,7 @@ controls:\n \n   - LensPosition:\n       type: float\n+      direction: inout\n       description: |\n         Set and report the focus lens position.\n \n@@ -768,6 +806,7 @@ controls:\n \n   - AfState:\n       type: int32_t\n+      direction: out\n       description: |\n         The current state of the AF algorithm.\n \n@@ -825,6 +864,7 @@ controls:\n \n   - AfPauseState:\n       type: int32_t\n+      direction: inout\n       description: |\n         Report whether the autofocus is currently running, paused or pausing.\n \n@@ -860,6 +900,7 @@ controls:\n \n   - HdrMode:\n       type: int32_t\n+      direction: inout\n       description: |\n         Set the mode to be used for High Dynamic Range (HDR) imaging.\n \n@@ -926,6 +967,7 @@ controls:\n \n   - HdrChannel:\n       type: int32_t\n+      direction: out\n       description: |\n         The HDR channel used to capture the frame.\n \n@@ -960,6 +1002,7 @@ controls:\n \n   - Gamma:\n       type: float\n+      direction: inout\n       description:  |\n         Specify a fixed gamma value.\n \n@@ -968,6 +1011,7 @@ controls:\n \n   - DebugMetadataEnable:\n       type: bool\n+      direction: inout\n       description: |\n         Enable or disable the debug metadata.\n \ndiff --git a/src/libcamera/control_ids_draft.yaml b/src/libcamera/control_ids_draft.yaml\nindex 1b284257f601..894d4749fb03 100644\n--- a/src/libcamera/control_ids_draft.yaml\n+++ b/src/libcamera/control_ids_draft.yaml\n@@ -10,6 +10,7 @@ vendor: draft\n controls:\n   - AePrecaptureTrigger:\n       type: int32_t\n+      direction: inout\n       description: |\n         Control for AE metering trigger. Currently identical to\n         ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER.\n@@ -31,6 +32,7 @@ controls:\n \n   - NoiseReductionMode:\n       type: int32_t\n+      direction: inout\n       description: |\n        Control to select the noise reduction algorithm mode. Currently\n        identical to ANDROID_NOISE_REDUCTION_MODE.\n@@ -59,6 +61,7 @@ controls:\n \n   - ColorCorrectionAberrationMode:\n       type: int32_t\n+      direction: out\n       description: |\n        Control to select the color correction aberration mode. Currently\n        identical to ANDROID_COLOR_CORRECTION_ABERRATION_MODE.\n@@ -79,6 +82,7 @@ controls:\n \n   - AeState:\n       type: int32_t\n+      direction: out\n       description: |\n        Control to report the current AE algorithm state. Currently identical to\n        ANDROID_CONTROL_AE_STATE.\n@@ -108,6 +112,7 @@ controls:\n \n   - AwbState:\n       type: int32_t\n+      direction: out\n       description: |\n        Control to report the current AWB algorithm state. Currently identical\n        to ANDROID_CONTROL_AWB_STATE.\n@@ -129,6 +134,7 @@ controls:\n \n   - SensorRollingShutterSkew:\n       type: int64_t\n+      direction: out\n       description: |\n        Control to report the time between the start of exposure of the first\n        row and the start of exposure of the last row. Currently identical to\n@@ -136,6 +142,7 @@ controls:\n \n   - LensShadingMapMode:\n       type: int32_t\n+      direction: out\n       description: |\n        Control to report if the lens shading map is available. Currently\n        identical to ANDROID_STATISTICS_LENS_SHADING_MAP_MODE.\n@@ -149,6 +156,7 @@ controls:\n \n   - PipelineDepth:\n       type: int32_t\n+      direction: out\n       description: |\n         Specifies the number of pipeline stages the frame went through from when\n         it was exposed to when the final completed result was available to the\n@@ -163,6 +171,7 @@ controls:\n \n   - MaxLatency:\n       type: int32_t\n+      direction: out\n       description: |\n         The maximum number of frames that can occur after a request (different\n         than the previous) has been submitted, and before the result's state\n@@ -172,6 +181,7 @@ controls:\n \n   - TestPatternMode:\n       type: int32_t\n+      direction: out\n       description: |\n         Control to select the test pattern mode. Currently identical to\n         ANDROID_SENSOR_TEST_PATTERN_MODE.\n@@ -229,6 +239,7 @@ controls:\n \n   - FaceDetectMode:\n       type: int32_t\n+      direction: out\n       description: |\n         Control to select the face detection mode used by the pipeline.\n \n@@ -262,6 +273,7 @@ controls:\n \n   - FaceDetectFaceRectangles:\n       type: Rectangle\n+      direction: out\n       description: |\n         Boundary rectangles of the detected faces. The number of values is\n         the number of detected faces.\n@@ -273,6 +285,7 @@ controls:\n \n   - FaceDetectFaceScores:\n       type: uint8_t\n+      direction: out\n       description: |\n         Confidence score of each of the detected faces. The range of score is\n         [0, 100]. The number of values should be the number of faces reported\n@@ -285,6 +298,7 @@ controls:\n \n   - FaceDetectFaceLandmarks:\n       type: Point\n+      direction: out\n       description: |\n         Array of human face landmark coordinates in format [..., left_eye_i,\n         right_eye_i, mouth_i, left_eye_i+1, ...], with i = index of face. The\n@@ -298,6 +312,7 @@ controls:\n \n   - FaceDetectFaceIds:\n       type: int32_t\n+      direction: out\n       description: |\n         Each detected face is given a unique ID that is valid for as long as the\n         face is visible to the camera device. A face that leaves the field of\ndiff --git a/src/libcamera/control_ids_rpi.yaml b/src/libcamera/control_ids_rpi.yaml\nindex 34bbdfc863c5..7524c5d23258 100644\n--- a/src/libcamera/control_ids_rpi.yaml\n+++ b/src/libcamera/control_ids_rpi.yaml\n@@ -9,6 +9,7 @@ vendor: rpi\n controls:\n   - StatsOutputEnable:\n       type: bool\n+      direction: inout\n       description: |\n         Toggles the Raspberry Pi IPA to output the hardware generated statistics.\n \n@@ -21,6 +22,7 @@ controls:\n   - Bcm2835StatsOutput:\n       type: uint8_t\n       size: [n]\n+      direction: out\n       description: |\n         Span of the BCM2835 ISP generated statistics for the current frame.\n \n@@ -33,6 +35,7 @@ controls:\n   - ScalerCrops:\n       type: Rectangle\n       size: [n]\n+      direction: out\n       description: |\n         An array of rectangles, where each singular value has identical\n         functionality to the ScalerCrop control. This control allows the\n","prefixes":["v2","1/4"]}