diff options
author | Dave Airlie <airlied@redhat.com> | 2010-05-07 02:42:51 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-05-18 03:40:11 -0400 |
commit | eb1f8e4f3be898df808e2dfc131099f5831d491d (patch) | |
tree | 9e5807824c60601f23016f3a2e82f8de10f7435a /include | |
parent | 0ddfa7d574e0f3a7510b0be6c8ed807af017223f (diff) |
drm/fbdev: rework output polling to be back in the core. (v4)
After thinking it over a lot it made more sense for the core to deal with
the output polling especially so it can notify X.
v2: drop plans for fake connector - per Michel's comments - fix X patch sent to xorg-devel, add intel polled/hpd setting, add initial nouveau polled/hpd settings.
v3: add config lock take inside polling, add intel/nouveau poll init/fini calls
v4: config lock was a bit agressive, only needed around connector list reading.
otherwise it could re-enter.
glisse: discard drm_helper_hpd_irq_event
v3: Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/drm/drm_crtc.h | 17 | ||||
-rw-r--r-- | include/drm/drm_crtc_helper.h | 3 | ||||
-rw-r--r-- | include/drm/drm_fb_helper.h | 13 |
3 files changed, 22 insertions, 11 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index c560364663a5..2e4bf92faa85 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/idr.h> | 31 | #include <linux/idr.h> |
32 | 32 | ||
33 | #include <linux/fb.h> | 33 | #include <linux/fb.h> |
34 | #include <linux/slow-work.h> | ||
34 | 35 | ||
35 | struct drm_device; | 36 | struct drm_device; |
36 | struct drm_mode_set; | 37 | struct drm_mode_set; |
@@ -460,6 +461,15 @@ enum drm_connector_force { | |||
460 | DRM_FORCE_ON_DIGITAL, /* for DVI-I use digital connector */ | 461 | DRM_FORCE_ON_DIGITAL, /* for DVI-I use digital connector */ |
461 | }; | 462 | }; |
462 | 463 | ||
464 | /* should we poll this connector for connects and disconnects */ | ||
465 | /* hot plug detectable */ | ||
466 | #define DRM_CONNECTOR_POLL_HPD (1 << 0) | ||
467 | /* poll for connections */ | ||
468 | #define DRM_CONNECTOR_POLL_CONNECT (1 << 1) | ||
469 | /* can cleanly poll for disconnections without flickering the screen */ | ||
470 | /* DACs should rarely do this without a lot of testing */ | ||
471 | #define DRM_CONNECTOR_POLL_DISCONNECT (1 << 2) | ||
472 | |||
463 | /** | 473 | /** |
464 | * drm_connector - central DRM connector control structure | 474 | * drm_connector - central DRM connector control structure |
465 | * @crtc: CRTC this connector is currently connected to, NULL if none | 475 | * @crtc: CRTC this connector is currently connected to, NULL if none |
@@ -504,6 +514,8 @@ struct drm_connector { | |||
504 | u32 property_ids[DRM_CONNECTOR_MAX_PROPERTY]; | 514 | u32 property_ids[DRM_CONNECTOR_MAX_PROPERTY]; |
505 | uint64_t property_values[DRM_CONNECTOR_MAX_PROPERTY]; | 515 | uint64_t property_values[DRM_CONNECTOR_MAX_PROPERTY]; |
506 | 516 | ||
517 | uint8_t polled; /* DRM_CONNECTOR_POLL_* */ | ||
518 | |||
507 | /* requested DPMS state */ | 519 | /* requested DPMS state */ |
508 | int dpms; | 520 | int dpms; |
509 | 521 | ||
@@ -543,6 +555,7 @@ struct drm_mode_set { | |||
543 | */ | 555 | */ |
544 | struct drm_mode_config_funcs { | 556 | struct drm_mode_config_funcs { |
545 | struct drm_framebuffer *(*fb_create)(struct drm_device *dev, struct drm_file *file_priv, struct drm_mode_fb_cmd *mode_cmd); | 557 | struct drm_framebuffer *(*fb_create)(struct drm_device *dev, struct drm_file *file_priv, struct drm_mode_fb_cmd *mode_cmd); |
558 | void (*output_poll_changed)(struct drm_device *dev); | ||
546 | }; | 559 | }; |
547 | 560 | ||
548 | struct drm_mode_group { | 561 | struct drm_mode_group { |
@@ -580,6 +593,10 @@ struct drm_mode_config { | |||
580 | struct drm_mode_config_funcs *funcs; | 593 | struct drm_mode_config_funcs *funcs; |
581 | resource_size_t fb_base; | 594 | resource_size_t fb_base; |
582 | 595 | ||
596 | /* output poll support */ | ||
597 | bool poll_enabled; | ||
598 | struct delayed_slow_work output_poll_slow_work; | ||
599 | |||
583 | /* pointers to standard properties */ | 600 | /* pointers to standard properties */ |
584 | struct list_head property_blob_list; | 601 | struct list_head property_blob_list; |
585 | struct drm_property *edid_property; | 602 | struct drm_property *edid_property; |
diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h index b1fa0f8cfa60..dc5873c21e45 100644 --- a/include/drm/drm_crtc_helper.h +++ b/include/drm/drm_crtc_helper.h | |||
@@ -127,4 +127,7 @@ static inline void drm_connector_helper_add(struct drm_connector *connector, | |||
127 | } | 127 | } |
128 | 128 | ||
129 | extern int drm_helper_resume_force_mode(struct drm_device *dev); | 129 | extern int drm_helper_resume_force_mode(struct drm_device *dev); |
130 | extern void drm_kms_helper_poll_init(struct drm_device *dev); | ||
131 | extern void drm_kms_helper_poll_fini(struct drm_device *dev); | ||
132 | extern void drm_helper_hpd_irq_event(struct drm_device *dev); | ||
130 | #endif | 133 | #endif |
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h index 9b55a94feada..f0a6afc47e76 100644 --- a/include/drm/drm_fb_helper.h +++ b/include/drm/drm_fb_helper.h | |||
@@ -30,8 +30,6 @@ | |||
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; | 33 | struct drm_fb_helper; |
36 | 34 | ||
37 | struct drm_fb_helper_crtc { | 35 | struct drm_fb_helper_crtc { |
@@ -71,9 +69,6 @@ struct drm_fb_helper_funcs { | |||
71 | 69 | ||
72 | int (*fb_probe)(struct drm_fb_helper *helper, | 70 | int (*fb_probe)(struct drm_fb_helper *helper, |
73 | struct drm_fb_helper_surface_size *sizes); | 71 | struct drm_fb_helper_surface_size *sizes); |
74 | |||
75 | void (*fb_output_status_changed)(struct drm_fb_helper *helper); | ||
76 | |||
77 | }; | 72 | }; |
78 | 73 | ||
79 | struct drm_fb_helper_connector { | 74 | struct drm_fb_helper_connector { |
@@ -95,8 +90,6 @@ struct drm_fb_helper { | |||
95 | u32 pseudo_palette[17]; | 90 | u32 pseudo_palette[17]; |
96 | struct list_head kernel_fb_list; | 91 | struct list_head kernel_fb_list; |
97 | 92 | ||
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 | 93 | /* we got a hotplug but fbdev wasn't running the console |
101 | delay until next set_par */ | 94 | delay until next set_par */ |
102 | bool delayed_hotplug; | 95 | bool delayed_hotplug; |
@@ -107,7 +100,7 @@ int drm_fb_helper_single_fb_probe(struct drm_fb_helper *helper, | |||
107 | 100 | ||
108 | int drm_fb_helper_init(struct drm_device *dev, | 101 | int drm_fb_helper_init(struct drm_device *dev, |
109 | struct drm_fb_helper *helper, int crtc_count, | 102 | struct drm_fb_helper *helper, int crtc_count, |
110 | int max_conn, bool polled); | 103 | int max_conn); |
111 | void drm_fb_helper_fini(struct drm_fb_helper *helper); | 104 | void drm_fb_helper_fini(struct drm_fb_helper *helper); |
112 | int drm_fb_helper_blank(int blank, struct fb_info *info); | 105 | int drm_fb_helper_blank(int blank, struct fb_info *info); |
113 | int drm_fb_helper_pan_display(struct fb_var_screeninfo *var, | 106 | int drm_fb_helper_pan_display(struct fb_var_screeninfo *var, |
@@ -130,10 +123,8 @@ void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch, | |||
130 | 123 | ||
131 | int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info); | 124 | int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info); |
132 | 125 | ||
133 | bool drm_helper_fb_hotplug_event(struct drm_fb_helper *fb_helper, | 126 | bool drm_fb_helper_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); | 127 | 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); | 128 | int drm_fb_helper_single_add_all_connectors(struct drm_fb_helper *fb_helper); |
137 | 129 | ||
138 | void drm_helper_fb_hpd_irq_event(struct drm_fb_helper *fb_helper); | ||
139 | #endif | 130 | #endif |