summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
diff options
context:
space:
mode:
authorBrian Norris <briannorris@chromium.org>2022-03-01 18:11:39 -0800
committerDouglas Anderson <dianders@chromium.org>2022-03-09 08:00:54 -0800
commitf28dd50756757cde90dbf139c100fb45b13dccb3 (patch)
tree29efffb3a06dbc1253a55725abdb192747db3251 /drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
parent8fb6c44fe8468f92ac7b8bbfcca4404a4e88645f (diff)
downloadlinux-stable-f28dd50756757cde90dbf139c100fb45b13dccb3.tar.gz
linux-stable-f28dd50756757cde90dbf139c100fb45b13dccb3.tar.bz2
linux-stable-f28dd50756757cde90dbf139c100fb45b13dccb3.zip
drm/bridge: analogix_dp: Enable autosuspend
DP AUX transactions can consist of many short operations. There's no need to power things up/down in short intervals. I pick an arbitrary 100ms; for the systems I'm testing (Rockchip RK3399), runtime-PM transitions only take a few microseconds. Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Douglas Anderson <dianders@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/20220301181107.v4.2.I48b18ab197c9b649d376cf8cfd934e59d338f86d@changeid
Diffstat (limited to 'drivers/gpu/drm/bridge/analogix/analogix_dp_core.c')
-rw-r--r--drivers/gpu/drm/bridge/analogix/analogix_dp_core.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
index d45931913dfc..c5afccd46440 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c
@@ -1119,9 +1119,7 @@ static int analogix_dp_get_modes(struct drm_connector *connector)
return 0;
}
- pm_runtime_get_sync(dp->dev);
edid = drm_get_edid(connector, &dp->aux.ddc);
- pm_runtime_put(dp->dev);
if (edid) {
drm_connector_update_edid_property(&dp->connector,
edid);
@@ -1642,7 +1640,8 @@ static ssize_t analogix_dpaux_transfer(struct drm_dp_aux *aux,
ret = analogix_dp_transfer(dp, msg);
out:
- pm_runtime_put(dp->dev);
+ pm_runtime_mark_last_busy(dp->dev);
+ pm_runtime_put_autosuspend(dp->dev);
return ret;
}
@@ -1775,6 +1774,8 @@ int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev)
if (ret)
return ret;
+ pm_runtime_use_autosuspend(dp->dev);
+ pm_runtime_set_autosuspend_delay(dp->dev, 100);
pm_runtime_enable(dp->dev);
ret = analogix_dp_create_bridge(drm_dev, dp);
@@ -1786,6 +1787,7 @@ int analogix_dp_bind(struct analogix_dp_device *dp, struct drm_device *drm_dev)
return 0;
err_disable_pm_runtime:
+ pm_runtime_dont_use_autosuspend(dp->dev);
pm_runtime_disable(dp->dev);
drm_dp_aux_unregister(&dp->aux);
@@ -1804,6 +1806,7 @@ void analogix_dp_unbind(struct analogix_dp_device *dp)
}
drm_dp_aux_unregister(&dp->aux);
+ pm_runtime_dont_use_autosuspend(dp->dev);
pm_runtime_disable(dp->dev);
}
EXPORT_SYMBOL_GPL(analogix_dp_unbind);