1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30#ifndef DRM_FB_HELPER_H
31#define DRM_FB_HELPER_H
32
33struct drm_fb_helper;
34
35#include <linux/kgdb.h>
36
37struct drm_fb_helper_crtc {
38 struct drm_mode_set mode_set;
39 struct drm_display_mode *desired_mode;
40};
41
42struct drm_fb_helper_surface_size {
43 u32 fb_width;
44 u32 fb_height;
45 u32 surface_width;
46 u32 surface_height;
47 u32 surface_bpp;
48 u32 surface_depth;
49};
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64struct drm_fb_helper_funcs {
65 void (*gamma_set)(struct drm_crtc *crtc, u16 red, u16 green,
66 u16 blue, int regno);
67 void (*gamma_get)(struct drm_crtc *crtc, u16 *red, u16 *green,
68 u16 *blue, int regno);
69
70 int (*fb_probe)(struct drm_fb_helper *helper,
71 struct drm_fb_helper_surface_size *sizes);
72 bool (*initial_config)(struct drm_fb_helper *fb_helper,
73 struct drm_fb_helper_crtc **crtcs,
74 struct drm_display_mode **modes,
75 bool *enabled, int width, int height);
76};
77
78struct drm_fb_helper_connector {
79 struct drm_connector *connector;
80 struct drm_cmdline_mode cmdline_mode;
81};
82
83struct drm_fb_helper {
84 struct drm_framebuffer *fb;
85 struct drm_device *dev;
86 int crtc_count;
87 struct drm_fb_helper_crtc *crtc_info;
88 int connector_count;
89 struct drm_fb_helper_connector **connector_info;
90 struct drm_fb_helper_funcs *funcs;
91 struct fb_info *fbdev;
92 u32 pseudo_palette[17];
93 struct list_head kernel_fb_list;
94
95
96
97 bool delayed_hotplug;
98};
99
100int drm_fb_helper_init(struct drm_device *dev,
101 struct drm_fb_helper *helper, int crtc_count,
102 int max_conn);
103void drm_fb_helper_fini(struct drm_fb_helper *helper);
104int drm_fb_helper_blank(int blank, struct fb_info *info);
105int drm_fb_helper_pan_display(struct fb_var_screeninfo *var,
106 struct fb_info *info);
107int drm_fb_helper_set_par(struct fb_info *info);
108int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
109 struct fb_info *info);
110
111bool drm_fb_helper_restore_fbdev_mode(struct drm_fb_helper *fb_helper);
112void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper,
113 uint32_t fb_width, uint32_t fb_height);
114void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
115 uint32_t depth);
116
117int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info);
118
119int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper);
120bool drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel);
121int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper);
122int drm_fb_helper_debug_enter(struct fb_info *info);
123int drm_fb_helper_debug_leave(struct fb_info *info);
124
125#endif
126