@@ -1475,6 +1475,36 @@ static void update_props(struct drm_device *dev,
}
}
+/*
+ * FIXME
+ * Perhaps atomic modeset shouldn't actually change the DPMS state,
+ * unless explicitly asked to do so. That's the way we treat everything
+ * else, so it makes sense. Although the dpms property is already a bit
+ * special in the legacy codepaths, so maybe we should follow the same
+ * pattern. Ie. a modeset forces DPMS to on (which is what we do here).
+ */
+static void update_connector_dpms(struct drm_device *dev, struct drm_crtc *crtc)
+{
+ struct drm_connector *connector;
+
+ list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
+ int dpms = connector->dpms;
+
+ if (connector->encoder && connector->encoder->crtc == crtc)
+ dpms = DRM_MODE_DPMS_ON;
+ else if (!connector->encoder || !connector->encoder->crtc)
+ dpms = DRM_MODE_DPMS_OFF;
+
+ if (connector->dpms == dpms)
+ continue;
+
+ connector->dpms = dpms;
+ drm_connector_property_set_value(connector,
+ dev->mode_config.dpms_property,
+ dpms);
+ }
+}
+
static void update_crtc(struct drm_device *dev,
struct intel_atomic_state *s)
{
@@ -1494,6 +1524,7 @@ static void update_crtc(struct drm_device *dev,
if (st->mode_dirty) {
drm_calc_timestamping_constants(crtc);
intel_crtc_update_sarea(crtc, crtc->enabled);
+ update_connector_dpms(dev, crtc);
}
if (st->fb_dirty)