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

Commit 8353ae1e 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 07d35574 47f361f8
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
 * Copyright (C) 2014 Red Hat
 * Author: Rob Clark <robdclark@gmail.com>
 *
@@ -562,6 +562,11 @@ int msm_atomic_commit(struct drm_device *dev,
	struct msm_commit *commit;
	int i, ret;

	if (!priv || priv->shutdown_in_progress) {
		DRM_ERROR("priv is null or shutdwon is in-progress\n");
		return -EINVAL;
	}

	SDE_ATRACE_BEGIN("atomic_commit");
	ret = drm_atomic_helper_prepare_planes(dev, state);
	if (ret) {
+36 −2
Original line number Diff line number Diff line
/*
 * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
 * Copyright (C) 2013 Red Hat
 * Author: Rob Clark <robdclark@gmail.com>
 *
@@ -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");
@@ -2199,6 +2210,28 @@ static const struct platform_device_id msm_id[] = {
	{ }
};

static void msm_pdev_shutdown(struct platform_device *pdev)
{
	struct drm_device *ddev = platform_get_drvdata(pdev);
	struct msm_drm_private *priv = NULL;

	if (!ddev) {
		DRM_ERROR("invalid drm device node\n");
		return;
	}

	priv = ddev->dev_private;
	if (!priv) {
		DRM_ERROR("invalid msm drm private node\n");
		return;
	}

	msm_lastclose(ddev);

	/* set this after lastclose to allow kickoff from lastclose */
	priv->shutdown_in_progress = true;
}

static const struct of_device_id dt_match[] = {
	{ .compatible = "qcom,mdp" },      /* mdp4 */
	{ .compatible = "qcom,sde-kms" },  /* sde  */
@@ -2209,6 +2242,7 @@ MODULE_DEVICE_TABLE(of, dt_match);
static struct platform_driver msm_platform_driver = {
	.probe      = msm_pdev_probe,
	.remove     = msm_pdev_remove,
	.shutdown   = msm_pdev_shutdown,
	.driver     = {
		.name   = "msm_drm",
		.of_match_table = dt_match,
+3 −0
Original line number Diff line number Diff line
@@ -375,6 +375,9 @@ struct msm_drm_private {

	/* list of clients waiting for events */
	struct list_head client_event_list;

	/* update the flag when msm driver receives shutdown notification */
	bool shutdown_in_progress;
};

struct msm_format {