drm: rcar-du: Switch connector DPMS to atomic helpers
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Sat, 21 Feb 2015 23:49:11 +0000 (01:49 +0200)
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tue, 3 Mar 2015 14:16:20 +0000 (16:16 +0200)
The atomic connector DPMS helper implements the connector DPMS operation
using atomic commit, removing the need for DPMS helper operations on
CRTCs and encoders.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
drivers/gpu/drm/rcar-du/rcar_du_crtc.c
drivers/gpu/drm/rcar-du/rcar_du_encoder.c
drivers/gpu/drm/rcar-du/rcar_du_hdmicon.c
drivers/gpu/drm/rcar-du/rcar_du_hdmienc.c
drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c
drivers/gpu/drm/rcar-du/rcar_du_vgacon.c

index f82893884a8a99a292f459244f12b2a185b55564..8a44d37f17168701702ef7eca322d7b01fc14d0b 100644 (file)
@@ -360,7 +360,7 @@ static void rcar_du_crtc_start(struct rcar_du_crtc *rcrtc)
        rcar_du_group_set_routing(rcrtc->group);
 
        /* FIXME: Commit the planes state. This is required here as the CRTC can
-        * be started from the DPMS and system resume handler, which don't go
+        * be started from the system resume handler, which don't go
         * through .atomic_plane_update() and .atomic_flush() to commit plane
         * state. Additionally, given that the plane state atomic commit occurs
         * between CRTC disable and enable, the hardware state could also be
@@ -475,14 +475,6 @@ static void rcar_du_crtc_disable(struct drm_crtc *crtc)
        rcrtc->outputs = 0;
 }
 
-static void rcar_du_crtc_dpms(struct drm_crtc *crtc, int mode)
-{
-       if (mode == DRM_MODE_DPMS_ON)
-               rcar_du_crtc_enable(crtc);
-       else
-               rcar_du_crtc_disable(crtc);
-}
-
 static bool rcar_du_crtc_mode_fixup(struct drm_crtc *crtc,
                                    const struct drm_display_mode *mode,
                                    struct drm_display_mode *adjusted_mode)
@@ -516,7 +508,6 @@ static void rcar_du_crtc_atomic_flush(struct drm_crtc *crtc)
 }
 
 static const struct drm_crtc_helper_funcs crtc_helper_funcs = {
-       .dpms = rcar_du_crtc_dpms,
        .mode_fixup = rcar_du_crtc_mode_fixup,
        .disable = rcar_du_crtc_disable,
        .enable = rcar_du_crtc_enable,
index 76b201f2f75ee08fdb706491853cbf87228bc135..d4a70228ce504cbb5c3e21d1cc680719a19fbded 100644 (file)
@@ -58,14 +58,6 @@ static void rcar_du_encoder_enable(struct drm_encoder *encoder)
                rcar_du_lvdsenc_enable(renc->lvds, encoder->crtc, true);
 }
 
-static void rcar_du_encoder_dpms(struct drm_encoder *encoder, int mode)
-{
-       if (mode == DRM_MODE_DPMS_ON)
-               rcar_du_encoder_enable(encoder);
-       else
-               rcar_du_encoder_disable(encoder);
-}
-
 static bool rcar_du_encoder_mode_fixup(struct drm_encoder *encoder,
                                       const struct drm_display_mode *mode,
                                       struct drm_display_mode *adjusted_mode)
@@ -128,7 +120,6 @@ static void rcar_du_encoder_mode_set(struct drm_encoder *encoder,
 }
 
 static const struct drm_encoder_helper_funcs encoder_helper_funcs = {
-       .dpms = rcar_du_encoder_dpms,
        .mode_fixup = rcar_du_encoder_mode_fixup,
        .mode_set = rcar_du_encoder_mode_set,
        .disable = rcar_du_encoder_disable,
index 9378c283cb5854fcea7c7eee00773cc103b2d78e..96f2eb43713c55e99f662fb76f8b7dcd727c0724 100644 (file)
@@ -75,7 +75,7 @@ rcar_du_hdmi_connector_detect(struct drm_connector *connector, bool force)
 }
 
 static const struct drm_connector_funcs connector_funcs = {
-       .dpms = drm_helper_connector_dpms,
+       .dpms = drm_atomic_helper_connector_dpms,
        .reset = drm_atomic_helper_connector_reset,
        .detect = rcar_du_hdmi_connector_detect,
        .fill_modes = drm_helper_probe_single_connector_modes,
@@ -112,7 +112,7 @@ int rcar_du_hdmi_connector_init(struct rcar_du_device *rcdu,
        if (ret < 0)
                return ret;
 
-       drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF);
+       connector->dpms = DRM_MODE_DPMS_OFF;
        drm_object_property_set_value(&connector->base,
                rcdu->ddev->mode_config.dpms_property, DRM_MODE_DPMS_OFF);
 
index a88ef2d6800ef56290e91a9696399e4266bc0e97..3c29250c8abd7f72bcf5e9434d2f932161dcec10 100644 (file)
@@ -62,20 +62,6 @@ static void rcar_du_hdmienc_enable(struct drm_encoder *encoder)
        hdmienc->enabled = true;
 }
 
-static void rcar_du_hdmienc_dpms(struct drm_encoder *encoder, int mode)
-{
-       struct rcar_du_hdmienc *hdmienc = to_rcar_hdmienc(encoder);
-       bool enable = mode == DRM_MODE_DPMS_ON;
-
-       if (hdmienc->enabled == enable)
-               return;
-
-       if (enable)
-               rcar_du_hdmienc_enable(encoder);
-       else
-               rcar_du_hdmienc_disable(encoder);
-}
-
 static bool rcar_du_hdmienc_mode_fixup(struct drm_encoder *encoder,
                                       const struct drm_display_mode *mode,
                                       struct drm_display_mode *adjusted_mode)
@@ -110,7 +96,6 @@ static void rcar_du_hdmienc_mode_set(struct drm_encoder *encoder,
 }
 
 static const struct drm_encoder_helper_funcs encoder_helper_funcs = {
-       .dpms = rcar_du_hdmienc_dpms,
        .mode_fixup = rcar_du_hdmienc_mode_fixup,
        .mode_set = rcar_du_hdmienc_mode_set,
        .disable = rcar_du_hdmienc_disable,
index 4bfa3ce34ab3669708801e6ebf59d97ce88432b9..0c43032fc69318b294d3cf2baa29862bedb77d14 100644 (file)
@@ -75,7 +75,7 @@ rcar_du_lvds_connector_detect(struct drm_connector *connector, bool force)
 }
 
 static const struct drm_connector_funcs connector_funcs = {
-       .dpms = drm_helper_connector_dpms,
+       .dpms = drm_atomic_helper_connector_dpms,
        .reset = drm_atomic_helper_connector_reset,
        .detect = rcar_du_lvds_connector_detect,
        .fill_modes = drm_helper_probe_single_connector_modes,
@@ -121,7 +121,7 @@ int rcar_du_lvds_connector_init(struct rcar_du_device *rcdu,
        if (ret < 0)
                return ret;
 
-       drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF);
+       connector->dpms = DRM_MODE_DPMS_OFF;
        drm_object_property_set_value(&connector->base,
                rcdu->ddev->mode_config.dpms_property, DRM_MODE_DPMS_OFF);
 
index a110cf22f3b0a6e9a6a184e929053c87c9411361..e0a5d8f939630a5d21319671f8a32981c4c09a6a 100644 (file)
@@ -44,7 +44,7 @@ rcar_du_vga_connector_detect(struct drm_connector *connector, bool force)
 }
 
 static const struct drm_connector_funcs connector_funcs = {
-       .dpms = drm_helper_connector_dpms,
+       .dpms = drm_atomic_helper_connector_dpms,
        .reset = drm_atomic_helper_connector_reset,
        .detect = rcar_du_vga_connector_detect,
        .fill_modes = drm_helper_probe_single_connector_modes,
@@ -80,7 +80,7 @@ int rcar_du_vga_connector_init(struct rcar_du_device *rcdu,
        if (ret < 0)
                return ret;
 
-       drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF);
+       connector->dpms = DRM_MODE_DPMS_OFF;
        drm_object_property_set_value(&connector->base,
                rcdu->ddev->mode_config.dpms_property, DRM_MODE_DPMS_OFF);