drm/atomic-helper: Unexport drm_atomic_helper_best_encoder
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 4 Oct 2018 20:24:27 +0000 (22:24 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 5 Oct 2018 16:04:09 +0000 (18:04 +0200)
It's the default. The exported version was kinda a transition state,
before we made this the default.

To stop new atomic drivers from using it (instead of just relying on
the default) let's unexport it.

v2: rename the default implementation to a more fitting name and add a
comment (Laurent)

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Gustavo Padovan <gustavo@padovan.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: David Airlie <airlied@linux.ie>
Cc: VMware Graphics <linux-graphics-maintainer@vmware.com>
Cc: Sinclair Yeh <syeh@vmware.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Cc: Archit Taneja <architt@codeaurora.org>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Russell King <rmk+kernel@armlinux.org.uk>
Cc: Jernej Skrabec <jernej.skrabec@siol.net>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Pierre-Hugues Husson <phh@phh.me>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181004202446.22905-3-daniel.vetter@ffwll.ch
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
drivers/gpu/drm/drm_atomic_helper.c
drivers/gpu/drm/vmwgfx/vmwgfx_ldu.c
drivers/gpu/drm/vmwgfx/vmwgfx_scrn.c
drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c
include/drm/drm_atomic_helper.h

index ac37c50d6c4bbcf622c60fc186d85fe637d1c4a3..5ac979d3450b4e346c69993ef900e4af39b28149 100644 (file)
@@ -1957,7 +1957,6 @@ static const struct drm_connector_funcs dw_hdmi_connector_funcs = {
 
 static const struct drm_connector_helper_funcs dw_hdmi_connector_helper_funcs = {
        .get_modes = dw_hdmi_connector_get_modes,
-       .best_encoder = drm_atomic_helper_best_encoder,
 };
 
 static int dw_hdmi_bridge_attach(struct drm_bridge *bridge)
index e49b22381048a912000b71f26d8f8bb6cf3d9a65..8acd89d2d1b31951c9ccbe77a8e3230b53c221b9 100644 (file)
@@ -92,6 +92,17 @@ drm_atomic_helper_plane_changed(struct drm_atomic_state *state,
        }
 }
 
+/*
+ * For connectors that support multiple encoders, either the
+ * .atomic_best_encoder() or .best_encoder() operation must be implemented.
+ */
+static struct drm_encoder *
+pick_single_encoder_for_connector(struct drm_connector *connector)
+{
+       WARN_ON(connector->encoder_ids[1]);
+       return drm_encoder_find(connector->dev, NULL, connector->encoder_ids[0]);
+}
+
 static int handle_conflicting_encoders(struct drm_atomic_state *state,
                                       bool disable_conflicting_encoders)
 {
@@ -119,7 +130,7 @@ static int handle_conflicting_encoders(struct drm_atomic_state *state,
                else if (funcs->best_encoder)
                        new_encoder = funcs->best_encoder(connector);
                else
-                       new_encoder = drm_atomic_helper_best_encoder(connector);
+                       new_encoder = pick_single_encoder_for_connector(connector);
 
                if (new_encoder) {
                        if (encoder_mask & drm_encoder_mask(new_encoder)) {
@@ -316,7 +327,7 @@ update_connector_routing(struct drm_atomic_state *state,
        else if (funcs->best_encoder)
                new_encoder = funcs->best_encoder(connector);
        else
-               new_encoder = drm_atomic_helper_best_encoder(connector);
+               new_encoder = pick_single_encoder_for_connector(connector);
 
        if (!new_encoder) {
                DRM_DEBUG_ATOMIC("No suitable encoder found for [CONNECTOR:%d:%s]\n",
@@ -3389,23 +3400,6 @@ fail:
 }
 EXPORT_SYMBOL(drm_atomic_helper_page_flip_target);
 
-/**
- * drm_atomic_helper_best_encoder - Helper for
- *     &drm_connector_helper_funcs.best_encoder callback
- * @connector: Connector control structure
- *
- * This is a &drm_connector_helper_funcs.best_encoder callback helper for
- * connectors that support exactly 1 encoder, statically determined at driver
- * init time.
- */
-struct drm_encoder *
-drm_atomic_helper_best_encoder(struct drm_connector *connector)
-{
-       WARN_ON(connector->encoder_ids[1]);
-       return drm_encoder_find(connector->dev, NULL, connector->encoder_ids[0]);
-}
-EXPORT_SYMBOL(drm_atomic_helper_best_encoder);
-
 /**
  * DOC: atomic state reset and initialization
  *
index 72357811719122f70f36ea420786b0333a787e0a..4b5378495eea78718ae37adab77f488642d34968 100644 (file)
@@ -274,7 +274,6 @@ static const struct drm_connector_funcs vmw_legacy_connector_funcs = {
 
 static const struct
 drm_connector_helper_funcs vmw_ldu_connector_helper_funcs = {
-       .best_encoder = drm_atomic_helper_best_encoder,
 };
 
 /*
index ad0de7f0cd60f07006e58fe4a544b19b973ccb87..4c68ad6f3605038d65370631ecef95fc3be27fc8 100644 (file)
@@ -389,7 +389,6 @@ static const struct drm_connector_funcs vmw_sou_connector_funcs = {
 
 static const struct
 drm_connector_helper_funcs vmw_sou_connector_helper_funcs = {
-       .best_encoder = drm_atomic_helper_best_encoder,
 };
 
 
index f30e839f7bfd2d946bbe908e20211719646ff8b5..e28bb08114a51de3fe1454655a7d4def48de41e8 100644 (file)
@@ -1037,7 +1037,6 @@ static const struct drm_connector_funcs vmw_stdu_connector_funcs = {
 
 static const struct
 drm_connector_helper_funcs vmw_stdu_connector_helper_funcs = {
-       .best_encoder = drm_atomic_helper_best_encoder,
 };
 
 
index 657af7b393790b68298cf10c73e513d1201a394d..e60c4f0f8827fd087c2786ad3fff4827e1f0dd00 100644 (file)
@@ -144,8 +144,6 @@ int drm_atomic_helper_page_flip_target(
                                uint32_t flags,
                                uint32_t target,
                                struct drm_modeset_acquire_ctx *ctx);
-struct drm_encoder *
-drm_atomic_helper_best_encoder(struct drm_connector *connector);
 
 /* default implementations for state handling */
 void drm_atomic_helper_crtc_reset(struct drm_crtc *crtc);