From patchwork Tue May 25 15:44:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 74567 X-Patchwork-Delegate: sakari.ailus@iki.fi Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1llZEJ-003f5J-UR; Tue, 25 May 2021 15:44:28 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232299AbhEYPpz (ORCPT + 1 other); Tue, 25 May 2021 11:45:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230013AbhEYPpz (ORCPT ); Tue, 25 May 2021 11:45:55 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CA20C061756 for ; Tue, 25 May 2021 08:44:25 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id x8so32742845wrq.9 for ; Tue, 25 May 2021 08:44:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QB5rbYaxeihEjSMoN5dAdVTi5PO0UCxWpYj6IuQlB8M=; b=KqNPu//9WI6I0t1cBsCA2uSyEd8hvS3P6h8nbZSFtu29yT1f/RCzd37GTLEvJWjg6T Ri6A+PIWic10+wdXK4WMPrzxTwKxDsucfsR4NKRXWOHvyUG0qBXQj3UxXXdSARAJ3iUY p7CCHtxn97JyqcCeG8ZJUcQS/WK4e0XmPrZov46E/a4Vu6UhMRF+wusBQPwkqd7sFlLC +kmIt+pywl/SpXi+w16o8BJhsPqDMQznEx3rSUmsX7x2B17d+I5XvQpl8LL/9ZDhdyXh W84nkpqFDfbyh7yLsaeYlyasCzIm17gK7+kPDF4IS+pR5QReTcVIXk0Y/4xzHWsFDnCe WZqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QB5rbYaxeihEjSMoN5dAdVTi5PO0UCxWpYj6IuQlB8M=; b=euY1HmS9k76+E2L48e+Sb7Tt9LdmXi+apiVjgZTAwRM1UPu7Sf1yDKFPgrV9RK0Ckc Zaljr65BcHB7cBjUS40snY5K7QoiVTGlFmtYLeLT2FDRcGGGS9NWqi8fYKY24B47G8CX HfDhQQWa3RiO1OxWypk+qZXEZOcKGvh+yZTJCbeN9nJIQ6Lc/XKpjh85PIEfiQizdvYS Xxq1WeU43HpY0PZGAb7hH1WQ/9yGxuFgSn21Tau6/y19oFgtGFeebwVlUpY2rscj7K4r nLJMo8q7tXx2Dh6wOUKHO07kz0daqGB1c0IxaTkcQys2aql2cU7mtorVmruuwiFH68QD 7Prg== X-Gm-Message-State: AOAM532sVTGvmfV6Xixah6sXpCRHVJmOgOjnefr4rdNypd3EtF3soHLO +cIXv9SzJmN/OhOVewQMyurdjN8bQYVhoA== X-Google-Smtp-Source: ABdhPJwjaqvqSHTSrhTpQLQGtOOhUhrVy5rUi6UwEDhgVUiw/sA098xWKZlJZZ4Ivg7XCFrmJi77sg== X-Received: by 2002:a5d:6d04:: with SMTP id e4mr27430410wrq.344.1621957463110; Tue, 25 May 2021 08:44:23 -0700 (PDT) Received: from localhost.localdomain (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id a11sm16753212wrr.48.2021.05.25.08.44.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 08:44:22 -0700 (PDT) From: David Plowman To: linux-media@vger.kernel.org Cc: David Plowman Subject: [PATCH v2 1/2] media: v4l2-ctrls: Add V4L2_CID_NOTIFY_GAIN_XXX controls Date: Tue, 25 May 2021 16:44:16 +0100 Message-Id: <20210525154417.7426-2-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210525154417.7426-1-david.plowman@raspberrypi.com> References: <20210525154417.7426-1-david.plowman@raspberrypi.com> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -3.2 (---) X-LSpam-Report: No, score=-3.2 required=5.0 tests=BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_LOW=-0.7 autolearn=ham autolearn_force=no We add new controls, one for each of the four usual Bayer channels: V4L2_CID_NOTIFY_GAIN_RED V4L2_CID_NOTIFY_GAIN_GREENR V4L2_CID_NOTIFY_GAIN_BLUE V4L2_CID_NOTIFY_GAIN_GREENB These are provided for sensors that need to know what colour gains will be applied to the Bayer channel by subsequent processing (such as by an ISP), even though the sensor will not apply this gain itself. The units, as with analogue gain, are determined by the driver. Signed-off-by: David Plowman --- drivers/media/v4l2-core/v4l2-ctrls.c | 4 ++++ include/uapi/linux/v4l2-controls.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index 0d7fe1bd975a..2f4436e04cf9 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c @@ -1150,6 +1150,10 @@ const char *v4l2_ctrl_get_name(u32 id) case V4L2_CID_TEST_PATTERN_GREENR: return "Green (Red) Pixel Value"; case V4L2_CID_TEST_PATTERN_BLUE: return "Blue Pixel Value"; case V4L2_CID_TEST_PATTERN_GREENB: return "Green (Blue) Pixel Value"; + case V4L2_CID_NOTIFY_GAIN_RED: return "Notify Red Gain"; + case V4L2_CID_NOTIFY_GAIN_GREENR: return "Notify Green (Red) Gain"; + case V4L2_CID_NOTIFY_GAIN_BLUE: return "Notify Blue Gain"; + case V4L2_CID_NOTIFY_GAIN_GREENB: return "Notify Green (Blue) Gain"; /* Image processing controls */ /* Keep the order of the 'case's the same as in v4l2-controls.h! */ diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h index d43bec5f1afd..dff5f0d26d4a 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -1116,6 +1116,10 @@ enum v4l2_jpeg_chroma_subsampling { #define V4L2_CID_TEST_PATTERN_BLUE (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 6) #define V4L2_CID_TEST_PATTERN_GREENB (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 7) #define V4L2_CID_UNIT_CELL_SIZE (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 8) +#define V4L2_CID_NOTIFY_GAIN_RED (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 9) +#define V4L2_CID_NOTIFY_GAIN_GREENR (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 10) +#define V4L2_CID_NOTIFY_GAIN_BLUE (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 11) +#define V4L2_CID_NOTIFY_GAIN_GREENB (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 12) /* Image processing controls */ From patchwork Tue May 25 15:44:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 74568 X-Patchwork-Delegate: sakari.ailus@iki.fi Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1llZEK-003f5J-U5; Tue, 25 May 2021 15:44:29 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232381AbhEYPp4 (ORCPT + 1 other); Tue, 25 May 2021 11:45:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230013AbhEYPp4 (ORCPT ); Tue, 25 May 2021 11:45:56 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B135C061574 for ; Tue, 25 May 2021 08:44:25 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id r12so32754230wrp.1 for ; Tue, 25 May 2021 08:44:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/TPhdbNwG56DgH/bkvG9Ab2XRQjfvqy0X0TnvaIzhV0=; b=hDZF3nDTIaL3tTijVRmk8XFQ4EwOKRhrmNTD8gLtvr25p3EQxAlY7YETs/ulm8ZSZU CF4M7VBDV8bAuYOaMtpuVhtnu+F6k4wV3skaOSMmXCyrNhxsxnETnHixdT3DIcILd0C5 xh1kA7xsImRe4Vs9fwnSZJgz4KByJrvaKqpb2oNSn0/CKgE8PMw+7+emb2kAwRsW5k/Q gcO5dmcMQlzOr1DnUvXy3m/sKrkZMb9NxPldH34b8EihVo8krkFLc1MKGiiQZT5QVz8w iXfJu2anNKOmDeXBnSsD7pQzHUhU+GAlttGxxikRWVi9YjVjo0COzRTWXDRSxfGakxj3 k7yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/TPhdbNwG56DgH/bkvG9Ab2XRQjfvqy0X0TnvaIzhV0=; b=Uiopa/V0ys2RDso7ki5I42uS3woLkTY74tI391X9FGAxCS5BP9HmjR7G2qs8CV25LZ MgyKROZljW8c/SGdk+/vuzRxK09o/1T5u1pdvOw/LVw46dDVisBvJPHDv4XhtQnO7l7p zscYuuxl2xvXqljtd/C5Bej6vjJkrzMG8++xA4dxJ7oT/iOEtydBJ8KjR5mPG4IDirT/ LDB4vx7p3u1lhFvWXGpi/DRhAOZYfgAGw/64yQUrViL7XO0hzSPfajWI5UrFNox926Cj /s/Ytn0m8J4ySvqOf5/fmWgjsNhd/+/9Ltf7MKCuaAGC5r7KkoCNfP8D9jtPTEKNjU1B 3Yrw== X-Gm-Message-State: AOAM530YMi1jRu978F2sGyon5H/ox8P6oAh0ROW/YVqBqmWORTtl0/u2 CYXy99ZA4WrHGOdvgb+WfAlIH8U/jdNe/g== X-Google-Smtp-Source: ABdhPJzrWRHN34EOxIx7WsXV+3mbDd6akgTvDc0b5JETAHrh2xJmi+yx/l15ZGRAJw7HAbV2Roypjw== X-Received: by 2002:adf:8b09:: with SMTP id n9mr28542513wra.148.1621957463762; Tue, 25 May 2021 08:44:23 -0700 (PDT) Received: from localhost.localdomain (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id a11sm16753212wrr.48.2021.05.25.08.44.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 08:44:23 -0700 (PDT) From: David Plowman To: linux-media@vger.kernel.org Cc: David Plowman Subject: [PATCH v2 2/2] media: v4l2-ctrls: Document V4L2_CID_NOTIFY_GAIN_XXX controls Date: Tue, 25 May 2021 16:44:17 +0100 Message-Id: <20210525154417.7426-3-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210525154417.7426-1-david.plowman@raspberrypi.com> References: <20210525154417.7426-1-david.plowman@raspberrypi.com> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -3.2 (---) X-LSpam-Report: No, score=-3.2 required=5.0 tests=BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1,RCVD_IN_DNSWL_LOW=-0.7 autolearn=ham autolearn_force=no Add documentation for each of the controls V4L2_CID_NOTIFY_GAIN_RED V4L2_CID_NOTIFY_GAIN_GREENR V4L2_CID_NOTIFY_GAIN_BLUE V4L2_CID_NOTIFY_GAIN_GREENB These controls are required by sensors that need to know what colour gains will be applied to pixels by downstream processing (such as by an ISP), though the sensor does not apply these gains itself. Signed-off-by: David Plowman --- .../media/v4l/ext-ctrls-image-source.rst | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-image-source.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-image-source.rst index de43f5c8486d..d50b56156a8e 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-image-source.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-image-source.rst @@ -72,3 +72,28 @@ Image Source Control IDs * - __u32 - ``height`` - Height of the area. + +``V4L2_CID_NOTIFY_GAIN_RED (integer)`` + Please refer to ``V4L2_CID_NOTIFY_GAIN_GREENB`` below. + +``V4L2_CID_NOTIFY_GAIN_GREENR (integer)`` + Please refer to ``V4L2_CID_NOTIFY_GAIN_GREENB`` below. + +``V4L2_CID_NOTIFY_GAIN_BLUE (integer)`` + Please refer to ``V4L2_CID_NOTIFY_GAIN_GREENB`` below. + +``V4L2_CID_NOTIFY_GAIN_GREENB (integer)`` + Note: this description covers all four ``V4L2_CID_NOTIFY_GAIN`` + controls, according to the Bayer channel indicated at the end of + the control name. + + The sensor is notified what gain will be applied to this Bayer + channel by subsequent processing (such as by an ISP). The sensor + is merely informed of this value in case it performs processing + that requires it, but it does not apply it to the output pixels + themselves. + + The units for the gain value are linear, with the default value + being shared between all four controls and representing a gain of + exactly 1. Other control properties, such as ranges, should also + be common.