Skip to content

Commit cdd65e8

Browse files
committed
Merge tag 'amd-drm-next-7.1-2026-04-01' of https://gitlab.freedesktop.org/agd5f/linux into drm-next
amd-drm-next-7.1-2026-04-01: amdgpu: - UserQ fixes - PASID handling fix - S4 fix for smu11 chips - devcoredump fixes - RAS fixes - Misc small fixes - DCN 4.2 updates - DVI fixes - DML fixes - DC pipe validation fixes - eDP DSC seamless boot - DC FP rework - swsmu cleanups - GC 11.5.4 updates - Add DC idle state manager - Add support for using multiple engines for buffer fills and clears - Misc SMU7 fixes amdkfd: - Non-4K page fixes - Logging cleanups - sysfs fixes Signed-off-by: Dave Airlie <airlied@redhat.com> From: Alex Deucher <alexander.deucher@amd.com> Link: https://patch.msgid.link/20260401184456.3576660-1-alexander.deucher@amd.com
2 parents 9bdbf7e + 8b3e8fa commit cdd65e8

303 files changed

Lines changed: 4153 additions & 1892 deletions

File tree

Some content is hidden

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

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

Lines changed: 245 additions & 214 deletions
Large diffs are not rendered by default.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ uint32_t amdgpu_atomfirmware_query_firmware_capability(struct amdgpu_device *ade
3030
bool amdgpu_atomfirmware_gpu_virtualization_supported(struct amdgpu_device *adev);
3131
void amdgpu_atomfirmware_scratch_regs_init(struct amdgpu_device *adev);
3232
int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev);
33+
int amdgpu_atomfirmware_get_integrated_system_info(struct amdgpu_device *adev,
34+
int *vram_width, int *vram_type, int *vram_vendor);
35+
int amdgpu_atomfirmware_get_umc_info(struct amdgpu_device *adev,
36+
int *vram_width, int *vram_type, int *vram_vendor);
3337
int amdgpu_atomfirmware_get_vram_info(struct amdgpu_device *adev,
3438
int *vram_width, int *vram_type, int *vram_vendor);
3539
int amdgpu_atomfirmware_get_uma_carveout_info(struct amdgpu_device *adev,

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -908,9 +908,8 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
908908
goto out_free_user_pages;
909909

910910
amdgpu_bo_list_for_each_entry(e, p->bo_list) {
911-
/* One fence for TTM and one for each CS job */
912911
r = drm_exec_prepare_obj(&p->exec, &e->bo->tbo.base,
913-
1 + p->gang_size);
912+
TTM_NUM_MOVE_FENCES + p->gang_size);
914913
drm_exec_retry_on_contention(&p->exec);
915914
if (unlikely(r))
916915
goto out_free_user_pages;
@@ -920,7 +919,7 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
920919

921920
if (p->uf_bo) {
922921
r = drm_exec_prepare_obj(&p->exec, &p->uf_bo->tbo.base,
923-
1 + p->gang_size);
922+
TTM_NUM_MOVE_FENCES + p->gang_size);
924923
drm_exec_retry_on_contention(&p->exec);
925924
if (unlikely(r))
926925
goto out_free_user_pages;

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

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ void amdgpu_coredump(struct amdgpu_device *adev, bool skip_vram_check,
3535
void amdgpu_coredump_init(struct amdgpu_device *adev)
3636
{
3737
}
38+
void amdgpu_coredump_fini(struct amdgpu_device *adev)
39+
{
40+
}
3841
#else
3942

4043
#define AMDGPU_CORE_DUMP_SIZE_MAX (256 * 1024 * 1024)
@@ -192,12 +195,16 @@ static void amdgpu_devcoredump_fw_info(struct amdgpu_device *adev,
192195
drm_printf(p, "VPE feature version: %u, fw version: 0x%08x\n",
193196
adev->vpe.feature_version, adev->vpe.fw_version);
194197

195-
drm_printf(p, "\nVBIOS Information\n");
196-
drm_printf(p, "vbios name : %s\n", ctx->name);
197-
drm_printf(p, "vbios pn : %s\n", ctx->vbios_pn);
198-
drm_printf(p, "vbios version : %d\n", ctx->version);
199-
drm_printf(p, "vbios ver_str : %s\n", ctx->vbios_ver_str);
200-
drm_printf(p, "vbios date : %s\n", ctx->date);
198+
if (adev->bios) {
199+
drm_printf(p, "\nVBIOS Information\n");
200+
drm_printf(p, "vbios name : %s\n", ctx->name);
201+
drm_printf(p, "vbios pn : %s\n", ctx->vbios_pn);
202+
drm_printf(p, "vbios version : %d\n", ctx->version);
203+
drm_printf(p, "vbios ver_str : %s\n", ctx->vbios_ver_str);
204+
drm_printf(p, "vbios date : %s\n", ctx->date);
205+
}else {
206+
drm_printf(p, "\nVBIOS Information: NA\n");
207+
}
201208
}
202209

203210
static ssize_t
@@ -436,4 +443,10 @@ void amdgpu_coredump_init(struct amdgpu_device *adev)
436443
{
437444
INIT_WORK(&adev->coredump_work, amdgpu_devcoredump_deferred_work);
438445
}
446+
447+
void amdgpu_coredump_fini(struct amdgpu_device *adev)
448+
{
449+
/* Finish deferred coredump formatting before HW/IP teardown. */
450+
flush_work(&adev->coredump_work);
451+
}
439452
#endif

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,5 @@ struct amdgpu_coredump_info {
5050
void amdgpu_coredump(struct amdgpu_device *adev, bool skip_vram_check,
5151
bool vram_lost, struct amdgpu_job *job);
5252
void amdgpu_coredump_init(struct amdgpu_device *adev);
53+
void amdgpu_coredump_fini(struct amdgpu_device *adev);
5354
#endif

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4225,6 +4225,7 @@ void amdgpu_device_fini_hw(struct amdgpu_device *adev)
42254225
if (pci_dev_is_disconnected(adev->pdev))
42264226
amdgpu_amdkfd_device_fini_sw(adev);
42274227

4228+
amdgpu_coredump_fini(adev);
42284229
amdgpu_device_ip_fini_early(adev);
42294230

42304231
amdgpu_irq_fini_hw(adev);

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2683,8 +2683,12 @@ static int amdgpu_pmops_freeze(struct device *dev)
26832683
if (r)
26842684
return r;
26852685

2686-
if (amdgpu_acpi_should_gpu_reset(adev))
2687-
return amdgpu_asic_reset(adev);
2686+
if (amdgpu_acpi_should_gpu_reset(adev)) {
2687+
amdgpu_device_lock_reset_domain(adev->reset_domain);
2688+
r = amdgpu_asic_reset(adev);
2689+
amdgpu_device_unlock_reset_domain(adev->reset_domain);
2690+
return r;
2691+
}
26882692
return 0;
26892693
}
26902694

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

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,50 @@ void amdgpu_gart_map_vram_range(struct amdgpu_device *adev, uint64_t pa,
403403
drm_dev_exit(idx);
404404
}
405405

406+
/**
407+
* amdgpu_gart_map_gfx9_mqd - map mqd and ctrl_stack dma_addresses into GART entries
408+
*
409+
* @adev: amdgpu_device pointer
410+
* @offset: offset into the GPU's gart aperture
411+
* @pages: number of pages to bind
412+
* @dma_addr: DMA addresses of pages
413+
* @flags: page table entry flags
414+
*
415+
* Map the MQD and control stack addresses into GART entries with the correct
416+
* memory types on gfxv9. The MQD occupies the first 4KB and is followed by
417+
* the control stack. The MQD uses UC (uncached) memory, while the control stack
418+
* uses NC (non-coherent) memory.
419+
*/
420+
void amdgpu_gart_map_gfx9_mqd(struct amdgpu_device *adev, uint64_t offset,
421+
int pages, dma_addr_t *dma_addr, uint64_t flags)
422+
{
423+
uint64_t page_base;
424+
unsigned int i, j, t;
425+
int idx;
426+
uint64_t ctrl_flags = AMDGPU_PTE_MTYPE_VG10(flags, AMDGPU_MTYPE_NC);
427+
void *dst;
428+
429+
if (!adev->gart.ptr)
430+
return;
431+
432+
if (!drm_dev_enter(adev_to_drm(adev), &idx))
433+
return;
434+
435+
t = offset / AMDGPU_GPU_PAGE_SIZE;
436+
dst = adev->gart.ptr;
437+
for (i = 0; i < pages; i++) {
438+
page_base = dma_addr[i];
439+
for (j = 0; j < AMDGPU_GPU_PAGES_IN_CPU_PAGE; j++, t++) {
440+
if ((i == 0) && (j == 0))
441+
amdgpu_gmc_set_pte_pde(adev, dst, t, page_base, flags);
442+
else
443+
amdgpu_gmc_set_pte_pde(adev, dst, t, page_base, ctrl_flags);
444+
page_base += AMDGPU_GPU_PAGE_SIZE;
445+
}
446+
}
447+
drm_dev_exit(idx);
448+
}
449+
406450
/**
407451
* amdgpu_gart_bind - bind pages into the gart page table
408452
*

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ void amdgpu_gart_unbind(struct amdgpu_device *adev, uint64_t offset,
6262
void amdgpu_gart_map(struct amdgpu_device *adev, uint64_t offset,
6363
int pages, dma_addr_t *dma_addr, uint64_t flags,
6464
void *dst);
65+
void amdgpu_gart_map_gfx9_mqd(struct amdgpu_device *adev, uint64_t offset,
66+
int pages, dma_addr_t *dma_addr, uint64_t flags);
6567
void amdgpu_gart_bind(struct amdgpu_device *adev, uint64_t offset,
6668
int pages, dma_addr_t *dma_addr, uint64_t flags);
6769
void amdgpu_gart_map_vram_range(struct amdgpu_device *adev, uint64_t pa,

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "amdgpu_ras.h"
3535
#include "amdgpu_reset.h"
3636
#include "amdgpu_xgmi.h"
37+
#include "amdgpu_atomfirmware.h"
3738

3839
#include <drm/drm_drv.h>
3940
#include <drm/ttm/ttm_tt.h>
@@ -1747,3 +1748,31 @@ int amdgpu_gmc_init_mem_ranges(struct amdgpu_device *adev)
17471748

17481749
return 0;
17491750
}
1751+
1752+
int amdgpu_gmc_get_vram_info(struct amdgpu_device *adev,
1753+
int *vram_width, int *vram_type, int *vram_vendor)
1754+
{
1755+
int ret = 0;
1756+
1757+
if (adev->flags & AMD_IS_APU)
1758+
return amdgpu_atomfirmware_get_integrated_system_info(adev,
1759+
vram_width, vram_type, vram_vendor);
1760+
switch (amdgpu_ip_version(adev, GC_HWIP, 0)) {
1761+
case IP_VERSION(12, 0, 0):
1762+
case IP_VERSION(12, 0, 1):
1763+
return amdgpu_atomfirmware_get_umc_info(adev,
1764+
vram_width, vram_type, vram_vendor);
1765+
case IP_VERSION(9, 5, 0):
1766+
case IP_VERSION(9, 4, 4):
1767+
case IP_VERSION(9, 4, 3):
1768+
ret = amdgpu_atomfirmware_get_umc_info(adev,
1769+
vram_width, vram_type, vram_vendor);
1770+
if (vram_width && !ret)
1771+
*vram_width *= hweight32(adev->aid_mask);
1772+
return ret;
1773+
default:
1774+
return amdgpu_atomfirmware_get_vram_info(adev,
1775+
vram_width, vram_type, vram_vendor);
1776+
}
1777+
return 0;
1778+
}

0 commit comments

Comments
 (0)