File tree Expand file tree Collapse file tree 5 files changed +18
-14
lines changed
drivers/gpu/drm/amd/amdgpu Expand file tree Collapse file tree 5 files changed +18
-14
lines changed Original file line number Diff line number Diff line change @@ -2008,8 +2008,24 @@ static void amdgpu_device_fill_reset_magic(struct amdgpu_device *adev)
2008
2008
*/
2009
2009
static bool amdgpu_device_check_vram_lost (struct amdgpu_device * adev )
2010
2010
{
2011
- return !!memcmp (adev -> gart .ptr , adev -> reset_magic ,
2012
- AMDGPU_RESET_MAGIC_NUM );
2011
+ if (memcmp (adev -> gart .ptr , adev -> reset_magic ,
2012
+ AMDGPU_RESET_MAGIC_NUM ))
2013
+ return true;
2014
+
2015
+ if (!adev -> in_gpu_reset )
2016
+ return false;
2017
+
2018
+ /*
2019
+ * For all ASICs with baco/mode1 reset, the VRAM is
2020
+ * always assumed to be lost.
2021
+ */
2022
+ switch (amdgpu_asic_reset_method (adev )) {
2023
+ case AMD_RESET_METHOD_BACO :
2024
+ case AMD_RESET_METHOD_MODE1 :
2025
+ return true;
2026
+ default :
2027
+ return false;
2028
+ }
2013
2029
}
2014
2030
2015
2031
/**
Original file line number Diff line number Diff line change @@ -1358,8 +1358,6 @@ static int cik_asic_reset(struct amdgpu_device *adev)
1358
1358
int r ;
1359
1359
1360
1360
if (cik_asic_reset_method (adev ) == AMD_RESET_METHOD_BACO ) {
1361
- if (!adev -> in_suspend )
1362
- amdgpu_inc_vram_lost (adev );
1363
1361
r = amdgpu_dpm_baco_reset (adev );
1364
1362
} else {
1365
1363
r = cik_asic_pci_config_reset (adev );
Original file line number Diff line number Diff line change @@ -351,17 +351,13 @@ static int nv_asic_reset(struct amdgpu_device *adev)
351
351
struct smu_context * smu = & adev -> smu ;
352
352
353
353
if (nv_asic_reset_method (adev ) == AMD_RESET_METHOD_BACO ) {
354
- if (!adev -> in_suspend )
355
- amdgpu_inc_vram_lost (adev );
356
354
ret = smu_baco_enter (smu );
357
355
if (ret )
358
356
return ret ;
359
357
ret = smu_baco_exit (smu );
360
358
if (ret )
361
359
return ret ;
362
360
} else {
363
- if (!adev -> in_suspend )
364
- amdgpu_inc_vram_lost (adev );
365
361
ret = nv_asic_mode1_reset (adev );
366
362
}
367
363
Original file line number Diff line number Diff line change @@ -569,14 +569,10 @@ static int soc15_asic_reset(struct amdgpu_device *adev)
569
569
570
570
switch (soc15_asic_reset_method (adev )) {
571
571
case AMD_RESET_METHOD_BACO :
572
- if (!adev -> in_suspend )
573
- amdgpu_inc_vram_lost (adev );
574
572
return soc15_asic_baco_reset (adev );
575
573
case AMD_RESET_METHOD_MODE2 :
576
574
return amdgpu_dpm_mode2_reset (adev );
577
575
default :
578
- if (!adev -> in_suspend )
579
- amdgpu_inc_vram_lost (adev );
580
576
return soc15_asic_mode1_reset (adev );
581
577
}
582
578
}
Original file line number Diff line number Diff line change @@ -765,8 +765,6 @@ static int vi_asic_reset(struct amdgpu_device *adev)
765
765
int r ;
766
766
767
767
if (vi_asic_reset_method (adev ) == AMD_RESET_METHOD_BACO ) {
768
- if (!adev -> in_suspend )
769
- amdgpu_inc_vram_lost (adev );
770
768
r = amdgpu_dpm_baco_reset (adev );
771
769
} else {
772
770
r = vi_asic_pci_config_reset (adev );
You can’t perform that action at this time.
0 commit comments