* [PATCH v6 0/7] Support for GPU ACD feature on Adreno X1-85
@ 2025-05-03 7:03 Akhil P Oommen
2025-05-03 7:03 ` [PATCH v6 1/7] drm/msm/adreno: Add support for ACD Akhil P Oommen
` (6 more replies)
0 siblings, 7 replies; 9+ messages in thread
From: Akhil P Oommen @ 2025-05-03 7:03 UTC (permalink / raw)
To: Rob Clark, Sean Paul, Konrad Dybcio, Abhinav Kumar,
Marijn Suijten, David Airlie, Simona Vetter, Viresh Kumar,
Nishanth Menon, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Akhil P Oommen, Bjorn Andersson, Maya Matuszczyk,
Anthony Ruhier, Dmitry Baryshkov
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, linux-pm,
devicetree, Konrad Dybcio, Krzysztof Kozlowski
This series adds support for ACD feature for Adreno GPU which helps to
lower the power consumption on GX rail and also sometimes is a requirement
to enable higher GPU frequencies. At high level, following are the
sequences required for ACD feature:
1. Identify the ACD level data for each regulator corner
2. Send a message to AOSS to switch voltage plan
3. Send a table with ACD level information to GMU during every
gpu wake up
For (1), it is better to keep ACD level data in devicetree because this
value depends on the process node, voltage margins etc which are
chipset specific. For instance, same GPU HW IP on a different chipset
would have a different set of values. So, a new schema which extends
opp-v2 is created to add a new property called "qcom,opp-acd-level".
ACD support is dynamically detected based on the presence of
"qcom,opp-acd-level" property in GPU's opp table. Also, qmp node should be
present under GMU node in devicetree for communication with AOSS.
The devicetree patch in this series adds the acd-level data for X1-85
GPU present in Snapdragon X1 Elite chipset.
The last two devicetree patches are for Bjorn and all the rest for
Rob Clark.
---
Changes in v6:
- Captured code-review trailers
- Link to v5: https://lore.kernel.org/r/20250419-gpu-acd-v5-0-8dbab23569e0@quicinc.com
Changes in v5:
- Rebased on top of 6.15-rc2
- Move 'acd data fix' mentioned in the prev revision to the correct patch
- Make module-param sysfs node read-only (Konrad)
- Apply opp-v2-qcom-adreno schema only on adreno opp table
- Link to v4: https://lore.kernel.org/r/20250109-gpu-acd-v4-0-08a5efaf4a23@quicinc.com
Changes in v4:
- Send correct acd data via hfi (Neil)
- Fix dt-bindings error
- Fix IB vote for the 1.1Ghz OPP
- New patch#2 to fix the HFI timeout error seen when ACD is enabled
- Link to v3: https://lore.kernel.org/r/20241231-gpu-acd-v3-0-3ba73660e9ca@quicinc.com
Changes in v3:
- Rebased on top of v6.13-rc4 since X1E doesn't boot properly with msm-next
- Update patternProperties regex (Krzysztof)
- Update MAINTAINERS file include the new opp-v2-qcom-adreno.yaml
- Update the new dt properties' description
- Do not move qmp_get() to acd probe (Konrad)
- New patches: patch#2, #3 and #6
- Link to v2: https://lore.kernel.org/r/20241021-gpu-acd-v2-0-9c25a62803bc@quicinc.com
Changes in v2:
- Removed RFC tag for the series
- Improve documentation for the new dt bindings (Krzysztof)
- Add fallback compatible string for opp-table (Krzysztof)
- Link to v1: https://lore.kernel.org/r/20241012-gpu-acd-v1-0-1e5e91aa95b6@quicinc.com
---
Akhil P Oommen (7):
drm/msm/adreno: Add support for ACD
drm/msm/a6xx: Increase HFI response timeout
drm/msm: a6x: Rework qmp_get() error handling
drm/msm/adreno: Add module param to disable ACD
dt-bindings: opp: Add v2-qcom-adreno vendor bindings
arm64: dts: qcom: x1e80100: Add ACD levels for GPU
arm64: dts: qcom: x1e80100: Add OPPs up to Turbo L3 for GPU
.../bindings/opp/opp-v2-qcom-adreno.yaml | 96 ++++++++++++++++++++++
MAINTAINERS | 1 +
arch/arm64/boot/dts/qcom/x1e80100.dtsi | 27 +++++-
drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 96 +++++++++++++++++++---
drivers/gpu/drm/msm/adreno/a6xx_gmu.h | 1 +
drivers/gpu/drm/msm/adreno/a6xx_hfi.c | 38 ++++++++-
drivers/gpu/drm/msm/adreno/a6xx_hfi.h | 21 +++++
drivers/gpu/drm/msm/adreno/adreno_device.c | 4 +
8 files changed, 269 insertions(+), 15 deletions(-)
---
base-commit: 8a834b0ac9ceb354a6e0b8cf5b363edca8221bdd
change-id: 20240724-gpu-acd-6c1dc5dcf516
Best regards,
--
Akhil P Oommen <quic_akhilpo@quicinc.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v6 1/7] drm/msm/adreno: Add support for ACD
2025-05-03 7:03 [PATCH v6 0/7] Support for GPU ACD feature on Adreno X1-85 Akhil P Oommen
@ 2025-05-03 7:03 ` Akhil P Oommen
2025-05-03 7:03 ` [PATCH v6 2/7] drm/msm/a6xx: Increase HFI response timeout Akhil P Oommen
` (5 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Akhil P Oommen @ 2025-05-03 7:03 UTC (permalink / raw)
To: Rob Clark, Sean Paul, Konrad Dybcio, Abhinav Kumar,
Marijn Suijten, David Airlie, Simona Vetter, Viresh Kumar,
Nishanth Menon, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Akhil P Oommen, Bjorn Andersson, Maya Matuszczyk,
Anthony Ruhier, Dmitry Baryshkov
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, linux-pm,
devicetree, Konrad Dybcio
ACD a.k.a Adaptive Clock Distribution is a feature which helps to reduce
the power consumption. In some chipsets, it is also a requirement to
support higher GPU frequencies. This patch adds support for GPU ACD by
sending necessary data to GMU and AOSS. The feature support for the
chipset is detected based on devicetree data.
Tested-by: Maya Matuszczyk <maccraft123mc@gmail.com>
Tested-by: Anthony Ruhier <aruhier@mailbox.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
---
drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 84 ++++++++++++++++++++++++++++++-----
drivers/gpu/drm/msm/adreno/a6xx_gmu.h | 1 +
drivers/gpu/drm/msm/adreno/a6xx_hfi.c | 36 +++++++++++++++
drivers/gpu/drm/msm/adreno/a6xx_hfi.h | 21 +++++++++
4 files changed, 132 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
index c8711938a5f4478ea02e7a4b336291c91e591358..6bd6d7c67f98b38cb1d23f926b5e6ccbd7f2ec53 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
@@ -1064,14 +1064,6 @@ int a6xx_gmu_resume(struct a6xx_gpu *a6xx_gpu)
gmu->hung = false;
- /* Notify AOSS about the ACD state (unimplemented for now => disable it) */
- if (!IS_ERR(gmu->qmp)) {
- ret = qmp_send(gmu->qmp, "{class: gpu, res: acd, val: %d}",
- 0 /* Hardcode ACD to be disabled for now */);
- if (ret)
- dev_err(gmu->dev, "failed to send GPU ACD state\n");
- }
-
/* Turn on the resources */
pm_runtime_get_sync(gmu->dev);
@@ -1671,6 +1663,68 @@ static int a6xx_gmu_pwrlevels_probe(struct a6xx_gmu *gmu)
return a6xx_gmu_rpmh_votes_init(gmu);
}
+static int a6xx_gmu_acd_probe(struct a6xx_gmu *gmu)
+{
+ struct a6xx_gpu *a6xx_gpu = container_of(gmu, struct a6xx_gpu, gmu);
+ struct a6xx_hfi_acd_table *cmd = &gmu->acd_table;
+ struct adreno_gpu *adreno_gpu = &a6xx_gpu->base;
+ struct msm_gpu *gpu = &adreno_gpu->base;
+ int ret, i, cmd_idx = 0;
+
+ cmd->version = 1;
+ cmd->stride = 1;
+ cmd->enable_by_level = 0;
+
+ /* Skip freq = 0 and parse acd-level for rest of the OPPs */
+ for (i = 1; i < gmu->nr_gpu_freqs; i++) {
+ struct dev_pm_opp *opp;
+ struct device_node *np;
+ unsigned long freq;
+ u32 val;
+
+ freq = gmu->gpu_freqs[i];
+ opp = dev_pm_opp_find_freq_exact(&gpu->pdev->dev, freq, true);
+ np = dev_pm_opp_get_of_node(opp);
+
+ ret = of_property_read_u32(np, "qcom,opp-acd-level", &val);
+ of_node_put(np);
+ dev_pm_opp_put(opp);
+ if (ret == -EINVAL)
+ continue;
+ else if (ret) {
+ DRM_DEV_ERROR(gmu->dev, "Unable to read acd level for freq %lu\n", freq);
+ return ret;
+ }
+
+ cmd->enable_by_level |= BIT(i);
+ cmd->data[cmd_idx++] = val;
+ }
+
+ cmd->num_levels = cmd_idx;
+
+ /* It is a problem if qmp node is unavailable when ACD is required */
+ if (cmd->enable_by_level && IS_ERR_OR_NULL(gmu->qmp)) {
+ DRM_DEV_ERROR(gmu->dev, "Unable to send ACD state to AOSS\n");
+ return -EINVAL;
+ }
+
+ /* Otherwise, nothing to do if qmp is unavailable */
+ if (IS_ERR_OR_NULL(gmu->qmp))
+ return 0;
+
+ /*
+ * Notify AOSS about the ACD state. AOSS is supposed to assume that ACD is disabled on
+ * system reset. So it is harmless if we couldn't notify 'OFF' state
+ */
+ ret = qmp_send(gmu->qmp, "{class: gpu, res: acd, val: %d}", !!cmd->enable_by_level);
+ if (ret && cmd->enable_by_level) {
+ DRM_DEV_ERROR(gmu->dev, "Failed to send ACD state to AOSS\n");
+ return ret;
+ }
+
+ return 0;
+}
+
static int a6xx_gmu_clocks_probe(struct a6xx_gmu *gmu)
{
int ret = devm_clk_bulk_get_all(gmu->dev, &gmu->clocks);
@@ -1992,7 +2046,7 @@ int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node)
gmu->qmp = qmp_get(gmu->dev);
if (IS_ERR(gmu->qmp) && adreno_is_a7xx(adreno_gpu)) {
ret = PTR_ERR(gmu->qmp);
- goto remove_device_link;
+ goto detach_gxpd;
}
init_completion(&gmu->pd_gate);
@@ -2008,6 +2062,10 @@ int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node)
/* Get the power levels for the GMU and GPU */
a6xx_gmu_pwrlevels_probe(gmu);
+ ret = a6xx_gmu_acd_probe(gmu);
+ if (ret)
+ goto detach_gxpd;
+
/* Set up the HFI queues */
a6xx_hfi_init(gmu);
@@ -2018,7 +2076,13 @@ int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node)
return 0;
-remove_device_link:
+detach_gxpd:
+ if (!IS_ERR_OR_NULL(gmu->gxpd))
+ dev_pm_domain_detach(gmu->gxpd, false);
+
+ if (!IS_ERR_OR_NULL(gmu->qmp))
+ qmp_put(gmu->qmp);
+
device_link_del(link);
detach_cxpd:
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.h b/drivers/gpu/drm/msm/adreno/a6xx_gmu.h
index 0c888b326cfb485400118f3601fa5f1949b03374..b2d4489b40249b1916ab4a42c89e3f4bdc5c4af9 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.h
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.h
@@ -93,6 +93,7 @@ struct a6xx_gmu {
int nr_gpu_freqs;
unsigned long gpu_freqs[GMU_MAX_GX_FREQS];
u32 gx_arc_votes[GMU_MAX_GX_FREQS];
+ struct a6xx_hfi_acd_table acd_table;
int nr_gpu_bws;
unsigned long gpu_bw_table[GMU_MAX_GX_FREQS];
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_hfi.c b/drivers/gpu/drm/msm/adreno/a6xx_hfi.c
index 0989aee3dd2cf9bc3405c3b25a595c22e6f06387..b256092596fbab86d4eb8c17ac7c89cf94827105 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_hfi.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_hfi.c
@@ -748,6 +748,38 @@ static int a6xx_hfi_send_bw_table(struct a6xx_gmu *gmu)
NULL, 0);
}
+#define HFI_FEATURE_ACD 12
+
+static int a6xx_hfi_enable_acd(struct a6xx_gmu *gmu)
+{
+ struct a6xx_hfi_acd_table *acd_table = &gmu->acd_table;
+ struct a6xx_hfi_msg_feature_ctrl msg = {
+ .feature = HFI_FEATURE_ACD,
+ .enable = 1,
+ .data = 0,
+ };
+ int ret;
+
+ if (!acd_table->enable_by_level)
+ return 0;
+
+ /* Enable ACD feature at GMU */
+ ret = a6xx_hfi_send_msg(gmu, HFI_H2F_FEATURE_CTRL, &msg, sizeof(msg), NULL, 0);
+ if (ret) {
+ DRM_DEV_ERROR(gmu->dev, "Unable to enable ACD (%d)\n", ret);
+ return ret;
+ }
+
+ /* Send ACD table to GMU */
+ ret = a6xx_hfi_send_msg(gmu, HFI_H2F_MSG_ACD, acd_table, sizeof(*acd_table), NULL, 0);
+ if (ret) {
+ DRM_DEV_ERROR(gmu->dev, "Unable to ACD table (%d)\n", ret);
+ return ret;
+ }
+
+ return 0;
+}
+
static int a6xx_hfi_send_test(struct a6xx_gmu *gmu)
{
struct a6xx_hfi_msg_test msg = { 0 };
@@ -845,6 +877,10 @@ int a6xx_hfi_start(struct a6xx_gmu *gmu, int boot_state)
if (ret)
return ret;
+ ret = a6xx_hfi_enable_acd(gmu);
+ if (ret)
+ return ret;
+
ret = a6xx_hfi_send_core_fw_start(gmu);
if (ret)
return ret;
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_hfi.h b/drivers/gpu/drm/msm/adreno/a6xx_hfi.h
index 52ba4a07d7b9a709289acd244a751ace9bdaab5d..653ef720e2da4d2b0793c0b76e994b6f6dc524c7 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_hfi.h
+++ b/drivers/gpu/drm/msm/adreno/a6xx_hfi.h
@@ -151,12 +151,33 @@ struct a6xx_hfi_msg_test {
u32 header;
};
+#define HFI_H2F_MSG_ACD 7
+#define MAX_ACD_STRIDE 2
+
+struct a6xx_hfi_acd_table {
+ u32 header;
+ u32 version;
+ u32 enable_by_level;
+ u32 stride;
+ u32 num_levels;
+ u32 data[16 * MAX_ACD_STRIDE];
+};
+
#define HFI_H2F_MSG_START 10
struct a6xx_hfi_msg_start {
u32 header;
};
+#define HFI_H2F_FEATURE_CTRL 11
+
+struct a6xx_hfi_msg_feature_ctrl {
+ u32 header;
+ u32 feature;
+ u32 enable;
+ u32 data;
+};
+
#define HFI_H2F_MSG_CORE_FW_START 14
struct a6xx_hfi_msg_core_fw_start {
--
2.48.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v6 2/7] drm/msm/a6xx: Increase HFI response timeout
2025-05-03 7:03 [PATCH v6 0/7] Support for GPU ACD feature on Adreno X1-85 Akhil P Oommen
2025-05-03 7:03 ` [PATCH v6 1/7] drm/msm/adreno: Add support for ACD Akhil P Oommen
@ 2025-05-03 7:03 ` Akhil P Oommen
2025-05-09 17:05 ` Konrad Dybcio
2025-05-03 7:03 ` [PATCH v6 3/7] drm/msm: a6x: Rework qmp_get() error handling Akhil P Oommen
` (4 subsequent siblings)
6 siblings, 1 reply; 9+ messages in thread
From: Akhil P Oommen @ 2025-05-03 7:03 UTC (permalink / raw)
To: Rob Clark, Sean Paul, Konrad Dybcio, Abhinav Kumar,
Marijn Suijten, David Airlie, Simona Vetter, Viresh Kumar,
Nishanth Menon, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Akhil P Oommen, Bjorn Andersson, Maya Matuszczyk,
Anthony Ruhier, Dmitry Baryshkov
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, linux-pm,
devicetree
When ACD feature is enabled, it triggers some internal calibrations
which result in a pretty long delay during the first HFI perf vote.
So, increase the HFI response timeout to match the downstream driver.
Tested-by: Maya Matuszczyk <maccraft123mc@gmail.com>
Tested-by: Anthony Ruhier <aruhier@mailbox.org>
Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
---
drivers/gpu/drm/msm/adreno/a6xx_hfi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_hfi.c b/drivers/gpu/drm/msm/adreno/a6xx_hfi.c
index b256092596fbab86d4eb8c17ac7c89cf94827105..d0ddae1617c3213a1bb2cb5c18b8653c5c1689e6 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_hfi.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_hfi.c
@@ -109,7 +109,7 @@ static int a6xx_hfi_wait_for_ack(struct a6xx_gmu *gmu, u32 id, u32 seqnum,
/* Wait for a response */
ret = gmu_poll_timeout(gmu, REG_A6XX_GMU_GMU2HOST_INTR_INFO, val,
- val & A6XX_GMU_GMU2HOST_INTR_INFO_MSGQ, 100, 5000);
+ val & A6XX_GMU_GMU2HOST_INTR_INFO_MSGQ, 100, 1000000);
if (ret) {
DRM_DEV_ERROR(gmu->dev,
--
2.48.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v6 3/7] drm/msm: a6x: Rework qmp_get() error handling
2025-05-03 7:03 [PATCH v6 0/7] Support for GPU ACD feature on Adreno X1-85 Akhil P Oommen
2025-05-03 7:03 ` [PATCH v6 1/7] drm/msm/adreno: Add support for ACD Akhil P Oommen
2025-05-03 7:03 ` [PATCH v6 2/7] drm/msm/a6xx: Increase HFI response timeout Akhil P Oommen
@ 2025-05-03 7:03 ` Akhil P Oommen
2025-05-03 7:03 ` [PATCH v6 4/7] drm/msm/adreno: Add module param to disable ACD Akhil P Oommen
` (3 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Akhil P Oommen @ 2025-05-03 7:03 UTC (permalink / raw)
To: Rob Clark, Sean Paul, Konrad Dybcio, Abhinav Kumar,
Marijn Suijten, David Airlie, Simona Vetter, Viresh Kumar,
Nishanth Menon, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Akhil P Oommen, Bjorn Andersson, Maya Matuszczyk,
Anthony Ruhier, Dmitry Baryshkov
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, linux-pm,
devicetree, Konrad Dybcio
Fix the following for qmp_get() errors:
1. Correctly handle probe defer for A6x GPUs
2. Ignore other errors because those are okay when GPU ACD is
not required. They are checked again during gpu acd probe.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Tested-by: Maya Matuszczyk <maccraft123mc@gmail.com>
Tested-by: Anthony Ruhier <aruhier@mailbox.org>
Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
---
drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
index 6bd6d7c67f98b38cb1d23f926b5e6ccbd7f2ec53..48b4ca8894ba38176481b62b7fd1406472369df1 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
@@ -2043,9 +2043,10 @@ int a6xx_gmu_init(struct a6xx_gpu *a6xx_gpu, struct device_node *node)
goto detach_cxpd;
}
+ /* Other errors are handled during GPU ACD probe */
gmu->qmp = qmp_get(gmu->dev);
- if (IS_ERR(gmu->qmp) && adreno_is_a7xx(adreno_gpu)) {
- ret = PTR_ERR(gmu->qmp);
+ if (PTR_ERR_OR_ZERO(gmu->qmp) == -EPROBE_DEFER) {
+ ret = -EPROBE_DEFER;
goto detach_gxpd;
}
--
2.48.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v6 4/7] drm/msm/adreno: Add module param to disable ACD
2025-05-03 7:03 [PATCH v6 0/7] Support for GPU ACD feature on Adreno X1-85 Akhil P Oommen
` (2 preceding siblings ...)
2025-05-03 7:03 ` [PATCH v6 3/7] drm/msm: a6x: Rework qmp_get() error handling Akhil P Oommen
@ 2025-05-03 7:03 ` Akhil P Oommen
2025-05-03 7:03 ` [PATCH v6 5/7] dt-bindings: opp: Add v2-qcom-adreno vendor bindings Akhil P Oommen
` (2 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Akhil P Oommen @ 2025-05-03 7:03 UTC (permalink / raw)
To: Rob Clark, Sean Paul, Konrad Dybcio, Abhinav Kumar,
Marijn Suijten, David Airlie, Simona Vetter, Viresh Kumar,
Nishanth Menon, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Akhil P Oommen, Bjorn Andersson, Maya Matuszczyk,
Anthony Ruhier, Dmitry Baryshkov
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, linux-pm,
devicetree, Konrad Dybcio
Add a module param to disable ACD which will help to quickly rule it
out for any GPU issues.
Tested-by: Maya Matuszczyk <maccraft123mc@gmail.com>
Tested-by: Anthony Ruhier <aruhier@mailbox.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
---
drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 7 +++++++
drivers/gpu/drm/msm/adreno/adreno_device.c | 4 ++++
2 files changed, 11 insertions(+)
diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
index 48b4ca8894ba38176481b62b7fd1406472369df1..38c0f8ef85c3d260864541d83abe43e49c772c52 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
@@ -1670,6 +1670,13 @@ static int a6xx_gmu_acd_probe(struct a6xx_gmu *gmu)
struct adreno_gpu *adreno_gpu = &a6xx_gpu->base;
struct msm_gpu *gpu = &adreno_gpu->base;
int ret, i, cmd_idx = 0;
+ extern bool disable_acd;
+
+ /* Skip ACD probe if requested via module param */
+ if (disable_acd) {
+ DRM_DEV_ERROR(gmu->dev, "Skipping GPU ACD probe\n");
+ return 0;
+ }
cmd->version = 1;
cmd->stride = 1;
diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c b/drivers/gpu/drm/msm/adreno/adreno_device.c
index 236b25c094cd5d462f4b6653de7b7910985cccb6..f5e1490d07c1868fa21cddb38de44c28af5ca0d5 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_device.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_device.c
@@ -24,6 +24,10 @@ int enable_preemption = -1;
MODULE_PARM_DESC(enable_preemption, "Enable preemption (A7xx only) (1=on , 0=disable, -1=auto (default))");
module_param(enable_preemption, int, 0600);
+bool disable_acd;
+MODULE_PARM_DESC(disable_acd, "Forcefully disable GPU ACD");
+module_param_unsafe(disable_acd, bool, 0400);
+
extern const struct adreno_gpulist a2xx_gpulist;
extern const struct adreno_gpulist a3xx_gpulist;
extern const struct adreno_gpulist a4xx_gpulist;
--
2.48.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v6 5/7] dt-bindings: opp: Add v2-qcom-adreno vendor bindings
2025-05-03 7:03 [PATCH v6 0/7] Support for GPU ACD feature on Adreno X1-85 Akhil P Oommen
` (3 preceding siblings ...)
2025-05-03 7:03 ` [PATCH v6 4/7] drm/msm/adreno: Add module param to disable ACD Akhil P Oommen
@ 2025-05-03 7:03 ` Akhil P Oommen
2025-05-03 7:03 ` [PATCH v6 6/7] arm64: dts: qcom: x1e80100: Add ACD levels for GPU Akhil P Oommen
2025-05-03 7:03 ` [PATCH v6 7/7] arm64: dts: qcom: x1e80100: Add OPPs up to Turbo L3 " Akhil P Oommen
6 siblings, 0 replies; 9+ messages in thread
From: Akhil P Oommen @ 2025-05-03 7:03 UTC (permalink / raw)
To: Rob Clark, Sean Paul, Konrad Dybcio, Abhinav Kumar,
Marijn Suijten, David Airlie, Simona Vetter, Viresh Kumar,
Nishanth Menon, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Akhil P Oommen, Bjorn Andersson, Maya Matuszczyk,
Anthony Ruhier, Dmitry Baryshkov
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, linux-pm,
devicetree, Krzysztof Kozlowski
Add a new schema which extends opp-v2 to support a new vendor specific
property required for Adreno GPUs found in Qualcomm's SoCs. The new
property called "qcom,opp-acd-level" carries a u32 value recommended
for each opp needs to be shared to GMU during runtime.
Also, update MAINTAINERS file include the new opp-v2-qcom-adreno.yaml.
Cc: Rob Clark <robdclark@gmail.com>
Tested-by: Maya Matuszczyk <maccraft123mc@gmail.com>
Tested-by: Anthony Ruhier <aruhier@mailbox.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
---
.../bindings/opp/opp-v2-qcom-adreno.yaml | 96 ++++++++++++++++++++++
MAINTAINERS | 1 +
2 files changed, 97 insertions(+)
diff --git a/Documentation/devicetree/bindings/opp/opp-v2-qcom-adreno.yaml b/Documentation/devicetree/bindings/opp/opp-v2-qcom-adreno.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..a27ba7b663d456f964628a91a661b51a684de1be
--- /dev/null
+++ b/Documentation/devicetree/bindings/opp/opp-v2-qcom-adreno.yaml
@@ -0,0 +1,96 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/opp/opp-v2-qcom-adreno.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Adreno compatible OPP supply
+
+description:
+ Adreno GPUs present in Qualcomm's Snapdragon chipsets uses an OPP specific
+ ACD related information tailored for the specific chipset. This binding
+ provides the information needed to describe such a hardware value.
+
+maintainers:
+ - Rob Clark <robdclark@gmail.com>
+
+allOf:
+ - $ref: opp-v2-base.yaml#
+
+properties:
+ compatible:
+ contains:
+ const: operating-points-v2-adreno
+
+patternProperties:
+ '^opp-[0-9]+$':
+ type: object
+ additionalProperties: false
+
+ properties:
+ opp-hz: true
+
+ opp-level: true
+
+ opp-peak-kBps: true
+
+ opp-supported-hw: true
+
+ qcom,opp-acd-level:
+ description: |
+ A positive value representing the ACD (Adaptive Clock Distribution,
+ a fancy name for clk throttling during voltage droop) level associated
+ with this OPP node. This value is shared to a co-processor inside GPU
+ (called Graphics Management Unit a.k.a GMU) during wake up. It may not
+ be present for some OPPs and GMU will disable ACD while transitioning
+ to that OPP. This value encodes a voltage threshold, delay cycles &
+ calibration margins which are identified by characterization of the
+ SoC. So, it doesn't have any unit. This data is passed to GMU firmware
+ via 'HFI_H2F_MSG_ACD' packet.
+ $ref: /schemas/types.yaml#/definitions/uint32
+
+ required:
+ - opp-hz
+ - opp-level
+
+required:
+ - compatible
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/power/qcom-rpmpd.h>
+
+ gpu_opp_table: opp-table {
+ compatible = "operating-points-v2-adreno", "operating-points-v2";
+
+ opp-687000000 {
+ opp-hz = /bits/ 64 <687000000>;
+ opp-level = <RPMH_REGULATOR_LEVEL_SVS_L1>;
+ opp-peak-kBps = <8171875>;
+ qcom,opp-acd-level = <0x882e5ffd>;
+ };
+
+ opp-550000000 {
+ opp-hz = /bits/ 64 <550000000>;
+ opp-level = <RPMH_REGULATOR_LEVEL_SVS>;
+ opp-peak-kBps = <6074219>;
+ qcom,opp-acd-level = <0xc0285ffd>;
+ };
+
+ opp-390000000 {
+ opp-hz = /bits/ 64 <390000000>;
+ opp-level = <RPMH_REGULATOR_LEVEL_LOW_SVS>;
+ opp-peak-kBps = <3000000>;
+ qcom,opp-acd-level = <0xc0285ffd>;
+ };
+
+ opp-300000000 {
+ opp-hz = /bits/ 64 <300000000>;
+ opp-level = <RPMH_REGULATOR_LEVEL_LOW_SVS_D1>;
+ opp-peak-kBps = <2136719>;
+ /* Intentionally left out qcom,opp-acd-level property here */
+ };
+
+ };
diff --git a/MAINTAINERS b/MAINTAINERS
index c59316109e3f8feacf9628fd1065ed551c4250d5..2d055c8135d1e3dbbf29fe9a552ac0ee98a8a2a4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -7512,6 +7512,7 @@ S: Maintained
B: https://gitlab.freedesktop.org/drm/msm/-/issues
T: git https://gitlab.freedesktop.org/drm/msm.git
F: Documentation/devicetree/bindings/display/msm/gpu.yaml
+F: Documentation/devicetree/bindings/opp/opp-v2-qcom-adreno.yaml
F: drivers/gpu/drm/msm/adreno/
F: drivers/gpu/drm/msm/msm_gpu.*
F: drivers/gpu/drm/msm/msm_gpu_devfreq.*
--
2.48.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v6 6/7] arm64: dts: qcom: x1e80100: Add ACD levels for GPU
2025-05-03 7:03 [PATCH v6 0/7] Support for GPU ACD feature on Adreno X1-85 Akhil P Oommen
` (4 preceding siblings ...)
2025-05-03 7:03 ` [PATCH v6 5/7] dt-bindings: opp: Add v2-qcom-adreno vendor bindings Akhil P Oommen
@ 2025-05-03 7:03 ` Akhil P Oommen
2025-05-03 7:03 ` [PATCH v6 7/7] arm64: dts: qcom: x1e80100: Add OPPs up to Turbo L3 " Akhil P Oommen
6 siblings, 0 replies; 9+ messages in thread
From: Akhil P Oommen @ 2025-05-03 7:03 UTC (permalink / raw)
To: Rob Clark, Sean Paul, Konrad Dybcio, Abhinav Kumar,
Marijn Suijten, David Airlie, Simona Vetter, Viresh Kumar,
Nishanth Menon, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Akhil P Oommen, Bjorn Andersson, Maya Matuszczyk,
Anthony Ruhier, Dmitry Baryshkov
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, linux-pm,
devicetree, Konrad Dybcio
Update GPU node to include acd level values.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Tested-by: Maya Matuszczyk <maccraft123mc@gmail.com>
Tested-by: Anthony Ruhier <aruhier@mailbox.org>
Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
---
arch/arm64/boot/dts/qcom/x1e80100.dtsi | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/qcom/x1e80100.dtsi b/arch/arm64/boot/dts/qcom/x1e80100.dtsi
index 4936fa5b98ff7a9a009e3106f4dba90131251971..a9c8cca1c6356393962cef856b3dbd9420733999 100644
--- a/arch/arm64/boot/dts/qcom/x1e80100.dtsi
+++ b/arch/arm64/boot/dts/qcom/x1e80100.dtsi
@@ -3752,60 +3752,69 @@ zap-shader {
};
gpu_opp_table: opp-table {
- compatible = "operating-points-v2";
+ compatible = "operating-points-v2-adreno", "operating-points-v2";
opp-1100000000 {
opp-hz = /bits/ 64 <1100000000>;
opp-level = <RPMH_REGULATOR_LEVEL_TURBO_L1>;
opp-peak-kBps = <16500000>;
+ qcom,opp-acd-level = <0xa82a5ffd>;
};
opp-1000000000 {
opp-hz = /bits/ 64 <1000000000>;
opp-level = <RPMH_REGULATOR_LEVEL_TURBO>;
opp-peak-kBps = <14398438>;
+ qcom,opp-acd-level = <0xa82b5ffd>;
};
opp-925000000 {
opp-hz = /bits/ 64 <925000000>;
opp-level = <RPMH_REGULATOR_LEVEL_NOM_L1>;
opp-peak-kBps = <14398438>;
+ qcom,opp-acd-level = <0xa82b5ffd>;
};
opp-800000000 {
opp-hz = /bits/ 64 <800000000>;
opp-level = <RPMH_REGULATOR_LEVEL_NOM>;
opp-peak-kBps = <12449219>;
+ qcom,opp-acd-level = <0xa82c5ffd>;
};
opp-744000000 {
opp-hz = /bits/ 64 <744000000>;
opp-level = <RPMH_REGULATOR_LEVEL_SVS_L2>;
opp-peak-kBps = <10687500>;
+ qcom,opp-acd-level = <0x882e5ffd>;
};
opp-687000000 {
opp-hz = /bits/ 64 <687000000>;
opp-level = <RPMH_REGULATOR_LEVEL_SVS_L1>;
opp-peak-kBps = <8171875>;
+ qcom,opp-acd-level = <0x882e5ffd>;
};
opp-550000000 {
opp-hz = /bits/ 64 <550000000>;
opp-level = <RPMH_REGULATOR_LEVEL_SVS>;
opp-peak-kBps = <6074219>;
+ qcom,opp-acd-level = <0xc0285ffd>;
};
opp-390000000 {
opp-hz = /bits/ 64 <390000000>;
opp-level = <RPMH_REGULATOR_LEVEL_LOW_SVS>;
opp-peak-kBps = <3000000>;
+ qcom,opp-acd-level = <0xc0285ffd>;
};
opp-300000000 {
opp-hz = /bits/ 64 <300000000>;
opp-level = <RPMH_REGULATOR_LEVEL_LOW_SVS_D1>;
opp-peak-kBps = <2136719>;
+ qcom,opp-acd-level = <0xc02b5ffd>;
};
};
};
--
2.48.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v6 7/7] arm64: dts: qcom: x1e80100: Add OPPs up to Turbo L3 for GPU
2025-05-03 7:03 [PATCH v6 0/7] Support for GPU ACD feature on Adreno X1-85 Akhil P Oommen
` (5 preceding siblings ...)
2025-05-03 7:03 ` [PATCH v6 6/7] arm64: dts: qcom: x1e80100: Add ACD levels for GPU Akhil P Oommen
@ 2025-05-03 7:03 ` Akhil P Oommen
6 siblings, 0 replies; 9+ messages in thread
From: Akhil P Oommen @ 2025-05-03 7:03 UTC (permalink / raw)
To: Rob Clark, Sean Paul, Konrad Dybcio, Abhinav Kumar,
Marijn Suijten, David Airlie, Simona Vetter, Viresh Kumar,
Nishanth Menon, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Akhil P Oommen, Bjorn Andersson, Maya Matuszczyk,
Anthony Ruhier, Dmitry Baryshkov
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, linux-pm,
devicetree, Konrad Dybcio
Now that we have ACD support for GPU, add additional OPPs up to
Turbo L3 which are supported across all existing SKUs.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Tested-by: Maya Matuszczyk <maccraft123mc@gmail.com>
Tested-by: Anthony Ruhier <aruhier@mailbox.org>
Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
---
arch/arm64/boot/dts/qcom/x1e80100.dtsi | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/qcom/x1e80100.dtsi b/arch/arm64/boot/dts/qcom/x1e80100.dtsi
index a9c8cca1c6356393962cef856b3dbd9420733999..8eddf0c9609871b8660587a22b008212a67604b3 100644
--- a/arch/arm64/boot/dts/qcom/x1e80100.dtsi
+++ b/arch/arm64/boot/dts/qcom/x1e80100.dtsi
@@ -3754,10 +3754,24 @@ zap-shader {
gpu_opp_table: opp-table {
compatible = "operating-points-v2-adreno", "operating-points-v2";
+ opp-1250000000 {
+ opp-hz = /bits/ 64 <1250000000>;
+ opp-level = <RPMH_REGULATOR_LEVEL_TURBO_L3>;
+ opp-peak-kBps = <16500000>;
+ qcom,opp-acd-level = <0xa82a5ffd>;
+ };
+
+ opp-1175000000 {
+ opp-hz = /bits/ 64 <1175000000>;
+ opp-level = <RPMH_REGULATOR_LEVEL_TURBO_L2>;
+ opp-peak-kBps = <14398438>;
+ qcom,opp-acd-level = <0xa82a5ffd>;
+ };
+
opp-1100000000 {
opp-hz = /bits/ 64 <1100000000>;
opp-level = <RPMH_REGULATOR_LEVEL_TURBO_L1>;
- opp-peak-kBps = <16500000>;
+ opp-peak-kBps = <14398438>;
qcom,opp-acd-level = <0xa82a5ffd>;
};
--
2.48.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v6 2/7] drm/msm/a6xx: Increase HFI response timeout
2025-05-03 7:03 ` [PATCH v6 2/7] drm/msm/a6xx: Increase HFI response timeout Akhil P Oommen
@ 2025-05-09 17:05 ` Konrad Dybcio
0 siblings, 0 replies; 9+ messages in thread
From: Konrad Dybcio @ 2025-05-09 17:05 UTC (permalink / raw)
To: Akhil P Oommen, Rob Clark, Sean Paul, Konrad Dybcio,
Abhinav Kumar, Marijn Suijten, David Airlie, Simona Vetter,
Viresh Kumar, Nishanth Menon, Stephen Boyd, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Bjorn Andersson,
Maya Matuszczyk, Anthony Ruhier, Dmitry Baryshkov
Cc: linux-arm-msm, dri-devel, freedreno, linux-kernel, linux-pm,
devicetree
On 5/3/25 9:03 AM, Akhil P Oommen wrote:
> When ACD feature is enabled, it triggers some internal calibrations
> which result in a pretty long delay during the first HFI perf vote.
> So, increase the HFI response timeout to match the downstream driver.
>
> Tested-by: Maya Matuszczyk <maccraft123mc@gmail.com>
> Tested-by: Anthony Ruhier <aruhier@mailbox.org>
> Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Konrad
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-05-09 17:05 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-03 7:03 [PATCH v6 0/7] Support for GPU ACD feature on Adreno X1-85 Akhil P Oommen
2025-05-03 7:03 ` [PATCH v6 1/7] drm/msm/adreno: Add support for ACD Akhil P Oommen
2025-05-03 7:03 ` [PATCH v6 2/7] drm/msm/a6xx: Increase HFI response timeout Akhil P Oommen
2025-05-09 17:05 ` Konrad Dybcio
2025-05-03 7:03 ` [PATCH v6 3/7] drm/msm: a6x: Rework qmp_get() error handling Akhil P Oommen
2025-05-03 7:03 ` [PATCH v6 4/7] drm/msm/adreno: Add module param to disable ACD Akhil P Oommen
2025-05-03 7:03 ` [PATCH v6 5/7] dt-bindings: opp: Add v2-qcom-adreno vendor bindings Akhil P Oommen
2025-05-03 7:03 ` [PATCH v6 6/7] arm64: dts: qcom: x1e80100: Add ACD levels for GPU Akhil P Oommen
2025-05-03 7:03 ` [PATCH v6 7/7] arm64: dts: qcom: x1e80100: Add OPPs up to Turbo L3 " Akhil P Oommen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).