From patchwork Mon Aug 9 09:34:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 76232 Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1mD1gi-0081Y5-6l; Mon, 09 Aug 2021 09:35:16 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234662AbhHIJfd (ORCPT + 1 other); Mon, 9 Aug 2021 05:35:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234648AbhHIJfa (ORCPT ); Mon, 9 Aug 2021 05:35:30 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64494C061796 for ; Mon, 9 Aug 2021 02:35:10 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id h14so20484128wrx.10 for ; Mon, 09 Aug 2021 02:35:10 -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 :mime-version:content-transfer-encoding; bh=sT/HsaDNiCiIxiqs7Z2NjoK/a9GnaoU2NEbK+Rzv5dU=; b=FZv9dhjSptoGrE727m/SrWZ99qgN7E8LemgLyVNUZBCoKUntrkeFSORfBpj6YvyeXn fADim+A8zZG9uRaHofiYRfF1TZ+2XDQNITx91ONXJZJ13ThwYfYsgGDO64bj0Zha1QBq 30H8rNuCPohf6LKNRc0yuqELCJC3cGdZOEnja4lfYJMBT/acT3adu/X88O+fj1fyWP1c UwUhh9J+J9tQBzeXB9e0ibiPDsJEv1zlg3Zj8Gp8NivDKySATARMmeo3TZK6E/n5YZ/4 +pXe95yI9buo/bOh6tWA5BcKWG4PHNsWEXkFJrx1iCHBu1FAwoahqjgvDBGWqAgTkasS 32PQ== 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:mime-version:content-transfer-encoding; bh=sT/HsaDNiCiIxiqs7Z2NjoK/a9GnaoU2NEbK+Rzv5dU=; b=FwIoiQTR8hyoXd0Cphk/wrOcJft/SThlDyo72/+4Jzhq0p6aSAno4Pt640gFt0CX1T a5iF6JmhWJ15pQTr47IFWhTB2C6a1yLLfkfYJ8f0exY9/+RekLCLCxTMQzCXuI6an72I FQirK3YPcr2GveRBlyRvoo2hToZX9Xqs9HaA/55V7/x9KGus0sgYgMM+ROWPAQkxyZX7 9iHJnrVDjAMfzE9hlHBUqOugAfYE7XDoAJDcMFFw+CBaKgR/JZVSAg754PXGSl0i9rhr wvg+bFZ5bLGzzRoAUTug6iaOj7XqsRg1/p2ABKHCiWjFKQvFzmHO6YZ1bb+GKfIdwO2E vkEQ== X-Gm-Message-State: AOAM531VR85tdTdJfkFlM0G9aIdbUwhrFSxT5AwxoBaETKa/a7k1pbGw 8Gxxh9G8bpUp/6stUI9BDKoyKWnswuNvJQ== X-Google-Smtp-Source: ABdhPJwNcpHxhEuYFk4367gW8Vt6yl635AWfG6onsWy0akqs4to5viv681hF+xSfIdz5X6SKDcAAkA== X-Received: by 2002:a5d:658e:: with SMTP id q14mr5266315wru.142.1628501708815; Mon, 09 Aug 2021 02:35:08 -0700 (PDT) Received: from davidp-xps-13.pitowers.org ([2a00:1098:3142:14:b9d5:8bb6:b974:d6b6]) by smtp.gmail.com with ESMTPSA id j1sm19941720wmo.4.2021.08.09.02.35.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 02:35:08 -0700 (PDT) From: David Plowman To: linux-media@vger.kernel.org, sakari.ailus@iki.fi, Laurent Pinchart , Kieran Bingham , Hans Verkuil , Mauro Carvalho Chehab Cc: David Plowman Subject: [PATCH v4 1/2] media: v4l2-ctrls: Add V4L2_CID_NOTIFY_GAINS control Date: Mon, 9 Aug 2021 10:34:47 +0100 Message-Id: <20210809093448.4461-2-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210809093448.4461-1-david.plowman@raspberrypi.com> References: <20210809093448.4461-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 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 a new control V4L2_CID_NOTIFY_GAINS which allows the sensor to be notified what gains will be applied to the different colour channels by subsequent processing (such as by an ISP), even though the sensor will not apply any of these gains itself. For Bayer sensors this will be an array control taking 4 values which are the 4 gains arranged in the fixed order B, Gb, Gr and R, irrespective of the exact Bayer order of the sensor itself. The units are in all cases linear with the default value indicating a gain of exactly 1. Signed-off-by: David Plowman --- drivers/media/v4l2-core/v4l2-ctrls-defs.c | 1 + include/uapi/linux/v4l2-controls.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/media/v4l2-core/v4l2-ctrls-defs.c b/drivers/media/v4l2-core/v4l2-ctrls-defs.c index 421300e13a41..f87053c83249 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls-defs.c +++ b/drivers/media/v4l2-core/v4l2-ctrls-defs.c @@ -1107,6 +1107,7 @@ 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_GAINS: return "Notify Gains"; /* 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 5532b5f68493..133e20444939 100644 --- a/include/uapi/linux/v4l2-controls.h +++ b/include/uapi/linux/v4l2-controls.h @@ -1118,6 +1118,7 @@ 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_GAINS (V4L2_CID_IMAGE_SOURCE_CLASS_BASE + 9) /* Image processing controls */