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

Commit e5aaaf87 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

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

parents 21af73b8 dc36ec05
Loading
Loading
Loading
Loading
+26 −27
Original line number Original line Diff line number Diff line
@@ -6009,12 +6009,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,
@@ -6043,11 +6045,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,
@@ -6055,26 +6053,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);