From patchwork Fri Jul 5 04:55:55 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: 11032023 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D9CCF912 for ; Fri, 5 Jul 2019 04:56:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CBE1B2881B for ; Fri, 5 Jul 2019 04:56:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C03E528856; Fri, 5 Jul 2019 04:56:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F6F028867 for ; Fri, 5 Jul 2019 04:56:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726696AbfGEE4j (ORCPT ); Fri, 5 Jul 2019 00:56:39 -0400 Received: from bin-mail-out-06.binero.net ([195.74.38.229]:59464 "EHLO bin-mail-out-06.binero.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725971AbfGEE4h (ORCPT ); Fri, 5 Jul 2019 00:56:37 -0400 X-Halon-ID: 402f9487-9ee1-11e9-8d05-005056917f90 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (unknown [145.14.112.32]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA id 402f9487-9ee1-11e9-8d05-005056917f90; Fri, 05 Jul 2019 06:56:29 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: Laurent Pinchart , linux-media@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, =?utf-8?q?Niklas_S=C3=B6derlund?= Subject: [PATCH 2/4] rcar-vin: Do not reset the crop and compose rectangles in s_fmt Date: Fri, 5 Jul 2019 06:55:55 +0200 Message-Id: <20190705045557.25463-3-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190705045557.25463-1-niklas.soderlund+renesas@ragnatech.se> References: <20190705045557.25463-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 X-Virus-Scanned: ClamAV using ClamSMTP The crop and compose rectangles where reset when s_fmt was called resulting in potentially valid rectangles where lost when updating the format. Fix this by instead trying to map 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 2d94e700a473572c..d5e860ba6d9a2409 100644 --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c @@ -271,8 +271,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;