Commit 65a102f6 authored by Noralf Trønnes's avatar Noralf Trønnes

drm/fb-helper: dpms_legacy(): Only set on connectors in use

For each enabled crtc the functions sets dpms on all registered connectors.
Limit this to only doing it once and on the connectors actually in use.
Signed-off-by: default avatarNoralf Trønnes <noralf@tronnes.org>
Fixes: 023eb571 ("drm: correctly update connector DPMS status in drm_fb_helper")
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20190326175546.18126-3-noralf@tronnes.org
parent b9ed8cff
...@@ -639,20 +639,19 @@ static struct sysrq_key_op sysrq_drm_fb_helper_restore_op = { }; ...@@ -639,20 +639,19 @@ static struct sysrq_key_op sysrq_drm_fb_helper_restore_op = { };
static void dpms_legacy(struct drm_fb_helper *fb_helper, int dpms_mode) static void dpms_legacy(struct drm_fb_helper *fb_helper, int dpms_mode)
{ {
struct drm_device *dev = fb_helper->dev; struct drm_device *dev = fb_helper->dev;
struct drm_crtc *crtc;
struct drm_connector *connector; struct drm_connector *connector;
struct drm_mode_set *modeset;
int i, j; int i, j;
drm_modeset_lock_all(dev); drm_modeset_lock_all(dev);
for (i = 0; i < fb_helper->crtc_count; i++) { for (i = 0; i < fb_helper->crtc_count; i++) {
crtc = fb_helper->crtc_info[i].mode_set.crtc; modeset = &fb_helper->crtc_info[i].mode_set;
if (!crtc->enabled) if (!modeset->crtc->enabled)
continue; continue;
/* Walk the connectors & encoders on this fb turning them on/off */ for (j = 0; j < modeset->num_connectors; j++) {
drm_fb_helper_for_each_connector(fb_helper, j) { connector = modeset->connectors[j];
connector = fb_helper->connector_info[j]->connector;
connector->funcs->dpms(connector, dpms_mode); connector->funcs->dpms(connector, dpms_mode);
drm_object_property_set_value(&connector->base, drm_object_property_set_value(&connector->base,
dev->mode_config.dpms_property, dpms_mode); dev->mode_config.dpms_property, dpms_mode);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment