Received: by 2002:ab2:78c:0:b0:1ec:b906:25e5 with SMTP id h12csp254048lqe; Fri, 23 Feb 2024 03:33:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUliScjH8nZ50tjBwJrwlcnCmblhcAM5T6ldf4lKzGKToQKsNOUAcOKGqKRZcgt6tnBr1CnLa+TVOQXxqHpyPgKA1YDevmzjSWMehTThA== X-Google-Smtp-Source: AGHT+IGOeN7w7KJI8Kc8MLeli1T5MFlgoQymzglxvvgehMwApnp1fsV9qRgRxO3vxNmoSeQAsD35 X-Received: by 2002:a05:6402:612:b0:564:f9d1:6b14 with SMTP id n18-20020a056402061200b00564f9d16b14mr961473edv.14.1708687990730; Fri, 23 Feb 2024 03:33:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708687990; cv=pass; d=google.com; s=arc-20160816; b=klOgtQnAnTdHM+fUH3mAyyBJQZdSsJrwJ49i4D9rtRXSMVbeXTw6zSm3Iv3af1iQUU Tx5kDM+boKsYYh2UehHoAmv0KevxYoPxYuo8hMYswJ1qUGpzY1MgmfQGQ+QYJjt4FRN3 Qd/2mH4Ruv2OWwoCcS4HRYSRgkbswbuTiYV3SrAKtfBL0W9KP/dmU9V0SwEmM7+yJY50 eGV2zxlNDH3VB3OMZ+dSdpvWkvCEh3sYYiL+kq7NAvrihs2iCctTlloMIoLBPRCSly54 EAZAGOEmQmIK+JRaR4/3X8P2bnCnvd2HKvL4lclJm3LYneqqO3z1kN5zh/sGUAaTTZwV KAZw== 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=Y/2JEyo5MkMid1L2C9TFpiW+5umH8bjz/FXdts9Ej+o=; fh=QT+iGvNcZeaNbQRUR4DJ7wLtNyZTa5ZJCEL+R9E9tc8=; b=INgO66Ct4TiT5s5rNOqWibvlP7eJsA89zDHnjWJXLhygaeijA1EyysJ64kWencWOoc KTZJq8edsYmHeZPQ8oCUUPwzycVFl9pjSzhFbn7qPZG5lmc4waqyBy3RZmszb3u5LJzE GXmglogo2TgyiZk9BkWqB3oiVc7Fpj8XgyFO9YyM1EQKXeTMscIon0V+zERuy4szTEB9 3e7JCo0AE5/RQ87uiQnFdQF8qWVc9373M2YblOvHi0BZOEucgO0JLKZPzFqW8TWo5N3o DNMB92I+Xzri9Z5x8u1Wbqu5b9gEukyg/93XsrwfxEgxqrwFN5y4zFDbTHuQk818Mltb SPow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=JAFl2++A; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-78222-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78222-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id o28-20020a509b1c000000b005645cc81355si5007222edi.169.2024.02.23.03.33.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 03:33:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78222-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=JAFl2++A; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-78222-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78222-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 75A021F22C41 for ; Fri, 23 Feb 2024 11:33:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D30607A707; Fri, 23 Feb 2024 11:33:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="JAFl2++A" 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 98E385C617; Fri, 23 Feb 2024 11:32:58 +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=1708687980; cv=none; b=aOCMIaghWUf3KdtrFX8WG3edf/+x3GX/YLHinylkOY/wJ3o1lwHKClalSUIfATwMCjHxIl7Cxbjo2JKP8QxkRTRnI7CL6lDJK8ZhpjmDwWqD52ahTV1XY66hjQHMlV4l56Kk80jvijW6IJZtV5DzY3KmcC+ZEiKmuPCSw5InSaY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708687980; c=relaxed/simple; bh=E8Lif2LsYWgiOStX5/WWdENwxJ97hdnhRuKU+qaBHOQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cT2J2dokhVupKpJ95cVplqWrgsJ8EdYva2DOEEdGWhczD0isTT7xy3u6KYMntOSBme3RN7HR3F/17F7k7NVp37RNbogY+pisiiVGDsCA4bbtGNuzMa5ZPhrTTqtXezAuSSXFTTanwF6lvPHlVqVjyzNYq/7TLIEDrkan8t4AxKg= 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=JAFl2++A; 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 (89-27-53-110.bb.dnainternet.fi [89.27.53.110]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id AE6AB2E7; Fri, 23 Feb 2024 12:32:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1708687967; bh=E8Lif2LsYWgiOStX5/WWdENwxJ97hdnhRuKU+qaBHOQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JAFl2++A1kGB6XVk/sFWGm3mgoo/++iReBl/1hHrZhmv5NI3dPruCIf4GYYnRniSa BZaPGHKugaisoDI6kbUoxPucSzRRQWt1qxe0UJCObuN0s9+j2j6i6vSgNthjI2QK4v X8f6iP6UHSVIm4plcP0bKVrs223m89CC6sy5NA7M= Date: Fri, 23 Feb 2024 13:33:00 +0200 From: Laurent Pinchart To: Mikhail Rudenko Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Sakari Ailus , Jacopo Mondi , Tommaso Merciai , Christophe JAILLET , Dave Stevenson , Mauro Carvalho Chehab Subject: Re: [PATCH v2 15/20] media: i2c: ov4689: Move pixel array size out of struct ov4689_mode Message-ID: <20240223113300.GS31348@pendragon.ideasonboard.com> References: <20231218174042.794012-1-mike.rudenko@gmail.com> <20231218174042.794012-16-mike.rudenko@gmail.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: <20231218174042.794012-16-mike.rudenko@gmail.com> Hi Mikhail, Thank you for the patch. On Mon, Dec 18, 2023 at 08:40:36PM +0300, Mikhail Rudenko wrote: > Pixel array dimensions and default crop size do not belong to the > ov4689_mode structure, since they are mode independent. Make them > defines instead. > > Signed-off-by: Mikhail Rudenko > --- > drivers/media/i2c/ov4689.c | 29 +++++++++++++---------------- > 1 file changed, 13 insertions(+), 16 deletions(-) > > diff --git a/drivers/media/i2c/ov4689.c b/drivers/media/i2c/ov4689.c > index b43fb1d7b15f..475508559e3e 100644 > --- a/drivers/media/i2c/ov4689.c > +++ b/drivers/media/i2c/ov4689.c > @@ -70,6 +70,11 @@ > #define OV4689_LANES 4 > #define OV4689_XVCLK_FREQ 24000000 > > +#define OV4689_PIXEL_ARRAY_WIDTH 2720 > +#define OV4689_PIXEL_ARRAY_HEIGHT 1536 > +#define OV4689_DUMMY_ROWS 8 > +#define OV4689_DUMMY_COLUMNS 16 Adding a comment here to indicate that there are dummy columns in each side would be useful: #define OV4689_DUMMY_ROWS 8 /* 8 dummy rows on each side */ #define OV4689_DUMMY_COLUMNS 16 /* 16 dummy columns on each side */ Reviewed-by: Laurent Pinchart > + > static const char *const ov4689_supply_names[] = { > "avdd", /* Analog power */ > "dovdd", /* Digital I/O power */ > @@ -90,10 +95,6 @@ struct ov4689_mode { > u32 vts_def; > u32 exp_def; > u32 pixel_rate; > - u32 sensor_width; > - u32 sensor_height; > - u32 crop_top; > - u32 crop_left; > const struct cci_reg_sequence *reg_list; > unsigned int num_regs; > }; > @@ -254,10 +255,6 @@ static const struct ov4689_mode supported_modes[] = { > .id = OV4689_MODE_2688_1520, > .width = 2688, > .height = 1520, > - .sensor_width = 2720, > - .sensor_height = 1536, > - .crop_top = 8, > - .crop_left = 16, > .exp_def = 1536, > .hts_def = 10296, > .hts_min = 3432, > @@ -385,8 +382,6 @@ static int ov4689_get_selection(struct v4l2_subdev *sd, > struct v4l2_subdev_state *state, > struct v4l2_subdev_selection *sel) > { > - const struct ov4689_mode *mode = to_ov4689(sd)->cur_mode; > - > if (sel->which != V4L2_SUBDEV_FORMAT_ACTIVE) > return -EINVAL; > > @@ -394,15 +389,17 @@ static int ov4689_get_selection(struct v4l2_subdev *sd, > case V4L2_SEL_TGT_CROP_BOUNDS: > sel->r.top = 0; > sel->r.left = 0; > - sel->r.width = mode->sensor_width; > - sel->r.height = mode->sensor_height; > + sel->r.width = OV4689_PIXEL_ARRAY_WIDTH; > + sel->r.height = OV4689_PIXEL_ARRAY_HEIGHT; > return 0; > case V4L2_SEL_TGT_CROP: > case V4L2_SEL_TGT_CROP_DEFAULT: > - sel->r.top = mode->crop_top; > - sel->r.left = mode->crop_left; > - sel->r.width = mode->width; > - sel->r.height = mode->height; > + sel->r.top = OV4689_DUMMY_ROWS; > + sel->r.left = OV4689_DUMMY_COLUMNS; > + sel->r.width = > + OV4689_PIXEL_ARRAY_WIDTH - 2 * OV4689_DUMMY_COLUMNS; > + sel->r.height = > + OV4689_PIXEL_ARRAY_WIDTH - 2 * OV4689_DUMMY_ROWS; > return 0; > } > -- Regards, Laurent Pinchart