drm/amd/pm: invalidate hdp before CPU access the memory written by GPU
Subsystems (3)
PATCH 1/1 drm/amd/pm: invalidate hdp before CPU access the memory written by GPU
To eliminate the possible influence by outdated HDP read cache.
--- drivers/gpu/drm/amd/pm/powerplay/smumgr/smu10_smumgr.c | 3 +-- drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c | 3 +-- drivers/gpu/drm/amd/pm/powerplay/smumgr/vega12_smumgr.c | 3 +-- drivers/gpu/drm/amd/pm/powerplay/smumgr/vega20_smumgr.c | 6 ++---- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 2 +- 5 files changed, 6 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/pm/powerplay/smumgr/smu10_smumgr.c +1 -2
@@ -139,8 +139,7 @@ static int smu10_copy_table_from_smc(struct pp_hwmgr *hwmgr, priv->smu_tables.entry[table_id].table_id, NULL); -/* flush hdp cache */ -amdgpu_asic_flush_hdp (adev,NULL ); +amdgpu_asic_invalidate_hdp (adev,NULL );memcpy (table, (uint8_t *)priv->smu_tables.entry[table_id].table, priv->smu_tables.entry[table_id].size);
drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c +1 -2
@@ -60,8 +60,7 @@ static int vega10_copy_table_from_smc(struct pp_hwmgr *hwmgr, priv->smu_tables.entry[table_id].table_id, NULL); -/* flush hdp cache */ -amdgpu_asic_flush_hdp (adev,NULL ); +amdgpu_asic_invalidate_hdp (adev,NULL );memcpy (table, priv->smu_tables.entry[table_id].table, priv->smu_tables.entry[table_id].size);
drivers/gpu/drm/amd/pm/powerplay/smumgr/vega12_smumgr.c +1 -2
@@ -68,8 +68,7 @@ static int vega12_copy_table_from_smc(struct pp_hwmgr *hwmgr,"[CopyTableFromSMC] Attempt to Transfer Table From SMU Failed!" , return -EINVAL); -/* flush hdp cache */ -amdgpu_asic_flush_hdp (adev,NULL ); +amdgpu_asic_invalidate_hdp (adev,NULL );memcpy (table, priv->smu_tables.entry[table_id].table, priv->smu_tables.entry[table_id].size);
drivers/gpu/drm/amd/pm/powerplay/smumgr/vega20_smumgr.c +2 -4
@@ -192,8 +192,7 @@ static int vega20_copy_table_from_smc(struct pp_hwmgr *hwmgr,"[CopyTableFromSMC] Attempt to Transfer Table From SMU Failed!" , return ret); -/* flush hdp cache */ -amdgpu_asic_flush_hdp (adev,NULL ); +amdgpu_asic_invalidate_hdp (adev,NULL );memcpy (table, priv->smu_tables.entry[table_id].table, priv->smu_tables.entry[table_id].size);
@@ -307,8 +306,7 @@ int vega20_get_activity_monitor_coeff(struct pp_hwmgr *hwmgr,"[GetActivityMonitor] Attempt to Transfer Table From SMU Failed!" , return ret); -/* flush hdp cache */ -amdgpu_asic_flush_hdp (adev,NULL ); +amdgpu_asic_invalidate_hdp (adev,NULL );memcpy (table, priv->smu_tables.entry[TABLE_ACTIVITY_MONITOR_COEFF ].table, priv->smu_tables.entry[TABLE_ACTIVITY_MONITOR_COEFF ].size);
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +1 -1
@@ -655,7 +655,7 @@ int smu_cmn_update_table(struct smu_context *smu,return ret;if (!drv2smu) { -amdgpu_asic_flush_hdp (adev,NULL ); +amdgpu_asic_invalidate_hdp (adev,NULL );memcpy (table_data, table->cpu_addr, table_size); }
Signature · 6 lines
2.29.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[AMD Public Use]
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Evan Quan
Sent: Tuesday, December 1, 2020 2:39 PM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; Quan, Evan <[email protected]>
Subject: [PATCH] drm/amd/pm: invalidate hdp before CPU access the memory written by GPU
[CAUTION: External Email]
To eliminate the possible influence by outdated HDP read cache.
--- drivers/gpu/drm/amd/pm/powerplay/smumgr/smu10_smumgr.c | 3 +-- drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c | 3 +-- drivers/gpu/drm/amd/pm/powerplay/smumgr/vega12_smumgr.c | 3 +-- drivers/gpu/drm/amd/pm/powerplay/smumgr/vega20_smumgr.c | 6 ++---- drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c | 2 +- 5 files changed, 6 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/pm/powerplay/smumgr/smu10_smumgr.c +1 -2
@@ -139,8 +139,7 @@ static int smu10_copy_table_from_smc(struct pp_hwmgr *hwmgr, priv->smu_tables.entry[table_id].table_id, NULL); -/* flush hdp cache */ -amdgpu_asic_flush_hdp (adev,NULL ); +amdgpu_asic_invalidate_hdp (adev,NULL );memcpy (table, (uint8_t *)priv->smu_tables.entry[table_id].table, priv->smu_tables.entry[table_id].size);
drivers/gpu/drm/amd/pm/powerplay/smumgr/vega10_smumgr.c +1 -2
@@ -60,8 +60,7 @@ static int vega10_copy_table_from_smc(struct pp_hwmgr *hwmgr, priv->smu_tables.entry[table_id].table_id, NULL); -/* flush hdp cache */ -amdgpu_asic_flush_hdp (adev,NULL ); +amdgpu_asic_invalidate_hdp (adev,NULL );memcpy (table, priv->smu_tables.entry[table_id].table, priv->smu_tables.entry[table_id].size);
drivers/gpu/drm/amd/pm/powerplay/smumgr/vega12_smumgr.c +1 -2
@@ -68,8 +68,7 @@ static int vega12_copy_table_from_smc(struct pp_hwmgr *hwmgr,"[CopyTableFromSMC] Attempt to Transfer Table From SMU Failed!" , return -EINVAL); -/* flush hdp cache */ -amdgpu_asic_flush_hdp (adev,NULL ); +amdgpu_asic_invalidate_hdp (adev,NULL );memcpy (table, priv->smu_tables.entry[table_id].table, priv->smu_tables.entry[table_id].size);
drivers/gpu/drm/amd/pm/powerplay/smumgr/vega20_smumgr.c +2 -4
@@ -192,8 +192,7 @@ static int vega20_copy_table_from_smc(struct pp_hwmgr *hwmgr,"[CopyTableFromSMC] Attempt to Transfer Table From SMU Failed!" , return ret); -/* flush hdp cache */ -amdgpu_asic_flush_hdp (adev,NULL ); +amdgpu_asic_invalidate_hdp (adev,NULL );memcpy (table, priv->smu_tables.entry[table_id].table, priv->smu_tables.entry[table_id].size);
@@ -307,8 +306,7 @@ int vega20_get_activity_monitor_coeff(struct pp_hwmgr *hwmgr,"[GetActivityMonitor] Attempt to Transfer Table From SMU Failed!" , return ret); -/* flush hdp cache */ -amdgpu_asic_flush_hdp (adev,NULL ); +amdgpu_asic_invalidate_hdp (adev,NULL );memcpy (table, priv->smu_tables.entry[TABLE_ACTIVITY_MONITOR_COEFF ].table, priv->smu_tables.entry[TABLE_ACTIVITY_MONITOR_COEFF ].size);
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c +1 -1
@@ -655,7 +655,7 @@ int smu_cmn_update_table(struct smu_context *smu,return ret;if (!drv2smu) { -amdgpu_asic_flush_hdp (adev,NULL ); +amdgpu_asic_invalidate_hdp (adev,NULL );memcpy (table_data, table->cpu_addr, table_size); }
--
2.29.0
_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Clijo.lazar%40amd.com%7Cd0fc04e728f0413072a408d895d8d319%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637424105789290029%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=GEhS59a7EmWSpSi2e3pKZKkNK1EDeoQ5aEG2ZvFvw6E%3D&reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx