aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_dma.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-06-06 05:50:03 -0400
committerDave Airlie <airlied@redhat.com>2010-06-07 19:32:02 -0400
commit5a79395b2791cc70442ab8434aed1b5206683e7c (patch)
treee730abdc96aa8de4697b14c8ff995b27fec74409 /drivers/gpu/drm/i915/i915_dma.c
parenta3524f1b27671eda909cde37da9caff41133b272 (diff)
drm: Propagate error from drm_fb_helper_init().
The previous commit fixes the problem, these commits make sure we actually fail properly if it happens again. I've squashed the commits from Chris since they are all fixing one issue. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_dma.c')
-rw-r--r--drivers/gpu/drm/i915/i915_dma.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index b2ebf02e4f8a..59a2bf8592ec 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1402,19 +1402,19 @@ static int i915_load_modeset_init(struct drm_device *dev,
1402 /* if we have > 1 VGA cards, then disable the radeon VGA resources */ 1402 /* if we have > 1 VGA cards, then disable the radeon VGA resources */
1403 ret = vga_client_register(dev->pdev, dev, NULL, i915_vga_set_decode); 1403 ret = vga_client_register(dev->pdev, dev, NULL, i915_vga_set_decode);
1404 if (ret) 1404 if (ret)
1405 goto destroy_ringbuffer; 1405 goto cleanup_ringbuffer;
1406 1406
1407 ret = vga_switcheroo_register_client(dev->pdev, 1407 ret = vga_switcheroo_register_client(dev->pdev,
1408 i915_switcheroo_set_state, 1408 i915_switcheroo_set_state,
1409 i915_switcheroo_can_switch); 1409 i915_switcheroo_can_switch);
1410 if (ret) 1410 if (ret)
1411 goto destroy_ringbuffer; 1411 goto cleanup_vga_client;
1412 1412
1413 intel_modeset_init(dev); 1413 intel_modeset_init(dev);
1414 1414
1415 ret = drm_irq_install(dev); 1415 ret = drm_irq_install(dev);
1416 if (ret) 1416 if (ret)
1417 goto destroy_ringbuffer; 1417 goto cleanup_vga_switcheroo;
1418 1418
1419 /* Always safe in the mode setting case. */ 1419 /* Always safe in the mode setting case. */
1420 /* FIXME: do pre/post-mode set stuff in core KMS code */ 1420 /* FIXME: do pre/post-mode set stuff in core KMS code */
@@ -1426,11 +1426,20 @@ static int i915_load_modeset_init(struct drm_device *dev,
1426 1426
1427 I915_WRITE(INSTPM, (1 << 5) | (1 << 21)); 1427 I915_WRITE(INSTPM, (1 << 5) | (1 << 21));
1428 1428
1429 intel_fbdev_init(dev); 1429 ret = intel_fbdev_init(dev);
1430 if (ret)
1431 goto cleanup_irq;
1432
1430 drm_kms_helper_poll_init(dev); 1433 drm_kms_helper_poll_init(dev);
1431 return 0; 1434 return 0;
1432 1435
1433destroy_ringbuffer: 1436cleanup_irq:
1437 drm_irq_uninstall(dev);
1438cleanup_vga_switcheroo:
1439 vga_switcheroo_unregister_client(dev->pdev);
1440cleanup_vga_client:
1441 vga_client_register(dev->pdev, NULL, NULL, NULL);
1442cleanup_ringbuffer:
1434 mutex_lock(&dev->struct_mutex); 1443 mutex_lock(&dev->struct_mutex);
1435 i915_gem_cleanup_ringbuffer(dev); 1444 i915_gem_cleanup_ringbuffer(dev);
1436 mutex_unlock(&dev->struct_mutex); 1445 mutex_unlock(&dev->struct_mutex);