Skip to content

Commit 5236bb8

Browse files
committed
Merge tag 'drm-misc-fixes-2025-04-30' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes
A spurious WARN fix for nouveau, an init and interrupt handling fixes for ivpu, a warning fix for ttm, a hotplug fix for fdinfo, vblank fixes for adp, a memory leak fix for the shmem kunit tests, and a timing fix for mipi-dbi. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maxime Ripard <mripard@redhat.com> Link: https://lore.kernel.org/r/20250430-dark-eggplant-trout-c4ea6c@houat
2 parents b443265 + 1a8bc0f commit 5236bb8

File tree

10 files changed

+45
-28
lines changed

10 files changed

+45
-28
lines changed

drivers/accel/ivpu/ivpu_fw.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ static void ivpu_fw_boot_params_print(struct ivpu_device *vdev, struct vpu_boot_
544544
boot_params->d0i3_entry_vpu_ts);
545545
ivpu_dbg(vdev, FW_BOOT, "boot_params.system_time_us = %llu\n",
546546
boot_params->system_time_us);
547-
ivpu_dbg(vdev, FW_BOOT, "boot_params.power_profile = %u\n",
547+
ivpu_dbg(vdev, FW_BOOT, "boot_params.power_profile = 0x%x\n",
548548
boot_params->power_profile);
549549
}
550550

@@ -646,7 +646,7 @@ void ivpu_fw_boot_params_setup(struct ivpu_device *vdev, struct vpu_boot_params
646646
boot_params->d0i3_residency_time_us = 0;
647647
boot_params->d0i3_entry_vpu_ts = 0;
648648
if (IVPU_WA(disable_d0i2))
649-
boot_params->power_profile = 1;
649+
boot_params->power_profile |= BIT(1);
650650

651651
boot_params->system_time_us = ktime_to_us(ktime_get_real());
652652
wmb(); /* Flush WC buffers after writing bootparams */

drivers/accel/ivpu/ivpu_hw_btrs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#define PLL_PROFILING_FREQ_DEFAULT 38400000
1515
#define PLL_PROFILING_FREQ_HIGH 400000000
1616

17-
#define DCT_DEFAULT_ACTIVE_PERCENT 15u
17+
#define DCT_DEFAULT_ACTIVE_PERCENT 30u
1818
#define DCT_PERIOD_US 35300u
1919

2020
int ivpu_hw_btrs_info_init(struct ivpu_device *vdev);

drivers/accel/ivpu/ivpu_pm.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -428,32 +428,34 @@ int ivpu_pm_dct_enable(struct ivpu_device *vdev, u8 active_percent)
428428
active_us = (DCT_PERIOD_US * active_percent) / 100;
429429
inactive_us = DCT_PERIOD_US - active_us;
430430

431+
vdev->pm->dct_active_percent = active_percent;
432+
433+
ivpu_dbg(vdev, PM, "DCT requested %u%% (D0: %uus, D0i2: %uus)\n",
434+
active_percent, active_us, inactive_us);
435+
431436
ret = ivpu_jsm_dct_enable(vdev, active_us, inactive_us);
432437
if (ret) {
433438
ivpu_err_ratelimited(vdev, "Failed to enable DCT: %d\n", ret);
434439
return ret;
435440
}
436441

437-
vdev->pm->dct_active_percent = active_percent;
438-
439-
ivpu_dbg(vdev, PM, "DCT set to %u%% (D0: %uus, D0i2: %uus)\n",
440-
active_percent, active_us, inactive_us);
441442
return 0;
442443
}
443444

444445
int ivpu_pm_dct_disable(struct ivpu_device *vdev)
445446
{
446447
int ret;
447448

449+
vdev->pm->dct_active_percent = 0;
450+
451+
ivpu_dbg(vdev, PM, "DCT requested to be disabled\n");
452+
448453
ret = ivpu_jsm_dct_disable(vdev);
449454
if (ret) {
450455
ivpu_err_ratelimited(vdev, "Failed to disable DCT: %d\n", ret);
451456
return ret;
452457
}
453458

454-
vdev->pm->dct_active_percent = 0;
455-
456-
ivpu_dbg(vdev, PM, "DCT disabled\n");
457459
return 0;
458460
}
459461

@@ -466,7 +468,7 @@ void ivpu_pm_irq_dct_work_fn(struct work_struct *work)
466468
if (ivpu_hw_btrs_dct_get_request(vdev, &enable))
467469
return;
468470

469-
if (vdev->pm->dct_active_percent)
471+
if (enable)
470472
ret = ivpu_pm_dct_enable(vdev, DCT_DEFAULT_ACTIVE_PERCENT);
471473
else
472474
ret = ivpu_pm_dct_disable(vdev);

drivers/gpu/drm/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ config DRM_DEBUG_DP_MST_TOPOLOGY_REFS
188188
bool "Enable refcount backtrace history in the DP MST helpers"
189189
depends on STACKTRACE_SUPPORT
190190
select STACKDEPOT
191-
depends on DRM_KMS_HELPER
191+
select DRM_KMS_HELPER
192192
depends on DEBUG_KERNEL
193193
depends on EXPERT
194194
help

drivers/gpu/drm/adp/adp_drv.c

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ struct adp_drv_private {
121121
dma_addr_t mask_iova;
122122
int be_irq;
123123
int fe_irq;
124-
spinlock_t irq_lock;
125124
struct drm_pending_vblank_event *event;
126125
};
127126

@@ -288,6 +287,7 @@ static void adp_crtc_atomic_enable(struct drm_crtc *crtc,
288287
writel(BIT(0), adp->be + ADBE_BLEND_EN3);
289288
writel(BIT(0), adp->be + ADBE_BLEND_BYPASS);
290289
writel(BIT(0), adp->be + ADBE_BLEND_EN4);
290+
drm_crtc_vblank_on(crtc);
291291
}
292292

293293
static void adp_crtc_atomic_disable(struct drm_crtc *crtc,
@@ -310,6 +310,7 @@ static void adp_crtc_atomic_flush(struct drm_crtc *crtc,
310310
struct drm_atomic_state *state)
311311
{
312312
u32 frame_num = 1;
313+
unsigned long flags;
313314
struct adp_drv_private *adp = crtc_to_adp(crtc);
314315
struct drm_crtc_state *new_state = drm_atomic_get_new_crtc_state(state, crtc);
315316
u64 new_size = ALIGN(new_state->mode.hdisplay *
@@ -330,13 +331,19 @@ static void adp_crtc_atomic_flush(struct drm_crtc *crtc,
330331
}
331332
writel(ADBE_FIFO_SYNC | frame_num, adp->be + ADBE_FIFO);
332333
//FIXME: use adbe flush interrupt
333-
spin_lock_irq(&crtc->dev->event_lock);
334334
if (crtc->state->event) {
335-
drm_crtc_vblank_get(crtc);
336-
adp->event = crtc->state->event;
335+
struct drm_pending_vblank_event *event = crtc->state->event;
336+
337+
crtc->state->event = NULL;
338+
spin_lock_irqsave(&crtc->dev->event_lock, flags);
339+
340+
if (drm_crtc_vblank_get(crtc) != 0)
341+
drm_crtc_send_vblank_event(crtc, event);
342+
else
343+
adp->event = event;
344+
345+
spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
337346
}
338-
crtc->state->event = NULL;
339-
spin_unlock_irq(&crtc->dev->event_lock);
340347
}
341348

342349
static const struct drm_crtc_funcs adp_crtc_funcs = {
@@ -482,8 +489,6 @@ static irqreturn_t adp_fe_irq(int irq, void *arg)
482489
u32 int_status;
483490
u32 int_ctl;
484491

485-
spin_lock(&adp->irq_lock);
486-
487492
int_status = readl(adp->fe + ADP_INT_STATUS);
488493
if (int_status & ADP_INT_STATUS_VBLANK) {
489494
drm_crtc_handle_vblank(&adp->crtc);
@@ -501,7 +506,6 @@ static irqreturn_t adp_fe_irq(int irq, void *arg)
501506

502507
writel(int_status, adp->fe + ADP_INT_STATUS);
503508

504-
spin_unlock(&adp->irq_lock);
505509

506510
return IRQ_HANDLED;
507511
}
@@ -512,8 +516,7 @@ static int adp_drm_bind(struct device *dev)
512516
struct adp_drv_private *adp = to_adp(drm);
513517
int err;
514518

515-
adp_disable_vblank(adp);
516-
writel(ADP_CTRL_FIFO_ON | ADP_CTRL_VBLANK_ON, adp->fe + ADP_CTRL);
519+
writel(ADP_CTRL_FIFO_ON, adp->fe + ADP_CTRL);
517520

518521
adp->next_bridge = drmm_of_get_bridge(&adp->drm, dev->of_node, 0, 0);
519522
if (IS_ERR(adp->next_bridge)) {
@@ -567,8 +570,6 @@ static int adp_probe(struct platform_device *pdev)
567570
if (IS_ERR(adp))
568571
return PTR_ERR(adp);
569572

570-
spin_lock_init(&adp->irq_lock);
571-
572573
dev_set_drvdata(&pdev->dev, &adp->drm);
573574

574575
err = adp_parse_of(pdev, adp);

drivers/gpu/drm/drm_file.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -964,6 +964,10 @@ void drm_show_fdinfo(struct seq_file *m, struct file *f)
964964
struct drm_file *file = f->private_data;
965965
struct drm_device *dev = file->minor->dev;
966966
struct drm_printer p = drm_seq_file_printer(m);
967+
int idx;
968+
969+
if (!drm_dev_enter(dev, &idx))
970+
return;
967971

968972
drm_printf(&p, "drm-driver:\t%s\n", dev->driver->name);
969973
drm_printf(&p, "drm-client-id:\t%llu\n", file->client_id);
@@ -983,6 +987,8 @@ void drm_show_fdinfo(struct seq_file *m, struct file *f)
983987

984988
if (dev->driver->show_fdinfo)
985989
dev->driver->show_fdinfo(&p, file);
990+
991+
drm_dev_exit(idx);
986992
}
987993
EXPORT_SYMBOL(drm_show_fdinfo);
988994

drivers/gpu/drm/drm_mipi_dbi.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,16 @@ static void mipi_dbi_blank(struct mipi_dbi_dev *dbidev)
404404
u16 height = drm->mode_config.min_height;
405405
u16 width = drm->mode_config.min_width;
406406
struct mipi_dbi *dbi = &dbidev->dbi;
407-
size_t len = width * height * 2;
407+
const struct drm_format_info *dst_format;
408+
size_t len;
408409
int idx;
409410

410411
if (!drm_dev_enter(drm, &idx))
411412
return;
412413

414+
dst_format = drm_format_info(dbidev->pixel_format);
415+
len = drm_format_info_min_pitch(dst_format, 0, width) * height;
416+
413417
memset(dbidev->tx_buf, 0, len);
414418

415419
mipi_dbi_set_window_address(dbidev, 0, width - 1, 0, height - 1);

drivers/gpu/drm/nouveau/nouveau_fence.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ nouveau_fence_context_kill(struct nouveau_fence_chan *fctx, int error)
9090
while (!list_empty(&fctx->pending)) {
9191
fence = list_entry(fctx->pending.next, typeof(*fence), head);
9292

93-
if (error)
93+
if (error && !dma_fence_is_signaled_locked(&fence->base))
9494
dma_fence_set_error(&fence->base, error);
9595

9696
if (nouveau_fence_signal(fence))

drivers/gpu/drm/tests/drm_gem_shmem_test.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,9 @@ static void drm_gem_shmem_test_get_pages_sgt(struct kunit *test)
216216
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, sgt);
217217
KUNIT_EXPECT_NULL(test, shmem->sgt);
218218

219+
ret = kunit_add_action_or_reset(test, kfree_wrapper, sgt);
220+
KUNIT_ASSERT_EQ(test, ret, 0);
221+
219222
ret = kunit_add_action_or_reset(test, sg_free_table_wrapper, sgt);
220223
KUNIT_ASSERT_EQ(test, ret, 0);
221224

drivers/gpu/drm/ttm/ttm_bo.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,8 @@ struct ttm_bo_swapout_walk {
10931093
struct ttm_lru_walk walk;
10941094
/** @gfp_flags: The gfp flags to use for ttm_tt_swapout() */
10951095
gfp_t gfp_flags;
1096-
1096+
/** @hit_low: Whether we should attempt to swap BO's with low watermark threshold */
1097+
/** @evict_low: If we cannot swap a bo when @try_low is false (first pass) */
10971098
bool hit_low, evict_low;
10981099
};
10991100

0 commit comments

Comments
 (0)