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

Commit 62b94edd authored by Benjamin Chan's avatar Benjamin Chan Committed by Narendra Muppalla
Browse files

msm: sde: Fix SDE rotator driver error handling



Initialize some local variables before using them and safely return
an error code when encounter error cases in the SDE rotator driver.

CRs-Fixed: 1060558
Change-Id: I25406b13ac2007f1789d8d32e428c39dac4c29cf
Signed-off-by: default avatarBenjamin Chan <bkchan@codeaurora.org>
Signed-off-by: default avatarNarendra Muppalla <NarendraM@codeaurora.org>
parent b4364fab
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -316,7 +316,7 @@ static int sde_mdp_wb_wait4comp(struct sde_mdp_ctl *ctl, void *arg)
{
	struct sde_mdp_writeback_ctx *ctx;
	int rc = 0;
	u64 rot_time;
	u64 rot_time = 0;
	u32 status, mask, isr;

	ctx = (struct sde_mdp_writeback_ctx *) ctl->priv_data;
+6 −3
Original line number Diff line number Diff line
@@ -1566,8 +1566,8 @@ static int sde_hw_rotator_kickoff(struct sde_rot_hw_resource *hw,
	if (!ctx) {
		SDEROT_ERR("Cannot locate rotator ctx from sesison id:%d\n",
				entry->item.session_id);
		return -EINVAL;
	}
	WARN_ON(ctx == NULL);

	ret = sde_smmu_ctrl(1);
	if (IS_ERR_VALUE(ret)) {
@@ -1609,8 +1609,8 @@ static int sde_hw_rotator_wait4done(struct sde_rot_hw_resource *hw,
	if (!ctx) {
		SDEROT_ERR("Cannot locate rotator ctx from sesison id:%d\n",
				entry->item.session_id);
		return -EINVAL;
	}
	WARN_ON(ctx == NULL);

	ret = rot->ops.wait_rotator_done(ctx, ctx->q_id, 0);

@@ -1745,8 +1745,10 @@ static irqreturn_t sde_hw_rotator_regdmairq_handler(int irq, void *ptr)
			q_id = ROT_QUEUE_LOW_PRIORITY;
			ts   = (ts >> SDE_REGDMA_SWTS_SHIFT) &
				SDE_REGDMA_SWTS_MASK;
		} else {
			SDEROT_ERR("unknown ISR status: isr=0x%X\n", isr);
			goto done_isr_handle;
		}

		ctx = rot->rotCtx[q_id][ts & SDE_HW_ROT_REGDMA_SEG_MASK];

		/*
@@ -1766,6 +1768,7 @@ static irqreturn_t sde_hw_rotator_regdmairq_handler(int irq, void *ptr)
				[ts & SDE_HW_ROT_REGDMA_SEG_MASK];
		};

done_isr_handle:
		spin_unlock(&rot->rotisr_lock);
		ret = IRQ_HANDLED;
	} else if (isr & REGDMA_INT_ERR_MASK) {
+1 −1
Original line number Diff line number Diff line
@@ -586,7 +586,7 @@ void sde_rot_ubwc_data_calc_offset(struct sde_mdp_data *data, u16 x, u16 y,
	struct sde_mdp_plane_sizes *ps, struct sde_mdp_format_params *fmt)
{
	u16 macro_w, micro_w, micro_h;
	u32 offset;
	u32 offset = 0;
	int ret;

	ret = sde_rot_get_ubwc_micro_dim(fmt->format, &micro_w, &micro_h);