Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1667765pxk; Sun, 13 Sep 2020 11:22:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5Oa8JZdEhsqbUE+ysTcIhmCNXlpQHZEYtRFAXkadOpdS6CSI92G/x6e7iysDPTYn5x8Y3 X-Received: by 2002:a17:906:b756:: with SMTP id fx22mr10843852ejb.245.1600021368395; Sun, 13 Sep 2020 11:22:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600021368; cv=none; d=google.com; s=arc-20160816; b=zGqxncilXvvjky8wywZAggAe5d6oT19ecLgyK0ouT71kdDC4PYul5ZS0dyIQTwYSc4 pixmilbEfXkQUmrmv7Wi3fHIG724Obheu6GFu7EaM4aYfF+R0W0iXQoSoeOfyYbF4h+n QlkqmAEzrnF1371EiVUlMg4ftiAbu8FAk1Qsk/Nk/iXnAMPHtttPJrbnYCxXDs+CMufg tL47KFnuea5U/6GugKKkEkiyBDzN1OQ7EXbgI/FfcjmnR6VxP8O+dHOoVHJWkPA/j07y Z7WxMRmSycQWNMwFWMy3HRIZE1ra/35TWWU7/Z2tzFdsZeHf266BiMxWsSfCHEM8Xned fpqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=kDtUyGBCvsp2MXb0IVS1L1dBIK+GCXlFzxLCH6PRjcU=; b=P3SlX2jPx6AB5q9oEmfaMo6ajSn2Svz+TBsuCBCDL8FisoSLQEIB+sHbDuA+rI3M9f TbRzRikyTwc/LG6z2FX0JeroeExI6JtojWpRtqBAhitQP1QoPQ1iqte7El9EgNorNltQ MLWnTNWu6v7M/dShLmdd5uOBhMWdxdYJmBD3bAdXS5hBNHc6ZPdQJSVIbMhfBT8aBBno i7wXwfEFsMJrzTb+d7WfenQOEvnPKAgoFmIANwOISMM/ACilQlS8Ye3iozX5rLjPwkT9 jhA50evBU6mycC+q5ZEiC7Ag0fzHxInhw/xzLDof6qAVjHblVVCon2RRTlJe5BTeoKCw ocyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a21si5493562eds.368.2020.09.13.11.22.24; Sun, 13 Sep 2020 11:22:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725949AbgIMSVu (ORCPT + 99 others); Sun, 13 Sep 2020 14:21:50 -0400 Received: from relmlor2.renesas.com ([210.160.252.172]:11279 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725936AbgIMSVs (ORCPT ); Sun, 13 Sep 2020 14:21:48 -0400 X-IronPort-AV: E=Sophos;i="5.76,422,1592838000"; d="scan'208";a="56924822" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 14 Sep 2020 03:21:46 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 2247940B696E; Mon, 14 Sep 2020 03:21:43 +0900 (JST) From: Lad Prabhakar To: =?UTF-8?q?Niklas=20S=C3=B6derlund?= , Laurent Pinchart , Hans Verkuil , Mauro Carvalho Chehab , Kieran Bingham , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Biju Das , Lad Prabhakar , Prabhakar Subject: [PATCH v2] media: rcar-vin: Update crop and compose settings for every s_fmt call Date: Sun, 13 Sep 2020 19:21:40 +0100 Message-Id: <20200913182140.32466-1-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The crop and compose settings for VIN in non mc mode werent updated in s_fmt call this resulted in captured images being clipped. With the below sequence on the third capture where size is set to 640x480 resulted in clipped image of size 320x240. high(640x480) -> low (320x240) -> high (640x480) This patch makes sure the VIN crop and compose settings are updated. Fixes: 104464f573d ("media: rcar-vin: Do not reset the crop and compose rectangles in s_fmt") Signed-off-by: Lad Prabhakar Reviewed-by: Biju Das --- Changes for v2: * Dropped redundant code mapping crop and compose rects v1 - https://lkml.org/lkml/2020/7/31/364 --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c index 0e066bba747e..1bd59a8453b4 100644 --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c @@ -305,7 +305,7 @@ static int rvin_s_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *f) { struct rvin_dev *vin = video_drvdata(file); - struct v4l2_rect fmt_rect, src_rect; + struct v4l2_rect src_rect; int ret; if (vb2_is_busy(&vin->queue)) @@ -317,14 +317,11 @@ static int rvin_s_fmt_vid_cap(struct file *file, void *priv, return ret; vin->format = f->fmt.pix; - - fmt_rect.top = 0; - fmt_rect.left = 0; - fmt_rect.width = vin->format.width; - fmt_rect.height = vin->format.height; - - v4l2_rect_map_inside(&vin->crop, &src_rect); - v4l2_rect_map_inside(&vin->compose, &fmt_rect); + vin->crop.top = 0; + vin->crop.left = 0; + vin->crop.width = vin->format.width; + vin->crop.height = vin->format.height; + vin->compose = vin->crop; vin->src_rect = src_rect; return 0; -- 2.17.1