Commit 036bfeb3 authored by Jeykumar Sankaran's avatar Jeykumar Sankaran Committed by Sean Paul

drm/msm: Add pm_suspend/resume callbacks to msm_kms

Used by the dpu driver for custom suspend/resume.

Changes in v3:
- None
Signed-off-by: default avatarJeykumar Sankaran <jsanka@codeaurora.org>
[seanpaul split this out of the megapatch]
Signed-off-by: default avatarSean Paul <seanpaul@chromium.org>
Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
parent 2b7ac1a8
...@@ -903,6 +903,11 @@ static int msm_pm_suspend(struct device *dev) ...@@ -903,6 +903,11 @@ static int msm_pm_suspend(struct device *dev)
{ {
struct drm_device *ddev = dev_get_drvdata(dev); struct drm_device *ddev = dev_get_drvdata(dev);
struct msm_drm_private *priv = ddev->dev_private; struct msm_drm_private *priv = ddev->dev_private;
struct msm_kms *kms = priv->kms;
/* TODO: Use atomic helper suspend/resume */
if (kms && kms->funcs && kms->funcs->pm_suspend)
return kms->funcs->pm_suspend(dev);
drm_kms_helper_poll_disable(ddev); drm_kms_helper_poll_disable(ddev);
...@@ -919,6 +924,11 @@ static int msm_pm_resume(struct device *dev) ...@@ -919,6 +924,11 @@ static int msm_pm_resume(struct device *dev)
{ {
struct drm_device *ddev = dev_get_drvdata(dev); struct drm_device *ddev = dev_get_drvdata(dev);
struct msm_drm_private *priv = ddev->dev_private; struct msm_drm_private *priv = ddev->dev_private;
struct msm_kms *kms = priv->kms;
/* TODO: Use atomic helper suspend/resume */
if (kms && kms->funcs && kms->funcs->pm_resume)
return kms->funcs->pm_resume(dev);
drm_atomic_helper_resume(ddev, priv->pm_state); drm_atomic_helper_resume(ddev, priv->pm_state);
drm_kms_helper_poll_enable(ddev); drm_kms_helper_poll_enable(ddev);
......
...@@ -61,6 +61,9 @@ struct msm_kms_funcs { ...@@ -61,6 +61,9 @@ struct msm_kms_funcs {
void (*set_encoder_mode)(struct msm_kms *kms, void (*set_encoder_mode)(struct msm_kms *kms,
struct drm_encoder *encoder, struct drm_encoder *encoder,
bool cmd_mode); bool cmd_mode);
/* pm suspend/resume hooks */
int (*pm_suspend)(struct device *dev);
int (*pm_resume)(struct device *dev);
/* cleanup: */ /* cleanup: */
void (*destroy)(struct msm_kms *kms); void (*destroy)(struct msm_kms *kms);
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment