diff options
author | Sean Paul <seanpaul@chromium.org> | 2016-09-07 14:23:15 +0300 |
---|---|---|
committer | Archit Taneja <architt@codeaurora.org> | 2016-09-24 09:26:35 +0300 |
commit | f2600d08d4e8d211262b143e71d3a08f320e1e17 (patch) | |
tree | 4cf23dcc6c284c04a15d6db76e89a39c99239bb8 /drivers/gpu/drm/bridge | |
parent | 8c77e2c2a48b5d52114fb179c3d7c21fd02be64d (diff) | |
download | linux-f2600d08d4e8d211262b143e71d3a08f320e1e17.tar.xz |
drm/bridge: analogix_dp: Improve panel on time
In order to reduce the time required to turn on the panel, this patch
makes 2 assumptions:
1- In detect(): if there's a panel, we're connected.
2- In get_modes(): if there's a panel, let the panel driver decide if
it should prepare/unprepare in order to get the modes.
The first is straightforward, and shouldn't need further explanation. The
second should eliminate the prepare/unprepare delays from get_modes() in
most cases, since panels generally hardcode their modes in the driver as
opposed to reading EDID. If a panel does need to read EDID, it should be
responsible for ensuring it's in a state in which it can.
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Diffstat (limited to 'drivers/gpu/drm/bridge')
-rw-r--r-- | drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index e9c9aebffe44..18f622a01a5c 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -924,15 +924,15 @@ int analogix_dp_get_modes(struct drm_connector *connector) struct edid *edid; int ret, num_modes = 0; - ret = analogix_dp_prepare_panel(dp, true, false); - if (ret) { - DRM_ERROR("Failed to prepare panel (%d)\n", ret); - return 0; - } - if (dp->plat_data->panel) { num_modes += drm_panel_get_modes(dp->plat_data->panel); } else { + ret = analogix_dp_prepare_panel(dp, true, false); + if (ret) { + DRM_ERROR("Failed to prepare panel (%d)\n", ret); + return 0; + } + edid = drm_get_edid(connector, &dp->aux.ddc); if (edid) { drm_mode_connector_update_edid_property(&dp->connector, @@ -940,15 +940,15 @@ int analogix_dp_get_modes(struct drm_connector *connector) num_modes += drm_add_edid_modes(&dp->connector, edid); kfree(edid); } + + ret = analogix_dp_prepare_panel(dp, false, false); + if (ret) + DRM_ERROR("Failed to unprepare panel (%d)\n", ret); } if (dp->plat_data->get_modes) num_modes += dp->plat_data->get_modes(dp->plat_data, connector); - ret = analogix_dp_prepare_panel(dp, false, false); - if (ret) - DRM_ERROR("Failed to unprepare panel (%d)\n", ret); - return num_modes; } @@ -972,6 +972,9 @@ analogix_dp_detect(struct drm_connector *connector, bool force) enum drm_connector_status status = connector_status_disconnected; int ret; + if (dp->plat_data->panel) + return connector_status_connected; + ret = analogix_dp_prepare_panel(dp, true, false); if (ret) { DRM_ERROR("Failed to prepare panel (%d)\n", ret); |