aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2010-05-07 02:42:51 -0400
committerDave Airlie <airlied@redhat.com>2010-05-18 03:40:11 -0400
commiteb1f8e4f3be898df808e2dfc131099f5831d491d (patch)
tree9e5807824c60601f23016f3a2e82f8de10f7435a /drivers/gpu/drm/nouveau
parent0ddfa7d574e0f3a7510b0be6c8ed807af017223f (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 'drivers/gpu/drm/nouveau')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_connector.c12
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_display.c1
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_fbcon.c14
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_fbcon.h2
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_state.c5
-rw-r--r--drivers/gpu/drm/nouveau/nv50_display.c2
6 files changed, 23 insertions, 13 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
index 14afe1e47e5..7e663a79829 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
@@ -843,6 +843,7 @@ nouveau_connector_create(struct drm_device *dev,
843 843
844 switch (dcb->type) { 844 switch (dcb->type) {
845 case DCB_CONNECTOR_VGA: 845 case DCB_CONNECTOR_VGA:
846 connector->polled = DRM_CONNECTOR_POLL_CONNECT;
846 if (dev_priv->card_type >= NV_50) { 847 if (dev_priv->card_type >= NV_50) {
847 drm_connector_attach_property(connector, 848 drm_connector_attach_property(connector,
848 dev->mode_config.scaling_mode_property, 849 dev->mode_config.scaling_mode_property,
@@ -854,6 +855,17 @@ nouveau_connector_create(struct drm_device *dev,
854 case DCB_CONNECTOR_TV_3: 855 case DCB_CONNECTOR_TV_3:
855 nv_connector->scaling_mode = DRM_MODE_SCALE_NONE; 856 nv_connector->scaling_mode = DRM_MODE_SCALE_NONE;
856 break; 857 break;
858 case DCB_CONNECTOR_DP:
859 case DCB_CONNECTOR_eDP:
860 case DCB_CONNECTOR_HDMI_0:
861 case DCB_CONNECTOR_HDMI_1:
862 case DCB_CONNECTOR_DVI_I:
863 case DCB_CONNECTOR_DVI_D:
864 if (dev_priv->card_type >= NV_50)
865 connector->polled = DRM_CONNECTOR_POLL_HPD;
866 else
867 connector->polled = DRM_CONNECTOR_POLL_CONNECT;
868 /* fall-through */
857 default: 869 default:
858 nv_connector->scaling_mode = DRM_MODE_SCALE_FULLSCREEN; 870 nv_connector->scaling_mode = DRM_MODE_SCALE_FULLSCREEN;
859 871
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c
index 9d7928f40fd..74e6b4ed12c 100644
--- a/drivers/gpu/drm/nouveau/nouveau_display.c
+++ b/drivers/gpu/drm/nouveau/nouveau_display.c
@@ -101,5 +101,6 @@ nouveau_user_framebuffer_create(struct drm_device *dev,
101 101
102const struct drm_mode_config_funcs nouveau_mode_config_funcs = { 102const struct drm_mode_config_funcs nouveau_mode_config_funcs = {
103 .fb_create = nouveau_user_framebuffer_create, 103 .fb_create = nouveau_user_framebuffer_create,
104 .output_poll_changed = nouveau_fbcon_output_poll_changed,
104}; 105};
105 106
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
index 2c2199329cc..fd4a2df715e 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c
+++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c
@@ -326,15 +326,11 @@ nouveau_fbcon_find_or_create_single(struct drm_fb_helper *helper,
326 return new_fb; 326 return new_fb;
327} 327}
328 328
329void nouveau_fbcon_hotplug(struct drm_device *dev) 329void
330nouveau_fbcon_output_poll_changed(struct drm_device *dev)
330{ 331{
331 struct drm_nouveau_private *dev_priv = dev->dev_private; 332 struct drm_nouveau_private *dev_priv = dev->dev_private;
332 drm_helper_fb_hpd_irq_event(&dev_priv->nfbdev->helper); 333 drm_fb_helper_hotplug_event(&dev_priv->nfbdev->helper);
333}
334
335static void nouveau_fbcon_output_status_changed(struct drm_fb_helper *fb_helper)
336{
337 drm_helper_fb_hotplug_event(fb_helper, true);
338} 334}
339 335
340int 336int
@@ -374,7 +370,6 @@ static struct drm_fb_helper_funcs nouveau_fbcon_helper_funcs = {
374 .gamma_set = nouveau_fbcon_gamma_set, 370 .gamma_set = nouveau_fbcon_gamma_set,
375 .gamma_get = nouveau_fbcon_gamma_get, 371 .gamma_get = nouveau_fbcon_gamma_get,
376 .fb_probe = nouveau_fbcon_find_or_create_single, 372 .fb_probe = nouveau_fbcon_find_or_create_single,
377 .fb_output_status_changed = nouveau_fbcon_output_status_changed,
378}; 373};
379 374
380 375
@@ -391,8 +386,7 @@ int nouveau_fbcon_init(struct drm_device *dev)
391 dev_priv->nfbdev = nfbdev; 386 dev_priv->nfbdev = nfbdev;
392 nfbdev->helper.funcs = &nouveau_fbcon_helper_funcs; 387 nfbdev->helper.funcs = &nouveau_fbcon_helper_funcs;
393 388
394 drm_fb_helper_init(dev, &nfbdev->helper, 389 drm_fb_helper_init(dev, &nfbdev->helper, 2, 4);
395 2, 4, true);
396 drm_fb_helper_single_add_all_connectors(&nfbdev->helper); 390 drm_fb_helper_single_add_all_connectors(&nfbdev->helper);
397 drm_fb_helper_initial_config(&nfbdev->helper, 32); 391 drm_fb_helper_initial_config(&nfbdev->helper, 32);
398 return 0; 392 return 0;
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.h b/drivers/gpu/drm/nouveau/nouveau_fbcon.h
index bf8e00d4de6..e7e12684c37 100644
--- a/drivers/gpu/drm/nouveau/nouveau_fbcon.h
+++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.h
@@ -58,6 +58,6 @@ void nouveau_fbcon_zfill_all(struct drm_device *dev);
58void nouveau_fbcon_save_disable_accel(struct drm_device *dev); 58void nouveau_fbcon_save_disable_accel(struct drm_device *dev);
59void nouveau_fbcon_restore_accel(struct drm_device *dev); 59void nouveau_fbcon_restore_accel(struct drm_device *dev);
60 60
61void nouveau_fbcon_hotplug(struct drm_device *dev); 61void nouveau_fbcon_output_poll_changed(struct drm_device *dev);
62#endif /* __NV50_FBCON_H__ */ 62#endif /* __NV50_FBCON_H__ */
63 63
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c
index c667a1138c3..e632339c323 100644
--- a/drivers/gpu/drm/nouveau/nouveau_state.c
+++ b/drivers/gpu/drm/nouveau/nouveau_state.c
@@ -516,8 +516,10 @@ nouveau_card_init(struct drm_device *dev)
516 516
517 dev_priv->init_state = NOUVEAU_CARD_INIT_DONE; 517 dev_priv->init_state = NOUVEAU_CARD_INIT_DONE;
518 518
519 if (drm_core_check_feature(dev, DRIVER_MODESET)) 519 if (drm_core_check_feature(dev, DRIVER_MODESET)) {
520 nouveau_fbcon_init(dev); 520 nouveau_fbcon_init(dev);
521 drm_kms_helper_poll_init(dev);
522 }
521 523
522 return 0; 524 return 0;
523 525
@@ -844,6 +846,7 @@ int nouveau_unload(struct drm_device *dev)
844 struct drm_nouveau_private *dev_priv = dev->dev_private; 846 struct drm_nouveau_private *dev_priv = dev->dev_private;
845 847
846 if (drm_core_check_feature(dev, DRIVER_MODESET)) { 848 if (drm_core_check_feature(dev, DRIVER_MODESET)) {
849 drm_kms_helper_poll_fini(dev);
847 nouveau_fbcon_fini(dev); 850 nouveau_fbcon_fini(dev);
848 if (dev_priv->card_type >= NV_50) 851 if (dev_priv->card_type >= NV_50)
849 nv50_display_destroy(dev); 852 nv50_display_destroy(dev);
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
index f9b304866e6..34156b69594 100644
--- a/drivers/gpu/drm/nouveau/nv50_display.c
+++ b/drivers/gpu/drm/nouveau/nv50_display.c
@@ -947,7 +947,7 @@ nv50_display_irq_hotplug_bh(struct work_struct *work)
947 if (dev_priv->chipset >= 0x90) 947 if (dev_priv->chipset >= 0x90)
948 nv_wr32(dev, 0xe074, nv_rd32(dev, 0xe074)); 948 nv_wr32(dev, 0xe074, nv_rd32(dev, 0xe074));
949 949
950 nouveau_fbcon_hotplug(dev); 950 drm_helper_hpd_irq_event(dev);
951} 951}
952 952
953void 953void