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

Commit 44256351 authored by Kyle Yan's avatar Kyle Yan Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: sde: add clock & bandwidth control for inline rotation" into msm-4.9

parents cf63235a f366a01b
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -1257,8 +1257,12 @@ static int sde_rotator_calc_perf(struct sde_rot_mgr *mgr,
				(mgr->overhead.denom - max_fps *
				mgr->overhead.numer));

	/* use client provided clock if specified */
	if (config->flags & SDE_ROTATION_EXT_PERF)
		perf->clk_rate = config->clk_rate;

	/*
	 * check for Override clock calcualtion
	 * check for Override clock calculation
	 */
	if (rot_dev->min_rot_clk > perf->clk_rate)
		perf->clk_rate = rot_dev->min_rot_clk;
@@ -1282,6 +1286,10 @@ static int sde_rotator_calc_perf(struct sde_rot_mgr *mgr,
	if (rot_dev->min_bw > perf->bw)
		perf->bw = rot_dev->min_bw;

	/* use client provided bandwidth if specified */
	if (config->flags & SDE_ROTATION_EXT_PERF)
		perf->bw = config->data_bw;

	perf->rdot_limit = sde_mdp_get_ot_limit(
			config->input.width, config->input.height,
			config->input.format, config->frame_rate, true);
+7 −0
Original line number Diff line number Diff line
@@ -65,6 +65,9 @@
/* use client mapped i/o virtual address */
#define SDE_ROTATION_EXT_IOVA		0x80000

/* use client provided clock/bandwidth parameters */
#define SDE_ROTATION_EXT_PERF		0x100000

/**********************************************************************
 * configuration structures
 **********************************************************************/
@@ -91,6 +94,8 @@ struct sde_rotation_buf_info {
 * @input: input buffer information
 * @output: output buffer information
 * @frame_rate: session frame rate in fps
 * @clk_rate: requested rotator clock rate if SDE_ROTATION_EXT_PERF is set
 * @data_bw: requested data bus bandwidth if SDE_ROTATION_EXT_PERF is set
 * @flags: configuration flags, e.g. rotation angle, flip, etc...
 */
struct sde_rotation_config {
@@ -98,6 +103,8 @@ struct sde_rotation_config {
	struct sde_rotation_buf_info	input;
	struct sde_rotation_buf_info	output;
	uint32_t	frame_rate;
	uint64_t	clk_rate;
	uint64_t	data_bw;
	uint32_t	flags;
};

+18 −1
Original line number Diff line number Diff line
@@ -1380,7 +1380,7 @@ int sde_rotator_inline_commit(void *handle, struct sde_rotator_inline_cmd *cmd,
	}

	SDEROT_DBG(
		"s:%d.%u src:(%u,%u,%u,%u)/%ux%u/%c%c%c%c dst:(%u,%u,%u,%u)/%c%c%c%c r:%d f:%d/%d s:%d fps:%u wb:%d vid:%d cmd:%d\n",
		"s:%d.%u src:(%u,%u,%u,%u)/%ux%u/%c%c%c%c dst:(%u,%u,%u,%u)/%c%c%c%c r:%d f:%d/%d s:%d fps:%u clk:%llu bw:%llu wb:%d vid:%d cmd:%d\n",
		ctx->session_id, cmd->sequence_id,
		cmd->src_rect_x, cmd->src_rect_y,
		cmd->src_rect_w, cmd->src_rect_h,
@@ -1392,8 +1392,21 @@ int sde_rotator_inline_commit(void *handle, struct sde_rotator_inline_cmd *cmd,
		cmd->dst_pixfmt >> 0, cmd->dst_pixfmt >> 8,
		cmd->dst_pixfmt >> 16, cmd->dst_pixfmt >> 24,
		cmd->rot90, cmd->hflip, cmd->vflip, cmd->secure, cmd->fps,
		cmd->clkrate, cmd->data_bw,
		cmd->dst_writeback, cmd->video_mode, cmd_type);
	SDEROT_EVTLOG(ctx->session_id, cmd->sequence_id,
		cmd->src_rect_x, cmd->src_rect_y,
		cmd->src_rect_w, cmd->src_rect_h,
		cmd->src_width, cmd->src_height,
		cmd->src_pixfmt,
		cmd->dst_rect_x, cmd->dst_rect_y,
		cmd->dst_rect_w, cmd->dst_rect_h,
		cmd->dst_pixfmt,
		cmd->rot90, cmd->hflip, cmd->vflip, cmd->secure, cmd->fps,
		cmd->clkrate, cmd->data_bw,
		cmd->dst_writeback, cmd->video_mode, cmd_type);


	sde_rot_mgr_lock(rot_dev->mgr);

	if (cmd_type == SDE_ROTATOR_INLINE_CMD_VALIDATE ||
@@ -1415,6 +1428,8 @@ int sde_rotator_inline_commit(void *handle, struct sde_rotator_inline_cmd *cmd,
		if (cmd->secure)
			flags |= SDE_ROTATION_SECURE;

		flags |= SDE_ROTATION_EXT_PERF;

		/* fill in item work structure */
		memset(&item, 0, sizeof(struct sde_rotation_item));
		item.flags = flags | SDE_ROTATION_EXT_IOVA;
@@ -1478,6 +1493,8 @@ int sde_rotator_inline_commit(void *handle, struct sde_rotator_inline_cmd *cmd,
		memset(&rotcfg, 0, sizeof(struct sde_rotation_config));
		rotcfg.flags = flags;
		rotcfg.frame_rate = cmd->fps;
		rotcfg.clk_rate = cmd->clkrate;
		rotcfg.data_bw = cmd->data_bw;
		rotcfg.session_id = ctx->session_id;
		rotcfg.input.width = cmd->src_rect_w;
		rotcfg.input.height = cmd->src_rect_h;
+4 −0
Original line number Diff line number Diff line
@@ -43,6 +43,8 @@ enum sde_rotator_inline_cmd_type {
 * @vflip: vertical flip prior to rotation
 * @secure: true if buffer is in secure domain
 * @prefill_bw: prefill bandwidth in Bps
 * @clkrate: clock rate in Hz
 * @data_bw: data bus bandwidth in Bps
 * @src_addr: source i/o buffer virtual address
 * @src_len: source i/o buffer length
 * @src_planes: source plane number
@@ -73,6 +75,8 @@ struct sde_rotator_inline_cmd {
	bool vflip;
	bool secure;
	u64 prefill_bw;
	u64 clkrate;
	u64 data_bw;
	dma_addr_t src_addr[SDE_ROTATOR_INLINE_PLANE_MAX];
	u32 src_len[SDE_ROTATOR_INLINE_PLANE_MAX];
	u32 src_planes;