From nobody Tue Feb 10 02:46:40 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8CBEEC873E for ; Thu, 7 Sep 2023 17:00:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240198AbjIGRAc (ORCPT ); Thu, 7 Sep 2023 13:00:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239909AbjIGRAP (ORCPT ); Thu, 7 Sep 2023 13:00:15 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D43B1BF8 for ; Thu, 7 Sep 2023 09:59:33 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-402d499580dso13266895e9.1 for ; Thu, 07 Sep 2023 09:59:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694105880; x=1694710680; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=r2eMRVYZa9yK+ZkgTl4p3lLwil9RZtGAozJNRxapQmc=; b=Lwevslcd4GRBR4+sX6zMPGvb5/0/RZJPhNa+Xm1hnbc0dJB3PoHPyniVbnM/ovsmNB 54aM2w6ZKJOt7C0MtlG4q03e7+kdNouOevH+Lp8ToP2QViMWlRo8H3yD/MDJyl7TLv0s w9FT4zSM18RGgZFzfRHsY4/mBAPTkw0NVEXOWUEZ9GOqXSndhgswoRanqxCZJEVbk7aZ 34harjp0IS6N0THVVHtRUoTePwUjEcgJxwS61yhbQ0ewL9MdonOHJFKmdImSJesaeh0z 8I9xa7fZYAE1uisywocr4XR9Y7Jdb6NUOPhmy7jIQBYN3xhT5CFyATtkTZ80ad8yh3a+ ojkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694105880; x=1694710680; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r2eMRVYZa9yK+ZkgTl4p3lLwil9RZtGAozJNRxapQmc=; b=NpkId7JPvJ/5CyqXWXFEfAARVaqAZNzfogJHRIaMDW3jj53IO/kX6XhXleYW05LiC0 vp93BiOCQp8DP/hjY+0/1qWmsx26ZxEznZWidvI2COV067hoBzJR6VkmbtrhrZ1AJnOs 4Dk/2SKG0C+s6uwwEuqw9EJ11ZQSoUHlEKeKAhw9TQa+RIc4ncZPJC+SgYmYxxklgXPc YRFDMM1pxU/6kwTwb8SBqR4gOubNjLMEnEjsDOec5n0uuHa7PvvhkcXoFnZydSQcubr1 MZgAuUkCsTEysZk0PBNhfb1addFxnp69jFCgNXWiFnZxw7IhIMg7BfodrOwT+DvPWB0u YEbQ== X-Gm-Message-State: AOJu0Yz6/YboepWsg9welC1j677K4P5FL+k+5jSBv8qYlmk6G3UliNcy s2KOiInOEqGjWIQgw+vFEbhD5pBO1rafFePwze4= X-Google-Smtp-Source: AGHT+IFfEQjrdgJzj3lbHrT1DzWXt/XdNKHsEr/Du0B2dJDVUyYYVus4VSj11Y5jeqf+eAK0YDVMvg== X-Received: by 2002:adf:f68c:0:b0:317:6cc7:6b21 with SMTP id v12-20020adff68c000000b003176cc76b21mr5206350wrp.69.1694105065339; Thu, 07 Sep 2023 09:44:25 -0700 (PDT) Received: from sagittarius-a.chello.ie (188-141-3-169.dynamic.upc.ie. [188.141.3.169]) by smtp.gmail.com with ESMTPSA id d15-20020adffd8f000000b00317ab75748bsm23822145wrr.49.2023.09.07.09.44.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 09:44:24 -0700 (PDT) From: Bryan O'Donoghue To: rfoss@kernel.org, todor.too@gmail.com, bryan.odonoghue@linaro.org, agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, mchehab@kernel.org, hverkuil-cisco@xs4all.nl, laurent.pinchart@ideasonboard.com, sakari.ailus@linux.intel.com, andrey.konovalov@linaro.org Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 08/17] media: qcom: camss: Assign the correct number of RDIs per VFE Date: Thu, 7 Sep 2023 17:44:01 +0100 Message-ID: <20230907164410.36651-9-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230907164410.36651-1-bryan.odonoghue@linaro.org> References: <20230907164410.36651-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Each Video Front End - VFE - has a variable number of Raw Data Interfaces - RDIs associated with it. The CAMSS code started from a naive implementation where a fixed define was used as a control in a for(){} loop iterating through RDIs. That model scales badly. An attempt was made with VFE_LINE_NUM_GEN2 and VFE_LINE_NUM_GEN1 to differentiate between SoCs but, the problem with that is "gen1" and "gen2" have no meaning in the silicon. There is no fixed constraint in the silicon between VFE and RDI, it is entirely up to the SoC designers how many VFEs are populated and how many RDIs to associate with each VFE. As an example sdm845 has VFE version 175 and sm8250 VFE version 480. sdm845 has 2 VFEs with 4 RDIs and 1 VFE Lite with 4 RDIs. sm8250 has 2 VFEs with 3 RDIs and 2 VFE Lite with 4 RDIs. Clearly then we need a more granular model to capture the necessary data. The defines have gone away to be replaced with per-SoC data but, we haven't populated the parameter data with the real values. Let's call those values out now msm8916: 1 x VFE 3 x RDI per VFE (not 4) msm8996: 2 x VFE 3 x RDI per VFE (not 4) sdm660: 2 x VFE 3 x RDI per VFE (not 4) sdm845: 2 x VFE 4 x RDI per VFE (not 3) 1 x VFE Lite 4 x RDI per VFE Lite (not 3) sm8250: 2 x VFE 3 x RDI per VFE (not 4) 2 x VFE Lite 4 x RDI per VFE Lite This more complex and correct mapping was not possible prior to passing values via driver data. Now that we have that change in place we can correctly map VFEs to RDIs for each VFE. Signed-off-by: Bryan O'Donoghue Acked-by: Konrad Dybcio Reviewed-by: Laurent Pinchart --- drivers/media/platform/qcom/camss/camss-vfe.h | 2 -- drivers/media/platform/qcom/camss/camss.c | 20 +++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-vfe.h b/drivers/media/= platform/qcom/camss/camss-vfe.h index b4bae9f65c68f..4783afa73a365 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe.h +++ b/drivers/media/platform/qcom/camss/camss-vfe.h @@ -52,9 +52,7 @@ enum vfe_line_id { VFE_LINE_RDI0 =3D 0, VFE_LINE_RDI1 =3D 1, VFE_LINE_RDI2 =3D 2, - VFE_LINE_NUM_GEN2 =3D 3, VFE_LINE_PIX =3D 3, - VFE_LINE_NUM_GEN1 =3D 4, VFE_LINE_NUM_MAX =3D 4 }; =20 diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/plat= form/qcom/camss/camss.c index 12131d9ea7ca8..8e78dd8d5961e 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -128,7 +128,7 @@ static const struct camss_subdev_resources vfe_res_8x16= [] =3D { { 0 } }, .reg =3D { "vfe0" }, .interrupt =3D { "vfe0" }, - .line_num =3D VFE_LINE_NUM_GEN1, + .line_num =3D 3, .ops =3D &vfe_ops_4_1 } }; @@ -277,7 +277,7 @@ static const struct camss_subdev_resources vfe_res_8x96= [] =3D { { 0 } }, .reg =3D { "vfe0" }, .interrupt =3D { "vfe0" }, - .line_num =3D VFE_LINE_NUM_GEN1, + .line_num =3D 3, .ops =3D &vfe_ops_4_7 }, =20 @@ -297,7 +297,7 @@ static const struct camss_subdev_resources vfe_res_8x96= [] =3D { { 0 } }, .reg =3D { "vfe1" }, .interrupt =3D { "vfe1" }, - .line_num =3D VFE_LINE_NUM_GEN1, + .line_num =3D 3, .ops =3D &vfe_ops_4_7 } }; @@ -467,7 +467,7 @@ static const struct camss_subdev_resources vfe_res_660[= ] =3D { { 0 } }, .reg =3D { "vfe0" }, .interrupt =3D { "vfe0" }, - .line_num =3D VFE_LINE_NUM_GEN1, + .line_num =3D 3, .ops =3D &vfe_ops_4_8 }, =20 @@ -490,7 +490,7 @@ static const struct camss_subdev_resources vfe_res_660[= ] =3D { { 0 } }, .reg =3D { "vfe1" }, .interrupt =3D { "vfe1" }, - .line_num =3D VFE_LINE_NUM_GEN1, + .line_num =3D 3, .ops =3D &vfe_ops_4_8 } }; @@ -657,7 +657,7 @@ static const struct camss_subdev_resources vfe_res_845[= ] =3D { { 384000000 } }, .reg =3D { "vfe0" }, .interrupt =3D { "vfe0" }, - .line_num =3D VFE_LINE_NUM_GEN2, + .line_num =3D 4, .ops =3D &vfe_ops_170 }, =20 @@ -679,7 +679,7 @@ static const struct camss_subdev_resources vfe_res_845[= ] =3D { { 384000000 } }, .reg =3D { "vfe1" }, .interrupt =3D { "vfe1" }, - .line_num =3D VFE_LINE_NUM_GEN2, + .line_num =3D 4, .ops =3D &vfe_ops_170 }, =20 @@ -700,7 +700,7 @@ static const struct camss_subdev_resources vfe_res_845[= ] =3D { { 384000000 } }, .reg =3D { "vfe_lite" }, .interrupt =3D { "vfe_lite" }, - .line_num =3D VFE_LINE_NUM_GEN2, + .line_num =3D 4, .ops =3D &vfe_ops_170 } }; @@ -839,7 +839,7 @@ static const struct camss_subdev_resources vfe_res_8250= [] =3D { { 0 } }, .reg =3D { "vfe0" }, .interrupt =3D { "vfe0" }, - .line_num =3D 4, + .line_num =3D 3, .ops =3D &vfe_ops_480 }, /* VFE1 */ @@ -859,7 +859,7 @@ static const struct camss_subdev_resources vfe_res_8250= [] =3D { { 0 } }, .reg =3D { "vfe1" }, .interrupt =3D { "vfe1" }, - .line_num =3D 4, + .line_num =3D 3, .ops =3D &vfe_ops_480 }, /* VFE2 (lite) */ --=20 2.41.0