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: Dhaval Patel <pdhaval@codeaurora.org> Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
This commit is contained in:
parent
4f2aa096ba
commit
47f361f8fc
1 changed files with 12 additions and 1 deletions
|
@ -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, ¶m);
|
||||
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");
|
||||
|
|
Loading…
Add table
Reference in a new issue