mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 12:31:52 -04:00
drm/amd/pm: Add smu vram copy function
Add a wrapper function for copying data/to from vram. This additionally checks for any RAS fatal error. Copy cannot be trusted if any RAS fatal error happened as VRAM becomes inaccessible. 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:
@@ -1104,6 +1104,18 @@ int smu_cmn_update_table(struct smu_context *smu,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int smu_cmn_vram_cpy(struct smu_context *smu, void *dst, const void *src,
|
||||
size_t len)
|
||||
{
|
||||
memcpy(dst, src, len);
|
||||
|
||||
/* Don't trust the copy operation if RAS fatal error happened. */
|
||||
if (amdgpu_ras_get_fed_status(smu->adev))
|
||||
return -EHWPOISON;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int smu_cmn_write_watermarks_table(struct smu_context *smu)
|
||||
{
|
||||
void *watermarks_table = smu->smu_table.watermarks_table;
|
||||
|
||||
@@ -174,6 +174,9 @@ int smu_cmn_update_table(struct smu_context *smu,
|
||||
void *table_data,
|
||||
bool drv2smu);
|
||||
|
||||
int smu_cmn_vram_cpy(struct smu_context *smu, void *dst,
|
||||
const void *src, size_t len);
|
||||
|
||||
int smu_cmn_write_watermarks_table(struct smu_context *smu);
|
||||
|
||||
int smu_cmn_write_pptable(struct smu_context *smu);
|
||||
|
||||
Reference in New Issue
Block a user