diff options
author | Dave Airlie <airlied@redhat.com> | 2010-03-30 01:34:18 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-04-06 20:30:38 -0400 |
commit | 4abe35204af82a018ca3ce6db4102aa09719698e (patch) | |
tree | fcc91e2e109fe311a673d5b99dc758aba3bb4a79 /include/drm | |
parent | 5c4426a782bc9509573fc7958a786ebd14fafdf3 (diff) |
drm/kms/fb: use slow work mechanism for normal hotplug also.
a) slow work is always used now for any fbcon hotplug, as its not
a fast task and is more suited to being ran under slow work.
b) attempt to not do any fbdev changes when X is running as we'll
just mess it up. This hooks set_par to hopefully do the changes
once X hands control to fbdev.
This also adds the nouveau/intel hotplug support.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drm_fb_helper.h | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h index a073d73c195e..9b55a94feada 100644 --- a/include/drm/drm_fb_helper.h +++ b/include/drm/drm_fb_helper.h | |||
@@ -32,20 +32,14 @@ | |||
32 | 32 | ||
33 | #include <linux/slow-work.h> | 33 | #include <linux/slow-work.h> |
34 | 34 | ||
35 | struct drm_fb_helper; | ||
36 | |||
35 | struct drm_fb_helper_crtc { | 37 | struct drm_fb_helper_crtc { |
36 | uint32_t crtc_id; | 38 | uint32_t crtc_id; |
37 | struct drm_mode_set mode_set; | 39 | struct drm_mode_set mode_set; |
38 | struct drm_display_mode *desired_mode; | 40 | struct drm_display_mode *desired_mode; |
39 | }; | 41 | }; |
40 | 42 | ||
41 | |||
42 | struct drm_fb_helper_funcs { | ||
43 | void (*gamma_set)(struct drm_crtc *crtc, u16 red, u16 green, | ||
44 | u16 blue, int regno); | ||
45 | void (*gamma_get)(struct drm_crtc *crtc, u16 *red, u16 *green, | ||
46 | u16 *blue, int regno); | ||
47 | }; | ||
48 | |||
49 | /* mode specified on the command line */ | 43 | /* mode specified on the command line */ |
50 | struct drm_fb_helper_cmdline_mode { | 44 | struct drm_fb_helper_cmdline_mode { |
51 | bool specified; | 45 | bool specified; |
@@ -69,6 +63,19 @@ struct drm_fb_helper_surface_size { | |||
69 | u32 surface_depth; | 63 | u32 surface_depth; |
70 | }; | 64 | }; |
71 | 65 | ||
66 | struct 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 | |||
72 | struct drm_fb_helper_connector { | 79 | struct drm_fb_helper_connector { |
73 | struct drm_fb_helper_cmdline_mode cmdline_mode; | 80 | struct drm_fb_helper_cmdline_mode cmdline_mode; |
74 | struct drm_connector *connector; | 81 | struct drm_connector *connector; |
@@ -88,21 +95,20 @@ struct drm_fb_helper { | |||
88 | u32 pseudo_palette[17]; | 95 | u32 pseudo_palette[17]; |
89 | struct list_head kernel_fb_list; | 96 | struct list_head kernel_fb_list; |
90 | 97 | ||
91 | struct delayed_slow_work output_poll_slow_work; | 98 | struct delayed_slow_work output_status_change_slow_work; |
92 | bool poll_enabled; | 99 | bool poll_enabled; |
93 | int (*fb_probe)(struct drm_fb_helper *helper, | 100 | /* we got a hotplug but fbdev wasn't running the console |
94 | struct drm_fb_helper_surface_size *sizes); | 101 | delay until next set_par */ |
95 | 102 | bool delayed_hotplug; | |
96 | void (*fb_poll_changed)(struct drm_fb_helper *helper); | ||
97 | }; | 103 | }; |
98 | 104 | ||
99 | int drm_fb_helper_single_fb_probe(struct drm_fb_helper *helper, | 105 | int drm_fb_helper_single_fb_probe(struct drm_fb_helper *helper, |
100 | int preferred_bpp); | 106 | int preferred_bpp); |
101 | 107 | ||
102 | int drm_fb_helper_init_crtc_count(struct drm_device *dev, | 108 | int drm_fb_helper_init(struct drm_device *dev, |
103 | struct drm_fb_helper *helper, int crtc_count, | 109 | struct drm_fb_helper *helper, int crtc_count, |
104 | int max_conn); | 110 | int max_conn, bool polled); |
105 | void drm_fb_helper_free(struct drm_fb_helper *helper); | 111 | void drm_fb_helper_fini(struct drm_fb_helper *helper); |
106 | int drm_fb_helper_blank(int blank, struct fb_info *info); | 112 | int drm_fb_helper_blank(int blank, struct fb_info *info); |
107 | int drm_fb_helper_pan_display(struct fb_var_screeninfo *var, | 113 | int drm_fb_helper_pan_display(struct fb_var_screeninfo *var, |
108 | struct fb_info *info); | 114 | struct fb_info *info); |
@@ -125,10 +131,9 @@ void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch, | |||
125 | int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info); | 131 | int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info); |
126 | 132 | ||
127 | bool drm_helper_fb_hotplug_event(struct drm_fb_helper *fb_helper, | 133 | bool drm_helper_fb_hotplug_event(struct drm_fb_helper *fb_helper, |
128 | u32 max_width, u32 max_height, bool polled); | 134 | bool polled); |
129 | bool drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper); | 135 | bool drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel); |
130 | int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper); | 136 | int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper); |
131 | 137 | ||
132 | void drm_fb_helper_poll_init(struct drm_fb_helper *fb_helper); | 138 | void drm_helper_fb_hpd_irq_event(struct drm_fb_helper *fb_helper); |
133 | void drm_fb_helper_poll_fini(struct drm_fb_helper *fb_helper); | ||
134 | #endif | 139 | #endif |