drm/i915: fix oops on single crtc devices.
[safe/jmp/linux-2.6] / drivers / gpu / drm / i915 / intel_fb.c
index 7f1eabb..dfbb0c6 100644 (file)
@@ -105,7 +105,11 @@ static int intelfb_create(struct intel_fbdev *ifbdev,
        }
 
        /* Flush everything out, we'll be doing GTT only from now on */
-       i915_gem_object_set_to_gtt_domain(fbo, 1);
+       ret = i915_gem_object_set_to_gtt_domain(fbo, 1);
+       if (ret) {
+               DRM_ERROR("failed to bind fb: %d.\n", ret);
+               goto out_unpin;
+       }
 
        info = framebuffer_alloc(0, device);
        if (!info) {
@@ -207,12 +211,6 @@ static int intel_fb_find_or_create_single(struct drm_fb_helper *helper,
        return new_fb;
 }
 
-void intelfb_hotplug(struct drm_device *dev, bool polled)
-{
-       drm_i915_private_t *dev_priv = dev->dev_private;
-       drm_helper_fb_hpd_irq_event(&dev_priv->fbdev->helper);
-}
-
 static struct drm_fb_helper_funcs intel_fb_helper_funcs = {
        .gamma_set = intel_crtc_fb_gamma_set,
        .gamma_get = intel_crtc_fb_gamma_get,
@@ -255,8 +253,8 @@ int intel_fbdev_init(struct drm_device *dev)
        dev_priv->fbdev = ifbdev;
        ifbdev->helper.funcs = &intel_fb_helper_funcs;
 
-       drm_fb_helper_init(dev, &ifbdev->helper, 2,
-                          INTELFB_CONN_LIMIT, false);
+       drm_fb_helper_init(dev, &ifbdev->helper, dev_priv->num_pipe,
+                          INTELFB_CONN_LIMIT);
 
        drm_fb_helper_single_add_all_connectors(&ifbdev->helper);
        drm_fb_helper_initial_config(&ifbdev->helper, 32);
@@ -274,3 +272,9 @@ void intel_fbdev_fini(struct drm_device *dev)
        dev_priv->fbdev = NULL;
 }
 MODULE_LICENSE("GPL and additional rights");
+
+void intel_fb_output_poll_changed(struct drm_device *dev)
+{
+       drm_i915_private_t *dev_priv = dev->dev_private;
+       drm_fb_helper_hotplug_event(&dev_priv->fbdev->helper);
+}