diff options
author | Dave Airlie <airlied@redhat.com> | 2010-04-19 23:16:04 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-04-19 23:16:04 -0400 |
commit | 7fff400be6fbf64f10abca9939718aaf1d61c255 (patch) | |
tree | 384118628f5c5aa2d74303cddd120de75308beea /include/drm | |
parent | 0bcb1d844ac638a4c4280f697d5bfac9791e9a70 (diff) | |
parent | b1f201980eb4a7a59277a13cf18acdbb46167ad5 (diff) |
Merge branch 'drm-fbdev-cleanup' into drm-core-next
* drm-fbdev-cleanup:
drm/fb: remove drm_fb_helper_setcolreg
drm/kms/fb: use slow work mechanism for normal hotplug also.
drm/kms/fb: add polling support for when nothing is connected.
drm/kms/fb: provide a 1024x768 fbcon if no outputs found.
drm/kms/fb: separate fbdev connector list from core drm connectors
drm/kms/fb: move to using fb helper crtc grouping instead of core crtc list
drm/fb: fix fbdev object model + cleanup properly.
Conflicts:
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/nouveau/nouveau_drv.h
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drm_crtc.h | 18 | ||||
-rw-r--r-- | include/drm/drm_crtc_helper.h | 6 | ||||
-rw-r--r-- | include/drm/drm_fb_helper.h | 76 |
3 files changed, 53 insertions, 47 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 8eb3630ee67d..c560364663a5 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
@@ -271,8 +271,6 @@ struct drm_framebuffer { | |||
271 | unsigned int depth; | 271 | unsigned int depth; |
272 | int bits_per_pixel; | 272 | int bits_per_pixel; |
273 | int flags; | 273 | int flags; |
274 | struct fb_info *fbdev; | ||
275 | u32 pseudo_palette[17]; | ||
276 | struct list_head filp_head; | 274 | struct list_head filp_head; |
277 | /* if you are using the helper */ | 275 | /* if you are using the helper */ |
278 | void *helper_private; | 276 | void *helper_private; |
@@ -369,9 +367,6 @@ struct drm_crtc_funcs { | |||
369 | * @enabled: is this CRTC enabled? | 367 | * @enabled: is this CRTC enabled? |
370 | * @x: x position on screen | 368 | * @x: x position on screen |
371 | * @y: y position on screen | 369 | * @y: y position on screen |
372 | * @desired_mode: new desired mode | ||
373 | * @desired_x: desired x for desired_mode | ||
374 | * @desired_y: desired y for desired_mode | ||
375 | * @funcs: CRTC control functions | 370 | * @funcs: CRTC control functions |
376 | * | 371 | * |
377 | * Each CRTC may have one or more connectors associated with it. This structure | 372 | * Each CRTC may have one or more connectors associated with it. This structure |
@@ -391,8 +386,6 @@ struct drm_crtc { | |||
391 | struct drm_display_mode mode; | 386 | struct drm_display_mode mode; |
392 | 387 | ||
393 | int x, y; | 388 | int x, y; |
394 | struct drm_display_mode *desired_mode; | ||
395 | int desired_x, desired_y; | ||
396 | const struct drm_crtc_funcs *funcs; | 389 | const struct drm_crtc_funcs *funcs; |
397 | 390 | ||
398 | /* CRTC gamma size for reporting to userspace */ | 391 | /* CRTC gamma size for reporting to userspace */ |
@@ -521,7 +514,6 @@ struct drm_connector { | |||
521 | uint32_t encoder_ids[DRM_CONNECTOR_MAX_ENCODER]; | 514 | uint32_t encoder_ids[DRM_CONNECTOR_MAX_ENCODER]; |
522 | uint32_t force_encoder_id; | 515 | uint32_t force_encoder_id; |
523 | struct drm_encoder *encoder; /* currently active encoder */ | 516 | struct drm_encoder *encoder; /* currently active encoder */ |
524 | void *fb_helper_private; | ||
525 | }; | 517 | }; |
526 | 518 | ||
527 | /** | 519 | /** |
@@ -548,16 +540,9 @@ struct drm_mode_set { | |||
548 | 540 | ||
549 | /** | 541 | /** |
550 | * struct drm_mode_config_funcs - configure CRTCs for a given screen layout | 542 | * struct drm_mode_config_funcs - configure CRTCs for a given screen layout |
551 | * @resize: adjust CRTCs as necessary for the proposed layout | ||
552 | * | ||
553 | * Currently only a resize hook is available. DRM will call back into the | ||
554 | * driver with a new screen width and height. If the driver can't support | ||
555 | * the proposed size, it can return false. Otherwise it should adjust | ||
556 | * the CRTC<->connector mappings as needed and update its view of the screen. | ||
557 | */ | 543 | */ |
558 | struct drm_mode_config_funcs { | 544 | struct drm_mode_config_funcs { |
559 | struct drm_framebuffer *(*fb_create)(struct drm_device *dev, struct drm_file *file_priv, struct drm_mode_fb_cmd *mode_cmd); | 545 | struct drm_framebuffer *(*fb_create)(struct drm_device *dev, struct drm_file *file_priv, struct drm_mode_fb_cmd *mode_cmd); |
560 | int (*fb_changed)(struct drm_device *dev); | ||
561 | }; | 546 | }; |
562 | 547 | ||
563 | struct drm_mode_group { | 548 | struct drm_mode_group { |
@@ -590,9 +575,6 @@ struct drm_mode_config { | |||
590 | 575 | ||
591 | struct list_head property_list; | 576 | struct list_head property_list; |
592 | 577 | ||
593 | /* in-kernel framebuffers - hung of filp_head in drm_framebuffer */ | ||
594 | struct list_head fb_kernel_list; | ||
595 | |||
596 | int min_width, min_height; | 578 | int min_width, min_height; |
597 | int max_width, max_height; | 579 | int max_width, max_height; |
598 | struct drm_mode_config_funcs *funcs; | 580 | struct drm_mode_config_funcs *funcs; |
diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h index b29e20168b5f..b1fa0f8cfa60 100644 --- a/include/drm/drm_crtc_helper.h +++ b/include/drm/drm_crtc_helper.h | |||
@@ -39,7 +39,6 @@ | |||
39 | 39 | ||
40 | #include <linux/fb.h> | 40 | #include <linux/fb.h> |
41 | 41 | ||
42 | #include "drm_fb_helper.h" | ||
43 | struct drm_crtc_helper_funcs { | 42 | struct drm_crtc_helper_funcs { |
44 | /* | 43 | /* |
45 | * Control power levels on the CRTC. If the mode passed in is | 44 | * Control power levels on the CRTC. If the mode passed in is |
@@ -96,8 +95,6 @@ struct drm_connector_helper_funcs { | |||
96 | 95 | ||
97 | extern int drm_helper_probe_single_connector_modes(struct drm_connector *connector, uint32_t maxX, uint32_t maxY); | 96 | extern int drm_helper_probe_single_connector_modes(struct drm_connector *connector, uint32_t maxX, uint32_t maxY); |
98 | extern void drm_helper_disable_unused_functions(struct drm_device *dev); | 97 | extern void drm_helper_disable_unused_functions(struct drm_device *dev); |
99 | extern int drm_helper_hotplug_stage_two(struct drm_device *dev); | ||
100 | extern bool drm_helper_initial_config(struct drm_device *dev); | ||
101 | extern int drm_crtc_helper_set_config(struct drm_mode_set *set); | 98 | extern int drm_crtc_helper_set_config(struct drm_mode_set *set); |
102 | extern bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, | 99 | extern bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, |
103 | struct drm_display_mode *mode, | 100 | struct drm_display_mode *mode, |
@@ -123,11 +120,10 @@ static inline void drm_encoder_helper_add(struct drm_encoder *encoder, | |||
123 | encoder->helper_private = (void *)funcs; | 120 | encoder->helper_private = (void *)funcs; |
124 | } | 121 | } |
125 | 122 | ||
126 | static inline int drm_connector_helper_add(struct drm_connector *connector, | 123 | static inline void drm_connector_helper_add(struct drm_connector *connector, |
127 | const struct drm_connector_helper_funcs *funcs) | 124 | const struct drm_connector_helper_funcs *funcs) |
128 | { | 125 | { |
129 | connector->helper_private = (void *)funcs; | 126 | connector->helper_private = (void *)funcs; |
130 | return drm_fb_helper_add_connector(connector); | ||
131 | } | 127 | } |
132 | 128 | ||
133 | extern int drm_helper_resume_force_mode(struct drm_device *dev); | 129 | extern int drm_helper_resume_force_mode(struct drm_device *dev); |
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 | |||
35 | struct drm_fb_helper; | ||
36 | |||
33 | struct drm_fb_helper_crtc { | 37 | struct 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 | |||
39 | struct 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 | ||
57 | struct 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 | |||
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 | |||
60 | struct drm_fb_helper_connector { | 79 | struct 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 | ||
64 | struct drm_fb_helper { | 84 | struct 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 | ||
75 | int drm_fb_helper_single_fb_probe(struct drm_device *dev, | 105 | int 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, | 108 | int 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, | 111 | void 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)); | ||
85 | int drm_fb_helper_init_crtc_count(struct drm_fb_helper *helper, int crtc_count, | ||
86 | int max_conn); | ||
87 | void drm_fb_helper_free(struct drm_fb_helper *helper); | ||
88 | int drm_fb_helper_blank(int blank, struct fb_info *info); | 112 | int drm_fb_helper_blank(int blank, struct fb_info *info); |
89 | int drm_fb_helper_pan_display(struct fb_var_screeninfo *var, | 113 | int 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 | ||
101 | void drm_fb_helper_restore(void); | 125 | void drm_fb_helper_restore(void); |
102 | void drm_fb_helper_fill_var(struct fb_info *info, struct drm_framebuffer *fb, | 126 | void 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); |
104 | void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch, | 128 | void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch, |
105 | uint32_t depth); | 129 | uint32_t depth); |
106 | 130 | ||
107 | int drm_fb_helper_add_connector(struct drm_connector *connector); | ||
108 | int drm_fb_helper_parse_command_line(struct drm_device *dev); | ||
109 | 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); |
110 | 132 | ||
133 | bool drm_helper_fb_hotplug_event(struct drm_fb_helper *fb_helper, | ||
134 | bool polled); | ||
135 | bool drm_fb_helper_initial_config(struct drm_fb_helper *fb_helper, int bpp_sel); | ||
136 | int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper); | ||
137 | |||
138 | void drm_helper_fb_hpd_irq_event(struct drm_fb_helper *fb_helper); | ||
111 | #endif | 139 | #endif |