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

Commit c0d4857a authored by Rajkumar Subbiah's avatar Rajkumar Subbiah
Browse files

disp: msm: sde: adjust intf timing for widebus



From Lahaina onwards, widebus is enabled for compressed DSI stream.
This change adjusts interface timing parameters to account for widebus.

Change-Id: Ie6b739ed2cdb515064e3a94404b3e0fe07755d7e
Signed-off-by: default avatarRajkumar Subbiah <rsubbia@codeaurora.org>
parent 50e358b5
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -2635,7 +2635,6 @@ static void sde_encoder_virt_enable(struct drm_encoder *drm_enc)

		phys->comp_type = comp_info->comp_type;
		phys->comp_ratio = comp_info->comp_ratio;
		phys->wide_bus_en = sde_enc->mode_info.wide_bus_en;
		phys->frame_trigger_mode = sde_enc->frame_trigger_mode;
		phys->poms_align_vsync = disp_info->poms_align_vsync;
		if (phys->comp_type == MSM_DISPLAY_COMPRESSION_DSC) {
@@ -2643,7 +2642,15 @@ static void sde_encoder_virt_enable(struct drm_encoder *drm_enc)
				comp_info->dsc_info.pclk_per_line;
			phys->dsc_extra_disp_width =
				comp_info->dsc_info.extra_width;
			phys->dce_bytes_per_line =
				comp_info->dsc_info.bytes_per_pkt *
				comp_info->dsc_info.pkt_per_line;
		} else if (phys->comp_type == MSM_DISPLAY_COMPRESSION_VDC) {
			phys->dce_bytes_per_line =
				comp_info->vdc_info.bytes_per_pkt *
				comp_info->vdc_info.pkt_per_line;
		}

		if (phys != sde_enc->cur_master) {
			/**
			 * on DMS request, the encoder will be enabled
+16 −0
Original line number Diff line number Diff line
@@ -550,4 +550,20 @@ static inline struct sde_kms *sde_encoder_get_kms(struct drm_encoder *drm_enc)

	return to_sde_kms(priv->kms);
}

/*
 * sde_encoder_is_widebus_enabled - check if widebus is enabled for current mode
 * @drm_enc:    Pointer to drm encoder structure
 * @Return: true if widebus is enabled for current mode
 */
static inline bool sde_encoder_is_widebus_enabled(struct drm_encoder *drm_enc)
{
	struct sde_encoder_virt *sde_enc;

	if (!drm_enc)
		return false;

	sde_enc = to_sde_encoder_virt(drm_enc);
	return sde_enc->mode_info.wide_bus_en;
}
#endif /* __SDE_ENCODER_H__ */
+4 −2
Original line number Diff line number Diff line
@@ -270,8 +270,8 @@ struct sde_encoder_irq {
 * @comp_ratio:		Compression ratio
 * @dsc_extra_pclk_cycle_cnt: Extra pclk cycle count for DSC over DP
 * @dsc_extra_disp_width: Additional display width for DSC over DP
 * @wide_bus_en:	Wide-bus configuraiton
 * @poms_align_vsync:   poms with vsync aligned
 * @dce_bytes_per_line:	Compressed bytes per line
 * @enc_spinlock:	Virtual-Encoder-Wide Spin Lock for IRQ purposes
 * @enable_state:	Enable state tracking
 * @vblank_refcount:	Reference count of vblank request
@@ -317,8 +317,8 @@ struct sde_encoder_phys {
	u32 comp_ratio;
	u32 dsc_extra_pclk_cycle_cnt;
	u32 dsc_extra_disp_width;
	bool wide_bus_en;
	bool poms_align_vsync;
	u32 dce_bytes_per_line;
	spinlock_t *enc_spinlock;
	enum sde_enc_enable_state enable_state;
	struct mutex *vblank_ctl_lock;
@@ -758,6 +758,7 @@ void sde_encoder_helper_phys_disable(struct sde_encoder_phys *phys_enc,

/**
 * sde_encoder_helper_setup_misr - helper function to setup misr
 * @phys_enc: Pointer to physical encoder structure
 * @enable: enable/disable flag
 * @frame_count: frame count for misr
 */
@@ -766,6 +767,7 @@ void sde_encoder_helper_setup_misr(struct sde_encoder_phys *phys_enc,

/**
 * sde_encoder_helper_collect_misr - helper function to collect misr
 * @phys_enc: Pointer to physical encoder structure
 * @nonblock:  blocking/non-blocking flag
 * @misr_value:  pointer to misr value
 * @Return: zero on success
+4 −0
Original line number Diff line number Diff line
@@ -1146,6 +1146,10 @@ static void sde_encoder_phys_cmd_enable_helper(
				(phys_enc->comp_type !=
				 MSM_DISPLAY_COMPRESSION_NONE), false);

	if (hw_intf->ops.enable_wide_bus)
		hw_intf->ops.enable_wide_bus(hw_intf,
			sde_encoder_is_widebus_enabled(phys_enc->parent));

	/*
	 * For pp-split, skip setting the flush bit for the slave intf, since
	 * both intfs use same ctl and HW will only flush the master.
+22 −12
Original line number Diff line number Diff line
@@ -78,17 +78,8 @@ static void drm_mode_to_intf_timing_params(
	 * <----------------- [hv]sync_end ------->
	 * <---------------------------- [hv]total ------------->
	 */
	timing->width = mode->hdisplay;	/* active width */

	if (phys_enc->hw_intf->cap->type != INTF_DP) {
		if ((vid_enc->base.comp_type == MSM_DISPLAY_COMPRESSION_DSC) ||
				(vid_enc->base.comp_type ==
				MSM_DISPLAY_COMPRESSION_VDC))
			timing->width = DIV_ROUND_UP(timing->width,
					vid_enc->base.comp_ratio);
	}

	timing->poms_align_vsync = phys_enc->poms_align_vsync;
	timing->width = mode->hdisplay;	/* active width */
	timing->height = mode->vdisplay;	/* active height */
	timing->xres = timing->width;
	timing->yres = timing->height;
@@ -104,8 +95,11 @@ static void drm_mode_to_intf_timing_params(
	timing->underflow_clr = 0xff;
	timing->hsync_skew = mode->hskew;
	timing->v_front_porch_fixed = vid_enc->base.vfp_cached;
	if (vid_enc->base.comp_type != MSM_DISPLAY_COMPRESSION_NONE)

	if (vid_enc->base.comp_type != MSM_DISPLAY_COMPRESSION_NONE) {
		timing->compression_en = true;
		timing->dce_bytes_per_line = vid_enc->base.dce_bytes_per_line;
	}

	/* DSI controller cannot handle active-low sync signals. */
	if (phys_enc->hw_intf->cap->type == INTF_DSI) {
@@ -122,7 +116,7 @@ static void drm_mode_to_intf_timing_params(
		timing->v_front_porch = 0;
	}

	timing->wide_bus_en = vid_enc->base.wide_bus_en;
	timing->wide_bus_en = sde_encoder_is_widebus_enabled(phys_enc->parent);

	/*
	 * for DP, divide the horizonal parameters by 2 when
@@ -148,6 +142,22 @@ static void drm_mode_to_intf_timing_params(
		}
	}

	/*
	 * for DSI, if compression is enabled, then divide the horizonal active
	 * timing parameters by compression ratio.
	 */
	if ((phys_enc->hw_intf->cap->type != INTF_DP) &&
			((vid_enc->base.comp_type ==
			MSM_DISPLAY_COMPRESSION_DSC) ||
			(vid_enc->base.comp_type ==
			MSM_DISPLAY_COMPRESSION_VDC))) {
		// adjust active dimensions
		timing->width = DIV_ROUND_UP(timing->width,
			vid_enc->base.comp_ratio);
		timing->xres = DIV_ROUND_UP(timing->xres,
			vid_enc->base.comp_ratio);
	}

	/*
	 * For edp only:
	 * DISPLAY_V_START = (VBP * HCYCLE) + HBP
Loading