aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2010-03-30 01:34:13 -0400
committerDave Airlie <airlied@redhat.com>2010-04-06 20:21:03 -0400
commit386516744ba45d50f42c6999151cc210cb4f96e4 (patch)
tree88e3b6aeb83040a8bd512eb7aad087e6c0fcd556 /include
parent643acacf02679befd0f98ac3c5fecb805f1c9548 (diff)
drm/fb: fix fbdev object model + cleanup properly.
The fbdev layer in the kms code should act like a consumer of the kms services and avoid having relying on information being store in the kms core structures in order for it to work. This patch a) removes the info pointer/psuedo palette from the core drm_framebuffer structure and moves it to the fbdev helper layer, it also removes the core drm keeping a list of kernel kms fbdevs. b) migrated all the fb helper functions out of the crtc helper file into the fb helper file. c) pushed the fb probing/hotplug control into the driver d) makes the surface sizes into a structure for ease of passing This changes the intel/radeon/nouveau drivers to use the new helper. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/drm/drm_crtc.h12
-rw-r--r--include/drm/drm_crtc_helper.h1
-rw-r--r--include/drm/drm_fb_helper.h24
3 files changed, 16 insertions, 21 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 1347524a8e30..c70814b184e8 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;
@@ -548,16 +546,9 @@ struct drm_mode_set {
548 546
549/** 547/**
550 * struct drm_mode_config_funcs - configure CRTCs for a given screen layout 548 * 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 */ 549 */
558struct drm_mode_config_funcs { 550struct 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); 551 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}; 552};
562 553
563struct drm_mode_group { 554struct drm_mode_group {
@@ -590,9 +581,6 @@ struct drm_mode_config {
590 581
591 struct list_head property_list; 582 struct list_head property_list;
592 583
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; 584 int min_width, min_height;
597 int max_width, max_height; 585 int max_width, max_height;
598 struct drm_mode_config_funcs *funcs; 586 struct drm_mode_config_funcs *funcs;
diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h
index b29e20168b5f..ce7aab77f7dc 100644
--- a/include/drm/drm_crtc_helper.h
+++ b/include/drm/drm_crtc_helper.h
@@ -97,7 +97,6 @@ struct drm_connector_helper_funcs {
97extern int drm_helper_probe_single_connector_modes(struct drm_connector *connector, uint32_t maxX, uint32_t maxY); 97extern int drm_helper_probe_single_connector_modes(struct drm_connector *connector, uint32_t maxX, uint32_t maxY);
98extern void drm_helper_disable_unused_functions(struct drm_device *dev); 98extern void drm_helper_disable_unused_functions(struct drm_device *dev);
99extern int drm_helper_hotplug_stage_two(struct drm_device *dev); 99extern int drm_helper_hotplug_stage_two(struct drm_device *dev);
100extern bool drm_helper_initial_config(struct drm_device *dev);
101extern int drm_crtc_helper_set_config(struct drm_mode_set *set); 100extern int drm_crtc_helper_set_config(struct drm_mode_set *set);
102extern bool drm_crtc_helper_set_mode(struct drm_crtc *crtc, 101extern bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
103 struct drm_display_mode *mode, 102 struct drm_display_mode *mode,
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index 58c892a2cbfa..38ab0daffd1f 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -57,6 +57,15 @@ struct drm_fb_helper_cmdline_mode {
57 bool margins; 57 bool margins;
58}; 58};
59 59
60struct drm_fb_helper_surface_size {
61 u32 fb_width;
62 u32 fb_height;
63 u32 surface_width;
64 u32 surface_height;
65 u32 surface_bpp;
66 u32 surface_depth;
67};
68
60struct drm_fb_helper_connector { 69struct drm_fb_helper_connector {
61 struct drm_fb_helper_cmdline_mode cmdline_mode; 70 struct drm_fb_helper_cmdline_mode cmdline_mode;
62}; 71};
@@ -69,19 +78,16 @@ struct drm_fb_helper {
69 struct drm_fb_helper_crtc *crtc_info; 78 struct drm_fb_helper_crtc *crtc_info;
70 struct drm_fb_helper_funcs *funcs; 79 struct drm_fb_helper_funcs *funcs;
71 int conn_limit; 80 int conn_limit;
81 struct fb_info *fbdev;
82 u32 pseudo_palette[17];
72 struct list_head kernel_fb_list; 83 struct list_head kernel_fb_list;
73}; 84};
74 85
75int drm_fb_helper_single_fb_probe(struct drm_device *dev, 86int drm_fb_helper_single_fb_probe(struct drm_device *dev,
76 int preferred_bpp, 87 int preferred_bpp,
77 int (*fb_create)(struct drm_device *dev, 88 int (*fb_create)(struct drm_device *dev,
78 uint32_t fb_width, 89 struct drm_fb_helper_surface_size *sizes,
79 uint32_t fb_height, 90 struct drm_fb_helper **fb_ptr));
80 uint32_t surface_width,
81 uint32_t surface_height,
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, 91int drm_fb_helper_init_crtc_count(struct drm_fb_helper *helper, int crtc_count,
86 int max_conn); 92 int max_conn);
87void drm_fb_helper_free(struct drm_fb_helper *helper); 93void drm_fb_helper_free(struct drm_fb_helper *helper);
@@ -99,7 +105,7 @@ int drm_fb_helper_setcolreg(unsigned regno,
99 struct fb_info *info); 105 struct fb_info *info);
100 106
101void drm_fb_helper_restore(void); 107void drm_fb_helper_restore(void);
102void drm_fb_helper_fill_var(struct fb_info *info, struct drm_framebuffer *fb, 108void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper,
103 uint32_t fb_width, uint32_t fb_height); 109 uint32_t fb_width, uint32_t fb_height);
104void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch, 110void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
105 uint32_t depth); 111 uint32_t depth);
@@ -108,4 +114,6 @@ int drm_fb_helper_add_connector(struct drm_connector *connector);
108int drm_fb_helper_parse_command_line(struct drm_device *dev); 114int drm_fb_helper_parse_command_line(struct drm_device *dev);
109int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info); 115int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info);
110 116
117bool drm_helper_fb_hotplug_event(struct drm_device *dev);
118bool drm_helper_initial_config(struct drm_device *dev);
111#endif 119#endif