drm: Nuke drm_atomic_helper_connector_set_property
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 25 Jul 2017 08:01:20 +0000 (10:01 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 8 Aug 2017 12:47:37 +0000 (14:47 +0200)
It's dead code, the core handles all this directly now. This also
allows us to unexport drm_atomic_helper_connector_set_property.

The only special case is nouveau which used one function for both
pre-nv50 legacy modeset code and post-nv50 atomic world instead of 2
vtables. But amounts to exactly the same.

What is rather strange here is how few drivers set this up, I suspect
the earlier patch to handle properties in the core did end up fixing a
pile of possible issues.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: David Airlie <airlied@linux.ie>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Cc: Vincent Abriou <vincent.abriou@st.com>
Cc: Eric Anholt <eric@anholt.net>
Cc: intel-gfx@lists.freedesktop.org
Cc: nouveau@lists.freedesktop.org
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170725080122.20548-7-daniel.vetter@ffwll.ch
Acked-by: Vincent Abriou <vincent.abriou@st.com>
17 files changed:
drivers/gpu/drm/drm_atomic.c
drivers/gpu/drm/drm_atomic_helper.c
drivers/gpu/drm/i915/intel_crt.c
drivers/gpu/drm/i915/intel_dp.c
drivers/gpu/drm/i915/intel_dp_mst.c
drivers/gpu/drm/i915/intel_dsi.c
drivers/gpu/drm/i915/intel_dvo.c
drivers/gpu/drm/i915/intel_hdmi.c
drivers/gpu/drm/i915/intel_lvds.c
drivers/gpu/drm/i915/intel_sdvo.c
drivers/gpu/drm/i915/intel_tv.c
drivers/gpu/drm/nouveau/nouveau_connector.c
drivers/gpu/drm/nouveau/nv50_display.c
drivers/gpu/drm/sti/sti_hdmi.c
drivers/gpu/drm/vc4/vc4_vec.c
include/drm/drm_atomic.h
include/drm/drm_atomic_helper.h

index 395438a7a576771bf6d9bb71f1d1924d14000a04..306fdca92abf4f4c2ea30e9f4edc48714260ae4d 100644 (file)
@@ -1144,7 +1144,7 @@ EXPORT_SYMBOL(drm_atomic_get_connector_state);
  * RETURNS:
  * Zero on success, error code on failure
  */
-int drm_atomic_connector_set_property(struct drm_connector *connector,
+static int drm_atomic_connector_set_property(struct drm_connector *connector,
                struct drm_connector_state *state, struct drm_property *property,
                uint64_t val)
 {
@@ -1211,7 +1211,6 @@ int drm_atomic_connector_set_property(struct drm_connector *connector,
 
        return 0;
 }
-EXPORT_SYMBOL(drm_atomic_connector_set_property);
 
 static void drm_atomic_connector_print_state(struct drm_printer *p,
                const struct drm_connector_state *state)
index 73b76166d9054b09477dd7deeea465f15faa2e48..02bf658b7c42d48c87e4d9b9eb08988e9057cb72 100644 (file)
@@ -2953,61 +2953,6 @@ out:
 }
 EXPORT_SYMBOL(drm_atomic_helper_resume);
 
-/**
- * drm_atomic_helper_connector_set_property - helper for connector properties
- * @connector: DRM connector
- * @property: DRM property
- * @val: value of property
- *
- * Provides a default connector set_property handler using the atomic driver
- * interface.
- *
- * RETURNS:
- * Zero on success, error code on failure
- */
-int
-drm_atomic_helper_connector_set_property(struct drm_connector *connector,
-                                   struct drm_property *property,
-                                   uint64_t val)
-{
-       struct drm_atomic_state *state;
-       struct drm_connector_state *connector_state;
-       int ret = 0;
-
-       state = drm_atomic_state_alloc(connector->dev);
-       if (!state)
-               return -ENOMEM;
-
-       /* ->set_property is always called with all locks held. */
-       state->acquire_ctx = connector->dev->mode_config.acquire_ctx;
-retry:
-       connector_state = drm_atomic_get_connector_state(state, connector);
-       if (IS_ERR(connector_state)) {
-               ret = PTR_ERR(connector_state);
-               goto fail;
-       }
-
-       ret = drm_atomic_connector_set_property(connector, connector_state,
-                       property, val);
-       if (ret)
-               goto fail;
-
-       ret = drm_atomic_commit(state);
-fail:
-       if (ret == -EDEADLK)
-               goto backoff;
-
-       drm_atomic_state_put(state);
-       return ret;
-
-backoff:
-       drm_atomic_state_clear(state);
-       drm_atomic_legacy_backoff(state);
-
-       goto retry;
-}
-EXPORT_SYMBOL(drm_atomic_helper_connector_set_property);
-
 static int page_flip_common(struct drm_atomic_state *state,
                            struct drm_crtc *crtc,
                            struct drm_framebuffer *fb,
index 84a1f5e85153fe1af4f7cfde8a5e7bf1a00201d5..84c3a6dc7c2a51a2b4bfd4d2e8d65c012fe3783d 100644 (file)
@@ -807,7 +807,6 @@ static const struct drm_connector_funcs intel_crt_connector_funcs = {
        .late_register = intel_connector_register,
        .early_unregister = intel_connector_unregister,
        .destroy = intel_crt_destroy,
-       .set_property = drm_atomic_helper_connector_set_property,
        .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
        .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
 };
index 2d42d09428c93e0f790a3da07ac74c01baee56e8..19b082ea57efaa9a56f85e36abd8f94415ce9f7f 100644 (file)
@@ -5010,7 +5010,6 @@ static const struct drm_connector_funcs intel_dp_connector_funcs = {
        .dpms = drm_atomic_helper_connector_dpms,
        .force = intel_dp_force,
        .fill_modes = drm_helper_probe_single_connector_modes,
-       .set_property = drm_atomic_helper_connector_set_property,
        .atomic_get_property = intel_digital_connector_atomic_get_property,
        .atomic_set_property = intel_digital_connector_atomic_set_property,
        .late_register = intel_dp_connector_register,
index e4ea968b1d6bf5ef354bf05d9e8e4202f00fc3dc..59a6dfd48ed42a70b9b715af9206adf0d203212c 100644 (file)
@@ -349,7 +349,6 @@ static const struct drm_connector_funcs intel_dp_mst_connector_funcs = {
        .dpms = drm_atomic_helper_connector_dpms,
        .detect = intel_dp_mst_detect,
        .fill_modes = drm_helper_probe_single_connector_modes,
-       .set_property = drm_atomic_helper_connector_set_property,
        .late_register = intel_connector_register,
        .early_unregister = intel_connector_unregister,
        .destroy = intel_dp_mst_connector_destroy,
index 50ec836da8b1c3a112f9ad83114d4b317c067990..375e7cfcf2075c5dd451c6e1c18d5b7fee5fad0c 100644 (file)
@@ -1658,7 +1658,6 @@ static const struct drm_connector_funcs intel_dsi_connector_funcs = {
        .early_unregister = intel_connector_unregister,
        .destroy = intel_dsi_connector_destroy,
        .fill_modes = drm_helper_probe_single_connector_modes,
-       .set_property = drm_atomic_helper_connector_set_property,
        .atomic_get_property = intel_digital_connector_atomic_get_property,
        .atomic_set_property = intel_digital_connector_atomic_set_property,
        .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
index c1544a53095ddb353430f9468b2e644dff4ea673..6b1970542911b6d9f7cfc3745eab81a9a60b3ce1 100644 (file)
@@ -350,7 +350,6 @@ static const struct drm_connector_funcs intel_dvo_connector_funcs = {
        .early_unregister = intel_connector_unregister,
        .destroy = intel_dvo_destroy,
        .fill_modes = drm_helper_probe_single_connector_modes,
-       .set_property = drm_atomic_helper_connector_set_property,
        .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
        .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
 };
index 2f831cfdd24330050bdfc4f6645b9a419280b77c..ee06763d935008bb35e72be7fac0fc0fa925202d 100644 (file)
@@ -1710,7 +1710,6 @@ static const struct drm_connector_funcs intel_hdmi_connector_funcs = {
        .detect = intel_hdmi_detect,
        .force = intel_hdmi_force,
        .fill_modes = drm_helper_probe_single_connector_modes,
-       .set_property = drm_atomic_helper_connector_set_property,
        .atomic_get_property = intel_digital_connector_atomic_get_property,
        .atomic_set_property = intel_digital_connector_atomic_set_property,
        .late_register = intel_connector_register,
index 6fe5d7c3bc23bf149e67ab4af228efbd5bf0642c..6579299f5d00d162e351043ccf6e7ea21c6e5a3e 100644 (file)
@@ -598,7 +598,6 @@ static const struct drm_connector_funcs intel_lvds_connector_funcs = {
        .dpms = drm_atomic_helper_connector_dpms,
        .detect = intel_lvds_detect,
        .fill_modes = drm_helper_probe_single_connector_modes,
-       .set_property = drm_atomic_helper_connector_set_property,
        .atomic_get_property = intel_digital_connector_atomic_get_property,
        .atomic_set_property = intel_digital_connector_atomic_set_property,
        .late_register = intel_connector_register,
index e58a47db9a9de354ecce771d657e9fb340ef59c0..a8eee1984ddfc37fb67743fa68aeef66accd45b9 100644 (file)
@@ -2196,7 +2196,6 @@ static const struct drm_connector_funcs intel_sdvo_connector_funcs = {
        .dpms = drm_atomic_helper_connector_dpms,
        .detect = intel_sdvo_detect,
        .fill_modes = drm_helper_probe_single_connector_modes,
-       .set_property = drm_atomic_helper_connector_set_property,
        .atomic_get_property = intel_sdvo_connector_atomic_get_property,
        .atomic_set_property = intel_sdvo_connector_atomic_set_property,
        .late_register = intel_sdvo_connector_register,
index 784df024e23056ce08c7ec2ca53f23d8e143886f..e4ef2919b6826d5086b7457d9676dedbad0ebf44 100644 (file)
@@ -1411,7 +1411,6 @@ static const struct drm_connector_funcs intel_tv_connector_funcs = {
        .late_register = intel_connector_register,
        .early_unregister = intel_connector_unregister,
        .destroy = intel_tv_destroy,
-       .set_property = drm_atomic_helper_connector_set_property,
        .fill_modes = drm_helper_probe_single_connector_modes,
        .atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
        .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
index 147b22163f9f6839419ebe3051f492f20fd9e0eb..72a6595e652b680ae7ad41fe69b7089009d53ca9 100644 (file)
@@ -770,9 +770,6 @@ nouveau_connector_set_property(struct drm_connector *connector,
        struct drm_encoder *encoder = to_drm_encoder(nv_encoder);
        int ret;
 
-       if (drm_drv_uses_atomic_modeset(connector->dev))
-               return drm_atomic_helper_connector_set_property(connector, property, value);
-
        ret = connector->funcs->atomic_set_property(&nv_connector->base,
                                                    &asyc->state,
                                                    property, value);
index 5ed88e75c21ebdd0c61bab42b6d37432e146417a..183db13186d6644d551d8c7af959279ae072a16b 100644 (file)
@@ -3109,7 +3109,6 @@ nv50_mstc = {
        .reset = nouveau_conn_reset,
        .detect = nv50_mstc_detect,
        .fill_modes = drm_helper_probe_single_connector_modes,
-       .set_property = drm_atomic_helper_connector_set_property,
        .destroy = nv50_mstc_destroy,
        .atomic_duplicate_state = nouveau_conn_atomic_duplicate_state,
        .atomic_destroy_state = nouveau_conn_atomic_destroy_state,
index dbc6a195d6f912a936b338a1a89648a288d6b98e..21f11dfae4724d6d90354ded22923eb37f901fd2 100644 (file)
@@ -1118,7 +1118,6 @@ static const struct drm_connector_funcs sti_hdmi_connector_funcs = {
        .detect = sti_hdmi_connector_detect,
        .destroy = drm_connector_cleanup,
        .reset = drm_atomic_helper_connector_reset,
-       .set_property = drm_atomic_helper_connector_set_property,
        .atomic_set_property = sti_hdmi_connector_set_property,
        .atomic_get_property = sti_hdmi_connector_get_property,
        .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
index 09c1e05765fa7ea8b64dac9ca21a612d93db82e6..369fea5a13a148e30bf953b5de9acc11c1be25a6 100644 (file)
@@ -369,7 +369,6 @@ static const struct drm_connector_funcs vc4_vec_connector_funcs = {
        .dpms = drm_atomic_helper_connector_dpms,
        .detect = vc4_vec_connector_detect,
        .fill_modes = drm_helper_probe_single_connector_modes,
-       .set_property = drm_atomic_helper_connector_set_property,
        .destroy = vc4_vec_connector_destroy,
        .reset = drm_atomic_helper_connector_reset,
        .atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
index 7d0d110f911d57dc1b20bcb48b283222d8e4312b..711617fdf032c8f31164de97476ed72e013796b0 100644 (file)
@@ -318,9 +318,6 @@ drm_atomic_get_plane_state(struct drm_atomic_state *state,
 struct drm_connector_state * __must_check
 drm_atomic_get_connector_state(struct drm_atomic_state *state,
                               struct drm_connector *connector);
-int drm_atomic_connector_set_property(struct drm_connector *connector,
-               struct drm_connector_state *state, struct drm_property *property,
-               uint64_t val);
 
 void drm_atomic_private_obj_init(struct drm_private_obj *obj,
                                 struct drm_private_state *state,
index a62aeb816dd8acb1971102a283d003a1c84e7e23..619089a027ec5fb946ab5f2c63b5504608e03abd 100644 (file)
@@ -124,9 +124,6 @@ int drm_atomic_helper_commit_duplicated_state(struct drm_atomic_state *state,
 int drm_atomic_helper_resume(struct drm_device *dev,
                             struct drm_atomic_state *state);
 
-int drm_atomic_helper_connector_set_property(struct drm_connector *connector,
-                                       struct drm_property *property,
-                                       uint64_t val);
 int drm_atomic_helper_page_flip(struct drm_crtc *crtc,
                                struct drm_framebuffer *fb,
                                struct drm_pending_vblank_event *event,