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 F36BB39D6FD for ; Mon, 8 Jun 2026 21:38:40 +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=1780954722; cv=none; b=oASS+EnQEB5X9D7iB76sjZlV9Jt8UTVVUq3PUaheErg39xvjclwrcKkCdGZRY9wk2tnHa+rIYUSt1MeAugk178vzfGyk9+gchZNLHURbIQnuQVuYDuFYBr4ZepeBqceLKGoqUgjXWZVM9xdE4jaXvAo14NDbo5mU9MCUDtqK//o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780954722; c=relaxed/simple; bh=5JXR8VgzOKi+zItDiQvW0UXop8eh5y7eYtpM7x833eU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BpmC8fRJUEpZUkpj+kIv0OcthyVrUv/c5qnMHyl8ti8bPwBT7F5c6noYT71TG3dCQwLcJFbDuLAHNb2UJ8BPO58+esX7/QhYjg9ApYVaZRA/0m7lO3FBJ61ZNgsvs1wcVnh4+OJUEkgqdM3ifmX0lRU3eiVx2JZ6OAuB4/bHU0A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (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=I7Vx/bwX; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="I7Vx/bwX" Received: from killaraus.ideasonboard.com (2001-14ba-70f3-e800--a06.rev.dnainternet.fi [IPv6:2001:14ba:70f3:e800::a06]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 709328F; Mon, 8 Jun 2026 23:38:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1780954690; bh=5JXR8VgzOKi+zItDiQvW0UXop8eh5y7eYtpM7x833eU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=I7Vx/bwXvHyhGKZXdyzTi+YGWXE7s4eF7C/+oLvHKUNwdNb+mokGPyK3pq9X9v+cz u3ygpEmPddWHMo+U5UxL0rrrvzsWmxtstZLiB01wtpq8dLJBKGQRmlAzIk3TfRqcJ8 ZRSbdAEzaty0NV6fMUh+kJs5LdbM6ybvAA+6Ln8M= Date: Tue, 9 Jun 2026 00:38:37 +0300 From: Laurent Pinchart To: Dave Stevenson Cc: Sakari Ailus , linux-media@vger.kernel.org, hans@jjverkuil.nl, Prabhakar , Kate Hsuan , Tommaso Merciai , Benjamin Mugnier , Sylvain Petinot , Christophe JAILLET , Julien Massot , Naushir Patuck , "Yan, Dongcheng" , Stefan Klug , Mirela Rabulea , =?utf-8?B?QW5kcsOp?= Apitzsch , Heimir Thor Sverrisson , Kieran Bingham , Mehdi Djait , Ricardo Ribalda Delgado , Hans de Goede , Jacopo Mondi , Tomi Valkeinen , David Plowman , "Yu, Ong Hock" , "Ng, Khai Wen" , Jai Luthra , Rishikesh Donadkar Subject: Re: [PATCH v5 03/10] media: imx219: Account rate_factor in setting upper exposure limit Message-ID: <20260608213837.GB944266@killaraus.ideasonboard.com> References: <20260607215356.842932-1-sakari.ailus@linux.intel.com> <20260607215356.842932-4-sakari.ailus@linux.intel.com> Precedence: bulk X-Mailing-List: linux-media@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: On Mon, Jun 08, 2026 at 04:42:44PM +0100, Dave Stevenson wrote: > On Sun, 7 Jun 2026 at 22:54, Sakari Ailus wrote: > > > > The rate_factor multiplier is used to multiply a few values in the > > sensor's timing configuration and the exposure time is one of them. This > > also needs to be taken into account in exposure time margin: multiply it > > by rate_factor so that sensor's exposure time margin is respected. > > Testing the 1640x1232 mode with FRM_LENGTH_A set to 0x288 (79.07fps), > I can write register 0x15a (COARSE_INTEGRATION_TIME_A) with values up > to and including 0x284 without it affecting the output frame rate, and > without image corruption. > With IMX219_EXPOSURE_OFFSET being 4, the current code implements > exactly those limits, so why do you believe the offset should be > increased? > > To my mind section 5-5 Frame Rate Calculation Formula of the datasheet > is fairly clear with > [ In the case of (frame_length_lines - 4 > coarse_integration_time) ]: > Frame_Length = frame_length_lines > [ In the case of (frame_length_lines - 4 < coarse_integration_time) ]: > Frame_Length = coarse_integration_time + 4 > > The register FRM_LENGTH_A (0x160) being in units of 2 lines doesn't > change that calculation. Readnig Jai's and your analysis, I agree. This patch should be dropped. > > Fixes: f513997119f4 ("media: i2c: imx219: Scale the pixel rate for analog binning") > > Cc: stable@vger.kernel.org > > Signed-off-by: Sakari Ailus > > --- > > drivers/media/i2c/imx219.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c > > index d8fe7db18b6c..e681f80f9e3e 100644 > > --- a/drivers/media/i2c/imx219.c > > +++ b/drivers/media/i2c/imx219.c > > @@ -451,7 +451,8 @@ static int imx219_set_ctrl(struct v4l2_ctrl *ctrl) > > int exposure_max, exposure_def; > > > > /* Update max exposure while meeting expected vblanking */ > > - exposure_max = format->height + ctrl->val - IMX219_EXPOSURE_OFFSET; > > + exposure_max = format->height + ctrl->val - > > + IMX219_EXPOSURE_OFFSET * rate_factor; > > exposure_def = (exposure_max < IMX219_EXPOSURE_DEFAULT) ? > > exposure_max : IMX219_EXPOSURE_DEFAULT; > > ret = __v4l2_ctrl_modify_range(imx219->exposure, -- Regards, Laurent Pinchart