Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp7873593rwp; Wed, 19 Jul 2023 01:22:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlEafEpmNKfhP/ZZTRlxcGdzp8Hg+A+q4mdJIf+Bjmg5bGMbCpW/iXgOpBlX37zsKORTLr2o X-Received: by 2002:a17:907:8a17:b0:98d:696a:531c with SMTP id sc23-20020a1709078a1700b0098d696a531cmr1969657ejc.40.1689754956872; Wed, 19 Jul 2023 01:22:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689754956; cv=none; d=google.com; s=arc-20160816; b=MFTZ3j00eFnQeV3h9AInIAsS3ar1y/cZGuQ6j+Xt3s4jtrsjBaeBZe0ebE78vXKChI X7z/cXHLaq4jEi/l80t+XUaP1oghrS3cv84+7aJDm8Eb3eAytIXTTePHLKbOaL8rEjB5 eqTcwEOugHDz5BfoOciUqmy4YIeonAZvZXiHoq7ACwGfJEctRJ9q4R+3+n7lU/OX4934 gKeE23ul9L/nKV3Y2ukHuMl0dS2ujQUz72YQj7+xsdJPC9PD7AIa+XMS2ZAu3dsAiXax LDFItqWeGPmOyHlkSwEfUYMgXfwVAJN5RSF0fAzVRldZu2e9CuKLWV/gsWcb2DAJXpfK lsrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=EtXxay+Im83PHxaROShX6tNQqkvPPgbRAYjDzzqfZvE=; fh=Jkp6eE3BVdYXUqTVjUDHnCxAIImw/6+PthaN3q/kWRw=; b=iEXxgLbh+80f/VbMorbkGcmcBgNj7QGp2RsAlvxTwX16/5rZsGzasZw+TA8XTAbDK0 DBLLCzy3411YfUSFHDD4b5dE7xxwjijh2SB9XNnWnkK54GK/LVTf8rcssL5q/o7nEWP4 /+eRd7QVZh6Fe0zqWXN5sBuYg0HIEq9D6pHywifaUmo5ClVR/bqnrtxHD1ZGZhj7n76p 1lNH+RgMhdqKvkicEDsQqsgAepdNUh1Rg6PHJAeIKOqkyKfTyAmI8fXhhNjEMHm25bHw b4MciX/HSbFGrSCSgw/zTeiQWm3y87c2oGF4gY8s+dNlJKXIF5ADo6erAJ/buREm63FU crwg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rh7-20020a17090720e700b00987b0a5f325si2407784ejb.1043.2023.07.19.01.22.12; Wed, 19 Jul 2023 01:22:36 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230094AbjGSIEd (ORCPT + 99 others); Wed, 19 Jul 2023 04:04:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229759AbjGSIEc (ORCPT ); Wed, 19 Jul 2023 04:04:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABBA8BE; Wed, 19 Jul 2023 01:04:31 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4305A61228; Wed, 19 Jul 2023 08:04:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86E2DC433C8; Wed, 19 Jul 2023 08:04:28 +0000 (UTC) Message-ID: <7dcadd80-ae5c-0e53-d91a-2ee5028e51f5@xs4all.nl> Date: Wed, 19 Jul 2023 10:04:26 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v1] media:Fix repeated initialization Content-Language: en-US To: Wang Ming , Sylwester Nawrocki , Mauro Carvalho Chehab , Krzysztof Kozlowski , Alim Akhtar , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Marek Szyprowski , Sylwester Nawrocki , linux-media@vger.kernel.org Cc: opensource.kernel@vivo.com References: <20230705142142.3526-1-machel@vivo.com> From: Hans Verkuil In-Reply-To: <20230705142142.3526-1-machel@vivo.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 On 05/07/2023 16:21, Wang Ming wrote: > If the first report returns NULL, > there is no need to execute the > fimc_capture_try_format() function > again. > > Signed-off-by: Wang Ming > --- > .../media/platform/samsung/exynos4-is/fimc-capture.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-capture.c b/drivers/media/platform/samsung/exynos4-is/fimc-capture.c > index a0d43bf892e6..5ce2f04afa1e 100644 > --- a/drivers/media/platform/samsung/exynos4-is/fimc-capture.c > +++ b/drivers/media/platform/samsung/exynos4-is/fimc-capture.c > @@ -825,10 +825,12 @@ static int fimc_pipeline_try_format(struct fimc_ctx *ctx, > tfmt->height = mf->height; > ffmt = fimc_capture_try_format(ctx, &tfmt->width, &tfmt->height, > NULL, &fcc, FIMC_SD_PAD_SINK_CAM); > - ffmt = fimc_capture_try_format(ctx, &tfmt->width, &tfmt->height, > - NULL, &fcc, FIMC_SD_PAD_SOURCE); > - if (ffmt && ffmt->mbus_code) > - mf->code = ffmt->mbus_code; > + if (ffmt) { > + ffmt = fimc_capture_try_format(ctx, &tfmt->width, &tfmt->height, > + NULL, &fcc, FIMC_SD_PAD_SOURCE); > + if (ffmt && ffmt->mbus_code) > + mf->code = ffmt->mbus_code; > + } I'm not so sure this is a bug at all. I think (not quite certain) that the first fimc_capture_try_format() call constrains the width and height to whatever is the SINK_CAM pad, then further constrains it to that of the SOURCE pad. But really, someone from Samsung should take a look as well. Adding Marek and Sylwester. Regards, Hans > if (mf->width != tfmt->width || mf->height != tfmt->height) > continue; > tfmt->code = mf->code;