Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp183726rdb; Thu, 1 Feb 2024 05:55:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IEVV264QA0zVtz6hDbl+pnznX5RcsqdgWrMKxHvYPwgb+HXtixrZrDrIEDfD5U/Dxr1nyrv X-Received: by 2002:a17:902:c948:b0:1d4:1f71:8fcf with SMTP id i8-20020a170902c94800b001d41f718fcfmr6158479pla.59.1706795749333; Thu, 01 Feb 2024 05:55:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706795749; cv=pass; d=google.com; s=arc-20160816; b=j3aLBTXUfT/i+FEQ5aeyY2L8xezp+sXiTaj9Vm474LF0WQ67XoRGq4RZQLEgAf7wnq 0rMiY/NkGYFJT+M4GVgon2RKxTxsbZZiY2aKh37kJMquLyk2IdM3Y9rGRtADSWDSVSZ1 gu7F8xGMlS9XhzBlW5Ns7GVaFqYV01ZlCyE7e/jkPhc7KW7OWknI1ka0Zd3g9WmaZ7s0 vIIFuFq/jRJ1CIL61tdZLkh3wGXlzarUgLsAfHcXXqQNtpYJzSZi78TWOoRSq+DymXka BkwldE0/8yeC5F13HpEmjiauEFan13j6jm0xSbJTCehwBY3rn+MOkiGYOQ3rbRdpFGS7 1ZEA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=DeoLaMDCeKDFgKaDp6lf/Oh2K9W3JXbITaKULjow4Z0=; fh=S0ajoIqRyqg6m0Lhr9+EBVlwTgPbsm1ToD69w/p5MGE=; b=fkceejOVERCRrRuqJ9DudXVFistJ6LvDNveT6B8ERR+2nxbHEDsTayuUe4eWnjJefA MxTDmMHIXqb1TfCLeMSFJFHrxbfmkWIolDFKtHrJADE+0juW7ZL6IcIScZA8feOupW7R JthtF+o0ak8GAh8d9ajuXTlgEJJzUx+PTSupCx2oHYPdeVdbvft72U2O3C+49QHAGnTk nuDzKxl5hN75nBWQfes3MEwG0h5b44xQcdGxK2awtrFh79dwq1sZQlSw+tGo8i+2Ytva zNgTgjQjmJsxUI0AdHawv/Mr41CyS4/1d/CcpE2jxRFajCuvyLv9wetxmA6bQZRLsAFL L6xA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=UD9a8fj3; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-48267-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48267-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCXZXkvApEK3XMYmJbjJsillGQ4W5mrieqqfhB7Hq04tOn1dGuP/tM93e/hsUNFWE0HaMKEEfCkEpoBfNolgrVwjFTuKhYG9gX6t6X3lKA== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id l1-20020a170903244100b001d9176f56f7si5209494pls.462.2024.02.01.05.55.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 05:55:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48267-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=UD9a8fj3; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-48267-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48267-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 71FF528DFE6 for ; Thu, 1 Feb 2024 13:53:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 59E945F474; Thu, 1 Feb 2024 13:52:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="UD9a8fj3" Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 32E3A5F468; Thu, 1 Feb 2024 13:52:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706795559; cv=none; b=VfkF/UqZ3LwfMZId8gMG/L0ibGL0RqkZPciGpANzlK+UqdTt3pApf6oCyhCe6rUkVrJKP64aABJTCz5PTOzrPvvbUrs3UhZZmlkbfjamBm0EhDKQc0tUN+XiBqh4J4Qlr34PXFdHPYkCkjZzqFR/LCrRaG7uuqY2cwIevrrxpq0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706795559; c=relaxed/simple; bh=ebmTHicMZOC5G/O7XY0VPUZ32gErFhOhfjjwyQcH3aQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aaoiZ5/GGBhM4NmpS6jpRxSOD6UphIBRSxQ9i5LWdRcx270iDKh9Ct1HSQ5+ukcFdAdnpR2pop6SoOIzT857ht5vZ3rIeGPMyNANksA/BbRhYv8ml7teKNMr1/DpujdLy0AxTWiqMppVLiVlEe+457pf+X5eR+v4MFRE8Yvrf9E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=UD9a8fj3; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Received: from pendragon.ideasonboard.com (unknown [94.107.229.70]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 79909613C; Thu, 1 Feb 2024 14:51:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1706795474; bh=ebmTHicMZOC5G/O7XY0VPUZ32gErFhOhfjjwyQcH3aQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UD9a8fj3OvrZ5BeNaUdR2+AZQXSSCY7pfmfYLmE55moZqqNph9JgP8Gmn+b0M2Ngw emvh68QZD96AbHtCoqkYXrFjP94ELxMj/vXZuyHumLBdyPSbJns7bqsME9R3cgPzvq 9ZHRS3U/4WrGrwVr+jip+mS55c08kjBzRdFJ5haI= Date: Thu, 1 Feb 2024 15:52:32 +0200 From: Laurent Pinchart To: Paul Elder Cc: linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org, kieran.bingham@ideasonboard.com, tomi.valkeinen@ideasonboard.com, umang.jain@ideasonboard.com, aford173@gmail.com, Alexander Stein , Dafna Hirschfeld , Mauro Carvalho Chehab , Heiko Stuebner , "moderated list:ARM/Rockchip SoC support" , open list Subject: Re: [PATCH v6 04/11] media: rkisp1: Support devices lacking dual crop Message-ID: <20240201135232.GB5344@pendragon.ideasonboard.com> References: <20240111114831.656736-1-paul.elder@ideasonboard.com> <20240111114831.656736-5-paul.elder@ideasonboard.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240111114831.656736-5-paul.elder@ideasonboard.com> Hi Paul, Thank you for the patch. On Thu, Jan 11, 2024 at 08:48:24PM +0900, Paul Elder wrote: > Some versions of the ISP supported by the rkisp1 driver, such as the ISP > in the i.MX8MP, lack the dual crop registers and don't support cropping > at the resizer input. They instead rely on cropping in the Image > Stabilization module, at the output of the ISP, to modify the resizer > input size and implement digital zoom. > > Support those ISP versions by addind a dual crop feature flag, and s/addind/adding/ > mapping the resizer input crop rectangle to either the resizer dual crop > module or the image stabilization module. The implementation doesn't match the commit message. You only disable dual-crop here, you don't handle the image stabilization module. I'm fine with that, I think adding IS support belongs to a separate patch, but what this patch is missing is disabling the ability to set a crop rectangle on the resizer input when dual-crop is not supported. > Signed-off-by: Laurent Pinchart > Signed-off-by: Paul Elder > Tested-by: Alexander Stein > Tested-by: Adam Ford > Reviewed-by: Tomi Valkeinen > --- > drivers/media/platform/rockchip/rkisp1/rkisp1-common.h | 2 ++ > drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 6 ++++-- > drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c | 6 ++++-- > 3 files changed, 10 insertions(+), 4 deletions(-) > > diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h b/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h > index f7c251f79aa9..219d4a2547aa 100644 > --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h > +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-common.h > @@ -112,6 +112,7 @@ enum rkisp1_isp_pad { > * @RKISP1_FEATURE_MIPI_CSI2: The ISP has an internal MIPI CSI-2 receiver > * @RKISP1_FEATURE_MAIN_STRIDE: The ISP supports configurable stride on the main path > * @RKISP1_FEATURE_SELF_PATH: The ISP has a self path > + * @RKISP1_FEATURE_DUAL_CROP: The ISP has the dual crop block at the resizer input > * > * The ISP features are stored in a bitmask in &rkisp1_info.features and allow > * the driver to implement support for features present in some ISP versions > @@ -121,6 +122,7 @@ enum rkisp1_feature { > RKISP1_FEATURE_MIPI_CSI2 = BIT(0), > RKISP1_FEATURE_MAIN_STRIDE = BIT(1), > RKISP1_FEATURE_SELF_PATH = BIT(2), > + RKISP1_FEATURE_DUAL_CROP = BIT(3), > }; > > #define rkisp1_has_feature(rkisp1, feature) \ > diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c > index f48a21985b18..2e40c376cab5 100644 > --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c > +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c > @@ -507,7 +507,8 @@ static const struct rkisp1_info px30_isp_info = { > .isr_size = ARRAY_SIZE(px30_isp_isrs), > .isp_ver = RKISP1_V12, > .features = RKISP1_FEATURE_MIPI_CSI2 > - | RKISP1_FEATURE_SELF_PATH, > + | RKISP1_FEATURE_SELF_PATH > + | RKISP1_FEATURE_DUAL_CROP, > }; > > static const char * const rk3399_isp_clks[] = { > @@ -527,7 +528,8 @@ static const struct rkisp1_info rk3399_isp_info = { > .isr_size = ARRAY_SIZE(rk3399_isp_isrs), > .isp_ver = RKISP1_V10, > .features = RKISP1_FEATURE_MIPI_CSI2 > - | RKISP1_FEATURE_SELF_PATH, > + | RKISP1_FEATURE_SELF_PATH > + | RKISP1_FEATURE_DUAL_CROP, > }; > > static const struct of_device_id rkisp1_of_match[] = { > diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c > index dd77a31e6014..de2eb2c97cc4 100644 > --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c > +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-resizer.c > @@ -635,7 +635,8 @@ static int rkisp1_rsz_s_stream(struct v4l2_subdev *sd, int enable) > struct v4l2_subdev_state *sd_state; > > if (!enable) { > - rkisp1_dcrop_disable(rsz, RKISP1_SHADOW_REGS_ASYNC); > + if (rkisp1_has_feature(rkisp1, DUAL_CROP)) > + rkisp1_dcrop_disable(rsz, RKISP1_SHADOW_REGS_ASYNC); > rkisp1_rsz_disable(rsz, RKISP1_SHADOW_REGS_ASYNC); > return 0; > } > @@ -646,7 +647,8 @@ static int rkisp1_rsz_s_stream(struct v4l2_subdev *sd, int enable) > sd_state = v4l2_subdev_lock_and_get_active_state(sd); > > rkisp1_rsz_config(rsz, sd_state, when); > - rkisp1_dcrop_config(rsz, sd_state); > + if (rkisp1_has_feature(rkisp1, DUAL_CROP)) > + rkisp1_dcrop_config(rsz, sd_state); > > v4l2_subdev_unlock_state(sd_state); > -- Regards, Laurent Pinchart