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

Commit 96854c2d authored by Clarence Ip's avatar Clarence Ip
Browse files

msm: sde: simulate timestamp on skipped inline interrupt



If an interrupt for regdma completion is missed for any reason,
the ISR needs to indicate that more than one rotation request
has been completed. This patch updates the software timestamp
simulation for inline rotations to select a timestamp matching
the current incoming interrupt, instead of simply selecting
the timestamp of the oldest request.

CRs-Fixed: 2062038
Change-Id: I4c651f277f4ae0eeb4d26a80feb5912c5ed56e17
Signed-off-by: default avatarClarence Ip <cip@codeaurora.org>
parent d27d963c
Loading
Loading
Loading
Loading
+19 −9
Original line number Diff line number Diff line
@@ -2677,9 +2677,9 @@ static irqreturn_t sde_hw_rotator_rotirq_handler(int irq, void *ptr)
static irqreturn_t sde_hw_rotator_regdmairq_handler(int irq, void *ptr)
{
	struct sde_hw_rotator *rot = ptr;
	struct sde_hw_rotator_context *ctx;
	struct sde_hw_rotator_context *ctx, *tmp;
	irqreturn_t ret = IRQ_NONE;
	u32 isr;
	u32 isr, isr_tmp;
	u32 ts;
	u32 q_id;

@@ -2716,18 +2716,28 @@ static irqreturn_t sde_hw_rotator_regdmairq_handler(int irq, void *ptr)
		 * Timestamp packet is not available in sbuf mode.
		 * Simulate timestamp update in the handler instead.
		 */
		if (!list_empty(&rot->sbuf_ctx[q_id])) {
			ctx = list_first_entry_or_null(&rot->sbuf_ctx[q_id],
					struct sde_hw_rotator_context, list);
			if (ctx) {
		if (list_empty(&rot->sbuf_ctx[q_id]))
			goto skip_sbuf;

		ctx = NULL;
		isr_tmp = isr;
		list_for_each_entry(tmp, &rot->sbuf_ctx[q_id], list) {
			u32 mask;

			mask = tmp->timestamp & 0x1 ? REGDMA_INT_1_MASK :
				REGDMA_INT_0_MASK;
			if (isr_tmp & mask) {
				isr_tmp &= ~mask;
				ctx = tmp;
				ts = ctx->timestamp;
				sde_hw_rotator_update_swts(rot, ctx, ts);
				SDEROT_DBG("update swts:0x%X\n", ts);
			} else {
				SDEROT_ERR("invalid swts ctx\n");
			}
			SDEROT_EVTLOG(isr, tmp->timestamp);
		}

		if (ctx == NULL)
			SDEROT_ERR("invalid swts ctx\n");
skip_sbuf:
		ctx = rot->rotCtx[q_id][ts & SDE_HW_ROT_REGDMA_SEG_MASK];

		/*
+4 −0
Original line number Diff line number Diff line
@@ -297,4 +297,8 @@
#define REGDMA_TIMESTAMP_REG            ROT_SSPP_TPG_PATTERN_GEN_INIT_VAL
#define REGDMA_RESET_STATUS_REG         ROT_SSPP_TPG_RGB_MAPPING

#define REGDMA_INT_0_MASK               0x101
#define REGDMA_INT_1_MASK               0x202
#define REGDMA_INT_2_MASK               0x404

#endif /*_SDE_ROTATOR_R3_HWIO_H */