From patchwork Wed Oct 30 16:34:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 21775 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id EEBFCC3237 for ; Wed, 30 Oct 2024 16:35:14 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 096AD65392; Wed, 30 Oct 2024 17:35:14 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="QYofRV1r"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D68A965392 for ; Wed, 30 Oct 2024 17:35:07 +0100 (CET) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:a7a3:a679:a325:f9b7]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8FEEB1083; Wed, 30 Oct 2024 17:35:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1730306103; bh=8aIoP0AITAVflNZ02qtNP/BZx4ZXfd+7ncAMgQYji4Q=; h=From:To:Cc:Subject:Date:From; b=QYofRV1rnjD+1WphbZ8+WiiZBdtERciBx3EEzuCgTNLktQJWKGiRvLBN1k4whBX5f EVYgDph54PY2pesCNO7QqK0UHvw2riGrjN0YItiQEyFqdaqBi+MRkmHtveNdJTJlR+ TQhOrUbKgM08mRuxst/Ac5qofHPlrD8aQBZgwxuQ= From: Stefan Klug To: libcamera-devel@lists.libcamera.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Stefan Klug , Sakari Ailus , Kieran Bingham , Umang Jain , Mauro Carvalho Chehab Subject: [PATCH] media: imx283: Report correct V4L2_SEL_TGT_CROP Date: Wed, 30 Oct 2024 17:34:21 +0100 Message-ID: <20241030163439.245035-1-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The target crop rectangle is initialized with the crop of the default sensor mode. This is incorrect when a different sensor mode gets selected. Fix that by updating the crop rectangle when changing the sensor mode. Signed-off-by: Stefan Klug --- drivers/media/i2c/imx283.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/media/i2c/imx283.c b/drivers/media/i2c/imx283.c index 3174d5ffd2d7..c8863c9e0ccf 100644 --- a/drivers/media/i2c/imx283.c +++ b/drivers/media/i2c/imx283.c @@ -1123,6 +1123,7 @@ static int imx283_set_pad_format(struct v4l2_subdev *sd, struct v4l2_subdev_state *sd_state, struct v4l2_subdev_format *fmt) { + struct v4l2_rect *crop; struct v4l2_mbus_framefmt *format; const struct imx283_mode *mode; struct imx283 *imx283 = to_imx283(sd); @@ -1149,6 +1150,9 @@ static int imx283_set_pad_format(struct v4l2_subdev *sd, *format = fmt->format; + crop = v4l2_subdev_state_get_crop(sd_state, IMAGE_PAD); + *crop = mode->crop; + return 0; }