OSDN Git Service

msm: mdss: add capability to parse multiple panel roi alignment
authorVeera Sundaram Sankaran <veeras@codeaurora.org>
Thu, 21 Apr 2016 21:41:44 +0000 (14:41 -0700)
committerKyle Yan <kyan@codeaurora.org>
Tue, 5 Jul 2016 22:31:04 +0000 (15:31 -0700)
Add device tree parsing logic to parse multiple panel alignment roi for
different panel resolutions. Add alignment roi as part of the panel
timing struct, so that it would be updated whenever resolution switch
happens.

Change-Id: I14ee1a4947312c4c36927adcbffad847f9062fd6
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
drivers/video/fbdev/msm/mdss_dsi_panel.c
drivers/video/fbdev/msm/mdss_fb.c
drivers/video/fbdev/msm/mdss_panel.c
drivers/video/fbdev/msm/mdss_panel.h

index ea706cb..cd770ea 100644 (file)
@@ -1519,11 +1519,13 @@ static int mdss_dsi_nt35596_read_status(struct mdss_dsi_ctrl_pdata *ctrl_pdata)
 }
 
 static void mdss_dsi_parse_roi_alignment(struct device_node *np,
-               struct mdss_panel_info *pinfo)
+               struct dsi_panel_timing *pt)
 {
        int len = 0;
        u32 value[6];
        struct property *data;
+       struct mdss_panel_timing *timing = &pt->timing;
+
        data = of_find_property(np, "qcom,panel-roi-alignment", &len);
        len /= sizeof(u32);
        if (!data || (len != 6)) {
@@ -1535,19 +1537,21 @@ static void mdss_dsi_parse_roi_alignment(struct device_node *np,
                        pr_debug("%s: Error reading panel roi alignment values",
                                        __func__);
                else {
-                       pinfo->xstart_pix_align = value[0];
-                       pinfo->ystart_pix_align = value[1];
-                       pinfo->width_pix_align = value[2];
-                       pinfo->height_pix_align = value[3];
-                       pinfo->min_width = value[4];
-                       pinfo->min_height = value[5];
+                       timing->roi_alignment.xstart_pix_align = value[0];
+                       timing->roi_alignment.ystart_pix_align = value[1];
+                       timing->roi_alignment.width_pix_align = value[2];
+                       timing->roi_alignment.height_pix_align = value[3];
+                       timing->roi_alignment.min_width = value[4];
+                       timing->roi_alignment.min_height = value[5];
                }
 
                pr_debug("%s: ROI alignment: [%d, %d, %d, %d, %d, %d]",
-                               __func__, pinfo->xstart_pix_align,
-                               pinfo->width_pix_align, pinfo->ystart_pix_align,
-                               pinfo->height_pix_align, pinfo->min_width,
-                               pinfo->min_height);
+                       __func__, timing->roi_alignment.xstart_pix_align,
+                       timing->roi_alignment.width_pix_align,
+                       timing->roi_alignment.ystart_pix_align,
+                       timing->roi_alignment.height_pix_align,
+                       timing->roi_alignment.min_width,
+                       timing->roi_alignment.min_height);
        }
 }
 
@@ -2201,6 +2205,8 @@ static int  mdss_dsi_panel_config_res_properties(struct device_node *np,
 {
        int rc = 0;
 
+       mdss_dsi_parse_roi_alignment(np, pt);
+
        mdss_dsi_parse_dcs_cmds(np, &pt->on_cmds,
                "qcom,mdss-dsi-on-command",
                "qcom,mdss-dsi-on-command-state");
@@ -2491,8 +2497,6 @@ static int mdss_panel_parse_dt(struct device_node *np,
        rc = of_property_read_u32(np, "qcom,mdss-dsi-post-init-delay", &tmp);
        pinfo->mipi.post_init_delay = (!rc ? tmp : 0);
 
-       mdss_dsi_parse_roi_alignment(np, pinfo);
-
        mdss_dsi_parse_trigger(np, &(pinfo->mipi.mdp_trigger),
                "qcom,mdss-dsi-mdp-trigger");
 
index 8f2a70d..9af5ee7 100644 (file)
@@ -559,10 +559,14 @@ static ssize_t mdss_fb_get_panel_info(struct device *dev,
                        "min_fps=%d\nmax_fps=%d\npanel_name=%s\n"
                        "primary_panel=%d\nis_pluggable=%d\ndisplay_id=%s\n"
                        "is_cec_supported=%d\nis_pingpong_split=%d\n",
-                       pinfo->partial_update_enabled, pinfo->xstart_pix_align,
-                       pinfo->width_pix_align, pinfo->ystart_pix_align,
-                       pinfo->height_pix_align, pinfo->min_width,
-                       pinfo->min_height, pinfo->partial_update_roi_merge,
+                       pinfo->partial_update_enabled,
+                       pinfo->roi_alignment.xstart_pix_align,
+                       pinfo->roi_alignment.width_pix_align,
+                       pinfo->roi_alignment.ystart_pix_align,
+                       pinfo->roi_alignment.height_pix_align,
+                       pinfo->roi_alignment.min_width,
+                       pinfo->roi_alignment.min_height,
+                       pinfo->partial_update_roi_merge,
                        pinfo->dynamic_fps, pinfo->min_fps, pinfo->max_fps,
                        pinfo->panel_name, pinfo->is_prim_panel,
                        pinfo->is_pluggable, pinfo->display_id,
index aab8c9c..97025b3 100644 (file)
@@ -645,6 +645,7 @@ void mdss_panel_info_from_timing(struct mdss_panel_timing *pt,
        pinfo->fbc = pt->fbc;
        pinfo->compression_mode = pt->compression_mode;
 
+       pinfo->roi_alignment = pt->roi_alignment;
        pinfo->te = pt->te;
 
        /* override te parameters if panel is in sw te mode */
index 8517a60..7a49f37 100644 (file)
@@ -580,6 +580,15 @@ struct mdss_mdp_pp_tear_check {
        u32 refx100;
 };
 
+struct mdss_panel_roi_alignment {
+       u32 xstart_pix_align;
+       u32 width_pix_align;
+       u32 ystart_pix_align;
+       u32 height_pix_align;
+       u32 min_width;
+       u32 min_height;
+};
+
 struct mdss_panel_info {
        u32 xres;
        u32 yres;
@@ -628,15 +637,10 @@ struct mdss_panel_info {
        int panel_max_fps;
        int panel_max_vtotal;
        u32 mode_sel_state;
-       u32 xstart_pix_align;
-       u32 width_pix_align;
-       u32 ystart_pix_align;
-       u32 height_pix_align;
-       u32 min_width;
-       u32 min_height;
        u32 min_fps;
        u32 max_fps;
        u32 prg_fet;
+       struct mdss_panel_roi_alignment roi_alignment;
 
        u32 cont_splash_enabled;
        bool esd_rdy;
@@ -751,6 +755,7 @@ struct mdss_panel_timing {
        u32 compression_mode;
 
        struct mdss_mdp_pp_tear_check te;
+       struct mdss_panel_roi_alignment roi_alignment;
 };
 
 struct mdss_panel_data {