Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2811505pxp; Mon, 14 Mar 2022 05:34:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcyYbz4P4+LDeLrliBdBbiM9Alt0++uGJRTMBaQtijqCyeKDj8NNnB9XPxOLYyCkl3hG7U X-Received: by 2002:a17:907:3f93:b0:6da:b5e2:f325 with SMTP id hr19-20020a1709073f9300b006dab5e2f325mr18119972ejc.120.1647261265125; Mon, 14 Mar 2022 05:34:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647261265; cv=none; d=google.com; s=arc-20160816; b=OS3PyVDX54AK/GaZM0C5z5Com3IdrDlxcdrgNuYmHPSm/G4oHOPogxxCDppMzpsra6 9nLljUQHq4MPM/WPPfl2lIL+YO1AZ9lNyELZzkuhxeB2MTpNb2mUlg0yrFWNrefyx8U0 Wr/ON/xbPuk5bhcXevX/NwFQVv+TksW4wLXl0ZhmQd3Kr41oPZ76PwjHmq+jYgg3AgHy i6ybpHHaIker1nM/Om3U55j84YjX5+MuAwbfnKVXS+ZknNz+3H9ehP4Tejhkhy4pC9Oi 6Qza7ZWfoN5son6PyrGnTg0HqcrgyKXc9Po05zPWbhopqWlljHOJKkSkEp/Ly/JHcGhz HI4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=yBBtuI6F18YPuS7YTSgGKI6xMx2O4uTZcjV3VPAgn7U=; b=LREB+hHLO/lpDUn4XYiTKwPssltSoWBIllEiq5WCG2guTM4XrObxJOPPq7FOP7YMc1 SQxCCx43QVfZWnOdIOSWxrr0xjtu28WKKWJ857jqDxQR5bPym3+QcCKymmFClRGMyiKH oAgYilqNHFwT0BvD+NvW/bGaoaGDMLmPgw3FRdNRroOFZHInVLBbKe6TZ+60VpP809W/ 73GHkhM7ikoYQgmNZ5XHCx5rEo89GTKBKc4ol5BSG7Sq+0nUnCqNI+rJTomK6+jXww/A LkkA7BrnZUG1GPSkCHzXs1zlNrb9p8ExKWakNdMD90uwMhf8RgRCf0L5kvpe6CJGBtSS dxKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IVemeglc; 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 v2-20020a170906488200b006db76365af6si8121332ejq.431.2022.03.14.05.33.59; Mon, 14 Mar 2022 05:34:25 -0700 (PDT) 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=IVemeglc; 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 S238318AbiCNKQ7 (ORCPT + 99 others); Mon, 14 Mar 2022 06:16:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230383AbiCNKQ7 (ORCPT ); Mon, 14 Mar 2022 06:16:59 -0400 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 9D65E3CA6E for ; Mon, 14 Mar 2022 03:15:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647252948; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=yBBtuI6F18YPuS7YTSgGKI6xMx2O4uTZcjV3VPAgn7U=; b=IVemeglcgRzDdPkh31BhUBB4lkYMOZrqgFg0/HXLIuVSYstEtWAT3OKlS8ceOtbneCxw5x cxfELS7JGhqTcqBpMe0mfu4qTXFX6mZJGc9QgmSRZDBzdjy4e4Wma4nQ00n4InfITE4F4x Pr7Kt5Ia6hLKz37cXo8a1TrsJ5Po+go= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-561-YQeAdOhmOyeUuGI8kVL1zw-1; Mon, 14 Mar 2022 06:15:45 -0400 X-MC-Unique: YQeAdOhmOyeUuGI8kVL1zw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B8EEF3802AC4; Mon, 14 Mar 2022 10:15:44 +0000 (UTC) Received: from kate-fedora.redhat.com (unknown [10.2.16.91]) by smtp.corp.redhat.com (Postfix) with ESMTP id C4C874AE321; Mon, 14 Mar 2022 10:15:41 +0000 (UTC) From: Kate Hsuan To: Sakari Ailus , Bingbu Cao , Tianshu Qiu , Mauro Carvalho Chehab , Greg Kroah-Hartman Cc: Jean-Michel Hautbois , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, hdegoede@redhat.com, Kate Hsuan Subject: [PATCH v3 1/2] staging: media: ipu3: Fix AF x_start position when rightmost stripe is used Date: Mon, 14 Mar 2022 18:15:22 +0800 Message-Id: <20220314101523.129672-1-hpa@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 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. Changes in v2: 1. Remove the setting of the first stripe. Signed-off-by: Kate Hsuan --- drivers/staging/media/ipu3/ipu3-css-params.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/staging/media/ipu3/ipu3-css-params.c b/drivers/staging/media/ipu3/ipu3-css-params.c index d9e3c3785075..5a8c07f34756 100644 --- a/drivers/staging/media/ipu3/ipu3-css-params.c +++ b/drivers/staging/media/ipu3/ipu3-css-params.c @@ -2556,6 +2556,10 @@ 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[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; } 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 */ -- 2.35.1