[PATCH v2 31/46] drm/mediatek: Add support for Display Layer Blender component
AngeloGioacchino Del Regno
angelogioacchino.delregno at collabora.com
Tue Nov 24 06:45:34 PST 2026
On 11/24/26 15:33, Daniel Stone wrote:
> Hi Angelo,
>
> On Tue, 14 Jul 2026 at 12:46, AngeloGioacchino Del Regno
> <angelogioacchino.delregno at collabora.com> wrote:
>> +#define DISP_REG_OVL_BLD_L0_CLR 0x20c
>> +# define OVL_BLD_BGCLR_BLACK 0xff000000
>> +# define OVL_BLD_BGCLR_RED 0xffff0000
>
> We probably don't need a #define for every ARGB8888 colour tbh. :)
>
>> +void mtk_blender_config(struct mtk_ddp_comp *comp, unsigned int w,
>> + unsigned int h, unsigned int vrefresh,
>> + unsigned int bpc, struct cmdq_pkt *cmdq_pkt)
>> +{
>> + struct mtk_disp_blender *priv = dev_get_drvdata(comp->dev);
>> + u32 val;
>> +
>> + /* Set ROI for this Blender */
>> + val = ((h & GENMASK(15, 0)) << 16) | (w & GENMASK(15, 0));
>> + writel(val, priv->regs + DISP_REG_OVL_BLD_ROI_SIZE);
>> +
>> + /*
>> + * Set both background color and constant layer color to Opaque Black
>> + * (ARGB) for eventual Alpha Blending to be effective
>> + */
>> + writel(OVL_BLD_BGCLR_BLACK, priv->regs + DISP_REG_OVL_BLD_BGCLR_CLR);
>> + writel(OVL_BLD_BGCLR_BLACK, priv->regs + DISP_REG_OVL_BLD_L0_CLR);
>
> Would you believe that this does not in fact need to be black, as it's
> been configurable since 4c684596cde4?
>
Heh, that's nice - I wrote this code also before the bg color property got
introduced, thanks! :-D
Cheers,
Angelo
More information about the linux-arm-kernel
mailing list