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

Commit 0cf3838a authored by Zhao, Yuan's avatar Zhao, Yuan Committed by Gerrit - the friendly Code Review server
Browse files

disp: msm: dsi: recount drm mode count



Drm driver will remove the same mode that defined
in dsi panel dtsi. But the mode count was not updated,
so when checked drm mode, need to recount the mode.

Change-Id: I51a2c40ceb7d4ee83a15f74d9d724b4fb9c8a618
Signed-off-by: default avatarZhao, Yuan <yzhao@codeaurora.org>
parent 71267af5
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1152,7 +1152,7 @@ void dsi_conn_set_allowed_mode_switch(struct drm_connector *connector,
	struct list_head *mode_list = &connector->modes;
	struct dsi_display *disp = display;
	struct dsi_panel *panel;
	int mode_count, rc = 0;
	int mode_count = 0, rc = 0;
	struct dsi_display_mode_priv_info *dsi_mode_info, *cmp_dsi_mode_info;
	bool allow_switch = false;

@@ -1162,7 +1162,8 @@ void dsi_conn_set_allowed_mode_switch(struct drm_connector *connector,
	}

	panel = disp->panel;
	mode_count = panel->num_display_modes;
	list_for_each_entry(drm_mode, &connector->modes, head)
		mode_count++;

	list_for_each_entry(drm_mode, &connector->modes, head) {

@@ -1180,6 +1181,8 @@ void dsi_conn_set_allowed_mode_switch(struct drm_connector *connector,
		mode_list = mode_list->next;
		cmp_mode_idx = 1;
		list_for_each_entry(cmp_drm_mode, mode_list, head) {
			if (&cmp_drm_mode->head == &connector->modes)
				continue;
			convert_to_dsi_mode(cmp_drm_mode, &dsi_mode);

			rc = dsi_display_find_mode(display, &dsi_mode,