OSDN Git Service

drm: Add an HPD poll helper to reschedule the poll work
[tomoyo/tomoyo-test1.git] / include / drm / drm_probe_helper.h
1 // SPDX-License-Identifier: GPL-2.0 OR MIT
2
3 #ifndef __DRM_PROBE_HELPER_H__
4 #define __DRM_PROBE_HELPER_H__
5
6 #include <drm/drm_modes.h>
7
8 struct drm_connector;
9 struct drm_crtc;
10 struct drm_device;
11 struct drm_modeset_acquire_ctx;
12
13 int drm_helper_probe_single_connector_modes(struct drm_connector
14                                             *connector, uint32_t maxX,
15                                             uint32_t maxY);
16 int drm_helper_probe_detect(struct drm_connector *connector,
17                             struct drm_modeset_acquire_ctx *ctx,
18                             bool force);
19 void drm_kms_helper_poll_init(struct drm_device *dev);
20 void drm_kms_helper_poll_fini(struct drm_device *dev);
21 bool drm_helper_hpd_irq_event(struct drm_device *dev);
22 bool drm_connector_helper_hpd_irq_event(struct drm_connector *connector);
23 void drm_kms_helper_hotplug_event(struct drm_device *dev);
24 void drm_kms_helper_connector_hotplug_event(struct drm_connector *connector);
25
26 void drm_kms_helper_poll_disable(struct drm_device *dev);
27 void drm_kms_helper_poll_enable(struct drm_device *dev);
28 void drm_kms_helper_poll_reschedule(struct drm_device *dev);
29 bool drm_kms_helper_is_poll_worker(void);
30
31 enum drm_mode_status drm_crtc_helper_mode_valid_fixed(struct drm_crtc *crtc,
32                                                       const struct drm_display_mode *mode,
33                                                       const struct drm_display_mode *fixed_mode);
34
35 int drm_connector_helper_get_modes_from_ddc(struct drm_connector *connector);
36 int drm_connector_helper_get_modes_fixed(struct drm_connector *connector,
37                                          const struct drm_display_mode *fixed_mode);
38 int drm_connector_helper_get_modes(struct drm_connector *connector);
39 int drm_connector_helper_tv_get_modes(struct drm_connector *connector);
40
41 #endif