On Tue, Jul 14, 2026 at 7:45 PM AngeloGioacchino Del Regno
<[email protected]> wrote:
>
> The mediatek-drm driver is ready to switch to the new Multimedia
> Subsystem Display Controller HW indexing.
>
> Perform the switch by:
>  - Adding new "from_comp_inst" and "to_comp_inst" members in the
>    Multimedia Subsystem HW Routes structure (mtk_mmsys_routes);
>  - Changing the MMSYS_ROUTE() macro to use those, which performs
>    the migration of all SoCs in one go (as all of them use this
>    macro to declare their route entries);
>  - Adding new mtk_mmsys_hw_connect() and mtk_mmsys_hw_disconnect()
>    functions, making use of the new HW Component Type-Instance
>    indexing.
>
> Unfortunately, this change needs to go along with the related one
> in the mediatek-drm driver, otherwise functionality of the Display
> Controller will regress.
>
> The only way to make this possible in two steps is to duplicate
> all of the routes structure arrays for all of the SoCs, which
> would result in a total of around ~1200 lines changed twice, and
> that ignores the big increase in size for this driver during the
> migration process so, in order to avoid useless bloat, I opted
> for an inter-dependency between the two changes: mediatek-drm
> and mtk-mmsys.
>
> Acked-by: AngeloGioacchino Del Regno <[email protected]>
> Signed-off-by: AngeloGioacchino Del Regno 
> <[email protected]>
> ---
>  drivers/soc/mediatek/mtk-mmsys.c       | 99 ++++++++++++++++++++------
>  drivers/soc/mediatek/mtk-mmsys.h       | 15 ++--
>  include/linux/soc/mediatek/mtk-mmsys.h | 16 ++---
>  3 files changed, 90 insertions(+), 40 deletions(-)
>
[snip]
> +void mtk_mmsys_hw_connect(struct device *dev,
> +                         enum mtk_ddp_comp_type src_type, u8 src_hw_inst_id,
> +                         enum mtk_ddp_comp_type dst_type, u8 dst_hw_inst_id)
>  {
>         struct mtk_mmsys *mmsys = dev_get_drvdata(dev);
>         const struct mtk_mmsys_routes *routes = mmsys->data->routes;
> -       int i;
>
> -       for (i = 0; i < mmsys->data->num_routes; i++)
> -               if (cur == routes[i].from_comp && next == routes[i].to_comp)
> -                       mtk_mmsys_update_bits(mmsys, routes[i].addr, 
> routes[i].mask,
> -                                             routes[i].val, NULL);
> +       for (int i = 0; i < mmsys->data->num_routes; i++) {
> +               if (src_type != routes[i].from_comp_type ||
> +                   src_hw_inst_id != routes[i].from_comp_inst ||
> +                   dst_type != routes[i].to_comp_type ||
> +                   dst_hw_inst_id != routes[i].to_comp_inst)
> +                       continue;
>
> -       if (mmsys->data->vsync_len)
> -               mtk_mmsys_update_bits(mmsys, MT8188_VDO1_MIXER_VSYNC_LEN, 
> GENMASK(31, 0),
> -                                     mmsys->data->vsync_len, NULL);

The refactor drops this vsync_len register write block, leaving MT8188
VDOSYS1 unconfigured.
Is this intentional? Otherwise please mention it in the commit message.

Regards,
Fei

> +               mtk_mmsys_update_bits(mmsys, routes[i].addr, routes[i].mask, 
> routes[i].val, NULL);
> +               dev_dbg(dev, "Connected %u-%u to %u-%u\n",
> +                       src_type, src_hw_inst_id, dst_type, dst_hw_inst_id);
> +       }

Reply via email to