dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Dave Stevenson <dave.stevenson@raspberrypi.com>
Cc: Marek Vasut <marex@denx.de>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Neil Armstrong <narmstrong@baylibre.com>,
	David Airlie <airlied@linux.ie>,
	Robert Foss <robert.foss@linaro.org>,
	Jonas Karlman <jonas@kwiboo.se>,
	Douglas Anderson <dianders@chromium.org>,
	dri-devel@lists.freedesktop.org, andrzej.hajda@gmail.com,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Jagan Teki <jagan@amarulasolutions.com>
Subject: Re: [PATCH 2/2] drm/bridge: Document the expected behaviour of DSI host controllers
Date: Tue, 22 Feb 2022 08:22:03 +0200	[thread overview]
Message-ID: <YhSBC13+3DM3FyQ+@pendragon.ideasonboard.com> (raw)
In-Reply-To: <85d0a4dbbe6c8ad7bc3fdd8ce719f6d418ce095e.1645029005.git.dave.stevenson@raspberrypi.com>

Hi Dave,

Thank you for the patch.


On Wed, Feb 16, 2022 at 04:59:44PM +0000, Dave Stevenson wrote:
> The exact behaviour of DSI host controllers is not specified,
> therefore define it.
> 
> Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
> ---
>  Documentation/gpu/drm-kms-helpers.rst |  7 +++++++
>  drivers/gpu/drm/drm_bridge.c          | 38 +++++++++++++++++++++++++++++++++++
>  2 files changed, 45 insertions(+)
> 
> diff --git a/Documentation/gpu/drm-kms-helpers.rst b/Documentation/gpu/drm-kms-helpers.rst
> index c3ce91eecbc1..362afdb867c6 100644
> --- a/Documentation/gpu/drm-kms-helpers.rst
> +++ b/Documentation/gpu/drm-kms-helpers.rst
> @@ -185,6 +185,13 @@ Bridge Helper Reference
>  .. kernel-doc:: drivers/gpu/drm/drm_bridge.c
>     :export:
>  
> +MIPI-DSI bridge operation
> +-------------------------
> +
> +.. kernel-doc:: drivers/gpu/drm/drm_bridge.c
> +   :doc: dsi bridge operations
> +
> +
>  Bridge Connector Helper Reference
>  ---------------------------------
>  
> diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c
> index 7c24e8340efa..14c2ee9e0328 100644
> --- a/drivers/gpu/drm/drm_bridge.c
> +++ b/drivers/gpu/drm/drm_bridge.c
> @@ -152,6 +152,44 @@
>   * situation when probing.
>   */
>  
> +/**
> + * DOC: dsi bridge operations
> + *
> + * DSI host interfaces are expected to be implemented as bridges rather than
> + * encoders, however there are a few aspects of their operation that need to
> + * be defined in order to provide a consistent interface.
> + *
> + * A DSI host should keep the PHY powered down until the pre_enable op is

I'd write "operation" in full everywhere to avoid mixing the two.

> + * called. All lanes should be in an idle state (not LP-11) up to this point.

Is the idle state LP-00 ? If so I'd state that explicitly.

"[...] in an idle state (LP-00, not LP-11) [...]"

> + * pre_enable should initialise the PHY, set the data lanes to LP-11, and the
> + * clock lane to either LP-11 or HS dependent on the mode_flag

s/dependent/depending/ ?

> + * MIPI_DSI_CLOCK_NON_CONTINUOUS.
> + *
> + * Ordinarily the downstream bridge DSI peripheral pre_enable will have been
> + * called before the DSI host. If the DSI peripheral requires LP-11 and/or
> + * the clock lane to be in HS mode prior to pre_enable, then it can set the
> + * DRM_BRIDGE_OP_UPSTREAM_FIRST flag to request the pre_enable (and
> + * post_disable) order to be altered to enable the DSI host first.
> + *
> + * Either the CRTC being enabled, or the DSI host enable op should switch the
> + * host to actively transmitting video on the data lanes.
> + *
> + * The reverse also applies. The DSI host disable op or stopping the CRTC should
> + * stop transmitting video, and the data lanes should return to the LP-11 state.
> + * The DSI host post_disable op should disable the PHY.
> + * If the DRM_BRIDGE_OP_UPSTREAM_FIRST flag is set, then the DSI peripheral's
> + * bridge post_disable will be called before the DSI host's post_disable.
> + *
> + * Whilst it is valid to call host_transfer prior to pre_enable or after
> + * post_disable, the exact state of the lanes is undefined at this point. The
> + * DSI host should initialise the interface, transmit the data, and then disable
> + * the interface again.
> + *
> + * Ultra Low Power State (ULPS) is not explicitly supported by DRM. If
> + * implemented, it therefore needs to be either handled entirely within the DSI

s/either // (or you need an "or ..." :-))

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> + * Host driver.
> + */
> +
>  static DEFINE_MUTEX(bridge_lock);
>  static LIST_HEAD(bridge_list);
>  

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2022-02-22  6:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-16 16:59 [PATCH 0/2] DSI host and peripheral initialisation ordering Dave Stevenson
2022-02-16 16:59 ` [PATCH 1/2] drm: Introduce DRM_BRIDGE_OP_UPSTREAM_FIRST to alter bridge init order Dave Stevenson
2022-02-22  6:33   ` Laurent Pinchart
2022-02-22  8:43     ` Dave Stevenson
2022-02-28 15:35       ` Andrzej Hajda
2022-03-02 14:01         ` Dave Stevenson
2022-02-16 16:59 ` [PATCH 2/2] drm/bridge: Document the expected behaviour of DSI host controllers Dave Stevenson
2022-02-22  6:22   ` Laurent Pinchart [this message]
2022-02-22  8:15     ` Dave Stevenson
2022-02-17 16:05 ` [PATCH 0/2] DSI host and peripheral initialisation ordering Maxime Ripard
2022-02-17 17:46 ` Dmitry Baryshkov
2022-02-18 13:20 ` Andrzej Hajda
2022-02-22  6:43   ` Laurent Pinchart
2022-02-22  8:51     ` Dave Stevenson
2022-03-02  0:13 ` Doug Anderson
2022-03-02 17:20   ` Dave Stevenson
2022-03-02 18:47     ` Doug Anderson

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=YhSBC13+3DM3FyQ+@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=airlied@linux.ie \
    --cc=andrzej.hajda@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=dianders@chromium.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jagan@amarulasolutions.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=marex@denx.de \
    --cc=narmstrong@baylibre.com \
    --cc=robert.foss@linaro.org \
    --cc=tzimmermann@suse.de \
    /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