Skip to content

Commit 1f8bdc3

Browse files
committed
Merge tag 'amd-drm-next-6.13-2024-11-06' of https://gitlab.freedesktop.org/agd5f/linux into drm-next
amd-drm-next-6.13-2024-11-06: amdgpu: - Misc cleanups - OLED fixes - DCN 4.x fixes - DCN 3.5 fixes - 8K fixes - IPS fixes - DSC fixes - S3 fix - KASAN fix - SMU13 fixes - fdinfo fixes - USB-C fixes - ACPI fix - Fix dummy page overlapping mappings - Fix workload profile handling - Add user control for zero RPM on SMU13 - Cleaner shader updates - Stop syncing PRT map operations - Debugfs permissions fixes - Debugfs bounds check fix - RAS cleanups - Enforce isolation updates amdkfd: - Add topology cap flag for per queue reset - Add an interface to query whether KFD queues are present - Use dynamic allocation for get_cu_occupancy From: Alex Deucher <alexander.deucher@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241106163904.189108-1-alexander.deucher@amd.com Signed-off-by: Dave Airlie <airlied@redhat.com>
2 parents e175800 + f5d873f commit 1f8bdc3

File tree

148 files changed

+1680
-1021
lines changed

Some content is hidden

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

148 files changed

+1680
-1021
lines changed

Documentation/gpu/amdgpu/thermal.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,18 @@ fan_minimum_pwm
100100
.. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
101101
:doc: fan_minimum_pwm
102102

103+
fan_zero_rpm_enable
104+
----------------------
105+
106+
.. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
107+
:doc: fan_zero_rpm_enable
108+
109+
fan_zero_rpm_stop_temperature
110+
-----------------------------
111+
112+
.. kernel-doc:: drivers/gpu/drm/amd/pm/amdgpu_pm.c
113+
:doc: fan_zero_rpm_stop_temperature
114+
103115
GFXOFF
104116
======
105117

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118

119119
#define MAX_GPU_INSTANCE 64
120120

121-
#define GFX_SLICE_PERIOD msecs_to_jiffies(250)
121+
#define GFX_SLICE_PERIOD_MS 250
122122

123123
struct amdgpu_gpu_instance {
124124
struct amdgpu_device *adev;
@@ -1111,8 +1111,6 @@ struct amdgpu_device {
11111111
bool in_s3;
11121112
bool in_s4;
11131113
bool in_s0ix;
1114-
/* indicate amdgpu suspension status */
1115-
bool suspend_complete;
11161114

11171115
enum pp_mp1_state mp1_state;
11181116
struct amdgpu_doorbell_index doorbell_index;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ static union acpi_object *amdgpu_atif_call(struct amdgpu_atif *atif,
172172
&buffer);
173173
obj = (union acpi_object *)buffer.pointer;
174174

175-
/* Fail if calling the method fails and ATIF is supported */
176-
if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
175+
/* Fail if calling the method fails */
176+
if (ACPI_FAILURE(status)) {
177177
DRM_DEBUG_DRIVER("failed to evaluate ATIF got %s\n",
178178
acpi_format_exception(status));
179179
kfree(obj);

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,15 @@ int amdgpu_amdkfd_start_sched(struct amdgpu_device *adev, uint32_t node_id)
890890
return kgd2kfd_start_sched(adev->kfd.dev, node_id);
891891
}
892892

893+
/* check if there are KFD queues active */
894+
bool amdgpu_amdkfd_compute_active(struct amdgpu_device *adev, uint32_t node_id)
895+
{
896+
if (!adev->kfd.init_complete)
897+
return false;
898+
899+
return kgd2kfd_compute_active(adev->kfd.dev, node_id);
900+
}
901+
893902
/* Config CGTT_SQ_CLK_CTRL */
894903
int amdgpu_amdkfd_config_sq_perfmon(struct amdgpu_device *adev, uint32_t xcp_id,
895904
bool core_override_enable, bool reg_override_enable, bool perfmon_override_enable)

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ int amdgpu_amdkfd_start_sched(struct amdgpu_device *adev, uint32_t node_id);
268268
int amdgpu_amdkfd_stop_sched(struct amdgpu_device *adev, uint32_t node_id);
269269
int amdgpu_amdkfd_config_sq_perfmon(struct amdgpu_device *adev, uint32_t xcp_id,
270270
bool core_override_enable, bool reg_override_enable, bool perfmon_override_enable);
271+
bool amdgpu_amdkfd_compute_active(struct amdgpu_device *adev, uint32_t node_id);
271272

272273

273274
/* Read user wptr from a specified user address space with page fault
@@ -431,6 +432,7 @@ int kgd2kfd_check_and_lock_kfd(void);
431432
void kgd2kfd_unlock_kfd(void);
432433
int kgd2kfd_start_sched(struct kfd_dev *kfd, uint32_t node_id);
433434
int kgd2kfd_stop_sched(struct kfd_dev *kfd, uint32_t node_id);
435+
bool kgd2kfd_compute_active(struct kfd_dev *kfd, uint32_t node_id);
434436
#else
435437
static inline int kgd2kfd_init(void)
436438
{
@@ -511,5 +513,10 @@ static inline int kgd2kfd_stop_sched(struct kfd_dev *kfd, uint32_t node_id)
511513
{
512514
return 0;
513515
}
516+
517+
static inline bool kgd2kfd_compute_active(struct kfd_dev *kfd, uint32_t node_id)
518+
{
519+
return false;
520+
}
514521
#endif
515522
#endif /* AMDGPU_AMDKFD_H_INCLUDED */

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ static ssize_t amdgpu_debugfs_gprwave_read(struct file *f, char __user *buf, siz
402402
int r;
403403
uint32_t *data, x;
404404

405-
if (size & 0x3 || *pos & 0x3)
405+
if (size > 4096 || size & 0x3 || *pos & 0x3)
406406
return -EINVAL;
407407

408408
r = pm_runtime_get_sync(adev_to_drm(adev)->dev);
@@ -1648,7 +1648,7 @@ int amdgpu_debugfs_regs_init(struct amdgpu_device *adev)
16481648

16491649
for (i = 0; i < ARRAY_SIZE(debugfs_regs); i++) {
16501650
ent = debugfs_create_file(debugfs_regs_names[i],
1651-
S_IFREG | 0444, root,
1651+
S_IFREG | 0400, root,
16521652
adev, debugfs_regs[i]);
16531653
if (!i && !IS_ERR_OR_NULL(ent))
16541654
i_size_write(ent->d_inode, adev->rmmio_size);
@@ -2096,17 +2096,20 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev)
20962096
amdgpu_debugfs_umsch_fwlog_init(adev, &adev->umsch_mm);
20972097

20982098
amdgpu_debugfs_jpeg_sched_mask_init(adev);
2099+
amdgpu_debugfs_gfx_sched_mask_init(adev);
2100+
amdgpu_debugfs_compute_sched_mask_init(adev);
2101+
amdgpu_debugfs_sdma_sched_mask_init(adev);
20992102

21002103
amdgpu_ras_debugfs_create_all(adev);
21012104
amdgpu_rap_debugfs_init(adev);
21022105
amdgpu_securedisplay_debugfs_init(adev);
21032106
amdgpu_fw_attestation_debugfs_init(adev);
21042107

2105-
debugfs_create_file("amdgpu_evict_vram", 0444, root, adev,
2108+
debugfs_create_file("amdgpu_evict_vram", 0400, root, adev,
21062109
&amdgpu_evict_vram_fops);
2107-
debugfs_create_file("amdgpu_evict_gtt", 0444, root, adev,
2110+
debugfs_create_file("amdgpu_evict_gtt", 0400, root, adev,
21082111
&amdgpu_evict_gtt_fops);
2109-
debugfs_create_file("amdgpu_test_ib", 0444, root, adev,
2112+
debugfs_create_file("amdgpu_test_ib", 0400, root, adev,
21102113
&amdgpu_debugfs_test_ib_fops);
21112114
debugfs_create_file("amdgpu_vm_info", 0444, root, adev,
21122115
&amdgpu_debugfs_vm_info_fops);

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6452,6 +6452,9 @@ bool amdgpu_device_cache_pci_state(struct pci_dev *pdev)
64526452
struct amdgpu_device *adev = drm_to_adev(dev);
64536453
int r;
64546454

6455+
if (amdgpu_sriov_vf(adev))
6456+
return false;
6457+
64556458
r = pci_save_state(pdev);
64566459
if (!r) {
64576460
kfree(adev->pci_state);

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,11 +1795,13 @@ int amdgpu_discovery_get_nps_info(struct amdgpu_device *adev,
17951795

17961796
switch (le16_to_cpu(nps_info->v1.header.version_major)) {
17971797
case 1:
1798+
mem_ranges = kvcalloc(nps_info->v1.count,
1799+
sizeof(*mem_ranges),
1800+
GFP_KERNEL);
1801+
if (!mem_ranges)
1802+
return -ENOMEM;
17981803
*nps_type = nps_info->v1.nps_type;
17991804
*range_cnt = nps_info->v1.count;
1800-
mem_ranges = kvzalloc(
1801-
*range_cnt * sizeof(struct amdgpu_gmc_memrange),
1802-
GFP_KERNEL);
18031805
for (i = 0; i < *range_cnt; i++) {
18041806
mem_ranges[i].base_address =
18051807
nps_info->v1.instance_info[i].base_address;

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ module_param_named(visualconfirm, amdgpu_dc_visual_confirm, uint, 0444);
888888
* the ABM algorithm, with 1 being the least reduction and 4 being the most
889889
* reduction.
890890
*
891-
* Defaults to -1, or disabled. Userspace can only override this level after
891+
* Defaults to -1, or auto. Userspace can only override this level after
892892
* boot if it's set to auto.
893893
*/
894894
int amdgpu_dm_abm_level = -1;
@@ -2505,7 +2505,6 @@ static int amdgpu_pmops_suspend(struct device *dev)
25052505
struct drm_device *drm_dev = dev_get_drvdata(dev);
25062506
struct amdgpu_device *adev = drm_to_adev(drm_dev);
25072507

2508-
adev->suspend_complete = false;
25092508
if (amdgpu_acpi_is_s0ix_active(adev))
25102509
adev->in_s0ix = true;
25112510
else if (amdgpu_acpi_is_s3_active(adev))
@@ -2520,7 +2519,6 @@ static int amdgpu_pmops_suspend_noirq(struct device *dev)
25202519
struct drm_device *drm_dev = dev_get_drvdata(dev);
25212520
struct amdgpu_device *adev = drm_to_adev(drm_dev);
25222521

2523-
adev->suspend_complete = true;
25242522
if (amdgpu_acpi_should_gpu_reset(adev))
25252523
return amdgpu_asic_reset(adev);
25262524

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ static int amdgpu_eeprom_xfer(struct i2c_adapter *i2c_adap, u32 eeprom_addr,
200200
dev_err_ratelimited(&i2c_adap->dev,
201201
"maddr:0x%04X size:0x%02X:quirk max_%s_len must be > %d",
202202
eeprom_addr, buf_size,
203-
read ? "read" : "write", EEPROM_OFFSET_SIZE);
203+
str_read_write(read), EEPROM_OFFSET_SIZE);
204204
return -EINVAL;
205205
}
206206

0 commit comments

Comments
 (0)