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

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

Merge "msm: sde: Fix SDE rotator context list locking"

parents 61f26e3a 39e8fe59
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1502,7 +1502,8 @@ static void sde_hw_rotator_free_rotctx(struct sde_hw_rotator *rot,
		ctx->q_id, ctx->timestamp,
		atomic_read(&ctx->hwres->num_active));

	rot->rotCtx[ctx->q_id][sde_hw_rotator_get_regdma_ctxidx(ctx)] = NULL;
	/* Clear rotator context from lookup purpose */
	sde_hw_rotator_clr_ctx(ctx);

	devm_kfree(&rot->pdev->dev, ctx);
}
+22 −0
Original line number Diff line number Diff line
@@ -345,10 +345,32 @@ static inline void sde_hw_rotator_put_ctx(struct sde_hw_rotator_context *ctx)
{
	 struct sde_hw_rotator *rot = ctx->rot;
	 u32 idx = sde_hw_rotator_get_regdma_ctxidx(ctx);
	 unsigned long flags;

	 spin_lock_irqsave(&rot->rotisr_lock, flags);
	 rot->rotCtx[ctx->q_id][idx] = ctx;
	 spin_unlock_irqrestore(&rot->rotisr_lock, flags);

	 SDEROT_DBG("rotCtx[%d][%d] <== ctx:%p | session-id:%d\n",
			 ctx->q_id, idx, ctx, ctx->session_id);
}

/**
 * sde_hw_rotator_clr_ctx(): Clearing rotator context according to its
 * timestamp.
 */
static inline void sde_hw_rotator_clr_ctx(struct sde_hw_rotator_context *ctx)
{
	 struct sde_hw_rotator *rot = ctx->rot;
	 u32 idx = sde_hw_rotator_get_regdma_ctxidx(ctx);
	 unsigned long flags;

	 spin_lock_irqsave(&rot->rotisr_lock, flags);
	 rot->rotCtx[ctx->q_id][idx] = NULL;
	 spin_unlock_irqrestore(&rot->rotisr_lock, flags);

	 SDEROT_DBG("rotCtx[%d][%d] <== null | session-id:%d\n",
			 ctx->q_id, idx, ctx->session_id);
}

#endif /*_SDE_ROTATOR_R3_INTERNAL_H */