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

Commit 60e1ff5f authored by Dhaval Patel's avatar Dhaval Patel
Browse files

drm/msm/dsi-stagging: add panel jitter parsing



Update dsi panel parsing with panel jitter and
prefill line requirement to set the display rsc
backoff time on command mode panel. It also updates
these information on display info structure.

Change-Id: I930f335ca55082085f719b1ee4a6ecb035811e15
Signed-off-by: default avatarDhaval Patel <pdhaval@codeaurora.org>
parent 4d424605
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -144,6 +144,13 @@ Optional properties:
					0xff = default value.
- qcom,mdss-dsi-border-color:		Defines the border color value if border is present.
					0 = default value.
- qcom,mdss-dsi-panel-jitter:		An integer value defines the panel jitter timing for rsc
					backoff time. The jitter configurition causes the early
					wakeup if panel needs to adjust before vsync.
					Default jitter value is 5%. Max allowed value is 25%.
- qcom,mdss-dsi-panel-prefill-lines:	An integer value defines the panel prefill lines required to
					calculate the backoff time of rsc.
					Default value is 16 lines. Max allowed value is vtotal.
- qcom,mdss-dsi-pan-enable-dynamic-fps:	Boolean used to enable change in frame rate dynamically.
- qcom,mdss-dsi-pan-fps-update:		A string that specifies when to change the frame rate.
					"dfps_suspend_resume_mode"= FPS change request is
@@ -634,6 +641,8 @@ Example:
						<40 120 128>,
						<128 240 64>;
		qcom,mdss-dsi-panel-orientation = "180"
		qcom,mdss-dsi-panel-jitter = <0x8>;
		qcom,mdss-dsi-panel-prefill-lines = <0x10>;
		qcom,mdss-dsi-force-clock-lane-hs;
		qcom,compression-mode = "dsc";
		qcom,adjust-timer-wakeup-ms = <1>;
+11 −0
Original line number Diff line number Diff line
@@ -2660,13 +2660,19 @@ int dsi_display_get_info(struct msm_display_info *info, void *disp)
{
	struct dsi_display *display;
	struct dsi_panel_phy_props phy_props;
	struct dsi_mode_info *timing;
	int i, rc;

	if (!info || !disp) {
		pr_err("invalid params\n");
		return -EINVAL;
	}

	display = disp;
	if (!display->panel) {
		pr_err("invalid display panel\n");
		return -EINVAL;
	}

	mutex_lock(&display->display_lock);
	rc = dsi_panel_get_phy_props(display->panel, &phy_props);
@@ -2677,6 +2683,7 @@ int dsi_display_get_info(struct msm_display_info *info, void *disp)
	}

	info->intf_type = DRM_MODE_CONNECTOR_DSI;
	timing = &display->panel->mode.timing;

	info->num_of_h_tiles = display->ctrl_count;
	for (i = 0; i < info->num_of_h_tiles; i++)
@@ -2684,6 +2691,10 @@ int dsi_display_get_info(struct msm_display_info *info, void *disp)

	info->is_connected = true;
	info->is_primary = true;
	info->frame_rate = timing->refresh_rate;
	info->vtotal = DSI_V_TOTAL(timing);
	info->prefill_lines = display->panel->panel_prefill_lines;
	info->jitter = display->panel->panel_jitter;
	info->width_mm = phy_props.panel_width_mm;
	info->height_mm = phy_props.panel_height_mm;
	info->max_width = 1920;
+39 −0
Original line number Diff line number Diff line
@@ -24,6 +24,10 @@

#define DEFAULT_MDP_TRANSFER_TIME 14000

#define DEFAULT_PANEL_JITTER		5
#define MAX_PANEL_JITTER		25
#define DEFAULT_PANEL_PREFILL_LINES	16

static int dsi_panel_vreg_get(struct dsi_panel *panel)
{
	int rc = 0;
@@ -1361,6 +1365,37 @@ static int dsi_panel_parse_reset_sequence(struct dsi_panel *panel,
	return rc;
}

static int dsi_panel_parse_jitter_config(struct dsi_panel *panel,
				     struct device_node *of_node)
{
	int rc;

	rc = of_property_read_u32(of_node, "qcom,mdss-dsi-panel-jitter",
				  &panel->panel_jitter);
	if (rc) {
		pr_debug("panel jitter is not defined rc=%d\n", rc);
		panel->panel_jitter = DEFAULT_PANEL_JITTER;
	} else if (panel->panel_jitter > MAX_PANEL_JITTER) {
		pr_debug("invalid jitter config=%d setting to:%d\n",
			panel->panel_jitter, DEFAULT_PANEL_JITTER);
		panel->panel_jitter = DEFAULT_PANEL_JITTER;
	}

	rc = of_property_read_u32(of_node, "qcom,mdss-dsi-panel-prefill-lines",
				  &panel->panel_prefill_lines);
	if (rc) {
		pr_debug("panel prefill lines are not defined rc=%d\n", rc);
		panel->panel_prefill_lines = DEFAULT_PANEL_PREFILL_LINES;
	} else if (panel->panel_prefill_lines >=
					DSI_V_TOTAL(&panel->mode.timing))  {
		pr_debug("invalid prefill lines config=%d setting to:%d\n",
		      panel->panel_prefill_lines, DEFAULT_PANEL_PREFILL_LINES);
		panel->panel_prefill_lines = DEFAULT_PANEL_PREFILL_LINES;
	}

	return 0;
}

static int dsi_panel_parse_power_cfg(struct device *parent,
				     struct dsi_panel *panel,
				     struct device_node *of_node)
@@ -1643,6 +1678,10 @@ struct dsi_panel *dsi_panel_get(struct device *parent,
	if (rc)
		pr_err("failed to parse backlight config, rc=%d\n", rc);

	rc = dsi_panel_parse_jitter_config(panel, of_node);
	if (rc)
		pr_err("failed to parse panel jitter config, rc=%d\n", rc);

	panel->panel_of_node = of_node;
	drm_panel_init(&panel->drm_panel);
	mutex_init(&panel->panel_lock);
+2 −0
Original line number Diff line number Diff line
@@ -176,6 +176,8 @@ struct dsi_panel {
	bool ulps_enabled;
	bool allow_phy_power_off;

	u32 panel_jitter;
	u32 panel_prefill_lines;
	bool panel_initialized;
};

+11 −2
Original line number Diff line number Diff line
@@ -199,13 +199,17 @@ enum msm_display_caps {
 * @h_tile_instance:    Controller instance used per tile. Number of elements is
 *                      based on num_of_h_tiles
 * @is_connected:       Set to true if display is connected
 * @is_primary:         Set to true if display is primary display
 * @width_mm:           Physical width
 * @height_mm:          Physical height
 * @max_width:          Max width of display. In case of hot pluggable display
 *                      this is max width supported by controller
 * @max_height:         Max height of display. In case of hot pluggable display
 *                      this is max height supported by controller
 * @is_primary:         Set to true if display is primary display
 * @frame_rate:		Display frame rate
 * @prefill_lines:	prefill lines based on porches.
 * @vtotal:		display vertical total
 * @jitter:		display jitter configuration
 * @compression:        Compression supported by the display
 */
struct msm_display_info {
@@ -216,7 +220,6 @@ struct msm_display_info {
	uint32_t h_tile_instance[MAX_H_TILES_PER_DISPLAY];

	bool is_connected;
	bool is_primary;

	unsigned int width_mm;
	unsigned int height_mm;
@@ -224,6 +227,12 @@ struct msm_display_info {
	uint32_t max_width;
	uint32_t max_height;

	bool is_primary;
	uint32_t frame_rate;
	uint32_t prefill_lines;
	uint32_t vtotal;
	uint32_t jitter;

	enum msm_display_compression compression;
};