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

Commit 56d98497 authored by Tatenda Chipeperekwa's avatar Tatenda Chipeperekwa
Browse files

disp: msm: dp: add mixer count check in dp mode validation



Add mixer count check in dp mode validation for mdp clock.

Change-Id: I37fe3037d7f7efc7bdc2a7446457af8a8e34684c
Signed-off-by: default avatarXiaowen Wu <wxiaowen@codeaurora.org>
Signed-off-by: default avatarTatenda Chipeperekwa <tatendac@codeaurora.org>
parent 27ec7895
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
/*
 * Copyright (c) 2014-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2014-2020, The Linux Foundation. All rights reserved.
 * Copyright (C) 2013 Red Hat
 * Author: Rob Clark <robdclark@gmail.com>
 *
@@ -2431,8 +2431,15 @@ static int sde_kms_get_mixer_count(const struct msm_kms *kms,
	temp = drm_fixp_mul(temp, vrefresh_fp);
	mode_clock_hz = drm_fixp_mul(temp, mdp_fudge_factor);
	if (mode_clock_hz > max_mdp_clock_hz ||
			mode->hdisplay > res->max_mixer_width)
			mode->hdisplay > res->max_mixer_width) {
		*num_lm = 2;
		if ((mode_clock_hz >> 1) > max_mdp_clock_hz) {
			SDE_DEBUG("[%s] clock %d exceeds max_mdp_clk %d\n",
					mode->name, mode_clock_hz,
					max_mdp_clock_hz);
			return -EINVAL;
		}
	}
	SDE_DEBUG("[%s] h=%d, v=%d, fps=%d, max_mdp_clk_hz=%llu, num_lm=%d\n",
			mode->name, mode->htotal, mode->vtotal, mode->vrefresh,
			sde_kms->perf.max_core_clk_rate, *num_lm);