diff options
author | Monk Liu <Monk.Liu@amd.com> | 2017-10-30 08:11:54 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-12-04 16:41:45 -0500 |
commit | 75bc6099bc619bd58e09d5203081ec9dc5535ec1 (patch) | |
tree | cad2d836c835537b6deaf5c47e09669cb1e86f8e /drivers/gpu | |
parent | 0c03b912d7f84636766bc26d38df5b21f1c00e94 (diff) |
drm/amdgpu:read VRAMLOST from gim
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 3 |
3 files changed, 8 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 05087eda0b71..57267ac265f0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |||
@@ -3037,11 +3037,10 @@ error: | |||
3037 | amdgpu_virt_release_full_gpu(adev, true); | 3037 | amdgpu_virt_release_full_gpu(adev, true); |
3038 | 3038 | ||
3039 | if (reset_flags) { | 3039 | if (reset_flags) { |
3040 | /* will get vram_lost from GIM in future, now all | 3040 | if (adev->virt.gim_feature & AMDGIM_FEATURE_GIM_FLR_VRAMLOST) { |
3041 | * reset request considered VRAM LOST | 3041 | (*reset_flags) |= AMDGPU_RESET_INFO_VRAM_LOST; |
3042 | */ | 3042 | atomic_inc(&adev->vram_lost_counter); |
3043 | (*reset_flags) |= ~AMDGPU_RESET_INFO_VRAM_LOST; | 3043 | } |
3044 | atomic_inc(&adev->vram_lost_counter); | ||
3045 | 3044 | ||
3046 | /* VF FLR or hotlink reset is always full-reset */ | 3045 | /* VF FLR or hotlink reset is always full-reset */ |
3047 | (*reset_flags) |= AMDGPU_RESET_INFO_FULLRESET; | 3046 | (*reset_flags) |= AMDGPU_RESET_INFO_FULLRESET; |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c index 733c64cbd1c8..663bf35cdce9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | |||
@@ -334,6 +334,7 @@ void amdgpu_virt_init_data_exchange(struct amdgpu_device *adev) | |||
334 | pf2vf_ver = adev->virt.fw_reserve.p_pf2vf->version; | 334 | pf2vf_ver = adev->virt.fw_reserve.p_pf2vf->version; |
335 | AMDGPU_FW_VRAM_PF2VF_READ(adev, header.size, &pf2vf_size); | 335 | AMDGPU_FW_VRAM_PF2VF_READ(adev, header.size, &pf2vf_size); |
336 | AMDGPU_FW_VRAM_PF2VF_READ(adev, checksum, &checksum); | 336 | AMDGPU_FW_VRAM_PF2VF_READ(adev, checksum, &checksum); |
337 | AMDGPU_FW_VRAM_PF2VF_READ(adev, feature_flags, &adev->virt.gim_feature); | ||
337 | 338 | ||
338 | /* pf2vf message must be in 4K */ | 339 | /* pf2vf message must be in 4K */ |
339 | if (pf2vf_size > 0 && pf2vf_size < 4096) { | 340 | if (pf2vf_size > 0 && pf2vf_size < 4096) { |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h index e3f78f5edc00..f77d116c7a1c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | |||
@@ -81,6 +81,8 @@ enum AMDGIM_FEATURE_FLAG { | |||
81 | AMDGIM_FEATURE_ERROR_LOG_COLLECT = 0x1, | 81 | AMDGIM_FEATURE_ERROR_LOG_COLLECT = 0x1, |
82 | /* GIM supports feature of loading uCodes */ | 82 | /* GIM supports feature of loading uCodes */ |
83 | AMDGIM_FEATURE_GIM_LOAD_UCODES = 0x2, | 83 | AMDGIM_FEATURE_GIM_LOAD_UCODES = 0x2, |
84 | /* VRAM LOST by GIM */ | ||
85 | AMDGIM_FEATURE_GIM_FLR_VRAMLOST = 0x4, | ||
84 | }; | 86 | }; |
85 | 87 | ||
86 | struct amdgim_pf2vf_info_header { | 88 | struct amdgim_pf2vf_info_header { |
@@ -246,6 +248,7 @@ struct amdgpu_virt { | |||
246 | const struct amdgpu_virt_ops *ops; | 248 | const struct amdgpu_virt_ops *ops; |
247 | struct amdgpu_vf_error_buffer vf_errors; | 249 | struct amdgpu_vf_error_buffer vf_errors; |
248 | struct amdgpu_virt_fw_reserve fw_reserve; | 250 | struct amdgpu_virt_fw_reserve fw_reserve; |
251 | uint32_t gim_feature; | ||
249 | }; | 252 | }; |
250 | 253 | ||
251 | #define AMDGPU_CSA_SIZE (8 * 1024) | 254 | #define AMDGPU_CSA_SIZE (8 * 1024) |