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

Commit 498d59f3 authored by Alan Kwong's avatar Alan Kwong
Browse files

msm: sde: add support for cmd/video mode inline rotation



Add support to control prefill bandwidth and prefill trigger
in cmd/video mode operation.

CRs-Fixed: 2009714
Change-Id: I4cda2d639486041b87b73f9ab7e68a3e85084f19
Signed-off-by: default avatarAlan Kwong <akwong@codeaurora.org>
parent 6bc6462b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -139,6 +139,9 @@ struct sde_rotation_item {
	/* rotation trigger mode */
	uint32_t	trigger;

	/* prefill bandwidth in Bps */
	uint64_t	prefill_bw;

	/* Source crop rectangle */
	struct sde_rect	src_rect;

+1 −0
Original line number Diff line number Diff line
@@ -1420,6 +1420,7 @@ int sde_rotator_inline_commit(void *handle, struct sde_rotator_inline_cmd *cmd,
		item.flags = flags | SDE_ROTATION_EXT_IOVA;
		item.trigger = cmd->video_mode ? SDE_ROTATOR_TRIGGER_VIDEO :
				SDE_ROTATOR_TRIGGER_COMMAND;
		item.prefill_bw = cmd->prefill_bw;
		item.session_id = ctx->session_id;
		item.sequence_id = cmd->sequence_id;
		item.src_rect.x = cmd->src_rect_x;
+2 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ enum sde_rotator_inline_cmd_type {
 * @hflip: horizontal flip prior to rotation
 * @vflip: vertical flip prior to rotation
 * @secure: true if buffer is in secure domain
 * @prefill_bw: prefill bandwidth in Bps
 * @src_addr: source i/o buffer virtual address
 * @src_len: source i/o buffer length
 * @src_planes: source plane number
@@ -71,6 +72,7 @@ struct sde_rotator_inline_cmd {
	bool hflip;
	bool vflip;
	bool secure;
	u64 prefill_bw;
	dma_addr_t src_addr[SDE_ROTATOR_INLINE_PLANE_MAX];
	u32 src_len[SDE_ROTATOR_INLINE_PLANE_MAX];
	u32 src_planes;
+11 −3
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@
/* traffic shaping clock ticks = finish_time x 19.2MHz */
#define TRAFFIC_SHAPE_CLKTICK_14MS   268800
#define TRAFFIC_SHAPE_CLKTICK_12MS   230400
#define TRAFFIC_SHAPE_VSYNC_CLK      19200000

/* XIN mapping */
#define XIN_SSPP		0
@@ -997,8 +998,8 @@ static void sde_hw_rotator_setup_wbengine(struct sde_hw_rotator_context *ctx,
	SDE_REGDMA_WRITE(wrptr, ROTTOP_OP_MODE, ctx->op_mode |
			(flags & SDE_ROT_FLAG_ROT_90 ? BIT(1) : 0) | BIT(0));

	/* setup traffic shaper for 4k 30fps content */
	if (ctx->is_traffic_shaping) {
	/* setup traffic shaper for 4k 30fps content or if prefill_bw is set */
	if (ctx->is_traffic_shaping || cfg->prefill_bw) {
		u32 bw;

		/*
@@ -1017,10 +1018,16 @@ static void sde_hw_rotator_setup_wbengine(struct sde_hw_rotator_context *ctx,
			bw *= fmt->bpp;

		bw /= TRAFFIC_SHAPE_CLKTICK_12MS;

		/* use prefill bandwidth instead if specified */
		if (cfg->prefill_bw)
			bw = DIV_ROUND_UP(cfg->prefill_bw,
					TRAFFIC_SHAPE_VSYNC_CLK);

		if (bw > 0xFF)
			bw = 0xFF;
		SDE_REGDMA_WRITE(wrptr, ROT_WB_TRAFFIC_SHAPER_WR_CLIENT,
				BIT(31) | bw);
				BIT(31) | (cfg->prefill_bw ? BIT(27) : 0) | bw);
		SDEROT_DBG("Enable ROT_WB Traffic Shaper:%d\n", bw);
	} else {
		SDE_REGDMA_WRITE(wrptr, ROT_WB_TRAFFIC_SHAPER_WR_CLIENT, 0);
@@ -1947,6 +1954,7 @@ static int sde_hw_rotator_config(struct sde_rot_hw_resource *hw,

	wb_cfg.v_downscale_factor = entry->dnsc_factor_h;
	wb_cfg.h_downscale_factor = entry->dnsc_factor_w;
	wb_cfg.prefill_bw = item->prefill_bw;

	rot->ops.setup_rotator_wbengine(ctx, ctx->q_id, &wb_cfg, flags);

+2 −0
Original line number Diff line number Diff line
@@ -85,6 +85,7 @@ struct sde_hw_rot_sspp_cfg {
 *  @dest_rect: dest ROI, caller takes into account the different operations
 *              such as decimation, flip etc to program this field
 *  @addr:      destination surface address
 *  @prefill_bw: prefill bandwidth in Bps
 */
struct sde_hw_rot_wb_cfg {
	struct sde_mdp_format_params   *fmt;
@@ -97,6 +98,7 @@ struct sde_hw_rot_wb_cfg {
	u32                             h_downscale_factor;
	u32                             fps;
	u64                             bw;
	u64                             prefill_bw;
};