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

Commit c19c9776 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: mdss: add return values to MDSS recovery events"

parents 2c80547a 3c9abb72
Loading
Loading
Loading
Loading
+18 −4
Original line number Diff line number Diff line
@@ -746,6 +746,8 @@ static void mdss_dsi_ctl_phy_reset(struct mdss_dsi_ctrl_pdata *ctrl, u32 event)
	u32 data0, data1, mask = 0, data_lane_en = 0;
	struct mdss_dsi_ctrl_pdata *ctrl0, *ctrl1;
	u32 ln0, ln1, ln_ctrl0, ln_ctrl1, i;
	int rc = 0;

	/*
	 * Add 2 ms delay suggested by HW team.
	 * Check clk lane stop state after every 200 us
@@ -767,9 +769,15 @@ static void mdss_dsi_ctl_phy_reset(struct mdss_dsi_ctrl_pdata *ctrl, u32 event)
		ctrl0 = mdss_dsi_get_ctrl_by_index(DSI_CTRL_0);
		ctrl1 = mdss_dsi_get_ctrl_by_index(DSI_CTRL_1);

		if (ctrl0->recovery)
			ctrl0->recovery->fxn(ctrl0->recovery->data,
		if (ctrl0->recovery) {
			rc = ctrl0->recovery->fxn(ctrl0->recovery->data,
					MDP_INTF_DSI_VIDEO_FIFO_OVERFLOW);
			if (rc < 0) {
				pr_debug("%s: Target is in suspend/shutdown\n",
					__func__);
				return;
			}
		}
		/*
		 * Disable PHY contention detection and receive.
		 * Configure the strength ctrl 1 register.
@@ -859,9 +867,15 @@ static void mdss_dsi_ctl_phy_reset(struct mdss_dsi_ctrl_pdata *ctrl, u32 event)
		 */
		udelay(200);
	} else {
		if (ctrl->recovery)
			ctrl->recovery->fxn(ctrl->recovery->data,
		if (ctrl->recovery) {
			rc = ctrl->recovery->fxn(ctrl->recovery->data,
					MDP_INTF_DSI_VIDEO_FIFO_OVERFLOW);
			if (rc < 0) {
				pr_debug("%s: Target is in suspend/shutdown\n",
					__func__);
				return;
			}
		}
		/* Disable PHY contention detection and receive */
		MIPI_OUTP((ctrl->phy_io.base) + 0x0188, 0);

+11 −9
Original line number Diff line number Diff line
@@ -1027,7 +1027,7 @@ static int mdss_mdp_cmd_wait4readptr(struct mdss_mdp_cmd_ctx *ctx)
	return rc;
}

static void mdss_mdp_cmd_intf_callback(void *data, int event)
static int mdss_mdp_cmd_intf_callback(void *data, int event)
{
	struct mdss_mdp_cmd_ctx *ctx = data;
	struct mdss_mdp_pp_tear_check *te = NULL;
@@ -1036,11 +1036,11 @@ static void mdss_mdp_cmd_intf_callback(void *data, int event)

	if (!data) {
		pr_err("%s: invalid ctx\n", __func__);
		return;
		return -EINVAL;
	}

	if (!ctx->ctl)
		return;
		return -EINVAL;

	switch (event) {
	case MDP_INTF_CALLBACK_DSI_WAIT:
@@ -1052,7 +1052,7 @@ static void mdss_mdp_cmd_intf_callback(void *data, int event)
		 * just return
		 */
		if (ctx->intf_stopped || !is_pingpong_split(ctx->ctl->mfd))
			return;
			return -EINVAL;
		atomic_inc(&ctx->rdptr_cnt);

		/* enable clks and rd_ptr interrupt */
@@ -1061,7 +1061,7 @@ static void mdss_mdp_cmd_intf_callback(void *data, int event)
		mixer = mdss_mdp_mixer_get(ctx->ctl, MDSS_MDP_MIXER_MUX_LEFT);
		if (!mixer) {
			pr_err("%s: null mixer\n", __func__);
			return;
			return -EINVAL;
		}

		/* wait for read pointer */
@@ -1085,6 +1085,7 @@ static void mdss_mdp_cmd_intf_callback(void *data, int event)
		pr_debug("%s: unhandled event=%d\n", __func__, event);
		break;
	}
	return 0;
}

static void mdss_mdp_cmd_lineptr_done(void *arg)
@@ -1110,7 +1111,7 @@ static void mdss_mdp_cmd_lineptr_done(void *arg)
	spin_unlock(&ctx->clk_lock);
}

static void mdss_mdp_cmd_intf_recovery(void *data, int event)
static int mdss_mdp_cmd_intf_recovery(void *data, int event)
{
	struct mdss_mdp_cmd_ctx *ctx = data;
	unsigned long flags;
@@ -1118,11 +1119,11 @@ static void mdss_mdp_cmd_intf_recovery(void *data, int event)

	if (!data) {
		pr_err("%s: invalid ctx\n", __func__);
		return;
		return -EINVAL;
	}

	if (!ctx->ctl)
		return;
		return -EINVAL;

	/*
	 * Currently, only intf_fifo_underflow is
@@ -1132,7 +1133,7 @@ static void mdss_mdp_cmd_intf_recovery(void *data, int event)
	if (event != MDP_INTF_DSI_CMD_FIFO_UNDERFLOW) {
		pr_warn("%s: unsupported recovery event:%d\n",
					__func__, event);
		return;
		return -EPERM;
	}

	if (atomic_read(&ctx->koff_cnt)) {
@@ -1156,6 +1157,7 @@ static void mdss_mdp_cmd_intf_recovery(void *data, int event)
	if (notify_frame_timeout)
		mdss_mdp_ctl_notify(ctx->ctl, MDP_NOTIFY_FRAME_TIMEOUT);

	return 0;
}

static void mdss_mdp_cmd_pingpong_done(void *arg)
+7 −7
Original line number Diff line number Diff line
@@ -310,7 +310,7 @@ int mdss_mdp_video_addr_setup(struct mdss_data_type *mdata,
	return 0;
}

static void mdss_mdp_video_intf_recovery(void *data, int event)
static int mdss_mdp_video_intf_recovery(void *data, int event)
{
	struct mdss_mdp_video_ctx *ctx;
	struct mdss_mdp_ctl *ctl = data;
@@ -322,7 +322,7 @@ static void mdss_mdp_video_intf_recovery(void *data, int event)

	if (!data) {
		pr_err("%s: invalid ctl\n", __func__);
		return;
		return -EINVAL;
	}

	/*
@@ -333,7 +333,7 @@ static void mdss_mdp_video_intf_recovery(void *data, int event)
	if (event != MDP_INTF_DSI_VIDEO_FIFO_OVERFLOW) {
		pr_warn("%s: unsupported recovery event:%d\n",
					__func__, event);
		return;
		return -EPERM;
	}

	ctx = ctl->intf_ctx[MASTER_CTX];
@@ -348,7 +348,7 @@ static void mdss_mdp_video_intf_recovery(void *data, int event)
	clk_rate = DIV_ROUND_UP_ULL(clk_rate, 1000); /* in kHz */
	if (!clk_rate) {
		pr_err("Unable to get proper clk_rate\n");
		return;
		return -EINVAL;
	}
	/*
	 * calculate clk_period as pico second to maintain good
@@ -358,7 +358,7 @@ static void mdss_mdp_video_intf_recovery(void *data, int event)
	clk_period = DIV_ROUND_UP_ULL(1000000000, clk_rate);
	if (!clk_period) {
		pr_err("Unable to calculate clock period\n");
		return;
		return -EINVAL;
	}
	min_ln_cnt = pinfo->lcdc.v_back_porch + pinfo->lcdc.v_pulse_width;
	active_lns_cnt = pinfo->yres;
@@ -384,7 +384,7 @@ static void mdss_mdp_video_intf_recovery(void *data, int event)
				!ctx->timegen_en) {
			pr_warn("Target is in suspend or shutdown pending\n");
			mutex_unlock(&ctl->offlock);
			return;
			return -EPERM;
		}

		line_cnt = mdss_mdp_video_line_count(ctl);
@@ -394,7 +394,7 @@ static void mdss_mdp_video_intf_recovery(void *data, int event)
			pr_debug("%s, Needed lines left line_cnt=%d\n",
						__func__, line_cnt);
			mutex_unlock(&ctl->offlock);
			return;
			return 0;
		} else {
			pr_warn("line count is less. line_cnt = %d\n",
								line_cnt);
+1 −1
Original line number Diff line number Diff line
@@ -166,7 +166,7 @@ enum {
};

struct mdss_intf_recovery {
	void (*fxn)(void *ctx, int event);
	int (*fxn)(void *ctx, int event);
	void *data;
};