aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDemon Singur <demonsingur@gmail.com>2018-07-14 12:03:00 +0000
committerDemon Singur <demonsingur@gmail.com>2018-07-16 10:38:55 +0000
commit335e3821382a344ae218b55ee36dd58137dab5f4 (patch)
treef66534f6ef5ab1946f2ed665dfc89ae358be6c01
parent7f364d7ea8db1628b4c80411f95d68a0f3610a54 (diff)
Revert "msm: mdss: Power on display asynchronously as early as possible"o8.1
td4332 seems to have problems powering on for the first few times when using this commit. This reverts commit c9ef91bc7d66b99b1be11eabb1d56447fa0752cb. Change-Id: Ic970e210a69ab90de4e29662a42dce13011f4837
-rw-r--r--drivers/video/fbdev/msm/mdss_dsi.c107
-rw-r--r--drivers/video/fbdev/msm/mdss_dsi.h7
-rw-r--r--drivers/video/fbdev/msm/mdss_mdp_ctl.c15
3 files changed, 16 insertions, 113 deletions
diff --git a/drivers/video/fbdev/msm/mdss_dsi.c b/drivers/video/fbdev/msm/mdss_dsi.c
index e60680035add..e201dc7397cf 100644
--- a/drivers/video/fbdev/msm/mdss_dsi.c
+++ b/drivers/video/fbdev/msm/mdss_dsi.c
@@ -1837,87 +1837,6 @@ static irqreturn_t test_hw_vsync_handler(int irq, void *data)
return IRQ_HANDLED;
}
-static int mdss_dsi_disp_wake_thread(void *data)
-{
- struct mdss_panel_data *pdata = data;
- struct mdss_dsi_ctrl_pdata *ctrl_pdata =
- container_of(pdata, typeof(*ctrl_pdata), panel_data);
- struct sched_param param = { .sched_priority = MAX_RT_PRIO - 1 };
-
- sched_setscheduler(current, SCHED_FIFO, &param);
-
- wait_event(ctrl_pdata->wake_waitq,
- atomic_read(&ctrl_pdata->needs_wake));
-
- /* MDSS_EVENT_LINK_READY */
- if (ctrl_pdata->refresh_clk_rate)
- mdss_dsi_clk_refresh(pdata, ctrl_pdata->update_phy_timing);
- mdss_dsi_on(pdata);
-
- /* MDSS_EVENT_UNBLANK */
- mdss_dsi_unblank(pdata);
-
- /* MDSS_EVENT_PANEL_ON */
- ctrl_pdata->ctrl_state |= CTRL_STATE_MDP_ACTIVE;
- pdata->panel_info.esd_rdy = true;
-
- atomic_set(&ctrl_pdata->needs_wake, 0);
- complete_all(&ctrl_pdata->wake_comp);
-
- return 0;
-}
-
-static void mdss_dsi_start_wake_thread(struct mdss_dsi_ctrl_pdata *ctrl_pdata)
-{
- if (ctrl_pdata->wake_thread)
- return;
-
- ctrl_pdata->wake_thread = kthread_run(mdss_dsi_disp_wake_thread,
- &ctrl_pdata->panel_data,
- "mdss_disp_wake");
- if (IS_ERR(ctrl_pdata->wake_thread)) {
- pr_err("%s: Failed to start disp-wake thread, rc=%ld\n",
- __func__, PTR_ERR(ctrl_pdata->wake_thread));
- ctrl_pdata->wake_thread = NULL;
- }
-}
-
-static void mdss_dsi_display_wake(struct mdss_dsi_ctrl_pdata *ctrl_pdata)
-{
- if (atomic_read(&ctrl_pdata->disp_is_on))
- return;
-
- atomic_set(&ctrl_pdata->disp_is_on, 1);
- reinit_completion(&ctrl_pdata->wake_comp);
-
- /* Make sure the thread is started since it's needed right now */
- mdss_dsi_start_wake_thread(ctrl_pdata);
- ctrl_pdata->wake_thread = NULL;
-
- atomic_set(&ctrl_pdata->needs_wake, 1);
- wake_up(&ctrl_pdata->wake_waitq);
-}
-
-static int mdss_dsi_fb_unblank_cb(struct notifier_block *nb,
- unsigned long action, void *data)
-{
- struct mdss_dsi_ctrl_pdata *ctrl_pdata =
- container_of(nb, typeof(*ctrl_pdata), wake_notif);
- struct fb_event *evdata = data;
- int *blank = evdata->data;
-
- /* Parse framebuffer blank events as soon as they occur */
- if (action != FB_EARLY_EVENT_BLANK)
- return NOTIFY_OK;
-
- if (*blank == FB_BLANK_UNBLANK)
- mdss_dsi_display_wake(ctrl_pdata);
- else
- mdss_dsi_start_wake_thread(ctrl_pdata);
-
- return NOTIFY_OK;
-}
-
int mdss_dsi_cont_splash_on(struct mdss_panel_data *pdata)
{
int ret = 0;
@@ -2796,12 +2715,25 @@ static int mdss_dsi_event_handler(struct mdss_panel_data *pdata,
ctrl_pdata->refresh_clk_rate = true;
break;
case MDSS_EVENT_LINK_READY:
- /* The unblank notifier handles waking for unblank events */
- mdss_dsi_display_wake(ctrl_pdata);
+ if (ctrl_pdata->refresh_clk_rate)
+ rc = mdss_dsi_clk_refresh(pdata,
+ ctrl_pdata->update_phy_timing);
+
+ rc = mdss_dsi_on(pdata);
+ break;
+ case MDSS_EVENT_UNBLANK:
+ if (ctrl_pdata->on_cmds.link_state == DSI_LP_MODE)
+ rc = mdss_dsi_unblank(pdata);
break;
case MDSS_EVENT_POST_PANEL_ON:
rc = mdss_dsi_post_panel_on(pdata);
break;
+ case MDSS_EVENT_PANEL_ON:
+ ctrl_pdata->ctrl_state |= CTRL_STATE_MDP_ACTIVE;
+ if (ctrl_pdata->on_cmds.link_state == DSI_HS_MODE)
+ rc = mdss_dsi_unblank(pdata);
+ pdata->panel_info.esd_rdy = true;
+ break;
case MDSS_EVENT_BLANK:
power_state = (int) (unsigned long) arg;
if (ctrl_pdata->off_cmds.link_state == DSI_HS_MODE)
@@ -2813,7 +2745,6 @@ static int mdss_dsi_event_handler(struct mdss_panel_data *pdata,
if (ctrl_pdata->off_cmds.link_state == DSI_LP_MODE)
rc = mdss_dsi_blank(pdata, power_state);
rc = mdss_dsi_off(pdata, power_state);
- atomic_set(&ctrl_pdata->disp_is_on, 0);
break;
case MDSS_EVENT_DISABLE_PANEL:
/* disable esd thread */
@@ -3546,10 +3477,6 @@ static int mdss_dsi_ctrl_probe(struct platform_device *pdev)
mdss_dsi_debug_bus_init(mdss_dsi_res);
- ctrl_pdata->wake_notif.notifier_call = mdss_dsi_fb_unblank_cb;
- ctrl_pdata->wake_notif.priority = INT_MAX - 1;
- fb_register_client(&ctrl_pdata->wake_notif);
-
return 0;
error_shadow_clk_deinit:
@@ -4017,7 +3944,6 @@ static int mdss_dsi_ctrl_remove(struct platform_device *pdev)
return -ENODEV;
}
- fb_unregister_client(&ctrl_pdata->wake_notif);
mdss_dsi_pm_qos_remove_request(ctrl_pdata->shared_data);
if (msm_dss_config_vreg(&pdev->dev,
@@ -4558,9 +4484,6 @@ int dsi_panel_device_register(struct platform_device *ctrl_pdev,
pr_info("%s: Continuous splash %s\n", __func__,
pinfo->cont_splash_enabled ? "enabled" : "disabled");
- init_completion(&ctrl_pdata->wake_comp);
- init_waitqueue_head(&ctrl_pdata->wake_waitq);
-
rc = mdss_register_panel(ctrl_pdev, &(ctrl_pdata->panel_data));
if (rc) {
pr_err("%s: unable to register MIPI DSI panel\n", __func__);
diff --git a/drivers/video/fbdev/msm/mdss_dsi.h b/drivers/video/fbdev/msm/mdss_dsi.h
index 5560021dd2c1..9847016fed29 100644
--- a/drivers/video/fbdev/msm/mdss_dsi.h
+++ b/drivers/video/fbdev/msm/mdss_dsi.h
@@ -591,13 +591,6 @@ struct mdss_dsi_ctrl_pdata {
bool update_phy_timing; /* flag to recalculate PHY timings */
bool phy_power_off;
-
- struct notifier_block wake_notif;
- struct task_struct *wake_thread;
- struct completion wake_comp;
- wait_queue_head_t wake_waitq;
- atomic_t disp_is_on;
- atomic_t needs_wake;
};
struct dsi_status_data {
diff --git a/drivers/video/fbdev/msm/mdss_mdp_ctl.c b/drivers/video/fbdev/msm/mdss_mdp_ctl.c
index 99b508ff3332..632d73e909a3 100644
--- a/drivers/video/fbdev/msm/mdss_mdp_ctl.c
+++ b/drivers/video/fbdev/msm/mdss_mdp_ctl.c
@@ -27,7 +27,6 @@
#include "mdss_mdp.h"
#include "mdss_mdp_trace.h"
#include "mdss_debug.h"
-#include "mdss_dsi.h"
#define MDSS_MDP_QSEED3_VER_DOWNSCALE_LIM 2
#define NUM_MIXERCFG_REGS 3
@@ -4228,15 +4227,6 @@ int mdss_mdp_ctl_destroy(struct mdss_mdp_ctl *ctl)
return 0;
}
-static void mdss_mdp_wait_for_panel_on(struct mdss_panel_data *pdata)
-{
- struct mdss_dsi_ctrl_pdata *ctrl_pdata =
- container_of(pdata, typeof(*ctrl_pdata), panel_data);
-
- if (atomic_read(&ctrl_pdata->needs_wake))
- wait_for_completion(&ctrl_pdata->wake_comp);
-}
-
int mdss_mdp_ctl_intf_event(struct mdss_mdp_ctl *ctl, int event, void *arg,
u32 flags)
{
@@ -4260,11 +4250,8 @@ int mdss_mdp_ctl_intf_event(struct mdss_mdp_ctl *ctl, int event, void *arg,
pr_debug("sending ctl=%d event=%d flag=0x%x\n", ctl->num, event, flags);
do {
- if (pdata->event_handler) {
+ if (pdata->event_handler)
rc = pdata->event_handler(pdata, event, arg);
- if (event == MDSS_EVENT_LINK_READY)
- mdss_mdp_wait_for_panel_on(pdata);
- }
pdata = pdata->next;
} while (rc == 0 && pdata && pdata->active &&
!(flags & CTL_INTF_EVENT_FLAG_SKIP_BROADCAST));