Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 457e6997 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drm/msm: move display and event threads to realtime priority"

parents c7cca716 824bbc22
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -521,6 +521,7 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
	struct msm_kms *kms;
	struct sde_dbg_power_ctrl dbg_power_ctrl = { 0 };
	int ret, i;
	struct sched_param param;

	ddev = drm_dev_alloc(drv, dev);
	if (!ddev) {
@@ -624,6 +625,12 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
	}
	ddev->mode_config.funcs = &mode_config_funcs;

	/**
	 * this priority was found during empiric testing to have appropriate
	 * realtime scheduling to process display updates and interact with
	 * other real time and normal priority task
	 */
	param.sched_priority = 16;
	for (i = 0; i < priv->num_crtcs; i++) {

		/* initialize display thread */
@@ -634,6 +641,11 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
			kthread_run(kthread_worker_fn,
				&priv->disp_thread[i].worker,
				"crtc_commit:%d", priv->disp_thread[i].crtc_id);
		ret = sched_setscheduler(priv->disp_thread[i].thread,
							SCHED_FIFO, &param);
		if (ret)
			pr_warn("display thread priority update failed: %d\n",
									ret);

		if (IS_ERR(priv->disp_thread[i].thread)) {
			dev_err(dev, "failed to create crtc_commit kthread\n");
@@ -648,6 +660,18 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv)
			kthread_run(kthread_worker_fn,
				&priv->event_thread[i].worker,
				"crtc_event:%d", priv->event_thread[i].crtc_id);
		/**
		 * event thread should also run at same priority as disp_thread
		 * because it is handling frame_done events. A lower priority
		 * event thread and higher priority disp_thread can causes
		 * frame_pending counters beyond 2. This can lead to commit
		 * failure at crtc commit level.
		 */
		ret = sched_setscheduler(priv->event_thread[i].thread,
							SCHED_FIFO, &param);
		if (ret)
			pr_warn("display event thread priority update failed: %d\n",
									ret);

		if (IS_ERR(priv->event_thread[i].thread)) {
			dev_err(dev, "failed to create crtc_event kthread\n");