summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLijo Lazar <lijo.lazar@amd.com>2026-03-27 10:50:40 +0300
committerAlex Deucher <alexander.deucher@amd.com>2026-04-03 20:52:10 +0300
commit3ecee2073cac99c629725f63a033c16ebac17e59 (patch)
tree9dafc775839107440c8ab3f0b34961a513ce6b8c
parent3bec582562a17ff16c4e3b8ac5cac8a6713976f2 (diff)
downloadlinux-3ecee2073cac99c629725f63a033c16ebac17e59.tar.xz
drm/amd/pm: Use smu vram copy in SMUv15
Use smu vram copy wrapper function for vram copy operations in SMUv15.0.8 Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Asad Kamal <asad.kamal@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c
index cc2babc6a341..1682ef1338f1 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c
@@ -344,7 +344,12 @@ static int smu_v15_0_8_get_metrics_table_internal(struct smu_context *smu, uint3
}
amdgpu_device_invalidate_hdp(smu->adev, NULL);
- memcpy(smu_table->metrics_table, table->cpu_addr, table_size);
+ ret = smu_cmn_vram_cpy(smu, smu_table->metrics_table,
+ table->cpu_addr, table_size);
+ if (ret) {
+ mutex_unlock(&smu_table->metrics_lock);
+ return ret;
+ }
smu_table->metrics_time = jiffies;
}
@@ -551,9 +556,14 @@ static int smu_v15_0_8_get_system_metrics_table(struct smu_context *smu)
}
amdgpu_hdp_invalidate(smu->adev, NULL);
+
+ ret = smu_cmn_vram_cpy(smu, sys_table->cache.buffer,
+ table->cpu_addr,
+ sizeof(SystemMetricsTable_t));
+ if (ret)
+ return ret;
+
smu_table_cache_update_time(sys_table, jiffies);
- memcpy(sys_table->cache.buffer, table->cpu_addr,
- sizeof(SystemMetricsTable_t));
return 0;
}
@@ -988,9 +998,9 @@ static int smu_v15_0_8_get_static_metrics_table(struct smu_context *smu)
}
amdgpu_hdp_invalidate(smu->adev, NULL);
- memcpy(smu_table->metrics_table, table->cpu_addr, table_size);
- return 0;
+ return smu_cmn_vram_cpy(smu, smu_table->metrics_table,
+ table->cpu_addr, table_size);
}
static int smu_v15_0_8_fru_get_product_info(struct smu_context *smu,