diff options
author | Jerome Glisse <jglisse@redhat.com> | 2009-09-10 15:46:48 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-09-11 01:53:59 -0400 |
commit | 6cf8a3f58806f12b975a89cfd7edf01566ff80a0 (patch) | |
tree | 5c940fa2e6651b7157744758cf008fb2d578db83 /drivers/gpu/drm/radeon/radeon_kms.c | |
parent | 923f6848e1686059ef8d272d1fca4d3577911a41 (diff) |
drm/radeon/kms: move modeset init outside of GPU init
We are splitting GPU & modeset init so that it's easier
to abord only remaining GPU init when somethings fails.
We want to always provide enough funcionalities to get
fbcon and a shadowfb X working. Only acceptable error
during initialization are memory allocation failure or
io mapping failure.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_kms.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_kms.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index dce09ada32bc..ac8505fe2ca7 100644 --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c | |||
@@ -54,12 +54,23 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags) | |||
54 | flags |= RADEON_IS_PCI; | 54 | flags |= RADEON_IS_PCI; |
55 | } | 55 | } |
56 | 56 | ||
57 | /* radeon_device_init should report only fatal error | ||
58 | * like memory allocation failure or iomapping failure, | ||
59 | * or memory manager initialization failure, it must | ||
60 | * properly initialize the GPU MC controller and permit | ||
61 | * VRAM allocation | ||
62 | */ | ||
57 | r = radeon_device_init(rdev, dev, dev->pdev, flags); | 63 | r = radeon_device_init(rdev, dev, dev->pdev, flags); |
58 | if (r) { | 64 | if (r) { |
59 | DRM_ERROR("Failed to initialize radeon, disabling IOCTL\n"); | 65 | DRM_ERROR("Fatal error while trying to initialize radeon.\n"); |
60 | radeon_device_fini(rdev); | 66 | return r; |
61 | kfree(rdev); | 67 | } |
62 | dev->dev_private = NULL; | 68 | /* Again modeset_init should fail only on fatal error |
69 | * otherwise it should provide enough functionalities | ||
70 | * for shadowfb to run | ||
71 | */ | ||
72 | r = radeon_modeset_init(rdev); | ||
73 | if (r) { | ||
63 | return r; | 74 | return r; |
64 | } | 75 | } |
65 | return 0; | 76 | return 0; |
@@ -69,6 +80,9 @@ int radeon_driver_unload_kms(struct drm_device *dev) | |||
69 | { | 80 | { |
70 | struct radeon_device *rdev = dev->dev_private; | 81 | struct radeon_device *rdev = dev->dev_private; |
71 | 82 | ||
83 | if (rdev == NULL) | ||
84 | return 0; | ||
85 | radeon_modeset_fini(rdev); | ||
72 | radeon_device_fini(rdev); | 86 | radeon_device_fini(rdev); |
73 | kfree(rdev); | 87 | kfree(rdev); |
74 | dev->dev_private = NULL; | 88 | dev->dev_private = NULL; |