From: Yang Wang Date: Mon, 27 Apr 2026 07:09:37 +0000 (+0800) Subject: drm/amd/pm: use the SMU multi-msgs helper in smu_v15_0 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=359cf7b42f87acc1ddd6b974fabe0ed6722f97ff;p=thirdparty%2Fkernel%2Flinux.git drm/amd/pm: use the SMU multi-msgs helper in smu_v15_0 Convert the SMU15 table address messages to smu_cmn_send_smc_msg_with_params() so they use the common SMU multi-msgs helper instead of open-coding struct smu_msg_args. No functional change intended. Signed-off-by: Yang Wang Reviewed-by: Kenneth Feng Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c index c3cb368138064..cc3a265700a59 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0.c @@ -589,52 +589,47 @@ int smu_v15_0_notify_memory_pool_location(struct smu_context *smu) { struct smu_table_context *smu_table = &smu->smu_table; struct smu_table *memory_pool = &smu_table->memory_pool; - struct smu_msg_args args = { - .msg = SMU_MSG_DramLogSetDramAddr, - .num_args = 3, - .num_out_args = 0, - }; + uint32_t params[3]; if (memory_pool->size == 0 || memory_pool->cpu_addr == NULL) return 0; /* SMU_MSG_DramLogSetDramAddr: ARG0=low, ARG1=high, ARG2=size */ - args.args[0] = lower_32_bits(memory_pool->mc_address); - args.args[1] = upper_32_bits(memory_pool->mc_address); - args.args[2] = (u32)memory_pool->size; - - return smu->msg_ctl.ops->send_msg(&smu->msg_ctl, &args); + params[0] = lower_32_bits(memory_pool->mc_address); + params[1] = upper_32_bits(memory_pool->mc_address); + params[2] = (u32)memory_pool->size; + + return smu_cmn_send_smc_msg_with_params(smu, + SMU_MSG_DramLogSetDramAddr, + params, ARRAY_SIZE(params), + NULL, 0); } int smu_v15_0_set_driver_table_location(struct smu_context *smu) { struct smu_table *driver_table = &smu->smu_table.driver_table; - struct smu_msg_args args = { - .msg = SMU_MSG_SetDriverDramAddr, - .num_args = 2, - .num_out_args = 0, + const uint32_t params[] = { + lower_32_bits(driver_table->mc_address), + upper_32_bits(driver_table->mc_address), }; - args.args[0] = lower_32_bits(driver_table->mc_address); - args.args[1] = upper_32_bits(driver_table->mc_address); - - return smu->msg_ctl.ops->send_msg(&smu->msg_ctl, &args); + return smu_cmn_send_smc_msg_with_params(smu, SMU_MSG_SetDriverDramAddr, + params, ARRAY_SIZE(params), + NULL, 0); } int smu_v15_0_set_tool_table_location(struct smu_context *smu) { struct smu_table *tool_table = &smu->smu_table.tables[SMU_TABLE_PMSTATUSLOG]; - struct smu_msg_args args = { - .msg = SMU_MSG_SetToolsDramAddr, - .num_args = 2, - .num_out_args = 0, + const uint32_t params[] = { + lower_32_bits(tool_table->mc_address), + upper_32_bits(tool_table->mc_address), }; /* SMU_MSG_SetToolsDramAddr: ARG0=low, ARG1=high */ - args.args[0] = lower_32_bits(tool_table->mc_address); - args.args[1] = upper_32_bits(tool_table->mc_address); - - return smu->msg_ctl.ops->send_msg(&smu->msg_ctl, &args); + return smu_cmn_send_smc_msg_with_params(smu, SMU_MSG_SetToolsDramAddr, + params, ARRAY_SIZE(params), + NULL, 0); } int smu_v15_0_set_allowed_mask(struct smu_context *smu)