linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frank Wunderlich <frank-w@public-files.de>
To: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Cc: Frank Wunderlich <linux@fw-web.de>,
	linux-mediatek@lists.infradead.org,
	Matthias Brugger <matthias.bgg@gmail.com>,
	CK Hu <ck.hu@mediatek.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Enric Balletbo Serra <eballetbo@gmail.com>,
	David Airlie <airlied@linux.ie>,
	dri-devel@lists.freedesktop.org, Daniel Vetter <daniel@ffwll.ch>
Subject: Aw: Re: [PATCH] soc: mediatek: mmsys: fix HDMI output on mt7623/bananapi-r2
Date: Mon, 12 Jul 2021 14:35:10 +0200	[thread overview]
Message-ID: <trinity-f4eef0e6-9873-4fbe-8c17-19cab347b1ab-1626093310010@3c-app-gmx-bs28> (raw)
In-Reply-To: <456f0611-1fc7-75ac-ff45-9afd94190283@collabora.com>

> Gesendet: Montag, 12. Juli 2021 um 13:50 Uhr
> Von: "Dafna Hirschfeld" <dafna.hirschfeld@collabora.com>
> An: "Frank Wunderlich" <linux@fw-web.de>, linux-mediatek@lists.infradead.org
> Cc: "Frank Wunderlich" <frank-w@public-files.de>, "Matthias Brugger" <matthias.bgg@gmail.com>, "CK Hu" <ck.hu@mediatek.com>, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "Enric Balletbo Serra" <eballetbo@gmail.com>, "David Airlie" <airlied@linux.ie>, dri-devel@lists.freedesktop.org, "Daniel Vetter" <daniel@ffwll.ch>
> Betreff: Re: [PATCH] soc: mediatek: mmsys: fix HDMI output on mt7623/bananapi-r2
>
> Hi
>
> On 10.07.21 15:24, Frank Wunderlich wrote:
> > From: Frank Wunderlich <frank-w@public-files.de>
> >
> > HDMI output was broken on mt7623/BPI-R2 in 5.13 because function for
> > special output selection (mtk_mmsys_ddp_sout_sel) was dropped.
> > This function wrote 3 registers at one time and so it is not compatible
> > with the array-approach.
> >
> > I re-added the old function and call this after the default routing table
> > was applied. This default routing table can still be used as the only
> > connection handled by mmsys on BPI-R2 is OVL0->RDMA0 and this is already
> > present in the default routing table
> >
> > Fixes: 440147639ac7 ("soc: mediatek: mmsys: Use an array for setting the routing registers")
> > Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
> > ---
> >   drivers/soc/mediatek/mtk-mmsys.c | 21 +++++++++++++++++++++
> >   1 file changed, 21 insertions(+)
> >
> > diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c
> > index 080660ef11bf..f91b7fdd417a 100644
> > --- a/drivers/soc/mediatek/mtk-mmsys.c
> > +++ b/drivers/soc/mediatek/mtk-mmsys.c
> > @@ -57,6 +57,25 @@ struct mtk_mmsys {
> >   	const struct mtk_mmsys_driver_data *data;
> >   };
> >
> > +static void mtk_mmsys_ddp_sout_sel(struct device *dev,
> > +				   enum mtk_ddp_comp_id cur,
> > +				   enum mtk_ddp_comp_id next)
> > +{
> > +	struct mtk_mmsys *mmsys = dev_get_drvdata(dev);
> > +
> > +	if (cur == DDP_COMPONENT_BLS && next == DDP_COMPONENT_DSI0) {
> > +		writel_relaxed(BLS_TO_DSI_RDMA1_TO_DPI1,
> > +			       mmsys->regs + DISP_REG_CONFIG_OUT_SEL);
> > +	} else if (cur == DDP_COMPONENT_BLS && next == DDP_COMPONENT_DPI0) {
> > +		writel_relaxed(BLS_TO_DPI_RDMA1_TO_DSI,
> > +			       mmsys->regs + DISP_REG_CONFIG_OUT_SEL);
> > +		writel_relaxed(DSI_SEL_IN_RDMA,
> > +			       mmsys->regs + DISP_REG_CONFIG_DSI_SEL);
> > +		writel_relaxed(DPI_SEL_IN_BLS,
> > +			       mmsys->regs + DISP_REG_CONFIG_DPI_SEL);
>
> you can still use the array approach for this like that:
>
>          {
>                  DDP_COMPONENT_BLS, DDP_COMPONENT_DSI0,
>                  DISP_REG_CONFIG_OUT_SEL, BLS_TO_DSI_RDMA1_TO_DPI1
>          }, {
>          {
>                  DDP_COMPONENT_BLS, DDP_COMPONENT_DPI0,
>                  DISP_REG_CONFIG_OUT_SEL, BLS_TO_DPI_RDMA1_TO_DSI
>          }, {
>          {
>                  DDP_COMPONENT_BLS, DDP_COMPONENT_DPI0,
>                  DISP_REG_CONFIG_DSI_SEL, DSI_SEL_IN_RDMA
>          }, {
>          {
>                  DDP_COMPONENT_BLS, DDP_COMPONENT_DPI0,
>                  DISP_REG_CONFIG_DPI_SEL, DPI_SEL_IN_BLS
>          }, {
>
>
> Thanks,
> Dafna

these 4 blocks are already there (except your additional brackets) and it does not work with them (not added in 5.14)

 91 static const struct mtk_mmsys_routes mmsys_default_routing_table[] = {
 92     {
 93         DDP_COMPONENT_BLS, DDP_COMPONENT_DSI0,
 94         DISP_REG_CONFIG_OUT_SEL, BLS_TO_DSI_RDMA1_TO_DPI1 //(1)
 95     }, {
 96         DDP_COMPONENT_BLS, DDP_COMPONENT_DSI0,
 97         DISP_REG_CONFIG_DSI_SEL, DSI_SEL_IN_BLS
 98     }, {
 99         DDP_COMPONENT_BLS, DDP_COMPONENT_DPI0,
100         DISP_REG_CONFIG_OUT_SEL, BLS_TO_DPI_RDMA1_TO_DSI //(2)
101     }, {
102         DDP_COMPONENT_BLS, DDP_COMPONENT_DPI0,
103         DISP_REG_CONFIG_DSI_SEL, DSI_SEL_IN_RDMA //(3)
104     }, {
105         DDP_COMPONENT_BLS, DDP_COMPONENT_DPI0,
106         DISP_REG_CONFIG_DPI_SEL, DPI_SEL_IN_BLS //(4)
107     }, {

and code should apply all matching parts (2-4 for BLS=>dpi), but it does not work...maybe because new code reads and OR the new value instead of writing it (old code overwrites current register value with the new value without reading)

 69     for (i = 0; i < mmsys->data->num_routes; i++)
 70         if (cur == routes[i].from_comp && next == routes[i].to_comp) {
 71             reg = readl_relaxed(mmsys->regs + routes[i].addr) | routes[i].val; //<<<<<<<<<<<
 72             writel_relaxed(reg, mmsys->regs + routes[i].addr);
 73         }


regards Frank

  reply	other threads:[~2021-07-12 12:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-10 13:24 Frank Wunderlich
2021-07-12 11:50 ` Dafna Hirschfeld
2021-07-12 12:35   ` Frank Wunderlich [this message]
2021-07-12 17:16   ` Aw: " Frank Wunderlich
2021-07-12 17:32     ` Dafna Hirschfeld
2021-07-24 17:06       ` Frank Wunderlich
2021-07-26  0:27         ` Chun-Kuang Hu
2021-07-26 10:33           ` Aw: " 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=trinity-f4eef0e6-9873-4fbe-8c17-19cab347b1ab-1626093310010@3c-app-gmx-bs28 \
    --to=frank-w@public-files.de \
    --cc=airlied@linux.ie \
    --cc=ck.hu@mediatek.com \
    --cc=dafna.hirschfeld@collabora.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eballetbo@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux@fw-web.de \
    --cc=matthias.bgg@gmail.com \
    --subject='Aw: Re: [PATCH] soc: mediatek: mmsys: fix HDMI output on mt7623/bananapi-r2' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).