aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'linux-core/drm_crtc_helper.h')
-rw-r--r--linux-core/drm_crtc_helper.h98
1 files changed, 0 insertions, 98 deletions
diff --git a/linux-core/drm_crtc_helper.h b/linux-core/drm_crtc_helper.h
deleted file mode 100644
index a0dd6675..00000000
--- a/linux-core/drm_crtc_helper.h
+++ /dev/null
@@ -1,98 +0,0 @@
1/*
2 * Copyright © 2006 Keith Packard
3 * Copyright © 2007 Intel Corporation
4 * Jesse Barnes <jesse.barnes@intel.com>
5 */
6
7/*
8 * The DRM mode setting helper functions are common code for drivers to use if they wish.
9 * Drivers are not forced to use this code in their implementations but it would be useful
10 * if they code they do use at least provides a consistent interface and operation to userspace
11 */
12
13#ifndef __DRM_CRTC_HELPER_H__
14#define __DRM_CRTC_HELPER_H__
15
16#include <linux/i2c.h>
17#include <linux/spinlock.h>
18#include <linux/types.h>
19#include <linux/idr.h>
20
21#include <linux/fb.h>
22
23struct drm_crtc_helper_funcs {
24 /*
25 * Control power levels on the CRTC. If the mode passed in is
26 * unsupported, the provider must use the next lowest power level.
27 */
28 void (*dpms)(struct drm_crtc *crtc, int mode);
29 void (*prepare)(struct drm_crtc *crtc);
30 void (*commit)(struct drm_crtc *crtc);
31
32 /* Provider can fixup or change mode timings before modeset occurs */
33 bool (*mode_fixup)(struct drm_crtc *crtc,
34 struct drm_display_mode *mode,
35 struct drm_display_mode *adjusted_mode);
36 /* Actually set the mode */
37 void (*mode_set)(struct drm_crtc *crtc, struct drm_display_mode *mode,
38 struct drm_display_mode *adjusted_mode, int x, int y);
39
40 /* Move the crtc on the current fb to the given position *optional* */
41 void (*mode_set_base)(struct drm_crtc *crtc, int x, int y);
42};
43
44struct drm_encoder_helper_funcs {
45 void (*dpms)(struct drm_encoder *encoder, int mode);
46 void (*save)(struct drm_encoder *encoder);
47 void (*restore)(struct drm_encoder *encoder);
48
49 bool (*mode_fixup)(struct drm_encoder *encoder,
50 struct drm_display_mode *mode,
51 struct drm_display_mode *adjusted_mode);
52 void (*prepare)(struct drm_encoder *encoder);
53 void (*commit)(struct drm_encoder *encoder);
54 void (*mode_set)(struct drm_encoder *encoder,
55 struct drm_display_mode *mode,
56 struct drm_display_mode *adjusted_mode);
57 /* detect for DAC style encoders */
58 enum drm_connector_status (*detect)(struct drm_encoder *encoder, struct drm_connector *connector);
59};
60
61struct drm_connector_helper_funcs {
62 int (*get_modes)(struct drm_connector *connector);
63 int (*mode_valid)(struct drm_connector *connector,
64 struct drm_display_mode *mode);
65 struct drm_encoder *(*best_encoder)(struct drm_connector *connector);
66};
67
68extern void drm_helper_probe_single_connector_modes(struct drm_connector *connector, uint32_t maxX, uint32_t maxY);
69extern void drm_helper_disable_unused_functions(struct drm_device *dev);
70extern int drm_helper_hotplug_stage_two(struct drm_device *dev);
71extern bool drm_helper_initial_config(struct drm_device *dev, bool can_grow);
72extern int drm_crtc_helper_set_config(struct drm_mode_set *set);
73extern bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, struct drm_display_mode *mode,
74 int x, int y);
75extern bool drm_helper_crtc_in_use(struct drm_crtc *crtc);
76
77extern int drm_helper_mode_fill_fb_struct(struct drm_framebuffer *fb,
78 struct drm_mode_fb_cmd *mode_cmd);
79
80static inline void drm_crtc_helper_add(struct drm_crtc *crtc, const struct drm_crtc_helper_funcs *funcs)
81{
82 crtc->helper_private = (void *)funcs;
83}
84
85static inline void drm_encoder_helper_add(struct drm_encoder *encoder, const struct drm_encoder_helper_funcs *funcs)
86{
87 encoder->helper_private = (void *)funcs;
88}
89
90static inline void drm_connector_helper_add(struct drm_connector *connector, const struct drm_connector_helper_funcs *funcs)
91{
92 connector->helper_private = (void *)funcs;
93}
94
95extern int drm_helper_resume_force_mode(struct drm_device *dev);
96extern void drm_helper_set_connector_dpms(struct drm_connector *connector,
97 int dpms_mode);
98#endif