Skip to content

Commit 1e6adfe

Browse files
committed
Merge tag 'amd-drm-fixes-5.7-2020-04-15' of git://people.freedesktop.org/~agd5f/linux into drm-fixes
amd-drm-fixes-5.7-2020-04-15: amdgpu: - gfx10 fix - SMU7 overclocking fix - RAS fix - GPU reset fix - Fix a regression in a previous s/r fix - Add a gfxoff quirk Signed-off-by: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents bbf4ee2 + 974229d commit 1e6adfe

File tree

9 files changed

+33
-16
lines changed

9 files changed

+33
-16
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2008,8 +2008,24 @@ static void amdgpu_device_fill_reset_magic(struct amdgpu_device *adev)
20082008
*/
20092009
static bool amdgpu_device_check_vram_lost(struct amdgpu_device *adev)
20102010
{
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+
}
20132029
}
20142030

20152031
/**
@@ -2340,6 +2356,8 @@ static int amdgpu_device_ip_suspend_phase1(struct amdgpu_device *adev)
23402356
{
23412357
int i, r;
23422358

2359+
amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
2360+
amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);
23432361

23442362
for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
23452363
if (!adev->ip_blocks[i].status.valid)

drivers/gpu/drm/amd/amdgpu/cik.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,8 +1358,6 @@ static int cik_asic_reset(struct amdgpu_device *adev)
13581358
int r;
13591359

13601360
if (cik_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) {
1361-
if (!adev->in_suspend)
1362-
amdgpu_inc_vram_lost(adev);
13631361
r = amdgpu_dpm_baco_reset(adev);
13641362
} else {
13651363
r = cik_asic_pci_config_reset(adev);

drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ static const struct soc15_reg_golden golden_settings_gc_10_1_2_nv12[] =
279279

280280
#define DEFAULT_SH_MEM_CONFIG \
281281
((SH_MEM_ADDRESS_MODE_64 << SH_MEM_CONFIG__ADDRESS_MODE__SHIFT) | \
282-
(SH_MEM_ALIGNMENT_MODE_DWORD << SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT) | \
282+
(SH_MEM_ALIGNMENT_MODE_UNALIGNED << SH_MEM_CONFIG__ALIGNMENT_MODE__SHIFT) | \
283283
(SH_MEM_RETRY_MODE_ALL << SH_MEM_CONFIG__RETRY_MODE__SHIFT) | \
284284
(3 << SH_MEM_CONFIG__INITIAL_INST_PREFETCH__SHIFT))
285285

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,6 +1234,8 @@ struct amdgpu_gfxoff_quirk {
12341234
static const struct amdgpu_gfxoff_quirk amdgpu_gfxoff_quirk_list[] = {
12351235
/* https://bugzilla.kernel.org/show_bug.cgi?id=204689 */
12361236
{ 0x1002, 0x15dd, 0x1002, 0x15dd, 0xc8 },
1237+
/* https://bugzilla.kernel.org/show_bug.cgi?id=207171 */
1238+
{ 0x1002, 0x15dd, 0x103c, 0x83e7, 0xd3 },
12371239
{ 0, 0, 0, 0, 0 },
12381240
};
12391241

drivers/gpu/drm/amd/amdgpu/nv.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -351,17 +351,13 @@ static int nv_asic_reset(struct amdgpu_device *adev)
351351
struct smu_context *smu = &adev->smu;
352352

353353
if (nv_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) {
354-
if (!adev->in_suspend)
355-
amdgpu_inc_vram_lost(adev);
356354
ret = smu_baco_enter(smu);
357355
if (ret)
358356
return ret;
359357
ret = smu_baco_exit(smu);
360358
if (ret)
361359
return ret;
362360
} else {
363-
if (!adev->in_suspend)
364-
amdgpu_inc_vram_lost(adev);
365361
ret = nv_asic_mode1_reset(adev);
366362
}
367363

drivers/gpu/drm/amd/amdgpu/soc15.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -569,14 +569,10 @@ static int soc15_asic_reset(struct amdgpu_device *adev)
569569

570570
switch (soc15_asic_reset_method(adev)) {
571571
case AMD_RESET_METHOD_BACO:
572-
if (!adev->in_suspend)
573-
amdgpu_inc_vram_lost(adev);
574572
return soc15_asic_baco_reset(adev);
575573
case AMD_RESET_METHOD_MODE2:
576574
return amdgpu_dpm_mode2_reset(adev);
577575
default:
578-
if (!adev->in_suspend)
579-
amdgpu_inc_vram_lost(adev);
580576
return soc15_asic_mode1_reset(adev);
581577
}
582578
}

drivers/gpu/drm/amd/amdgpu/vi.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -765,8 +765,6 @@ static int vi_asic_reset(struct amdgpu_device *adev)
765765
int r;
766766

767767
if (vi_asic_reset_method(adev) == AMD_RESET_METHOD_BACO) {
768-
if (!adev->in_suspend)
769-
amdgpu_inc_vram_lost(adev);
770768
r = amdgpu_dpm_baco_reset(adev);
771769
} else {
772770
r = vi_asic_pci_config_reset(adev);

drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3804,9 +3804,12 @@ static int smu7_trim_single_dpm_states(struct pp_hwmgr *hwmgr,
38043804
{
38053805
uint32_t i;
38063806

3807+
/* force the trim if mclk_switching is disabled to prevent flicker */
3808+
bool force_trim = (low_limit == high_limit);
38073809
for (i = 0; i < dpm_table->count; i++) {
38083810
/*skip the trim if od is enabled*/
3809-
if (!hwmgr->od_enabled && (dpm_table->dpm_levels[i].value < low_limit
3811+
if ((!hwmgr->od_enabled || force_trim)
3812+
&& (dpm_table->dpm_levels[i].value < low_limit
38103813
|| dpm_table->dpm_levels[i].value > high_limit))
38113814
dpm_table->dpm_levels[i].enabled = false;
38123815
else

drivers/gpu/drm/amd/powerplay/smu_v11_0.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,6 +1718,12 @@ int smu_v11_0_baco_set_state(struct smu_context *smu, enum smu_baco_state state)
17181718
if (ret)
17191719
goto out;
17201720

1721+
if (ras && ras->supported) {
1722+
ret = smu_send_smc_msg(smu, SMU_MSG_PrepareMp1ForUnload, NULL);
1723+
if (ret)
1724+
goto out;
1725+
}
1726+
17211727
/* clear vbios scratch 6 and 7 for coming asic reinit */
17221728
WREG32(adev->bios_scratch_reg_offset + 6, 0);
17231729
WREG32(adev->bios_scratch_reg_offset + 7, 0);

0 commit comments

Comments
 (0)