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

Commit 47f361f8 authored by Lakshmi Narayana Kalavala's avatar Lakshmi Narayana Kalavala
Browse files

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



Display thread processes the work assigned by HAL for
screen update. Current logic selects the thread priority
to default and causes the frame drop. This patch moves
the display thread to realtime priority to process the display
work items at realtime. Event thread must follow the
display thread priority to avoid frame_pending counters
beyond 2.

Change-Id: I9154b749550cee52da1d16d22a8418676325e769
Signed-off-by: default avatarDhaval Patel <pdhaval@codeaurora.org>
Signed-off-by: default avatarLakshmi Narayana Kalavala <lkalaval@codeaurora.org>
parent 4f2aa096
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -439,6 +439,7 @@ static int msm_load(struct drm_device *dev, unsigned long flags)
	struct msm_kms *kms;
	struct sde_dbg_power_ctrl dbg_power_ctrl = { NULL };
	int ret, i;
	struct sched_param param;

	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
	if (!priv) {
@@ -532,7 +533,12 @@ static int msm_load(struct drm_device *dev, unsigned long flags)
			goto fail;
		}
	}

	/**
	 * 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;
	/* initialize commit thread structure */
	for (i = 0; i < priv->num_crtcs; i++) {
		priv->disp_thread[i].crtc_id = priv->crtcs[i]->base.id;
@@ -543,6 +549,11 @@ static int msm_load(struct drm_device *dev, unsigned long flags)
				&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->dev, "failed to create kthread\n");