浏览代码

disp: msm: dsi: fix mode count for POMS enabled video mode panel

In legacy POMS feature, there were separate timing nodes for
video and command mode. So, while calculating the total number
of modes, 1 extra mode is added for command mode if POMS feature
is enabled in video mode panel.

But as per the new design, this is clubbed into one timing node.
So, there is no separate mode for command mode. This change removes
the check to add 1 extra mode count otherwise it leads to null
pointer dereference while getting lm for this extra mode. Also
avoid overriding mode capability when POMS is enabled.

Change-Id: I73f3b89b22f566e40c88178f2af392214b1ada8d
Signed-off-by: Anand Tarakh <[email protected]>
Anand Tarakh 1 年之前
父节点
当前提交
78cde5eaf5
共有 2 个文件被更改,包括 5 次插入10 次删除
  1. 4 1
      msm/dsi/dsi_display.c
  2. 1 9
      msm/dsi/dsi_panel.c

+ 4 - 1
msm/dsi/dsi_display.c

@@ -7286,7 +7286,10 @@ int dsi_display_get_modes_helper(struct dsi_display *display,
 
 			dsi_display_get_dfps_timing(display, sub_mode,
 					curr_refresh_rate);
-			sub_mode->panel_mode_caps = DSI_OP_VIDEO_MODE;
+
+			/* Avoid override for first sub mode in POMS enabled video mode usecase */
+			if ((i != start) && support_cmd_mode && support_video_mode)
+				sub_mode->panel_mode_caps = DSI_OP_VIDEO_MODE;
 		}
 		end = array_idx;
 

+ 1 - 9
msm/dsi/dsi_panel.c

@@ -4009,17 +4009,9 @@ int dsi_panel_get_mode_count(struct dsi_panel *panel)
 	num_dfps_rates = !panel->dfps_caps.dfps_support ? 1 :
 					panel->dfps_caps.dfps_list_len;
 
-	/*
-	 * Inflate num_of_modes by fps in dfps.
-	 * Single command mode for video mode panels supporting
-	 * panel operating mode switch.
-	 */
+	/* Inflate num_of_modes by fps in dfps. */
 	num_video_modes = num_video_modes * num_dfps_rates;
 
-	if ((panel->panel_mode == DSI_OP_VIDEO_MODE) &&
-			(panel->panel_mode_switch_enabled))
-		num_cmd_modes  = 1;
-
 	panel->num_display_modes = num_video_modes + num_cmd_modes;
 
 error: