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

Commit 07209e9e authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drm/msm/dp: add mixer count check in dp mode validation"

parents 4d8b9f81 acab3928
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -1949,6 +1949,10 @@ static enum drm_mode_status dp_display_validate_mode(
	struct dp_display_mode dp_mode;
	bool dsc_en;
	u32 pclk_khz;
	struct msm_drm_private *priv;
	struct sde_kms *sde_kms;
	u32 num_lm = 0;
	int rc = 0;

	if (!dp_display || !mode || !panel) {
		pr_err("invalid params\n");
@@ -1997,6 +2001,15 @@ static enum drm_mode_status dp_display_validate_mode(
		goto end;
	}

	priv = dp_display->drm_dev->dev_private;
	sde_kms = to_sde_kms(priv->kms);
	rc = msm_get_mixer_count(dp->priv, mode,
			sde_kms->catalog->max_mixer_width, &num_lm);
	if (rc) {
		DP_MST_DEBUG("error getting mixer count. rc:%d\n", rc);
		goto end;
	}

	if (dp_display->max_hdisplay > 0 && dp_display->max_vdisplay > 0 &&
			((mode->hdisplay > dp_display->max_hdisplay) ||
			(mode->vdisplay > dp_display->max_vdisplay))) {
+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>
 *
@@ -2692,8 +2692,15 @@ static int sde_kms_get_mixer_count(const struct msm_kms *kms,
	mode_clock_hz = drm_fixp_mul(temp, mdp_fudge_factor);

	if (mode_clock_hz > max_mdp_clock_hz ||
			mode->hdisplay > max_mixer_width)
			mode->hdisplay > 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_pclk_hz=%llu, num_lm=%d\n",
			mode->name, mode->htotal, mode->vtotal, mode->vrefresh,