From 267be033817f2aed0d2d64b612e43c57a2d07af7 Mon Sep 17 00:00:00 2001 From: Kuogee Hsieh Date: Mon, 29 Sep 2014 13:47:37 -0700 Subject: [PATCH] msm: mdss: check dcs_cmd_by_left for tear_on and tear_off "dcs_cmd_by_left" indicates that dcs commands can be only sent for left DSI controller. Tear_on and Tear_off should not be send to right controller when above flag is set. This change fixes the tear_on and tear_off APIs with input validation. CRs-Fixed: 728424 Change-Id: Ia4e37456bf4377f7dc4c7a3c1d929c06420b05e4 Signed-off-by: Kuogee Hsieh --- drivers/video/fbdev/msm/mdss_dsi_cmd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/video/fbdev/msm/mdss_dsi_cmd.c b/drivers/video/fbdev/msm/mdss_dsi_cmd.c index f64ac148c0ab..f233589d5de6 100644 --- a/drivers/video/fbdev/msm/mdss_dsi_cmd.c +++ b/drivers/video/fbdev/msm/mdss_dsi_cmd.c @@ -612,6 +612,11 @@ static struct dsi_cmd_desc dsi_tear_off_cmd = { void mdss_dsi_set_tear_on(struct mdss_dsi_ctrl_pdata *ctrl) { struct dcs_cmd_req cmdreq; + struct mdss_panel_info *pinfo; + + pinfo = &(ctrl->panel_data.panel_info); + if (pinfo->dcs_cmd_by_left && ctrl->ndx != DSI_CTRL_LEFT) + return; cmdreq.cmds = &dsi_tear_on_cmd; cmdreq.cmds_cnt = 1; @@ -625,6 +630,11 @@ void mdss_dsi_set_tear_on(struct mdss_dsi_ctrl_pdata *ctrl) void mdss_dsi_set_tear_off(struct mdss_dsi_ctrl_pdata *ctrl) { struct dcs_cmd_req cmdreq; + struct mdss_panel_info *pinfo; + + pinfo = &(ctrl->panel_data.panel_info); + if (pinfo->dcs_cmd_by_left && ctrl->ndx != DSI_CTRL_LEFT) + return; cmdreq.cmds = &dsi_tear_off_cmd; cmdreq.cmds_cnt = 1;