All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Reichel <sre@kernel.org>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Nikhil Devshatwar <nikhil.nd@ti.com>,
	dri-devel@lists.freedesktop.org, linux-omap@vger.kernel.org,
	Sekhar Nori <nsekhar@ti.com>, Tony Lindgren <tony@atomide.com>,
	hns@goldelico.com, Sam Ravnborg <sam@ravnborg.org>
Subject: Re: [PATCH v5 06/29] drm/omap: dsi: send nop instead of page & column
Date: Mon, 14 Dec 2020 15:22:08 +0100	[thread overview]
Message-ID: <20201214142208.2x4yk6ucnhztqted@earth.universe> (raw)
In-Reply-To: <20201208122855.254819-7-tomi.valkeinen@ti.com>

[-- Attachment #1: Type: text/plain, Size: 3901 bytes --]

Hi,

On Tue, Dec 08, 2020 at 02:28:32PM +0200, Tomi Valkeinen wrote:
> The OMAP DSI command mode panel driver used to send page & column
> address before each frame update, and this code was moved into the DSI
> host driver when converting it to the DRM bridge model.
> 
> However, it's not really required to send the page & column address
> before each frame. It's also something that doesn't really belong to the
> DSI host driver, so we should drop the code.
> 
> That said, frame updates break if we don't send _something_ between the
> frames. A NOP command does the trick.
> 
> It is not clear if this behavior is as expected from a DSI command mode
> frame transfer, or is it a feature/issue with OMAP DSI driver, or a
> feature/issue in the command mode panel used.
> 
> Most likely this is related to the following from the DSI spec:
> 
> "To enable PHY synchronization the host processor should periodically
> end HS transmission and drive the Data Lanes to the LP state. This
> transition should take place at least once per frame."
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---

Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>

-- Sebastian

>  drivers/gpu/drm/omapdrm/dss/dsi.c | 46 ++++++++++++-------------------
>  1 file changed, 17 insertions(+), 29 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
> index 7fee9cf8782d..c6e044f8bece 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -3884,35 +3884,19 @@ static int _dsi_update(struct dsi_data *dsi)
>  	return 0;
>  }
>  
> -static int _dsi_update_window(struct dsi_data *dsi, int channel,
> -			      int x, int y, int w, int h)
> -{
> -	int x1 = x, x2 = (x + w - 1);
> -	int y1 = y, y2 = (y + h - 1);
> -	u8 payloadX[5] = { MIPI_DCS_SET_COLUMN_ADDRESS,
> -			   x1 >> 8, x1 & 0xff, x2 >> 8, x2 & 0xff };
> -	u8 payloadY[5] = { MIPI_DCS_SET_PAGE_ADDRESS,
> -			   y1 >> 8, y1 & 0xff, y2 >> 8, y2 & 0xff };
> -	struct mipi_dsi_msg msgX = { 0 }, msgY = { 0 };
> -	int ret;
> +static int _dsi_send_nop(struct dsi_data *dsi, int channel)
> +{
> +	const u8 payload[] = { MIPI_DCS_NOP };
> +	const struct mipi_dsi_msg msg = {
> +		.channel = channel,
> +		.type = MIPI_DSI_DCS_SHORT_WRITE,
> +		.tx_len = 1,
> +		.tx_buf = payload,
> +	};
>  
>  	WARN_ON(!dsi_bus_is_locked(dsi));
>  
> -	msgX.type = MIPI_DSI_DCS_LONG_WRITE;
> -	msgX.channel = channel;
> -	msgX.tx_buf = payloadX;
> -	msgX.tx_len = sizeof(payloadX);
> -
> -	msgY.type = MIPI_DSI_DCS_LONG_WRITE;
> -	msgY.channel = channel;
> -	msgY.tx_buf = payloadY;
> -	msgY.tx_len = sizeof(payloadY);
> -
> -	ret = _omap_dsi_host_transfer(dsi, &msgX);
> -	if (ret != 0)
> -		return ret;
> -
> -	return _omap_dsi_host_transfer(dsi, &msgY);
> +	return _omap_dsi_host_transfer(dsi, &msg);
>  }
>  
>  static int dsi_update_channel(struct omap_dss_device *dssdev, int channel)
> @@ -3944,10 +3928,14 @@ static int dsi_update_channel(struct omap_dss_device *dssdev, int channel)
>  
>  	dsi_set_ulps_auto(dsi, false);
>  
> -	r = _dsi_update_window(dsi, channel, 0, 0, dsi->vm.hactive,
> -			       dsi->vm.vactive);
> +	/*
> +	 * Send NOP between the frames. If we don't send something here, the
> +	 * updates stop working. This is probably related to DSI spec stating
> +	 * that the DSI host should transition to LP at least once per frame.
> +	 */
> +	r = _dsi_send_nop(dsi, channel);
>  	if (r < 0) {
> -		DSSWARN("window update error: %d\n", r);
> +		DSSWARN("failed to send nop between frames: %d\n", r);
>  		goto err;
>  	}
>  
> -- 
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Sebastian Reichel <sre@kernel.org>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Tony Lindgren <tony@atomide.com>,
	hns@goldelico.com, Sekhar Nori <nsekhar@ti.com>,
	dri-devel@lists.freedesktop.org,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	linux-omap@vger.kernel.org, Sam Ravnborg <sam@ravnborg.org>,
	Nikhil Devshatwar <nikhil.nd@ti.com>
Subject: Re: [PATCH v5 06/29] drm/omap: dsi: send nop instead of page & column
Date: Mon, 14 Dec 2020 15:22:08 +0100	[thread overview]
Message-ID: <20201214142208.2x4yk6ucnhztqted@earth.universe> (raw)
In-Reply-To: <20201208122855.254819-7-tomi.valkeinen@ti.com>


[-- Attachment #1.1: Type: text/plain, Size: 3901 bytes --]

Hi,

On Tue, Dec 08, 2020 at 02:28:32PM +0200, Tomi Valkeinen wrote:
> The OMAP DSI command mode panel driver used to send page & column
> address before each frame update, and this code was moved into the DSI
> host driver when converting it to the DRM bridge model.
> 
> However, it's not really required to send the page & column address
> before each frame. It's also something that doesn't really belong to the
> DSI host driver, so we should drop the code.
> 
> That said, frame updates break if we don't send _something_ between the
> frames. A NOP command does the trick.
> 
> It is not clear if this behavior is as expected from a DSI command mode
> frame transfer, or is it a feature/issue with OMAP DSI driver, or a
> feature/issue in the command mode panel used.
> 
> Most likely this is related to the following from the DSI spec:
> 
> "To enable PHY synchronization the host processor should periodically
> end HS transmission and drive the Data Lanes to the LP state. This
> transition should take place at least once per frame."
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---

Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>

-- Sebastian

>  drivers/gpu/drm/omapdrm/dss/dsi.c | 46 ++++++++++++-------------------
>  1 file changed, 17 insertions(+), 29 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
> index 7fee9cf8782d..c6e044f8bece 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dsi.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
> @@ -3884,35 +3884,19 @@ static int _dsi_update(struct dsi_data *dsi)
>  	return 0;
>  }
>  
> -static int _dsi_update_window(struct dsi_data *dsi, int channel,
> -			      int x, int y, int w, int h)
> -{
> -	int x1 = x, x2 = (x + w - 1);
> -	int y1 = y, y2 = (y + h - 1);
> -	u8 payloadX[5] = { MIPI_DCS_SET_COLUMN_ADDRESS,
> -			   x1 >> 8, x1 & 0xff, x2 >> 8, x2 & 0xff };
> -	u8 payloadY[5] = { MIPI_DCS_SET_PAGE_ADDRESS,
> -			   y1 >> 8, y1 & 0xff, y2 >> 8, y2 & 0xff };
> -	struct mipi_dsi_msg msgX = { 0 }, msgY = { 0 };
> -	int ret;
> +static int _dsi_send_nop(struct dsi_data *dsi, int channel)
> +{
> +	const u8 payload[] = { MIPI_DCS_NOP };
> +	const struct mipi_dsi_msg msg = {
> +		.channel = channel,
> +		.type = MIPI_DSI_DCS_SHORT_WRITE,
> +		.tx_len = 1,
> +		.tx_buf = payload,
> +	};
>  
>  	WARN_ON(!dsi_bus_is_locked(dsi));
>  
> -	msgX.type = MIPI_DSI_DCS_LONG_WRITE;
> -	msgX.channel = channel;
> -	msgX.tx_buf = payloadX;
> -	msgX.tx_len = sizeof(payloadX);
> -
> -	msgY.type = MIPI_DSI_DCS_LONG_WRITE;
> -	msgY.channel = channel;
> -	msgY.tx_buf = payloadY;
> -	msgY.tx_len = sizeof(payloadY);
> -
> -	ret = _omap_dsi_host_transfer(dsi, &msgX);
> -	if (ret != 0)
> -		return ret;
> -
> -	return _omap_dsi_host_transfer(dsi, &msgY);
> +	return _omap_dsi_host_transfer(dsi, &msg);
>  }
>  
>  static int dsi_update_channel(struct omap_dss_device *dssdev, int channel)
> @@ -3944,10 +3928,14 @@ static int dsi_update_channel(struct omap_dss_device *dssdev, int channel)
>  
>  	dsi_set_ulps_auto(dsi, false);
>  
> -	r = _dsi_update_window(dsi, channel, 0, 0, dsi->vm.hactive,
> -			       dsi->vm.vactive);
> +	/*
> +	 * Send NOP between the frames. If we don't send something here, the
> +	 * updates stop working. This is probably related to DSI spec stating
> +	 * that the DSI host should transition to LP at least once per frame.
> +	 */
> +	r = _dsi_send_nop(dsi, channel);
>  	if (r < 0) {
> -		DSSWARN("window update error: %d\n", r);
> +		DSSWARN("failed to send nop between frames: %d\n", r);
>  		goto err;
>  	}
>  
> -- 
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-12-14 14:27 UTC|newest]

Thread overview: 144+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-08 12:28 [PATCH v5 00/29] Convert DSI code to use drm_mipi_dsi and drm_panel (second half) Tomi Valkeinen
2020-12-08 12:28 ` Tomi Valkeinen
2020-12-08 12:28 ` [PATCH v5 01/29] drm/panel: panel-dsi-cm: cleanup tear enable Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-14 13:09   ` Sebastian Reichel
2020-12-14 13:09     ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 02/29] ARM: dts: omap5: add address-cells & size-cells to dsi Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-14 13:09   ` Sebastian Reichel
2020-12-14 13:09     ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 03/29] drm/omap: pll: fix iteration loop check Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-14 13:10   ` Sebastian Reichel
2020-12-14 13:10     ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 04/29] drm/omap: dsi: set trans_mode according to client mode_flags Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-14 13:10   ` Sebastian Reichel
2020-12-14 13:10     ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 05/29] drm/panel: panel-dsi-cm: set column & page at setup Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-14 13:10   ` Sebastian Reichel
2020-12-14 13:10     ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 06/29] drm/omap: dsi: send nop instead of page & column Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-14 14:22   ` Sebastian Reichel [this message]
2020-12-14 14:22     ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 07/29] drm/omap: dsi: simplify VC handling Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-14 14:31   ` Sebastian Reichel
2020-12-14 14:31     ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 08/29] drm/omap: dsi: drop useless channel checks Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-14 14:32   ` Sebastian Reichel
2020-12-14 14:32     ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 09/29] drm/omap: dsi: cleanup dispc channel usage Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-08 15:17   ` Laurent Pinchart
2020-12-08 15:17     ` Laurent Pinchart
2020-12-14 14:35   ` Sebastian Reichel
2020-12-14 14:35     ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 10/29] drm/omap: dsi: rename 'channel' to 'vc' Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-08 15:22   ` Laurent Pinchart
2020-12-08 15:22     ` Laurent Pinchart
2020-12-14 15:18   ` Sebastian Reichel
2020-12-14 15:18     ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 11/29] drm/omap: dsi: pass vc to various functions Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-08 15:38   ` Laurent Pinchart
2020-12-08 15:38     ` Laurent Pinchart
2020-12-08 15:45     ` Tomi Valkeinen
2020-12-08 15:45       ` Tomi Valkeinen
2020-12-14 15:37   ` Sebastian Reichel
2020-12-14 15:37     ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 12/29] drm/omap: dsi: untangle vc & channel Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-08 15:41   ` Laurent Pinchart
2020-12-08 15:41     ` Laurent Pinchart
2020-12-14 15:47     ` Sebastian Reichel
2020-12-14 15:47       ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 13/29] drm/omap: dsi: skip dsi_vc_enable_hs when already in correct mode Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-14 15:50   ` Sebastian Reichel
2020-12-14 15:50     ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 14/29] drm/omap: dsi: enable HS before sending the frame Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-08 15:42   ` Laurent Pinchart
2020-12-08 15:42     ` Laurent Pinchart
2020-12-14 15:51   ` Sebastian Reichel
2020-12-14 15:51     ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 15/29] drm/omap: dsi: use separate VCs for cmd and video Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-14 15:54   ` Sebastian Reichel
2020-12-14 15:54     ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 16/29] drm/panel: panel-dsi-cm: remove extra 'if' Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-08 15:42   ` Laurent Pinchart
2020-12-08 15:42     ` Laurent Pinchart
2020-12-14 15:55   ` Sebastian Reichel
2020-12-14 15:55     ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 17/29] drm/panel: panel-dsi-cm: add panel database to driver Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-14 16:04   ` Sebastian Reichel
2020-12-14 16:04     ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 18/29] drm/panel: panel-dsi-cm: drop unneeded includes Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-14 16:06   ` Sebastian Reichel
2020-12-14 16:06     ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 19/29] drm/omap: dsi: move structs & defines to dsi.h Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-14 16:14   ` Sebastian Reichel
2020-12-14 16:14     ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 20/29] drm/omap: dsi: move enable/disable to bridge enable/disable Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-14 16:16   ` Sebastian Reichel
2020-12-14 16:16     ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 21/29] drm/omap: dsi: display_enable cleanup Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-14 16:17   ` Sebastian Reichel
2020-12-14 16:17     ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 22/29] drm/omap: dsi: display_disable cleanup Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-14 16:20   ` Sebastian Reichel
2020-12-14 16:20     ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 23/29] drm/omap: dsi: rename dsi_display_* functions Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-14 16:22   ` Sebastian Reichel
2020-12-14 16:22     ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 24/29] drm/omap: dsi: cleanup initial vc setup Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-14 16:34   ` Sebastian Reichel
2020-12-14 16:34     ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 25/29] drm/omap: dsi: split video mode enable/disable into separate func Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-14 16:38   ` Sebastian Reichel
2020-12-14 16:38     ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 26/29] drm/omap: dsi: fix and cleanup ddr_clk_always_on Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-14 16:39   ` Sebastian Reichel
2020-12-14 16:39     ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 27/29] drm/omap: dsi: remove ulps support Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-14 17:39   ` Sebastian Reichel
2020-12-14 17:39     ` Sebastian Reichel
2020-12-14 18:55     ` Tomi Valkeinen
2020-12-14 18:55       ` Tomi Valkeinen
2020-12-14 22:08       ` Sebastian Reichel
2020-12-14 22:08         ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 28/29] drm/omap: dsi: fix DCS_CMD_ENABLE Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-14 16:48   ` Sebastian Reichel
2020-12-14 16:48     ` Sebastian Reichel
2020-12-08 12:28 ` [PATCH v5 29/29] drm/omap: dsi: allow DSI commands to be sent early Tomi Valkeinen
2020-12-08 12:28   ` Tomi Valkeinen
2020-12-08 15:48   ` Laurent Pinchart
2020-12-08 15:48     ` Laurent Pinchart
2020-12-10  7:34     ` Tomi Valkeinen
2020-12-10  7:34       ` Tomi Valkeinen
2020-12-10  8:17       ` Tomi Valkeinen
2020-12-10  8:17         ` Tomi Valkeinen
2020-12-14 17:17   ` Sebastian Reichel
2020-12-14 17:17     ` Sebastian Reichel
2020-12-15 10:05     ` Tomi Valkeinen
2020-12-15 10:05       ` Tomi Valkeinen

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=20201214142208.2x4yk6ucnhztqted@earth.universe \
    --to=sre@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hns@goldelico.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=nikhil.nd@ti.com \
    --cc=nsekhar@ti.com \
    --cc=sam@ravnborg.org \
    --cc=tomi.valkeinen@ti.com \
    --cc=tony@atomide.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.