On Tue, Jul 25, 2017 at 11:23 AM, Maarten Lankhorst <maarten@xxxxxxxxxxxxxx> wrote: > Op 25-07-17 om 10:01 schreef Daniel Vetter: >> 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. > Legacy drivers didn't always hook it up either, probably why. :) > No use hooking it up in legacy world if you didn't expose a property. > > But yeah, good to fix this. With atomic, everyone has properties ... -Daniel >> Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxxx> >> Cc: Daniel Vetter <daniel.vetter@xxxxxxxxx> >> Cc: Jani Nikula <jani.nikula@xxxxxxxxxxxxxxx> >> Cc: Sean Paul <seanpaul@xxxxxxxxxxxx> >> Cc: David Airlie <airlied@xxxxxxxx> >> Cc: Ben Skeggs <bskeggs@xxxxxxxxxx> >> Cc: Benjamin Gaignard <benjamin.gaignard@xxxxxxxxxx> >> Cc: Vincent Abriou <vincent.abriou@xxxxxx> >> Cc: Eric Anholt <eric@xxxxxxxxxx> >> Cc: intel-gfx@xxxxxxxxxxxxxxxxxxxxx >> Cc: nouveau@xxxxxxxxxxxxxxxxxxxxx >> --- >> drivers/gpu/drm/drm_atomic.c | 3 +- >> drivers/gpu/drm/drm_atomic_helper.c | 55 ----------------------------- >> drivers/gpu/drm/i915/intel_crt.c | 1 - >> drivers/gpu/drm/i915/intel_dp.c | 1 - >> drivers/gpu/drm/i915/intel_dp_mst.c | 1 - >> drivers/gpu/drm/i915/intel_dsi.c | 1 - >> drivers/gpu/drm/i915/intel_dvo.c | 1 - >> drivers/gpu/drm/i915/intel_hdmi.c | 1 - >> drivers/gpu/drm/i915/intel_lvds.c | 1 - >> drivers/gpu/drm/i915/intel_sdvo.c | 1 - >> drivers/gpu/drm/i915/intel_tv.c | 1 - >> drivers/gpu/drm/nouveau/nouveau_connector.c | 3 -- >> drivers/gpu/drm/nouveau/nv50_display.c | 1 - >> drivers/gpu/drm/sti/sti_hdmi.c | 1 - >> drivers/gpu/drm/vc4/vc4_vec.c | 1 - >> include/drm/drm_atomic.h | 3 -- >> include/drm/drm_atomic_helper.h | 3 -- >> 17 files changed, 1 insertion(+), 78 deletions(-) >> >> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c >> index 395438a7a576..306fdca92abf 100644 >> --- a/drivers/gpu/drm/drm_atomic.c >> +++ b/drivers/gpu/drm/drm_atomic.c >> @@ -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) >> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c >> index 0482e39a7889..1ca0dcca6230 100644 >> --- a/drivers/gpu/drm/drm_atomic_helper.c >> +++ b/drivers/gpu/drm/drm_atomic_helper.c >> @@ -2967,61 +2967,6 @@ int drm_atomic_helper_resume(struct drm_device *dev, >> } >> 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, >> diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c >> index 84a1f5e85153..84c3a6dc7c2a 100644 >> --- a/drivers/gpu/drm/i915/intel_crt.c >> +++ b/drivers/gpu/drm/i915/intel_crt.c >> @@ -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, >> }; >> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c >> index 2d42d09428c9..19b082ea57ef 100644 >> --- a/drivers/gpu/drm/i915/intel_dp.c >> +++ b/drivers/gpu/drm/i915/intel_dp.c >> @@ -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, >> diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c >> index e4ea968b1d6b..59a6dfd48ed4 100644 >> --- a/drivers/gpu/drm/i915/intel_dp_mst.c >> +++ b/drivers/gpu/drm/i915/intel_dp_mst.c >> @@ -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, >> diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c >> index 50ec836da8b1..375e7cfcf207 100644 >> --- a/drivers/gpu/drm/i915/intel_dsi.c >> +++ b/drivers/gpu/drm/i915/intel_dsi.c >> @@ -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, >> diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c >> index c1544a53095d..6b1970542911 100644 >> --- a/drivers/gpu/drm/i915/intel_dvo.c >> +++ b/drivers/gpu/drm/i915/intel_dvo.c >> @@ -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, >> }; >> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c >> index 5609976539bf..3074190b9455 100644 >> --- a/drivers/gpu/drm/i915/intel_hdmi.c >> +++ b/drivers/gpu/drm/i915/intel_hdmi.c >> @@ -1765,7 +1765,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, >> diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c >> index 6fe5d7c3bc23..6579299f5d00 100644 >> --- a/drivers/gpu/drm/i915/intel_lvds.c >> +++ b/drivers/gpu/drm/i915/intel_lvds.c >> @@ -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, >> diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c >> index e58a47db9a9d..a8eee1984ddf 100644 >> --- a/drivers/gpu/drm/i915/intel_sdvo.c >> +++ b/drivers/gpu/drm/i915/intel_sdvo.c >> @@ -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, >> diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c >> index 784df024e230..e4ef2919b682 100644 >> --- a/drivers/gpu/drm/i915/intel_tv.c >> +++ b/drivers/gpu/drm/i915/intel_tv.c >> @@ -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, >> diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c >> index dab78c660dd6..2468e81918fd 100644 >> --- a/drivers/gpu/drm/nouveau/nouveau_connector.c >> +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c >> @@ -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); >> diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c >> index e2029f05bf7b..80a96eb08bbf 100644 >> --- a/drivers/gpu/drm/nouveau/nv50_display.c >> +++ b/drivers/gpu/drm/nouveau/nv50_display.c >> @@ -3122,7 +3122,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, >> diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c >> index dbc6a195d6f9..21f11dfae472 100644 >> --- a/drivers/gpu/drm/sti/sti_hdmi.c >> +++ b/drivers/gpu/drm/sti/sti_hdmi.c >> @@ -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, >> diff --git a/drivers/gpu/drm/vc4/vc4_vec.c b/drivers/gpu/drm/vc4/vc4_vec.c >> index 09c1e05765fa..369fea5a13a1 100644 >> --- a/drivers/gpu/drm/vc4/vc4_vec.c >> +++ b/drivers/gpu/drm/vc4/vc4_vec.c >> @@ -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, >> diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h >> index 1f6a2c768e4b..fccc09d5f2b3 100644 >> --- a/include/drm/drm_atomic.h >> +++ b/include/drm/drm_atomic.h >> @@ -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, >> diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h >> index a62aeb816dd8..619089a027ec 100644 >> --- a/include/drm/drm_atomic_helper.h >> +++ b/include/drm/drm_atomic_helper.h >> @@ -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, > > -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel