Skip to content

Commit 59b9d6b

Browse files
committed
Merge tag 'amd-drm-next-5.15-2021-08-06' of https://gitlab.freedesktop.org/agd5f/linux into drm-next
amd-drm-next-5.15-2021-08-06: amdgpu: - Aldebaran fixes - Powergating fix for Renoir - Switch virtual DCE over to vkms based atomic modesetting - Misc typo fixes - PSP handling cleanups - DC FP cleanups - RAS fixes - Wave debug improvements - Freesync fix - BACO/BOCO fixes - Misc fixes amdkfd: - Expose gfx version in sysfs - Aldebaran fixes radeon: - Coding style fix - Typo fixes - Pageflip fix UAPI: - amdkfd: SVM address range query Proposed userspace: https://github.com/RadeonOpenCompute/ROCR-Runtime/tree/memory_model_queries Signed-off-by: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 9efba20 + a43e2a0 commit 59b9d6b

File tree

96 files changed

+1611
-1196
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+1611
-1196
lines changed

drivers/gpu/drm/amd/amdgpu/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ amdgpu-y += \
120120
amdgpu-y += \
121121
dce_v10_0.o \
122122
dce_v11_0.o \
123-
dce_virtual.o
123+
amdgpu_vkms.o
124124

125125
# add GFX block
126126
amdgpu-y += \

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,7 @@ struct amdgpu_device {
916916

917917
/* display */
918918
bool enable_virtual_display;
919+
struct amdgpu_vkms_output *amdgpu_vkms_output;
919920
struct amdgpu_mode_info mode_info;
920921
/* For pre-DCE11. DCE11 and later are in "struct amdgpu_device->dm" */
921922
struct work_struct hotplug_work;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,7 @@ void amdgpu_acpi_detect(void)
10401040
*/
10411041
bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev)
10421042
{
1043-
#if defined(CONFIG_AMD_PMC) || defined(CONFIG_AMD_PMC_MODULE)
1043+
#if IS_ENABLED(CONFIG_AMD_PMC) && IS_ENABLED(CONFIG_PM_SLEEP)
10441044
if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) {
10451045
if (adev->flags & AMD_IS_APU)
10461046
return pm_suspend_target_state == PM_SUSPEND_TO_IDLE;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ int amdgpu_amdkfd_gpuvm_free_memory_of_gpu(
271271
struct kgd_dev *kgd, struct kgd_mem *mem, void *drm_priv,
272272
uint64_t *size);
273273
int amdgpu_amdkfd_gpuvm_map_memory_to_gpu(
274-
struct kgd_dev *kgd, struct kgd_mem *mem, void *drm_priv);
274+
struct kgd_dev *kgd, struct kgd_mem *mem, void *drm_priv, bool *table_freed);
275275
int amdgpu_amdkfd_gpuvm_unmap_memory_from_gpu(
276276
struct kgd_dev *kgd, struct kgd_mem *mem, void *drm_priv);
277277
int amdgpu_amdkfd_gpuvm_sync_memory(

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

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,8 @@ static void unmap_bo_from_gpuvm(struct kgd_mem *mem,
10571057

10581058
static int update_gpuvm_pte(struct kgd_mem *mem,
10591059
struct kfd_mem_attachment *entry,
1060-
struct amdgpu_sync *sync)
1060+
struct amdgpu_sync *sync,
1061+
bool *table_freed)
10611062
{
10621063
struct amdgpu_bo_va *bo_va = entry->bo_va;
10631064
struct amdgpu_device *adev = entry->adev;
@@ -1068,7 +1069,7 @@ static int update_gpuvm_pte(struct kgd_mem *mem,
10681069
return ret;
10691070

10701071
/* Update the page tables */
1071-
ret = amdgpu_vm_bo_update(adev, bo_va, false);
1072+
ret = amdgpu_vm_bo_update(adev, bo_va, false, table_freed);
10721073
if (ret) {
10731074
pr_err("amdgpu_vm_bo_update failed\n");
10741075
return ret;
@@ -1080,7 +1081,8 @@ static int update_gpuvm_pte(struct kgd_mem *mem,
10801081
static int map_bo_to_gpuvm(struct kgd_mem *mem,
10811082
struct kfd_mem_attachment *entry,
10821083
struct amdgpu_sync *sync,
1083-
bool no_update_pte)
1084+
bool no_update_pte,
1085+
bool *table_freed)
10841086
{
10851087
int ret;
10861088

@@ -1097,7 +1099,7 @@ static int map_bo_to_gpuvm(struct kgd_mem *mem,
10971099
if (no_update_pte)
10981100
return 0;
10991101

1100-
ret = update_gpuvm_pte(mem, entry, sync);
1102+
ret = update_gpuvm_pte(mem, entry, sync, table_freed);
11011103
if (ret) {
11021104
pr_err("update_gpuvm_pte() failed\n");
11031105
goto update_gpuvm_pte_failed;
@@ -1605,7 +1607,8 @@ int amdgpu_amdkfd_gpuvm_free_memory_of_gpu(
16051607
}
16061608

16071609
int amdgpu_amdkfd_gpuvm_map_memory_to_gpu(
1608-
struct kgd_dev *kgd, struct kgd_mem *mem, void *drm_priv)
1610+
struct kgd_dev *kgd, struct kgd_mem *mem,
1611+
void *drm_priv, bool *table_freed)
16091612
{
16101613
struct amdgpu_device *adev = get_amdgpu_device(kgd);
16111614
struct amdgpu_vm *avm = drm_priv_to_vm(drm_priv);
@@ -1693,7 +1696,7 @@ int amdgpu_amdkfd_gpuvm_map_memory_to_gpu(
16931696
entry->va, entry->va + bo_size, entry);
16941697

16951698
ret = map_bo_to_gpuvm(mem, entry, ctx.sync,
1696-
is_invalid_userptr);
1699+
is_invalid_userptr, table_freed);
16971700
if (ret) {
16981701
pr_err("Failed to map bo to gpuvm\n");
16991702
goto out_unreserve;
@@ -1717,6 +1720,12 @@ int amdgpu_amdkfd_gpuvm_map_memory_to_gpu(
17171720
true);
17181721
ret = unreserve_bo_and_vms(&ctx, false, false);
17191722

1723+
/* Only apply no TLB flush on Aldebaran to
1724+
* workaround regressions on other Asics.
1725+
*/
1726+
if (table_freed && (adev->asic_type != CHIP_ALDEBARAN))
1727+
*table_freed = true;
1728+
17201729
goto out;
17211730

17221731
out_unreserve:
@@ -2143,7 +2152,7 @@ static int validate_invalid_user_pages(struct amdkfd_process_info *process_info)
21432152
continue;
21442153

21452154
kfd_mem_dmaunmap_attachment(mem, attachment);
2146-
ret = update_gpuvm_pte(mem, attachment, &sync);
2155+
ret = update_gpuvm_pte(mem, attachment, &sync, NULL);
21472156
if (ret) {
21482157
pr_err("%s: update PTE failed\n", __func__);
21492158
/* make sure this gets validated again */
@@ -2349,7 +2358,7 @@ int amdgpu_amdkfd_gpuvm_restore_process_bos(void *info, struct dma_fence **ef)
23492358
continue;
23502359

23512360
kfd_mem_dmaunmap_attachment(mem, attachment);
2352-
ret = update_gpuvm_pte(mem, attachment, &sync_obj);
2361+
ret = update_gpuvm_pte(mem, attachment, &sync_obj, NULL);
23532362
if (ret) {
23542363
pr_debug("Memory eviction: update PTE failed. Try again\n");
23552364
goto validate_map_fail;

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

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,46 @@ bool amdgpu_atomfirmware_dynamic_boot_config_supported(struct amdgpu_device *ade
468468
return (fw_cap & ATOM_FIRMWARE_CAP_DYNAMIC_BOOT_CFG_ENABLE) ? true : false;
469469
}
470470

471+
/*
472+
* Helper function to query RAS EEPROM address
473+
*
474+
* @adev: amdgpu_device pointer
475+
*
476+
* Return true if vbios supports ras rom address reporting
477+
*/
478+
bool amdgpu_atomfirmware_ras_rom_addr(struct amdgpu_device *adev, uint8_t* i2c_address)
479+
{
480+
struct amdgpu_mode_info *mode_info = &adev->mode_info;
481+
int index;
482+
u16 data_offset, size;
483+
union firmware_info *firmware_info;
484+
u8 frev, crev;
485+
486+
if (i2c_address == NULL)
487+
return false;
488+
489+
*i2c_address = 0;
490+
491+
index = get_index_into_master_table(atom_master_list_of_data_tables_v2_1,
492+
firmwareinfo);
493+
494+
if (amdgpu_atom_parse_data_header(adev->mode_info.atom_context,
495+
index, &size, &frev, &crev, &data_offset)) {
496+
/* support firmware_info 3.4 + */
497+
if ((frev == 3 && crev >=4) || (frev > 3)) {
498+
firmware_info = (union firmware_info *)
499+
(mode_info->atom_context->bios + data_offset);
500+
*i2c_address = firmware_info->v34.ras_rom_i2c_slave_addr;
501+
}
502+
}
503+
504+
if (*i2c_address != 0)
505+
return true;
506+
507+
return false;
508+
}
509+
510+
471511
union smu_info {
472512
struct atom_smu_info_v3_1 v31;
473513
};

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ int amdgpu_atomfirmware_get_clock_info(struct amdgpu_device *adev);
3636
int amdgpu_atomfirmware_get_gfx_info(struct amdgpu_device *adev);
3737
bool amdgpu_atomfirmware_mem_ecc_supported(struct amdgpu_device *adev);
3838
bool amdgpu_atomfirmware_sram_ecc_supported(struct amdgpu_device *adev);
39+
bool amdgpu_atomfirmware_ras_rom_addr(struct amdgpu_device *adev, uint8_t* i2c_address);
3940
bool amdgpu_atomfirmware_mem_training_supported(struct amdgpu_device *adev);
4041
bool amdgpu_atomfirmware_dynamic_boot_config_supported(struct amdgpu_device *adev);
4142
int amdgpu_atomfirmware_get_fw_reserved_fb_size(struct amdgpu_device *adev);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ static int amdgpu_cs_vm_handling(struct amdgpu_cs_parser *p)
799799
if (r)
800800
return r;
801801

802-
r = amdgpu_vm_bo_update(adev, fpriv->prt_va, false);
802+
r = amdgpu_vm_bo_update(adev, fpriv->prt_va, false, NULL);
803803
if (r)
804804
return r;
805805

@@ -810,7 +810,7 @@ static int amdgpu_cs_vm_handling(struct amdgpu_cs_parser *p)
810810
if (amdgpu_mcbp || amdgpu_sriov_vf(adev)) {
811811
bo_va = fpriv->csa_va;
812812
BUG_ON(!bo_va);
813-
r = amdgpu_vm_bo_update(adev, bo_va, false);
813+
r = amdgpu_vm_bo_update(adev, bo_va, false, NULL);
814814
if (r)
815815
return r;
816816

@@ -829,7 +829,7 @@ static int amdgpu_cs_vm_handling(struct amdgpu_cs_parser *p)
829829
if (bo_va == NULL)
830830
continue;
831831

832-
r = amdgpu_vm_bo_update(adev, bo_va, false);
832+
r = amdgpu_vm_bo_update(adev, bo_va, false, NULL);
833833
if (r)
834834
return r;
835835

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3647,9 +3647,9 @@ int amdgpu_device_init(struct amdgpu_device *adev,
36473647

36483648
fence_driver_init:
36493649
/* Fence driver */
3650-
r = amdgpu_fence_driver_init(adev);
3650+
r = amdgpu_fence_driver_sw_init(adev);
36513651
if (r) {
3652-
dev_err(adev->dev, "amdgpu_fence_driver_init failed\n");
3652+
dev_err(adev->dev, "amdgpu_fence_driver_sw_init failed\n");
36533653
amdgpu_vf_error_put(adev, AMDGIM_ERROR_VF_FENCE_INIT_FAIL, 0, 0);
36543654
goto failed;
36553655
}
@@ -3989,7 +3989,6 @@ int amdgpu_device_resume(struct drm_device *dev, bool fbcon)
39893989
}
39903990
amdgpu_fence_driver_hw_init(adev);
39913991

3992-
39933992
r = amdgpu_device_ip_late_init(adev);
39943993
if (r)
39953994
return r;

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1215,6 +1215,13 @@ static const struct pci_device_id pciidlist[] = {
12151215
/* CYAN_SKILLFISH */
12161216
{0x1002, 0x13FE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYAN_SKILLFISH|AMD_IS_APU},
12171217

1218+
/* BEIGE_GOBY */
1219+
{0x1002, 0x7420, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BEIGE_GOBY},
1220+
{0x1002, 0x7421, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BEIGE_GOBY},
1221+
{0x1002, 0x7422, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BEIGE_GOBY},
1222+
{0x1002, 0x7423, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BEIGE_GOBY},
1223+
{0x1002, 0x743F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BEIGE_GOBY},
1224+
12181225
{0, 0, 0}
12191226
};
12201227

@@ -1231,7 +1238,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
12311238
int ret, retry = 0;
12321239
bool supports_atomic = false;
12331240

1234-
if (!amdgpu_virtual_display &&
1241+
if (amdgpu_virtual_display ||
12351242
amdgpu_device_asic_has_dc_support(flags & AMD_ASIC_MASK))
12361243
supports_atomic = true;
12371244

@@ -1566,6 +1573,8 @@ static int amdgpu_pmops_runtime_suspend(struct device *dev)
15661573
pci_ignore_hotplug(pdev);
15671574
pci_set_power_state(pdev, PCI_D3cold);
15681575
drm_dev->switch_power_state = DRM_SWITCH_POWER_DYNAMIC_OFF;
1576+
} else if (amdgpu_device_supports_boco(drm_dev)) {
1577+
/* nothing to do */
15691578
} else if (amdgpu_device_supports_baco(drm_dev)) {
15701579
amdgpu_device_baco_enter(drm_dev);
15711580
}

0 commit comments

Comments
 (0)