drm/amdgpu:read VRAMLOST from gim
Subsystems (2)
PATCH 1/1 drm/amdgpu:read VRAMLOST from gim
Change-Id I6a268903465004d6e8f65f135734094772b9f614
Signed-off-by Monk Liu <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 ++++----- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +4 -5
@@ -2953,11 +2953,10 @@ static int amdgpu_reset_sriov(struct amdgpu_device *adev, uint64_t *reset_flags,amdgpu_virt_release_full_gpu (adev, true);if (reset_flags) { -/* will get vram_lost from GIM in future, now all -* reset request considered VRAM LOST -*/ - (*reset_flags) |= ~AMDGPU_RESET_INFO_VRAM_LOST ; -atomic_inc (&adev->vram_lost_counter); +if (adev->virt.gim_feature &AMDGIM_FEATURE_GIM_FLR_VRAMLOST ) { + (*reset_flags) |=AMDGPU_RESET_INFO_VRAM_LOST ; +atomic_inc (&adev->vram_lost_counter); + }/* VF FLR or hotlink reset is always full-reset */ (*reset_flags) |=AMDGPU_RESET_INFO_FULLRESET ;
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +1 -0
@@ -332,6 +332,7 @@ void amdgpu_virt_init_data_exchange(struct amdgpu_device *adev) pf2vf_ver = adev->virt.fw_reserve.p_pf2vf->version;AMDGPU_FW_VRAM_PF2VF_READ (adev, header.size, &pf2vf_size);AMDGPU_FW_VRAM_PF2VF_READ (adev, checksum, &checksum); +AMDGPU_FW_VRAM_PF2VF_READ (adev, feature_flags, &adev->virt.gim_feature);/* pf2vf message must be in 4K */ if (pf2vf_size >0 && pf2vf_size <4096 ) {
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h +3 -0
@@ -81,6 +81,8 @@ enum AMDGIM_FEATURE_FLAG {AMDGIM_FEATURE_ERROR_LOG_COLLECT =0x1 ,/* GIM supports feature of loading uCodes */ AMDGIM_FEATURE_GIM_LOAD_UCODES =0x2 , +/* VRAM LOST by GIM */ + AMDGIM_FEATURE_GIM_FLR_VRAMLOST = 0x4, }; struct amdgim_pf2vf_info_header {
@@ -246,6 +248,7 @@ struct amdgpu_virt {const struct amdgpu_virt_ops *ops;struct amdgpu_vf_error_buffer vf_errors;struct amdgpu_virt_fw_reserve fw_reserve; +uint32_t gim_feature; };#define AMDGPU_CSA_SIZE (8 * 1024)
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Alex Deucher
Acked-byQuoted 2 lines · Monk Liu
Change-Id I6a268903465004d6e8f65f135734094772b9f614Signed-off-by Monk Liu <[email protected]>
Acked-by Alex Deucher <[email protected]>
Quoted 62 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 ++++----- drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +4
-5@@ -2953,11 +2953,10 @@ static int amdgpu_reset_sriov(struct amdgpu_device *adev, uint64_t *reset_flags,amdgpu_virt_release_full_gpu (adev, true);if (reset_flags) { -/* will get vram_lost from GIM in future, now all -* reset request considered VRAM LOST -*/ - (*reset_flags) |= ~AMDGPU_RESET_INFO_VRAM_LOST ; -atomic_inc (&adev->vram_lost_counter); +if (adev->virt.gim_feature &AMDGIM_FEATURE_GIM_FLR_VRAMLOST ) { + (*reset_flags) |=AMDGPU_RESET_INFO_VRAM_LOST ; +atomic_inc (&adev->vram_lost_counter); + }/* VF FLR or hotlink reset is always full-reset */ (*reset_flags) |=AMDGPU_RESET_INFO_FULLRESET ;drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +1
-0@@ -332,6 +332,7 @@ void amdgpu_virt_init_data_exchange(struct amdgpu_device *adev) pf2vf_ver = adev->virt.fw_reserve.p_pf2vf->version;AMDGPU_FW_VRAM_PF2VF_READ (adev, header.size, &pf2vf_size);AMDGPU_FW_VRAM_PF2VF_READ (adev, checksum, &checksum); +AMDGPU_FW_VRAM_PF2VF_READ (adev, feature_flags, &adev->virt.gim_feature);/* pf2vf message must be in 4K */ if (pf2vf_size >0 && pf2vf_size <4096 ) {drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h +3
-1@@ -81,6 +81,8 @@ enum AMDGIM_FEATURE_FLAG {AMDGIM_FEATURE_ERROR_LOG_COLLECT =0x1 ,/* GIM supports feature of loading uCodes */ AMDGIM_FEATURE_GIM_LOAD_UCODES =0x2 , +/* VRAM LOST by GIM */ + AMDGIM_FEATURE_GIM_FLR_VRAMLOST = 0x4, }; struct amdgim_pf2vf_info_header {@@ -246,6 +248,7 @@ struct amdgpu_virt {const struct amdgpu_virt_ops *ops;struct amdgpu_vf_error_buffer vf_errors;struct amdgpu_virt_fw_reserve fw_reserve; +uint32_t gim_feature; };#define AMDGPU_CSA_SIZE (8 * 1024) --2.7.4
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx