Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp971413rdg; Fri, 11 Aug 2023 06:05:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGMF7yfTF6sTyhnmTRYLuMUluoXdew0mhWrCj/K4h27KmoOYWXevSmjMQx26g2SnZIBiw0K X-Received: by 2002:a17:906:314c:b0:99b:64d0:f6c8 with SMTP id e12-20020a170906314c00b0099b64d0f6c8mr1490225eje.50.1691759131962; Fri, 11 Aug 2023 06:05:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691759131; cv=none; d=google.com; s=arc-20160816; b=sEt2f0o4kH6IXbny1qNDO/Hmk7uZ7S/yhfHSlP8aN1nZakuUyvafXcjG71fooI2o2H v/eBrciosttPUp9r0/8xJiyvRdGd7vk5vz1J/I4+PRgrBIaZ8VDNT5ZZrzJKKML8v1ex hbBkJgOigPtOhDLXiIigGP+L0pKxZKFEhRm0oTgugAumtEnlw+SC8kGbwvJZgZyNbRUx J0P0fsLjd2jd8u3KEO+MAxGFwOlMQ3CdWD8y6H3Fvi4b8fV6BL1GmB1a3dq9TFDAvrg/ Ke/hazOPqdjiz6Grm99PsBww8wFgHGrTAZ3m21LQiDo8MEoCbtaV+lPhA/oQ2Nnejm4a 1FAg== 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=Ekg8d7VnSEmC/9widfKE7c1klznCQGBPRD9AlwjwCNk=; fh=8s3oQmYApjrVjGjnWAug7ZyTHulCW4ZxgX/EauNXgy8=; b=FZaBal2hBbjKsEWQVVvA9rh8GlykD5hvMPZaDE5T9vKBbDM1JQ1R+SFs8IAUfoIV2x JCail/jsMmZwudzBRfnCaHrmLpluZpopJhHpK/98DYtyN5k+1+kIuty06eo9+ORz0Z14 nKPMXlJgcT1i8rFfoB8kqm8O5L/tjlSOmb7u1p2665ULx1B4PfcywQt0zHE2g60d+b8C Jlwb8qXNpgufnAaCiAt6K+6TJdUlZLc6NfOxRzIeKM+vbjqRLKBM7bZWNXKlXY50KI2v /wtd3+Ujd89ISJqCy2AboEKisHYwuzenN1qca9d+bl8Y6j2kD3H28vn9hh/1YLjUsoxz pM3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=luCkbIMv; 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 b3-20020a170906660300b0099b56bacec3si3411487ejp.955.2023.08.11.06.05.05; Fri, 11 Aug 2023 06:05:31 -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=luCkbIMv; 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 S233933AbjHKL4Q (ORCPT + 99 others); Fri, 11 Aug 2023 07:56:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229577AbjHKL4P (ORCPT ); Fri, 11 Aug 2023 07:56:15 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A47BD110 for ; Fri, 11 Aug 2023 04:56:14 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id 2adb3069b0e04-4fe457ec6e7so3046482e87.3 for ; Fri, 11 Aug 2023 04:56:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691754973; x=1692359773; 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=Ekg8d7VnSEmC/9widfKE7c1klznCQGBPRD9AlwjwCNk=; b=luCkbIMvgW4IRGoXPX89ZUU3Gx8kEnm5/2hEsCllbBFMZd8Ff7WtRLHzSF0emKhN08 fgjZELOebZH6vI5GQhzf1Kp6xmSKQRBeWuOgvBGLK1i0F25s//6/A0C0LoSH2OKWhk/F C7QoYlami3klNXzKk1FQiuAOeUCgoXy70wVi9niDpxcA/Ozj3hifS13ewer7F7Krc21X d8EiWRtMMs9DGkoEZroxHqMMmGAnRBwqXAMABr1npvsA9zW1vVdWfL0foqk5vz2hhOdY 6DxeB3Erv1SaUx5tDqzMKv7HihTWbr76LixOTfSagGkbSW20XBvQuItkLJsY56YdLiOR liQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691754973; x=1692359773; 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=Ekg8d7VnSEmC/9widfKE7c1klznCQGBPRD9AlwjwCNk=; b=e7bE+fw/Tb55kC/w+pUn3x6Xaw+uvY8KBuMLl6oA63/wFiq6lEE098cXc+AVNkDdx/ ecG9CTtlBM8BWcjQYrFC7vUtQQbeEOVtKUA5GFQkcV8vqOCTyJF2O+QIsiYpKMWpokEG 7E5+LiCvBea4DwC+MigipM+xhBSAAv7OE62gWYMDQU8UXeYMRce079a53uEAMpq4ENEK 1DszIx9a6mWcTf37j3NFBXI4ni1gHSUtzf7j3JQ4IsIUFuRQ03YBQd2mtOHluOxYPIt+ w99VNdAhuCE1JuE0rlvSPA4A4K0Wp8S/amY8AhUJrIHtq/xhAG+r11KLOrdma3+XzED/ rCOA== X-Gm-Message-State: AOJu0YzhZ45PYv0QUj2nbBBRTJa8D/IURvzUTZva1u5Nh53jSDFU+ZSY a4pSiJN1AqPp1tDXnMxVRfl3xA== X-Received: by 2002:a05:6512:3e3:b0:4f9:5a87:1028 with SMTP id n3-20020a05651203e300b004f95a871028mr1068758lfq.30.1691754972916; Fri, 11 Aug 2023 04:56:12 -0700 (PDT) Received: from [192.168.1.101] (abyj188.neoplus.adsl.tpnet.pl. [83.9.29.188]) by smtp.gmail.com with ESMTPSA id l25-20020ac24319000000b004fe0c0235ddsm704728lfh.143.2023.08.11.04.56.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Aug 2023 04:56:12 -0700 (PDT) Message-ID: <838c5cb2-8dc8-4214-b8ba-54649ca8c6d3@linaro.org> Date: Fri, 11 Aug 2023 13:56:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] media: venus: pm_helpers: Unify v3 and v4 venc/vdec_get Content-Language: en-US To: Bryan O'Donoghue , Stanimir Varbanov , Vikash Garodia , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab Cc: Marijn Suijten , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230811-topic-venus_dedup-v1-1-c4b4af499ef2@linaro.org> <85603f46-6520-6afa-1560-9ccd171475d8@linaro.org> From: Konrad Dybcio Autocrypt: addr=konrad.dybcio@linaro.org; keydata= xsFNBF9ALYUBEADWAhxdTBWrwAgDQQzc1O/bJ5O7b6cXYxwbBd9xKP7MICh5YA0DcCjJSOum BB/OmIWU6X+LZW6P88ZmHe+KeyABLMP5s1tJNK1j4ntT7mECcWZDzafPWF4F6m4WJOG27kTJ HGWdmtO+Rv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8Bs9jy0wQYezNzqS+FxoNXmDQg2jetX8en4bO2Di7Pmx0jXA4TOb9TM izWDgYvmBE8= In-Reply-To: <85603f46-6520-6afa-1560-9ccd171475d8@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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,URIBL_BLOCKED autolearn=unavailable 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 11.08.2023 13:52, Bryan O'Donoghue wrote: > On 11/08/2023 12:12, Konrad Dybcio wrote: >> They do the same thing, except v3 and earlier are expected to have the >> old style of bindings (i.e. core clock per core under video-enc/decoder >> subnode). >> >> Unify them to stop duplicating needlessly. >> >> Signed-off-by: Konrad Dybcio >> --- >>   drivers/media/platform/qcom/venus/pm_helpers.c | 34 ++++++++------------------ >>   1 file changed, 10 insertions(+), 24 deletions(-) >> >> diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c >> index 48c9084bb4db..83d1e68bb9ca 100644 >> --- a/drivers/media/platform/qcom/venus/pm_helpers.c >> +++ b/drivers/media/platform/qcom/venus/pm_helpers.c >> @@ -295,6 +295,8 @@ static int core_get_v1(struct venus_core *core) >>   { >>       int ret; >>   +    legacy_binding = true; >> + >>       ret = core_clks_get(core); >>       if (ret) >>           return ret; >> @@ -349,6 +351,9 @@ static int vdec_get_v3(struct device *dev) >>   { >>       struct venus_core *core = dev_get_drvdata(dev); >>   +    if (!legacy_binding) >> +        return 0; >> + >>       return vcodec_clks_get(core, dev, core->vcodec0_clks, >>                      core->res->vcodec0_clks); >>   } >> @@ -374,6 +379,9 @@ static int venc_get_v3(struct device *dev) >>   { >>       struct venus_core *core = dev_get_drvdata(dev); >>   +    if (!legacy_binding) >> +        return 0; >> + >>       return vcodec_clks_get(core, dev, core->vcodec1_clks, >>                      core->res->vcodec1_clks); >>   } >> @@ -764,17 +772,6 @@ static int coreid_power_v4(struct venus_inst *inst, int on) >>       return ret; >>   } >>   -static int vdec_get_v4(struct device *dev) >> -{ >> -    struct venus_core *core = dev_get_drvdata(dev); >> - >> -    if (!legacy_binding) >> -        return 0; >> - >> -    return vcodec_clks_get(core, dev, core->vcodec0_clks, >> -                   core->res->vcodec0_clks); >> -} >> - >>   static void vdec_put_v4(struct device *dev) >>   { >>       struct venus_core *core = dev_get_drvdata(dev); >> @@ -809,17 +806,6 @@ static int vdec_power_v4(struct device *dev, int on) >>       return ret; >>   } >>   -static int venc_get_v4(struct device *dev) >> -{ >> -    struct venus_core *core = dev_get_drvdata(dev); >> - >> -    if (!legacy_binding) >> -        return 0; >> - >> -    return vcodec_clks_get(core, dev, core->vcodec1_clks, >> -                   core->res->vcodec1_clks); >> -} >> - >>   static void venc_put_v4(struct device *dev) >>   { >>       struct venus_core *core = dev_get_drvdata(dev); >> @@ -1180,10 +1166,10 @@ static const struct venus_pm_ops pm_ops_v4 = { >>       .core_get = core_get_v4, >>       .core_put = core_put_v4, >>       .core_power = core_power_v4, >> -    .vdec_get = vdec_get_v4, >> +    .vdec_get = vdec_get_v3, >>       .vdec_put = vdec_put_v4, >>       .vdec_power = vdec_power_v4, >> -    .venc_get = venc_get_v4, >> +    .venc_get = venc_get_v3, >>       .venc_put = venc_put_v4, >>       .venc_power = venc_power_v4, >>       .coreid_power = coreid_power_v4, >> >> --- >> base-commit: 21ef7b1e17d039053edaeaf41142423810572741 >> change-id: 20230811-topic-venus_dedup-08f183d3a611 >> >> Best regards, > > This makes sense. > > It'd be nice to get rid of the top-level static bool and bury it in the core venus structure but, that's not a problem with your patch. That's the plan, just that untangling this mess will take some time Konrad