aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915
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/i915
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/i915')
-rw-r--r--drivers/gpu/drm/i915/i915_dma.c2
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c3
-rw-r--r--drivers/gpu/drm/i915/intel_crt.c5
-rw-r--r--drivers/gpu/drm/i915/intel_display.c2
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c2
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h2
-rw-r--r--drivers/gpu/drm/i915/intel_fb.c14
-rw-r--r--drivers/gpu/drm/i915/intel_hdmi.c1
-rw-r--r--drivers/gpu/drm/i915/intel_sdvo.c2
9 files changed, 22 insertions, 11 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 52e468bbd5e4..8fe66ac4e1a5 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1493,7 +1493,7 @@ static int i915_load_modeset_init(struct drm_device *dev,
1493 I915_WRITE(INSTPM, (1 << 5) | (1 << 21)); 1493 I915_WRITE(INSTPM, (1 << 5) | (1 << 21));
1494 1494
1495 intel_fbdev_init(dev); 1495 intel_fbdev_init(dev);
1496 1496 drm_kms_helper_poll_init(dev);
1497 return 0; 1497 return 0;
1498 1498
1499destroy_ringbuffer: 1499destroy_ringbuffer:
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index ed26b7b7376a..b034ea36731c 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -271,8 +271,7 @@ static void i915_hotplug_work_func(struct work_struct *work)
271 } 271 }
272 } 272 }
273 /* Just fire off a uevent and let userspace tell us what to do */ 273 /* Just fire off a uevent and let userspace tell us what to do */
274 intelfb_hotplug(dev, false); 274 drm_helper_hpd_irq_event(dev);
275 drm_sysfs_hotplug_event(dev);
276} 275}
277 276
278static void i915_handle_rps_change(struct drm_device *dev) 277static void i915_handle_rps_change(struct drm_device *dev)
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
index 26756cd34e3c..e16ac5a28c3c 100644
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -577,5 +577,10 @@ void intel_crt_init(struct drm_device *dev)
577 577
578 drm_sysfs_connector_add(connector); 578 drm_sysfs_connector_add(connector);
579 579
580 if (I915_HAS_HOTPLUG(dev))
581 connector->polled = DRM_CONNECTOR_POLL_HPD;
582 else
583 connector->polled = DRM_CONNECTOR_POLL_CONNECT;
584
580 dev_priv->hotplug_supported_mask |= CRT_HOTPLUG_INT_STATUS; 585 dev_priv->hotplug_supported_mask |= CRT_HOTPLUG_INT_STATUS;
581} 586}
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 3836f56e842c..4d739a1b13ca 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4959,6 +4959,7 @@ intel_user_framebuffer_create(struct drm_device *dev,
4959 4959
4960static const struct drm_mode_config_funcs intel_mode_funcs = { 4960static const struct drm_mode_config_funcs intel_mode_funcs = {
4961 .fb_create = intel_user_framebuffer_create, 4961 .fb_create = intel_user_framebuffer_create,
4962 .output_poll_changed = intel_fb_output_poll_changed,
4962}; 4963};
4963 4964
4964static struct drm_gem_object * 4965static struct drm_gem_object *
@@ -5346,6 +5347,7 @@ void intel_modeset_cleanup(struct drm_device *dev)
5346 5347
5347 mutex_lock(&dev->struct_mutex); 5348 mutex_lock(&dev->struct_mutex);
5348 5349
5350 drm_kms_helper_poll_fini(dev);
5349 intel_fbdev_fini(dev); 5351 intel_fbdev_fini(dev);
5350 5352
5351 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 5353 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index f6299bb788e5..6b1c9a27c27a 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1392,6 +1392,8 @@ intel_dp_init(struct drm_device *dev, int output_reg)
1392 DRM_MODE_CONNECTOR_DisplayPort); 1392 DRM_MODE_CONNECTOR_DisplayPort);
1393 drm_connector_helper_add(connector, &intel_dp_connector_helper_funcs); 1393 drm_connector_helper_add(connector, &intel_dp_connector_helper_funcs);
1394 1394
1395 connector->polled = DRM_CONNECTOR_POLL_HPD;
1396
1395 if (output_reg == DP_A) 1397 if (output_reg == DP_A)
1396 intel_encoder->type = INTEL_OUTPUT_EDP; 1398 intel_encoder->type = INTEL_OUTPUT_EDP;
1397 else 1399 else
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 3230e8d2ea43..df931f787665 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -235,5 +235,5 @@ extern int intel_overlay_put_image(struct drm_device *dev, void *data,
235extern int intel_overlay_attrs(struct drm_device *dev, void *data, 235extern int intel_overlay_attrs(struct drm_device *dev, void *data,
236 struct drm_file *file_priv); 236 struct drm_file *file_priv);
237 237
238void intelfb_hotplug(struct drm_device *dev, bool polled); 238extern void intel_fb_output_poll_changed(struct drm_device *dev);
239#endif /* __INTEL_DRV_H__ */ 239#endif /* __INTEL_DRV_H__ */
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c
index 7f1eabbaa2bb..6f53cf7fbc50 100644
--- a/drivers/gpu/drm/i915/intel_fb.c
+++ b/drivers/gpu/drm/i915/intel_fb.c
@@ -207,12 +207,6 @@ static int intel_fb_find_or_create_single(struct drm_fb_helper *helper,
207 return new_fb; 207 return new_fb;
208} 208}
209 209
210void intelfb_hotplug(struct drm_device *dev, bool polled)
211{
212 drm_i915_private_t *dev_priv = dev->dev_private;
213 drm_helper_fb_hpd_irq_event(&dev_priv->fbdev->helper);
214}
215
216static struct drm_fb_helper_funcs intel_fb_helper_funcs = { 210static struct drm_fb_helper_funcs intel_fb_helper_funcs = {
217 .gamma_set = intel_crtc_fb_gamma_set, 211 .gamma_set = intel_crtc_fb_gamma_set,
218 .gamma_get = intel_crtc_fb_gamma_get, 212 .gamma_get = intel_crtc_fb_gamma_get,
@@ -256,7 +250,7 @@ int intel_fbdev_init(struct drm_device *dev)
256 ifbdev->helper.funcs = &intel_fb_helper_funcs; 250 ifbdev->helper.funcs = &intel_fb_helper_funcs;
257 251
258 drm_fb_helper_init(dev, &ifbdev->helper, 2, 252 drm_fb_helper_init(dev, &ifbdev->helper, 2,
259 INTELFB_CONN_LIMIT, false); 253 INTELFB_CONN_LIMIT);
260 254
261 drm_fb_helper_single_add_all_connectors(&ifbdev->helper); 255 drm_fb_helper_single_add_all_connectors(&ifbdev->helper);
262 drm_fb_helper_initial_config(&ifbdev->helper, 32); 256 drm_fb_helper_initial_config(&ifbdev->helper, 32);
@@ -274,3 +268,9 @@ void intel_fbdev_fini(struct drm_device *dev)
274 dev_priv->fbdev = NULL; 268 dev_priv->fbdev = NULL;
275} 269}
276MODULE_LICENSE("GPL and additional rights"); 270MODULE_LICENSE("GPL and additional rights");
271
272void intel_fb_output_poll_changed(struct drm_device *dev)
273{
274 drm_i915_private_t *dev_priv = dev->dev_private;
275 drm_fb_helper_hotplug_event(&dev_priv->fbdev->helper);
276}
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 8a1c4eddc030..65727f0a79a3 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -237,6 +237,7 @@ void intel_hdmi_init(struct drm_device *dev, int sdvox_reg)
237 237
238 intel_encoder->type = INTEL_OUTPUT_HDMI; 238 intel_encoder->type = INTEL_OUTPUT_HDMI;
239 239
240 connector->polled = DRM_CONNECTOR_POLL_HPD;
240 connector->interlace_allowed = 0; 241 connector->interlace_allowed = 0;
241 connector->doublescan_allowed = 0; 242 connector->doublescan_allowed = 0;
242 intel_encoder->crtc_mask = (1 << 0) | (1 << 1); 243 intel_encoder->crtc_mask = (1 << 0) | (1 << 1);
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 42ceb15da689..ca372abc36cd 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -2244,6 +2244,7 @@ intel_sdvo_dvi_init(struct intel_encoder *intel_encoder, int device)
2244 } 2244 }
2245 2245
2246 connector = &intel_connector->base; 2246 connector = &intel_connector->base;
2247 connector->polled = DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT;
2247 encoder->encoder_type = DRM_MODE_ENCODER_TMDS; 2248 encoder->encoder_type = DRM_MODE_ENCODER_TMDS;
2248 connector->connector_type = DRM_MODE_CONNECTOR_DVID; 2249 connector->connector_type = DRM_MODE_CONNECTOR_DVID;
2249 2250
@@ -2310,6 +2311,7 @@ intel_sdvo_analog_init(struct intel_encoder *intel_encoder, int device)
2310 return false; 2311 return false;
2311 2312
2312 connector = &intel_connector->base; 2313 connector = &intel_connector->base;
2314 connector->polled = DRM_CONNECTOR_POLL_CONNECT;
2313 encoder->encoder_type = DRM_MODE_ENCODER_DAC; 2315 encoder->encoder_type = DRM_MODE_ENCODER_DAC;
2314 connector->connector_type = DRM_MODE_CONNECTOR_VGA; 2316 connector->connector_type = DRM_MODE_CONNECTOR_VGA;
2315 sdvo_connector = intel_connector->dev_priv; 2317 sdvo_connector = intel_connector->dev_priv;