mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
UPSTREAM: drm/bridge: analogix-anx78xx: Use bridge->mode_valid() callback
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.
Change-Id: I7411e25508096ac0cc52b1eb4a84e06249c3d054
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Carlos Palminha <palminha@synopsys.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Archit Taneja <architt@codeaurora.org>
Cc: Andrzej Hajda <a.hajda@samsung.com>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: David Airlie <airlied@linux.ie>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1d0ed1858ae56c827bd09cc1fa6ff4a05d1530eb.1495720737.git.joabreu@synopsys.com
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
(cherry-picked from 7dbcbce9f5)
This commit is contained in:
@@ -1066,18 +1066,18 @@ 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)
|
||||
static 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)
|
||||
@@ -1134,7 +1134,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,
|
||||
|
||||
Reference in New Issue
Block a user