mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 13:41:48 -04:00
drm/amd/pm: Use smu vram copy in SMUv13
Use smu vram copy wrapper function for vram copy operations in SMUv13.0.6 and SMUv13.0.12. 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>
This commit is contained in:
@@ -479,9 +479,14 @@ static int smu_v13_0_12_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,
|
||||
smu_v13_0_12_get_system_metrics_size());
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
smu_table_cache_update_time(sys_table, jiffies);
|
||||
memcpy(sys_table->cache.buffer, table->cpu_addr,
|
||||
smu_v13_0_12_get_system_metrics_size());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -778,7 +778,10 @@ int smu_v13_0_6_get_metrics_table(struct smu_context *smu, void *metrics_table,
|
||||
}
|
||||
|
||||
amdgpu_hdp_invalidate(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)
|
||||
return ret;
|
||||
|
||||
smu_table->metrics_time = jiffies;
|
||||
}
|
||||
@@ -857,9 +860,9 @@ int smu_v13_0_6_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 void smu_v13_0_6_update_caps(struct smu_context *smu)
|
||||
@@ -2404,13 +2407,15 @@ static int smu_v13_0_6_request_i2c_xfer(struct smu_context *smu,
|
||||
|
||||
table_size = smu_table->tables[SMU_TABLE_I2C_COMMANDS].size;
|
||||
|
||||
memcpy(table->cpu_addr, table_data, table_size);
|
||||
ret = smu_cmn_vram_cpy(smu, table->cpu_addr, table_data, table_size);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Flush hdp cache */
|
||||
amdgpu_hdp_flush(adev, NULL);
|
||||
ret = smu_cmn_send_smc_msg(smu, SMU_MSG_RequestI2cTransaction,
|
||||
NULL);
|
||||
|
||||
return ret;
|
||||
return smu_cmn_send_smc_msg(smu, SMU_MSG_RequestI2cTransaction,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static int smu_v13_0_6_i2c_xfer(struct i2c_adapter *i2c_adap,
|
||||
|
||||
Reference in New Issue
Block a user