diff options
author | Tao Zhou <tao.zhou1@amd.com> | 2019-07-23 00:18:39 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-07-31 15:49:52 -0400 |
commit | 045c02165397c6c2c01ca5b8f68a9b642f4d244f (patch) | |
tree | 9a55b1a5d3a357ccd35db555a0bd4d33a5f86e76 /drivers | |
parent | 5bbfb64a177f36d3d208e39c61ce6df3968df4d4 (diff) |
drm/amdgpu: switch to amdgpu_umc structure
create new amdgpu_umc structure to for more umc
settings in future and switch to the new structure
Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Dennis Li <dennis.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 8 |
4 files changed, 16 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 61bd7be69a3f..2aa06be83974 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
@@ -948,6 +948,9 @@ struct amdgpu_device { | |||
948 | /* KFD */ | 948 | /* KFD */ |
949 | struct amdgpu_kfd_dev kfd; | 949 | struct amdgpu_kfd_dev kfd; |
950 | 950 | ||
951 | /* UMC */ | ||
952 | struct amdgpu_umc umc; | ||
953 | |||
951 | /* display related functionality */ | 954 | /* display related functionality */ |
952 | struct amdgpu_display_manager dm; | 955 | struct amdgpu_display_manager dm; |
953 | 956 | ||
@@ -973,7 +976,6 @@ struct amdgpu_device { | |||
973 | 976 | ||
974 | const struct amdgpu_nbio_funcs *nbio_funcs; | 977 | const struct amdgpu_nbio_funcs *nbio_funcs; |
975 | const struct amdgpu_df_funcs *df_funcs; | 978 | const struct amdgpu_df_funcs *df_funcs; |
976 | const struct amdgpu_umc_funcs *umc_funcs; | ||
977 | 979 | ||
978 | /* delayed work_func for deferring clockgating during resume */ | 980 | /* delayed work_func for deferring clockgating during resume */ |
979 | struct delayed_work delayed_init_work; | 981 | struct delayed_work delayed_init_work; |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c index a6134280b941..5f428a3929bd 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | |||
@@ -595,8 +595,8 @@ int amdgpu_ras_error_query(struct amdgpu_device *adev, | |||
595 | 595 | ||
596 | switch (info->head.block) { | 596 | switch (info->head.block) { |
597 | case AMDGPU_RAS_BLOCK__UMC: | 597 | case AMDGPU_RAS_BLOCK__UMC: |
598 | if (adev->umc_funcs->query_ras_error_count) | 598 | if (adev->umc.funcs->query_ras_error_count) |
599 | adev->umc_funcs->query_ras_error_count(adev, &err_data); | 599 | adev->umc.funcs->query_ras_error_count(adev, &err_data); |
600 | break; | 600 | break; |
601 | default: | 601 | default: |
602 | break; | 602 | break; |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h index 1ee1a00e5ac8..f5d6def96414 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h | |||
@@ -26,4 +26,10 @@ struct amdgpu_umc_funcs { | |||
26 | void *ras_error_status); | 26 | void *ras_error_status); |
27 | }; | 27 | }; |
28 | 28 | ||
29 | struct amdgpu_umc { | ||
30 | /* max error count in one ras query call */ | ||
31 | uint32_t max_ras_err_cnt_per_query; | ||
32 | const struct amdgpu_umc_funcs *funcs; | ||
33 | }; | ||
34 | |||
29 | #endif | 35 | #endif |
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c index 5282c9489c70..ae685998b282 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | |||
@@ -247,8 +247,8 @@ static int gmc_v9_0_process_ras_data_cb(struct amdgpu_device *adev, | |||
247 | { | 247 | { |
248 | struct ras_err_data err_data = {0, 0}; | 248 | struct ras_err_data err_data = {0, 0}; |
249 | kgd2kfd_set_sram_ecc_flag(adev->kfd.dev); | 249 | kgd2kfd_set_sram_ecc_flag(adev->kfd.dev); |
250 | if (adev->umc_funcs->query_ras_error_count) | 250 | if (adev->umc.funcs->query_ras_error_count) |
251 | adev->umc_funcs->query_ras_error_count(adev, &err_data); | 251 | adev->umc.funcs->query_ras_error_count(adev, &err_data); |
252 | amdgpu_ras_reset_gpu(adev, 0); | 252 | amdgpu_ras_reset_gpu(adev, 0); |
253 | return AMDGPU_RAS_UE; | 253 | return AMDGPU_RAS_UE; |
254 | } | 254 | } |
@@ -635,7 +635,9 @@ static void gmc_v9_0_set_umc_funcs(struct amdgpu_device *adev) | |||
635 | { | 635 | { |
636 | switch (adev->asic_type) { | 636 | switch (adev->asic_type) { |
637 | case CHIP_VEGA20: | 637 | case CHIP_VEGA20: |
638 | adev->umc_funcs = &umc_v6_1_funcs; | 638 | adev->umc.max_ras_err_cnt_per_query = |
639 | UMC_V6_1_UMC_INSTANCE_NUM * UMC_V6_1_CHANNEL_INSTANCE_NUM; | ||
640 | adev->umc.funcs = &umc_v6_1_funcs; | ||
639 | break; | 641 | break; |
640 | default: | 642 | default: |
641 | break; | 643 | break; |