xref: /linux/drivers/gpu/drm/drm_crtc_helper_internal.h (revision 1c26b8e09004477c070f0dccb2369438ef9e1fc9)
1e15c8f4bSDaniel Vetter /*
2e15c8f4bSDaniel Vetter  * Copyright © 2016 Intel Corporation
3e15c8f4bSDaniel Vetter  *
4e15c8f4bSDaniel Vetter  * Permission is hereby granted, free of charge, to any person obtaining a
5e15c8f4bSDaniel Vetter  * copy of this software and associated documentation files (the "Software"),
6e15c8f4bSDaniel Vetter  * to deal in the Software without restriction, including without limitation
7e15c8f4bSDaniel Vetter  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8e15c8f4bSDaniel Vetter  * and/or sell copies of the Software, and to permit persons to whom the
9e15c8f4bSDaniel Vetter  * Software is furnished to do so, subject to the following conditions:
10e15c8f4bSDaniel Vetter  *
11e15c8f4bSDaniel Vetter  * The above copyright notice and this permission notice shall be included in
12e15c8f4bSDaniel Vetter  * all copies or substantial portions of the Software.
13e15c8f4bSDaniel Vetter  *
14e15c8f4bSDaniel Vetter  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15e15c8f4bSDaniel Vetter  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16e15c8f4bSDaniel Vetter  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17e15c8f4bSDaniel Vetter  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18e15c8f4bSDaniel Vetter  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19e15c8f4bSDaniel Vetter  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20e15c8f4bSDaniel Vetter  * OTHER DEALINGS IN THE SOFTWARE.
21e15c8f4bSDaniel Vetter  */
22e15c8f4bSDaniel Vetter 
23e15c8f4bSDaniel Vetter /*
24e15c8f4bSDaniel Vetter  * This header file contains mode setting related functions and definitions
25e15c8f4bSDaniel Vetter  * which are only used within the drm kms helper module as internal
26e15c8f4bSDaniel Vetter  * implementation details and are not exported to drivers.
27e15c8f4bSDaniel Vetter  */
28e15c8f4bSDaniel Vetter 
29da251bf8SJose Abreu #include <drm/drm_connector.h>
30da251bf8SJose Abreu #include <drm/drm_crtc.h>
31e15c8f4bSDaniel Vetter #include <drm/drm_dp_helper.h>
32da251bf8SJose Abreu #include <drm/drm_encoder.h>
33da251bf8SJose Abreu #include <drm/drm_modes.h>
34e15c8f4bSDaniel Vetter 
35e15c8f4bSDaniel Vetter /* drm_fb_helper.c */
36699fbeeaSVille Syrjälä #ifdef CONFIG_DRM_FBDEV_EMULATION
37e15c8f4bSDaniel Vetter int drm_fb_helper_modinit(void);
38699fbeeaSVille Syrjälä #else
39699fbeeaSVille Syrjälä static inline int drm_fb_helper_modinit(void)
40699fbeeaSVille Syrjälä {
41699fbeeaSVille Syrjälä 	return 0;
42699fbeeaSVille Syrjälä }
43699fbeeaSVille Syrjälä #endif
44e15c8f4bSDaniel Vetter 
45e15c8f4bSDaniel Vetter /* drm_dp_aux_dev.c */
46e15c8f4bSDaniel Vetter #ifdef CONFIG_DRM_DP_AUX_CHARDEV
47e15c8f4bSDaniel Vetter int drm_dp_aux_dev_init(void);
48e15c8f4bSDaniel Vetter void drm_dp_aux_dev_exit(void);
49e15c8f4bSDaniel Vetter int drm_dp_aux_register_devnode(struct drm_dp_aux *aux);
50e15c8f4bSDaniel Vetter void drm_dp_aux_unregister_devnode(struct drm_dp_aux *aux);
51e15c8f4bSDaniel Vetter #else
52e15c8f4bSDaniel Vetter static inline int drm_dp_aux_dev_init(void)
53e15c8f4bSDaniel Vetter {
54e15c8f4bSDaniel Vetter 	return 0;
55e15c8f4bSDaniel Vetter }
56e15c8f4bSDaniel Vetter 
57e15c8f4bSDaniel Vetter static inline void drm_dp_aux_dev_exit(void)
58e15c8f4bSDaniel Vetter {
59e15c8f4bSDaniel Vetter }
60e15c8f4bSDaniel Vetter 
61e15c8f4bSDaniel Vetter static inline int drm_dp_aux_register_devnode(struct drm_dp_aux *aux)
62e15c8f4bSDaniel Vetter {
63e15c8f4bSDaniel Vetter 	return 0;
64e15c8f4bSDaniel Vetter }
65e15c8f4bSDaniel Vetter 
66e15c8f4bSDaniel Vetter static inline void drm_dp_aux_unregister_devnode(struct drm_dp_aux *aux)
67e15c8f4bSDaniel Vetter {
68e15c8f4bSDaniel Vetter }
69e15c8f4bSDaniel Vetter #endif
70da251bf8SJose Abreu 
71da251bf8SJose Abreu /* drm_probe_helper.c */
72da251bf8SJose Abreu enum drm_mode_status drm_crtc_mode_valid(struct drm_crtc *crtc,
73da251bf8SJose Abreu 					 const struct drm_display_mode *mode);
74da251bf8SJose Abreu enum drm_mode_status drm_encoder_mode_valid(struct drm_encoder *encoder,
75da251bf8SJose Abreu 					    const struct drm_display_mode *mode);
76*1c26b8e0SLyude Paul int
77*1c26b8e0SLyude Paul drm_connector_mode_valid(struct drm_connector *connector,
78*1c26b8e0SLyude Paul 			 struct drm_display_mode *mode,
79*1c26b8e0SLyude Paul 			 struct drm_modeset_acquire_ctx *ctx,
80*1c26b8e0SLyude Paul 			 enum drm_mode_status *status);
81a92462d6SJosé Roberto de Souza 
82a92462d6SJosé Roberto de Souza struct drm_encoder *
83a92462d6SJosé Roberto de Souza drm_connector_get_single_encoder(struct drm_connector *connector);
84