mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Archit Taneja <architt@codeaurora.org>
To: Jose Abreu <Jose.Abreu@synopsys.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Cc: "Carlos Palminha" <CARLOS.PALMINHA@synopsys.com>,
	"Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	"Dave Airlie" <airlied@linux.ie>,
	"Andrzej Hajda" <a.hajda@samsung.com>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>
Subject: Re: [PATCH v5 02/10] drm: Introduce drm_bridge_mode_valid()
Date: Fri, 26 May 2017 09:55:46 +0530	[thread overview]
Message-ID: <91e029e3-6b2b-4203-e880-556545cd6f63@codeaurora.org> (raw)
In-Reply-To: <36bd5e054496ad3c9c71f1ffe204f28533f55f1e.1495720737.git.joabreu@synopsys.com>



On 05/25/2017 07:49 PM, Jose Abreu wrote:
> Introduce a new helper function which calls mode_valid() callback
> for all bridges in an encoder chain.
>

Reviewed-by: Archit Taneja <architt@codeaurora.org>

> Signed-off-by: Jose Abreu <joabreu@synopsys.com>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: Carlos Palminha <palminha@synopsys.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Dave Airlie <airlied@linux.ie>
> Cc: Andrzej Hajda <a.hajda@samsung.com>
> Cc: Archit Taneja <architt@codeaurora.org>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  drivers/gpu/drm/drm_bridge.c | 33 +++++++++++++++++++++++++++++++++
>  include/drm/drm_bridge.h     |  2 ++
>  2 files changed, 35 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c
> index 86a7637..dc8cdfe 100644
> --- a/drivers/gpu/drm/drm_bridge.c
> +++ b/drivers/gpu/drm/drm_bridge.c
> @@ -206,6 +206,39 @@ bool drm_bridge_mode_fixup(struct drm_bridge *bridge,
>  EXPORT_SYMBOL(drm_bridge_mode_fixup);
>
>  /**
> + * drm_bridge_mode_valid - validate the mode against all bridges in the
> + * 			   encoder chain.
> + * @bridge: bridge control structure
> + * @mode: desired mode to be validated
> + *
> + * Calls &drm_bridge_funcs.mode_valid for all the bridges in the encoder
> + * chain, starting from the first bridge to the last. If at least one bridge
> + * does not accept the mode the function returns the error code.
> + *
> + * Note: the bridge passed should be the one closest to the encoder.
> + *
> + * RETURNS:
> + * MODE_OK on success, drm_mode_status Enum error code on failure
> + */
> +enum drm_mode_status drm_bridge_mode_valid(struct drm_bridge *bridge,
> +					   const struct drm_display_mode *mode)
> +{
> +	enum drm_mode_status ret = MODE_OK;
> +
> +	if (!bridge)
> +		return ret;
> +
> +	if (bridge->funcs->mode_valid)
> +		ret = bridge->funcs->mode_valid(bridge, mode);
> +
> +	if (ret != MODE_OK)
> +		return ret;
> +
> +	return drm_bridge_mode_valid(bridge->next, mode);
> +}
> +EXPORT_SYMBOL(drm_bridge_mode_valid);
> +
> +/**
>   * drm_bridge_disable - disables all bridges in the encoder chain
>   * @bridge: bridge control structure
>   *
> diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
> index 00c6c36..8358eb3 100644
> --- a/include/drm/drm_bridge.h
> +++ b/include/drm/drm_bridge.h
> @@ -233,6 +233,8 @@ int drm_bridge_attach(struct drm_encoder *encoder, struct drm_bridge *bridge,
>  bool drm_bridge_mode_fixup(struct drm_bridge *bridge,
>  			const struct drm_display_mode *mode,
>  			struct drm_display_mode *adjusted_mode);
> +enum drm_mode_status drm_bridge_mode_valid(struct drm_bridge *bridge,
> +					   const struct drm_display_mode *mode);
>  void drm_bridge_disable(struct drm_bridge *bridge);
>  void drm_bridge_post_disable(struct drm_bridge *bridge);
>  void drm_bridge_mode_set(struct drm_bridge *bridge,
>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  reply	other threads:[~2017-05-26  4:26 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-25 14:19 [PATCH v5 00/10] Introduce new mode validation callbacks Jose Abreu
2017-05-25 14:19 ` [PATCH v5 01/10] drm: Add drm_{crtc/encoder/connector}_mode_valid() Jose Abreu
2017-05-30  6:38   ` Daniel Vetter
2017-05-30  7:26   ` Neil Armstrong
2017-05-25 14:19 ` [PATCH v5 02/10] drm: Introduce drm_bridge_mode_valid() Jose Abreu
2017-05-26  4:25   ` Archit Taneja [this message]
2017-05-30  7:27   ` Neil Armstrong
2017-05-25 14:19 ` [PATCH v5 03/10] drm: Use new mode_valid() helpers in connector probe helper Jose Abreu
2017-05-30  7:27   ` Neil Armstrong
2017-05-25 14:19 ` [PATCH v5 04/10] drm: Use mode_valid() in atomic modeset Jose Abreu
2017-05-29 19:38   ` Daniel Vetter
2017-05-30  7:27   ` Neil Armstrong
2017-05-25 14:19 ` [PATCH v5 05/10] drm: arcpgu: Use crtc->mode_valid() callback Jose Abreu
2017-05-30  7:28   ` Neil Armstrong
2017-06-21  9:38   ` Jose Abreu
2017-06-22  8:46     ` Daniel Vetter
2017-05-25 14:19 ` [PATCH v5 06/10] drm/bridge: analogix-anx78xx: Use bridge->mode_valid() callback Jose Abreu
2017-05-26  4:27   ` Archit Taneja
2017-05-30  7:28   ` Neil Armstrong
2017-05-30 10:35     ` Archit Taneja
2017-05-25 14:19 ` [PATCH v5 07/10] drm/bridge/synopsys: dw-hdmi: " Jose Abreu
2017-05-29  9:45   ` Neil Armstrong
2017-05-30 10:24   ` Archit Taneja
2017-05-30 10:29     ` Philipp Zabel
2017-06-05  7:53       ` Archit Taneja
2017-05-25 14:19 ` [PATCH v5 08/10] drm/arm: malidp: Use crtc->mode_valid() callback Jose Abreu
2017-05-30  7:29   ` Neil Armstrong
2017-05-30  9:37     ` Liviu Dudau
2017-05-31  8:20       ` Daniel Vetter
2017-05-31 10:48         ` Liviu Dudau
2017-05-31 10:56           ` Daniel Vetter
2017-05-31 11:09             ` Liviu Dudau
2017-05-25 14:19 ` [PATCH v5 09/10] drm/atmel-hlcdc: " Jose Abreu
2017-05-30  7:30   ` Neil Armstrong
2017-06-02  9:35   ` Boris Brezillon
2017-05-25 14:19 ` [PATCH v5 10/10] drm: vc4: Use crtc->mode_valid() and encoder->mode_valid() callbacks Jose Abreu
2017-05-30  7:30   ` Neil Armstrong
2017-06-02 20:10   ` Eric Anholt
2017-06-20  8:47     ` Daniel Vetter

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=91e029e3-6b2b-4203-e880-556545cd6f63@codeaurora.org \
    --to=architt@codeaurora.org \
    --cc=CARLOS.PALMINHA@synopsys.com \
    --cc=Jose.Abreu@synopsys.com \
    --cc=a.hajda@samsung.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ville.syrjala@linux.intel.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

Powered by JetHome