Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2252694pxa; Mon, 3 Aug 2020 11:14:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRb3Lu4FKXYroWYqYtLstr5awtwG4dyStBbkKzbgU9DcOUReBGqbNkBR4Fw6AF2GiEfQZ4 X-Received: by 2002:aa7:c6ce:: with SMTP id b14mr17525606eds.208.1596478482716; Mon, 03 Aug 2020 11:14:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596478482; cv=none; d=google.com; s=arc-20160816; b=Iot/4kSlBtQ/Oe5anBzy2HuazHWkjvKrW7ib9v3/SBru0XEhFeayvEJ3ulp4fKTa/K dnWD3A1MKlrTNTsCLq/+zxkaw2tClN1W7Ed78mHGLV9W2C41+G2/D0rse7kUyO4J5fx8 1SGQnaeaadVQ3NznOb4ccorCzWE/aNmL8nTVirMFmdPMy1A/iHrDvaw6IBT+Y2/0WfoE OcUaNV8s6il+4ZXd8QSFdk7jHEUxQml4aqUFjfantu6x1tGCtuQwy6a6jFP+VsnXXPMT m423zywfB7jY66731ys6KSGhbYCPIO/ejPVT7W0bjEx1Pp8fc4I0TNX+UZUF81u3sRDI Ak+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=J7r7YpmcchYGchQNEBkoeTg3Nnece6VxKk14FSGb/wg=; b=asFsvWLGiW/0sfLzZA1L6ylcAl0KEAIaklPGOFURP+DLmVazF+JqRpFOcHYkA/b+nX 98IIkLHZ4zSuG2SOWgX3YnlV6y9Ighsf4r7s6jj2WzKqgT9N8Y9+jAG5e0NL2NBlfR3V X+xOf5El4ztNBHGunP7uFqRoTaWgzWeDt8l16FO/3f8l2SNPT3AnFxpVXGDgkkhpSzVw EwPhUgyhSMe2Bc+0spUO2VzHSvwUWgsczcE4Ld42lAvfViJj6kLDUUaDDDZuE0dbg0X2 z/4k0AYJ2BnJ0zNLtvC6l/TlcUulL448yv2vH/Xb+7Up01KIlJclzrrqNMcXv7WrqVxt hzmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="KI+YOp/8"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b6si11042107ejb.293.2020.08.03.11.14.20; Mon, 03 Aug 2020 11:14:42 -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=@gmail.com header.s=20161025 header.b="KI+YOp/8"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728043AbgHCSMB (ORCPT + 99 others); Mon, 3 Aug 2020 14:12:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbgHCSMA (ORCPT ); Mon, 3 Aug 2020 14:12:00 -0400 Received: from mail-yb1-xb42.google.com (mail-yb1-xb42.google.com [IPv6:2607:f8b0:4864:20::b42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C666C06174A; Mon, 3 Aug 2020 11:12:00 -0700 (PDT) Received: by mail-yb1-xb42.google.com with SMTP id p191so4375768ybg.0; Mon, 03 Aug 2020 11:12:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=J7r7YpmcchYGchQNEBkoeTg3Nnece6VxKk14FSGb/wg=; b=KI+YOp/8fZfo8O25o8ruNnOpVKqngH04wZu7j4+45EG69hqJEJrNj3YJqLyKderBRb FqcnzqGp51v+YqnWzfdPXbTlMvi85BzASMDf8cxJciN7iM00LQ2nXXYUBw3uXOstD0fL ehG61mzYsgxMHpAdCe59A1MI86zAiAjLpYFGZSgfGIdyZ7rjtIB2msfMFfsTuZG8XspJ Pc1KaKSskqbDRoq96nYvH5h2f1+qr1qc6/Tg1fuyXo/F5OMhzWnXPNN5+J9OIkFghrGR WJsSX+jUlp2fIaAoCpP3aGN8JZfjvoMffk6MYgyyXx4kkEbEhGZTsKFlZyR0TA9HKEfW Q6Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=J7r7YpmcchYGchQNEBkoeTg3Nnece6VxKk14FSGb/wg=; b=J8RWaOluSqyOteb6EpFUTDF9UJb8ILGy1/2tYAcjMBivFoKWcmLjrRGH8Gi0T5AUGQ WYqeu/FlnNLaPI6Kq1SR4XFGV5pjkqmA6fBskSApzwx+O0ZCXGmUQUkKHI/UoOCqPybL kYtTKze+AZu5O/CfJsI87Bocvc7FZNDYSr+0AYZeb79ag2S9GjKEwJtO3Mp24xRn5Q7h FalxdUXdg+LePeHa5ot6sqqs3YBCKdJ+nzNxtsA+YzRPABmJ8toPriMBX3lujq6y7RHk 3CbA/X2Hpj/raxms0sjaKU6V48T4nDnNfebRcfBqvtzViJnl/1pBBqFRa4R3vGF1Rmdt EwYA== X-Gm-Message-State: AOAM531qDm4JaLHki0kHZTeR6zBkaUp3p97kv3ncp/U4TrhciE0DTbrk VoNltYfEZRTZHLt16p8u2Jl7cIELtPNyKXLy2HI= X-Received: by 2002:a25:4fd6:: with SMTP id d205mr28216774ybb.214.1596478319311; Mon, 03 Aug 2020 11:11:59 -0700 (PDT) MIME-Version: 1.0 References: <1596187745-31596-1-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com> <20200801090456.GB1379367@oden.dyn.berto.se> In-Reply-To: <20200801090456.GB1379367@oden.dyn.berto.se> From: "Lad, Prabhakar" Date: Mon, 3 Aug 2020 19:11:32 +0100 Message-ID: Subject: Re: [PATCH] media: rcar-vin: Update crop and compose settings for every s_fmt call To: Hans Verkuil , Laurent Pinchart Cc: Lad Prabhakar , Mauro Carvalho Chehab , Kieran Bingham , linux-media , Linux-Renesas , LKML , Biju Das , Niklas Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Hans, On Sat, Aug 1, 2020 at 10:04 AM Niklas wrot= e: > > 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. > What should be the exact behaviour of the bridge driver for s_fmt call. Should the crop/compose settings be updated for every s_fmt callback or should they be only updated on s_selection callback. Currently the non-mc rcar-vin doesnt update the crop/compose setting in s_fmt callback due to which I see the above issue as mentioned. Cheers, Prabhakar > > > > 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/medi= a/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, v= oid *priv, > > fmt_rect.width =3D vin->format.width; > > fmt_rect.height =3D vin->format.height; > > > > + vin->crop.top =3D 0; > > + vin->crop.left =3D 0; > > + vin->crop.width =3D vin->format.width; > > + vin->crop.height =3D vin->format.height; > > + vin->compose =3D vin->crop; > > + > > v4l2_rect_map_inside(&vin->crop, &src_rect); > > v4l2_rect_map_inside(&vin->compose, &fmt_rect); > > vin->src_rect =3D src_rect; > > -- > > 2.7.4 > > > > -- > Regards, > Niklas S=C3=B6derlund