From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E25ACC25B0D for ; Thu, 11 Aug 2022 16:26:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237333AbiHKQ0f (ORCPT ); Thu, 11 Aug 2022 12:26:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237936AbiHKQZA (ORCPT ); Thu, 11 Aug 2022 12:25:00 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B745C275E4; Thu, 11 Aug 2022 09:06:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 1316ECE22B2; Thu, 11 Aug 2022 16:06:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A731C43140; Thu, 11 Aug 2022 16:06:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660233994; bh=4Pd9YhMtbhmuj5NoQ6MMg43/eFwj/qfS0d/cqdREFS8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tiwe1RASNYITWokLvoz5F2g8tGVO5xo+gZNZ4Czo8r0cT0IWHV0gAb3NLTLa/KJOr B1m0WBoyzcpt8nNxGmnRxjSt5XCpHrvoKNvGPReHorzFRPJbkRybCe1wRE+HVb+HgG 0vbqL5xvhSXpkbiHCNvfx/Er95IQ75Ch8Ms/RWNOU/+yvRlV8boahNIGP3qRo6F9t1 GnMpVOi1m/5qmW4XUyniBKwc9+OunevNkKsf68cMDk2t/bAA5d4eLwOyTkfRvG41P3 RJwQZM13v2DkRBRAaRM1dMG07hFmZkSDQw89xjWORuML2Dq/7PAfVfrD/z3GDjnhID ZD0sR7Xt7zXPQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Eugen Hristev , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin , nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, claudiu.beznea@microchip.com, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.10 26/46] media: atmel: atmel-isc-base: allow wb ctrls to be changed when isc is not configured Date: Thu, 11 Aug 2022 12:03:50 -0400 Message-Id: <20220811160421.1539956-26-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220811160421.1539956-1-sashal@kernel.org> References: <20220811160421.1539956-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Eugen Hristev [ Upstream commit aa63c5eaf7f7d2d3a4b1cc5782e7151b8ae3079f ] When attempting to change the white balance (WB) ctrls before starting streaming, e.g.: # v4l2-ctl -L User Controls .. blue_component_gain 0x009819c1 (int) : min=0 max=8191 step=1 default=512 value=512 flags=slider .. # v4l2-ctl --set-ctrl=blue_component_gain=500 # v4l2-ctl -L .. blue_component_gain 0x009819c1 (int) : min=0 max=8191 step=1 default=512 value=500 flags=slider .. These will not be written to the internal data struct and will not be written to the WB hardware module. Thus, after starting streaming, they will be reset to default: # v4l2-ctl -L .. blue_component_gain 0x009819c1 (int) : min=0 max=8191 step=1 default=512 value=512 flags=slider .. It does not make much sense to not be able to configure the WB controls at all times. Even if the sensor would not be RAW Bayer (and in this case the WB module is unavailable), the user could configure the ISC itself, as the ISC should not care about the sensor format. Thus, when WB module is available (if the sensor changes format e.g.) it will be already configured as be user's desires. In consequence, remove the check in isc_s_awb_ctrl that will return if ISC does not know the sensor format. Signed-off-by: Eugen Hristev Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/atmel/atmel-isc-base.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/media/platform/atmel/atmel-isc-base.c b/drivers/media/platform/atmel/atmel-isc-base.c index fe3ec8d0eaee..5364ec24947c 100644 --- a/drivers/media/platform/atmel/atmel-isc-base.c +++ b/drivers/media/platform/atmel/atmel-isc-base.c @@ -1915,10 +1915,6 @@ static int isc_s_awb_ctrl(struct v4l2_ctrl *ctrl) else ctrls->awb = ISC_WB_NONE; - /* we did not configure ISC yet */ - if (!isc->config.sd_format) - break; - /* configure the controls with new values from v4l2 */ if (ctrl->cluster[ISC_CTRL_R_GAIN]->is_new) ctrls->gain[ISC_HIS_CFG_MODE_R] = isc->r_gain_ctrl->val; -- 2.35.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4941CC19F2A for ; Thu, 11 Aug 2022 16:08:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wwrywz6klzF1ZE3cRFPasays8Gxd2sq2dHwgtyaw95w=; b=tnFPUlUz1z4AEG XkcxbutlYcRllR5G61xv/uUyvzOYlAj4jZMb3uMruaBJa7GT5wTtRTbOtnWECUcjqtddxne0rMP08 g6xXmH1w5jYFY7+2QLxZ+7suBoLNXpKUxTzRXL5Id1il3rDPtyuX+L02KknbK/q2lM56iEjWj43hA 9mi4ratGYbyQiv/PZCaRC0cOACxCk4gYYdJ0a1LKWbSxLrH29zkca2XWZZsMWZxgU3Uj8tDovh3Nu blQguyyESyrF9gNDAxZ0Y1wXZazU/AjD5QSyNY7NgTV7rtbMBD7TEIF6C8brkPNpzb76blEE2FMv8 TBt277bxigQJdDzMhclQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oMAhy-00Ehrw-Md; Thu, 11 Aug 2022 16:06:55 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oMAhg-00Ehbk-1u for linux-arm-kernel@lists.infradead.org; Thu, 11 Aug 2022 16:06:37 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A3097B82144; Thu, 11 Aug 2022 16:06:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A731C43140; Thu, 11 Aug 2022 16:06:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660233994; bh=4Pd9YhMtbhmuj5NoQ6MMg43/eFwj/qfS0d/cqdREFS8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tiwe1RASNYITWokLvoz5F2g8tGVO5xo+gZNZ4Czo8r0cT0IWHV0gAb3NLTLa/KJOr B1m0WBoyzcpt8nNxGmnRxjSt5XCpHrvoKNvGPReHorzFRPJbkRybCe1wRE+HVb+HgG 0vbqL5xvhSXpkbiHCNvfx/Er95IQ75Ch8Ms/RWNOU/+yvRlV8boahNIGP3qRo6F9t1 GnMpVOi1m/5qmW4XUyniBKwc9+OunevNkKsf68cMDk2t/bAA5d4eLwOyTkfRvG41P3 RJwQZM13v2DkRBRAaRM1dMG07hFmZkSDQw89xjWORuML2Dq/7PAfVfrD/z3GDjnhID ZD0sR7Xt7zXPQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 5.10 26/46] media: atmel: atmel-isc-base: allow wb ctrls to be changed when isc is not configured Date: Thu, 11 Aug 2022 12:03:50 -0400 Message-Id: <20220811160421.1539956-26-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220811160421.1539956-1-sashal@kernel.org> References: <20220811160421.1539956-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220811_090636_424399_EA5AC283 X-CRM114-Status: GOOD ( 15.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Levin , alexandre.belloni@bootlin.com, Hans Verkuil , Eugen Hristev , Mauro Carvalho Chehab , claudiu.beznea@microchip.com, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Eugen Hristev [ Upstream commit aa63c5eaf7f7d2d3a4b1cc5782e7151b8ae3079f ] When attempting to change the white balance (WB) ctrls before starting streaming, e.g.: # v4l2-ctl -L User Controls .. blue_component_gain 0x009819c1 (int) : min=0 max=8191 step=1 default=512 value=512 flags=slider .. # v4l2-ctl --set-ctrl=blue_component_gain=500 # v4l2-ctl -L .. blue_component_gain 0x009819c1 (int) : min=0 max=8191 step=1 default=512 value=500 flags=slider .. These will not be written to the internal data struct and will not be written to the WB hardware module. Thus, after starting streaming, they will be reset to default: # v4l2-ctl -L .. blue_component_gain 0x009819c1 (int) : min=0 max=8191 step=1 default=512 value=512 flags=slider .. It does not make much sense to not be able to configure the WB controls at all times. Even if the sensor would not be RAW Bayer (and in this case the WB module is unavailable), the user could configure the ISC itself, as the ISC should not care about the sensor format. Thus, when WB module is available (if the sensor changes format e.g.) it will be already configured as be user's desires. In consequence, remove the check in isc_s_awb_ctrl that will return if ISC does not know the sensor format. Signed-off-by: Eugen Hristev Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/atmel/atmel-isc-base.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/media/platform/atmel/atmel-isc-base.c b/drivers/media/platform/atmel/atmel-isc-base.c index fe3ec8d0eaee..5364ec24947c 100644 --- a/drivers/media/platform/atmel/atmel-isc-base.c +++ b/drivers/media/platform/atmel/atmel-isc-base.c @@ -1915,10 +1915,6 @@ static int isc_s_awb_ctrl(struct v4l2_ctrl *ctrl) else ctrls->awb = ISC_WB_NONE; - /* we did not configure ISC yet */ - if (!isc->config.sd_format) - break; - /* configure the controls with new values from v4l2 */ if (ctrl->cluster[ISC_CTRL_R_GAIN]->is_new) ctrls->gain[ISC_HIS_CFG_MODE_R] = isc->r_gain_ctrl->val; -- 2.35.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel