OSDN Git Service

msm: mdss: make panel status check and dfps update exclusive
authorSandeep Panda <spanda@codeaurora.org>
Thu, 13 Apr 2017 12:30:54 +0000 (18:00 +0530)
committerSandeep Panda <spanda@codeaurora.org>
Sat, 15 Apr 2017 14:41:33 +0000 (20:11 +0530)
Since on some platforms DSI_CMD_OFFSET register has become
double buffered, so dynamic fps update and DSI DMA command
transfer can not happen at the same time. This changes makes
panel status check which in turn does a DSI DMA transfer, and
dfps update mutually exclusive.

Change-Id: If8591c55d31669dbf3f565db041c04bcd6cb616a
Signed-off-by: Sandeep Panda <spanda@codeaurora.org>
drivers/video/fbdev/msm/mdss_dsi.c
drivers/video/fbdev/msm/mdss_dsi.h
drivers/video/fbdev/msm/mdss_dsi_status.c
drivers/video/fbdev/msm/mdss_fb.c

index 17722ea..b155282 100644 (file)
@@ -2713,10 +2713,7 @@ static int mdss_dsi_event_handler(struct mdss_panel_data *pdata,
                rc = mdss_dsi_reconfig(pdata, mode);
                break;
        case MDSS_EVENT_DSI_PANEL_STATUS:
-               if (ctrl_pdata->check_status)
-                       rc = ctrl_pdata->check_status(ctrl_pdata);
-               else
-                       rc = true;
+               rc = mdss_dsi_check_panel_status(ctrl_pdata, arg);
                break;
        case MDSS_EVENT_PANEL_TIMING_SWITCH:
                rc = mdss_dsi_panel_timing_switch(ctrl_pdata, arg);
index 2a76466..00f2338 100644 (file)
@@ -704,6 +704,7 @@ void mdss_dsi_cfg_lane_ctrl(struct mdss_dsi_ctrl_pdata *ctrl,
 void mdss_dsi_set_reg(struct mdss_dsi_ctrl_pdata *ctrl, int off,
        u32 mask, u32 val);
 int mdss_dsi_phy_pll_reset_status(struct mdss_dsi_ctrl_pdata *ctrl);
+int mdss_dsi_check_panel_status(struct mdss_dsi_ctrl_pdata *ctrl, void *arg);
 
 static inline const char *__mdss_dsi_pm_name(enum dsi_pm_type module)
 {
index 4208c2c..0f24f66 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 and
@@ -39,6 +39,35 @@ static uint32_t interval = STATUS_CHECK_INTERVAL_MS;
 static int32_t dsi_status_disable = DSI_STATUS_CHECK_INIT;
 struct dsi_status_data *pstatus_data;
 
+int mdss_dsi_check_panel_status(struct mdss_dsi_ctrl_pdata *ctrl, void *arg)
+{
+       struct mdss_mdp_ctl *ctl = NULL;
+       struct msm_fb_data_type *mfd = arg;
+       int ret = 0;
+
+       if (!mfd)
+               return -EINVAL;
+
+       ctl = mfd_to_ctl(mfd);
+
+       if (!ctl || !ctrl)
+               return -EINVAL;
+
+       mutex_lock(&ctl->offlock);
+       /*
+        * if check_status method is not defined
+        * then no need to fail this function,
+        * instead return a positive value.
+        */
+       if (ctrl->check_status)
+               ret = ctrl->check_status(ctrl);
+       else
+               ret = 1;
+       mutex_unlock(&ctl->offlock);
+
+       return ret;
+}
+
 /*
  * check_dsi_ctrl_status() - Reads MFD structure and
  * calls platform specific DSI ctrl Status function.
index 9364324..0995a67 100644 (file)
@@ -653,7 +653,7 @@ static ssize_t mdss_fb_get_panel_status(struct device *dev,
                ret = scnprintf(buf, PAGE_SIZE, "panel_status=%s\n", "suspend");
        } else {
                panel_status = mdss_fb_send_panel_event(mfd,
-                               MDSS_EVENT_DSI_PANEL_STATUS, NULL);
+                               MDSS_EVENT_DSI_PANEL_STATUS, mfd);
                ret = scnprintf(buf, PAGE_SIZE, "panel_status=%s\n",
                        panel_status > 0 ? "alive" : "dead");
        }