From: Linus Walleij <linus.walleij@linaro.org>
To: Nicolas Boichat <drinkcat@chromium.org>
Cc: Andrzej Hajda <a.hajda@samsung.com>,
Robert Foss <robert.foss@linaro.org>,
Chun-Kuang Hu <chunkuang.hu@kernel.org>,
Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@linux.ie>,
Emil Velikov <emil.velikov@collabora.com>,
Inki Dae <inki.dae@samsung.com>,
Jernej Skrabec <jernej.skrabec@siol.net>,
Jonas Karlman <jonas@kwiboo.se>,
Joonyoung Shim <jy0922.shim@samsung.com>,
Jordan Crouse <jcrouse@codeaurora.org>,
Krzysztof Kozlowski <krzk@kernel.org>,
Kyungmin Park <kyungmin.park@samsung.com>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
Maxime Ripard <mripard@kernel.org>,
Neil Armstrong <narmstrong@baylibre.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
Rajendra Nayak <rnayak@codeaurora.org>,
Rikard Falkeborn <rikard.falkeborn@gmail.com>,
Rob Clark <robdclark@gmail.com>, Sam Ravnborg <sam@ravnborg.org>,
Sean Paul <sean@poorly.run>,
Seung-Woo Kim <sw0312.kim@samsung.com>,
Thierry Reding <thierry.reding@gmail.com>,
Thomas Zimmermann <tzimmermann@suse.de>,
Viresh Kumar <viresh.kumar@linaro.org>,
Xin Ji <xji@analogixsemi.com>,
"open list:DRM PANEL DRIVERS" <dri-devel@lists.freedesktop.org>,
freedreno <freedreno@lists.freedesktop.org>,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
MSM <linux-arm-msm@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"moderated list:ARM/Mediatek SoC support"
<linux-mediatek@lists.infradead.org>,
linux-samsung-soc <linux-samsung-soc@vger.kernel.org>
Subject: Re: [PATCH] drm/dsi: Add _NO_ to MIPI_DSI_* flags disabling features
Date: Mon, 1 Mar 2021 09:59:35 +0100 [thread overview]
Message-ID: <CACRpkdbQa3BZwgtp3=061cu+y+4qkMqtXQhXH_VuHB3KcLyDCA@mail.gmail.com> (raw)
In-Reply-To: <20210211113309.1.I629b2366a6591410359c7fcf6d385b474b705ca2@changeid>
On Thu, Feb 11, 2021 at 4:34 AM Nicolas Boichat <drinkcat@chromium.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
next prev parent reply other threads:[~2021-03-01 9:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-11 3:33 [PATCH] drm/dsi: Add _NO_ to MIPI_DSI_* flags disabling features Nicolas Boichat
2021-02-12 9:04 ` Robert Foss
2021-02-16 6:31 ` Chun-Kuang Hu
2021-02-18 6:14 ` Xin Ji
2021-02-18 19:35 ` [Freedreno] " abhinavk
2021-02-21 19:08 ` Laurent Pinchart
2021-02-22 5:31 ` Nicolas Boichat
2021-02-22 7:20 ` Andrzej Hajda
2021-02-22 11:00 ` Nicolas Boichat
2021-03-01 8:59 ` Linus Walleij [this message]
2021-03-03 10:31 ` Nicolas Boichat
2021-06-28 11:10 ` Linus Walleij
2021-06-28 23:44 ` Nicolas Boichat
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='CACRpkdbQa3BZwgtp3=061cu+y+4qkMqtXQhXH_VuHB3KcLyDCA@mail.gmail.com' \
--to=linus.walleij@linaro.org \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=a.hajda@samsung.com \
--cc=airlied@linux.ie \
--cc=chunkuang.hu@kernel.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=drinkcat@chromium.org \
--cc=emil.velikov@collabora.com \
--cc=freedreno@lists.freedesktop.org \
--cc=inki.dae@samsung.com \
--cc=jcrouse@codeaurora.org \
--cc=jernej.skrabec@siol.net \
--cc=jonas@kwiboo.se \
--cc=jy0922.shim@samsung.com \
--cc=krzk@kernel.org \
--cc=kyungmin.park@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=matthias.bgg@gmail.com \
--cc=mripard@kernel.org \
--cc=narmstrong@baylibre.com \
--cc=p.zabel@pengutronix.de \
--cc=rikard.falkeborn@gmail.com \
--cc=rnayak@codeaurora.org \
--cc=robdclark@gmail.com \
--cc=robert.foss@linaro.org \
--cc=sam@ravnborg.org \
--cc=sean@poorly.run \
--cc=sw0312.kim@samsung.com \
--cc=thierry.reding@gmail.com \
--cc=tzimmermann@suse.de \
--cc=viresh.kumar@linaro.org \
--cc=xji@analogixsemi.com \
/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 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).