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

Commit 450019d3 authored by Rajesh Yadav's avatar Rajesh Yadav
Browse files

msm: mdss: dsi: Add chromaticity values for HDR support



Add WRGB chromaticity values, peak brightness and blackness
level to panel information. This change also adds method to
parse afore mentioned parameters from device tree and exposes
these properties on sysfs node to read.

CRs-Fixed: 1095347
Change-Id: I039732d8c2a5fa98233647928283df8d9d3f3123
Signed-off-by: default avatarRajesh Yadav <ryadav@codeaurora.org>
Signed-off-by: default avatarShashank Babu Chinta Venkata <sbchin@codeaurora.org>
parent b1f7ce7c
Loading
Loading
Loading
Loading
+22 −0
Original line number Original line Diff line number Diff line
@@ -326,6 +326,28 @@ Optional properties:
					2A/2B command.
					2A/2B command.
- qcom,dcs-cmd-by-left:			Boolean to indicate that dcs command are sent
- qcom,dcs-cmd-by-left:			Boolean to indicate that dcs command are sent
					through the left DSI controller only in a dual-dsi configuration
					through the left DSI controller only in a dual-dsi configuration
- qcom,mdss-dsi-panel-hdr-enabled:	Boolean to indicate HDR support in panel.
- qcom,mdss-dsi-panel-hdr-color-primaries:
					Array of 8 unsigned integers denoting chromaticity of panel.These
					values are specified in nits units. The value range is 0 through 50000.
					To obtain real chromacity, these values should be divided by factor of
					50000. The structure of array is defined in below order
						value 1: x value of white chromaticity of display panel
						value 2: y value of white chromaticity of display panel
						value 3: x value of red chromaticity of display panel
						value 4: y value of red chromaticity of display panel
						value 5: x value of green chromaticity of display panel
						value 6: y value of green chromaticity of display panel
						value 7: x value of blue chromaticity of display panel
						value 8: y value of blue chromaticity of display panel
- qcom,mdss-dsi-panel-peak-brightness:	Maximum brightness supported by panel.In absence of maximum value
					typical value becomes peak brightness. Value is specified in nits units.
					To obtail real peak brightness, this value should be divided by factor of
					10000.
- qcom,mdss-dsi-panel-blackness-level:	Blackness level supported by panel. Blackness level is defined as
					ratio of peak brightness to contrast. Value is specified in nits units.
					To obtail real blackness level, this value should be divided by factor of
					10000.
- qcom,mdss-dsi-lp11-init:		Boolean used to enable the DSI clocks and data lanes (low power 11)
- qcom,mdss-dsi-lp11-init:		Boolean used to enable the DSI clocks and data lanes (low power 11)
					before issuing hardware reset line.
					before issuing hardware reset line.
- qcom,mdss-dsi-init-delay-us:		Delay in microseconds(us) before performing any DSI activity in lp11
- qcom,mdss-dsi-init-delay-us:		Delay in microseconds(us) before performing any DSI activity in lp11
+55 −0
Original line number Original line Diff line number Diff line
@@ -1115,6 +1115,58 @@ void mdss_dsi_panel_dsc_pps_send(struct mdss_dsi_ctrl_pdata *ctrl,
	mdss_dsi_panel_cmds_send(ctrl, &pcmds, CMD_REQ_COMMIT);
	mdss_dsi_panel_cmds_send(ctrl, &pcmds, CMD_REQ_COMMIT);
}
}


static int mdss_dsi_parse_hdr_settings(struct device_node *np,
		struct mdss_panel_info *pinfo)
{
	int rc = 0;
	struct mdss_panel_hdr_properties *hdr_prop;

	if (!np) {
		pr_err("%s: device node pointer is NULL\n", __func__);
		return -EINVAL;
	}

	if (!pinfo) {
		pr_err("%s: panel info is NULL\n", __func__);
		return -EINVAL;
	}

	hdr_prop = &pinfo->hdr_properties;
	hdr_prop->hdr_enabled = of_property_read_bool(np,
		"qcom,mdss-dsi-panel-hdr-enabled");

	if (hdr_prop->hdr_enabled) {
		rc = of_property_read_u32_array(np,
				"qcom,mdss-dsi-panel-hdr-color-primaries",
				hdr_prop->display_primaries,
				DISPLAY_PRIMARIES_COUNT);
		if (rc) {
			pr_info("%s:%d, Unable to read color primaries,rc:%u",
					__func__, __LINE__,
					hdr_prop->hdr_enabled = false);
		}

		rc = of_property_read_u32(np,
			"qcom,mdss-dsi-panel-peak-brightness",
			&(hdr_prop->peak_brightness));
		if (rc) {
			pr_info("%s:%d, Unable to read hdr brightness, rc:%u",
				__func__, __LINE__, rc);
			hdr_prop->hdr_enabled = false;
		}

		rc = of_property_read_u32(np,
			"qcom,mdss-dsi-panel-blackness-level",
			&(hdr_prop->blackness_level));
		if (rc) {
			pr_info("%s:%d, Unable to read hdr brightness, rc:%u",
				__func__, __LINE__, rc);
			hdr_prop->hdr_enabled = false;
		}
	}
	return 0;
}

static int mdss_dsi_parse_dsc_version(struct device_node *np,
static int mdss_dsi_parse_dsc_version(struct device_node *np,
		struct mdss_panel_timing *timing)
		struct mdss_panel_timing *timing)
{
{
@@ -2460,6 +2512,9 @@ static int mdss_panel_parse_dt(struct device_node *np,
		"qcom,mdss-dsi-lane-3-state");
		"qcom,mdss-dsi-lane-3-state");


	rc = mdss_panel_parse_display_timings(np, &ctrl_pdata->panel_data);
	rc = mdss_panel_parse_display_timings(np, &ctrl_pdata->panel_data);
	if (rc)
		return rc;
	rc = mdss_dsi_parse_hdr_settings(np, pinfo);
	if (rc)
	if (rc)
		return rc;
		return rc;


+19 −2
Original line number Original line Diff line number Diff line
@@ -572,7 +572,13 @@ static ssize_t mdss_fb_get_panel_info(struct device *dev,
			"min_w=%d\nmin_h=%d\nroi_merge=%d\ndyn_fps_en=%d\n"
			"min_w=%d\nmin_h=%d\nroi_merge=%d\ndyn_fps_en=%d\n"
			"min_fps=%d\nmax_fps=%d\npanel_name=%s\n"
			"min_fps=%d\nmax_fps=%d\npanel_name=%s\n"
			"primary_panel=%d\nis_pluggable=%d\ndisplay_id=%s\n"
			"primary_panel=%d\nis_pluggable=%d\ndisplay_id=%s\n"
			"is_cec_supported=%d\nis_pingpong_split=%d\n",
			"is_cec_supported=%d\nis_pingpong_split=%d\n"
			"is_hdr_enabled=%d\n"
			"peak_brightness=%d\nblackness_level=%d\n"
			"white_chromaticity_x=%d\nwhite_chromaticity_y=%d\n"
			"red_chromaticity_x=%d\nred_chromaticity_y=%d\n"
			"green_chromaticity_x=%d\ngreen_chromaticity_y=%d\n"
			"blue_chromaticity_x=%d\nblue_chromaticity_y=%d\n",
			pinfo->partial_update_enabled,
			pinfo->partial_update_enabled,
			pinfo->roi_alignment.xstart_pix_align,
			pinfo->roi_alignment.xstart_pix_align,
			pinfo->roi_alignment.width_pix_align,
			pinfo->roi_alignment.width_pix_align,
@@ -584,7 +590,18 @@ static ssize_t mdss_fb_get_panel_info(struct device *dev,
			pinfo->dynamic_fps, pinfo->min_fps, pinfo->max_fps,
			pinfo->dynamic_fps, pinfo->min_fps, pinfo->max_fps,
			pinfo->panel_name, pinfo->is_prim_panel,
			pinfo->panel_name, pinfo->is_prim_panel,
			pinfo->is_pluggable, pinfo->display_id,
			pinfo->is_pluggable, pinfo->display_id,
			pinfo->is_cec_supported, is_pingpong_split(mfd));
			pinfo->is_cec_supported, is_pingpong_split(mfd),
			pinfo->hdr_properties.hdr_enabled,
			pinfo->hdr_properties.peak_brightness,
			pinfo->hdr_properties.blackness_level,
			pinfo->hdr_properties.display_primaries[0],
			pinfo->hdr_properties.display_primaries[1],
			pinfo->hdr_properties.display_primaries[2],
			pinfo->hdr_properties.display_primaries[3],
			pinfo->hdr_properties.display_primaries[4],
			pinfo->hdr_properties.display_primaries[5],
			pinfo->hdr_properties.display_primaries[6],
			pinfo->hdr_properties.display_primaries[7]);


	return ret;
	return ret;
}
}
+19 −0
Original line number Original line Diff line number Diff line
@@ -63,6 +63,9 @@ enum fps_resolution {


#define DSC_PPS_LEN		128
#define DSC_PPS_LEN		128


/* HDR propeties count */
#define DISPLAY_PRIMARIES_COUNT	8	/* WRGB x and y values*/

static inline const char *mdss_panel2str(u32 panel)
static inline const char *mdss_panel2str(u32 panel)
{
{
	static const char const *names[] = {
	static const char const *names[] = {
@@ -590,6 +593,19 @@ struct mdss_panel_roi_alignment {
	u32 min_height;
	u32 min_height;
};
};


struct mdss_panel_hdr_properties {
	bool hdr_enabled;

	/* WRGB X and y values arrayed in format */
	/* [WX, WY, RX, RY, GX, GY, BX, BY] */
	u32 display_primaries[DISPLAY_PRIMARIES_COUNT];

	/* peak brightness supported by panel */
	u32 peak_brightness;
	/* Blackness level supported by panel */
	u32 blackness_level;
};

struct mdss_panel_info {
struct mdss_panel_info {
	u32 xres;
	u32 xres;
	u32 yres;
	u32 yres;
@@ -723,6 +739,9 @@ struct mdss_panel_info {


	/* debugfs structure for the panel */
	/* debugfs structure for the panel */
	struct mdss_panel_debugfs_info *debugfs_info;
	struct mdss_panel_debugfs_info *debugfs_info;

	/* HDR properties of display panel*/
	struct mdss_panel_hdr_properties hdr_properties;
};
};


struct mdss_panel_timing {
struct mdss_panel_timing {