From: Maxim Schwalm <maxim.schwalm@gmail.com>
To: "Tomi Valkeinen" <tomi.valkeinen@ideasonboard.com>,
"Andrzej Hajda" <andrzej.hajda@intel.com>,
"Neil Armstrong" <neil.armstrong@linaro.org>,
"Robert Foss" <rfoss@kernel.org>,
"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
"Jonas Karlman" <jonas@kwiboo.se>,
"Jernej Skrabec" <jernej.skrabec@gmail.com>,
"David Airlie" <airlied@gmail.com>,
"Daniel Vetter" <daniel@ffwll.ch>,
"Péter Ujfalusi" <peter.ujfalusi@gmail.com>,
"Francesco Dolcini" <francesco@dolcini.it>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Aradhya Bhatia <a-bhatia1@ti.com>
Subject: Re: [PATCH v2 03/12] drm/bridge: tc358768: Fix bit updates
Date: Tue, 22 Aug 2023 00:22:10 +0200 [thread overview]
Message-ID: <e151e29e-7dc7-e237-aeed-4005911d9583@gmail.com> (raw)
In-Reply-To: <20230816-tc358768-v2-3-242b9d5f703a@ideasonboard.com>
Hi Tomi,
On 16.08.23 13:25, Tomi Valkeinen wrote:
> The driver has a few places where it does:
>
> if (thing_is_enabled_in_config)
> update_thing_bit_in_hw()
>
> This means that if the thing is _not_ enabled, the bit never gets
> cleared. This affects the h/vsyncs and continuous DSI clock bits.
>
> Fix the driver to always update the bit.
>
> Fixes: ff1ca6397b1d ("drm/bridge: Add tc358768 driver")
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> ---
> drivers/gpu/drm/bridge/tc358768.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/tc358768.c b/drivers/gpu/drm/bridge/tc358768.c
> index bc97a837955b..b668f77673c3 100644
> --- a/drivers/gpu/drm/bridge/tc358768.c
> +++ b/drivers/gpu/drm/bridge/tc358768.c
> @@ -794,8 +794,8 @@ static void tc358768_bridge_pre_enable(struct drm_bridge *bridge)
> val |= BIT(i + 1);
> tc358768_write(priv, TC358768_HSTXVREGEN, val);
>
> - if (!(mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS))
> - tc358768_write(priv, TC358768_TXOPTIONCNTRL, 0x1);
> + tc358768_write(priv, TC358768_TXOPTIONCNTRL,
> + (mode_flags & MIPI_DSI_CLOCK_NON_CONTINUOUS) ? 0 : BIT(0));
>
> /* TXTAGOCNT[26:16] RXTASURECNT[10:0] */
> val = tc358768_to_ns((lptxcnt + 1) * dsibclk_nsk * 4);
> @@ -861,11 +861,12 @@ static void tc358768_bridge_pre_enable(struct drm_bridge *bridge)
> tc358768_write(priv, TC358768_DSI_HACT, hact);
>
> /* VSYNC polarity */
> - if (!(mode->flags & DRM_MODE_FLAG_NVSYNC))
> - tc358768_update_bits(priv, TC358768_CONFCTL, BIT(5), BIT(5));
> + tc358768_update_bits(priv, TC358768_CONFCTL, BIT(5),
> + (mode->flags & DRM_MODE_FLAG_PVSYNC) ? BIT(5) : 0);
> +
> /* HSYNC polarity */
> - if (mode->flags & DRM_MODE_FLAG_PHSYNC)
> - tc358768_update_bits(priv, TC358768_PP_MISC, BIT(0), BIT(0));
> + tc358768_update_bits(priv, TC358768_PP_MISC, BIT(0),
> + (mode->flags & DRM_MODE_FLAG_PHSYNC) ? BIT(0) : 0);
>
> /* Start DSI Tx */
> tc358768_write(priv, TC358768_DSI_START, 0x1);
>
shouldn't the last patch of this series be moved before this one?
Currently, this patch will still lead to a temporary regression until
patch #12 is applied.
Best regards,
Maxim
next prev parent reply other threads:[~2023-08-21 22:22 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-16 11:25 [PATCH v2 00/12] drm/bridge: tc358768: Fixes and timings improvements Tomi Valkeinen
2023-08-16 11:25 ` [PATCH v2 01/12] drm/tegra: rgb: Parameterize V- and H-sync polarities Tomi Valkeinen
2023-08-16 11:25 ` [PATCH v2 02/12] drm/bridge: tc358768: Fix use of uninitialized variable Tomi Valkeinen
2023-08-16 11:25 ` [PATCH v2 03/12] drm/bridge: tc358768: Fix bit updates Tomi Valkeinen
2023-08-21 22:22 ` Maxim Schwalm [this message]
2023-08-22 16:13 ` Tomi Valkeinen
2023-08-16 11:25 ` [PATCH v2 04/12] drm/bridge: tc358768: Cleanup PLL calculations Tomi Valkeinen
2023-08-16 11:25 ` [PATCH v2 05/12] drm/bridge: tc358768: Use struct videomode Tomi Valkeinen
2023-08-16 11:25 ` [PATCH v2 06/12] drm/bridge: tc358768: Print logical values, not raw register values Tomi Valkeinen
2023-08-16 11:25 ` [PATCH v2 07/12] drm/bridge: tc358768: Use dev for dbg prints, not priv->dev Tomi Valkeinen
2023-08-16 11:25 ` [PATCH v2 08/12] drm/bridge: tc358768: Rename dsibclk to hsbyteclk Tomi Valkeinen
2023-08-16 11:25 ` [PATCH v2 09/12] drm/bridge: tc358768: Clean up clock period code Tomi Valkeinen
2023-08-16 11:25 ` [PATCH v2 10/12] drm/bridge: tc358768: Fix tc358768_ns_to_cnt() Tomi Valkeinen
2023-08-16 11:25 ` [PATCH v2 11/12] drm/bridge: tc358768: Attempt to fix DSI horizontal timings Tomi Valkeinen
2023-08-16 11:25 ` [PATCH v2 12/12] drm/bridge: tc358768: Default to positive h/v syncs Tomi Valkeinen
2023-08-16 16:59 ` [PATCH v2 00/12] drm/bridge: tc358768: Fixes and timings improvements Tomi Valkeinen
2023-08-21 19:46 ` Péter Ujfalusi
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=e151e29e-7dc7-e237-aeed-4005911d9583@gmail.com \
--to=maxim.schwalm@gmail.com \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=a-bhatia1@ti.com \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=francesco@dolcini.it \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=linux-kernel@vger.kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=peter.ujfalusi@gmail.com \
--cc=rfoss@kernel.org \
--cc=tomi.valkeinen@ideasonboard.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