All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chun-Kuang Hu <chunkuang.hu@kernel.org>
To: Frank Wunderlich <frank-w@public-files.de>
Cc: chunkuang Hu <chunkuang.hu@kernel.org>,
	Dafna Hirschfeld <dafna.hirschfeld@collabora.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Enric Balletbo i Serra <enric.balletbo@collabora.com>,
	David Airlie <airlied@linux.ie>,
	"moderated list:ARM/Mediatek SoC support" 
	<linux-mediatek@lists.infradead.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Collabora Kernel ML <kernel@collabora.com>,
	Matthias Brugger <matthias.bgg@gmail.com>
Subject: Re: Re: Re: BUG: MTK DRM/HDMI broken on 5.13 (mt7623/bpi-r2)
Date: Sat, 10 Jul 2021 00:53:07 +0800	[thread overview]
Message-ID: <CAAOTY_-yi5NP_U-m==ZHeBNC9-6NrjUacKWdmmgVXZjH+sFZKw@mail.gmail.com> (raw)
In-Reply-To: <trinity-937ebfa3-d123-42de-a289-3ad0dbc09782-1625830110576@3c-app-gmx-bap43>

Hi, Frank:

Frank Wunderlich <frank-w@public-files.de> 於 2021年7月9日 週五 下午7:28寫道:
>
> > Gesendet: Freitag, 09. Juli 2021 um 12:38 Uhr
> > Von: "Frank Wunderlich" <frank-w@public-files.de>
> > An: "Enric Balletbo Serra" <eballetbo@gmail.com>
> > Cc: "CK Hu" <ck.hu@mediatek.com>, "Dafna Hirschfeld" <dafna.hirschfeld@collabora.com>, "chunkuang Hu" <chunkuang.hu@kernel.org>, "Thomas Zimmermann" <tzimmermann@suse.de>, "David Airlie" <airlied@linux.ie>, "linux-kernel" <linux-kernel@vger.kernel.org>, "Enric Balletbo i Serra" <enric.balletbo@collabora.com>, "moderated list:ARM/Mediatek SoC support" <linux-mediatek@lists.infradead.org>, "dri-devel" <dri-devel@lists.freedesktop.org>, "Matthias Brugger" <matthias.bgg@gmail.com>, "Collabora Kernel ML" <kernel@collabora.com>
> > Betreff: Aw: Re: Re: BUG: MTK DRM/HDMI broken on 5.13 (mt7623/bpi-r2)
> >
> >
> > > Gesendet: Freitag, 09. Juli 2021 um 12:24 Uhr
> > > Von: "Enric Balletbo Serra" <eballetbo@gmail.com>
> > > If this is the offending commit, could you try if the following patch
> > > fixes the issue for you?
> > >
> > > https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux.git/commit/?h=v5.13-next/fixes&id=db39994e0bd852c6612a9709e63c09b98b161e00
> > >
> > > If not, and that patch is the offending commit, it probably means that
> > > the default routing table doesn't work for mt7623. Needs a specific
> > > soc table.
> >
> > Hi Eric,
> >
> > thanks for response, but it does not fix the issue for me. hdmi on mt7623 is DPI not DSI. There is already a mt7623 specific routing-table defined (one for DPI/HDMI and one for external=DSI/MIPI):
> >
> > https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/mediatek/mtk_drm_drv.c#L74
> >
> > maybe it can be included or compared with the "default" route?
> >
> > regards Frank
>
> Hi
>
> i tried to convert the old routing table into the new format
>
> diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c
> index 080660ef11bf..134dae13382f 100644
> --- a/drivers/soc/mediatek/mtk-mmsys.c
> +++ b/drivers/soc/mediatek/mtk-mmsys.c
> @@ -20,6 +20,12 @@ static const struct mtk_mmsys_driver_data mt2701_mmsys_driver_data = {
>         .num_routes = ARRAY_SIZE(mmsys_default_routing_table),
>  };
>
> +static const struct mtk_mmsys_driver_data mt7623_mmsys_driver_data = {
> +       .clk_driver = "clk-mt2701-mm",
> +       .routes = mmsys_mt7623_routing_table,
> +       .num_routes = ARRAY_SIZE(mmsys_mt7623_routing_table),
> +};
> +
>  static const struct mtk_mmsys_driver_data mt2712_mmsys_driver_data = {
>         .clk_driver = "clk-mt2712-mm",
>         .routes = mmsys_default_routing_table,
> @@ -133,6 +139,10 @@ static const struct of_device_id of_match_mtk_mmsys[] = {
>                 .compatible = "mediatek,mt2701-mmsys",
>                 .data = &mt2701_mmsys_driver_data,
>         },
> +       {
> +               .compatible = "mediatek,mt7623-mmsys",
> +               .data = &mt7623_mmsys_driver_data,
> +       },
>         {
>                 .compatible = "mediatek,mt2712-mmsys",
>                 .data = &mt2712_mmsys_driver_data,
> diff --git a/drivers/soc/mediatek/mtk-mmsys.h b/drivers/soc/mediatek/mtk-mmsys.h
> index 11388961dded..fd397f68339c 100644
> --- a/drivers/soc/mediatek/mtk-mmsys.h
> +++ b/drivers/soc/mediatek/mtk-mmsys.h
> @@ -214,5 +214,14 @@ static const struct mtk_mmsys_routes mmsys_default_routing_table[] = {
>                 DISP_REG_CONFIG_DISP_UFOE_MOUT_EN, UFOE_MOUT_EN_DSI0,
>         }
>  };
> -
> +static const struct mtk_mmsys_routes mmsys_mt7623_routing_table[] = {
> +       //HDMI
> +       {
> +               DDP_COMPONENT_OVL0, DDP_COMPONENT_RDMA0,
> +               DISP_REG_CONFIG_DISP_OVL_MOUT_EN, OVL_MOUT_EN_RDMA
> +       }, {
> +               DDP_COMPONENT_RDMA0, DDP_COMPONENT_DPI0,
> +               DISP_REG_CONFIG_DISP_RDMA0_SOUT_EN, RDMA0_SOUT_DPI0
> +       }
> +};
>  #endif /* __SOC_MEDIATEK_MTK_MMSYS_H */
> :...skipping...
> diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c
> index 080660ef11bf..134dae13382f 100644
> --- a/drivers/soc/mediatek/mtk-mmsys.c
> +++ b/drivers/soc/mediatek/mtk-mmsys.c
> @@ -20,6 +20,12 @@ static const struct mtk_mmsys_driver_data mt2701_mmsys_driver_data = {
>         .num_routes = ARRAY_SIZE(mmsys_default_routing_table),
>  };
>
> +static const struct mtk_mmsys_driver_data mt7623_mmsys_driver_data = {
> +       .clk_driver = "clk-mt2701-mm",//leave clock as mt7623 is based on mt2701
> +       .routes = mmsys_mt7623_routing_table,
> +       .num_routes = ARRAY_SIZE(mmsys_mt7623_routing_table),
> +};
> +
>  static const struct mtk_mmsys_driver_data mt2712_mmsys_driver_data = {
>         .clk_driver = "clk-mt2712-mm",
>         .routes = mmsys_default_routing_table,
> @@ -133,6 +139,10 @@ static const struct of_device_id of_match_mtk_mmsys[] = {
>                 .compatible = "mediatek,mt2701-mmsys",
>                 .data = &mt2701_mmsys_driver_data,
>         },
> +       {
> +               .compatible = "mediatek,mt7623-mmsys",
> +               .data = &mt7623_mmsys_driver_data,
> +       },
>         {
>                 .compatible = "mediatek,mt2712-mmsys",
>                 .data = &mt2712_mmsys_driver_data,
> diff --git a/drivers/soc/mediatek/mtk-mmsys.h b/drivers/soc/mediatek/mtk-mmsys.h
> index 11388961dded..fd397f68339c 100644
> --- a/drivers/soc/mediatek/mtk-mmsys.h
> +++ b/drivers/soc/mediatek/mtk-mmsys.h
> @@ -214,5 +214,14 @@ static const struct mtk_mmsys_routes mmsys_default_routing_table[] = {
>                 DISP_REG_CONFIG_DISP_UFOE_MOUT_EN, UFOE_MOUT_EN_DSI0,
>         }
>  };
> -
> +static const struct mtk_mmsys_routes mmsys_mt7623_routing_table[] = {
> +       //HDMI
> +       {
> +               DDP_COMPONENT_OVL0, DDP_COMPONENT_RDMA0,
> +               DISP_REG_CONFIG_DISP_OVL_MOUT_EN, OVL_MOUT_EN_RDMA
> +       }, {
> +               DDP_COMPONENT_RDMA0, DDP_COMPONENT_DPI0,
> +               DISP_REG_CONFIG_DISP_RDMA0_SOUT_EN, RDMA0_SOUT_DPI0
> +       }
> +};
>
> here i've left out COLOR0 and BLS because i have not found the 3rd (address) and 4th params (value) for the routing between them and edging components
>
> this is the old route:
>
>         DDP_COMPONENT_OVL0,
>         DDP_COMPONENT_RDMA0,
>         DDP_COMPONENT_COLOR0,
>         DDP_COMPONENT_BLS,
>         DDP_COMPONENT_DPI0,
>
> so i guess i need:
>
> DISP_REG_CONFIG_DISP_RDMA0_MOUT_EN, RDMA0_MOUT_EN_COLOR0
> DISP_REG_CONFIG_DISP_COLOR0_MOUT_EN, COLOR0_MOUT_EN_BLS
> DISP_REG_CONFIG_DISP_BLS_MOUT_EN, BLS_MOUT_EN_DPI0
>
> thinking OUT is right for display...it's no HDMI-in
> but i'm unsure whats the difference between MOUT and SOUT
>
> compatible for mmsys is already set to mediatek,mt7623-mmsys in arch/arm/boot/dts/mt7623n.dtsi but it's not working, i guess because color0 and bls are missing in route
>
> any hint how to add them?

SOUT means even though data could output to multiple sink, but could
only output to single sink at one moment. MOUT means data could output
to multiple sink at one moment.
For SOUT with 4 sink output, the value for each sink would be 0, 1, 2, 3.
For MOUT with 4 sink output, the value for each sink would be BIT(0),
BIT(1), BIT(2), BIT(3).
[1] is my original design, and it has 'mask' in struct mtk_mmsys_conn_cfg.
For SOUT with 4 sink output, the mask would be 0x3.
For MOUT with 4 sink output, the mask would be 0xf.
You could try to add back the mask.

[1] https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2345186

Regards,
Chun-Kuang.

>
> regards Frank

WARNING: multiple messages have this Message-ID (diff)
From: Chun-Kuang Hu <chunkuang.hu@kernel.org>
To: Frank Wunderlich <frank-w@public-files.de>
Cc: chunkuang Hu <chunkuang.hu@kernel.org>,
	 Dafna Hirschfeld <dafna.hirschfeld@collabora.com>,
	 linux-kernel <linux-kernel@vger.kernel.org>,
	 Enric Balletbo i Serra <enric.balletbo@collabora.com>,
	David Airlie <airlied@linux.ie>,
	 "moderated list:ARM/Mediatek SoC support"
	<linux-mediatek@lists.infradead.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	 Collabora Kernel ML <kernel@collabora.com>,
	Matthias Brugger <matthias.bgg@gmail.com>
Subject: Re: Re: Re: BUG: MTK DRM/HDMI broken on 5.13 (mt7623/bpi-r2)
Date: Sat, 10 Jul 2021 00:53:07 +0800	[thread overview]
Message-ID: <CAAOTY_-yi5NP_U-m==ZHeBNC9-6NrjUacKWdmmgVXZjH+sFZKw@mail.gmail.com> (raw)
In-Reply-To: <trinity-937ebfa3-d123-42de-a289-3ad0dbc09782-1625830110576@3c-app-gmx-bap43>

Hi, Frank:

Frank Wunderlich <frank-w@public-files.de> 於 2021年7月9日 週五 下午7:28寫道:
>
> > Gesendet: Freitag, 09. Juli 2021 um 12:38 Uhr
> > Von: "Frank Wunderlich" <frank-w@public-files.de>
> > An: "Enric Balletbo Serra" <eballetbo@gmail.com>
> > Cc: "CK Hu" <ck.hu@mediatek.com>, "Dafna Hirschfeld" <dafna.hirschfeld@collabora.com>, "chunkuang Hu" <chunkuang.hu@kernel.org>, "Thomas Zimmermann" <tzimmermann@suse.de>, "David Airlie" <airlied@linux.ie>, "linux-kernel" <linux-kernel@vger.kernel.org>, "Enric Balletbo i Serra" <enric.balletbo@collabora.com>, "moderated list:ARM/Mediatek SoC support" <linux-mediatek@lists.infradead.org>, "dri-devel" <dri-devel@lists.freedesktop.org>, "Matthias Brugger" <matthias.bgg@gmail.com>, "Collabora Kernel ML" <kernel@collabora.com>
> > Betreff: Aw: Re: Re: BUG: MTK DRM/HDMI broken on 5.13 (mt7623/bpi-r2)
> >
> >
> > > Gesendet: Freitag, 09. Juli 2021 um 12:24 Uhr
> > > Von: "Enric Balletbo Serra" <eballetbo@gmail.com>
> > > If this is the offending commit, could you try if the following patch
> > > fixes the issue for you?
> > >
> > > https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux.git/commit/?h=v5.13-next/fixes&id=db39994e0bd852c6612a9709e63c09b98b161e00
> > >
> > > If not, and that patch is the offending commit, it probably means that
> > > the default routing table doesn't work for mt7623. Needs a specific
> > > soc table.
> >
> > Hi Eric,
> >
> > thanks for response, but it does not fix the issue for me. hdmi on mt7623 is DPI not DSI. There is already a mt7623 specific routing-table defined (one for DPI/HDMI and one for external=DSI/MIPI):
> >
> > https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/mediatek/mtk_drm_drv.c#L74
> >
> > maybe it can be included or compared with the "default" route?
> >
> > regards Frank
>
> Hi
>
> i tried to convert the old routing table into the new format
>
> diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c
> index 080660ef11bf..134dae13382f 100644
> --- a/drivers/soc/mediatek/mtk-mmsys.c
> +++ b/drivers/soc/mediatek/mtk-mmsys.c
> @@ -20,6 +20,12 @@ static const struct mtk_mmsys_driver_data mt2701_mmsys_driver_data = {
>         .num_routes = ARRAY_SIZE(mmsys_default_routing_table),
>  };
>
> +static const struct mtk_mmsys_driver_data mt7623_mmsys_driver_data = {
> +       .clk_driver = "clk-mt2701-mm",
> +       .routes = mmsys_mt7623_routing_table,
> +       .num_routes = ARRAY_SIZE(mmsys_mt7623_routing_table),
> +};
> +
>  static const struct mtk_mmsys_driver_data mt2712_mmsys_driver_data = {
>         .clk_driver = "clk-mt2712-mm",
>         .routes = mmsys_default_routing_table,
> @@ -133,6 +139,10 @@ static const struct of_device_id of_match_mtk_mmsys[] = {
>                 .compatible = "mediatek,mt2701-mmsys",
>                 .data = &mt2701_mmsys_driver_data,
>         },
> +       {
> +               .compatible = "mediatek,mt7623-mmsys",
> +               .data = &mt7623_mmsys_driver_data,
> +       },
>         {
>                 .compatible = "mediatek,mt2712-mmsys",
>                 .data = &mt2712_mmsys_driver_data,
> diff --git a/drivers/soc/mediatek/mtk-mmsys.h b/drivers/soc/mediatek/mtk-mmsys.h
> index 11388961dded..fd397f68339c 100644
> --- a/drivers/soc/mediatek/mtk-mmsys.h
> +++ b/drivers/soc/mediatek/mtk-mmsys.h
> @@ -214,5 +214,14 @@ static const struct mtk_mmsys_routes mmsys_default_routing_table[] = {
>                 DISP_REG_CONFIG_DISP_UFOE_MOUT_EN, UFOE_MOUT_EN_DSI0,
>         }
>  };
> -
> +static const struct mtk_mmsys_routes mmsys_mt7623_routing_table[] = {
> +       //HDMI
> +       {
> +               DDP_COMPONENT_OVL0, DDP_COMPONENT_RDMA0,
> +               DISP_REG_CONFIG_DISP_OVL_MOUT_EN, OVL_MOUT_EN_RDMA
> +       }, {
> +               DDP_COMPONENT_RDMA0, DDP_COMPONENT_DPI0,
> +               DISP_REG_CONFIG_DISP_RDMA0_SOUT_EN, RDMA0_SOUT_DPI0
> +       }
> +};
>  #endif /* __SOC_MEDIATEK_MTK_MMSYS_H */
> :...skipping...
> diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c
> index 080660ef11bf..134dae13382f 100644
> --- a/drivers/soc/mediatek/mtk-mmsys.c
> +++ b/drivers/soc/mediatek/mtk-mmsys.c
> @@ -20,6 +20,12 @@ static const struct mtk_mmsys_driver_data mt2701_mmsys_driver_data = {
>         .num_routes = ARRAY_SIZE(mmsys_default_routing_table),
>  };
>
> +static const struct mtk_mmsys_driver_data mt7623_mmsys_driver_data = {
> +       .clk_driver = "clk-mt2701-mm",//leave clock as mt7623 is based on mt2701
> +       .routes = mmsys_mt7623_routing_table,
> +       .num_routes = ARRAY_SIZE(mmsys_mt7623_routing_table),
> +};
> +
>  static const struct mtk_mmsys_driver_data mt2712_mmsys_driver_data = {
>         .clk_driver = "clk-mt2712-mm",
>         .routes = mmsys_default_routing_table,
> @@ -133,6 +139,10 @@ static const struct of_device_id of_match_mtk_mmsys[] = {
>                 .compatible = "mediatek,mt2701-mmsys",
>                 .data = &mt2701_mmsys_driver_data,
>         },
> +       {
> +               .compatible = "mediatek,mt7623-mmsys",
> +               .data = &mt7623_mmsys_driver_data,
> +       },
>         {
>                 .compatible = "mediatek,mt2712-mmsys",
>                 .data = &mt2712_mmsys_driver_data,
> diff --git a/drivers/soc/mediatek/mtk-mmsys.h b/drivers/soc/mediatek/mtk-mmsys.h
> index 11388961dded..fd397f68339c 100644
> --- a/drivers/soc/mediatek/mtk-mmsys.h
> +++ b/drivers/soc/mediatek/mtk-mmsys.h
> @@ -214,5 +214,14 @@ static const struct mtk_mmsys_routes mmsys_default_routing_table[] = {
>                 DISP_REG_CONFIG_DISP_UFOE_MOUT_EN, UFOE_MOUT_EN_DSI0,
>         }
>  };
> -
> +static const struct mtk_mmsys_routes mmsys_mt7623_routing_table[] = {
> +       //HDMI
> +       {
> +               DDP_COMPONENT_OVL0, DDP_COMPONENT_RDMA0,
> +               DISP_REG_CONFIG_DISP_OVL_MOUT_EN, OVL_MOUT_EN_RDMA
> +       }, {
> +               DDP_COMPONENT_RDMA0, DDP_COMPONENT_DPI0,
> +               DISP_REG_CONFIG_DISP_RDMA0_SOUT_EN, RDMA0_SOUT_DPI0
> +       }
> +};
>
> here i've left out COLOR0 and BLS because i have not found the 3rd (address) and 4th params (value) for the routing between them and edging components
>
> this is the old route:
>
>         DDP_COMPONENT_OVL0,
>         DDP_COMPONENT_RDMA0,
>         DDP_COMPONENT_COLOR0,
>         DDP_COMPONENT_BLS,
>         DDP_COMPONENT_DPI0,
>
> so i guess i need:
>
> DISP_REG_CONFIG_DISP_RDMA0_MOUT_EN, RDMA0_MOUT_EN_COLOR0
> DISP_REG_CONFIG_DISP_COLOR0_MOUT_EN, COLOR0_MOUT_EN_BLS
> DISP_REG_CONFIG_DISP_BLS_MOUT_EN, BLS_MOUT_EN_DPI0
>
> thinking OUT is right for display...it's no HDMI-in
> but i'm unsure whats the difference between MOUT and SOUT
>
> compatible for mmsys is already set to mediatek,mt7623-mmsys in arch/arm/boot/dts/mt7623n.dtsi but it's not working, i guess because color0 and bls are missing in route
>
> any hint how to add them?

SOUT means even though data could output to multiple sink, but could
only output to single sink at one moment. MOUT means data could output
to multiple sink at one moment.
For SOUT with 4 sink output, the value for each sink would be 0, 1, 2, 3.
For MOUT with 4 sink output, the value for each sink would be BIT(0),
BIT(1), BIT(2), BIT(3).
[1] is my original design, and it has 'mask' in struct mtk_mmsys_conn_cfg.
For SOUT with 4 sink output, the mask would be 0x3.
For MOUT with 4 sink output, the mask would be 0xf.
You could try to add back the mask.

[1] https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2345186

Regards,
Chun-Kuang.

>
> regards Frank

_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

WARNING: multiple messages have this Message-ID (diff)
From: Chun-Kuang Hu <chunkuang.hu@kernel.org>
To: Frank Wunderlich <frank-w@public-files.de>
Cc: chunkuang Hu <chunkuang.hu@kernel.org>,
	Dafna Hirschfeld <dafna.hirschfeld@collabora.com>,
	David Airlie <airlied@linux.ie>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	"moderated list:ARM/Mediatek SoC support"
	<linux-mediatek@lists.infradead.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Enric Balletbo i Serra <enric.balletbo@collabora.com>,
	Collabora Kernel ML <kernel@collabora.com>
Subject: Re: Re: Re: BUG: MTK DRM/HDMI broken on 5.13 (mt7623/bpi-r2)
Date: Sat, 10 Jul 2021 00:53:07 +0800	[thread overview]
Message-ID: <CAAOTY_-yi5NP_U-m==ZHeBNC9-6NrjUacKWdmmgVXZjH+sFZKw@mail.gmail.com> (raw)
In-Reply-To: <trinity-937ebfa3-d123-42de-a289-3ad0dbc09782-1625830110576@3c-app-gmx-bap43>

Hi, Frank:

Frank Wunderlich <frank-w@public-files.de> 於 2021年7月9日 週五 下午7:28寫道:
>
> > Gesendet: Freitag, 09. Juli 2021 um 12:38 Uhr
> > Von: "Frank Wunderlich" <frank-w@public-files.de>
> > An: "Enric Balletbo Serra" <eballetbo@gmail.com>
> > Cc: "CK Hu" <ck.hu@mediatek.com>, "Dafna Hirschfeld" <dafna.hirschfeld@collabora.com>, "chunkuang Hu" <chunkuang.hu@kernel.org>, "Thomas Zimmermann" <tzimmermann@suse.de>, "David Airlie" <airlied@linux.ie>, "linux-kernel" <linux-kernel@vger.kernel.org>, "Enric Balletbo i Serra" <enric.balletbo@collabora.com>, "moderated list:ARM/Mediatek SoC support" <linux-mediatek@lists.infradead.org>, "dri-devel" <dri-devel@lists.freedesktop.org>, "Matthias Brugger" <matthias.bgg@gmail.com>, "Collabora Kernel ML" <kernel@collabora.com>
> > Betreff: Aw: Re: Re: BUG: MTK DRM/HDMI broken on 5.13 (mt7623/bpi-r2)
> >
> >
> > > Gesendet: Freitag, 09. Juli 2021 um 12:24 Uhr
> > > Von: "Enric Balletbo Serra" <eballetbo@gmail.com>
> > > If this is the offending commit, could you try if the following patch
> > > fixes the issue for you?
> > >
> > > https://git.kernel.org/pub/scm/linux/kernel/git/matthias.bgg/linux.git/commit/?h=v5.13-next/fixes&id=db39994e0bd852c6612a9709e63c09b98b161e00
> > >
> > > If not, and that patch is the offending commit, it probably means that
> > > the default routing table doesn't work for mt7623. Needs a specific
> > > soc table.
> >
> > Hi Eric,
> >
> > thanks for response, but it does not fix the issue for me. hdmi on mt7623 is DPI not DSI. There is already a mt7623 specific routing-table defined (one for DPI/HDMI and one for external=DSI/MIPI):
> >
> > https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/mediatek/mtk_drm_drv.c#L74
> >
> > maybe it can be included or compared with the "default" route?
> >
> > regards Frank
>
> Hi
>
> i tried to convert the old routing table into the new format
>
> diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c
> index 080660ef11bf..134dae13382f 100644
> --- a/drivers/soc/mediatek/mtk-mmsys.c
> +++ b/drivers/soc/mediatek/mtk-mmsys.c
> @@ -20,6 +20,12 @@ static const struct mtk_mmsys_driver_data mt2701_mmsys_driver_data = {
>         .num_routes = ARRAY_SIZE(mmsys_default_routing_table),
>  };
>
> +static const struct mtk_mmsys_driver_data mt7623_mmsys_driver_data = {
> +       .clk_driver = "clk-mt2701-mm",
> +       .routes = mmsys_mt7623_routing_table,
> +       .num_routes = ARRAY_SIZE(mmsys_mt7623_routing_table),
> +};
> +
>  static const struct mtk_mmsys_driver_data mt2712_mmsys_driver_data = {
>         .clk_driver = "clk-mt2712-mm",
>         .routes = mmsys_default_routing_table,
> @@ -133,6 +139,10 @@ static const struct of_device_id of_match_mtk_mmsys[] = {
>                 .compatible = "mediatek,mt2701-mmsys",
>                 .data = &mt2701_mmsys_driver_data,
>         },
> +       {
> +               .compatible = "mediatek,mt7623-mmsys",
> +               .data = &mt7623_mmsys_driver_data,
> +       },
>         {
>                 .compatible = "mediatek,mt2712-mmsys",
>                 .data = &mt2712_mmsys_driver_data,
> diff --git a/drivers/soc/mediatek/mtk-mmsys.h b/drivers/soc/mediatek/mtk-mmsys.h
> index 11388961dded..fd397f68339c 100644
> --- a/drivers/soc/mediatek/mtk-mmsys.h
> +++ b/drivers/soc/mediatek/mtk-mmsys.h
> @@ -214,5 +214,14 @@ static const struct mtk_mmsys_routes mmsys_default_routing_table[] = {
>                 DISP_REG_CONFIG_DISP_UFOE_MOUT_EN, UFOE_MOUT_EN_DSI0,
>         }
>  };
> -
> +static const struct mtk_mmsys_routes mmsys_mt7623_routing_table[] = {
> +       //HDMI
> +       {
> +               DDP_COMPONENT_OVL0, DDP_COMPONENT_RDMA0,
> +               DISP_REG_CONFIG_DISP_OVL_MOUT_EN, OVL_MOUT_EN_RDMA
> +       }, {
> +               DDP_COMPONENT_RDMA0, DDP_COMPONENT_DPI0,
> +               DISP_REG_CONFIG_DISP_RDMA0_SOUT_EN, RDMA0_SOUT_DPI0
> +       }
> +};
>  #endif /* __SOC_MEDIATEK_MTK_MMSYS_H */
> :...skipping...
> diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c
> index 080660ef11bf..134dae13382f 100644
> --- a/drivers/soc/mediatek/mtk-mmsys.c
> +++ b/drivers/soc/mediatek/mtk-mmsys.c
> @@ -20,6 +20,12 @@ static const struct mtk_mmsys_driver_data mt2701_mmsys_driver_data = {
>         .num_routes = ARRAY_SIZE(mmsys_default_routing_table),
>  };
>
> +static const struct mtk_mmsys_driver_data mt7623_mmsys_driver_data = {
> +       .clk_driver = "clk-mt2701-mm",//leave clock as mt7623 is based on mt2701
> +       .routes = mmsys_mt7623_routing_table,
> +       .num_routes = ARRAY_SIZE(mmsys_mt7623_routing_table),
> +};
> +
>  static const struct mtk_mmsys_driver_data mt2712_mmsys_driver_data = {
>         .clk_driver = "clk-mt2712-mm",
>         .routes = mmsys_default_routing_table,
> @@ -133,6 +139,10 @@ static const struct of_device_id of_match_mtk_mmsys[] = {
>                 .compatible = "mediatek,mt2701-mmsys",
>                 .data = &mt2701_mmsys_driver_data,
>         },
> +       {
> +               .compatible = "mediatek,mt7623-mmsys",
> +               .data = &mt7623_mmsys_driver_data,
> +       },
>         {
>                 .compatible = "mediatek,mt2712-mmsys",
>                 .data = &mt2712_mmsys_driver_data,
> diff --git a/drivers/soc/mediatek/mtk-mmsys.h b/drivers/soc/mediatek/mtk-mmsys.h
> index 11388961dded..fd397f68339c 100644
> --- a/drivers/soc/mediatek/mtk-mmsys.h
> +++ b/drivers/soc/mediatek/mtk-mmsys.h
> @@ -214,5 +214,14 @@ static const struct mtk_mmsys_routes mmsys_default_routing_table[] = {
>                 DISP_REG_CONFIG_DISP_UFOE_MOUT_EN, UFOE_MOUT_EN_DSI0,
>         }
>  };
> -
> +static const struct mtk_mmsys_routes mmsys_mt7623_routing_table[] = {
> +       //HDMI
> +       {
> +               DDP_COMPONENT_OVL0, DDP_COMPONENT_RDMA0,
> +               DISP_REG_CONFIG_DISP_OVL_MOUT_EN, OVL_MOUT_EN_RDMA
> +       }, {
> +               DDP_COMPONENT_RDMA0, DDP_COMPONENT_DPI0,
> +               DISP_REG_CONFIG_DISP_RDMA0_SOUT_EN, RDMA0_SOUT_DPI0
> +       }
> +};
>
> here i've left out COLOR0 and BLS because i have not found the 3rd (address) and 4th params (value) for the routing between them and edging components
>
> this is the old route:
>
>         DDP_COMPONENT_OVL0,
>         DDP_COMPONENT_RDMA0,
>         DDP_COMPONENT_COLOR0,
>         DDP_COMPONENT_BLS,
>         DDP_COMPONENT_DPI0,
>
> so i guess i need:
>
> DISP_REG_CONFIG_DISP_RDMA0_MOUT_EN, RDMA0_MOUT_EN_COLOR0
> DISP_REG_CONFIG_DISP_COLOR0_MOUT_EN, COLOR0_MOUT_EN_BLS
> DISP_REG_CONFIG_DISP_BLS_MOUT_EN, BLS_MOUT_EN_DPI0
>
> thinking OUT is right for display...it's no HDMI-in
> but i'm unsure whats the difference between MOUT and SOUT
>
> compatible for mmsys is already set to mediatek,mt7623-mmsys in arch/arm/boot/dts/mt7623n.dtsi but it's not working, i guess because color0 and bls are missing in route
>
> any hint how to add them?

SOUT means even though data could output to multiple sink, but could
only output to single sink at one moment. MOUT means data could output
to multiple sink at one moment.
For SOUT with 4 sink output, the value for each sink would be 0, 1, 2, 3.
For MOUT with 4 sink output, the value for each sink would be BIT(0),
BIT(1), BIT(2), BIT(3).
[1] is my original design, and it has 'mask' in struct mtk_mmsys_conn_cfg.
For SOUT with 4 sink output, the mask would be 0x3.
For MOUT with 4 sink output, the mask would be 0xf.
You could try to add back the mask.

[1] https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2345186

Regards,
Chun-Kuang.

>
> regards Frank

  reply	other threads:[~2021-07-09 16:53 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-06  9:54 BUG: MTK DRM/HDMI broken on 5.13 (mt7623/bpi-r2) Frank Wunderlich
2021-07-06  9:54 ` Frank Wunderlich
2021-07-06  9:54 ` Frank Wunderlich
2021-07-06 11:20 ` Daniel Vetter
2021-07-06 11:20   ` Daniel Vetter
2021-07-06 11:20   ` Daniel Vetter
2021-07-06 11:40   ` Aw: " Frank Wunderlich
2021-07-06 11:40     ` Frank Wunderlich
2021-07-06 11:40     ` Frank Wunderlich
2021-07-07 14:58     ` Chun-Kuang Hu
2021-07-07 14:58       ` Chun-Kuang Hu
2021-07-07 14:58       ` Chun-Kuang Hu
2021-07-07 15:03     ` Chun-Kuang Hu
2021-07-07 15:03       ` Chun-Kuang Hu
2021-07-07 15:03       ` Chun-Kuang Hu
2021-07-07 16:33       ` Aw: " Frank Wunderlich
2021-07-07 16:33         ` Frank Wunderlich
2021-07-07 16:33         ` Frank Wunderlich
2021-07-08  7:22 ` Dafna Hirschfeld
2021-07-08  7:22   ` Dafna Hirschfeld
2021-07-08  7:22   ` Dafna Hirschfeld
2021-07-08  8:00   ` Aw: " Frank Wunderlich
2021-07-08  8:00     ` Frank Wunderlich
2021-07-08  8:00     ` Frank Wunderlich
2021-07-08  9:35   ` Frank Wunderlich
2021-07-08  9:35     ` Frank Wunderlich
2021-07-08  9:35     ` Frank Wunderlich
2021-07-08 12:30     ` Dafna Hirschfeld
2021-07-08 12:30       ` Dafna Hirschfeld
2021-07-08 12:30       ` Dafna Hirschfeld
2021-07-08 14:01       ` Aw: " Frank Wunderlich
2021-07-08 14:01         ` Frank Wunderlich
2021-07-08 14:01         ` Frank Wunderlich
2021-07-08 15:31     ` Aw: " Frank Wunderlich
2021-07-08 15:31       ` Frank Wunderlich
2021-07-08 15:31       ` Frank Wunderlich
2021-07-09 10:02       ` Frank Wunderlich
2021-07-09 10:02         ` Frank Wunderlich
2021-07-09 10:02         ` Frank Wunderlich
2021-07-09 10:24         ` Enric Balletbo Serra
2021-07-09 10:24           ` Enric Balletbo Serra
2021-07-09 10:24           ` Enric Balletbo Serra
2021-07-09 10:38           ` Aw: " Frank Wunderlich
2021-07-09 10:38             ` Frank Wunderlich
2021-07-09 10:38             ` Frank Wunderlich
2021-07-09 11:28             ` Frank Wunderlich
2021-07-09 11:28               ` Frank Wunderlich
2021-07-09 11:28               ` Frank Wunderlich
2021-07-09 16:53               ` Chun-Kuang Hu [this message]
2021-07-09 16:53                 ` Chun-Kuang Hu
2021-07-09 16:53                 ` Chun-Kuang Hu
2021-07-12  8:11                 ` Aw: " Frank Wunderlich
2021-07-12  8:11                   ` Frank Wunderlich
2021-07-12  8:11                   ` Frank Wunderlich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAAOTY_-yi5NP_U-m==ZHeBNC9-6NrjUacKWdmmgVXZjH+sFZKw@mail.gmail.com' \
    --to=chunkuang.hu@kernel.org \
    --cc=airlied@linux.ie \
    --cc=dafna.hirschfeld@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=enric.balletbo@collabora.com \
    --cc=frank-w@public-files.de \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.