Commit 5236bb81 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'drm-misc-fixes-2025-04-30' of...

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: default avatarDave Airlie <airlied@redhat.com>

From: Maxime Ripard <mripard@redhat.com>
Link: https://lore.kernel.org/r/20250430-dark-eggplant-trout-c4ea6c@houat
parents b4432656 1a8bc0fe
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -544,7 +544,7 @@ static void ivpu_fw_boot_params_print(struct ivpu_device *vdev, struct vpu_boot_
		 boot_params->d0i3_entry_vpu_ts);
	ivpu_dbg(vdev, FW_BOOT, "boot_params.system_time_us = %llu\n",
		 boot_params->system_time_us);
	ivpu_dbg(vdev, FW_BOOT, "boot_params.power_profile = %u\n",
	ivpu_dbg(vdev, FW_BOOT, "boot_params.power_profile = 0x%x\n",
		 boot_params->power_profile);
}

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

	boot_params->system_time_us = ktime_to_us(ktime_get_real());
	wmb(); /* Flush WC buffers after writing bootparams */
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
#define PLL_PROFILING_FREQ_DEFAULT   38400000
#define PLL_PROFILING_FREQ_HIGH      400000000

#define DCT_DEFAULT_ACTIVE_PERCENT 15u
#define DCT_DEFAULT_ACTIVE_PERCENT 30u
#define DCT_PERIOD_US		   35300u

int ivpu_hw_btrs_info_init(struct ivpu_device *vdev);
+10 −8
Original line number Diff line number Diff line
@@ -428,16 +428,17 @@ int ivpu_pm_dct_enable(struct ivpu_device *vdev, u8 active_percent)
	active_us = (DCT_PERIOD_US * active_percent) / 100;
	inactive_us = DCT_PERIOD_US - active_us;

	vdev->pm->dct_active_percent = active_percent;

	ivpu_dbg(vdev, PM, "DCT requested %u%% (D0: %uus, D0i2: %uus)\n",
		 active_percent, active_us, inactive_us);

	ret = ivpu_jsm_dct_enable(vdev, active_us, inactive_us);
	if (ret) {
		ivpu_err_ratelimited(vdev, "Failed to enable DCT: %d\n", ret);
		return ret;
	}

	vdev->pm->dct_active_percent = active_percent;

	ivpu_dbg(vdev, PM, "DCT set to %u%% (D0: %uus, D0i2: %uus)\n",
		 active_percent, active_us, inactive_us);
	return 0;
}

@@ -445,15 +446,16 @@ int ivpu_pm_dct_disable(struct ivpu_device *vdev)
{
	int ret;

	vdev->pm->dct_active_percent = 0;

	ivpu_dbg(vdev, PM, "DCT requested to be disabled\n");

	ret = ivpu_jsm_dct_disable(vdev);
	if (ret) {
		ivpu_err_ratelimited(vdev, "Failed to disable DCT: %d\n", ret);
		return ret;
	}

	vdev->pm->dct_active_percent = 0;

	ivpu_dbg(vdev, PM, "DCT disabled\n");
	return 0;
}

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

	if (vdev->pm->dct_active_percent)
	if (enable)
		ret = ivpu_pm_dct_enable(vdev, DCT_DEFAULT_ACTIVE_PERCENT);
	else
		ret = ivpu_pm_dct_disable(vdev);
+1 −1
Original line number Diff line number Diff line
@@ -188,7 +188,7 @@ config DRM_DEBUG_DP_MST_TOPOLOGY_REFS
        bool "Enable refcount backtrace history in the DP MST helpers"
	depends on STACKTRACE_SUPPORT
        select STACKDEPOT
        depends on DRM_KMS_HELPER
        select DRM_KMS_HELPER
        depends on DEBUG_KERNEL
        depends on EXPERT
        help
+14 −13
Original line number Diff line number Diff line
@@ -121,7 +121,6 @@ struct adp_drv_private {
	dma_addr_t mask_iova;
	int be_irq;
	int fe_irq;
	spinlock_t irq_lock;
	struct drm_pending_vblank_event *event;
};

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

static void adp_crtc_atomic_disable(struct drm_crtc *crtc,
@@ -310,6 +310,7 @@ static void adp_crtc_atomic_flush(struct drm_crtc *crtc,
				  struct drm_atomic_state *state)
{
	u32 frame_num = 1;
	unsigned long flags;
	struct adp_drv_private *adp = crtc_to_adp(crtc);
	struct drm_crtc_state *new_state = drm_atomic_get_new_crtc_state(state, crtc);
	u64 new_size = ALIGN(new_state->mode.hdisplay *
@@ -330,13 +331,19 @@ static void adp_crtc_atomic_flush(struct drm_crtc *crtc,
	}
	writel(ADBE_FIFO_SYNC | frame_num, adp->be + ADBE_FIFO);
	//FIXME: use adbe flush interrupt
	spin_lock_irq(&crtc->dev->event_lock);
	if (crtc->state->event) {
		drm_crtc_vblank_get(crtc);
		adp->event = crtc->state->event;
	}
		struct drm_pending_vblank_event *event = crtc->state->event;

		crtc->state->event = NULL;
	spin_unlock_irq(&crtc->dev->event_lock);
		spin_lock_irqsave(&crtc->dev->event_lock, flags);

		if (drm_crtc_vblank_get(crtc) != 0)
			drm_crtc_send_vblank_event(crtc, event);
		else
			adp->event = event;

		spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
	}
}

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

	spin_lock(&adp->irq_lock);

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

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

	spin_unlock(&adp->irq_lock);

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

	adp_disable_vblank(adp);
	writel(ADP_CTRL_FIFO_ON | ADP_CTRL_VBLANK_ON, adp->fe + ADP_CTRL);
	writel(ADP_CTRL_FIFO_ON, adp->fe + ADP_CTRL);

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

	spin_lock_init(&adp->irq_lock);

	dev_set_drvdata(&pdev->dev, &adp->drm);

	err = adp_parse_of(pdev, adp);
Loading