[PATCH v2] drm/mediatek: ovl: Add fmt_support_man for MT8192 and MT8195

Jason-JH Lin (林睿祥) Jason-JH.Lin at mediatek.com
Tue Sep 17 09:44:14 PDT 2024


> > +
> > +#define OVL_CON_CLRFMT_PARGB8888(ovl)  ({ \
> > +	struct mtk_disp_ovl *_ovl = (ovl); \
> > +	(_ovl->data->fmt_support_man ? \
> > +	((3 << 12) | OVL_CON_CLRFMT_MAN) : OVL_CON_CLRFMT_ARGB8888); \
> > +})
> 
> Isn't it just simpler to pass an "extended input format selection"
> flag to
> these macros, instead of the entire mtk_disp_ovl structure?
> 
> Something like...
> 
> #define OVL_CON_CLRFMT_PARGB8888(fmt_support_man)
> 
> ...or alternatively, it's probably simply more straightforward to
> assign
> function pointers to struct mtk_disp_ovl_data:
> 
> `.fmt_convert = ovl_fmt_convert_mt8173` for MT8173-style controllers
> and
> `.fmt_convert = ovl_fmt_convert_mt8195` for MT8195-style controllers,
> 
> so that you can simply call `con = ovl->data->fmt_convert(ovl, fmt,
> blend_mode)`
> in mtk_ovl_layer_config().
> 
> The thing is - those macros seem to be unnecessarily complicated, and
> it's at
> least impacting on readability... :-)

OK, I'll add
`.fmt_convert = mtk_ovl_fmt_convert_with_blend` to the driver data for
MT8192 and MT8195
and add
`.fmt_convert = mtk_ovl_fmt_convert` to the driver data for other SoCs.

Regards,
Jason-JH.Lin

> 
> Cheers,
> Angelo
> 
> > 


More information about the Linux-mediatek mailing list