Skip to content

Commit 0d3a1b3

Browse files
committed
Merge tag 'amd-drm-next-5.14-2021-07-01' of https://gitlab.freedesktop.org/agd5f/linux into drm-next
amd-drm-next-5.14-2021-07-01: amdgpu: - Misc Navi fixes - Powergating fix - Yellow Carp updates - Beige Goby updates - S0ix fix - Revert overlay validation fix - GPU reset fix for DC - PPC64 fix - Add new dimgrey cavefish DID - RAS fix amdkfd: - SVM fixes radeon: - Fix missing drm_gem_object_put in error path Signed-off-by: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 8a02ea4 + 93c5bcd commit 0d3a1b3

40 files changed

+987
-464
lines changed

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

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,6 +1369,38 @@ static void amdgpu_device_check_smu_prv_buffer_size(struct amdgpu_device *adev)
13691369
adev->pm.smu_prv_buffer_size = 0;
13701370
}
13711371

1372+
static int amdgpu_device_init_apu_flags(struct amdgpu_device *adev)
1373+
{
1374+
if (!(adev->flags & AMD_IS_APU) ||
1375+
adev->asic_type < CHIP_RAVEN)
1376+
return 0;
1377+
1378+
switch (adev->asic_type) {
1379+
case CHIP_RAVEN:
1380+
if (adev->pdev->device == 0x15dd)
1381+
adev->apu_flags |= AMD_APU_IS_RAVEN;
1382+
if (adev->pdev->device == 0x15d8)
1383+
adev->apu_flags |= AMD_APU_IS_PICASSO;
1384+
break;
1385+
case CHIP_RENOIR:
1386+
if ((adev->pdev->device == 0x1636) ||
1387+
(adev->pdev->device == 0x164c))
1388+
adev->apu_flags |= AMD_APU_IS_RENOIR;
1389+
else
1390+
adev->apu_flags |= AMD_APU_IS_GREEN_SARDINE;
1391+
break;
1392+
case CHIP_VANGOGH:
1393+
adev->apu_flags |= AMD_APU_IS_VANGOGH;
1394+
break;
1395+
case CHIP_YELLOW_CARP:
1396+
break;
1397+
default:
1398+
return -EINVAL;
1399+
}
1400+
1401+
return 0;
1402+
}
1403+
13721404
/**
13731405
* amdgpu_device_check_arguments - validate module params
13741406
*
@@ -3386,6 +3418,10 @@ int amdgpu_device_init(struct amdgpu_device *adev,
33863418
mutex_init(&adev->psp.mutex);
33873419
mutex_init(&adev->notifier_lock);
33883420

3421+
r = amdgpu_device_init_apu_flags(adev);
3422+
if (r)
3423+
return r;
3424+
33893425
r = amdgpu_device_check_arguments(adev);
33903426
if (r)
33913427
return r;
@@ -4304,6 +4340,7 @@ bool amdgpu_device_should_recover_gpu(struct amdgpu_device *adev)
43044340
case CHIP_SIENNA_CICHLID:
43054341
case CHIP_NAVY_FLOUNDER:
43064342
case CHIP_DIMGREY_CAVEFISH:
4343+
case CHIP_BEIGE_GOBY:
43074344
case CHIP_VANGOGH:
43084345
case CHIP_ALDEBARAN:
43094346
break;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ int amdgpu_smu_pptable_id = -1;
160160
* highest. That helps saving some idle power.
161161
* DISABLE_FRACTIONAL_PWM (bit 2) disabled by default
162162
* PSR (bit 3) disabled by default
163+
* EDP NO POWER SEQUENCING (bit 4) disabled by default
163164
*/
164165
uint amdgpu_dc_feature_mask = 2;
165166
uint amdgpu_dc_debug_mask;
@@ -1198,6 +1199,7 @@ static const struct pci_device_id pciidlist[] = {
11981199
{0x1002, 0x73E0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_DIMGREY_CAVEFISH},
11991200
{0x1002, 0x73E1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_DIMGREY_CAVEFISH},
12001201
{0x1002, 0x73E2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_DIMGREY_CAVEFISH},
1202+
{0x1002, 0x73E3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_DIMGREY_CAVEFISH},
12011203
{0x1002, 0x73FF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_DIMGREY_CAVEFISH},
12021204

12031205
/* Aldebaran */

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,7 @@ void amdgpu_gmc_tmz_set(struct amdgpu_device *adev)
562562
case CHIP_NAVI14:
563563
case CHIP_NAVI12:
564564
case CHIP_VANGOGH:
565+
case CHIP_YELLOW_CARP:
565566
/* Don't enable it by default yet.
566567
*/
567568
if (amdgpu_tmz < 1) {

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ int amdgpu_hmm_range_get_pages(struct mmu_interval_notifier *notifier,
160160
struct mm_struct *mm, struct page **pages,
161161
uint64_t start, uint64_t npages,
162162
struct hmm_range **phmm_range, bool readonly,
163-
bool mmap_locked)
163+
bool mmap_locked, void *owner)
164164
{
165165
struct hmm_range *hmm_range;
166166
unsigned long timeout;
@@ -185,6 +185,7 @@ int amdgpu_hmm_range_get_pages(struct mmu_interval_notifier *notifier,
185185
hmm_range->hmm_pfns = pfns;
186186
hmm_range->start = start;
187187
hmm_range->end = start + npages * PAGE_SIZE;
188+
hmm_range->dev_private_owner = owner;
188189

189190
/* Assuming 512MB takes maxmium 1 second to fault page address */
190191
timeout = max(npages >> 17, 1ULL) * HMM_RANGE_DEFAULT_TIMEOUT;

drivers/gpu/drm/amd/amdgpu/amdgpu_mn.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ int amdgpu_hmm_range_get_pages(struct mmu_interval_notifier *notifier,
3434
struct mm_struct *mm, struct page **pages,
3535
uint64_t start, uint64_t npages,
3636
struct hmm_range **phmm_range, bool readonly,
37-
bool mmap_locked);
37+
bool mmap_locked, void *owner);
3838
int amdgpu_hmm_range_get_pages_done(struct hmm_range *hmm_range);
3939

4040
#if defined(CONFIG_HMM_MIRROR)

drivers/gpu/drm/amd/amdgpu/amdgpu_nbio.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ struct amdgpu_nbio_funcs {
9393
void (*enable_aspm)(struct amdgpu_device *adev,
9494
bool enable);
9595
void (*program_aspm)(struct amdgpu_device *adev);
96+
void (*apply_lc_spc_mode_wa)(struct amdgpu_device *adev);
97+
void (*apply_l1_link_width_reconfig_wa)(struct amdgpu_device *adev);
9698
};
9799

98100
struct amdgpu_nbio {

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -590,10 +590,6 @@ static int amdgpu_ttm_io_mem_reserve(struct ttm_device *bdev,
590590

591591
mem->bus.offset += adev->gmc.aper_base;
592592
mem->bus.is_iomem = true;
593-
if (adev->gmc.xgmi.connected_to_cpu)
594-
mem->bus.caching = ttm_cached;
595-
else
596-
mem->bus.caching = ttm_write_combined;
597593
break;
598594
default:
599595
return -EINVAL;
@@ -696,7 +692,7 @@ int amdgpu_ttm_tt_get_user_pages(struct amdgpu_bo *bo, struct page **pages)
696692
readonly = amdgpu_ttm_tt_is_readonly(ttm);
697693
r = amdgpu_hmm_range_get_pages(&bo->notifier, mm, pages, start,
698694
ttm->num_pages, &gtt->range, readonly,
699-
false);
695+
false, NULL);
700696
out_putmm:
701697
mmput(mm);
702698

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,11 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man,
463463
if (i == 1)
464464
node->base.placement |= TTM_PL_FLAG_CONTIGUOUS;
465465

466+
if (adev->gmc.xgmi.connected_to_cpu)
467+
node->base.bus.caching = ttm_cached;
468+
else
469+
node->base.bus.caching = ttm_write_combined;
470+
466471
atomic64_add(vis_usage, &mgr->vis_usage);
467472
*res = &node->base;
468473
return 0;

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,12 @@ athub_v2_0_update_medium_grain_clock_gating(struct amdgpu_device *adev,
3636
{
3737
uint32_t def, data;
3838

39+
if (!(adev->cg_flags & AMD_CG_SUPPORT_MC_MGCG))
40+
return;
41+
3942
def = data = RREG32_SOC15(ATHUB, 0, mmATHUB_MISC_CNTL);
4043

41-
if (enable && (adev->cg_flags & AMD_CG_SUPPORT_MC_MGCG))
44+
if (enable)
4245
data |= ATHUB_MISC_CNTL__CG_ENABLE_MASK;
4346
else
4447
data &= ~ATHUB_MISC_CNTL__CG_ENABLE_MASK;
@@ -53,10 +56,13 @@ athub_v2_0_update_medium_grain_light_sleep(struct amdgpu_device *adev,
5356
{
5457
uint32_t def, data;
5558

59+
if (!((adev->cg_flags & AMD_CG_SUPPORT_MC_LS) &&
60+
(adev->cg_flags & AMD_CG_SUPPORT_HDP_LS)))
61+
return;
62+
5663
def = data = RREG32_SOC15(ATHUB, 0, mmATHUB_MISC_CNTL);
5764

58-
if (enable && (adev->cg_flags & AMD_CG_SUPPORT_MC_LS) &&
59-
(adev->cg_flags & AMD_CG_SUPPORT_HDP_LS))
65+
if (enable)
6066
data |= ATHUB_MISC_CNTL__CG_MEM_LS_ENABLE_MASK;
6167
else
6268
data &= ~ATHUB_MISC_CNTL__CG_MEM_LS_ENABLE_MASK;

0 commit comments

Comments
 (0)