drm: omapdrm: Switch connector DPMS to atomic helpers
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Thu, 5 Mar 2015 20:50:51 +0000 (22:50 +0200)
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Fri, 12 Jun 2015 19:52:48 +0000 (22:52 +0300)
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@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/gpu/drm/omapdrm/omap_connector.c
drivers/gpu/drm/omapdrm/omap_crtc.c
drivers/gpu/drm/omapdrm/omap_encoder.c

index d170f0cb1aa9767b0dea3449d5c8be771a2f19c3..83f2a9177c149c3f990ccd6ec76bdac3b8c2825a 100644 (file)
@@ -260,7 +260,7 @@ struct drm_encoder *omap_connector_attached_encoder(
 }
 
 static const struct drm_connector_funcs omap_connector_funcs = {
-       .dpms = drm_helper_connector_dpms,
+       .dpms = drm_atomic_helper_connector_dpms,
        .reset = drm_atomic_helper_connector_reset,
        .detect = omap_connector_detect,
        .fill_modes = drm_helper_probe_single_connector_modes,
index 68bf38bd0ce268651226aab96dcafd12bd5dfed0..5216fb07b534e3a309e67ff2b8f04192c6bcf68e 100644 (file)
@@ -592,19 +592,6 @@ static void omap_crtc_mode_set_nofb(struct drm_crtc *crtc)
        copy_timings_drm_to_omap(&omap_crtc->timings, mode);
 }
 
-static void omap_crtc_dpms(struct drm_crtc *crtc, int mode)
-{
-       struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
-       bool enable = (mode == DRM_MODE_DPMS_ON);
-
-       DBG("%s: %d", omap_crtc->name, mode);
-
-       if (enable)
-               omap_crtc_enable(crtc);
-       else
-               omap_crtc_disable(crtc);
-}
-
 static void omap_crtc_atomic_begin(struct drm_crtc *crtc)
 {
        dispc_runtime_get();
@@ -749,7 +736,6 @@ static const struct drm_crtc_funcs omap_crtc_funcs = {
 };
 
 static const struct drm_crtc_helper_funcs omap_crtc_helper_funcs = {
-       .dpms = omap_crtc_dpms,
        .mode_fixup = omap_crtc_mode_fixup,
        .mode_set_nofb = omap_crtc_mode_set_nofb,
        .disable = omap_crtc_disable,
index 96459f7091478b37537065cea7755e37fedabbda..2aeb41f0881ae3bacf27a6fc7e90be2d737232de 100644 (file)
@@ -62,22 +62,6 @@ static const struct drm_encoder_funcs omap_encoder_funcs = {
        .destroy = omap_encoder_destroy,
 };
 
-/*
- * The CRTC drm_crtc_helper_set_mode() doesn't really give us the right
- * order.. the easiest way to work around this for now is to make all
- * the encoder-helper's no-op's and have the omap_crtc code take care
- * of the sequencing and call us in the right points.
- *
- * Eventually to handle connecting CRTCs to different encoders properly,
- * either the CRTC helpers need to change or we need to replace
- * drm_crtc_helper_set_mode(), but lets wait until atomic-modeset for
- * that.
- */
-
-static void omap_encoder_dpms(struct drm_encoder *encoder, int mode)
-{
-}
-
 static bool omap_encoder_mode_fixup(struct drm_encoder *encoder,
                                  const struct drm_display_mode *mode,
                                  struct drm_display_mode *adjusted_mode)
@@ -116,6 +100,15 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder,
        }
 }
 
+/*
+ * The CRTC drm_crtc_helper_set_mode() didn't really give us the right order.
+ * The easiest way to work around this was to make all the encoder-helper's
+ * no-op's and have the omap_crtc code take care of the sequencing and call
+ * us in the right points.
+ *
+ * FIXME: Revisit this after switching to atomic updates completely.
+ */
+
 static void omap_encoder_disable(struct drm_encoder *encoder)
 {
 }
@@ -125,7 +118,6 @@ static void omap_encoder_enable(struct drm_encoder *encoder)
 }
 
 static const struct drm_encoder_helper_funcs omap_encoder_helper_funcs = {
-       .dpms = omap_encoder_dpms,
        .mode_fixup = omap_encoder_mode_fixup,
        .mode_set = omap_encoder_mode_set,
        .disable = omap_encoder_disable,