[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdbQa3BZwgtp3=061cu+y+4qkMqtXQhXH_VuHB3KcLyDCA@mail.gmail.com>
Date: Mon, 1 Mar 2021 09:59:35 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Nicolas Boichat <drinkcat@...omium.org>
Cc: Andrzej Hajda <a.hajda@...sung.com>,
Robert Foss <robert.foss@...aro.org>,
Chun-Kuang Hu <chunkuang.hu@...nel.org>,
Daniel Vetter <daniel@...ll.ch>,
David Airlie <airlied@...ux.ie>,
Emil Velikov <emil.velikov@...labora.com>,
Inki Dae <inki.dae@...sung.com>,
Jernej Skrabec <jernej.skrabec@...l.net>,
Jonas Karlman <jonas@...boo.se>,
Joonyoung Shim <jy0922.shim@...sung.com>,
Jordan Crouse <jcrouse@...eaurora.org>,
Krzysztof Kozlowski <krzk@...nel.org>,
Kyungmin Park <kyungmin.park@...sung.com>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Matthias Brugger <matthias.bgg@...il.com>,
Maxime Ripard <mripard@...nel.org>,
Neil Armstrong <narmstrong@...libre.com>,
Philipp Zabel <p.zabel@...gutronix.de>,
Rajendra Nayak <rnayak@...eaurora.org>,
Rikard Falkeborn <rikard.falkeborn@...il.com>,
Rob Clark <robdclark@...il.com>,
Sam Ravnborg <sam@...nborg.org>, Sean Paul <sean@...rly.run>,
Seung-Woo Kim <sw0312.kim@...sung.com>,
Thierry Reding <thierry.reding@...il.com>,
Thomas Zimmermann <tzimmermann@...e.de>,
Viresh Kumar <viresh.kumar@...aro.org>,
Xin Ji <xji@...logixsemi.com>,
"open list:DRM PANEL DRIVERS" <dri-devel@...ts.freedesktop.org>,
freedreno <freedreno@...ts.freedesktop.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
MSM <linux-arm-msm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@...ts.infradead.org>,
linux-samsung-soc <linux-samsung-soc@...r.kernel.org>
Subject: Re: [PATCH] drm/dsi: Add _NO_ to MIPI_DSI_* flags disabling features
On Thu, Feb 11, 2021 at 4:34 AM Nicolas Boichat <drinkcat@...omium.org> wrote:
> Many of the DSI flags have names opposite to their actual effects,
> e.g. MIPI_DSI_MODE_EOT_PACKET means that EoT packets will actually
> be disabled. Fix this by including _NO_ in the flag names, e.g.
> MIPI_DSI_MODE_NO_EOT_PACKET.
Unless someone like me interpreted it literally...
Like in these:
> drivers/gpu/drm/mcde/mcde_dsi.c | 2 +-
> drivers/gpu/drm/panel/panel-novatek-nt35510.c | 2 +-
> drivers/gpu/drm/panel/panel-samsung-s6d16d0.c | 2 +-
> drivers/gpu/drm/panel/panel-sony-acx424akp.c | 2 +-
> diff --git a/drivers/gpu/drm/mcde/mcde_dsi.c b/drivers/gpu/drm/mcde/mcde_dsi.c
> index 2314c8122992..f4cdc3cfd7d0 100644
> --- a/drivers/gpu/drm/mcde/mcde_dsi.c
> +++ b/drivers/gpu/drm/mcde/mcde_dsi.c
> @@ -760,7 +760,7 @@ static void mcde_dsi_start(struct mcde_dsi *d)
> DSI_MCTL_MAIN_DATA_CTL_BTA_EN |
> DSI_MCTL_MAIN_DATA_CTL_READ_EN |
> DSI_MCTL_MAIN_DATA_CTL_REG_TE_EN;
> - if (d->mdsi->mode_flags & MIPI_DSI_MODE_EOT_PACKET)
> + if (d->mdsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET)
> val |= DSI_MCTL_MAIN_DATA_CTL_HOST_EOT_GEN;
If you read the code you can see that this is interpreted as inserting
an EOT packet, so here you need to change the logic such:
if (!d->mdsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET)
val |= DSI_MCTL_MAIN_DATA_CTL_HOST_EOT_GEN;
This will make sure the host generates the EOT packet in HS mode
*unless* the flag is set.
(I checked the data sheet.)
> diff --git a/drivers/gpu/drm/panel/panel-novatek-nt35510.c b/drivers/gpu/drm/panel/panel-novatek-nt35510.c
> index b9a0e56f33e2..9d9334656803 100644
> --- a/drivers/gpu/drm/panel/panel-novatek-nt35510.c
> +++ b/drivers/gpu/drm/panel/panel-novatek-nt35510.c
> @@ -899,7 +899,7 @@ static int nt35510_probe(struct mipi_dsi_device *dsi)
> dsi->hs_rate = 349440000;
> dsi->lp_rate = 9600000;
> dsi->mode_flags = MIPI_DSI_CLOCK_NON_CONTINUOUS |
> - MIPI_DSI_MODE_EOT_PACKET;
> + MIPI_DSI_MODE_NO_EOT_PACKET;
Here you should just delete the MIPI_DSI_MODE_EOT_PACKET
flag because this was used with the MCDE driver which interpret the
flag literally.
> diff --git a/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c b/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c
> index 4aac0d1573dd..b04b9975e9b2 100644
> --- a/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c
> +++ b/drivers/gpu/drm/panel/panel-samsung-s6d16d0.c
> @@ -186,7 +186,7 @@ static int s6d16d0_probe(struct mipi_dsi_device *dsi)
> */
> dsi->mode_flags =
> MIPI_DSI_CLOCK_NON_CONTINUOUS |
> - MIPI_DSI_MODE_EOT_PACKET;
> + MIPI_DSI_MODE_NO_EOT_PACKET;
Same, just delete the flag.
> --- a/drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c
> +++ b/drivers/gpu/drm/panel/panel-samsung-s6e63m0-dsi.c
> @@ -97,7 +97,7 @@ static int s6e63m0_dsi_probe(struct mipi_dsi_device *dsi)
> dsi->hs_rate = 349440000;
> dsi->lp_rate = 9600000;
> dsi->mode_flags = MIPI_DSI_MODE_VIDEO |
> - MIPI_DSI_MODE_EOT_PACKET |
> + MIPI_DSI_MODE_NO_EOT_PACKET |
> MIPI_DSI_MODE_VIDEO_BURST;
Same, just delete the flag.
> diff --git a/drivers/gpu/drm/panel/panel-sony-acx424akp.c b/drivers/gpu/drm/panel/panel-sony-acx424akp.c
> index 065efae213f5..6b706cbf2f9c 100644
> --- a/drivers/gpu/drm/panel/panel-sony-acx424akp.c
> +++ b/drivers/gpu/drm/panel/panel-sony-acx424akp.c
> @@ -450,7 +450,7 @@ static int acx424akp_probe(struct mipi_dsi_device *dsi)
> else
> dsi->mode_flags =
> MIPI_DSI_CLOCK_NON_CONTINUOUS |
> - MIPI_DSI_MODE_EOT_PACKET;
> + MIPI_DSI_MODE_NO_EOT_PACKET;
Same, just delete the flag.
These are all just semantic bugs due to the ambiguity of the flags, it is
possible to provide a Fixes: flag for each file using this flag the wrong way
but I dunno if it's worth it.
Yours,
Linus Walleij
Powered by blists - more mailing lists