From patchwork Wed Sep 4 21:54:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 11131813 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3F48815E9 for ; Wed, 4 Sep 2019 21:54:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 205C121883 for ; Wed, 4 Sep 2019 21:54:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730082AbfIDVyi (ORCPT ); Wed, 4 Sep 2019 17:54:38 -0400 Received: from bin-mail-out-06.binero.net ([195.74.38.229]:53375 "EHLO bin-mail-out-06.binero.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730084AbfIDVyh (ORCPT ); Wed, 4 Sep 2019 17:54:37 -0400 X-Halon-ID: 88c0fd5d-cf5e-11e9-837a-0050569116f7 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (unknown [84.172.84.18]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA id 88c0fd5d-cf5e-11e9-837a-0050569116f7; Wed, 04 Sep 2019 23:54:14 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: Laurent Pinchart , Kieran Bingham , linux-media@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= Subject: [PATCH v3 4/6] rcar-vin: Do not reset the crop and compose rectangles in s_fmt Date: Wed, 4 Sep 2019 23:54:07 +0200 Message-Id: <20190904215409.30136-5-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190904215409.30136-1-niklas.soderlund+renesas@ragnatech.se> References: <20190904215409.30136-1-niklas.soderlund+renesas@ragnatech.se> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The crop and compose rectangles are reset when s_fmt is called resulting in potentially valid rectangles being lost when updating the format. Fix this by mapping the rectangles inside the new format. Signed-off-by: Niklas Söderlund Reviewed-by: Kieran Bingham --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c index 4d01a13ad14eee68..3f175e2e0a9a1389 100644 --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c @@ -283,8 +283,8 @@ static int rvin_s_fmt_vid_cap(struct file *file, void *priv, return ret; vin->format = f->fmt.pix; - vin->crop = crop; - vin->compose = compose; + v4l2_rect_map_inside(&vin->crop, &crop); + v4l2_rect_map_inside(&vin->compose, &compose); vin->src_rect = crop; return 0;