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.h76
1 files changed, 52 insertions, 24 deletions
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index 58c892a2cbfa..9b55a94feada 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -30,17 +30,14 @@
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
33#include <linux/slow-work.h>
34
35struct drm_fb_helper;
36
33struct drm_fb_helper_crtc { 37struct drm_fb_helper_crtc {
34 uint32_t crtc_id; 38 uint32_t crtc_id;
35 struct drm_mode_set mode_set; 39 struct drm_mode_set mode_set;
36}; 40 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}; 41};
45 42
46/* mode specified on the command line */ 43/* mode specified on the command line */
@@ -57,8 +54,31 @@ struct drm_fb_helper_cmdline_mode {
57 bool margins; 54 bool margins;
58}; 55};
59 56
57struct drm_fb_helper_surface_size {
58 u32 fb_width;
59 u32 fb_height;
60 u32 surface_width;
61 u32 surface_height;
62 u32 surface_bpp;
63 u32 surface_depth;
64};
65
66struct drm_fb_helper_funcs {
67 void (*gamma_set)(struct drm_crtc *crtc, u16 red, u16 green,
68 u16 blue, int regno);
69 void (*gamma_get)(struct drm_crtc *crtc, u16 *red, u16 *green,
70 u16 *blue, int regno);
71
72 int (*fb_probe)(struct drm_fb_helper *helper,
73 struct drm_fb_helper_surface_size *sizes);
74
75 void (*fb_output_status_changed)(struct drm_fb_helper *helper);
76
77};
78
60struct drm_fb_helper_connector { 79struct drm_fb_helper_connector {
61 struct drm_fb_helper_cmdline_mode cmdline_mode; 80 struct drm_fb_helper_cmdline_mode cmdline_mode;
81 struct drm_connector *connector;
62}; 82};
63 83
64struct drm_fb_helper { 84struct drm_fb_helper {
@@ -67,24 +87,28 @@ struct drm_fb_helper {
67 struct drm_display_mode *mode; 87 struct drm_display_mode *mode;
68 int crtc_count; 88 int crtc_count;
69 struct drm_fb_helper_crtc *crtc_info; 89 struct drm_fb_helper_crtc *crtc_info;
90 int connector_count;
91 struct drm_fb_helper_connector **connector_info;
70 struct drm_fb_helper_funcs *funcs; 92 struct drm_fb_helper_funcs *funcs;
71 int conn_limit; 93 int conn_limit;
94 struct fb_info *fbdev;
95 u32 pseudo_palette[17];
72 struct list_head kernel_fb_list; 96 struct list_head kernel_fb_list;
97
98 struct delayed_slow_work output_status_change_slow_work;
99 bool poll_enabled;
100 /* we got a hotplug but fbdev wasn't running the console
101 delay until next set_par */
102 bool delayed_hotplug;
73}; 103};
74 104
75int drm_fb_helper_single_fb_probe(struct drm_device *dev, 105int drm_fb_helper_single_fb_probe(struct drm_fb_helper *helper,
76 int preferred_bpp, 106 int preferred_bpp);
77 int (*fb_create)(struct drm_device *dev, 107
78 uint32_t fb_width, 108int drm_fb_helper_init(struct drm_device *dev,
79 uint32_t fb_height, 109 struct drm_fb_helper *helper, int crtc_count,
80 uint32_t surface_width, 110 int max_conn, bool polled);
81 uint32_t surface_height, 111void 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); 112int drm_fb_helper_blank(int blank, struct fb_info *info);
89int drm_fb_helper_pan_display(struct fb_var_screeninfo *var, 113int drm_fb_helper_pan_display(struct fb_var_screeninfo *var,
90 struct fb_info *info); 114 struct fb_info *info);
@@ -99,13 +123,17 @@ int drm_fb_helper_setcolreg(unsigned regno,
99 struct fb_info *info); 123 struct fb_info *info);
100 124
101void drm_fb_helper_restore(void); 125void drm_fb_helper_restore(void);
102void drm_fb_helper_fill_var(struct fb_info *info, struct drm_framebuffer *fb, 126void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper,
103 uint32_t fb_width, uint32_t fb_height); 127 uint32_t fb_width, uint32_t fb_height);
104void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch, 128void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
105 uint32_t depth); 129 uint32_t depth);
106 130
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); 131int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info);
110 132
133bool drm_helper_fb_hotplug_event(struct drm_fb_helper *fb_helper,
134 bool polled);
135bool drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel);
136int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper);
137
138void drm_helper_fb_hpd_irq_event(struct drm_fb_helper *fb_helper);
111#endif 139#endif