diff --git a/drivers/gpu/drm/msm/dsi-staging/dsi_display.c b/drivers/gpu/drm/msm/dsi-staging/dsi_display.c index b4a5dc481213..bf88e0ef3b89 100644 --- a/drivers/gpu/drm/msm/dsi-staging/dsi_display.c +++ b/drivers/gpu/drm/msm/dsi-staging/dsi_display.c @@ -19,6 +19,8 @@ #include #include +#include + #include "msm_drv.h" #include "sde_connector.h" #include "msm_mmu.h" @@ -1060,6 +1062,7 @@ int dsi_display_set_power(struct drm_connector *connector, int power_mode, void *disp) { struct dsi_display *display = disp; + struct msm_drm_notifier notify_data; int rc = 0; if (!display || !display->panel) { @@ -1067,17 +1070,27 @@ int dsi_display_set_power(struct drm_connector *connector, return -EINVAL; } + notify_data.data = &power_mode; + notify_data.id = MSM_DRM_PRIMARY_DISPLAY; + switch (power_mode) { case SDE_MODE_DPMS_LP1: + msm_drm_notifier_call_chain(MSM_DRM_EARLY_EVENT_BLANK, ¬ify_data); rc = dsi_panel_set_lp1(display->panel); + msm_drm_notifier_call_chain(MSM_DRM_EVENT_BLANK, ¬ify_data); break; case SDE_MODE_DPMS_LP2: + msm_drm_notifier_call_chain(MSM_DRM_EARLY_EVENT_BLANK, ¬ify_data); rc = dsi_panel_set_lp2(display->panel); + msm_drm_notifier_call_chain(MSM_DRM_EVENT_BLANK, ¬ify_data); break; case SDE_MODE_DPMS_ON: if (display->panel->power_mode == SDE_MODE_DPMS_LP1 || - display->panel->power_mode == SDE_MODE_DPMS_LP2) + display->panel->power_mode == SDE_MODE_DPMS_LP2) { + msm_drm_notifier_call_chain(MSM_DRM_EARLY_EVENT_BLANK, ¬ify_data); rc = dsi_panel_set_nolp(display->panel); + msm_drm_notifier_call_chain(MSM_DRM_EVENT_BLANK, ¬ify_data); + } break; case SDE_MODE_DPMS_OFF: default: diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c index 8b26a48358c0..22172f991d1b 100644 --- a/drivers/gpu/drm/msm/msm_atomic.c +++ b/drivers/gpu/drm/msm/msm_atomic.c @@ -68,7 +68,7 @@ EXPORT_SYMBOL(msm_drm_unregister_client); * event(unblank or power down). */ static bool notifier_enabled __read_mostly = true; -static int msm_drm_notifier_call_chain(unsigned long val, void *v) +int msm_drm_notifier_call_chain(unsigned long val, void *v) { if (unlikely(!notifier_enabled)) return 0; @@ -76,6 +76,7 @@ static int msm_drm_notifier_call_chain(unsigned long val, void *v) return blocking_notifier_call_chain(&msm_drm_notifier_list, val, v); } +EXPORT_SYMBOL(msm_drm_notifier_call_chain); void msm_drm_notifier_enable(bool val) { diff --git a/include/linux/msm_drm_notify.h b/include/linux/msm_drm_notify.h index 924ba852c99c..4f9b32662ad5 100644 --- a/include/linux/msm_drm_notify.h +++ b/include/linux/msm_drm_notify.h @@ -23,6 +23,10 @@ enum { /* panel: power on */ MSM_DRM_BLANK_UNBLANK, + MSM_DRM_BLANK_LP1, + MSM_DRM_BLANK_LP2, + MSM_DRM_BLANK_STANDBY, + MSM_DRM_BLANK_SUSPEND, /* panel: power off */ MSM_DRM_BLANK_POWERDOWN, }; @@ -42,4 +46,5 @@ struct msm_drm_notifier { int msm_drm_register_client(struct notifier_block *nb); int msm_drm_unregister_client(struct notifier_block *nb); +int msm_drm_notifier_call_chain(unsigned long val, void *v); #endif