aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm/drm_fb_helper.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/drm/drm_fb_helper.h')
-rw-r--r--include/drm/drm_fb_helper.h67
1 files changed, 43 insertions, 24 deletions
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index 58c892a2cbfa..f0a6afc47e76 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -30,17 +30,12 @@
30#ifndef DRM_FB_HELPER_H 30#ifndef DRM_FB_HELPER_H
31#define DRM_FB_HELPER_H 31#define DRM_FB_HELPER_H
32 32
33struct drm_fb_helper;
34
33struct drm_fb_helper_crtc { 35struct drm_fb_helper_crtc {
34 uint32_t crtc_id; 36 uint32_t crtc_id;
35 struct drm_mode_set mode_set; 37 struct drm_mode_set mode_set;
36}; 38 struct drm_display_mode *desired_mode;
37
38
39struct drm_fb_helper_funcs {
40 void (*gamma_set)(struct drm_crtc *crtc, u16 red, u16 green,
41 u16 blue, int regno);
42 void (*gamma_get)(struct drm_crtc *crtc, u16 *red, u16 *green,
43 u16 *blue, int regno);
44}; 39};
45 40
46/* mode specified on the command line */ 41/* mode specified on the command line */
@@ -57,8 +52,28 @@ struct drm_fb_helper_cmdline_mode {
57 bool margins; 52 bool margins;
58}; 53};
59 54
55struct drm_fb_helper_surface_size {
56 u32 fb_width;
57 u32 fb_height;
58 u32 surface_width;
59 u32 surface_height;
60 u32 surface_bpp;
61 u32 surface_depth;
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};
73
60struct drm_fb_helper_connector { 74struct drm_fb_helper_connector {
61 struct drm_fb_helper_cmdline_mode cmdline_mode; 75 struct drm_fb_helper_cmdline_mode cmdline_mode;
76 struct drm_connector *connector;
62}; 77};
63 78
64struct drm_fb_helper { 79struct drm_fb_helper {
@@ -67,24 +82,26 @@ struct drm_fb_helper {
67 struct drm_display_mode *mode; 82 struct drm_display_mode *mode;
68 int crtc_count; 83 int crtc_count;
69 struct drm_fb_helper_crtc *crtc_info; 84 struct drm_fb_helper_crtc *crtc_info;
85 int connector_count;
86 struct drm_fb_helper_connector **connector_info;
70 struct drm_fb_helper_funcs *funcs; 87 struct drm_fb_helper_funcs *funcs;
71 int conn_limit; 88 int conn_limit;
89 struct fb_info *fbdev;
90 u32 pseudo_palette[17];
72 struct list_head kernel_fb_list; 91 struct list_head kernel_fb_list;
92
93 /* we got a hotplug but fbdev wasn't running the console
94 delay until next set_par */
95 bool delayed_hotplug;
73}; 96};
74 97
75int drm_fb_helper_single_fb_probe(struct drm_device *dev, 98int drm_fb_helper_single_fb_probe(struct drm_fb_helper *helper,
76 int preferred_bpp, 99 int preferred_bpp);
77 int (*fb_create)(struct drm_device *dev, 100
78 uint32_t fb_width, 101int drm_fb_helper_init(struct drm_device *dev,
79 uint32_t fb_height, 102 struct drm_fb_helper *helper, int crtc_count,
80 uint32_t surface_width, 103 int max_conn);
81 uint32_t surface_height, 104void drm_fb_helper_fini(struct drm_fb_helper *helper);
82 uint32_t surface_depth,
83 uint32_t surface_bpp,
84 struct drm_framebuffer **fb_ptr));
85int drm_fb_helper_init_crtc_count(struct drm_fb_helper *helper, int crtc_count,
86 int max_conn);
87void drm_fb_helper_free(struct drm_fb_helper *helper);
88int drm_fb_helper_blank(int blank, struct fb_info *info); 105int drm_fb_helper_blank(int blank, struct fb_info *info);
89int drm_fb_helper_pan_display(struct fb_var_screeninfo *var, 106int drm_fb_helper_pan_display(struct fb_var_screeninfo *var,
90 struct fb_info *info); 107 struct fb_info *info);
@@ -99,13 +116,15 @@ int drm_fb_helper_setcolreg(unsigned regno,
99 struct fb_info *info); 116 struct fb_info *info);
100 117
101void drm_fb_helper_restore(void); 118void drm_fb_helper_restore(void);
102void drm_fb_helper_fill_var(struct fb_info *info, struct drm_framebuffer *fb, 119void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper,
103 uint32_t fb_width, uint32_t fb_height); 120 uint32_t fb_width, uint32_t fb_height);
104void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch, 121void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
105 uint32_t depth); 122 uint32_t depth);
106 123
107int drm_fb_helper_add_connector(struct drm_connector *connector);
108int drm_fb_helper_parse_command_line(struct drm_device *dev);
109int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info); 124int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info);
110 125
126bool drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper);
127bool drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel);
128int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper);
129
111#endif 130#endif