msm: mdss: Share minimum width and height limitations on panel ROI

Add panel ROI limitations on minimum width and height values
to the panel info sys_fs node.

Change-Id: I3297beb20e7f207a296e6cec114daf2305324898
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
diff --git a/Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt b/Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt
index 807bc1f..c4b4707 100644
--- a/Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt
+++ b/Documentation/devicetree/bindings/fb/mdss-dsi-panel.txt
@@ -291,7 +291,8 @@
 					timing of TE simulation with more precision.
 					The default value is 6000 with 60 fps.
 - qcom,panel-roi-alignment:		Specifies the panel ROI alignment restrictions on its
-					left, top, width and height values
+					left, top, width, height alignments and minimum width and
+					height values
 
 Note, if a given optional qcom,* binding is not present, then the driver will configure
 the default values specified.
@@ -397,6 +398,6 @@
 		qcom,mdss-tear-check-start-pos = <1280>;
 		qcom,mdss-tear-check-rd-ptr-trigger-intr = <1281>;
 		qcom,mdss-tear-check-frame-rate = <6000>;
-		qcom,panel-roi-alignment = <4 4 2 2>;
+		qcom,panel-roi-alignment = <4 4 2 2 20 20>;
 	};
 };
diff --git a/drivers/video/msm/mdss/mdss_dsi_panel.c b/drivers/video/msm/mdss/mdss_dsi_panel.c
index 0175150..0e1cd66 100644
--- a/drivers/video/msm/mdss/mdss_dsi_panel.c
+++ b/drivers/video/msm/mdss/mdss_dsi_panel.c
@@ -732,11 +732,11 @@
 		struct mdss_panel_info *pinfo)
 {
 	int len = 0;
-	u32 value[4];
+	u32 value[6];
 	struct property *data;
 	data = of_find_property(np, "qcom,panel-roi-alignment", &len);
 	len /= sizeof(u32);
-	if (!data || (len != 4)) {
+	if (!data || (len != 6)) {
 		pr_debug("%s: Panel roi alignment not found", __func__);
 	} else {
 		int rc = of_property_read_u32_array(np,
@@ -749,11 +749,15 @@
 			pinfo->width_pix_align = value[1];
 			pinfo->ystart_pix_align = value[2];
 			pinfo->height_pix_align = value[3];
+			pinfo->min_width = value[4];
+			pinfo->min_height = value[5];
 		}
 
-		pr_debug("%s: coordinate rules: [%d, %d, %d, %d]", __func__,
-			pinfo->xstart_pix_align, pinfo->width_pix_align,
-			pinfo->ystart_pix_align, pinfo->height_pix_align);
+		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);
 	}
 }
 
diff --git a/drivers/video/msm/mdss/mdss_fb.c b/drivers/video/msm/mdss/mdss_fb.c
index d073d88..a66f4b6 100644
--- a/drivers/video/msm/mdss/mdss_fb.c
+++ b/drivers/video/msm/mdss/mdss_fb.c
@@ -383,10 +383,12 @@
 	int ret;
 
 	ret = scnprintf(buf, PAGE_SIZE,
-			"pu_en=%d\nxstart=%d\nwalign=%d\nystart=%d\nhalign=%d",
+			"pu_en=%d\nxstart=%d\nwalign=%d\nystart=%d\nhalign=%d\n"
+			"min_w=%d\nmin_h=%d",
 			pinfo->partial_update_enabled, pinfo->xstart_pix_align,
 			pinfo->width_pix_align, pinfo->ystart_pix_align,
-			pinfo->height_pix_align);
+			pinfo->height_pix_align, pinfo->min_width,
+			pinfo->min_height);
 
 	return ret;
 }
diff --git a/drivers/video/msm/mdss/mdss_panel.h b/drivers/video/msm/mdss/mdss_panel.h
index 8c98b22..c81b353 100644
--- a/drivers/video/msm/mdss/mdss_panel.h
+++ b/drivers/video/msm/mdss/mdss_panel.h
@@ -327,6 +327,8 @@
 	u32 width_pix_align;
 	u32 ystart_pix_align;
 	u32 height_pix_align;
+	u32 min_width;
+	u32 min_height;
 
 	u32 cont_splash_enabled;
 	u32 partial_update_enabled;