Re: [RESEND PATCH v6 17/20] drm/mediatek: Support MT8188 Padding in display driver

From: Shawn Sung (宋孝謙)
Date: Mon Oct 02 2023 - 21:29:49 EST


Hi Angelo,

On Thu, 2023-09-28 at 12:24 +0200, AngeloGioacchino Del Regno wrote:
> Il 28/09/23 05:39, Shawn Sung (宋孝謙) ha scritto:
> > Hi CK,
> >
> > On Thu, 2023-09-28 at 03:05 +0000, CK Hu (胡俊光) wrote:
> > > Hi, Hsiao-chien:
> > >
> > > On Mon, 2023-09-11 at 15:42 +0800, Hsiao Chien Sung wrote:
> > > > Padding is a new display module on MT8188, it provides ability
> > > > to add pixels to width and height of a layer with specified
> > > > colors.
> > > >
> > > > Due to hardware design, Mixer in VDOSYS1 requires width of a
> > > > layer
> > > > to be 2-pixel-align, or 4-pixel-align when ETHDR is enabled,
> > > > we need Padding to deal with odd width.
> > > >
> > > > Please notice that even if the Padding is in bypass mode,
> > > > settings in register must be cleared to 0,
> > > > or undefined behaviors could happen.
> > >
> > > You just set padding to bypass mode and not clear settings to 0.
> > > Any
> > > thing wrong?
> > >
> >
> > Since the deafult value of all the registers in Padding is zero,
> > and
> > we are not using Padding currently, it's fine if we just set
> > padding to
> > bypass mode witout clearing other registers.
> >
> > The comment is just a reminder in case we forget it in the future.
>
> Do *not* rely on default register values, because you don't know what
> booted
> Linux in the first place: you shall *not* expect a clean state and
> you shall
> *not* expect a clean boot.
>
> Besides, what I see is that you're setting GENMASK(1, 0) without
> explaining
> why in the code: you have to add at least the definitions for
> PADDING_EN and
> PADDING_BYPASS.
>
> I also don't see why you shouldn't add at least basic handling for
> this block,
> as it looks easy enough: after all, you anyway have to make sure that
> the
> registers are cleared - might as well just add a little more effort
> on top
> and actually set them to meaningful values? That's ultimately your
> choice, but
> I don't want to see any GENMASK(31,0) write even for register
> clearing.
>
> Please make this driver proper.
>

Thank you for the suggestions.
I'll implement it in the next version.

Thanks,
Shawn