Re: [PATCH v6 07/13] drm/imx: dc: Use TCON operation mode

From: Liu Ying

Date: Mon Oct 26 2026 - 05:39:58 EST


On Fri, Sep 04, 2026 at 10:32:35AM +0200, Maxime Ripard wrote:
> Hi,

Hi,

Sorry for the late reply.

>
> On Fri, Sep 04, 2026 at 03:54:57PM +0800, Liu Ying wrote:
> > @@ -273,7 +285,22 @@ dc_crtc_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_commit *state)
> > dc_ed_pec_sync_trigger(dc_crtc->ed_cont);
> > dc_ed_pec_sync_trigger(dc_crtc->ed_safe);
> > dc_fg_shdtokgen(dc_crtc->fg);
> > +
> > + /* Don't relinquish CPU until TCON is set to operation mode. */
> > + local_irq_save(flags);
> > + preempt_disable();
> > +
> > dc_fg_enable(dc_crtc->fg);
> > + /*
> > + * Turn TCON into operation mode as soon as the first dumb
> > + * frame is generated by DC(we don't relinquish CPU to ensure
> > + * this). This makes DPR/PRG be able to evade the frame.
> > + */
> > + DC_CRTC_WAIT_FOR_FRAMEGEN_FRAME_INDEX_MOVING(dc_crtc->fg);
> > + dc_tc_set_operation_mode(dc_crtc->tc);
> > +
> > + local_irq_restore(flags);
> > + preempt_enable();
>
> That's really not great... Can you expand on why you need this, and is
> there really no other way to do it?

This is a sequence instructed by NXP/Freescale IP designer to ensure
that the prefetch engine(DPRC + PRG) can be enabled reliably - TCON must
be switched to operation mode from bypass mode as soon as FrameGen finishes
generating the first frame(frame index moves). This is the only way to
do that, AFAIK.

I'll address Sashiko AI bot's comments about local irq disablement in
next version.

>
> Maxime

--
Regards,
Liu Ying