aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRomain Perier <romain.perier@collabora.com>2017-04-07 08:17:43 -0400
committerArchit Taneja <architt@codeaurora.org>2017-04-10 05:23:10 -0400
commit6ce2ca580f10d8d76cc3661a0b6b88d419725c9c (patch)
tree675363e71ebf934eed8ca9810043a2de0322f097 /drivers
parentc98cdff94a6a7877923dec1329c2b76d6247d076 (diff)
drm: dw-hdmi: Implement the mode_fixup drm helper
This helper is supposed to validate or reject the modeline before it applied by the mode setting. Currently this function has been dropped, it was previously set to a dummy function that always returned true. For both cases, this means that userspace can ask for a bad modeline that will be always accepted. On some platforms, like Rockchip, the drm dw_hdmi-rockchip variant driver already implements the atomic_check drm helper, so mode_fixup cannot be handled and implemented there (as drm_atomic_helper relies on either atomic_check or mode_fixup). This commit implements this helper. It only checks that this mode is correct from the connector point of view. Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Romain Perier <romain.perier@collabora.com> Signed-off-by: Archit Taneja <architt@codeaurora.org> Link: http://patchwork.freedesktop.org/patch/msgid/20170407121743.4142-1-romain.perier@collabora.com
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/bridge/synopsys/dw-hdmi.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index 3bc856cc6daa..4e1f54a675d8 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -1947,6 +1947,20 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *bridge)
1947 return 0; 1947 return 0;
1948} 1948}
1949 1949
1950static bool dw_hdmi_bridge_mode_fixup(struct drm_bridge *bridge,
1951 const struct drm_display_mode *orig_mode,
1952 struct drm_display_mode *mode)
1953{
1954 struct dw_hdmi *hdmi = bridge->driver_private;
1955 struct drm_connector *connector = &hdmi->connector;
1956 enum drm_mode_status status;
1957
1958 status = dw_hdmi_connector_mode_valid(connector, mode);
1959 if (status != MODE_OK)
1960 return false;
1961 return true;
1962}
1963
1950static void dw_hdmi_bridge_mode_set(struct drm_bridge *bridge, 1964static void dw_hdmi_bridge_mode_set(struct drm_bridge *bridge,
1951 struct drm_display_mode *orig_mode, 1965 struct drm_display_mode *orig_mode,
1952 struct drm_display_mode *mode) 1966 struct drm_display_mode *mode)
@@ -1988,6 +2002,7 @@ static const struct drm_bridge_funcs dw_hdmi_bridge_funcs = {
1988 .enable = dw_hdmi_bridge_enable, 2002 .enable = dw_hdmi_bridge_enable,
1989 .disable = dw_hdmi_bridge_disable, 2003 .disable = dw_hdmi_bridge_disable,
1990 .mode_set = dw_hdmi_bridge_mode_set, 2004 .mode_set = dw_hdmi_bridge_mode_set,
2005 .mode_fixup = dw_hdmi_bridge_mode_fixup,
1991}; 2006};
1992 2007
1993static irqreturn_t dw_hdmi_i2c_irq(struct dw_hdmi *hdmi) 2008static irqreturn_t dw_hdmi_i2c_irq(struct dw_hdmi *hdmi)