Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp99124pxp; Tue, 8 Mar 2022 21:37:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJxO6UX8pwltIDYNjCHe1u/l4IDH4kU2oXHD+Hi545gu22wqUMW51+Bks0bQoz+CvRrmI1d1 X-Received: by 2002:a17:902:ab8d:b0:153:2e8:d363 with SMTP id f13-20020a170902ab8d00b0015302e8d363mr1230325plr.93.1646804265208; Tue, 08 Mar 2022 21:37:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646804265; cv=none; d=google.com; s=arc-20160816; b=Usq+i5aLCo7GyvCvu1ZzlEISwSDNbCgXbXNKK1WV8ZMlyyddGNkHEPW0WgnqmlMVwr rd7w/S0doguDvB7WIueNPD3vbJUGV8flntv+JS/bIl/TMusRBXuotTbYHfzetv8SoJor +XOfec0LAzOd1BRFmK/5N+VshmztwGfCoz28cDRwgpFqPl8mcOK4734dVGwZRzYO6j5B TpmP5OTp2JPYpEv7i1Scw0gnIcjpY0lgMeodRj5THC8+AJtFoQUmpPx5pmcrZ2oyALmu j8fXdqr+h3+XDmthE96vwcGNirjbqYqRfKi1ULlUla22vt8R15Qwkh1EUngJvDiBCTBE m4iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Y27yK8mxYkUsBc+4/wjGD0QD87yh3tgDYSNNIdSemVA=; b=gdNvreGX7Xptgw/hOsIxjc3PcHv1Il3TH91zsaaWTsk6q1EJN2hCEuzpkT1I1/xP8b jU0r+EIjFGpScXRnPAxyizF6Lw+A/SEkb+m4ADuxzJT/JF1zSr5vcy920Fh5M+31afsF /qCwYMEhqOEC7bgyd2vIk8jERwrs5M8p7xLt884Xg850bi0v53ee+l1mvTrgJPyHNo8j 0nh8aXnDdMUkMiv1WgfUmjdyQ3hIyeE18HUTf1Ks2U0OJbQ898ocndF30UWA9jVwiC6d 6Ts8EprVH/GapNj+TfGHQZ4BLICTBnP5zSqT2KgLtM0vfhv/Yqq64DYtb/luFye9SK4A juLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YNU5SXNM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s24-20020a17090a5d1800b001bf5531ee72si948516pji.15.2022.03.08.21.37.28; Tue, 08 Mar 2022 21:37:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YNU5SXNM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229482AbiCIFcj (ORCPT + 99 others); Wed, 9 Mar 2022 00:32:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbiCIFci (ORCPT ); Wed, 9 Mar 2022 00:32:38 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 52CA11451F5 for ; Tue, 8 Mar 2022 21:31:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646803899; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Y27yK8mxYkUsBc+4/wjGD0QD87yh3tgDYSNNIdSemVA=; b=YNU5SXNMTOxpLa5hSYJJZvmrQs7Jc7WhCvZML0yvm0QgZZSc1qQzgAPDczELOboiloL52p 75H76WFU4wGudMzVs31OkS9GKtIHTf1APix7bt/i79ZwoW18DJnPW8TpmVg0YXC+EUbYfn 0LrP02YFbKGo8xneRhXEpqF/zK9Rtqo= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-201-BFEz8atmMcKqgN35SQDGyg-1; Wed, 09 Mar 2022 00:31:38 -0500 X-MC-Unique: BFEz8atmMcKqgN35SQDGyg-1 Received: by mail-lf1-f70.google.com with SMTP id d14-20020a05651233ce00b004475964142aso459526lfg.21 for ; Tue, 08 Mar 2022 21:31:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Y27yK8mxYkUsBc+4/wjGD0QD87yh3tgDYSNNIdSemVA=; b=GsrJPDHXhfmZzHwESaBKRgQxg3e0UVZtDCUKR9rtMLiSpewoo6jUUSjo4rTuwI0VAy y1ZldhWD02kiA/LYtBw+HXtPzRCLb8hWiA1kODHl1AsIvj5mrWOUphTR0wfkzjZYwpRO 66GanGoqOS9mdzzazf2k3OllIUe/eu2wMP1/dvNR72mas/VaT5YKhxfLFPuPBb2S4TK1 l5bIRS6wYeUuANa2UG69X/H5qypd4vYIDxW0vCYloxFWXs4C+GFmJRRt7TprAeSj+Te9 ecChJ6ATCFyUqs5XBibJB95127TeW2VoRTCfnfftske3qxJ60RG8PkO1S9Y5Uk40r3FP l/7g== X-Gm-Message-State: AOAM533+SRzjQXfkw/OEHct+YmEnHORkLqTlu4OxAO/n9gXCYN0j6xvv YymoxzwSOEvnmOlwO2aQXOf3FTJaxgmhv/W5js2KJQtFtQYRone/329eWanF32sWlGPzwhhBrtO bBaifwJxiNc8cak0JqvuqRWTjHHiG6q5tDv4N82DM X-Received: by 2002:a05:651c:556:b0:247:eb02:8ab7 with SMTP id q22-20020a05651c055600b00247eb028ab7mr7047965ljp.104.1646803896694; Tue, 08 Mar 2022 21:31:36 -0800 (PST) X-Received: by 2002:a05:651c:556:b0:247:eb02:8ab7 with SMTP id q22-20020a05651c055600b00247eb028ab7mr7047951ljp.104.1646803896248; Tue, 08 Mar 2022 21:31:36 -0800 (PST) MIME-Version: 1.0 References: <20220223090648.41989-1-hpa@redhat.com> <20220223090648.41989-2-hpa@redhat.com> In-Reply-To: From: Kate Hsuan Date: Wed, 9 Mar 2022 13:31:25 +0800 Message-ID: Subject: Re: [PATCH 1/1] staging: media: ipu3: Fix AF x_start position when rightmost stripe is used To: Sakari Ailus Cc: Bingbu Cao , Tianshu Qiu , Mauro Carvalho Chehab , Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Hans De Goede , Jean-Michel Hautbois Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sakari, On Thu, Mar 3, 2022 at 5:09 PM Sakari Ailus wrote: > > Hi Kate, > > Thank you for the patch. > > On Wed, Feb 23, 2022 at 05:06:48PM +0800, Kate Hsuan wrote: > > For the AF configuration, if the rightmost stripe is used, the AF scene > > will be at the incorrect location of the sensor. > > > > The AF coordinate may be set to the right part of the sensor. This > > configuration would lead to x_start being greater than the > > down_scaled_stripes offset and the leftmost stripe would be disabled > > and only the rightmost stripe is used to control the AF coordinate. If > > the x_start doesn't perform any adjustments, the AF coordinate will be > > at the wrong place of the sensor since down_scaled_stripes offset > > would be the new zero of the coordinate system. > > > > In this patch, if only the rightmost stripe is used, x_start should > > minus down_scaled_stripes offset to maintain its correctness of AF > > scene coordinate. > > > > Signed-off-by: Kate Hsuan > > --- > > drivers/staging/media/ipu3/ipu3-css-params.c | 9 ++++++++- > > 1 file changed, 8 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/staging/media/ipu3/ipu3-css-params.c b/drivers/staging/media/ipu3/ipu3-css-params.c > > index d9e3c3785075..efe4de8ef205 100644 > > --- a/drivers/staging/media/ipu3/ipu3-css-params.c > > +++ b/drivers/staging/media/ipu3/ipu3-css-params.c > > @@ -2556,6 +2556,14 @@ int imgu_css_cfg_acc(struct imgu_css *css, unsigned int pipe, > > /* Enable only for rightmost stripe, disable left */ > > acc->af.stripes[0].grid_cfg.y_start &= > > ~IPU3_UAPI_GRID_Y_START_EN; > > + acc->af.stripes[0].grid_cfg.x_start -= > > + acc->stripe.down_scaled_stripes[1].offset; > > + acc->af.stripes[0].grid_cfg.x_end -= > > + acc->stripe.down_scaled_stripes[1].offset; > > + acc->af.stripes[1].grid_cfg.x_start -= > > + acc->stripe.down_scaled_stripes[1].offset; > > + acc->af.stripes[1].grid_cfg.x_end -= > > + acc->stripe.down_scaled_stripes[1].offset; > > The grid x/y ends are calculated from the width when both grids are enabled > and I think it should work the same way here. There's also masking of the > bits that aren't in use. Thanks for clarifying this :) > > The first stripe isn't enabled so changing values there has no effect as > far as I can tell. > Okay. I would remove the setting of the first stripe in the v2 patch. Thank you > Looking at the code a little, it seems all awb_fr, ae and af seem to suffer > from the same issue. Let's still iron out the fix for af first before > considering those. > > > } else if (acc->af.config.grid_cfg.x_end <= > > acc->stripe.bds_out_stripes[0].width - min_overlap) { > > /* Enable only for leftmost stripe, disable right */ > > @@ -2563,7 +2571,6 @@ int imgu_css_cfg_acc(struct imgu_css *css, unsigned int pipe, > > ~IPU3_UAPI_GRID_Y_START_EN; > > } else { > > /* Enable for both stripes */ > > - > > acc->af.stripes[0].grid_cfg.width = > > (acc->stripe.bds_out_stripes[0].width - min_overlap - > > acc->af.config.grid_cfg.x_start + 1) >> > > -- > Kind regards, > > Sakari Ailus > -- BR, Kate