Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1560491rdh; Mon, 25 Sep 2023 17:26:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHYGi8CBW16lCJfRr4+mUgKFW/c1PqySAwuIquv+LktqzuxfdSNIPgGytQXmXKHpMnlegqo X-Received: by 2002:a05:6808:1522:b0:3a9:9bb4:485c with SMTP id u34-20020a056808152200b003a99bb4485cmr13018381oiw.8.1695688017025; Mon, 25 Sep 2023 17:26:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695688016; cv=none; d=google.com; s=arc-20160816; b=PKe1lA94M/4nNGuqNRHyKujlCaX3nS2fl8C3bP1Od9ed1NAZZpAWih406ZBHU/YGzT +OLVQqKOS3/q4jUOUlnGEWhN5lXhqpn+FGv+Kg6wO68jCIZz/aEy3QZO3ZHGvU2uvD13 lWfM9J83VCrppjXH2+etGHRWol8Ohkek+CMBg0xChM+TEYKOPy0z9Sto45dpuPMoOV5L GU91RwTgXoK8awJCpv566ivAkKP5zZdhWwcTKkdBo78hCcAiv9/kjMMkokRfbcpz53jT 7ma1bUg2pY0CDH2hFIGh3xvdAw2MbSxlC3J/OTEYQf5ee5ZQGP1xbRHjoj0B9NzwOYmJ 1/2w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XhSKtn1WWoetbFcEPefpk8WL/CMtB2nONd2TgD1HTnc=; fh=YrDxnoZE2zu1w4A5O/pMyb6W2NB5EAkKDOR3m7KPwy0=; b=RTSFwnMNO+axU38KlnVJtFeVzp5f9cEM5UuZ0iZ8EoLKb2q6hsDZ9rvJxFBa+AMUYe SU84wCaxiAnEZU1Ofe50X6aUjzFvC169eDfRUgr400L+UPo8Ubp3bPF6CQzSyFqxeJvo tlkkSXZZ+9is6qzBwKxTju/gDBD1QllhptbVr7aMN/Zr8MXh3k7Up4wX5RH/MIldcPR3 ZrELSOoD1K/cXorxnIixTsX+o0KshlHvE9GGvdPOek5o0bxoYQffPzOkVotZhJaoJQ3W 1oHDVXxHv1B7Jl29F2l5MW0vNr6Wgnc3uMtyh+5d3Ta6mWmPGYpMnXjiIHXnRjWPdJC7 W5zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a+qYhljL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id ei16-20020a056a0080d000b00690c1e51cdfsi10571042pfb.188.2023.09.25.17.26.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 17:26:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a+qYhljL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 5DB5580D6A16; Mon, 25 Sep 2023 08:48:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232946AbjIYPrq (ORCPT + 99 others); Mon, 25 Sep 2023 11:47:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231464AbjIYPrd (ORCPT ); Mon, 25 Sep 2023 11:47:33 -0400 Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AEC11B0 for ; Mon, 25 Sep 2023 08:47:21 -0700 (PDT) Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40572aeb6d0so31600275e9.1 for ; Mon, 25 Sep 2023 08:47:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695656839; x=1696261639; 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=XhSKtn1WWoetbFcEPefpk8WL/CMtB2nONd2TgD1HTnc=; b=a+qYhljL1C/V066XBe5dZ7FqjupeM+qrarX+trLPW9j+kyO1yoRxCMQfHK1vn8USlR d2Hq/16C3cJ1KmEym1zi8vgJbVRQwsWIJC4PTP/+WZAaPRyYTkq0iP3hAiZm8fJ90+kZ qxZTpcrevIV3WUnakufumRaGJnBBNRLRnGECHb+cn2DClVBt++88c67zabJ4Ly3QNnzx lYiyw1dplBHSyC1DAnMK8oBTxhe16BeKSbsezaDL47s1zkgxODiu3TLvCOytVoXcusop ss+7n+5+uktxBNDVANe1h04qz+3grk91vaztPwaWl2NDyxiD/wEtmrgHUsYJPCKKB/u1 kWJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695656840; x=1696261640; 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=XhSKtn1WWoetbFcEPefpk8WL/CMtB2nONd2TgD1HTnc=; b=Win3F9BDoqxVTrdJzV6WSzbi5IGT+IJ2kqgCEAT0yU+DCLbFZx9ZfTNBJcyq0mFoT+ mW/8SW13lJgNhyuz64lFNEcrwcV8x9QQnoCDAvKI1RIkA3sjvOyAu9PqQG6lzWS2sYaL +UJx0MT/XYoIakGeCy86fA/FMcFtFP357Y68bO/KLWBNgluKbhmC+c0b8mAP0PzAnm4l boVYys8gsDfj1iJW3dkB4nFCanFVWOuS9/qRn5foyN6R7FGLGrE7mGtUcNrA43ZFhIci 9PUp7I7HdcK7fvQOMPEWQfBKo9Ykuq+B35Uw3o+mNyfULY9pogCrcG0w6zT4iGZgkAWP wJow== X-Gm-Message-State: AOJu0YwUy1Wtmh/Ig7AgXtcwcxFyvZGLJkL3PtU2i1ybDvG4tqVmuXjq BX0B3ZxYOvYzUfk9GiFtoUU7iQ== X-Received: by 2002:a5d:6382:0:b0:319:8c35:378 with SMTP id p2-20020a5d6382000000b003198c350378mr6188318wru.44.1695656839745; Mon, 25 Sep 2023 08:47:19 -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 d4-20020adffd84000000b0031f34a395e7sm12077536wrr.45.2023.09.25.08.47.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 08:47:19 -0700 (PDT) From: Bryan O'Donoghue To: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, hverkuil@xs4all.nl, laurent.pinchart@ideasonboard.com, rfoss@kernel.org, todor.too@gmail.com, agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, mchehab@kernel.org, sakari.ailus@linux.intel.com, andrey.konovalov@linaro.org Cc: linux-kernel@vger.kernel.org, Bryan O'Donoghue Subject: [RESEND PATCH v6 08/17] media: qcom: camss: Assign the correct number of RDIs per VFE Date: Mon, 25 Sep 2023 16:46:58 +0100 Message-ID: <20230925154707.837542-9-bryan.odonoghue@linaro.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230925154707.837542-1-bryan.odonoghue@linaro.org> References: <20230925154707.837542-1-bryan.odonoghue@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 25 Sep 2023 08:48:07 -0700 (PDT) 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 = 0, VFE_LINE_RDI1 = 1, VFE_LINE_RDI2 = 2, - VFE_LINE_NUM_GEN2 = 3, VFE_LINE_PIX = 3, - VFE_LINE_NUM_GEN1 = 4, VFE_LINE_NUM_MAX = 4 }; diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/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[] = { { 0 } }, .reg = { "vfe0" }, .interrupt = { "vfe0" }, - .line_num = VFE_LINE_NUM_GEN1, + .line_num = 3, .ops = &vfe_ops_4_1 } }; @@ -277,7 +277,7 @@ static const struct camss_subdev_resources vfe_res_8x96[] = { { 0 } }, .reg = { "vfe0" }, .interrupt = { "vfe0" }, - .line_num = VFE_LINE_NUM_GEN1, + .line_num = 3, .ops = &vfe_ops_4_7 }, @@ -297,7 +297,7 @@ static const struct camss_subdev_resources vfe_res_8x96[] = { { 0 } }, .reg = { "vfe1" }, .interrupt = { "vfe1" }, - .line_num = VFE_LINE_NUM_GEN1, + .line_num = 3, .ops = &vfe_ops_4_7 } }; @@ -467,7 +467,7 @@ static const struct camss_subdev_resources vfe_res_660[] = { { 0 } }, .reg = { "vfe0" }, .interrupt = { "vfe0" }, - .line_num = VFE_LINE_NUM_GEN1, + .line_num = 3, .ops = &vfe_ops_4_8 }, @@ -490,7 +490,7 @@ static const struct camss_subdev_resources vfe_res_660[] = { { 0 } }, .reg = { "vfe1" }, .interrupt = { "vfe1" }, - .line_num = VFE_LINE_NUM_GEN1, + .line_num = 3, .ops = &vfe_ops_4_8 } }; @@ -657,7 +657,7 @@ static const struct camss_subdev_resources vfe_res_845[] = { { 384000000 } }, .reg = { "vfe0" }, .interrupt = { "vfe0" }, - .line_num = VFE_LINE_NUM_GEN2, + .line_num = 4, .ops = &vfe_ops_170 }, @@ -679,7 +679,7 @@ static const struct camss_subdev_resources vfe_res_845[] = { { 384000000 } }, .reg = { "vfe1" }, .interrupt = { "vfe1" }, - .line_num = VFE_LINE_NUM_GEN2, + .line_num = 4, .ops = &vfe_ops_170 }, @@ -700,7 +700,7 @@ static const struct camss_subdev_resources vfe_res_845[] = { { 384000000 } }, .reg = { "vfe_lite" }, .interrupt = { "vfe_lite" }, - .line_num = VFE_LINE_NUM_GEN2, + .line_num = 4, .ops = &vfe_ops_170 } }; @@ -839,7 +839,7 @@ static const struct camss_subdev_resources vfe_res_8250[] = { { 0 } }, .reg = { "vfe0" }, .interrupt = { "vfe0" }, - .line_num = 4, + .line_num = 3, .ops = &vfe_ops_480 }, /* VFE1 */ @@ -859,7 +859,7 @@ static const struct camss_subdev_resources vfe_res_8250[] = { { 0 } }, .reg = { "vfe1" }, .interrupt = { "vfe1" }, - .line_num = 4, + .line_num = 3, .ops = &vfe_ops_480 }, /* VFE2 (lite) */ -- 2.42.0