From: Dmitry Baryshkov dmitry.baryshkov@linaro.org
commit c8268795c9a9cc7be50f78d4502fad83a2a4f8df upstream
This is not a direct cherry-pick of the upstream commit. Only the helper functions required as dependencies for "drm/i915: Fix HPD polling, reenabling the output poll work as needed" were extracted from the original commit. The rest of the code was not applied, as the codebase has diverged significantly from upstream.
This partial adaptation ensures that the required drm_connector_helper_funcs are available for the dependent fix, while minimizing changes to the existing code.
Introduce two drm_connector_helper_funcs: enable_hpd() and disable_hpd(). They are called by drm_kms_helper_poll_enable() and drm_kms_helper_poll_disable() (and thus drm_kms_helper_poll_init() and drm_kms_helper_poll_fini()) respectively.
This allows DRM drivers to rely on drm_kms_helper_poll for enabling and disabling HPD detection rather than doing that manually.
Signed-off-by: Dmitry Baryshkov dmitry.baryshkov@linaro.org Reviewed-by: Tomi Valkeinen tomi.valkeinen@ideasonboard.com Signed-off-by: Neil Armstrong neil.armstrong@linaro.org Link: https://patchwork.freedesktop.org/patch/msgid/20221102180705.459294-3-dmitry... Signed-off-by: Nicusor Huhulea nicusor.huhulea@siemens.com --- include/drm/drm_modeset_helper_vtables.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h index 6f19cf5c210e..54f4848a655a 100644 --- a/include/drm/drm_modeset_helper_vtables.h +++ b/include/drm/drm_modeset_helper_vtables.h @@ -1144,6 +1144,28 @@ struct drm_connector_helper_funcs { */ void (*cleanup_writeback_job)(struct drm_writeback_connector *connector, struct drm_writeback_job *job); + + /** + * @enable_hpd: + * + * Enable hot-plug detection for the connector. + * + * This operation is optional. + * + * This callback is used by the drm_kms_helper_poll_enable() helpers. + */ + void (*enable_hpd)(struct drm_connector *connector); + + /** + * @disable_hpd: + * + * Disable hot-plug detection for the connector. + * + * This operation is optional. + * + * This callback is used by the drm_kms_helper_poll_disable() helpers. + */ + void (*disable_hpd)(struct drm_connector *connector); };
/**