Merge "disp: msm: dsi: fix the DMS mode flag setting"
This commit is contained in:

zatwierdzone przez
Gerrit - the friendly Code Review server

commit
e5aaaf8785
@@ -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.
|
||||
* @cur_dsi_mode: Current DSI mode.
|
||||
* @mode: Mode value structure to be validated.
|
||||
* @cur_mode: Current mode.
|
||||
* @adj_mode: Mode to be set.
|
||||
* MSM_MODE_FLAG_SEAMLESS_VRR flag is set if there
|
||||
* 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.
|
||||
*/
|
||||
int dsi_display_validate_mode_change(struct dsi_display *display,
|
||||
@@ -6038,41 +6040,38 @@ int dsi_display_validate_mode_change(struct dsi_display *display,
|
||||
mutex_lock(&display->display_lock);
|
||||
|
||||
if ((cur_mode->timing.v_active == adj_mode->timing.v_active) &&
|
||||
(cur_mode->timing.h_active == adj_mode->timing.h_active)) {
|
||||
(cur_mode->timing.h_active == adj_mode->timing.h_active)) {
|
||||
/* dfps change use case */
|
||||
if (cur_mode->timing.refresh_rate !=
|
||||
adj_mode->timing.refresh_rate) {
|
||||
dsi_panel_get_dfps_caps(display->panel, &dfps_caps);
|
||||
if (!dfps_caps.dfps_support) {
|
||||
pr_err("invalid mode dfps not supported\n");
|
||||
rc = -ENOTSUPP;
|
||||
goto error;
|
||||
if (dfps_caps.dfps_support) {
|
||||
pr_debug("Mode switch is seamless variable refresh\n");
|
||||
adj_mode->dsi_mode_flags |= DSI_MODE_FLAG_VRR;
|
||||
SDE_EVT32(cur_mode->timing.refresh_rate,
|
||||
adj_mode->timing.refresh_rate,
|
||||
cur_mode->timing.h_front_porch,
|
||||
adj_mode->timing.h_front_porch);
|
||||
}
|
||||
pr_debug("Mode switch is seamless variable refresh\n");
|
||||
adj_mode->dsi_mode_flags |= DSI_MODE_FLAG_VRR;
|
||||
SDE_EVT32(cur_mode->timing.refresh_rate,
|
||||
adj_mode->timing.refresh_rate,
|
||||
cur_mode->timing.h_front_porch,
|
||||
adj_mode->timing.h_front_porch);
|
||||
}
|
||||
|
||||
/* dynamic clk change use case */
|
||||
if (cur_mode->pixel_clk_khz != adj_mode->pixel_clk_khz) {
|
||||
dyn_clk_caps = &(display->panel->dyn_clk_caps);
|
||||
if (!dyn_clk_caps->dyn_clk_support) {
|
||||
pr_err("dyn clk change not supported\n");
|
||||
rc = -ENOTSUPP;
|
||||
goto error;
|
||||
if (dyn_clk_caps->dyn_clk_support) {
|
||||
pr_debug("dynamic clk change detected\n");
|
||||
if (adj_mode->dsi_mode_flags
|
||||
& DSI_MODE_FLAG_VRR) {
|
||||
pr_err("dfps and dyn clk not supported in same commit\n");
|
||||
rc = -ENOTSUPP;
|
||||
goto error;
|
||||
}
|
||||
|
||||
adj_mode->dsi_mode_flags |=
|
||||
DSI_MODE_FLAG_DYN_CLK;
|
||||
SDE_EVT32(cur_mode->pixel_clk_khz,
|
||||
adj_mode->pixel_clk_khz);
|
||||
}
|
||||
if (adj_mode->dsi_mode_flags & DSI_MODE_FLAG_VRR) {
|
||||
pr_err("dfps and dyn clk not supported in same commit\n");
|
||||
rc = -ENOTSUPP;
|
||||
goto error;
|
||||
}
|
||||
pr_debug("dynamic clk change detected\n");
|
||||
adj_mode->dsi_mode_flags |= DSI_MODE_FLAG_DYN_CLK;
|
||||
SDE_EVT32(cur_mode->pixel_clk_khz,
|
||||
adj_mode->pixel_clk_khz);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user