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

Commit dc36ec05 authored by Ray Zhang's avatar Ray Zhang
Browse files

disp: msm: dsi: fix the DMS mode flag setting



DFPS validation doesn't update DSI_MODE_FLAG_DMS when there is
only refresh rate change but not resolution change. This is not
expected. DMS should be able to support this use case if DFPS
is not enabled.

Change-Id: I738bce68b1dc098338281ac95156a483769608c4
Signed-off-by: default avatarRay Zhang <rayz@codeaurora.org>
parent 9bca2675
Loading
Loading
Loading
Loading
+26 −27
Original line number Original line Diff line number Diff line
@@ -6006,12 +6006,14 @@ int dsi_display_find_mode(struct dsi_display *display,
}
}


/**
/**
 * dsi_display_validate_mode_change() - Validate if varaible refresh case.
 * dsi_display_validate_mode_change() - Validate mode change case.
 * @display:     DSI display handle.
 * @display:     DSI display handle.
 * @cur_dsi_mode:   Current DSI mode.
 * @cur_mode:    Current mode.
 * @mode:        Mode value structure to be validated.
 * @adj_mode:    Mode to be set.
 *               MSM_MODE_FLAG_SEAMLESS_VRR flag is set if there
 *               MSM_MODE_FLAG_SEAMLESS_VRR flag is set if there
 *               is change in fps but vactive and hactive are same.
 *               is change in fps but vactive and hactive are same.
 *               DSI_MODE_FLAG_DYN_CLK flag is set if there
 *               is change in clk but vactive and hactive are same.
 * Return: error code.
 * Return: error code.
 */
 */
int dsi_display_validate_mode_change(struct dsi_display *display,
int dsi_display_validate_mode_change(struct dsi_display *display,
@@ -6040,11 +6042,7 @@ int dsi_display_validate_mode_change(struct dsi_display *display,
		if (cur_mode->timing.refresh_rate !=
		if (cur_mode->timing.refresh_rate !=
		    adj_mode->timing.refresh_rate) {
		    adj_mode->timing.refresh_rate) {
			dsi_panel_get_dfps_caps(display->panel, &dfps_caps);
			dsi_panel_get_dfps_caps(display->panel, &dfps_caps);
			if (!dfps_caps.dfps_support) {
			if (dfps_caps.dfps_support) {
				pr_err("invalid mode dfps not supported\n");
				rc = -ENOTSUPP;
				goto error;
			}
				pr_debug("Mode switch is seamless variable refresh\n");
				pr_debug("Mode switch is seamless variable refresh\n");
				adj_mode->dsi_mode_flags |= DSI_MODE_FLAG_VRR;
				adj_mode->dsi_mode_flags |= DSI_MODE_FLAG_VRR;
				SDE_EVT32(cur_mode->timing.refresh_rate,
				SDE_EVT32(cur_mode->timing.refresh_rate,
@@ -6052,26 +6050,27 @@ int dsi_display_validate_mode_change(struct dsi_display *display,
					cur_mode->timing.h_front_porch,
					cur_mode->timing.h_front_porch,
					adj_mode->timing.h_front_porch);
					adj_mode->timing.h_front_porch);
			}
			}
		}


		/* dynamic clk change use case */
		/* dynamic clk change use case */
		if (cur_mode->pixel_clk_khz != adj_mode->pixel_clk_khz) {
		if (cur_mode->pixel_clk_khz != adj_mode->pixel_clk_khz) {
			dyn_clk_caps = &(display->panel->dyn_clk_caps);
			dyn_clk_caps = &(display->panel->dyn_clk_caps);
			if (!dyn_clk_caps->dyn_clk_support) {
			if (dyn_clk_caps->dyn_clk_support) {
				pr_err("dyn clk change not supported\n");
				pr_debug("dynamic clk change detected\n");
				rc = -ENOTSUPP;
				if (adj_mode->dsi_mode_flags
				goto error;
						& DSI_MODE_FLAG_VRR) {
			}
			if (adj_mode->dsi_mode_flags & DSI_MODE_FLAG_VRR) {
					pr_err("dfps and dyn clk not supported in same commit\n");
					pr_err("dfps and dyn clk not supported in same commit\n");
					rc = -ENOTSUPP;
					rc = -ENOTSUPP;
					goto error;
					goto error;
				}
				}
		pr_debug("dynamic clk change detected\n");

		adj_mode->dsi_mode_flags |= DSI_MODE_FLAG_DYN_CLK;
				adj_mode->dsi_mode_flags |=
						DSI_MODE_FLAG_DYN_CLK;
				SDE_EVT32(cur_mode->pixel_clk_khz,
				SDE_EVT32(cur_mode->pixel_clk_khz,
						adj_mode->pixel_clk_khz);
						adj_mode->pixel_clk_khz);
			}
			}
		}
		}
	}


error:
error:
	mutex_unlock(&display->display_lock);
	mutex_unlock(&display->display_lock);