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

Commit e3ad37cd authored by Raviteja Tamatam's avatar Raviteja Tamatam
Browse files

drm/msm/sde: rotator software reset during vbif busy case



In some cases regdma timeouts are caused due to vbif busy
and vbif not returing the bus transactions. In such cases
rotator software reset is triggered to avoid panic.

Change-Id: Iad6728a2440961df1d3360b10e07a839931ba200
Signed-off-by: default avatarRaviteja Tamatam <travitej@codeaurora.org>
parent aee5aeb2
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
/* Copyright (c) 2012, 2015-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012, 2015-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -145,6 +145,7 @@ void sde_mdp_halt_vbif_xin(struct sde_mdp_vbif_halt_params *params)
	struct sde_rot_data_type *mdata = sde_rot_get_mdata();
	u32 reg_val;
	bool forced_on;
	int rc = 0;

	if (!mdata || !params || !params->reg_off_mdp_clk_ctrl) {
		SDEROT_ERR("null input parameter\n");
@@ -166,7 +167,9 @@ void sde_mdp_halt_vbif_xin(struct sde_mdp_vbif_halt_params *params)
		reg_val | BIT(params->xin_id));

	/* this is a polling operation */
	sde_mdp_wait_for_xin_halt(params->xin_id);
	rc = sde_mdp_wait_for_xin_halt(params->xin_id);
	if (rc == -ETIMEDOUT)
		params->xin_timeout = BIT(params->xin_id);

	reg_val = SDE_VBIF_READ(mdata, MMSS_VBIF_XIN_HALT_CTRL0);
	SDE_VBIF_WRITE(mdata, MMSS_VBIF_XIN_HALT_CTRL0,
+3 −1
Original line number Diff line number Diff line
/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -76,11 +76,13 @@ struct sde_mdp_set_ot_params {
 * @xin_id: xin port number of vbif
 * @reg_off_mdp_clk_ctrl: reg offset for vbif clock control
 * @bit_off_mdp_clk_ctrl: bit offset for vbif clock control
 * @xin_timeout: bit position indicates timeout on corresponding xin id
 */
struct sde_mdp_vbif_halt_params {
	u32 xin_id;
	u32 reg_off_mdp_clk_ctrl;
	u32 bit_off_mdp_clk_ctrl;
	u32 xin_timeout;
};

enum sde_bus_vote_type {
+13 −6
Original line number Diff line number Diff line
/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -973,9 +973,10 @@ static int sde_hw_rotator_enable_irq(struct sde_hw_rotator *rot)
	return ret;
}

static void sde_hw_rotator_halt_vbif_xin_client(void)
static int sde_hw_rotator_halt_vbif_xin_client(void)
{
	struct sde_mdp_vbif_halt_params halt_params;
	int rc = 0;

	memset(&halt_params, 0, sizeof(struct sde_mdp_vbif_halt_params));
	halt_params.xin_id = XIN_SSPP;
@@ -983,6 +984,7 @@ static void sde_hw_rotator_halt_vbif_xin_client(void)
	halt_params.bit_off_mdp_clk_ctrl =
		MMSS_VBIF_NRT_VBIF_CLK_FORCE_CTRL0_XIN0;
	sde_mdp_halt_vbif_xin(&halt_params);
	rc |=  halt_params.xin_timeout;

	memset(&halt_params, 0, sizeof(struct sde_mdp_vbif_halt_params));
	halt_params.xin_id = XIN_WRITEBACK;
@@ -990,6 +992,9 @@ static void sde_hw_rotator_halt_vbif_xin_client(void)
	halt_params.bit_off_mdp_clk_ctrl =
		MMSS_VBIF_NRT_VBIF_CLK_FORCE_CTRL0_XIN1;
	sde_mdp_halt_vbif_xin(&halt_params);
	rc |=  halt_params.xin_timeout;

	return rc;
}

/**
@@ -2306,7 +2311,10 @@ static u32 sde_hw_rotator_wait_done_regdma(
					__sde_hw_rotator_get_timestamp(rot,
					ROT_QUEUE_LOW_PRIORITY);

			if (ubwcerr || abort) {
			spin_unlock_irqrestore(&rot->rotisr_lock, flags);

			if (ubwcerr || abort ||
					sde_hw_rotator_halt_vbif_xin_client()) {
				/*
				 * Perform recovery for ROT SSPP UBWC decode
				 * error.
@@ -2314,16 +2322,15 @@ static u32 sde_hw_rotator_wait_done_regdma(
				 * - reset TS logic so all pending rotation
				 *   in hw queue got done signalled
				 */
				spin_unlock_irqrestore(&rot->rotisr_lock,
						flags);
				if (!sde_hw_rotator_reset(rot, ctx))
					status = REGDMA_INCOMPLETE_CMD;
				else
					status = ROT_ERROR_BIT;
				spin_lock_irqsave(&rot->rotisr_lock, flags);
			} else {
				status = ROT_ERROR_BIT;
			}

			spin_lock_irqsave(&rot->rotisr_lock, flags);
		} else {
			if (rc == 1)
				SDEROT_WARN(