Skip to content

Commit 8368e97

Browse files
committed
Merge tag 'amd-drm-next-6.14-2024-12-18' of https://gitlab.freedesktop.org/agd5f/linux into drm-next
amd-drm-next-6.14-2024-12-18: amdgpu: - RAS updates - ISP updates - SDMA queue reset support - Rework DPM powergating interfaces - Documentation updates and cleanups - Panel replay fixes - DCN 3.5 updates - DP tunneling fixes - Use a pm notifier to more gracefully handle VRAM eviction on suspend or hibernate - Add debugfs interfaces for forcing scheduling to specific engine instances - GG 9.5 updates - IH 4.4 updates - Make missing optional firmware less noisy - PSP 13.x updates - SMU 13.x updates - VCN 5.x updates - JPEG 5.x updates - Misc cleanups - GC 12.x updates - DRM panic support - DC FAMS updates - DSC fixes - job handling fixes amdkfd: - GG 9.5 updates - Logging improvements - Misc cleanups - Various Optimizations Signed-off-by: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 38e9610 + 695c2c7 commit 8368e97

File tree

307 files changed

+10497
-3722
lines changed

Some content is hidden

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

307 files changed

+10497
-3722
lines changed

drivers/gpu/drm/amd/amdgpu/Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright 2017 Advanced Micro Devices, Inc.
2+
# Copyright 2017-2024 Advanced Micro Devices, Inc. All rights reserved.
33
#
44
# Permission is hereby granted, free of charge, to any person obtaining a
55
# copy of this software and associated documentation files (the "Software"),
@@ -105,7 +105,7 @@ amdgpu-y += \
105105

106106
# add UMC block
107107
amdgpu-y += \
108-
umc_v6_0.o umc_v6_1.o umc_v6_7.o umc_v8_7.o umc_v8_10.o umc_v12_0.o
108+
umc_v6_0.o umc_v6_1.o umc_v6_7.o umc_v8_7.o umc_v8_10.o umc_v12_0.o umc_v8_14.o
109109

110110
# add IH block
111111
amdgpu-y += \
@@ -200,6 +200,7 @@ amdgpu-y += \
200200
vcn_v4_0_3.o \
201201
vcn_v4_0_5.o \
202202
vcn_v5_0_0.o \
203+
vcn_v5_0_1.o \
203204
amdgpu_jpeg.o \
204205
jpeg_v1_0.o \
205206
jpeg_v2_0.o \
@@ -208,7 +209,8 @@ amdgpu-y += \
208209
jpeg_v4_0.o \
209210
jpeg_v4_0_3.o \
210211
jpeg_v4_0_5.o \
211-
jpeg_v5_0_0.o
212+
jpeg_v5_0_0.o \
213+
jpeg_v5_0_1.o
212214

213215
# add VPE block
214216
amdgpu-y += \

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,8 @@ aldebaran_mode2_restore_hwcontext(struct amdgpu_reset_control *reset_ctl,
334334
AMDGPU_INIT_LEVEL_RESET_RECOVERY);
335335
dev_info(tmp_adev->dev,
336336
"GPU reset succeeded, trying to resume\n");
337+
/*TBD: Ideally should clear only GFX, SDMA blocks*/
338+
amdgpu_ras_clear_err_state(tmp_adev);
337339
r = aldebaran_mode2_restore_ip(tmp_adev);
338340
if (r)
339341
goto end;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,6 +880,7 @@ struct amdgpu_device {
880880
bool need_swiotlb;
881881
bool accel_working;
882882
struct notifier_block acpi_nb;
883+
struct notifier_block pm_nb;
883884
struct amdgpu_i2c_chan *i2c_bus[AMDGPU_MAX_I2C_BUS];
884885
struct debugfs_blob_wrapper debugfs_vbios_blob;
885886
struct debugfs_blob_wrapper debugfs_discovery_blob;
@@ -1174,7 +1175,6 @@ struct amdgpu_device {
11741175

11751176
struct work_struct reset_work;
11761177

1177-
bool job_hang;
11781178
bool dc_enabled;
11791179
/* Mask of active clusters */
11801180
uint32_t aid_mask;

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ struct ras_query_context;
7171
#define ACA_ERROR_CE_MASK BIT_MASK(ACA_ERROR_TYPE_CE)
7272
#define ACA_ERROR_DEFERRED_MASK BIT_MASK(ACA_ERROR_TYPE_DEFERRED)
7373

74+
#define mmSMNAID_AID0_MCA_SMU 0x03b30400 /* SMN AID AID0 */
75+
#define mmSMNAID_XCD0_MCA_SMU 0x36430400 /* SMN AID XCD0 */
76+
#define mmSMNAID_XCD1_MCA_SMU 0x38430400 /* SMN AID XCD1 */
77+
#define mmSMNXCD_XCD0_MCA_SMU 0x40430400 /* SMN XCD XCD0 */
78+
7479
enum aca_reg_idx {
7580
ACA_REG_IDX_CTL = 0,
7681
ACA_REG_IDX_STATUS = 1,

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static int acp_poweroff(struct generic_pm_domain *genpd)
140140
* 2. power off the acp tiles
141141
* 3. check and enter ulv state
142142
*/
143-
amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, true);
143+
amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, true, 0);
144144
return 0;
145145
}
146146

@@ -157,7 +157,7 @@ static int acp_poweron(struct generic_pm_domain *genpd)
157157
* 2. turn on acp clock
158158
* 3. power on acp tiles
159159
*/
160-
amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, false);
160+
amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, false, 0);
161161
return 0;
162162
}
163163

@@ -236,7 +236,7 @@ static int acp_hw_init(struct amdgpu_ip_block *ip_block)
236236
ip_block->version->major, ip_block->version->minor);
237237
/* -ENODEV means board uses AZ rather than ACP */
238238
if (r == -ENODEV) {
239-
amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, true);
239+
amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, true, 0);
240240
return 0;
241241
} else if (r) {
242242
return r;
@@ -508,7 +508,7 @@ static int acp_hw_fini(struct amdgpu_ip_block *ip_block)
508508

509509
/* return early if no ACP */
510510
if (!adev->acp.acp_genpd) {
511-
amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, false);
511+
amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, false, 0);
512512
return 0;
513513
}
514514

@@ -565,7 +565,7 @@ static int acp_suspend(struct amdgpu_ip_block *ip_block)
565565

566566
/* power up on suspend */
567567
if (!adev->acp.acp_cell)
568-
amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, false);
568+
amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, false, 0);
569569
return 0;
570570
}
571571

@@ -575,7 +575,7 @@ static int acp_resume(struct amdgpu_ip_block *ip_block)
575575

576576
/* power down again on resume */
577577
if (!adev->acp.acp_cell)
578-
amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, true);
578+
amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, true, 0);
579579
return 0;
580580
}
581581

@@ -584,19 +584,19 @@ static bool acp_is_idle(void *handle)
584584
return true;
585585
}
586586

587-
static int acp_set_clockgating_state(void *handle,
587+
static int acp_set_clockgating_state(struct amdgpu_ip_block *ip_block,
588588
enum amd_clockgating_state state)
589589
{
590590
return 0;
591591
}
592592

593-
static int acp_set_powergating_state(void *handle,
593+
static int acp_set_powergating_state(struct amdgpu_ip_block *ip_block,
594594
enum amd_powergating_state state)
595595
{
596-
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
596+
struct amdgpu_device *adev = ip_block->adev;
597597
bool enable = (state == AMD_PG_STATE_GATE);
598598

599-
amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, enable);
599+
amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, enable, 0);
600600

601601
return 0;
602602
}

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ void amdgpu_amdkfd_free_gtt_mem(struct amdgpu_device *adev, void **mem_obj)
368368
{
369369
struct amdgpu_bo **bo = (struct amdgpu_bo **) mem_obj;
370370

371-
amdgpu_bo_reserve(*bo, true);
371+
(void)amdgpu_bo_reserve(*bo, true);
372372
amdgpu_bo_kunmap(*bo);
373373
amdgpu_bo_unpin(*bo);
374374
amdgpu_bo_unreserve(*bo);
@@ -724,7 +724,9 @@ void amdgpu_amdkfd_set_compute_idle(struct amdgpu_device *adev, bool idle)
724724
/* Disable GFXOFF and PG. Temporary workaround
725725
* to fix some compute applications issue on GFX9.
726726
*/
727-
adev->ip_blocks[AMD_IP_BLOCK_TYPE_GFX].version->funcs->set_powergating_state((void *)adev, state);
727+
struct amdgpu_ip_block *gfx_block = amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_GFX);
728+
if (gfx_block != NULL)
729+
gfx_block->version->funcs->set_powergating_state((void *)gfx_block, state);
728730
}
729731
amdgpu_dpm_switch_power_profile(adev,
730732
PP_SMC_POWER_PROFILE_COMPUTE,
@@ -834,7 +836,7 @@ int amdgpu_amdkfd_unmap_hiq(struct amdgpu_device *adev, u32 doorbell_off,
834836
if (!kiq->pmf || !kiq->pmf->kiq_unmap_queues)
835837
return -EINVAL;
836838

837-
if (!kiq_ring->sched.ready || adev->job_hang)
839+
if (!kiq_ring->sched.ready || amdgpu_in_reset(adev))
838840
return 0;
839841

840842
ring_funcs = kzalloc(sizeof(*ring_funcs), GFP_KERNEL);

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,9 @@ void kgd2kfd_unlock_kfd(void);
433433
int kgd2kfd_start_sched(struct kfd_dev *kfd, uint32_t node_id);
434434
int kgd2kfd_stop_sched(struct kfd_dev *kfd, uint32_t node_id);
435435
bool kgd2kfd_compute_active(struct kfd_dev *kfd, uint32_t node_id);
436+
bool kgd2kfd_vmfault_fast_path(struct amdgpu_device *adev, struct amdgpu_iv_entry *entry,
437+
bool retry_fault);
438+
436439
#else
437440
static inline int kgd2kfd_init(void)
438441
{
@@ -518,5 +521,12 @@ static inline bool kgd2kfd_compute_active(struct kfd_dev *kfd, uint32_t node_id)
518521
{
519522
return false;
520523
}
524+
525+
static inline bool kgd2kfd_vmfault_fast_path(struct amdgpu_device *adev, struct amdgpu_iv_entry *entry,
526+
bool retry_fault)
527+
{
528+
return false;
529+
}
530+
521531
#endif
522532
#endif /* AMDGPU_AMDKFD_H_INCLUDED */

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ kfd_mem_dmaunmap_userptr(struct kgd_mem *mem,
730730
return;
731731

732732
amdgpu_bo_placement_from_domain(bo, AMDGPU_GEM_DOMAIN_CPU);
733-
ttm_bo_validate(&bo->tbo, &bo->placement, &ctx);
733+
(void)ttm_bo_validate(&bo->tbo, &bo->placement, &ctx);
734734

735735
dma_unmap_sgtable(adev->dev, ttm->sg, direction, 0);
736736
sg_free_table(ttm->sg);
@@ -779,7 +779,7 @@ kfd_mem_dmaunmap_sg_bo(struct kgd_mem *mem,
779779
}
780780

781781
amdgpu_bo_placement_from_domain(bo, AMDGPU_GEM_DOMAIN_CPU);
782-
ttm_bo_validate(&bo->tbo, &bo->placement, &ctx);
782+
(void)ttm_bo_validate(&bo->tbo, &bo->placement, &ctx);
783783

784784
dir = mem->alloc_flags & KFD_IOC_ALLOC_MEM_FLAGS_WRITABLE ?
785785
DMA_BIDIRECTIONAL : DMA_TO_DEVICE;
@@ -989,7 +989,7 @@ static int kfd_mem_attach(struct amdgpu_device *adev, struct kgd_mem *mem,
989989
if (!attachment[i])
990990
continue;
991991
if (attachment[i]->bo_va) {
992-
amdgpu_bo_reserve(bo[i], true);
992+
(void)amdgpu_bo_reserve(bo[i], true);
993993
if (--attachment[i]->bo_va->ref_count == 0)
994994
amdgpu_vm_bo_del(adev, attachment[i]->bo_va);
995995
amdgpu_bo_unreserve(bo[i]);
@@ -1259,11 +1259,11 @@ static int unmap_bo_from_gpuvm(struct kgd_mem *mem,
12591259
return -EBUSY;
12601260
}
12611261

1262-
amdgpu_vm_bo_unmap(adev, bo_va, entry->va);
1262+
(void)amdgpu_vm_bo_unmap(adev, bo_va, entry->va);
12631263

1264-
amdgpu_vm_clear_freed(adev, vm, &bo_va->last_pt_update);
1264+
(void)amdgpu_vm_clear_freed(adev, vm, &bo_va->last_pt_update);
12651265

1266-
amdgpu_sync_fence(sync, bo_va->last_pt_update);
1266+
(void)amdgpu_sync_fence(sync, bo_va->last_pt_update);
12671267

12681268
return 0;
12691269
}
@@ -2352,7 +2352,7 @@ void amdgpu_amdkfd_gpuvm_unmap_gtt_bo_from_kernel(struct kgd_mem *mem)
23522352
{
23532353
struct amdgpu_bo *bo = mem->bo;
23542354

2355-
amdgpu_bo_reserve(bo, true);
2355+
(void)amdgpu_bo_reserve(bo, true);
23562356
amdgpu_bo_kunmap(bo);
23572357
amdgpu_bo_unpin(bo);
23582358
amdgpu_bo_unreserve(bo);

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

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,35 +47,37 @@
4747
/* Check if current bios is an ATOM BIOS.
4848
* Return true if it is ATOM BIOS. Otherwise, return false.
4949
*/
50-
static bool check_atom_bios(uint8_t *bios, size_t size)
50+
static bool check_atom_bios(struct amdgpu_device *adev, size_t size)
5151
{
5252
uint16_t tmp, bios_header_start;
53+
uint8_t *bios = adev->bios;
5354

5455
if (!bios || size < 0x49) {
55-
DRM_INFO("vbios mem is null or mem size is wrong\n");
56+
dev_dbg(adev->dev, "VBIOS mem is null or mem size is wrong\n");
5657
return false;
5758
}
5859

5960
if (!AMD_IS_VALID_VBIOS(bios)) {
60-
DRM_INFO("BIOS signature incorrect %x %x\n", bios[0], bios[1]);
61+
dev_dbg(adev->dev, "VBIOS signature incorrect %x %x\n", bios[0],
62+
bios[1]);
6163
return false;
6264
}
6365

6466
bios_header_start = bios[0x48] | (bios[0x49] << 8);
6567
if (!bios_header_start) {
66-
DRM_INFO("Can't locate bios header\n");
68+
dev_dbg(adev->dev, "Can't locate VBIOS header\n");
6769
return false;
6870
}
6971

7072
tmp = bios_header_start + 4;
7173
if (size < tmp) {
72-
DRM_INFO("BIOS header is broken\n");
74+
dev_dbg(adev->dev, "VBIOS header is broken\n");
7375
return false;
7476
}
7577

7678
if (!memcmp(bios + tmp, "ATOM", 4) ||
7779
!memcmp(bios + tmp, "MOTA", 4)) {
78-
DRM_DEBUG("ATOMBIOS detected\n");
80+
dev_dbg(adev->dev, "ATOMBIOS detected\n");
7981
return true;
8082
}
8183

@@ -118,7 +120,7 @@ static bool amdgpu_read_bios_from_vram(struct amdgpu_device *adev)
118120
memcpy_fromio(adev->bios, bios, size);
119121
iounmap(bios);
120122

121-
if (!check_atom_bios(adev->bios, size)) {
123+
if (!check_atom_bios(adev, size)) {
122124
kfree(adev->bios);
123125
return false;
124126
}
@@ -146,7 +148,7 @@ bool amdgpu_read_bios(struct amdgpu_device *adev)
146148
memcpy_fromio(adev->bios, bios, size);
147149
pci_unmap_rom(adev->pdev, bios);
148150

149-
if (!check_atom_bios(adev->bios, size)) {
151+
if (!check_atom_bios(adev, size)) {
150152
kfree(adev->bios);
151153
return false;
152154
}
@@ -186,7 +188,7 @@ static bool amdgpu_read_bios_from_rom(struct amdgpu_device *adev)
186188
/* read complete BIOS */
187189
amdgpu_asic_read_bios_from_rom(adev, adev->bios, len);
188190

189-
if (!check_atom_bios(adev->bios, len)) {
191+
if (!check_atom_bios(adev, len)) {
190192
kfree(adev->bios);
191193
return false;
192194
}
@@ -216,7 +218,7 @@ static bool amdgpu_read_platform_bios(struct amdgpu_device *adev)
216218
memcpy_fromio(adev->bios, bios, romlen);
217219
iounmap(bios);
218220

219-
if (!check_atom_bios(adev->bios, romlen))
221+
if (!check_atom_bios(adev, romlen))
220222
goto free_bios;
221223

222224
adev->bios_size = romlen;
@@ -324,7 +326,7 @@ static bool amdgpu_atrm_get_bios(struct amdgpu_device *adev)
324326
break;
325327
}
326328

327-
if (!check_atom_bios(adev->bios, size)) {
329+
if (!check_atom_bios(adev, size)) {
328330
kfree(adev->bios);
329331
return false;
330332
}
@@ -389,7 +391,7 @@ static bool amdgpu_acpi_vfct_bios(struct amdgpu_device *adev)
389391
vhdr->ImageLength,
390392
GFP_KERNEL);
391393

392-
if (!check_atom_bios(adev->bios, vhdr->ImageLength)) {
394+
if (!check_atom_bios(adev, vhdr->ImageLength)) {
393395
kfree(adev->bios);
394396
return false;
395397
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,9 @@ static int amdgpu_cgs_get_firmware_info(struct cgs_device *cgs_device,
414414
return -EINVAL;
415415
}
416416

417-
err = amdgpu_ucode_request(adev, &adev->pm.fw, "%s", fw_name);
417+
err = amdgpu_ucode_request(adev, &adev->pm.fw,
418+
AMDGPU_UCODE_REQUIRED,
419+
"%s", fw_name);
418420
if (err) {
419421
DRM_ERROR("Failed to load firmware \"%s\"", fw_name);
420422
amdgpu_ucode_release(&adev->pm.fw);

0 commit comments

Comments
 (0)