Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1616552rwb; Fri, 28 Jul 2023 12:06:09 -0700 (PDT) X-Google-Smtp-Source: APBJJlEzK1oXdCJzbO8iZWhFw6itckh0j6Utn93f8t3xsja9AqH4FlWZSWCZkLOiQx0JJxtB/SeF X-Received: by 2002:a17:90b:384a:b0:268:977d:5253 with SMTP id nl10-20020a17090b384a00b00268977d5253mr1249112pjb.8.1690571168981; Fri, 28 Jul 2023 12:06:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690571168; cv=none; d=google.com; s=arc-20160816; b=MW7cc2xzl5hIOlYnNM2SSJLi2gbEWXrSCpkIAa27Z96DM+BotC8chWuf9CY8nmLKRl I56up/+z0i1QVcys2zxAVf8jdqD1EwPu4tWSldoaROmAaKjO2s/kwoj5JkUx6or41nrY Pf+xdOoLxfX99EqjNg3yaPIx40SVAhDRCYhiiNmxk6dQz1y2V+n8XLLW8gT/Bo9fJHyo rZypKevg6opvyfSVYhxshMpC3y3zXM0PNFjkRw3M5yVoIPMZju6C2nV4EOEAsRBALaSb 4MKYxHnU5+i6kX81XL2gNgMK6noIOAwqggivTG8GYhOT+1gJ0TR0lreCbB5Ht1fFyxTa 2gQw== 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:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=OB/bj30EnQnr6qTMECfih4Nn+rCyljk2OAQ0K7AzNWE=; fh=nxTtIXp+YeUW0dy9b6eCXd9HvCzACw07E51P+fRCTrE=; b=YkA/gtX3HicTN/gcNSWYT1c0Yv68dIx7jHweNfPmSslo6IIc0Ssg0ekcedE+QniqMh 3tnv1PJsUsyR2b16LMwxoRafRrzHg8ASO+1AzNAZYAPHV45iQ9TZPkdAIYaf4xuPXfD+ JZp1F/2Ao49GhvsKwkzP5lY9KTPcX9Lp9ert1CH78BCAWjzh7+/vgDeVOHgu4zNItlFH c0EFCaEBx/p05u/bDCuL2DdGMg9cm4pjblB/IpWF17vS6SjU7nsx7+F/X6R1B/QDBmLc +pZw+7Qqukw6QNsfytU+FCGYRZMRNnKNiCd9cF46OR+cBXx0lKvb6YMeFjbLXoKOaDid cUPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sgkyoIIx; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f4-20020a17090a700400b00267fbd6ee69si653945pjk.38.2023.07.28.12.05.56; Fri, 28 Jul 2023 12:06:08 -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=@linaro.org header.s=google header.b=sgkyoIIx; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235703AbjG1SOF (ORCPT + 99 others); Fri, 28 Jul 2023 14:14:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233673AbjG1SOE (ORCPT ); Fri, 28 Jul 2023 14:14:04 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60381268B for ; Fri, 28 Jul 2023 11:13:55 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2b962c226ceso36650991fa.3 for ; Fri, 28 Jul 2023 11:13:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690568033; x=1691172833; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=OB/bj30EnQnr6qTMECfih4Nn+rCyljk2OAQ0K7AzNWE=; b=sgkyoIIxxj+BiKxTUEpniRyHaGqsstpWOTmwkVKFUNAqtP4tLHT8ZRHBpUu8PKmTNa fvFhKwPbOw0bafwB1vOtaVPui1FeDZwTt4gT9trORHRUgq+ACJ0e7enxDL0CjC4EzfVt fWqQ1CISQyFxPZ8tORBha8debkONk4Nj9p/Hzh/ACPLTd+/87oAOCPiGjZhZQnRGcaQX hc2cXUD546s8ED0lYDuHnnkGiSDwznkW1VUudgeVkhCVNGyR7encM/+zEQapwokUyZyI 1doqxWmH7PN1kxCPNA+DRYpjmpy4FNY+y5AhUpxbLWRIij3ADQAHOk/OQvW681v9P0R5 zvMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690568033; x=1691172833; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=OB/bj30EnQnr6qTMECfih4Nn+rCyljk2OAQ0K7AzNWE=; b=R+gx3585OmvP6Q7Ui/ry9cye69RhbEzBlfhPV/TMisgYb73Gwf32k6Oe/FVzVzrM51 WaGu3OJrG4nI9+atrjGnzcn59TyxeOh10Jc+Ir60T2Wa7AJgWcZEmR2rYYJFHVak5ada DZObCztBxyP1vwz8G2YNuMZAYqHMPYd4VkkRWCuuV5e9WANC10vQvxmwDgywHUxWyQf1 oQELO5P6jzee2Tuu7k+2QsA0XgD6T4MZwOGTKRLhCsmmvXnGKRgMAcntpIqcK+qEIJcE 8eS55rKJkqsLHvnetq+NEf8lpfgax7lnL/hG1IMkOfBKpLL1vXpkbQolrkY46Kdaohrr wYzQ== X-Gm-Message-State: ABy/qLbqnZu/Fumqg04meaCPQhrAvk3cFLPQErWQincZ+IQnfb+iFrpR U4jdn0JCuAwoloRLVwvohrHhBA== X-Received: by 2002:a05:6512:3b13:b0:4fe:c53:1824 with SMTP id f19-20020a0565123b1300b004fe0c531824mr3270765lfv.40.1690568033641; Fri, 28 Jul 2023 11:13:53 -0700 (PDT) Received: from [192.168.1.101] (abyk53.neoplus.adsl.tpnet.pl. [83.9.30.53]) by smtp.gmail.com with ESMTPSA id z5-20020ac24f85000000b004fb74dbbd98sm915772lfs.246.2023.07.28.11.13.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 28 Jul 2023 11:13:53 -0700 (PDT) Message-ID: Date: Fri, 28 Jul 2023 20:13:51 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 32/33] iris: variant: iris3: implement logic to compute clock frequency Content-Language: en-US To: Vikash Garodia , stanimir.k.varbanov@gmail.com, agross@kernel.org, andersson@kernel.org, mchehab@kernel.org, hans.verkuil@cisco.com, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: quic_dikshita@quicinc.com References: <1690550624-14642-1-git-send-email-quic_vgarodia@quicinc.com> <1690550624-14642-33-git-send-email-quic_vgarodia@quicinc.com> From: Konrad Dybcio Autocrypt: addr=konrad.dybcio@linaro.org; keydata= xsFNBF9ALYUBEADWAhxdTBWrwAgDQQzc1O/bJ5O7b6cXYxwbBd9xKP7MICh5YA0DcCjJSOum BB/OmIWU6X+LZW6P88ZmHe+KeyABLMP5s1tJNK1j4ntT7mECcWZDzafPWF4F6m4WJOG27kTJ HGWdmtO+RvadOVi6CoUDqALsmfS3MUG5Pj2Ne9+0jRg4hEnB92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Pmx0jXA4TOb9TM izWDgYvmBE8= In-Reply-To: <1690550624-14642-33-git-send-email-quic_vgarodia@quicinc.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 28.07.2023 15:23, Vikash Garodia wrote: > From: Dikshita Agarwal > > This implements the logic to computer the required clock frequency > by encoder or decoder for a specific usecase. It considers the input > as various parameters configured by client for that usecase. > > Signed-off-by: Dikshita Agarwal > Signed-off-by: Vikash Garodia > --- > .../iris/variant/iris3/src/msm_vidc_clock_iris3.c | 627 +++++++++++++++++++++ > 1 file changed, 627 insertions(+) > create mode 100644 drivers/media/platform/qcom/iris/variant/iris3/src/msm_vidc_clock_iris3.c > > diff --git a/drivers/media/platform/qcom/iris/variant/iris3/src/msm_vidc_clock_iris3.c b/drivers/media/platform/qcom/iris/variant/iris3/src/msm_vidc_clock_iris3.c > new file mode 100644 > index 0000000..6665aef > --- /dev/null > +++ b/drivers/media/platform/qcom/iris/variant/iris3/src/msm_vidc_clock_iris3.c > @@ -0,0 +1,627 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* > + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. > + */ > + > +#include "msm_vidc_debug.h" > + > +#define ENABLE_FINEBITRATE_SUBUHD60 0 > +#include "perf_static_model.h" > + > +/* > + * Chipset Generation Technology: SW/FW overhead profiling > + * need update with new numbers > + */ > +static u32 frequency_table_iris3[2][6] = { I think it's the third repetition of the same (ftbl + OPP) > + /* //make lowsvs_D1 as invalid; */ > + {533, 444, 366, 338, 240, 0}, > + {800, 666, 549, 507, 360, 0}, > +}; > + > + /* Tensilica cycles */ > +#define DECODER_VPP_FW_OVERHEAD_IRIS3 66234 > + > +/* Tensilica cycles; this is measured in Lahaina 1stage with FW profiling */ Is it gonna differ for other SoCs? Especially that 8350 has IRIS2? > +#define DECODER_VPPVSP1STAGE_FW_OVERHEAD_IRIS3 93000 > + > +#define DECODER_VSP_FW_OVERHEAD_IRIS3 \ > + (DECODER_VPPVSP1STAGE_FW_OVERHEAD_IRIS3 - DECODER_VPP_FW_OVERHEAD_IRIS3) > + > +/* Tensilica cycles; encoder has ARP register */ > +#define ENCODER_VPP_FW_OVERHEAD_IRIS3 48405 > + > +#define ENCODER_VPPVSP1STAGE_FW_OVERHEAD_IRIS3 \ > + (ENCODER_VPP_FW_OVERHEAD_IRIS3 + DECODER_VSP_FW_OVERHEAD_IRIS3) > + > +#define DECODER_SW_OVERHEAD_IRIS3 489583 > +#define ENCODER_SW_OVERHEAD_IRIS3 489583 > + > +/* Video IP Core Technology: pipefloor and pipe penlaty */ > +static u32 decoder_vpp_target_clk_per_mb_iris3 = 200; Why is this a variable? [...] > + > +/* 8KUHD60; UHD240; 1080p960 with B */ > +static u32 fp_pixel_count_bar0 = 3840 * 2160 * 240; > +/* 8KUHD60; UHD240; 1080p960 without B */ > +static u32 fp_pixel_count_bar1 = 3840 * 2160 * 240; Not sure what the 'B' is, but the entries are the same. And looks like there's: - no need for it to be a variable - maybe you could make this a macro or just a simple multiplication [...] > +u32 get_bitrate_entry(u32 pixle_count) pixle -> pixel, checkpatch should point out typos [...] > +static int calculate_vsp_min_freq(struct api_calculation_input codec_input, > + struct api_calculation_freq_output *codec_output) > +{ > + /* > + * VSP calculation > + * different methodology from Lahaina > + */ Not sure if that comment is useful to the reader. [...] > + > +static u32 calculate_pipe_penalty(struct api_calculation_input codec_input) > +{ > + u32 pipe_penalty_codec = 0; > + > + /* decoder */ > + if (codec_input.decoder_or_encoder == CODEC_DECODER) > + pipe_penalty_codec = pipe_penalty_iris3[0][0]; > + else > + pipe_penalty_codec = 101; Add a define for this magic number? Also, return the value instead of assigning it and doing the same Konrad