Skip to content

Commit dfd4b50

Browse files
committed
Merge tag 'drm-fixes-2025-08-16' of https://gitlab.freedesktop.org/drm/kernel
Pull drm fixes from Dave Airlie: "Relatively quiet week, usual amdgpu/i915/xe fixes along with a set of fixes for fbdev format info, which fix some regressions seen in with rc1. bridge: - fix OF-node leak - fix documentation fbdev-emulation: - pass correct format info to drm_helper_mode_fill_fb_struct() panfrost: - print correct RSS size amdgpu: - PSP fix - VRAM reservation fix - CSA fix - Process kill fix i915: - Fix the implementation of wa_18038517565 [fbc] - Do not trigger Frame Change events from frontbuffer flush [psr] xe: - Some more xe_migrate_access_memory fixes (Auld) - Defer buffer object shrinker write-backs and GPU waits (Thomas) - HWMON fix for clamping limits (Karthik) - SRIOV-PF: Set VF LMEM BAR size (Michal)" * tag 'drm-fixes-2025-08-16' of https://gitlab.freedesktop.org/drm/kernel: drm/xe/pf: Set VF LMEM BAR size drm/amdgpu: fix task hang from failed job submission during process kill drm/amdgpu: fix incorrect vm flags to map bo drm/amdgpu: fix vram reservation issue drm/amdgpu: Add PSP fw version check for fw reserve GFX command drm/xe/hwmon: Add SW clamp for power limits writes drm/xe: Defer buffer object shrinker write-backs and GPU waits drm/xe/migrate: prevent potential UAF drm/xe/migrate: don't overflow max copy size drm/xe/migrate: prevent infinite recursion drm/i915/psr: Do not trigger Frame Change events from frontbuffer flush drm/i915/fbc: fix the implementation of wa_18038517565 drm/panfrost: Print RSS for tiler heap BO's in debugfs GEMS file drm/radeon: Pass along the format info from .fb_create() to drm_helper_mode_fill_fb_struct() drm/nouveau: Pass along the format info from .fb_create() to drm_helper_mode_fill_fb_struct() drm/omap: Pass along the format info from .fb_create() to drm_helper_mode_fill_fb_struct() drm/bridge: document HDMI CEC callbacks drm/bridge: Describe the newly introduced drm_connector parameter for drm_bridge_detect drm/bridge: fix OF node leak
2 parents d0efc9e + 00062ea commit dfd4b50

24 files changed

+257
-67
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,6 +1139,9 @@ static int amdgpu_cs_vm_handling(struct amdgpu_cs_parser *p)
11391139
}
11401140
}
11411141

1142+
if (!amdgpu_vm_ready(vm))
1143+
return -EINVAL;
1144+
11421145
r = amdgpu_vm_clear_freed(adev, vm, NULL);
11431146
if (r)
11441147
return r;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ int amdgpu_map_static_csa(struct amdgpu_device *adev, struct amdgpu_vm *vm,
8888
}
8989

9090
r = amdgpu_vm_bo_map(adev, *bo_va, csa_addr, 0, size,
91-
AMDGPU_PTE_READABLE | AMDGPU_PTE_WRITEABLE |
92-
AMDGPU_PTE_EXECUTABLE);
91+
AMDGPU_VM_PAGE_READABLE | AMDGPU_VM_PAGE_WRITEABLE |
92+
AMDGPU_VM_PAGE_EXECUTABLE);
9393

9494
if (r) {
9595
DRM_ERROR("failed to do bo_map on static CSA, err=%d\n", r);

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,15 +1039,28 @@ int psp_update_fw_reservation(struct psp_context *psp)
10391039
{
10401040
int ret;
10411041
uint64_t reserv_addr, reserv_addr_ext;
1042-
uint32_t reserv_size, reserv_size_ext;
1042+
uint32_t reserv_size, reserv_size_ext, mp0_ip_ver;
10431043
struct amdgpu_device *adev = psp->adev;
10441044

1045+
mp0_ip_ver = amdgpu_ip_version(adev, MP0_HWIP, 0);
1046+
10451047
if (amdgpu_sriov_vf(psp->adev))
10461048
return 0;
10471049

1048-
if ((amdgpu_ip_version(adev, MP0_HWIP, 0) != IP_VERSION(14, 0, 2)) &&
1049-
(amdgpu_ip_version(adev, MP0_HWIP, 0) != IP_VERSION(14, 0, 3)))
1050+
switch (mp0_ip_ver) {
1051+
case IP_VERSION(14, 0, 2):
1052+
if (adev->psp.sos.fw_version < 0x3b0e0d)
1053+
return 0;
1054+
break;
1055+
1056+
case IP_VERSION(14, 0, 3):
1057+
if (adev->psp.sos.fw_version < 0x3a0e14)
1058+
return 0;
1059+
break;
1060+
1061+
default:
10501062
return 0;
1063+
}
10511064

10521065
ret = psp_get_fw_reservation_info(psp, GFX_CMD_ID_FB_FW_RESERV_ADDR, &reserv_addr, &reserv_size);
10531066
if (ret)

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -654,22 +654,29 @@ int amdgpu_vm_validate(struct amdgpu_device *adev, struct amdgpu_vm *vm,
654654
* Check if all VM PDs/PTs are ready for updates
655655
*
656656
* Returns:
657-
* True if VM is not evicting.
657+
* True if VM is not evicting and all VM entities are not stopped
658658
*/
659659
bool amdgpu_vm_ready(struct amdgpu_vm *vm)
660660
{
661-
bool empty;
662661
bool ret;
663662

664663
amdgpu_vm_eviction_lock(vm);
665664
ret = !vm->evicting;
666665
amdgpu_vm_eviction_unlock(vm);
667666

668667
spin_lock(&vm->status_lock);
669-
empty = list_empty(&vm->evicted);
668+
ret &= list_empty(&vm->evicted);
670669
spin_unlock(&vm->status_lock);
671670

672-
return ret && empty;
671+
spin_lock(&vm->immediate.lock);
672+
ret &= !vm->immediate.stopped;
673+
spin_unlock(&vm->immediate.lock);
674+
675+
spin_lock(&vm->delayed.lock);
676+
ret &= !vm->delayed.stopped;
677+
spin_unlock(&vm->delayed.lock);
678+
679+
return ret;
673680
}
674681

675682
/**

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,9 +648,8 @@ static void amdgpu_vram_mgr_del(struct ttm_resource_manager *man,
648648
list_for_each_entry(block, &vres->blocks, link)
649649
vis_usage += amdgpu_vram_mgr_vis_size(adev, block);
650650

651-
amdgpu_vram_mgr_do_reserve(man);
652-
653651
drm_buddy_free_list(mm, &vres->blocks, vres->flags);
652+
amdgpu_vram_mgr_do_reserve(man);
654653
mutex_unlock(&mgr->lock);
655654

656655
atomic64_sub(vis_usage, &mgr->vis_usage);

drivers/gpu/drm/bridge/aux-bridge.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ static void drm_aux_bridge_release(struct device *dev)
1818
{
1919
struct auxiliary_device *adev = to_auxiliary_dev(dev);
2020

21+
of_node_put(dev->of_node);
2122
ida_free(&drm_aux_bridge_ida, adev->id);
2223

2324
kfree(adev);
@@ -65,6 +66,7 @@ int drm_aux_bridge_register(struct device *parent)
6566

6667
ret = auxiliary_device_init(adev);
6768
if (ret) {
69+
of_node_put(adev->dev.of_node);
6870
ida_free(&drm_aux_bridge_ida, adev->id);
6971
kfree(adev);
7072
return ret;

drivers/gpu/drm/drm_bridge.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,6 +1227,7 @@ EXPORT_SYMBOL(drm_atomic_bridge_chain_check);
12271227
/**
12281228
* drm_bridge_detect - check if anything is attached to the bridge output
12291229
* @bridge: bridge control structure
1230+
* @connector: attached connector
12301231
*
12311232
* If the bridge supports output detection, as reported by the
12321233
* DRM_BRIDGE_OP_DETECT bridge ops flag, call &drm_bridge_funcs.detect for the

drivers/gpu/drm/i915/display/intel_fbc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -552,10 +552,6 @@ static void ilk_fbc_deactivate(struct intel_fbc *fbc)
552552
if (dpfc_ctl & DPFC_CTL_EN) {
553553
dpfc_ctl &= ~DPFC_CTL_EN;
554554
intel_de_write(display, ILK_DPFC_CONTROL(fbc->id), dpfc_ctl);
555-
556-
/* wa_18038517565 Enable DPFC clock gating after FBC disable */
557-
if (display->platform.dg2 || DISPLAY_VER(display) >= 14)
558-
fbc_compressor_clkgate_disable_wa(fbc, false);
559555
}
560556
}
561557

@@ -1710,6 +1706,10 @@ static void __intel_fbc_disable(struct intel_fbc *fbc)
17101706

17111707
__intel_fbc_cleanup_cfb(fbc);
17121708

1709+
/* wa_18038517565 Enable DPFC clock gating after FBC disable */
1710+
if (display->platform.dg2 || DISPLAY_VER(display) >= 14)
1711+
fbc_compressor_clkgate_disable_wa(fbc, false);
1712+
17131713
fbc->state.plane = NULL;
17141714
fbc->flip_pending = false;
17151715
fbc->busy_bits = 0;

drivers/gpu/drm/i915/display/intel_psr.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3275,7 +3275,9 @@ static void intel_psr_configure_full_frame_update(struct intel_dp *intel_dp)
32753275

32763276
static void _psr_invalidate_handle(struct intel_dp *intel_dp)
32773277
{
3278-
if (intel_dp->psr.psr2_sel_fetch_enabled) {
3278+
struct intel_display *display = to_intel_display(intel_dp);
3279+
3280+
if (DISPLAY_VER(display) < 20 && intel_dp->psr.psr2_sel_fetch_enabled) {
32793281
if (!intel_dp->psr.psr2_sel_fetch_cff_enabled) {
32803282
intel_dp->psr.psr2_sel_fetch_cff_enabled = true;
32813283
intel_psr_configure_full_frame_update(intel_dp);
@@ -3361,7 +3363,7 @@ static void _psr_flush_handle(struct intel_dp *intel_dp)
33613363
{
33623364
struct intel_display *display = to_intel_display(intel_dp);
33633365

3364-
if (intel_dp->psr.psr2_sel_fetch_enabled) {
3366+
if (DISPLAY_VER(display) < 20 && intel_dp->psr.psr2_sel_fetch_enabled) {
33653367
if (intel_dp->psr.psr2_sel_fetch_cff_enabled) {
33663368
/* can we turn CFF off? */
33673369
if (intel_dp->psr.busy_frontbuffer_bits == 0)
@@ -3378,11 +3380,13 @@ static void _psr_flush_handle(struct intel_dp *intel_dp)
33783380
* existing SU configuration
33793381
*/
33803382
intel_psr_configure_full_frame_update(intel_dp);
3381-
}
33823383

3383-
intel_psr_force_update(intel_dp);
3384+
intel_psr_force_update(intel_dp);
3385+
} else {
3386+
intel_psr_exit(intel_dp);
3387+
}
33843388

3385-
if (!intel_dp->psr.psr2_sel_fetch_enabled && !intel_dp->psr.active &&
3389+
if ((!intel_dp->psr.psr2_sel_fetch_enabled || DISPLAY_VER(display) >= 20) &&
33863390
!intel_dp->psr.busy_frontbuffer_bits)
33873391
queue_work(display->wq.unordered, &intel_dp->psr.work);
33883392
}

drivers/gpu/drm/nouveau/nouveau_display.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,14 +253,14 @@ nouveau_check_bl_size(struct nouveau_drm *drm, struct nouveau_bo *nvbo,
253253

254254
int
255255
nouveau_framebuffer_new(struct drm_device *dev,
256+
const struct drm_format_info *info,
256257
const struct drm_mode_fb_cmd2 *mode_cmd,
257258
struct drm_gem_object *gem,
258259
struct drm_framebuffer **pfb)
259260
{
260261
struct nouveau_drm *drm = nouveau_drm(dev);
261262
struct nouveau_bo *nvbo = nouveau_gem_object(gem);
262263
struct drm_framebuffer *fb;
263-
const struct drm_format_info *info;
264264
unsigned int height, i;
265265
uint32_t tile_mode;
266266
uint8_t kind;
@@ -295,9 +295,6 @@ nouveau_framebuffer_new(struct drm_device *dev,
295295
kind = nvbo->kind;
296296
}
297297

298-
info = drm_get_format_info(dev, mode_cmd->pixel_format,
299-
mode_cmd->modifier[0]);
300-
301298
for (i = 0; i < info->num_planes; i++) {
302299
height = drm_format_info_plane_height(info,
303300
mode_cmd->height,
@@ -321,7 +318,7 @@ nouveau_framebuffer_new(struct drm_device *dev,
321318
if (!(fb = *pfb = kzalloc(sizeof(*fb), GFP_KERNEL)))
322319
return -ENOMEM;
323320

324-
drm_helper_mode_fill_fb_struct(dev, fb, NULL, mode_cmd);
321+
drm_helper_mode_fill_fb_struct(dev, fb, info, mode_cmd);
325322
fb->obj[0] = gem;
326323

327324
ret = drm_framebuffer_init(dev, fb, &nouveau_framebuffer_funcs);
@@ -344,7 +341,7 @@ nouveau_user_framebuffer_create(struct drm_device *dev,
344341
if (!gem)
345342
return ERR_PTR(-ENOENT);
346343

347-
ret = nouveau_framebuffer_new(dev, mode_cmd, gem, &fb);
344+
ret = nouveau_framebuffer_new(dev, info, mode_cmd, gem, &fb);
348345
if (ret == 0)
349346
return fb;
350347

0 commit comments

Comments
 (0)