Re: i.MX8MP: Fix HDMI LCDIF FIFO underruns

Maxime Ripard
2026-03-20T09:25:14Z

[-- Attachment #1: Type: text/plain, Size: 1844 bytes --]

On Fri, Mar 20, 2026 at 09:04:17AM +0100, Marco Felsch wrote:
> On 26-03-20, Marek Vasut wrote:
> > On 3/19/26 12:45 PM, Krzysztof Hałasa wrote:
> > > Running (and terminating) Weston on i.MX8MP sometimes produced black
> > > or grey screens. The LCDIF3 INT_STATUS_D0 register showed a FIFO underrun:
> > >
> > > 32FC6024: 1000002
> > >
> > > The PANIC0_THRES register was set to:
> > >
> > > 32FC6238: AA0154
> > >
> > > which apparently meant low = 2736 bytes (0xAA * 16 + 16), high = 5456 bytes
> > > (0x154 * 16 + 16).
> > >
> > > With this patch (based on NXP's driver) the watermarks are only 16 bytes
> > > higher (register values increased by 1) and the underruns are gone.
> > >
> > > Tested on Solidrun Hummingboard Mate with a 1080p60 HDMI display.
> > >
> > > Signed-off-by: Krzysztof Hałasa <khalasa@piap.pl>
> > >
> > > --- a/drivers/gpu/drm/mxsfb/lcdif_kms.c
> > > +++ b/drivers/gpu/drm/mxsfb/lcdif_kms.c
> > > @@ -353,8 +353,8 @@ static void lcdif_enable_controller(struct lcdif_drm_private *lcdif)
> > > u32 reg;
> > > /* Set FIFO Panic watermarks, low 1/3, high 2/3 . */
> > > - writel(FIELD_PREP(PANIC0_THRES_LOW_MASK, 1 * PANIC0_THRES_MAX / 3) |
> > > - FIELD_PREP(PANIC0_THRES_HIGH_MASK, 2 * PANIC0_THRES_MAX / 3),
> > > + writel(FIELD_PREP(PANIC0_THRES_LOW_MASK, DIV_ROUND_UP(1 * PANIC0_THRES_MAX, 3)) |
> > > + FIELD_PREP(PANIC0_THRES_HIGH_MASK, DIV_ROUND_UP(2 * PANIC0_THRES_MAX, 3)),
> >
> > I am starting to wonder, whether this should be configurable in DT, because
> > it seems there might be users that need to tweak the watermarks one way or
> > the other for different video outputs ?
>
> +1 to provide a override mechanism via DT.

If this is related to the output resolution, the DT is the last place
you should deal with this.

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]