mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jose Abreu <Jose.Abreu@synopsys.com>
To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Cc: "Jose Abreu" <Jose.Abreu@synopsys.com>,
	"Carlos Palminha" <CARLOS.PALMINHA@synopsys.com>,
	"Alexey Brodkin" <Alexey.Brodkin@synopsys.com>,
	"Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	"Daniel Vetter" <daniel.vetter@ffwll.ch>,
	"Dave Airlie" <airlied@linux.ie>,
	"Andrzej Hajda" <a.hajda@samsung.com>,
	"Archit Taneja" <architt@codeaurora.org>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>
Subject: [PATCH v4 06/10] drm/bridge: analogix-anx78xx: Use bridge->mode_valid() callback
Date: Fri, 19 May 2017 01:52:15 +0100	[thread overview]
Message-ID: <20f98154ec1c8d0fbae71978c83d37fe468c1bc8.1495091280.git.joabreu@synopsys.com> (raw)
In-Reply-To: <cover.1495091280.git.joabreu@synopsys.com>
In-Reply-To: <cover.1495091280.git.joabreu@synopsys.com>

Now that we have a callback to check if bridge supports a given mode
we can use it in Analogix bridge so that we restrict the number of
probbed modes to the ones we can actually display.

Also, there is no need to use mode_fixup() callback as mode_valid()
will handle the mode validation.

NOTE: Only compile tested.

Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Carlos Palminha <palminha@synopsys.com>
Cc: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
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/bridge/analogix-anx78xx.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/bridge/analogix-anx78xx.c b/drivers/gpu/drm/bridge/analogix-anx78xx.c
index a2a8236..cf69a1c 100644
--- a/drivers/gpu/drm/bridge/analogix-anx78xx.c
+++ b/drivers/gpu/drm/bridge/analogix-anx78xx.c
@@ -1061,18 +1061,17 @@ static int anx78xx_bridge_attach(struct drm_bridge *bridge)
 	return 0;
 }
 
-static bool anx78xx_bridge_mode_fixup(struct drm_bridge *bridge,
-				      const struct drm_display_mode *mode,
-				      struct drm_display_mode *adjusted_mode)
+enum drm_mode_status anx78xx_bridge_mode_valid(struct drm_bridge *bridge,
+					       const struct drm_display_mode *mode)
 {
 	if (mode->flags & DRM_MODE_FLAG_INTERLACE)
-		return false;
+		return MODE_NO_INTERLACE;
 
 	/* Max 1200p at 5.4 Ghz, one lane */
 	if (mode->clock > 154000)
-		return false;
+		return MODE_CLOCK_HIGH;
 
-	return true;
+	return MODE_OK;
 }
 
 static void anx78xx_bridge_disable(struct drm_bridge *bridge)
@@ -1129,7 +1128,7 @@ static void anx78xx_bridge_enable(struct drm_bridge *bridge)
 
 static const struct drm_bridge_funcs anx78xx_bridge_funcs = {
 	.attach = anx78xx_bridge_attach,
-	.mode_fixup = anx78xx_bridge_mode_fixup,
+	.mode_valid = anx78xx_bridge_mode_valid,
 	.disable = anx78xx_bridge_disable,
 	.mode_set = anx78xx_bridge_mode_set,
 	.enable = anx78xx_bridge_enable,
-- 
1.9.1

  parent reply	other threads:[~2017-05-19  0:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-19  0:52 [PATCH v4 00/10] Introduce new mode validation callbacks Jose Abreu
2017-05-19  0:52 ` [PATCH v4 01/10] drm: Add drm_{crtc/encoder/connector}_mode_valid() Jose Abreu
2017-05-19  0:52 ` [PATCH v4 02/10] drm: Introduce drm_bridge_mode_valid() Jose Abreu
2017-05-19  0:52 ` [PATCH v4 03/10] drm: Use new mode_valid() helpers in connector probe helper Jose Abreu
2017-05-22  7:54   ` Daniel Vetter
2017-05-19  0:52 ` [PATCH v4 04/10] drm: Use mode_valid() in atomic modeset Jose Abreu
2017-05-19  0:52 ` [PATCH v4 05/10] drm: arc: Use crtc->mode_valid() callback Jose Abreu
2017-05-22 18:32   ` Alexey Brodkin
2017-05-19  0:52 ` Jose Abreu [this message]
2017-05-19  0:52 ` [PATCH v4 07/10] drm/bridge/synopsys: dw-hdmi: Use bridge->mode_valid() callback Jose Abreu
2017-05-24 12:30   ` Neil Armstrong
2017-05-19  0:52 ` [PATCH v4 08/10] drm/arm: malidp: Use crtc->mode_valid() callback Jose Abreu
2017-05-19  0:52 ` [PATCH v4 09/10] drm/atmel-hlcdc: " Jose Abreu
2017-05-19  0:52 ` [PATCH v4 10/10] drm: vc4: Use crtc->mode_valid() and encoder->mode_valid() callbacks Jose Abreu
2017-05-22  7:56 ` [PATCH v4 00/10] Introduce new mode validation callbacks Daniel Vetter
2017-05-22 10:01   ` Jose Abreu
2017-05-22 15:31   ` Daniel Vetter
2017-05-23 14:40     ` Jose Abreu
2017-05-24 12:12       ` 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=20f98154ec1c8d0fbae71978c83d37fe468c1bc8.1495091280.git.joabreu@synopsys.com \
    --to=jose.abreu@synopsys.com \
    --cc=Alexey.Brodkin@synopsys.com \
    --cc=CARLOS.PALMINHA@synopsys.com \
    --cc=a.hajda@samsung.com \
    --cc=airlied@linux.ie \
    --cc=architt@codeaurora.org \
    --cc=daniel.vetter@ffwll.ch \
    --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

all inboxes | Powered by JetHome®