drm/i915: Drop FBDEV #ifdev in mst code
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 4 Jul 2017 15:18:22 +0000 (17:18 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 6 Jul 2017 08:00:33 +0000 (10:00 +0200)
Since

commit a03fdcb1863297481a4b817c2a759cafcbdfa0ae
Author: Archit Taneja <architt@codeaurora.org>
Date:   Wed Aug 5 12:28:57 2015 +0530

    drm: Add top level Kconfig option for DRM fbdev emulation

this is properly handled using dummy functions. This essentially
undoes

commit 7296c849bf2eca2bd7d34a4686a53e3089150ac1
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Jul 22 20:10:28 2014 +1000

    drm/i915: fix build without fbde

v2: We also need to drop the #ifdef from headers. Seems like a small
price to pay for slightly cleaner code.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170704151833.17304-3-daniel.vetter@ffwll.ch
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_dp_mst.c

index e1f7c97a338a8e0744f673274ee83170fa2e0691..2981014fcfe2f0dce737d28de641bf05b57fc5de 100644 (file)
@@ -2303,11 +2303,9 @@ struct drm_i915_private {
 
        struct drm_i915_gem_object *vlv_pctx;
 
-#ifdef CONFIG_DRM_FBDEV_EMULATION
        /* list of fbdev register on this device */
        struct intel_fbdev *fbdev;
        struct work_struct fbdev_suspend_work;
-#endif
 
        struct drm_property *broadcast_rgb_property;
        struct drm_property *force_audio_property;
index 9aa9592844973e8952cacfed70566ab12b63e98b..e4ea968b1d6bf5ef354bf05d9e8e4202f00fc3dc 100644 (file)
@@ -443,28 +443,6 @@ static bool intel_dp_mst_get_hw_state(struct intel_connector *connector)
        return false;
 }
 
-static void intel_connector_add_to_fbdev(struct intel_connector *connector)
-{
-#ifdef CONFIG_DRM_FBDEV_EMULATION
-       struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
-
-       if (dev_priv->fbdev)
-               drm_fb_helper_add_one_connector(&dev_priv->fbdev->helper,
-                                               &connector->base);
-#endif
-}
-
-static void intel_connector_remove_from_fbdev(struct intel_connector *connector)
-{
-#ifdef CONFIG_DRM_FBDEV_EMULATION
-       struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
-
-       if (dev_priv->fbdev)
-               drm_fb_helper_remove_one_connector(&dev_priv->fbdev->helper,
-                                                  &connector->base);
-#endif
-}
-
 static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, const char *pathprop)
 {
        struct intel_dp *intel_dp = container_of(mgr, struct intel_dp, mst_mgr);
@@ -500,28 +478,32 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo
 
 static void intel_dp_register_mst_connector(struct drm_connector *connector)
 {
-       struct intel_connector *intel_connector = to_intel_connector(connector);
+       struct drm_i915_private *dev_priv = to_i915(connector->dev);
 
-       intel_connector_add_to_fbdev(intel_connector);
+       if (dev_priv->fbdev)
+               drm_fb_helper_add_one_connector(&dev_priv->fbdev->helper,
+                                               connector);
 
-       drm_connector_register(&intel_connector->base);
+       drm_connector_register(connector);
 }
 
 static void intel_dp_destroy_mst_connector(struct drm_dp_mst_topology_mgr *mgr,
                                           struct drm_connector *connector)
 {
        struct intel_connector *intel_connector = to_intel_connector(connector);
+       struct drm_i915_private *dev_priv = to_i915(connector->dev);
 
        drm_connector_unregister(connector);
 
-       /* need to nuke the connector */
-       intel_connector_remove_from_fbdev(intel_connector);
+       if (dev_priv->fbdev)
+               drm_fb_helper_remove_one_connector(&dev_priv->fbdev->helper,
+                                                  connector);
        /* prevent race with the check in ->detect */
        drm_modeset_lock(&connector->dev->mode_config.connection_mutex, NULL);
        intel_connector->mst_port = NULL;
        drm_modeset_unlock(&connector->dev->mode_config.connection_mutex);
 
-       drm_connector_unreference(&intel_connector->base);
+       drm_connector_unreference(connector);
        DRM_DEBUG_KMS("\n");
 }