Skip to content

Commit 965c995

Browse files
committed
Merge tag 'drm-fixes-2025-09-12' of https://gitlab.freedesktop.org/drm/kernel
Pull drm fixes from Dave Airlie: "Weekly pull fixes for drm, mostly amdgpu and xe, with a revert for nouveau and some maintainers updates, and misc bits, doesn't seem too out of the normal. MAINTAINERS: - add rust tree to MAINTAINERS - fix X entries for nova/nouveau nova: - depend on 64-bit i915: - Fix size for for_each_set_bit() in abox iteration xe: - Don't touch survivability_mode on fini - Fixes around eviction and suspend - Extend Wa_13011645652 to PTL-H, WCL amdgpu: - PSP 11.x fix - DPCD quirk handing fix - DCN 3.5 PG fix - Audio suspend fix - OEM i2c clean up fix - Module unload memory leak fix - DC delay fix - ISP firmware fix - VCN fixes amdkfd: - P2P topology fix - APU mem limit calculation fix mediatek: - fix potential OF node use-after-free panthor: - out-of-bounds check nouveau: - revert waitqueue removal for sched teardown * tag 'drm-fixes-2025-09-12' of https://gitlab.freedesktop.org/drm/kernel: (25 commits) MAINTAINERS: drm-misc: fix X: entries for nova/nouveau drm/mediatek: clean up driver data initialisation drm/mediatek: fix potential OF node use-after-free drm/amdgpu/vcn: Allow limiting ctx to instance 0 for AV1 at any time drm/amdgpu/vcn4: Fix IB parsing with multiple engine info packages drm/amd/amdgpu: Declare isp firmware binary file drm/amd/display: use udelay rather than fsleep drm/amdgpu: fix a memory leak in fence cleanup when unloading drm/xe: Extend Wa_13011645652 to PTL-H, WCL drm/xe: Block exec and rebind worker while evicting for suspend / hibernate drm/xe: Allow the pm notifier to continue on failure drm/xe: Attempt to bring bos back to VRAM after eviction drm/xe/configfs: Don't touch survivability_mode on fini amd/amdkfd: correct mem limit calculation for small APUs drm/amdkfd: fix p2p links bug in topology drm/amd/display: remove oem i2c adapter on finish drm/amd/display: Drop dm_prepare_suspend() and dm_complete() drm/amd/display: Correct sequences and delays for DCN35 PG & RCG drm/amd/display: Disable DPCD Probe Quirk drm/i915/power: fix size for for_each_set_bit() in abox iteration ...
2 parents cb780b7 + 9a3f210 commit 965c995

40 files changed

+366
-349
lines changed

MAINTAINERS

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8078,7 +8078,6 @@ F: Documentation/devicetree/bindings/gpu/
80788078
F: Documentation/gpu/
80798079
F: drivers/gpu/drm/
80808080
F: drivers/gpu/vga/
8081-
F: rust/kernel/drm/
80828081
F: include/drm/drm
80838082
F: include/linux/vga*
80848083
F: include/uapi/drm/
@@ -8090,11 +8089,21 @@ X: drivers/gpu/drm/i915/
80908089
X: drivers/gpu/drm/kmb/
80918090
X: drivers/gpu/drm/mediatek/
80928091
X: drivers/gpu/drm/msm/
8093-
X: drivers/gpu/drm/nouveau/
8092+
X: drivers/gpu/drm/nova/
80948093
X: drivers/gpu/drm/radeon/
80958094
X: drivers/gpu/drm/tegra/
80968095
X: drivers/gpu/drm/xe/
80978096

8097+
DRM DRIVERS AND COMMON INFRASTRUCTURE [RUST]
8098+
M: Danilo Krummrich <[email protected]>
8099+
M: Alice Ryhl <[email protected]>
8100+
S: Supported
8101+
W: https://drm.pages.freedesktop.org/maintainer-tools/drm-rust.html
8102+
T: git https://gitlab.freedesktop.org/drm/rust/kernel.git
8103+
F: drivers/gpu/drm/nova/
8104+
F: drivers/gpu/nova-core/
8105+
F: rust/kernel/drm/
8106+
80988107
DRM DRIVERS FOR ALLWINNER A10
80998108
M: Maxime Ripard <[email protected]>
81008109
M: Chen-Yu Tsai <[email protected]>

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

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -213,19 +213,35 @@ int amdgpu_amdkfd_reserve_mem_limit(struct amdgpu_device *adev,
213213
spin_lock(&kfd_mem_limit.mem_limit_lock);
214214

215215
if (kfd_mem_limit.system_mem_used + system_mem_needed >
216-
kfd_mem_limit.max_system_mem_limit)
216+
kfd_mem_limit.max_system_mem_limit) {
217217
pr_debug("Set no_system_mem_limit=1 if using shared memory\n");
218+
if (!no_system_mem_limit) {
219+
ret = -ENOMEM;
220+
goto release;
221+
}
222+
}
218223

219-
if ((kfd_mem_limit.system_mem_used + system_mem_needed >
220-
kfd_mem_limit.max_system_mem_limit && !no_system_mem_limit) ||
221-
(kfd_mem_limit.ttm_mem_used + ttm_mem_needed >
222-
kfd_mem_limit.max_ttm_mem_limit) ||
223-
(adev && xcp_id >= 0 && adev->kfd.vram_used[xcp_id] + vram_needed >
224-
vram_size - reserved_for_pt - reserved_for_ras - atomic64_read(&adev->vram_pin_size))) {
224+
if (kfd_mem_limit.ttm_mem_used + ttm_mem_needed >
225+
kfd_mem_limit.max_ttm_mem_limit) {
225226
ret = -ENOMEM;
226227
goto release;
227228
}
228229

230+
/*if is_app_apu is false and apu_prefer_gtt is true, it is an APU with
231+
* carve out < gtt. In that case, VRAM allocation will go to gtt domain, skip
232+
* VRAM check since ttm_mem_limit check already cover this allocation
233+
*/
234+
235+
if (adev && xcp_id >= 0 && (!adev->apu_prefer_gtt || adev->gmc.is_app_apu)) {
236+
uint64_t vram_available =
237+
vram_size - reserved_for_pt - reserved_for_ras -
238+
atomic64_read(&adev->vram_pin_size);
239+
if (adev->kfd.vram_used[xcp_id] + vram_needed > vram_available) {
240+
ret = -ENOMEM;
241+
goto release;
242+
}
243+
}
244+
229245
/* Update memory accounting by decreasing available system
230246
* memory, TTM memory and GPU memory as computed above
231247
*/
@@ -1626,11 +1642,15 @@ size_t amdgpu_amdkfd_get_available_memory(struct amdgpu_device *adev,
16261642
uint64_t vram_available, system_mem_available, ttm_mem_available;
16271643

16281644
spin_lock(&kfd_mem_limit.mem_limit_lock);
1629-
vram_available = KFD_XCP_MEMORY_SIZE(adev, xcp_id)
1630-
- adev->kfd.vram_used_aligned[xcp_id]
1631-
- atomic64_read(&adev->vram_pin_size)
1632-
- reserved_for_pt
1633-
- reserved_for_ras;
1645+
if (adev->apu_prefer_gtt && !adev->gmc.is_app_apu)
1646+
vram_available = KFD_XCP_MEMORY_SIZE(adev, xcp_id)
1647+
- adev->kfd.vram_used_aligned[xcp_id];
1648+
else
1649+
vram_available = KFD_XCP_MEMORY_SIZE(adev, xcp_id)
1650+
- adev->kfd.vram_used_aligned[xcp_id]
1651+
- atomic64_read(&adev->vram_pin_size)
1652+
- reserved_for_pt
1653+
- reserved_for_ras;
16341654

16351655
if (adev->apu_prefer_gtt) {
16361656
system_mem_available = no_system_mem_limit ?

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,6 @@ void amdgpu_ring_fini(struct amdgpu_ring *ring)
421421
dma_fence_put(ring->vmid_wait);
422422
ring->vmid_wait = NULL;
423423
ring->me = 0;
424-
425-
ring->adev->rings[ring->idx] = NULL;
426424
}
427425

428426
/**

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
#include "amdgpu.h"
3030
#include "isp_v4_1_1.h"
3131

32+
MODULE_FIRMWARE("amdgpu/isp_4_1_1.bin");
33+
3234
#define ISP_PERFORMANCE_STATE_LOW 0
3335
#define ISP_PERFORMANCE_STATE_HIGH 1
3436

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

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,12 @@ static int psp_v11_0_wait_for_bootloader(struct psp_context *psp)
149149
int ret;
150150
int retry_loop;
151151

152-
for (retry_loop = 0; retry_loop < 10; retry_loop++) {
152+
for (retry_loop = 0; retry_loop < 20; retry_loop++) {
153153
/* Wait for bootloader to signify that is
154154
ready having bit 31 of C2PMSG_35 set to 1 */
155155
ret = psp_wait_for(
156156
psp, SOC15_REG_OFFSET(MP0, 0, mmMP0_SMN_C2PMSG_35),
157-
0x80000000, 0x80000000, PSP_WAITREG_NOVERBOSE);
157+
0x80000000, 0x8000FFFF, PSP_WAITREG_NOVERBOSE);
158158

159159
if (ret == 0)
160160
return 0;
@@ -397,18 +397,6 @@ static int psp_v11_0_mode1_reset(struct psp_context *psp)
397397

398398
msleep(500);
399399

400-
offset = SOC15_REG_OFFSET(MP0, 0, mmMP0_SMN_C2PMSG_33);
401-
402-
ret = psp_wait_for(psp, offset, MBOX_TOS_RESP_FLAG, MBOX_TOS_RESP_MASK,
403-
0);
404-
405-
if (ret) {
406-
DRM_INFO("psp mode 1 reset failed!\n");
407-
return -EINVAL;
408-
}
409-
410-
DRM_INFO("psp mode1 reset succeed \n");
411-
412400
return 0;
413401
}
414402

@@ -665,7 +653,8 @@ static const struct psp_funcs psp_v11_0_funcs = {
665653
.ring_get_wptr = psp_v11_0_ring_get_wptr,
666654
.ring_set_wptr = psp_v11_0_ring_set_wptr,
667655
.load_usbc_pd_fw = psp_v11_0_load_usbc_pd_fw,
668-
.read_usbc_pd_fw = psp_v11_0_read_usbc_pd_fw
656+
.read_usbc_pd_fw = psp_v11_0_read_usbc_pd_fw,
657+
.wait_for_bootloader = psp_v11_0_wait_for_bootloader
669658
};
670659

671660
void psp_v11_0_set_psp_funcs(struct psp_context *psp)

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1888,15 +1888,19 @@ static int vcn_v3_0_limit_sched(struct amdgpu_cs_parser *p,
18881888
struct amdgpu_job *job)
18891889
{
18901890
struct drm_gpu_scheduler **scheds;
1891-
1892-
/* The create msg must be in the first IB submitted */
1893-
if (atomic_read(&job->base.entity->fence_seq))
1894-
return -EINVAL;
1891+
struct dma_fence *fence;
18951892

18961893
/* if VCN0 is harvested, we can't support AV1 */
18971894
if (p->adev->vcn.harvest_config & AMDGPU_VCN_HARVEST_VCN0)
18981895
return -EINVAL;
18991896

1897+
/* wait for all jobs to finish before switching to instance 0 */
1898+
fence = amdgpu_ctx_get_fence(p->ctx, job->base.entity, ~0ull);
1899+
if (fence) {
1900+
dma_fence_wait(fence, false);
1901+
dma_fence_put(fence);
1902+
}
1903+
19001904
scheds = p->adev->gpu_sched[AMDGPU_HW_IP_VCN_DEC]
19011905
[AMDGPU_RING_PRIO_DEFAULT].sched;
19021906
drm_sched_entity_modify_sched(job->base.entity, scheds, 1);

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

Lines changed: 29 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,15 +1808,19 @@ static int vcn_v4_0_limit_sched(struct amdgpu_cs_parser *p,
18081808
struct amdgpu_job *job)
18091809
{
18101810
struct drm_gpu_scheduler **scheds;
1811-
1812-
/* The create msg must be in the first IB submitted */
1813-
if (atomic_read(&job->base.entity->fence_seq))
1814-
return -EINVAL;
1811+
struct dma_fence *fence;
18151812

18161813
/* if VCN0 is harvested, we can't support AV1 */
18171814
if (p->adev->vcn.harvest_config & AMDGPU_VCN_HARVEST_VCN0)
18181815
return -EINVAL;
18191816

1817+
/* wait for all jobs to finish before switching to instance 0 */
1818+
fence = amdgpu_ctx_get_fence(p->ctx, job->base.entity, ~0ull);
1819+
if (fence) {
1820+
dma_fence_wait(fence, false);
1821+
dma_fence_put(fence);
1822+
}
1823+
18201824
scheds = p->adev->gpu_sched[AMDGPU_HW_IP_VCN_ENC]
18211825
[AMDGPU_RING_PRIO_0].sched;
18221826
drm_sched_entity_modify_sched(job->base.entity, scheds, 1);
@@ -1907,22 +1911,16 @@ static int vcn_v4_0_dec_msg(struct amdgpu_cs_parser *p, struct amdgpu_job *job,
19071911

19081912
#define RADEON_VCN_ENGINE_TYPE_ENCODE (0x00000002)
19091913
#define RADEON_VCN_ENGINE_TYPE_DECODE (0x00000003)
1910-
19111914
#define RADEON_VCN_ENGINE_INFO (0x30000001)
1912-
#define RADEON_VCN_ENGINE_INFO_MAX_OFFSET 16
1913-
19141915
#define RENCODE_ENCODE_STANDARD_AV1 2
19151916
#define RENCODE_IB_PARAM_SESSION_INIT 0x00000003
1916-
#define RENCODE_IB_PARAM_SESSION_INIT_MAX_OFFSET 64
19171917

1918-
/* return the offset in ib if id is found, -1 otherwise
1919-
* to speed up the searching we only search upto max_offset
1920-
*/
1921-
static int vcn_v4_0_enc_find_ib_param(struct amdgpu_ib *ib, uint32_t id, int max_offset)
1918+
/* return the offset in ib if id is found, -1 otherwise */
1919+
static int vcn_v4_0_enc_find_ib_param(struct amdgpu_ib *ib, uint32_t id, int start)
19221920
{
19231921
int i;
19241922

1925-
for (i = 0; i < ib->length_dw && i < max_offset && ib->ptr[i] >= 8; i += ib->ptr[i]/4) {
1923+
for (i = start; i < ib->length_dw && ib->ptr[i] >= 8; i += ib->ptr[i] / 4) {
19261924
if (ib->ptr[i + 1] == id)
19271925
return i;
19281926
}
@@ -1937,33 +1935,29 @@ static int vcn_v4_0_ring_patch_cs_in_place(struct amdgpu_cs_parser *p,
19371935
struct amdgpu_vcn_decode_buffer *decode_buffer;
19381936
uint64_t addr;
19391937
uint32_t val;
1940-
int idx;
1938+
int idx = 0, sidx;
19411939

19421940
/* The first instance can decode anything */
19431941
if (!ring->me)
19441942
return 0;
19451943

1946-
/* RADEON_VCN_ENGINE_INFO is at the top of ib block */
1947-
idx = vcn_v4_0_enc_find_ib_param(ib, RADEON_VCN_ENGINE_INFO,
1948-
RADEON_VCN_ENGINE_INFO_MAX_OFFSET);
1949-
if (idx < 0) /* engine info is missing */
1950-
return 0;
1951-
1952-
val = amdgpu_ib_get_value(ib, idx + 2); /* RADEON_VCN_ENGINE_TYPE */
1953-
if (val == RADEON_VCN_ENGINE_TYPE_DECODE) {
1954-
decode_buffer = (struct amdgpu_vcn_decode_buffer *)&ib->ptr[idx + 6];
1955-
1956-
if (!(decode_buffer->valid_buf_flag & 0x1))
1957-
return 0;
1958-
1959-
addr = ((u64)decode_buffer->msg_buffer_address_hi) << 32 |
1960-
decode_buffer->msg_buffer_address_lo;
1961-
return vcn_v4_0_dec_msg(p, job, addr);
1962-
} else if (val == RADEON_VCN_ENGINE_TYPE_ENCODE) {
1963-
idx = vcn_v4_0_enc_find_ib_param(ib, RENCODE_IB_PARAM_SESSION_INIT,
1964-
RENCODE_IB_PARAM_SESSION_INIT_MAX_OFFSET);
1965-
if (idx >= 0 && ib->ptr[idx + 2] == RENCODE_ENCODE_STANDARD_AV1)
1966-
return vcn_v4_0_limit_sched(p, job);
1944+
while ((idx = vcn_v4_0_enc_find_ib_param(ib, RADEON_VCN_ENGINE_INFO, idx)) >= 0) {
1945+
val = amdgpu_ib_get_value(ib, idx + 2); /* RADEON_VCN_ENGINE_TYPE */
1946+
if (val == RADEON_VCN_ENGINE_TYPE_DECODE) {
1947+
decode_buffer = (struct amdgpu_vcn_decode_buffer *)&ib->ptr[idx + 6];
1948+
1949+
if (!(decode_buffer->valid_buf_flag & 0x1))
1950+
return 0;
1951+
1952+
addr = ((u64)decode_buffer->msg_buffer_address_hi) << 32 |
1953+
decode_buffer->msg_buffer_address_lo;
1954+
return vcn_v4_0_dec_msg(p, job, addr);
1955+
} else if (val == RADEON_VCN_ENGINE_TYPE_ENCODE) {
1956+
sidx = vcn_v4_0_enc_find_ib_param(ib, RENCODE_IB_PARAM_SESSION_INIT, idx);
1957+
if (sidx >= 0 && ib->ptr[sidx + 2] == RENCODE_ENCODE_STANDARD_AV1)
1958+
return vcn_v4_0_limit_sched(p, job);
1959+
}
1960+
idx += ib->ptr[idx] / 4;
19671961
}
19681962
return 0;
19691963
}

drivers/gpu/drm/amd/amdkfd/kfd_topology.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1587,7 +1587,8 @@ static int kfd_dev_create_p2p_links(void)
15871587
break;
15881588
if (!dev->gpu || !dev->gpu->adev ||
15891589
(dev->gpu->kfd->hive_id &&
1590-
dev->gpu->kfd->hive_id == new_dev->gpu->kfd->hive_id))
1590+
dev->gpu->kfd->hive_id == new_dev->gpu->kfd->hive_id &&
1591+
amdgpu_xgmi_get_is_sharing_enabled(dev->gpu->adev, new_dev->gpu->adev)))
15911592
goto next;
15921593

15931594
/* check if node(s) is/are peer accessible in one direction or bi-direction */

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2913,6 +2913,17 @@ static int dm_oem_i2c_hw_init(struct amdgpu_device *adev)
29132913
return 0;
29142914
}
29152915

2916+
static void dm_oem_i2c_hw_fini(struct amdgpu_device *adev)
2917+
{
2918+
struct amdgpu_display_manager *dm = &adev->dm;
2919+
2920+
if (dm->oem_i2c) {
2921+
i2c_del_adapter(&dm->oem_i2c->base);
2922+
kfree(dm->oem_i2c);
2923+
dm->oem_i2c = NULL;
2924+
}
2925+
}
2926+
29162927
/**
29172928
* dm_hw_init() - Initialize DC device
29182929
* @ip_block: Pointer to the amdgpu_ip_block for this hw instance.
@@ -2963,7 +2974,7 @@ static int dm_hw_fini(struct amdgpu_ip_block *ip_block)
29632974
{
29642975
struct amdgpu_device *adev = ip_block->adev;
29652976

2966-
kfree(adev->dm.oem_i2c);
2977+
dm_oem_i2c_hw_fini(adev);
29672978

29682979
amdgpu_dm_hpd_fini(adev);
29692980

@@ -3127,25 +3138,6 @@ static void dm_destroy_cached_state(struct amdgpu_device *adev)
31273138
dm->cached_state = NULL;
31283139
}
31293140

3130-
static void dm_complete(struct amdgpu_ip_block *ip_block)
3131-
{
3132-
struct amdgpu_device *adev = ip_block->adev;
3133-
3134-
dm_destroy_cached_state(adev);
3135-
}
3136-
3137-
static int dm_prepare_suspend(struct amdgpu_ip_block *ip_block)
3138-
{
3139-
struct amdgpu_device *adev = ip_block->adev;
3140-
3141-
if (amdgpu_in_reset(adev))
3142-
return 0;
3143-
3144-
WARN_ON(adev->dm.cached_state);
3145-
3146-
return dm_cache_state(adev);
3147-
}
3148-
31493141
static int dm_suspend(struct amdgpu_ip_block *ip_block)
31503142
{
31513143
struct amdgpu_device *adev = ip_block->adev;
@@ -3571,10 +3563,8 @@ static const struct amd_ip_funcs amdgpu_dm_funcs = {
35713563
.early_fini = amdgpu_dm_early_fini,
35723564
.hw_init = dm_hw_init,
35733565
.hw_fini = dm_hw_fini,
3574-
.prepare_suspend = dm_prepare_suspend,
35753566
.suspend = dm_suspend,
35763567
.resume = dm_resume,
3577-
.complete = dm_complete,
35783568
.is_idle = dm_is_idle,
35793569
.wait_for_idle = dm_wait_for_idle,
35803570
.check_soft_reset = dm_check_soft_reset,

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,7 @@ void amdgpu_dm_initialize_dp_connector(struct amdgpu_display_manager *dm,
809809
drm_dp_aux_init(&aconnector->dm_dp_aux.aux);
810810
drm_dp_cec_register_connector(&aconnector->dm_dp_aux.aux,
811811
&aconnector->base);
812+
drm_dp_dpcd_set_probe(&aconnector->dm_dp_aux.aux, false);
812813

813814
if (aconnector->base.connector_type == DRM_MODE_CONNECTOR_eDP)
814815
return;

0 commit comments

Comments
 (0)