drm/msm: support shutdown sequence on msm driver
Add shutdown sequence in msm driver to turn off all connectors/bridge gracefully. That will allow the graceful shutdown for dsi panel. Change-Id: I055bd57a45706478c785b7a3c41bf7623dd8d2e7 Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org> Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
This commit is contained in:
parent
07324253e2
commit
4f2aa096ba
3 changed files with 33 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* 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) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* 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>
|
||||
*
|
||||
|
@ -2199,6 +2199,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 +2231,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,
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue