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

Commit 7e86c13d authored by Vara Reddy's avatar Vara Reddy Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/dsi: allocate current mode memory early for DMS



There can be a scenario where dynamic mode set can come
for first commit also, allocate memory for current mode
before checking for DMS.

Change-Id: Ief856a372629112380f199bc336160b3fa278eef
Signed-off-by: default avatarVara Reddy <varar@codeaurora.org>
parent 4fbdc645
Loading
Loading
Loading
Loading
+9 −9
Original line number Original line Diff line number Diff line
@@ -6306,6 +6306,15 @@ int dsi_display_set_mode(struct dsi_display *display,
	timing = adj_mode.timing;
	timing = adj_mode.timing;
	adjust_timing_by_ctrl_count(display, &adj_mode);
	adjust_timing_by_ctrl_count(display, &adj_mode);


	if (!display->panel->cur_mode) {
		display->panel->cur_mode =
			kzalloc(sizeof(struct dsi_display_mode), GFP_KERNEL);
		if (!display->panel->cur_mode) {
			rc = -ENOMEM;
			goto error;
		}
	}

	/*For dynamic DSI setting, use specified clock rate */
	/*For dynamic DSI setting, use specified clock rate */
	if (display->cached_clk_rate > 0)
	if (display->cached_clk_rate > 0)
		adj_mode.priv_info->clk_rate_hz = display->cached_clk_rate;
		adj_mode.priv_info->clk_rate_hz = display->cached_clk_rate;
@@ -6322,15 +6331,6 @@ int dsi_display_set_mode(struct dsi_display *display,
		goto error;
		goto error;
	}
	}


	if (!display->panel->cur_mode) {
		display->panel->cur_mode =
			kzalloc(sizeof(struct dsi_display_mode), GFP_KERNEL);
		if (!display->panel->cur_mode) {
			rc = -ENOMEM;
			goto error;
		}
	}

	DSI_INFO("mdp_transfer_time_us=%d us\n",
	DSI_INFO("mdp_transfer_time_us=%d us\n",
			adj_mode.priv_info->mdp_transfer_time_us);
			adj_mode.priv_info->mdp_transfer_time_us);
	DSI_INFO("hactive= %d,vactive= %d,fps=%d\n",
	DSI_INFO("hactive= %d,vactive= %d,fps=%d\n",