From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DB132FD694 for ; Tue, 3 Feb 2026 23:26:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770161206; cv=none; b=rcxkiiX0CkZBibp8HqTUY4LMeDitIHKk1GFE3OzDXD/aarZFuM9rCgWAUFUZ6PIYY3X4/nAktKh1ZHzm7QnTatM3QDO5y/xzfqiMYwQ/SocKD7P9FpMSibHeJx4q3Bry5OClRVonddQ5icQcYYhaOE7fZJXVOmUKs6bg36Rg2Bg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770161206; c=relaxed/simple; bh=JDYCeisgg5aZVwzbn4acHjDfSOtvsMosCHQV7abm4ik=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=UA97cO/WALHVS91FMdPovZ3wwRVPtYkO/Oq0G0ZpBdqO0cDqreQcCvbvGjkCet4T8aYsDY7JSo7Y7foaPn5R3nYUprOWURf8mTfEpEz70jgdGl8Z8Nbm9eOfJ5alHjg3N1TVSRLnzMQZ8kGXxlCVZZ8+dU7pts0aDYFAER9r1Tw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=jFvJ6y6N; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="jFvJ6y6N" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4806dffc64cso1174755e9.1 for ; Tue, 03 Feb 2026 15:26:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770161203; x=1770766003; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=4tOMpWAco5NL2cPjWFFGjdWexXwfjBlWZysiwEErnHs=; b=jFvJ6y6N1WaMqstfqy0JlluauEXfN3jsVlA0tAT8eOXFVcv0s+z530c+ckBz3HPMlz PwxjtYkXwgXN52Iy7EHJbw2DHOrbOhIwmMbinUT8BPlJ34goKqvfL4TpjWEU07JMshAI pu5JbSPneWU9v2Yce7QzmJNToE16tsoK+abd8nEch3ogzXtPD0MfOmnEkncn5/MyLfm2 URfAfyUyb63F4cLvOpRdILhoDcMP16Pernk5df49o7jZoEkIPwHUOjIBR8+ES7BblFlM HBSIVOYndSQZqcTMhvRGrcUMCNH3VM3eTupLoONkG4fSIxx/4qcTai+E8roamLPfAJj0 il9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770161203; x=1770766003; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4tOMpWAco5NL2cPjWFFGjdWexXwfjBlWZysiwEErnHs=; b=NccBZtoVZchBNkW3JUojehFVsPXsGuQSogcY+0zeXJP1FNKbdEwneQlst/BF/QR54C HAjg0wGzhhVOuKu3kdT+6NgXVcD4vMiogXUhjD043TtW0maK1v2P3q8m2f/9T2D87krX uRaprBVprjRcZ0DaR7zO82uSVCDBCocHRrqPf6/7jIyKck1R5URnsCM2qGuhUMCpZcEw zdq+M+c6yloENS/egJKXrcy/w98c+Ps2Jnp2yvGw9JF0eS0cNHlgApNuAw+Hdioe938k AVi5c0Ul5tqcldGQN2GOBY3AM6Vfj5vIeITSZKJBlRL4XedYmwGMBmKBaEF4pcGS8vYg V5hg== X-Forwarded-Encrypted: i=1; AJvYcCWJ3dswtW9hHR82TIjdAfwHfWq27o/xS3SUZRyPF8+L+pzncFrK1IkOSSIbTu8T8Ctnq557u0OzKSDN9iE=@vger.kernel.org X-Gm-Message-State: AOJu0YwtGDT6rud0bC7w5akggrTViCxbnawSU0xTjl7qbPxSC9g8fLnw f1FWaIUzTVLWtWA5POPv/3iFjo6/ab7ynyUkmidF+y2Uo7nvoufsCrc237E7r6yJr4A= X-Gm-Gg: AZuq6aJob02dxL+ojpGV28/+c9ycaaOMOWoIWRzA5g9eQPwq7bhph6EFt+/ng8pGyJf JsCI1ONp811OmKMoa836PWO7TWC3Mokk1J6q+epbCSOB6XarK8+Ioi+oB87hXcUV6F/lPDTp+4V q8TwbIerwlByWYfx1kJh4IaobztfBER2151H+MnzBZPa5E2JeWwD8CPB6q7/VnZ0brzHoO6go2g hXAMUXe/9NNmmVDai2PStWUJBus3LNQ2LF9WJ97KysDrh71SCPoBOTdkiGOSNA7+NbjvMCWNlDu VMhgejjNKv0jRX+7QCiYUgX+/idr0nXCl0nO86z1p8oVsrNlT2T6ZuEXzx/TA4j06egfmVnnb1i Z+nWx9/++qCpXM/OWcAt7jvrv75UouBG/dXGzmAlaHUgci2sCdbMol5pdgzmZBPv/fT2z7UReQd JXFEHcl4130auIl8EHPcr89voE8oDgU4/MDePhg255e6MDmkzrYSEzw3P+iDfiBhs= X-Received: by 2002:a05:600c:354f:b0:47e:e2eb:bc22 with SMTP id 5b1f17b1804b1-4830e92457fmr16197645e9.5.1770161202709; Tue, 03 Feb 2026 15:26:42 -0800 (PST) Received: from [192.168.0.40] (188-141-3-146.dynamic.upc.ie. [188.141.3.146]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43617e38fbbsm2437596f8f.13.2026.02.03.15.26.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 Feb 2026 15:26:41 -0800 (PST) Message-ID: Date: Tue, 3 Feb 2026 23:26:33 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 5/8] media: venus: scale MMCX power domain on SM8250 To: Dmitry Baryshkov , Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Taniya Das , Jonathan Marek , Ulf Hansson , "Rafael J. Wysocki" , Vikash Garodia , Dikshita Agarwal , Mauro Carvalho Chehab , Stanimir Varbanov , Abhinav Kumar , Hans Verkuil , Stefan Schmidt , Konrad Dybcio , Bryan O'Donoghue , Dikshita Agarwal Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, linux-media@vger.kernel.org, Mauro Carvalho Chehab References: <20260201-iris-venus-fix-sm8250-v2-0-6f40d2605c89@oss.qualcomm.com> <_7umWxzVDHQ1e4kaoIIeTAMrOKoeuDc7ugiknoM_vrCHqzpXjpw8QWe44KAlf4frFpNY9wFxLs76ZXAP1V9r1A==@protonmail.internalid> <20260201-iris-venus-fix-sm8250-v2-5-6f40d2605c89@oss.qualcomm.com> From: Bryan O'Donoghue Content-Language: en-US In-Reply-To: <20260201-iris-venus-fix-sm8250-v2-5-6f40d2605c89@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 01/02/2026 10:49, Dmitry Baryshkov wrote: > On SM8250 most of the video clocks are powered by the MMCX domain, while > the PLL it powered on by the MX domain. Extend the driver to support > scaling both power domains, while keeping compatibitility with the > existing DTs, which define only the MX domain. > > Fixes: 0aeabfa29a9c ("media: venus: core: add sm8250 DT compatible and resource data") > Signed-off-by: Dmitry Baryshkov > --- > drivers/media/platform/qcom/venus/core.c | 7 ++++++- > drivers/media/platform/qcom/venus/core.h | 1 + > drivers/media/platform/qcom/venus/pm_helpers.c | 8 +++++++- > 3 files changed, 14 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c > index 646dae3407b4..cad2df84ce60 100644 > --- a/drivers/media/platform/qcom/venus/core.c > +++ b/drivers/media/platform/qcom/venus/core.c > @@ -882,6 +882,7 @@ static const struct venus_resources sdm845_res_v2 = { > .vcodec_pmdomains = (const char *[]) { "venus", "vcodec0", "vcodec1" }, > .vcodec_pmdomains_num = 3, > .opp_pmdomain = (const char *[]) { "cx" }, > + .opp_pmdomain_num = 1, > .vcodec_num = 2, > .max_load = 3110400, /* 4096x2160@90 */ > .hfi_version = HFI_VERSION_4XX, > @@ -933,6 +934,7 @@ static const struct venus_resources sc7180_res = { > .vcodec_pmdomains = (const char *[]) { "venus", "vcodec0" }, > .vcodec_pmdomains_num = 2, > .opp_pmdomain = (const char *[]) { "cx" }, > + .opp_pmdomain_num = 1, > .vcodec_num = 1, > .hfi_version = HFI_VERSION_4XX, > .vpu_version = VPU_VERSION_AR50, > @@ -992,7 +994,8 @@ static const struct venus_resources sm8250_res = { > .vcodec_clks_num = 1, > .vcodec_pmdomains = (const char *[]) { "venus", "vcodec0" }, > .vcodec_pmdomains_num = 2, > - .opp_pmdomain = (const char *[]) { "mx" }, > + .opp_pmdomain = (const char *[]) { "mx", "mmcx" }, > + .opp_pmdomain_num = 2, > .vcodec_num = 1, > .max_load = 7833600, > .hfi_version = HFI_VERSION_6XX, > @@ -1054,6 +1057,7 @@ static const struct venus_resources sc7280_res = { > .vcodec_pmdomains = (const char *[]) { "venus", "vcodec0" }, > .vcodec_pmdomains_num = 2, > .opp_pmdomain = (const char *[]) { "cx" }, > + .opp_pmdomain_num = 1, > .vcodec_num = 1, > .hfi_version = HFI_VERSION_6XX, > .vpu_version = VPU_VERSION_IRIS2_1, > @@ -1102,6 +1106,7 @@ static const struct venus_resources qcm2290_res = { > .vcodec_pmdomains = (const char *[]) { "venus", "vcodec0" }, > .vcodec_pmdomains_num = 2, > .opp_pmdomain = (const char *[]) { "cx" }, > + .opp_pmdomain_num = 1, > .vcodec_num = 1, > .hfi_version = HFI_VERSION_4XX, > .vpu_version = VPU_VERSION_AR50_LITE, > diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h > index c7acacaa53b8..62ab747291b8 100644 > --- a/drivers/media/platform/qcom/venus/core.h > +++ b/drivers/media/platform/qcom/venus/core.h > @@ -85,6 +85,7 @@ struct venus_resources { > const char **vcodec_pmdomains; > unsigned int vcodec_pmdomains_num; > const char **opp_pmdomain; > + unsigned int opp_pmdomain_num; > unsigned int vcodec_num; > const char * const resets[VIDC_RESETS_NUM_MAX]; > unsigned int resets_num; > diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c > index f0269524ac70..14a4e8311a64 100644 > --- a/drivers/media/platform/qcom/venus/pm_helpers.c > +++ b/drivers/media/platform/qcom/venus/pm_helpers.c > @@ -887,7 +887,7 @@ static int vcodec_domains_get(struct venus_core *core) > }; > struct dev_pm_domain_attach_data opp_pd_data = { > .pd_names = res->opp_pmdomain, > - .num_pd_names = 1, > + .num_pd_names = res->opp_pmdomain_num, > .pd_flags = PD_FLAG_DEV_LINK_ON | PD_FLAG_REQUIRED_OPP, > }; > > @@ -904,6 +904,12 @@ static int vcodec_domains_get(struct venus_core *core) > > /* Attach the power domain for setting performance state */ > ret = devm_pm_domain_attach_list(dev, &opp_pd_data, &core->opp_pmdomain); > + /* backwards compatibility for incomplete ABI SM8250 */ > + if (ret == -ENODEV && > + of_device_is_compatible(dev->of_node, "qcom,sm8250-venus")) { > + opp_pd_data.num_pd_names--; Setting this to "1" would be a bit clearer IMO - there's no use-case for num_pd_names = 3; num_pd_names--; for example. Its stylistic rather than functional so entirely up to you to keep or change. > + ret = devm_pm_domain_attach_list(dev, &opp_pd_data, &core->opp_pmdomain); > + } > if (ret < 0) > return ret; > > > -- > 2.47.3 > > Reviewed-by: Bryan O'Donoghue