FROMLIST: drm/bridge: analogix_dp: Don't read EDID if panel present
authorSean Paul <seanpaul@chromium.org>
Wed, 24 Aug 2016 14:25:29 +0000 (10:25 -0400)
committerHuang, Tao <huangtao@rock-chips.com>
Fri, 10 Mar 2017 08:10:10 +0000 (16:10 +0800)
If there's a panel connected to the analogix_dp bridge, rely on
the panel driver for modes, rather than reading EDID *and* calling
get_modes() on the panel.

This allows panels with a valid EDID to read it in the panel driver
(e.g. simple_panel), and panels with invalid EDID to homebrew modes
in their get_modes implementation.

BUG=chrome-os-partner:53565
TEST=Boot device and confirm the modes returned are from panel driver
     instead of EDID

[from https://patchwork.freedesktop.org/patch/107115/]
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/374959
Commit-Ready: Chris Zhong <zyw@rock-chips.com>
Tested-by: Chris Zhong <zyw@rock-chips.com>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
Change-Id: Ie07dd33e3c121215bf24394cfcb3fff8c7c746a5
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c

index 58f0d294f8c1419f73e2c1d9b0224bf5faca016c..31f384b096a6e8f2c224578eaabf89623fe51ddd 100644 (file)
@@ -931,14 +931,13 @@ int analogix_dp_get_modes(struct drm_connector *connector)
 
        pm_runtime_get_sync(dp->dev);
 
-       if (analogix_dp_handle_edid(dp) == 0) {
+       if (dp->plat_data->panel) {
+               num_modes += drm_panel_get_modes(dp->plat_data->panel);
+       } else if (analogix_dp_handle_edid(dp) == 0) {
                drm_mode_connector_update_edid_property(&dp->connector, edid);
                num_modes += drm_add_edid_modes(&dp->connector, edid);
        }
 
-       if (dp->plat_data->panel)
-               num_modes += drm_panel_get_modes(dp->plat_data->panel);
-
        if (dp->plat_data->get_modes)
                num_modes += dp->plat_data->get_modes(dp->plat_data, connector);