Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
858f5b2
drm/amd/pm: Disable VCN queue reset on SMU v13.0.6 due to regression
Jie1zhang Oct 4, 2025
6ff5abe
drm/amdgpu: Skip SDMA suspend during mode-2 reset
Oct 8, 2025
11d35db
drm/amdkcl: fix suballoc helper availability for distro kernels
Oct 10, 2025
bccf333
drm/amdgpu: fix bit shift logic
pldrc Oct 10, 2025
e85ca18
drm/amdgpu: Add kiq hdp flush callbacks
vizhao Oct 9, 2025
4972be8
drm/amdgpu: use GPU_HDP_FLUSH for sriov
vizhao Oct 9, 2025
cb2e207
drm/amdgpu: hide VRAM sysfs attributes on GPUs without VRAM
ChristianKoenigAMD Oct 7, 2025
d3b227e
drm/amdkcl: Add Peerdirect checks for KFD
kentrussell Mar 28, 2025
7c33556
amdkfd: Do nto wait for queue op response during reset
ahrehman Nov 5, 2025
ae161fb
drm/amdgpu: Updated naming of SRIOV critical region offsets/sizes wit…
Oct 6, 2025
e477601
drm/amdgpu: Add SRIOV crit_region_version support
Oct 7, 2025
509ddf4
drm/amdgpu: Introduce SRIOV critical regions v2 during VF init
Oct 7, 2025
584c651
drm/amdgpu: Reuse fw_vram_usage_* for dynamic critical region in SRIOV
Oct 8, 2025
d1763d4
drm/amdgpu: Add logic for VF ipd and VF bios to init from dynamic cri…
Oct 7, 2025
a46363c
drm/amdgpu: Add logic for VF data exchange region to init from dynami…
Oct 8, 2025
8431ebc
drm/amd: Stop overloading power limit with limit type
superm1 Oct 9, 2025
3d19f4a
drm/amd: Remove second call to set_power_limit()
superm1 Oct 9, 2025
3dcd53b
drm/amd: Save and restore all limit types
superm1 Oct 9, 2025
df4fe3b
drm/amd: Drop calls to restore power limit and clock from smu_resume()
superm1 Oct 9, 2025
f376e7b
drm/amdgpu: disable peer-to-peer access for DCC-enabled GC12 VRAM sur…
vprosyak Nov 6, 2025
895f8d4
Revert "drm/amdgpu: disable peer-to-peer access for DCC-enabled GC12 …
Nov 6, 2025
234b4a9
drm/amdkfd: Don't clear PT after process killed
PhilipYangA Oct 31, 2025
b518f60
Revert "drm/amdkfd: Don't clear PT after process killed"
vprosyak Nov 6, 2025
7b4bec6
drm/amd/pm: add new message definitions for pmfw eeprom interface
Sep 8, 2025
6547b58
drm/amd/pm: implement ras_smu_drv interface for smu v13.0.12
Sep 12, 2025
cd47484
drm/amd/pm: add smu ras driver framework
Sep 15, 2025
2d9cc37
drm/amdgpu: add function to check if pmfw eeprom is supported
Sep 15, 2025
d2a666a
drm/amdgpu: add wrapper functions for pmfw eeprom interface
Sep 15, 2025
20dc791
drm/amdgpu: adapt reset function for pmfw eeprom
Sep 4, 2025
17d5be1
drm/amdgpu: add initialization function for pmfw eeprom
Sep 4, 2025
0362db3
drm/amdgpu: add check function for pmfw eeprom
Sep 4, 2025
a83aca7
drm/amd/pm: check pmfw eeprom feature bit
Oct 22, 2025
fdf5044
drm/amdgpu: initialize max record count after table reset
Oct 31, 2025
2b39bed
drm/amdgpu: make MCA IPID parse global
Sep 30, 2025
cffad3d
drm/amdgpu: add ras_eeprom_read_idx interface
Jul 23, 2025
d8d3fac
drm/amdgpu: support to load RAS bad pages from PMFW
Jul 24, 2025
202da73
drm/amdgpu: skip writing eeprom when PMFW manages RAS data
Sep 8, 2025
8b72f51
drm/amdgpu: load RAS bad page from PMFW in page retirement
Jul 25, 2025
be00768
drm/amd/pm: remove unnecessary prints for smu busy
Nov 6, 2025
5d38c29
drm/amdgpu: get RAS bad page address from MCA address
Aug 27, 2025
c7775b9
drm/amdgpu: try for more times if RAS bad page number is not updated
Aug 27, 2025
78ac958
drm/amdgpu: add RAS bad page threshold handling for PMFW manages eeprom
Sep 24, 2025
c2f9403
drm/amdgpu: optimize timeout implemention in ras_eeprom_update_record…
Nov 6, 2025
c53924c
drm/amdgpu: get rev_id from strap register or IP-discovery table
Oct 14, 2025
b64b87c
drm/amdgpu: add new performance monitor PSP interfaces
Nov 6, 2025
d7a5b4c
drm/amdgpu: add psp interfaces for peak tops limiter driver
Nov 4, 2025
1acae0d
drm/amdgpu: add PTL enable/query gfx control support for GC 9.4.4
Nov 4, 2025
c991e9c
drm/amdkfd: add kgd control interface for ptl
Nov 4, 2025
b9e648a
drm/amdgpu: integrate PTL control with PMC device locking
Nov 11, 2025
1163438
Revert "drm/amdgpu: integrate PTL control with PMC device locking"
alexdeucher Nov 12, 2025
b980c4c
Revert "drm/amdkfd: add kgd control interface for ptl"
alexdeucher Nov 12, 2025
4d3dfef
Revert "drm/amdgpu: add PTL enable/query gfx control support for..."
alexdeucher Nov 12, 2025
6b7bcc0
Revert "drm/amdgpu: add psp interfaces for peak tops limiter driver"
alexdeucher Nov 12, 2025
a79d8cf
Revert "drm/amdgpu: add new performance monitor PSP interfaces"
alexdeucher Nov 12, 2025
8b0726a
Revert "drm/amdgpu: integrate PTL control with PMC device locking"
Nov 12, 2025
17f1f16
drm/amdgpu: disable peer-to-peer access for DCC-enabled GC12 VRAM sur…
vprosyak Nov 6, 2025
63f896b
drm/amdkfd: Don't clear PT after process killed
PhilipYangA Oct 31, 2025
39c3621
drm/amdkfd: Fix AIS deinit warnings
hkasivis Nov 12, 2025
db63a49
drm/amdkfd: Don't remap PCI P2P range
hkasivis Nov 13, 2025
6fbeb59
drm/amdkfd: Disable AIS on virtualized environment
Nov 19, 2025
01cee31
drm/amdgpu: Add sriov vf check for VCN per queue reset support.
Nov 19, 2025
fa6e6b8
drm/amdgpu: fix non-x86 GPU VCRAT parsing
fitzsim Jan 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/aldebaran.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ static int aldebaran_mode2_suspend_ip(struct amdgpu_device *adev)
uint32_t ip_block;
int r, i;

/* Skip suspend of SDMA IP versions >= 4.4.2. They are multi-aid */
if (adev->aid_mask)
ip_block_mask &= ~BIT(AMD_IP_BLOCK_TYPE_SDMA);

amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);

Expand Down
4 changes: 4 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1364,6 +1364,10 @@ static int unmap_bo_from_gpuvm(struct kgd_mem *mem,

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

/* VM entity stopped if process killed, don't clear freed pt bo */
if (!amdgpu_vm_ready(vm))
return 0;

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

(void)amdgpu_sync_fence(sync, bo_va->last_pt_update, GFP_KERNEL);
Expand Down
29 changes: 16 additions & 13 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,19 +181,22 @@ int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev)
u8 frev, crev;
int usage_bytes = 0;

if (amdgpu_atom_parse_data_header(ctx, index, NULL, &frev, &crev, &data_offset)) {
if (frev == 2 && crev == 1) {
fw_usage_v2_1 =
(struct vram_usagebyfirmware_v2_1 *)(ctx->bios + data_offset);
amdgpu_atomfirmware_allocate_fb_v2_1(adev,
fw_usage_v2_1,
&usage_bytes);
} else if (frev >= 2 && crev >= 2) {
fw_usage_v2_2 =
(struct vram_usagebyfirmware_v2_2 *)(ctx->bios + data_offset);
amdgpu_atomfirmware_allocate_fb_v2_2(adev,
fw_usage_v2_2,
&usage_bytes);
/* Skip atomfirmware allocation for SRIOV VFs when dynamic crit regn is enabled */
if (!(amdgpu_sriov_vf(adev) && adev->virt.is_dynamic_crit_regn_enabled)) {
if (amdgpu_atom_parse_data_header(ctx, index, NULL, &frev, &crev, &data_offset)) {
if (frev == 2 && crev == 1) {
fw_usage_v2_1 =
(struct vram_usagebyfirmware_v2_1 *)(ctx->bios + data_offset);
amdgpu_atomfirmware_allocate_fb_v2_1(adev,
fw_usage_v2_1,
&usage_bytes);
} else if (frev >= 2 && crev >= 2) {
fw_usage_v2_2 =
(struct vram_usagebyfirmware_v2_2 *)(ctx->bios + data_offset);
amdgpu_atomfirmware_allocate_fb_v2_2(adev,
fw_usage_v2_2,
&usage_bytes);
}
}
}

Expand Down
34 changes: 25 additions & 9 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,12 @@ void amdgpu_bios_release(struct amdgpu_device *adev)
* part of the system bios. On boot, the system bios puts a
* copy of the igp rom at the start of vram if a discrete card is
* present.
* For SR-IOV, the vbios image is also put in VRAM in the VF.
* For SR-IOV, if dynamic critical region is not enabled,
* the vbios image is also put at the start of VRAM in the VF.
*/
static bool amdgpu_read_bios_from_vram(struct amdgpu_device *adev)
{
uint8_t __iomem *bios;
uint8_t __iomem *bios = NULL;
resource_size_t vram_base;
resource_size_t size = 256 * 1024; /* ??? */

Expand All @@ -114,18 +115,33 @@ static bool amdgpu_read_bios_from_vram(struct amdgpu_device *adev)

adev->bios = NULL;
vram_base = pci_resource_start(adev->pdev, 0);
bios = ioremap_wc(vram_base, size);
if (!bios)
return false;

adev->bios = kmalloc(size, GFP_KERNEL);
if (!adev->bios) {
iounmap(bios);
if (!adev->bios)
return false;

/* For SRIOV with dynamic critical region is enabled,
* the vbios image is put at a dynamic offset of VRAM in the VF.
* If dynamic critical region is disabled, follow the existing logic as on baremetal.
*/
if (amdgpu_sriov_vf(adev) && adev->virt.is_dynamic_crit_regn_enabled) {
if (amdgpu_virt_get_dynamic_data_info(adev,
AMD_SRIOV_MSG_VBIOS_IMG_TABLE_ID, adev->bios, (uint64_t *)&size)) {
amdgpu_bios_release(adev);
return false;
}
} else {
bios = ioremap_wc(vram_base, size);
if (!bios) {
amdgpu_bios_release(adev);
return false;
}

memcpy_fromio(adev->bios, bios, size);
iounmap(bios);
}

adev->bios_size = size;
memcpy_fromio(adev->bios, bios, size);
iounmap(bios);

if (!check_atom_bios(adev, size)) {
amdgpu_bios_release(adev);
Expand Down
17 changes: 14 additions & 3 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -2779,6 +2779,10 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev)
r = amdgpu_virt_request_full_gpu(adev, true);
if (r)
return r;

r = amdgpu_virt_init_critical_region(adev);
if (r)
return r;
}

switch (adev->asic_type) {
Expand Down Expand Up @@ -7329,10 +7333,17 @@ void amdgpu_device_flush_hdp(struct amdgpu_device *adev,
if (adev->gmc.xgmi.connected_to_cpu)
return;

if (ring && ring->funcs->emit_hdp_flush)
if (ring && ring->funcs->emit_hdp_flush) {
amdgpu_ring_emit_hdp_flush(ring);
else
amdgpu_asic_flush_hdp(adev, ring);
return;
}

if (!ring && amdgpu_sriov_runtime(adev)) {
if (!amdgpu_kiq_hdp_flush(adev))
return;
}

amdgpu_asic_flush_hdp(adev, ring);
}

void amdgpu_device_invalidate_hdp(struct amdgpu_device *adev,
Expand Down
24 changes: 20 additions & 4 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,25 @@ static int amdgpu_discovery_read_binary_from_mem(struct amdgpu_device *adev,
vram_size <<= 20;

if (sz_valid) {
uint64_t pos = vram_size - DISCOVERY_TMR_OFFSET;
amdgpu_device_vram_access(adev, pos, (uint32_t *)binary,
adev->mman.discovery_tmr_size, false);
if (amdgpu_sriov_vf(adev) && adev->virt.is_dynamic_crit_regn_enabled) {
/* For SRIOV VFs with dynamic critical region enabled,
* we will get the IPD binary via below call.
* If dynamic critical is disabled, fall through to normal seq.
*/
if (amdgpu_virt_get_dynamic_data_info(adev,
AMD_SRIOV_MSG_IPD_TABLE_ID, binary,
(uint64_t *)&adev->mman.discovery_tmr_size)) {
dev_err(adev->dev,
"failed to read discovery info from dynamic critical region.");
ret = -EINVAL;
goto exit;
}
} else {
uint64_t pos = vram_size - DISCOVERY_TMR_OFFSET;

amdgpu_device_vram_access(adev, pos, (uint32_t *)binary,
adev->mman.discovery_tmr_size, false);
}
} else {
ret = amdgpu_discovery_read_binary_from_sysmem(adev, binary);
}
Expand All @@ -310,7 +326,7 @@ static int amdgpu_discovery_read_binary_from_mem(struct amdgpu_device *adev,
dev_err(adev->dev,
"failed to read discovery info from memory, vram size read: %llx",
vram_size);

exit:
return ret;
}

Expand Down
15 changes: 14 additions & 1 deletion drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,24 @@ static int amdgpu_dma_buf_attach(struct dma_buf *dmabuf,
struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);

#ifdef HAVE_STRUCT_DMA_BUF_ATTACH_OPS_ALLOW_PEER2PEER
/*
* Disable peer-to-peer access for DCC-enabled VRAM surfaces on GFX12+.
* Such buffers cannot be safely accessed over P2P due to device-local
* compression metadata. Fallback to system-memory path instead.
* Device supports GFX12 (GC 12.x or newer)
* BO was created with the AMDGPU_GEM_CREATE_GFX12_DCC flag
*
*/
if ((adev->ip_versions[GC_HWIP][0] >= IP_VERSION(12, 0, 0)) &&
bo->flags & AMDGPU_GEM_CREATE_GFX12_DCC) {
attach->peer2peer = false;
goto update_vm;
}
if (!amdgpu_dmabuf_is_xgmi_accessible(attach_adev, bo) &&
pci_p2pdma_distance(adev->pdev, attach->dev, false) < 0)
attach->peer2peer = false;
#endif

update_vm:
amdgpu_vm_bo_update_shared(bo);

return 0;
Expand Down
71 changes: 71 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "amdgpu_reset.h"
#include "amdgpu_xcp.h"
#include "amdgpu_xgmi.h"
#include "amdgpu_mes.h"
#include "nvd.h"

/* delay 0.1 second to enable gfx off feature */
Expand Down Expand Up @@ -1194,6 +1195,75 @@ void amdgpu_kiq_wreg(struct amdgpu_device *adev, uint32_t reg, uint32_t v, uint3
dev_err(adev->dev, "failed to write reg:%x\n", reg);
}

int amdgpu_kiq_hdp_flush(struct amdgpu_device *adev)
{
signed long r, cnt = 0;
unsigned long flags;
uint32_t seq;
struct amdgpu_kiq *kiq = &adev->gfx.kiq[0];
struct amdgpu_ring *ring = &kiq->ring;

if (amdgpu_device_skip_hw_access(adev))
return 0;

if (adev->enable_mes_kiq && adev->mes.ring[0].sched.ready)
return amdgpu_mes_hdp_flush(adev);

if (!ring->funcs->emit_hdp_flush) {
return -EOPNOTSUPP;
}

spin_lock_irqsave(&kiq->ring_lock, flags);
r = amdgpu_ring_alloc(ring, 32);
if (r)
goto failed_unlock;

amdgpu_ring_emit_hdp_flush(ring);
r = amdgpu_fence_emit_polling(ring, &seq, MAX_KIQ_REG_WAIT);
if (r)
goto failed_undo;

amdgpu_ring_commit(ring);
spin_unlock_irqrestore(&kiq->ring_lock, flags);

r = amdgpu_fence_wait_polling(ring, seq, MAX_KIQ_REG_WAIT);

/* don't wait anymore for gpu reset case because this way may
* block gpu_recover() routine forever, e.g. this virt_kiq_rreg
* is triggered in TTM and ttm_bo_lock_delayed_workqueue() will
* never return if we keep waiting in virt_kiq_rreg, which cause
* gpu_recover() hang there.
*
* also don't wait anymore for IRQ context
* */
if (r < 1 && (amdgpu_in_reset(adev) || in_interrupt()))
goto failed_kiq_hdp_flush;

might_sleep();
while (r < 1 && cnt++ < MAX_KIQ_REG_TRY) {
if (amdgpu_in_reset(adev))
goto failed_kiq_hdp_flush;

msleep(MAX_KIQ_REG_BAILOUT_INTERVAL);
r = amdgpu_fence_wait_polling(ring, seq, MAX_KIQ_REG_WAIT);
}

if (cnt > MAX_KIQ_REG_TRY) {
dev_err(adev->dev, "failed to flush HDP via KIQ timeout\n");
return -ETIMEDOUT;
}

return 0;

failed_undo:
amdgpu_ring_undo(ring);
failed_unlock:
spin_unlock_irqrestore(&kiq->ring_lock, flags);
failed_kiq_hdp_flush:
dev_err(adev->dev, "failed to flush HDP via KIQ\n");
return r < 0 ? r : -EIO;
}

int amdgpu_gfx_get_num_kcq(struct amdgpu_device *adev)
{
if (amdgpu_num_kcq == -1) {
Expand Down Expand Up @@ -2484,3 +2554,4 @@ void amdgpu_debugfs_compute_sched_mask_init(struct amdgpu_device *adev)
&amdgpu_debugfs_compute_sched_mask_fops);
#endif
}

1 change: 1 addition & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,7 @@ int amdgpu_gfx_cp_ecc_error_irq(struct amdgpu_device *adev,
struct amdgpu_iv_entry *entry);
uint32_t amdgpu_kiq_rreg(struct amdgpu_device *adev, uint32_t reg, uint32_t xcc_id);
void amdgpu_kiq_wreg(struct amdgpu_device *adev, uint32_t reg, uint32_t v, uint32_t xcc_id);
int amdgpu_kiq_hdp_flush(struct amdgpu_device *adev);
int amdgpu_gfx_get_num_kcq(struct amdgpu_device *adev);
void amdgpu_gfx_cp_init_microcode(struct amdgpu_device *adev, uint32_t ucode_id);

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ static int amdgpu_debugfs_jpeg_sched_mask_set(void *data, u64 val)
for (i = 0; i < adev->jpeg.num_jpeg_inst; ++i) {
for (j = 0; j < adev->jpeg.num_jpeg_rings; ++j) {
ring = &adev->jpeg.inst[i].ring_dec[j];
if (val & (BIT_ULL(1) << ((i * adev->jpeg.num_jpeg_rings) + j)))
if (val & (BIT_ULL((i * adev->jpeg.num_jpeg_rings) + j)))
ring->sched.ready = true;
else
ring->sched.ready = false;
Expand Down
12 changes: 12 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,18 @@ int amdgpu_mes_reg_write_reg_wait(struct amdgpu_device *adev,
return r;
}

int amdgpu_mes_hdp_flush(struct amdgpu_device *adev)
{
uint32_t hdp_flush_req_offset, hdp_flush_done_offset, ref_and_mask;

hdp_flush_req_offset = adev->nbio.funcs->get_hdp_flush_req_offset(adev);
hdp_flush_done_offset = adev->nbio.funcs->get_hdp_flush_done_offset(adev);
ref_and_mask = adev->nbio.hdp_flush_reg->ref_and_mask_cp0;

return amdgpu_mes_reg_write_reg_wait(adev, hdp_flush_req_offset, hdp_flush_done_offset,
ref_and_mask, ref_and_mask);
}

int amdgpu_mes_set_shader_debugger(struct amdgpu_device *adev,
uint64_t process_context_addr,
uint32_t spi_gdbg_per_vmid_cntl,
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ int amdgpu_mes_wreg(struct amdgpu_device *adev,
int amdgpu_mes_reg_write_reg_wait(struct amdgpu_device *adev,
uint32_t reg0, uint32_t reg1,
uint32_t ref, uint32_t mask);
int amdgpu_mes_hdp_flush(struct amdgpu_device *adev);
int amdgpu_mes_set_shader_debugger(struct amdgpu_device *adev,
uint64_t process_context_addr,
uint32_t spi_gdbg_per_vmid_cntl,
Expand Down
Loading