Skip to content

Commit 6318080

Browse files
committed
Merge tag 'amd-drm-next-6.7-2023-10-27' of https://gitlab.freedesktop.org/agd5f/linux into drm-next
amd-drm-next-6.7-2023-10-27: amdgpu: - RAS fixes - Seamless boot fixes - NBIO 7.7 fix - SMU 14.0 fixes - GC 11.5 fixes - DML2 fixes - ASPM fixes - VPE fixes - Misc code cleanups - SRIOV fixes - Add some missing copyright notices - DCN 3.5 fixes - FAMS fixes - Backlight fix - S/G display fix - fdinfo cleanups - EXT_COHERENT fixes for APU and NUMA systems amdkfd: - Misc fixes - Misc code cleanups - SVM fixes Signed-off-by: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 915b6d0 + dd3dd98 commit 6318080

File tree

137 files changed

+1474
-698
lines changed

Some content is hidden

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

137 files changed

+1474
-698
lines changed

drivers/gpu/drm/amd/amdgpu/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ amdgpu-y += \
104104
amdgpu-y += \
105105
df_v1_7.o \
106106
df_v3_6.o \
107-
df_v4_3.o
107+
df_v4_3.o \
108+
df_v4_6_2.o
108109

109110
# add GMC block
110111
amdgpu-y += \

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,13 @@ static inline uint32_t amdgpu_ip_version(const struct amdgpu_device *adev,
11191119
return adev->ip_versions[ip][inst] & ~0xFFU;
11201120
}
11211121

1122+
static inline uint32_t amdgpu_ip_version_full(const struct amdgpu_device *adev,
1123+
uint8_t ip, uint8_t inst)
1124+
{
1125+
/* This returns full version - major/minor/rev/variant/subrevision */
1126+
return adev->ip_versions[ip][inst];
1127+
}
1128+
11221129
static inline struct amdgpu_device *drm_to_adev(struct drm_device *ddev)
11231130
{
11241131
return container_of(ddev, struct amdgpu_device, ddev);
@@ -1333,9 +1340,7 @@ void amdgpu_device_pci_config_reset(struct amdgpu_device *adev);
13331340
int amdgpu_device_pci_reset(struct amdgpu_device *adev);
13341341
bool amdgpu_device_need_post(struct amdgpu_device *adev);
13351342
bool amdgpu_device_seamless_boot_supported(struct amdgpu_device *adev);
1336-
bool amdgpu_device_pcie_dynamic_switching_supported(void);
13371343
bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev);
1338-
bool amdgpu_device_aspm_support_quirk(void);
13391344

13401345
void amdgpu_cs_report_moved_bytes(struct amdgpu_device *adev, u64 num_bytes,
13411346
u64 num_vis_bytes);

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

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ struct amdgpu_acpi_xcc_info {
6868
struct amdgpu_acpi_dev_info {
6969
struct list_head list;
7070
struct list_head xcc_list;
71-
uint16_t bdf;
71+
uint32_t sbdf;
7272
uint16_t supp_xcp_mode;
7373
uint16_t xcp_mode;
7474
uint16_t mem_mode;
@@ -927,22 +927,22 @@ static acpi_status amdgpu_acpi_get_node_id(acpi_handle handle,
927927
#endif
928928
}
929929

930-
static struct amdgpu_acpi_dev_info *amdgpu_acpi_get_dev(u16 bdf)
930+
static struct amdgpu_acpi_dev_info *amdgpu_acpi_get_dev(u32 sbdf)
931931
{
932932
struct amdgpu_acpi_dev_info *acpi_dev;
933933

934934
if (list_empty(&amdgpu_acpi_dev_list))
935935
return NULL;
936936

937937
list_for_each_entry(acpi_dev, &amdgpu_acpi_dev_list, list)
938-
if (acpi_dev->bdf == bdf)
938+
if (acpi_dev->sbdf == sbdf)
939939
return acpi_dev;
940940

941941
return NULL;
942942
}
943943

944944
static int amdgpu_acpi_dev_init(struct amdgpu_acpi_dev_info **dev_info,
945-
struct amdgpu_acpi_xcc_info *xcc_info, u16 bdf)
945+
struct amdgpu_acpi_xcc_info *xcc_info, u32 sbdf)
946946
{
947947
struct amdgpu_acpi_dev_info *tmp;
948948
union acpi_object *obj;
@@ -955,7 +955,7 @@ static int amdgpu_acpi_dev_init(struct amdgpu_acpi_dev_info **dev_info,
955955

956956
INIT_LIST_HEAD(&tmp->xcc_list);
957957
INIT_LIST_HEAD(&tmp->list);
958-
tmp->bdf = bdf;
958+
tmp->sbdf = sbdf;
959959

960960
obj = acpi_evaluate_dsm_typed(xcc_info->handle, &amd_xcc_dsm_guid, 0,
961961
AMD_XCC_DSM_GET_SUPP_MODE, NULL,
@@ -1007,7 +1007,7 @@ static int amdgpu_acpi_dev_init(struct amdgpu_acpi_dev_info **dev_info,
10071007

10081008
DRM_DEBUG_DRIVER(
10091009
"New dev(%x): Supported xcp mode: %x curr xcp_mode : %x mem mode : %x, tmr base: %llx tmr size: %llx ",
1010-
tmp->bdf, tmp->supp_xcp_mode, tmp->xcp_mode, tmp->mem_mode,
1010+
tmp->sbdf, tmp->supp_xcp_mode, tmp->xcp_mode, tmp->mem_mode,
10111011
tmp->tmr_base, tmp->tmr_size);
10121012
list_add_tail(&tmp->list, &amdgpu_acpi_dev_list);
10131013
*dev_info = tmp;
@@ -1023,7 +1023,7 @@ static int amdgpu_acpi_dev_init(struct amdgpu_acpi_dev_info **dev_info,
10231023
}
10241024

10251025
static int amdgpu_acpi_get_xcc_info(struct amdgpu_acpi_xcc_info *xcc_info,
1026-
u16 *bdf)
1026+
u32 *sbdf)
10271027
{
10281028
union acpi_object *obj;
10291029
acpi_status status;
@@ -1054,8 +1054,10 @@ static int amdgpu_acpi_get_xcc_info(struct amdgpu_acpi_xcc_info *xcc_info,
10541054
xcc_info->phy_id = (obj->integer.value >> 32) & 0xFF;
10551055
/* xcp node of this xcc [47:40] */
10561056
xcc_info->xcp_node = (obj->integer.value >> 40) & 0xFF;
1057+
/* PF domain of this xcc [31:16] */
1058+
*sbdf = (obj->integer.value) & 0xFFFF0000;
10571059
/* PF bus/dev/fn of this xcc [63:48] */
1058-
*bdf = (obj->integer.value >> 48) & 0xFFFF;
1060+
*sbdf |= (obj->integer.value >> 48) & 0xFFFF;
10591061
ACPI_FREE(obj);
10601062
obj = NULL;
10611063

@@ -1079,7 +1081,7 @@ static int amdgpu_acpi_enumerate_xcc(void)
10791081
struct acpi_device *acpi_dev;
10801082
char hid[ACPI_ID_LEN];
10811083
int ret, id;
1082-
u16 bdf;
1084+
u32 sbdf;
10831085

10841086
INIT_LIST_HEAD(&amdgpu_acpi_dev_list);
10851087
xa_init(&numa_info_xa);
@@ -1107,16 +1109,16 @@ static int amdgpu_acpi_enumerate_xcc(void)
11071109
xcc_info->handle = acpi_device_handle(acpi_dev);
11081110
acpi_dev_put(acpi_dev);
11091111

1110-
ret = amdgpu_acpi_get_xcc_info(xcc_info, &bdf);
1112+
ret = amdgpu_acpi_get_xcc_info(xcc_info, &sbdf);
11111113
if (ret) {
11121114
kfree(xcc_info);
11131115
continue;
11141116
}
11151117

1116-
dev_info = amdgpu_acpi_get_dev(bdf);
1118+
dev_info = amdgpu_acpi_get_dev(sbdf);
11171119

11181120
if (!dev_info)
1119-
ret = amdgpu_acpi_dev_init(&dev_info, xcc_info, bdf);
1121+
ret = amdgpu_acpi_dev_init(&dev_info, xcc_info, sbdf);
11201122

11211123
if (ret == -ENOMEM)
11221124
return ret;
@@ -1136,13 +1138,14 @@ int amdgpu_acpi_get_tmr_info(struct amdgpu_device *adev, u64 *tmr_offset,
11361138
u64 *tmr_size)
11371139
{
11381140
struct amdgpu_acpi_dev_info *dev_info;
1139-
u16 bdf;
1141+
u32 sbdf;
11401142

11411143
if (!tmr_offset || !tmr_size)
11421144
return -EINVAL;
11431145

1144-
bdf = pci_dev_id(adev->pdev);
1145-
dev_info = amdgpu_acpi_get_dev(bdf);
1146+
sbdf = (pci_domain_nr(adev->pdev->bus) << 16);
1147+
sbdf |= pci_dev_id(adev->pdev);
1148+
dev_info = amdgpu_acpi_get_dev(sbdf);
11461149
if (!dev_info)
11471150
return -ENOENT;
11481151

@@ -1157,13 +1160,14 @@ int amdgpu_acpi_get_mem_info(struct amdgpu_device *adev, int xcc_id,
11571160
{
11581161
struct amdgpu_acpi_dev_info *dev_info;
11591162
struct amdgpu_acpi_xcc_info *xcc_info;
1160-
u16 bdf;
1163+
u32 sbdf;
11611164

11621165
if (!numa_info)
11631166
return -EINVAL;
11641167

1165-
bdf = pci_dev_id(adev->pdev);
1166-
dev_info = amdgpu_acpi_get_dev(bdf);
1168+
sbdf = (pci_domain_nr(adev->pdev->bus) << 16);
1169+
sbdf |= pci_dev_id(adev->pdev);
1170+
dev_info = amdgpu_acpi_get_dev(sbdf);
11671171
if (!dev_info)
11681172
return -ENOENT;
11691173

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,9 @@ static ssize_t amdgpu_debugfs_regs_smc_read(struct file *f, char __user *buf,
748748
ssize_t result = 0;
749749
int r;
750750

751+
if (!adev->smc_rreg)
752+
return -EPERM;
753+
751754
if (size & 0x3 || *pos & 0x3)
752755
return -EINVAL;
753756

@@ -804,6 +807,9 @@ static ssize_t amdgpu_debugfs_regs_smc_write(struct file *f, const char __user *
804807
ssize_t result = 0;
805808
int r;
806809

810+
if (!adev->smc_wreg)
811+
return -EPERM;
812+
807813
if (size & 0x3 || *pos & 0x3)
808814
return -EINVAL;
809815

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

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,14 +1456,14 @@ bool amdgpu_device_seamless_boot_supported(struct amdgpu_device *adev)
14561456
}
14571457

14581458
/*
1459-
* Intel hosts such as Raptor Lake and Sapphire Rapids don't support dynamic
1460-
* speed switching. Until we have confirmation from Intel that a specific host
1461-
* supports it, it's safer that we keep it disabled for all.
1459+
* Intel hosts such as Rocket Lake, Alder Lake, Raptor Lake and Sapphire Rapids
1460+
* don't support dynamic speed switching. Until we have confirmation from Intel
1461+
* that a specific host supports it, it's safer that we keep it disabled for all.
14621462
*
14631463
* https://edc.intel.com/content/www/us/en/design/products/platforms/details/raptor-lake-s/13th-generation-core-processors-datasheet-volume-1-of-2/005/pci-express-support/
14641464
* https://gitlab.freedesktop.org/drm/amd/-/issues/2663
14651465
*/
1466-
bool amdgpu_device_pcie_dynamic_switching_supported(void)
1466+
static bool amdgpu_device_pcie_dynamic_switching_supported(void)
14671467
{
14681468
#if IS_ENABLED(CONFIG_X86)
14691469
struct cpuinfo_x86 *c = &cpu_data(0);
@@ -1496,20 +1496,13 @@ bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev)
14961496
default:
14971497
return false;
14981498
}
1499+
if (adev->flags & AMD_IS_APU)
1500+
return false;
1501+
if (!(adev->pm.pp_feature & PP_PCIE_DPM_MASK))
1502+
return false;
14991503
return pcie_aspm_enabled(adev->pdev);
15001504
}
15011505

1502-
bool amdgpu_device_aspm_support_quirk(void)
1503-
{
1504-
#if IS_ENABLED(CONFIG_X86)
1505-
struct cpuinfo_x86 *c = &cpu_data(0);
1506-
1507-
return !(c->x86 == 6 && c->x86_model == INTEL_FAM6_ALDERLAKE);
1508-
#else
1509-
return true;
1510-
#endif
1511-
}
1512-
15131506
/* if we get transitioned to only one device, take VGA back */
15141507
/**
15151508
* amdgpu_device_vga_set_decode - enable/disable vga decode
@@ -2315,6 +2308,8 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev)
23152308
adev->pm.pp_feature &= ~PP_GFXOFF_MASK;
23162309
if (amdgpu_sriov_vf(adev) && adev->asic_type == CHIP_SIENNA_CICHLID)
23172310
adev->pm.pp_feature &= ~PP_OVERDRIVE_MASK;
2311+
if (!amdgpu_device_pcie_dynamic_switching_supported())
2312+
adev->pm.pp_feature &= ~PP_PCIE_DPM_MASK;
23182313

23192314
total = true;
23202315
for (i = 0; i < adev->num_ip_blocks; i++) {

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "df_v1_7.h"
3636
#include "df_v3_6.h"
3737
#include "df_v4_3.h"
38+
#include "df_v4_6_2.h"
3839
#include "nbio_v6_1.h"
3940
#include "nbio_v7_0.h"
4041
#include "nbio_v7_4.h"
@@ -1487,7 +1488,7 @@ static int amdgpu_discovery_get_gfx_info(struct amdgpu_device *adev)
14871488
adev->gfx.config.num_sc_per_sh = le32_to_cpu(gc_info->v2.gc_num_sc_per_se) /
14881489
le32_to_cpu(gc_info->v2.gc_num_sh_per_se);
14891490
adev->gfx.config.num_packer_per_sc = le32_to_cpu(gc_info->v2.gc_num_packer_per_sc);
1490-
if (le16_to_cpu(gc_info->v2.header.version_minor == 1)) {
1491+
if (le16_to_cpu(gc_info->v2.header.version_minor) == 1) {
14911492
adev->gfx.config.gc_num_tcp_per_sa = le32_to_cpu(gc_info->v2_1.gc_num_tcp_per_sh);
14921493
adev->gfx.config.gc_tcp_size_per_cu = le32_to_cpu(gc_info->v2_1.gc_tcp_size_per_cu);
14931494
adev->gfx.config.gc_num_sdp_interface = le32_to_cpu(gc_info->v2_1.gc_num_sdp_interface); /* per XCD */
@@ -2559,6 +2560,9 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev)
25592560
case IP_VERSION(4, 3, 0):
25602561
adev->df.funcs = &df_v4_3_funcs;
25612562
break;
2563+
case IP_VERSION(4, 6, 2):
2564+
adev->df.funcs = &df_v4_6_2_funcs;
2565+
break;
25622566
default:
25632567
break;
25642568
}

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,15 @@ static const char *amdgpu_ip_name[AMDGPU_HW_IP_NUM] = {
5656

5757
void amdgpu_show_fdinfo(struct drm_printer *p, struct drm_file *file)
5858
{
59-
struct amdgpu_device *adev = drm_to_adev(file->minor->dev);
6059
struct amdgpu_fpriv *fpriv = file->driver_priv;
6160
struct amdgpu_vm *vm = &fpriv->vm;
6261

6362
struct amdgpu_mem_stats stats;
6463
ktime_t usage[AMDGPU_HW_IP_NUM];
65-
uint32_t bus, dev, fn, domain;
6664
unsigned int hw_ip;
6765
int ret;
6866

6967
memset(&stats, 0, sizeof(stats));
70-
bus = adev->pdev->bus->number;
71-
domain = pci_domain_nr(adev->pdev->bus);
72-
dev = PCI_SLOT(adev->pdev->devfn);
73-
fn = PCI_FUNC(adev->pdev->devfn);
7468

7569
ret = amdgpu_bo_reserve(vm->root.bo, false);
7670
if (ret)
@@ -88,9 +82,6 @@ void amdgpu_show_fdinfo(struct drm_printer *p, struct drm_file *file)
8882
*/
8983

9084
drm_printf(p, "pasid:\t%u\n", fpriv->vm.pasid);
91-
drm_printf(p, "drm-driver:\t%s\n", file->minor->dev->driver->name);
92-
drm_printf(p, "drm-pdev:\t%04x:%02x:%02x.%d\n", domain, bus, dev, fn);
93-
drm_printf(p, "drm-client-id:\t%llu\n", vm->immediate.fence_context);
9485
drm_printf(p, "drm-memory-vram:\t%llu KiB\n", stats.vram/1024UL);
9586
drm_printf(p, "drm-memory-gtt: \t%llu KiB\n", stats.gtt/1024UL);
9687
drm_printf(p, "drm-memory-cpu: \t%llu KiB\n", stats.cpu/1024UL);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,7 @@ void amdgpu_gmc_tmz_set(struct amdgpu_device *adev)
786786
/* YELLOW_CARP*/
787787
case IP_VERSION(10, 3, 3):
788788
case IP_VERSION(11, 0, 4):
789+
case IP_VERSION(11, 5, 0):
789790
/* Don't enable it by default yet.
790791
*/
791792
if (amdgpu_tmz < 1) {

0 commit comments

Comments
 (0)