Merge branch 'display-kernel.lnx.5.10' into display-kernel.lnx.1.0

Change-Id: I5d2b08380b6b0eb09492b950fb38cd9a0b3196c1
This commit is contained in:
Jeykumar Sankaran
2021-12-08 12:37:35 -08:00
کامیت cf39b00660
53فایلهای تغییر یافته به همراه1867 افزوده شده و 334 حذف شده

مشاهده پرونده

@@ -107,6 +107,24 @@ static void msm_fb_output_poll_changed(struct drm_device *dev)
drm_fb_helper_hotplug_event(priv->fbdev);
}
static void msm_drm_display_thread_priority_worker(struct kthread_work *work)
{
int ret = 0;
struct sched_param param = { 0 };
struct task_struct *task = current->group_leader;
/**
* 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;
ret = sched_setscheduler(task, SCHED_FIFO, &param);
if (ret)
pr_warn("pid:%d name:%s priority update failed: %d\n",
current->tgid, task->comm, ret);
}
/**
* msm_atomic_helper_check - validate state object
* @dev: DRM device
@@ -663,20 +681,13 @@ static int msm_component_bind_all(struct device *dev,
}
#endif
static int msm_drm_display_thread_create(struct sched_param param,
struct msm_drm_private *priv, struct drm_device *ddev,
static int msm_drm_display_thread_create(struct msm_drm_private *priv, struct drm_device *ddev,
struct device *dev)
{
int i, ret = 0;
/**
* 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;
kthread_init_work(&priv->thread_priority_work, msm_drm_display_thread_priority_worker);
for (i = 0; i < priv->num_crtcs; i++) {
/* initialize display thread */
priv->disp_thread[i].crtc_id = priv->crtcs[i]->base.id;
kthread_init_worker(&priv->disp_thread[i].worker);
@@ -685,11 +696,7 @@ static int msm_drm_display_thread_create(struct sched_param param,
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);
kthread_queue_work(&priv->disp_thread[i].worker, &priv->thread_priority_work);
if (IS_ERR(priv->disp_thread[i].thread)) {
dev_err(dev, "failed to create crtc_commit kthread\n");
@@ -711,11 +718,7 @@ static int msm_drm_display_thread_create(struct sched_param param,
* 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);
kthread_queue_work(&priv->event_thread[i].worker, &priv->thread_priority_work);
if (IS_ERR(priv->event_thread[i].thread)) {
dev_err(dev, "failed to create crtc_event kthread\n");
@@ -750,12 +753,7 @@ static int msm_drm_display_thread_create(struct sched_param param,
kthread_init_worker(&priv->pp_event_worker);
priv->pp_event_thread = kthread_run(kthread_worker_fn,
&priv->pp_event_worker, "pp_event");
ret = sched_setscheduler(priv->pp_event_thread,
SCHED_FIFO, &param);
if (ret)
pr_warn("pp_event thread priority update failed: %d\n",
ret);
kthread_queue_work(&priv->pp_event_worker, &priv->thread_priority_work);
if (IS_ERR(priv->pp_event_thread)) {
dev_err(dev, "failed to create pp_event kthread\n");
@@ -765,8 +763,8 @@ static int msm_drm_display_thread_create(struct sched_param param,
}
return 0;
}
static struct msm_kms *_msm_drm_component_init_helper(
struct msm_drm_private *priv,
struct drm_device *ddev, struct device *dev,
@@ -891,7 +889,6 @@ static int msm_drm_component_init(struct device *dev)
struct msm_drm_private *priv = ddev->dev_private;
struct msm_kms *kms = NULL;
int ret;
struct sched_param param = { 0 };
struct drm_crtc *crtc;
ret = msm_mdss_init(ddev);
@@ -930,7 +927,7 @@ static int msm_drm_component_init(struct device *dev)
sde_rotator_register();
sde_rotator_smmu_driver_register();
ret = msm_drm_display_thread_create(param, priv, ddev, dev);
ret = msm_drm_display_thread_create(priv, ddev, dev);
if (ret) {
dev_err(dev, "msm_drm_display_thread_create failed\n");
goto fail;
@@ -1501,7 +1498,7 @@ void msm_mode_object_event_notify(struct drm_mode_object *obj,
static int msm_release(struct inode *inode, struct file *filp)
{
struct drm_file *file_priv = filp->private_data;
struct drm_file *file_priv;
struct drm_minor *minor;
struct drm_device *dev;
struct msm_drm_private *priv;
@@ -1513,6 +1510,7 @@ static int msm_release(struct inode *inode, struct file *filp)
mutex_lock(&msm_release_lock);
file_priv = filp->private_data;
if (!file_priv) {
ret = -EINVAL;
goto end;