Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b3f4432b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: mdss: enable different panel configuration modes"

parents 3aa623e8 42800ad2
Loading
Loading
Loading
Loading
+68 −23
Original line number Diff line number Diff line
@@ -400,11 +400,47 @@ Optional properties:
- qcom,panel-ack-disabled: A boolean property to indicate, whether we need to wait for any ACK from the panel
			   for any commands that we send.
- qcom,mdss-dsi-force-clock-lane-hs:	Boolean to force dsi clock lanes to HS mode always.
- qcom,mdss-dsi-compression:		Select compression mode for panel.

- qcom,compression-mode:		Select compression mode for panel.
					"fbc" - frame buffer compression
					"dsc" - display stream compression.
					If "dsc" compression is used then config subnodes needs to be defined.
- qcom,panel-supply-entries:		A node that lists the elements of the supply used to
					power the DSI panel. There can be more than one instance
					of this binding, in which case the entry would be appended
					with the supply entry index. For a detailed description of
					fields in the supply entry, refer to the qcom,ctrl-supply-entries
					binding above.
- qcom,config-select:			Optional property to select default configuration.

[[Optional config sub-nodes]]		These subnodes provide different configurations for a given same panel.
					Default configuration can be chosen by specifying phandle of the
					selected subnode in the qcom,config-select.
Required properties for sub-nodes:	None
Optional properites:
- qcom,lm-split:			An array of two values indicating MDP should use two layer
					mixers to reduce power.
					Ex: Normally 1080x1920 display uses single DSI and thus one layer
					    mixer. But if we use two layer mixers then mux the output of
					    those mixers two into single stream and route it to single DSI
					    then we can lower the clock requirements of MDP. To use this
					    configuration we need two fill this array with <540 540>.
					This property should not be used if underlying display is using
					two DSI panels such a way that each carrying half the display.
					Both values doesn't have to be same, but recommended, however sum of
					both values has to be equal to the panel-width.
					By default two mixer streams are merged using 2D mux, however if
					2 DSC encoders are used then merge is performed within compression
					engine.
- qcom,mdss-dsc-encoders:		An integer value indicating how many DSC encoders should be used
					to drive data stream to DSI.
					Default value is 1 and max value is 2.
					2 encoder should be used only if qcom,mdss-lm-split is used.
- qcom,mdss-dsc-slice-height:		An integer value indicates the dsc slice height.
- qcom,mdss-dsc-slice-width:		An integer value indicates the dsc slice width.
					Multiple of slice width should be equal to panel-width.
					Maximum 2 slices per DSC encoder can be used so if 2 DSC encoders
					are used then minimum slice width is equal to panel-width/4.
- qcom,mdss-dsc-slice-per-pkt:		An integer value indicates the slice per dsi packet.
- qcom,mdss-dsc-bit-per-component: 	An integer value indicates the bits per component before compression.
- qcom,mdss-dsc-bit-per-pixel:		An integer value indicates the bits per pixel after compression.
@@ -412,19 +448,8 @@ Optional properties:
- qcom,mdss-dsc-ich-reset-value: 	An integer value defines the Indexed Color History reset value.
- qcom,mdss-dsc-ich-reset-override:	An integer value defines the Indexed Color History for each line in
					slice.
- qcom,mdss-dsc-data-path-mode:		Select the dsc data path mode.
					"1p1d" - Single panel and single DSI
					"merge-1p2d" - Merge two DSI output to single panel
					"split-1p2d" - This is fb split mode which have two encoder work
					in tandem to compress large image.
- qcom,mdss-dsc-config-by-manufacture-cmd: A boolean to indicates panel use manufacture command to setup pps
					instead of standard dcs type 0x0A.
- qcom,panel-supply-entries:		A node that lists the elements of the supply used to
					power the DSI panel. There can be more than one instance
					of this binding, in which case the entry would be appended
					with the supply entry index. For a detailed description of
					fields in the supply entry, refer to the qcom,ctrl-supply-entries
					binding above.

Note, if a given optional qcom,* binding is not present, then the driver will configure
the default values specified.
@@ -565,17 +590,7 @@ Example:
						<128 240 64>;
		qcom,mdss-dsi-panel-orientation = "180"
		qcom,mdss-dsi-force-clock-lane-hs;
		qcom,mdss-dsi-compression = "dsc";
		qcom,mdss-dsc-slice-height = <16>;
		qcom,mdss-dsc-slice-width = <720>;
		qcom,mdss-dsc-slice-per-pkt = <2>;
		qcom,mdss-dsc-bit-per-component = <8>;
		qcom,mdss-dsc-bit-per-pixel = <8>;
		qcom,mdss-dsc-block-prediction-enable;
		qcom,mdss-dsc-ich-reset-value = <0>;
		qcom,mdss-dsc-ich-reset-override = <0>;
		qcom,mdss-dsc-data-path-mode = "1p1d";
		qcom,mdss-dsc-config-by-manufacture-cmd;
		qcom,compression-mode = "dsc";
		qcom,panel-supply-entries {
			#address-cells = <1>;
			#size-cells = <0>;
@@ -606,5 +621,35 @@ Example:
				qcom,supply-post-off-sleep = <0>;
			};
		};

		qcom,config-select = <&dsi_sim_vid_config0>;

		dsi_sim_vid_config0: config0 {
			qcom,lm-split = <360 360>;
			qcom,mdss-dsc-encoders = <2>;
			qcom,mdss-dsc-slice-height = <16>;
			qcom,mdss-dsc-slice-width = <360>;
			qcom,mdss-dsc-slice-per-pkt = <2>;
			qcom,mdss-dsc-bit-per-component = <8>;
			qcom,mdss-dsc-bit-per-pixel = <8>;
			qcom,mdss-dsc-block-prediction-enable;
			qcom,mdss-dsc-ich-reset-value = <0>;
			qcom,mdss-dsc-ich-reset-override = <0>;
			qcom,mdss-dsc-config-by-manufacture-cmd;
		};

		dsi_sim_vid_config1: config1 {
			qcom,mdss-dsc-encoders = <1>;
			qcom,mdss-dsc-slice-height = <16>;
			qcom,mdss-dsc-slice-width = <360>;
			qcom,mdss-dsc-slice-per-pkt = <2>;
			qcom,mdss-dsc-bit-per-component = <8>;
			qcom,mdss-dsc-bit-per-pixel = <8>;
			qcom,mdss-dsc-block-prediction-enable;
			qcom,mdss-dsc-ich-reset-value = <0>;
			qcom,mdss-dsc-ich-reset-override = <0>;
			qcom,mdss-dsc-config-by-manufacture-cmd;
		};

	};
};
+0 −15
Original line number Diff line number Diff line
@@ -503,20 +503,6 @@ Subnode properties:
- qcom,mdss-mixer-swap: A boolean property that indicates if the mixer muxes
			 need to be swapped based on the target panel.
			 By default the property is not defined.
- qcom,mdss-fb-split:	 Array of splitted framebuffer size. There should
			 be only two values in this property. The values
			 correspond to the left and right size respectively.
			 MDP muxes two mixer output together before sending to
			 the panel interface and these values are used to set
			 each mixer width, so the sum of these two values
			 should be equal to the panel x-resolution.

			 Note that if the sum of two values is not equal to
			 x-resolution or this subnode itself is not defined
			 in device tree there are two cases: 1)split is not
			 enabled if framebuffer size is less than max mixer
			 width; 2) the defaut even split is enabled if frambuffer
			 size is greater than max mixer width.
- qcom,memblock-reserve: Specifies the memory location and the size reserved
			 for the framebuffer used to display the splash screen.
			 This property is required whenever the continuous splash
@@ -732,7 +718,6 @@ Example:
			cell-index = <0>;
			compatible = "qcom,mdss-fb";
			qcom,mdss-mixer-swap;
			qcom,mdss-fb-split = <480 240>
			linux,contiguous-region = <&fb_mem>;
			qcom,mdss-fb-splash-logo-enabled:
			qcom,cont-splash-memory {
+47 −12
Original line number Diff line number Diff line
@@ -53,18 +53,6 @@
		qcom,mdss-dsi-te-using-te-pin;
		qcom,ulps-enabled;

		qcom,mdss-dsi-compression = "dsc";
		qcom,mdss-dsc-slice-height = <16>;
		qcom,mdss-dsc-slice-width = <720>;
		qcom,mdss-dsc-slice-per-pkt = <2>;
		qcom,mdss-dsc-bit-per-component = <8>;
		qcom,mdss-dsc-bit-per-pixel = <8>;
		qcom,mdss-dsc-block-prediction-enable;
		qcom,mdss-dsc-ich-reset-value = <0>;
		qcom,mdss-dsc-ich-reset-override = <0>;
		qcom,mdss-dsc-data-path-mode = "1p1d";
		qcom,mdss-dsc-config-by-manufacture-cmd;

		qcom,mdss-dsi-on-command = [15 01 00 00 0a 00 02 ff 10
			15 01 00 00 0a 00 02 fb 01
			15 01 00 00 0a 00 02 ba 03
@@ -100,5 +88,52 @@

		qcom,mdss-dsi-off-command = [05 01 00 00 78 00 02 28 00
				 05 01 00 00 78 00 02 10 00];

		qcom,compression-mode = "dsc";
		qcom,config-select = <&dsi_nt35597_dsc_cmd_config2>;

		dsi_nt35597_dsc_cmd_config0: config0 {
			qcom,mdss-dsc-encoders = <1>;
			qcom,mdss-dsc-slice-height = <16>;
			qcom,mdss-dsc-slice-width = <720>;
			qcom,mdss-dsc-slice-per-pkt = <2>;

			qcom,mdss-dsc-bit-per-component = <8>;
			qcom,mdss-dsc-bit-per-pixel = <8>;
			qcom,mdss-dsc-block-prediction-enable;
			qcom,mdss-dsc-ich-reset-value = <0>;
			qcom,mdss-dsc-ich-reset-override = <0>;
			qcom,mdss-dsc-config-by-manufacture-cmd;
		};

		dsi_nt35597_dsc_cmd_config1: config1 {
			qcom,lm-split = <720 720>;
			qcom,mdss-dsc-encoders = <1>; /* 3D Mux */
			qcom,mdss-dsc-slice-height = <16>;
			qcom,mdss-dsc-slice-width = <720>;
			qcom,mdss-dsc-slice-per-pkt = <2>;

			qcom,mdss-dsc-bit-per-component = <8>;
			qcom,mdss-dsc-bit-per-pixel = <8>;
			qcom,mdss-dsc-block-prediction-enable;
			qcom,mdss-dsc-ich-reset-value = <0>;
			qcom,mdss-dsc-ich-reset-override = <0>;
			qcom,mdss-dsc-config-by-manufacture-cmd;
		};

		dsi_nt35597_dsc_cmd_config2: config2 {
			qcom,lm-split = <720 720>;
			qcom,mdss-dsc-encoders = <2>; /* DSC Merge */
			qcom,mdss-dsc-slice-height = <16>;
			qcom,mdss-dsc-slice-width = <720>;
			qcom,mdss-dsc-slice-per-pkt = <2>;

			qcom,mdss-dsc-bit-per-component = <8>;
			qcom,mdss-dsc-bit-per-pixel = <8>;
			qcom,mdss-dsc-block-prediction-enable;
			qcom,mdss-dsc-ich-reset-value = <0>;
			qcom,mdss-dsc-ich-reset-override = <0>;
			qcom,mdss-dsc-config-by-manufacture-cmd;
		};
	};
};
+47 −12
Original line number Diff line number Diff line
@@ -30,18 +30,6 @@
		qcom,mdss-dsi-underflow-color = <0xff>;
		qcom,mdss-dsi-border-color = <0>;

		qcom,mdss-dsi-compression = "dsc";
		qcom,mdss-dsc-slice-height = <16>;
		qcom,mdss-dsc-slice-width = <720>;
		qcom,mdss-dsc-slice-per-pkt = <2>;
		qcom,mdss-dsc-bit-per-component = <8>;
		qcom,mdss-dsc-bit-per-pixel = <8>;
		qcom,mdss-dsc-block-prediction-enable;
		qcom,mdss-dsc-ich-reset-value = <0>;
		qcom,mdss-dsc-ich-reset-override = <0>;
		qcom,mdss-dsc-data-path-mode = "1p1d";
		qcom,mdss-dsc-config-by-manufacture-cmd;

		qcom,mdss-dsi-on-command = [15 01 00 00 0a 00 02 ff 10
			15 01 00 00 0a 00 02 fb 01
			15 01 00 00 0a 00 02 ba 03
@@ -90,5 +78,52 @@
		qcom,mdss-dsi-dma-trigger = "trigger_sw";
		qcom,mdss-dsi-mdp-trigger = "none";
		qcom,mdss-dsi-reset-sequence = <1 20>, <0 20>, <1 50>;

		qcom,compression-mode = "dsc";
		qcom,config-select = <&dsi_nt35597_dsc_video_config0>;

		dsi_nt35597_dsc_video_config0: config0 {
			qcom,mdss-dsc-encoders = <1>;
			qcom,mdss-dsc-slice-height = <16>;
			qcom,mdss-dsc-slice-width = <720>;
			qcom,mdss-dsc-slice-per-pkt = <2>;

			qcom,mdss-dsc-bit-per-component = <8>;
			qcom,mdss-dsc-bit-per-pixel = <8>;
			qcom,mdss-dsc-block-prediction-enable;
			qcom,mdss-dsc-ich-reset-value = <0>;
			qcom,mdss-dsc-ich-reset-override = <0>;
			qcom,mdss-dsc-config-by-manufacture-cmd;
		};

		dsi_nt35597_dsc_video_config1: config1 {
			qcom,lm-split = <720 720>;
			qcom,mdss-dsc-encoders = <1>; /* 3D Mux */
			qcom,mdss-dsc-slice-height = <16>;
			qcom,mdss-dsc-slice-width = <720>;
			qcom,mdss-dsc-slice-per-pkt = <2>;

			qcom,mdss-dsc-bit-per-component = <8>;
			qcom,mdss-dsc-bit-per-pixel = <8>;
			qcom,mdss-dsc-block-prediction-enable;
			qcom,mdss-dsc-ich-reset-value = <0>;
			qcom,mdss-dsc-ich-reset-override = <0>;
			qcom,mdss-dsc-config-by-manufacture-cmd;
		};

		dsi_nt35597_dsc_video_config2: config2 {
			qcom,lm-split = <720 720>;
			qcom,mdss-dsc-encoders = <2>; /* DSC Merge */
			qcom,mdss-dsc-slice-height = <16>;
			qcom,mdss-dsc-slice-width = <720>;
			qcom,mdss-dsc-slice-per-pkt = <2>;

			qcom,mdss-dsc-bit-per-component = <8>;
			qcom,mdss-dsc-bit-per-pixel = <8>;
			qcom,mdss-dsc-block-prediction-enable;
			qcom,mdss-dsc-ich-reset-value = <0>;
			qcom,mdss-dsc-ich-reset-override = <0>;
			qcom,mdss-dsc-config-by-manufacture-cmd;
		};
	};
};
+82 −17
Original line number Diff line number Diff line
@@ -1254,7 +1254,7 @@ void mdss_dsc_parameters_calc(struct mdss_panel_info *pinfo)

	dsc->bytes_per_pkt = bytes_in_slice * dsc->slice_per_pkt;

	dsc->det_thresh_flatness = 7 + (bpc - 8);
	dsc->det_thresh_flatness = 7 + 2*(bpc - 8);

	dsc->initial_xmit_delay = dsc->rc_model_size / (2 * bpp);

@@ -1347,10 +1347,30 @@ static int mdss_dsi_parse_dsc_params(struct device_node *np,
{
	struct dsc_desc *dsc;
	u32 data;
	const char *cp;
	int rc = 0;

	dsc = &pinfo->dsc;

	rc = of_property_read_u32(np, "qcom,mdss-dsc-encoders", &data);
	if (rc) {
		if (!of_find_property(np, "qcom,mdss-dsc-encoders", NULL)) {
			/* property is not defined, default to 1 */
			data = 1;
		} else {
			pr_err("%s: Error parsing qcom,mdss-dsc-encoders\n",
				__func__);
			goto end;
		}
	}

	pinfo->dsc_enc_total = data;

	if (pinfo->is_split_display && (pinfo->dsc_enc_total > 1)) {
		pr_err("%s: Error: for split displays, more than 1 dsc encoder per panel is not allowed.\n",
			__func__);
		goto end;
	}

	rc = of_property_read_u32(np, "qcom,mdss-dsc-slice-height", &data);
	if (rc)
		goto end;
@@ -1361,13 +1381,29 @@ static int mdss_dsi_parse_dsc_params(struct device_node *np,
		goto end;
	dsc->slice_width = data;

	if (pinfo->xres % dsc->slice_width) {
		pr_err("%s: Error: multiple of slice-width:%d should match panel-width:%d\n",
			__func__, dsc->slice_width, pinfo->xres);
		goto end;
	}

	data = pinfo->xres / dsc->slice_width;
	if (((pinfo->dsc_enc_total > 1) && ((data != 2) && (data != 4))) ||
	    ((pinfo->dsc_enc_total == 1) && (data > 2))) {
		pr_err("%s: Error: max 2 slice per encoder. slice-width:%d should match panel-width:%d dsc_enc_total:%d\n",
			__func__, dsc->slice_width,
			pinfo->xres, pinfo->dsc_enc_total);
		goto end;
	}

	rc = of_property_read_u32(np, "qcom,mdss-dsc-slice-per-pkt", &data);
	if (rc)
		goto end;
	dsc->slice_per_pkt = data;

	pr_debug("%s: slice h=%d w=%d s_pkt=%d\n", __func__,
		dsc->slice_height, dsc->slice_width, dsc->slice_per_pkt);
	pr_debug("%s: num_enc:%d :slice h=%d w=%d s_pkt=%d\n", __func__,
		pinfo->dsc_enc_total, dsc->slice_height,
		dsc->slice_width, dsc->slice_per_pkt);

	rc = of_property_read_u32(np, "qcom,mdss-dsc-bit-per-component", &data);
	if (rc)
@@ -1393,13 +1429,6 @@ static int mdss_dsi_parse_dsc_params(struct device_node *np,
		goto end;
	dsc->ich_reset_override = data;

	dsc->data_path_model = DSC_PATH_1P1D;	/* default */
	cp = of_get_property(np, "qcom,mdss-dsc-data-path-mode", NULL);
	if (cp && !strcmp(cp, "merge_1p1d"))
		dsc->data_path_model = DSC_PATH_MERGE_1P1D;
	else if (cp && !strcmp(cp, "split_1p2d"))
		dsc->data_path_model = DSC_PATH_SPLIT_1P2D;

	dsc->block_pred_enable = of_property_read_bool(np,
			"qcom,mdss-dsc-block-prediction-enable");

@@ -1419,22 +1448,23 @@ end:
}

static int mdss_dsi_parse_compression_params(struct device_node *np,
				struct mdss_panel_info *pinfo)
	struct device_node *cfg_np, struct mdss_panel_info *pinfo)
{
	int rc = 0;
	const char *data;

	pinfo->fbc.enabled = 0;
	pinfo->fbc.target_bpp = pinfo->bpp;

	data = of_get_property(np, "qcom,mdss-dsi-compression", NULL);
	data = of_get_property(np, "qcom,compression-mode", NULL);
	if (data) {
		if (!strcmp(data, "dsc"))
			mdss_dsi_parse_dsc_params(np, pinfo);
			rc = mdss_dsi_parse_dsc_params(cfg_np, pinfo);
		else if (!strcmp(data, "fbc"))
			mdss_dsi_parse_fbc_params(np, pinfo);
			rc = mdss_dsi_parse_fbc_params(np, pinfo);
	}

	return 0;
	return rc;
}

static void mdss_panel_parse_te_params(struct device_node *np,
@@ -1985,6 +2015,31 @@ static int mdss_panel_parse_dt(struct device_node *np,
	int rc, i, len;
	const char *data;
	struct mdss_panel_info *pinfo = &(ctrl_pdata->panel_data.panel_info);
	struct device_node *cfg_np = NULL;

	if (mdss_dsi_is_hw_config_split(ctrl_pdata->shared_data))
		pinfo->is_split_display = true;

	if (of_find_property(np, "qcom,config-select", NULL)) {
		cfg_np = of_parse_phandle(np, "qcom,config-select", 0);
		if (!cfg_np) {
			pr_err("%s: error parsing qcom,config-select\n",
				__func__);
		} else {
			if (!of_property_read_u32_array(cfg_np, "qcom,lm-split",
			    pinfo->lm_widths, 2)) {
				if (pinfo->is_split_display &&
				    (pinfo->lm_widths[1] != 0)) {
					pr_err("%s: lm-split not allowed with split display\n",
						__func__);
					return -EINVAL;
				}
			}
		}
	} else {
		pr_debug("%s: qcom,config-select is not present\n", __func__);
	}


	rc = of_property_read_u32(np, "qcom,mdss-dsi-panel-width", &tmp);
	if (rc) {
@@ -1994,6 +2049,9 @@ static int mdss_panel_parse_dt(struct device_node *np,
	}
	pinfo->xres = (!rc ? tmp : 640);

	if ((pinfo->lm_widths[0] == 0) && (pinfo->lm_widths[1] == 0))
		pinfo->lm_widths[0] = pinfo->xres;

	rc = of_property_read_u32(np, "qcom,mdss-dsi-panel-height", &tmp);
	if (rc) {
		pr_err("%s:%d, panel height not specified\n",
@@ -2232,7 +2290,12 @@ static int mdss_panel_parse_dt(struct device_node *np,
	mdss_dsi_parse_trigger(np, &(pinfo->mipi.dma_trigger),
		"qcom,mdss-dsi-dma-trigger");

	mdss_dsi_parse_compression_params(np, pinfo);
	rc = mdss_dsi_parse_compression_params(np, cfg_np, pinfo);
	if (rc) {
		pr_err("%s: parsing compression params failed. rc:%d\n",
			__func__, rc);
		goto error;
	}

	mdss_panel_parse_te_params(np, pinfo);

@@ -2261,9 +2324,11 @@ static int mdss_panel_parse_dt(struct device_node *np,

	mdss_dsi_parse_dfps_config(np, ctrl_pdata);

	of_node_put(cfg_np);
	return 0;

error:
	of_node_put(cfg_np);
	return -EINVAL;
}

Loading