drm: Introduce drm_connector_{get,put}()
For consistency with other reference counting APIs in the kernel, add drm_connector_get() and drm_connector_put() functions to reference count connectors. Compatibility aliases are added to keep existing code working. To help speed up the transition, all the instances of the old functions in the DRM core are already replaced in this commit. The existing semantic patch for mode object reference count conversion is extended for these new helpers. Reviewed-by: Sean Paul <seanpaul@chromium.org> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170228144643.5668-4-thierry.reding@gmail.com
This commit is contained in:
@@ -465,7 +465,7 @@ drm_crtc_helper_disable(struct drm_crtc *crtc)
|
||||
connector->dpms = DRM_MODE_DPMS_OFF;
|
||||
|
||||
/* we keep a reference while the encoder is bound */
|
||||
drm_connector_unreference(connector);
|
||||
drm_connector_put(connector);
|
||||
}
|
||||
drm_connector_list_iter_put(&conn_iter);
|
||||
}
|
||||
@@ -623,7 +623,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
|
||||
for (ro = 0; ro < set->num_connectors; ro++) {
|
||||
if (set->connectors[ro]->encoder)
|
||||
continue;
|
||||
drm_connector_reference(set->connectors[ro]);
|
||||
drm_connector_get(set->connectors[ro]);
|
||||
}
|
||||
|
||||
/* a) traverse passed in connector list and get encoders for them */
|
||||
@@ -772,7 +772,7 @@ fail:
|
||||
for (ro = 0; ro < set->num_connectors; ro++) {
|
||||
if (set->connectors[ro]->encoder)
|
||||
continue;
|
||||
drm_connector_unreference(set->connectors[ro]);
|
||||
drm_connector_put(set->connectors[ro]);
|
||||
}
|
||||
|
||||
/* Try to restore the config */
|
||||
|
Reference in New Issue
Block a user