mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dominik Haller <D.Haller@phytec.de>
To: "Laurent.pinchart@ideasonboard.com"
	<Laurent.pinchart@ideasonboard.com>,
	"andrzej.hajda@intel.com" <andrzej.hajda@intel.com>,
	"neil.armstrong@linaro.org" <neil.armstrong@linaro.org>,
	"tzimmermann@suse.de" <tzimmermann@suse.de>,
	"tomi.valkeinen@ideasonboard.com"
	<tomi.valkeinen@ideasonboard.com>,
	"jyri.sarha@iki.fi" <jyri.sarha@iki.fi>,
	"rfoss@kernel.org" <rfoss@kernel.org>,
	"airlied@gmail.com" <airlied@gmail.com>,
	"a-bhatia1@ti.com" <a-bhatia1@ti.com>,
	"jonas@kwiboo.se" <jonas@kwiboo.se>,
	"jernej.skrabec@gmail.com" <jernej.skrabec@gmail.com>,
	"mripard@kernel.org" <mripard@kernel.org>,
	"maarten.lankhorst@linux.intel.com"
	<maarten.lankhorst@linux.intel.com>,
	"daniel@ffwll.ch" <daniel@ffwll.ch>
Cc: "devarsht@ti.com" <devarsht@ti.com>,
	"u-kumar1@ti.com" <u-kumar1@ti.com>,
	"sam@ravnborg.org" <sam@ravnborg.org>,
	"j-choudhary@ti.com" <j-choudhary@ti.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"j-luthra@ti.com" <j-luthra@ti.com>,
	"boris.brezillon@bootlin.com" <boris.brezillon@bootlin.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"nm@ti.com" <nm@ti.com>, "vigneshr@ti.com" <vigneshr@ti.com>,
	"kieran.bingham+renesas@ideasonboard.com"
	<kieran.bingham+renesas@ideasonboard.com>,
	"treding@nvidia.com" <treding@nvidia.com>,
	"praneeth@ti.com" <praneeth@ti.com>
Subject: Re: [EXTERNAL] [PATCH 3/7] drm/bridge: cdns-dsi: Wait for Clk and Data Lanes to be ready
Date: Wed, 22 May 2024 10:23:37 +0000	[thread overview]
Message-ID: <f45daf0d6c0ab8a225277621b6e6b373929d145a.camel@phytec.de> (raw)
In-Reply-To: <20240511153051.1355825-4-a-bhatia1@ti.com>

Hi Aradhya,

this fixes the color-shift bug on our setup:
j721s2 -> ti,sn65dsi83 -> edt,etml1010g3dra



Tested-by: Dominik Haller <d.haller@phytec.de>


On Sat, 2024-05-11 at 21:00 +0530, Aradhya Bhatia wrote:
> Once the DSI Link and DSI Phy are initialized, the code needs to wait
> for Clk and Data Lanes to be ready, before continuing configuration.
> This is in accordance with the DSI Start-up procedure, found in the
> Technical Reference Manual of Texas Instrument's J721E SoC[0] which
> houses this DSI TX controller.
> 
> If the previous bridge (or crtc/encoder) are configured pre-maturely,
> the input signal FIFO gets corrupt. This introduces a color-shift on
> the
> display.
> 
> Allow the driver to wait for the clk and data lanes to get ready
> during
> DSI enable.
> 
> Fixes: e19233955d9e ("drm/bridge: Add Cadence DSI driver")
> Signed-off-by: Aradhya Bhatia <a-bhatia1@ti.com>
> ---
>  drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c
> b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c
> index 557b037bbc67..05d2f4cc50da 100644
> --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c
> +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c
> @@ -761,7 +761,7 @@ static void cdns_dsi_bridge_enable(struct
> drm_bridge *bridge)
>  	struct phy_configure_opts_mipi_dphy *phy_cfg = &output-
> >phy_opts.mipi_dphy;
>  	unsigned long tx_byte_period;
>  	struct cdns_dsi_cfg dsi_cfg;
> -	u32 tmp, reg_wakeup, div;
> +	u32 tmp, reg_wakeup, div, status;
>  	int nlanes;
>  
>  	if (WARN_ON(pm_runtime_get_sync(dsi->base.dev) < 0))
> @@ -778,6 +778,17 @@ static void cdns_dsi_bridge_enable(struct
> drm_bridge *bridge)
>  	cdns_dsi_init_link(dsi);
>  	cdns_dsi_hs_init(dsi);
>  
> +	/*
> +	 * Now that the DSI Link and DSI Phy are initialized,
> +	 * wait for the CLK and Data Lanes to be ready.
> +	 */
> +	tmp = CLK_LANE_RDY;
> +	for (int i = 0; i < nlanes; i++)
> +		tmp |= DATA_LANE_RDY(i);
> +
> +	WARN_ON_ONCE(readl_poll_timeout(dsi->regs + MCTL_MAIN_STS,
> status,
> +					status & tmp, 100, 0));
> +
>  	writel(HBP_LEN(dsi_cfg.hbp) | HSA_LEN(dsi_cfg.hsa),
>  	       dsi->regs + VID_HSIZE1);
>  	writel(HFP_LEN(dsi_cfg.hfp) | HACT_LEN(dsi_cfg.hact),

  reply	other threads:[~2024-05-22 10:38 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-11 15:30 [PATCH 0/7] drm/bridge: cdns-dsi: Fix the color-shift issue Aradhya Bhatia
2024-05-11 15:30 ` [PATCH 1/7] drm/tidss: Add CRTC mode_fixup Aradhya Bhatia
2024-05-16  8:10   ` Maxime Ripard
2024-05-16 11:03     ` Aradhya Bhatia
2024-05-21 13:18       ` Maxime Ripard
2024-05-30  9:39         ` Aradhya Bhatia
2024-05-11 15:30 ` [PATCH 2/7] drm/bridge: cdns-dsi: Fix minor bugs Aradhya Bhatia
2024-05-16  8:11   ` Maxime Ripard
2024-05-16  9:41     ` Aradhya Bhatia
2024-05-11 15:30 ` [PATCH 3/7] drm/bridge: cdns-dsi: Wait for Clk and Data Lanes to be ready Aradhya Bhatia
2024-05-22 10:23   ` Dominik Haller [this message]
2024-05-11 15:30 ` [PATCH 4/7] drm/bridge: cdns-dsi: Reset the DCS write FIFO Aradhya Bhatia
2024-05-11 15:30 ` [PATCH 5/7] drm/bridge: cdns-dsi: Support atomic bridge APIs Aradhya Bhatia
2024-05-21 20:20   ` Markus Elfring
2024-05-11 15:30 ` [PATCH 6/7] drm/bridge: Introduce early_enable and late disable Aradhya Bhatia
2024-05-16  8:22   ` Maxime Ripard
2024-05-16  9:40     ` Aradhya Bhatia
2024-05-21 13:15       ` Maxime Ripard
2024-05-24 11:08         ` Aradhya Bhatia
2024-05-28 11:43           ` Maxime Ripard
2024-05-30  9:43             ` Aradhya Bhatia
2024-05-11 15:30 ` [PATCH 7/7] drm/bridge: cdns-dsi: Implement early_enable and late_disable Aradhya Bhatia

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=f45daf0d6c0ab8a225277621b6e6b373929d145a.camel@phytec.de \
    --to=d.haller@phytec.de \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=a-bhatia1@ti.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=boris.brezillon@bootlin.com \
    --cc=daniel@ffwll.ch \
    --cc=devarsht@ti.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=j-choudhary@ti.com \
    --cc=j-luthra@ti.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=jyri.sarha@iki.fi \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=nm@ti.com \
    --cc=praneeth@ti.com \
    --cc=rfoss@kernel.org \
    --cc=sam@ravnborg.org \
    --cc=tomi.valkeinen@ideasonboard.com \
    --cc=treding@nvidia.com \
    --cc=tzimmermann@suse.de \
    --cc=u-kumar1@ti.com \
    --cc=vigneshr@ti.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

all inboxes | Powered by JetHome®