Skip to content

Commit

Permalink
drm: msm: extend qcom drm notifier
Browse files Browse the repository at this point in the history
Change-Id: Id266a34b20403a9f3ef445902730f293712bf260
Signed-off-by: UtsavisGreat <[email protected]>

fix

Signed-off-by: UtsavisGreat <[email protected]>
  • Loading branch information
Demon000 authored and penglezos committed May 30, 2020
1 parent 7186a1c commit dc255c4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
18 changes: 9 additions & 9 deletions drivers/gpu/drm/msm/dsi-staging/dsi_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <linux/of.h>
#include <linux/of_gpio.h>
#include <linux/err.h>
#include <drm/drm_notifier.h>
#include <linux/msm_drm_notify.h>

#include "msm_drv.h"
#include "sde_connector.h"
Expand Down Expand Up @@ -233,7 +233,7 @@ int dsi_display_set_backlight(struct drm_connector *connector,
goto error;
}

if (drm_dev && (drm_dev->doze_state == DRM_BLANK_LP1 || drm_dev->doze_state == DRM_BLANK_LP2)) {
if (drm_dev && (drm_dev->doze_state == MSM_DRM_BLANK_LP1 || drm_dev->doze_state == MSM_DRM_BLANK_LP2)) {
rc = dsi_panel_set_doze_backlight(display, (u32)bl_temp);
if (rc)
pr_err("unable to set doze backlight\n");
Expand Down Expand Up @@ -1236,8 +1236,8 @@ int dsi_display_set_power(struct drm_connector *connector,
int power_mode, void *disp)
{
struct dsi_display *display = disp;
struct msm_drm_notifier g_notify_data;
int rc = 0;
struct drm_notify_data g_notify_data;
struct drm_device *dev = NULL;
int event = 0;

Expand All @@ -1259,21 +1259,21 @@ int dsi_display_set_power(struct drm_connector *connector,
pr_info("%s %d\n", __func__, event);
switch (power_mode) {
case SDE_MODE_DPMS_LP1:
drm_notifier_call_chain(DRM_EARLY_EVENT_BLANK, &g_notify_data);
msm_drm_notifier_call_chain(MSM_DRM_EARLY_EVENT_BLANK, &g_notify_data);
rc = dsi_panel_set_lp1(display->panel);
drm_notifier_call_chain(DRM_EVENT_BLANK, &g_notify_data);
msm_drm_notifier_call_chain(MSM_DRM_EVENT_BLANK, &g_notify_data);
break;
case SDE_MODE_DPMS_LP2:
drm_notifier_call_chain(DRM_EARLY_EVENT_BLANK, &g_notify_data);
msm_drm_notifier_call_chain(MSM_DRM_EARLY_EVENT_BLANK, &g_notify_data);
rc = dsi_panel_set_lp2(display->panel);
drm_notifier_call_chain(DRM_EVENT_BLANK, &g_notify_data);
msm_drm_notifier_call_chain(MSM_DRM_EVENT_BLANK, &g_notify_data);
break;
case SDE_MODE_DPMS_ON:
if (display->panel->power_mode == SDE_MODE_DPMS_LP1 ||
display->panel->power_mode == SDE_MODE_DPMS_LP2) {
drm_notifier_call_chain(DRM_EARLY_EVENT_BLANK, &g_notify_data);
msm_drm_notifier_call_chain(MSM_DRM_EARLY_EVENT_BLANK, &g_notify_data);
rc = dsi_panel_set_nolp(display->panel);
drm_notifier_call_chain(DRM_EVENT_BLANK, &g_notify_data);
msm_drm_notifier_call_chain(MSM_DRM_EVENT_BLANK, &g_notify_data);
}
break;
case SDE_MODE_DPMS_OFF:
Expand Down
3 changes: 2 additions & 1 deletion drivers/gpu/drm/msm/msm_atomic.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,12 @@ EXPORT_SYMBOL(msm_drm_unregister_client);
* @v: notifier data, inculde display id and display blank
* event(unblank or power down).
*/
static int msm_drm_notifier_call_chain(unsigned long val, void *v)
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);

/* block until specified crtcs are no longer pending update, and
* atomically mark them as pending update
Expand Down
5 changes: 5 additions & 0 deletions include/linux/msm_drm_notify.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand All @@ -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

0 comments on commit dc255c4

Please sign in to comment.