Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp663814pxa; Sat, 1 Aug 2020 02:05:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5HT+nhdGp/V8LThKdUkqIfjK2vVbb9voc6UJux2VkUEqSAljPDn7gUIiDMyB5iFRsETYS X-Received: by 2002:a17:906:3449:: with SMTP id d9mr8025236ejb.460.1596272727635; Sat, 01 Aug 2020 02:05:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596272727; cv=none; d=google.com; s=arc-20160816; b=gbVC8yBT6FTlKWze8/Xhv5EMmoXt0dnGwEoXys/kJGCGVH5O9o4cwYIQ4RWq+iqReG VoH5iVWnDy6aWp+5qnToJcl/3DTaF9ROp/2n5CAS9hHHhon8xNwcOuhJNt2dad2qxjgX tcyQw2Q5XtTv4KGItsx9kf0Vm6FRE/nNaTnKeky+hJhaqRBsEGqnvSi0o7qlJeArKioj xopmoXJ+kKKzDMJrlP5K7Mbb4ZonEQaAUHWvEbBCj0MJZcOw+SegYT4451JH5D0czApV XyXgACgAIICwiLS3suEzzwZT30O7QGFdr0uKhVq0w8MWqBazRDfgt0b+RPf6/+ZNqkJL 62qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ysGkfROsxh9fScF28a6Ab2vg7iqMPSIMDcq/54hw/Bs=; b=falaSvaY2KJaCn1DxSDTVVjV+byr7VZfSdJ6b7REHyhPKqOMINh8rwk7/dv2RJeoQq eNyJgXxGN5q7JXt+65e2TjMpQOUtdQxFAYQilFGHJ5gdTH4fBOGY0ylqVmG3wQr9jafp tqRJQwZGMhcOd21w1rv6WHYAO6+UBrICaRMsi+nD5XT/1sRgDI237Dw6wonnuC07HDBj hWTpQX7XINeZOdY8SUjZOwb/u3Ri9sbUD5J+f/LH45wCfQ5/cIQ9yAkPDTBMw8kv6Ebh 42yWf+Zbtnv40572uZE59MJmjzBoWIO46edXTm4K/rIPYXoek2gki9YnPhWdGdmp2xC2 oHDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ragnatech-se.20150623.gappssmtp.com header.s=20150623 header.b=NLvj3hoT; 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 e26si7616117edv.66.2020.08.01.02.05.04; Sat, 01 Aug 2020 02:05:27 -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; dkim=pass header.i=@ragnatech-se.20150623.gappssmtp.com header.s=20150623 header.b=NLvj3hoT; 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 S1726414AbgHAJFB (ORCPT + 99 others); Sat, 1 Aug 2020 05:05:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725997AbgHAJFA (ORCPT ); Sat, 1 Aug 2020 05:05:00 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE92BC061757 for ; Sat, 1 Aug 2020 02:04:59 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id v12so4450661ljc.10 for ; Sat, 01 Aug 2020 02:04:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech-se.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=ysGkfROsxh9fScF28a6Ab2vg7iqMPSIMDcq/54hw/Bs=; b=NLvj3hoTucDf6+zODHoC036A5mqQFsEMXF7b9PN5sgndABfVg1Ow7CM9z9Ig0i/iAv QjBs2ZE6feVJKQ1a+tEYAAXBL9kHxq1JWH4c6J4i3aGKMkU5naF/d8S9QRR9Spg25wtN 3KAlWP+ovjBMIMbRoEmAcCTTOelojk7X9esECTxq3bgiiEEurWT+vGuVs8BV3q3JBywM wKbj+AjK4Ccn16LdqzXunJEsuGsVVQkxEHVUcPT6KA4ybrobiKAo263uG3OhHY0z/uHV IvgAjzu8Uh0jKNNRJkMrNbJJrixlcMX9Cxbl9QT+B14Ky0lyXl1YvFdmHX7LHVxlZVUY aatg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=ysGkfROsxh9fScF28a6Ab2vg7iqMPSIMDcq/54hw/Bs=; b=gn1Yv/bDwXvqGU9wtavdPFU5bM0kw0WG+3SDG3fSx7XNEfUafeNsniL40R8Tng6mky pHu+tvJ+Ue7AHCMybSLrv16gEgwhEfqUk5cLcwrfnQeSvM3pAAC0Qrob826AEAZgWgFn /n9Xadmh67qWsZEcGOSKSiXt/1Gyk2WpL1ku08ebzpIfoehxZfihpidW+cLslWQWU5ZI Cl0aoQZsOd7BxDajsT6PTjl/ERPfQmvXC7GDcCEWYCcBq2bznvuAtlwLUiGrY+XHdo3/ LkuFLSP7abMrBhYsIQ24etxJheHFzyroV19OBvWqowP0yRaDDIMHiaAV8ZAHD6L5t+oq FExQ== X-Gm-Message-State: AOAM532het+plUbj1tymLnJYzsZ3HZzlQYDgrVEr09ZbxoawzDMCmFsu Y73HBvgIttayqB/ciB7UMS/FFQ== X-Received: by 2002:a2e:160d:: with SMTP id w13mr3732137ljd.470.1596272698238; Sat, 01 Aug 2020 02:04:58 -0700 (PDT) Received: from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203]) by smtp.gmail.com with ESMTPSA id r19sm2556901lfi.58.2020.08.01.02.04.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Aug 2020 02:04:57 -0700 (PDT) Date: Sat, 1 Aug 2020 11:04:56 +0200 From: Niklas To: Lad Prabhakar Cc: Mauro Carvalho Chehab , Hans Verkuil , Kieran Bingham , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Biju Das , Prabhakar Subject: Re: [PATCH] media: rcar-vin: Update crop and compose settings for every s_fmt call Message-ID: <20200801090456.GB1379367@oden.dyn.berto.se> References: <1596187745-31596-1-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1596187745-31596-1-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Lad, Thanks for your work. On 2020-07-31 10:29:05 +0100, Lad Prabhakar wrote: > 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. This is clearly an inconsistency in the VIN driver that should be fixed. But I think the none-mc mode implements the correct behavior. That is that S_FMT should not modify the crop/compose rectangles other then make sure they don't go out of bounds. This is an area we tried to clarify in the past but I'm still not sure what the correct answer to. > > 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 > --- > drivers/media/platform/rcar-vin/rcar-v4l2.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c > index f421e25..a9b13d9 100644 > --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c > +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c > @@ -319,6 +319,12 @@ static int rvin_s_fmt_vid_cap(struct file *file, void *priv, > fmt_rect.width = vin->format.width; > fmt_rect.height = vin->format.height; > > + vin->crop.top = 0; > + vin->crop.left = 0; > + vin->crop.width = vin->format.width; > + vin->crop.height = vin->format.height; > + vin->compose = vin->crop; > + > v4l2_rect_map_inside(&vin->crop, &src_rect); > v4l2_rect_map_inside(&vin->compose, &fmt_rect); > vin->src_rect = src_rect; > -- > 2.7.4 > -- Regards, Niklas S?derlund