Browse Source

disp: msm: sde: increase max number of mixers to 4

Increase the maximum number of mixers per crtc to 4 to
support 4LM use case. This change also increases the number
of data path to 4 to support 4LM in continuous splash handoff.

Change-Id: I4655017dcb405fad69513bebb8fd7f848fc5873d
Signed-off-by: Amine Najahi <[email protected]>
Amine Najahi 5 years ago
parent
commit
4fef803aff

+ 8 - 8
msm/sde/sde_crtc.c

@@ -924,7 +924,7 @@ static int _sde_crtc_check_rois_centered_and_symmetric(struct drm_crtc *crtc,
 {
 	struct sde_crtc *sde_crtc;
 	struct sde_crtc_state *crtc_state;
-	const struct sde_rect *roi[CRTC_DUAL_MIXERS];
+	const struct sde_rect *roi[MAX_MIXERS_PER_CRTC];
 
 	if (!crtc || !state)
 		return -EINVAL;
@@ -932,7 +932,7 @@ static int _sde_crtc_check_rois_centered_and_symmetric(struct drm_crtc *crtc,
 	sde_crtc = to_sde_crtc(crtc);
 	crtc_state = to_sde_crtc_state(state);
 
-	if (sde_crtc->num_mixers > CRTC_DUAL_MIXERS) {
+	if (sde_crtc->num_mixers > MAX_MIXERS_PER_CRTC) {
 		SDE_ERROR("%s: unsupported number of mixers: %d\n",
 				sde_crtc->name, sde_crtc->num_mixers);
 		return -EINVAL;
@@ -971,7 +971,7 @@ static int _sde_crtc_check_rois_centered_and_symmetric(struct drm_crtc *crtc,
 	 * On certain HW, if using 2 LM, ROIs must be split evenly between the
 	 * LMs and be of equal width.
 	 */
-	if (sde_crtc->num_mixers < 2)
+	if (sde_crtc->num_mixers < CRTC_DUAL_MIXERS_ONLY)
 		return 0;
 
 	roi[0] = &crtc_state->lm_roi[0];
@@ -1563,7 +1563,7 @@ static void _sde_crtc_swap_mixers_for_right_partial_update(
 	sde_crtc = to_sde_crtc(crtc);
 	cstate = to_sde_crtc_state(crtc->state);
 
-	if (sde_crtc->num_mixers != CRTC_DUAL_MIXERS)
+	if (sde_crtc->num_mixers != CRTC_DUAL_MIXERS_ONLY)
 		return;
 
 	drm_for_each_encoder_mask(drm_enc, crtc->dev,
@@ -1638,7 +1638,7 @@ static void _sde_crtc_blend_setup(struct drm_crtc *crtc,
 
 	SDE_DEBUG("%s\n", sde_crtc->name);
 
-	if (sde_crtc->num_mixers > CRTC_DUAL_MIXERS) {
+	if (sde_crtc->num_mixers > MAX_MIXERS_PER_CRTC) {
 		SDE_ERROR("invalid number mixers: %d\n", sde_crtc->num_mixers);
 		return;
 	}
@@ -2054,7 +2054,7 @@ static int _sde_validate_hw_resources(struct sde_crtc *sde_crtc)
 	}
 
 	if (!sde_crtc->num_mixers ||
-		sde_crtc->num_mixers > CRTC_DUAL_MIXERS) {
+		sde_crtc->num_mixers > MAX_MIXERS_PER_CRTC) {
 		SDE_ERROR("%s: invalid number mixers: %d\n",
 			sde_crtc->name, sde_crtc->num_mixers);
 		SDE_EVT32(DRMID(&sde_crtc->base), sde_crtc->num_mixers,
@@ -2137,7 +2137,7 @@ static void _sde_crtc_dest_scaler_setup(struct drm_crtc *crtc)
 
 			if ((i == count-1) && hw_ds->ops.setup_opmode) {
 				op_mode |= (cstate->num_ds_enabled ==
-					CRTC_DUAL_MIXERS) ?
+					CRTC_DUAL_MIXERS_ONLY) ?
 					SDE_DS_OP_MODE_DUAL : 0;
 				hw_ds->ops.setup_opmode(hw_ds, op_mode);
 				SDE_EVT32_VERBOSE(DRMID(crtc), op_mode);
@@ -2823,7 +2823,7 @@ static int _sde_crtc_check_dest_scaler_validate_ds(struct drm_crtc *crtc,
 			max_in_width = hw_ds->scl->top->maxinputwidth;
 			max_out_width = hw_ds->scl->top->maxoutputwidth;
 
-			if (cstate->num_ds == CRTC_DUAL_MIXERS)
+			if (cstate->num_ds == CRTC_DUAL_MIXERS_ONLY)
 				max_in_width -= SDE_DS_OVERFETCH_SIZE;
 
 			SDE_DEBUG("max DS width [%d,%d] for num_ds = %d\n",

+ 4 - 5
msm/sde/sde_crtc.h

@@ -284,7 +284,7 @@ struct sde_crtc {
 	u32 num_ctls;
 	u32 num_mixers;
 	bool mixers_swapped;
-	struct sde_crtc_mixer mixers[CRTC_DUAL_MIXERS];
+	struct sde_crtc_mixer mixers[MAX_MIXERS_PER_CRTC];
 
 	struct drm_pending_vblank_event *event;
 	u32 vsync_count;
@@ -410,8 +410,8 @@ struct sde_crtc_state {
 
 	bool is_ppsplit;
 	struct sde_rect crtc_roi;
-	struct sde_rect lm_bounds[CRTC_DUAL_MIXERS];
-	struct sde_rect lm_roi[CRTC_DUAL_MIXERS];
+	struct sde_rect lm_bounds[MAX_MIXERS_PER_CRTC];
+	struct sde_rect lm_roi[MAX_MIXERS_PER_CRTC];
 	struct msm_roi_list user_roi_list, cached_user_roi_list;
 
 	struct msm_property_state property_state;
@@ -482,8 +482,7 @@ static inline int sde_crtc_get_mixer_width(struct sde_crtc *sde_crtc,
 	if (cstate->num_ds_enabled)
 		mixer_width = cstate->ds_cfg[0].lm_width;
 	else
-		mixer_width = (sde_crtc->num_mixers == CRTC_DUAL_MIXERS ?
-			mode->hdisplay / CRTC_DUAL_MIXERS : mode->hdisplay);
+		mixer_width = mode->hdisplay / sde_crtc->num_mixers;
 
 	return mixer_width;
 }

+ 3 - 3
msm/sde/sde_encoder_phys_wb.c

@@ -1092,7 +1092,7 @@ static void sde_encoder_phys_wb_irq_ctrl(
 		return;
 
 	pp = phys->hw_pp->idx - PINGPONG_0;
-	if ((pp + CRTC_DUAL_MIXERS) >= PINGPONG_MAX) {
+	if ((pp + CRTC_DUAL_MIXERS_ONLY) >= PINGPONG_MAX) {
 		SDE_ERROR("invalid pingpong index for WB or CWB\n");
 		return;
 	}
@@ -1104,7 +1104,7 @@ static void sde_encoder_phys_wb_irq_ctrl(
 		if (ret)
 			atomic_dec_return(&phys->wbirq_refcount);
 
-		for (index = 0; index < CRTC_DUAL_MIXERS; index++)
+		for (index = 0; index < CRTC_DUAL_MIXERS_ONLY; index++)
 			if (cwb_irq_tbl[index + pp] != SDE_NONE)
 				sde_encoder_helper_register_irq(phys,
 					cwb_irq_tbl[index + pp]);
@@ -1114,7 +1114,7 @@ static void sde_encoder_phys_wb_irq_ctrl(
 		if (ret)
 			atomic_inc_return(&phys->wbirq_refcount);
 
-		for (index = 0; index < CRTC_DUAL_MIXERS; index++)
+		for (index = 0; index < CRTC_DUAL_MIXERS_ONLY; index++)
 			if (cwb_irq_tbl[index + pp] != SDE_NONE)
 				sde_encoder_helper_unregister_irq(phys,
 					cwb_irq_tbl[index + pp]);

+ 2 - 2
msm/sde/sde_hw_ad4.c

@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
  */
 #include <drm/msm_drm_pp.h>
 #include "sde_hw_catalog.h"
@@ -299,7 +299,7 @@ static int ad4_params_check(struct sde_hw_dspp *dspp,
 	}
 
 	if (!cfg->hw_cfg->num_of_mixers ||
-	    cfg->hw_cfg->num_of_mixers > CRTC_DUAL_MIXERS) {
+	    cfg->hw_cfg->num_of_mixers > CRTC_DUAL_MIXERS_ONLY) {
 		DRM_ERROR("invalid mixer cnt %d\n",
 				cfg->hw_cfg->num_of_mixers);
 		return -EINVAL;

+ 1 - 1
msm/sde/sde_hw_catalog.h

@@ -72,7 +72,7 @@
 #define MAX_IMG_WIDTH 0x3fff
 #define MAX_IMG_HEIGHT 0x3fff
 
-#define CRTC_DUAL_MIXERS	2
+#define CRTC_DUAL_MIXERS_ONLY	2
 #define MAX_MIXERS_PER_CRTC	4
 #define MAX_MIXERS_PER_LAYOUT	2
 #define MAX_LAYOUTS_PER_CRTC (MAX_MIXERS_PER_CRTC / MAX_MIXERS_PER_LAYOUT)

+ 1 - 1
msm/sde/sde_hw_mdss.h

@@ -37,7 +37,7 @@
 #endif
 
 #define MAX_DSI_DISPLAYS		2
-#define MAX_DATA_PATH_PER_DSIPLAY	2
+#define MAX_DATA_PATH_PER_DSIPLAY	4
 
 enum sde_format_flags {
 	SDE_FORMAT_FLAG_YUV_BIT,