diff options
author | Andrzej Hajda <a.hajda@samsung.com> | 2014-10-07 09:09:14 -0400 |
---|---|---|
committer | Inki Dae <daeinki@gmail.com> | 2014-11-02 11:51:27 -0500 |
commit | c52142e6a88da1152ec7c3f887aedee4e50b2d56 (patch) | |
tree | 8362fb8b4b173cbc65942d89c3cf22fe6ad82458 | |
parent | 10a8fce846c1b12ebb29b036d1a15efc65eddbb5 (diff) |
drm/exynos: init vblank with real number of crtcs
Initialization of vblank with MAX_CRTC caused attempts
to disabling vblanks for non-existing crtcs in case
drm used fewer crtcs. The patch fixes it.
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_drv.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 443a2069858a..510d7cbb79a5 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c | |||
@@ -94,10 +94,6 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags) | |||
94 | /* init kms poll for handling hpd */ | 94 | /* init kms poll for handling hpd */ |
95 | drm_kms_helper_poll_init(dev); | 95 | drm_kms_helper_poll_init(dev); |
96 | 96 | ||
97 | ret = drm_vblank_init(dev, MAX_CRTC); | ||
98 | if (ret) | ||
99 | goto err_mode_config_cleanup; | ||
100 | |||
101 | /* setup possible_clones. */ | 97 | /* setup possible_clones. */ |
102 | exynos_drm_encoder_setup(dev); | 98 | exynos_drm_encoder_setup(dev); |
103 | 99 | ||
@@ -106,12 +102,16 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags) | |||
106 | /* Try to bind all sub drivers. */ | 102 | /* Try to bind all sub drivers. */ |
107 | ret = component_bind_all(dev->dev, dev); | 103 | ret = component_bind_all(dev->dev, dev); |
108 | if (ret) | 104 | if (ret) |
109 | goto err_cleanup_vblank; | 105 | goto err_mode_config_cleanup; |
106 | |||
107 | ret = drm_vblank_init(dev, dev->mode_config.num_crtc); | ||
108 | if (ret) | ||
109 | goto err_unbind_all; | ||
110 | 110 | ||
111 | /* Probe non kms sub drivers and virtual display driver. */ | 111 | /* Probe non kms sub drivers and virtual display driver. */ |
112 | ret = exynos_drm_device_subdrv_probe(dev); | 112 | ret = exynos_drm_device_subdrv_probe(dev); |
113 | if (ret) | 113 | if (ret) |
114 | goto err_unbind_all; | 114 | goto err_cleanup_vblank; |
115 | 115 | ||
116 | /* force connectors detection */ | 116 | /* force connectors detection */ |
117 | drm_helper_hpd_irq_event(dev); | 117 | drm_helper_hpd_irq_event(dev); |
@@ -135,10 +135,10 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags) | |||
135 | 135 | ||
136 | return 0; | 136 | return 0; |
137 | 137 | ||
138 | err_unbind_all: | ||
139 | component_unbind_all(dev->dev, dev); | ||
140 | err_cleanup_vblank: | 138 | err_cleanup_vblank: |
141 | drm_vblank_cleanup(dev); | 139 | drm_vblank_cleanup(dev); |
140 | err_unbind_all: | ||
141 | component_unbind_all(dev->dev, dev); | ||
142 | err_mode_config_cleanup: | 142 | err_mode_config_cleanup: |
143 | drm_mode_config_cleanup(dev); | 143 | drm_mode_config_cleanup(dev); |
144 | drm_release_iommu_mapping(dev); | 144 | drm_release_iommu_mapping(dev); |
@@ -155,8 +155,8 @@ static int exynos_drm_unload(struct drm_device *dev) | |||
155 | exynos_drm_fbdev_fini(dev); | 155 | exynos_drm_fbdev_fini(dev); |
156 | drm_kms_helper_poll_fini(dev); | 156 | drm_kms_helper_poll_fini(dev); |
157 | 157 | ||
158 | component_unbind_all(dev->dev, dev); | ||
159 | drm_vblank_cleanup(dev); | 158 | drm_vblank_cleanup(dev); |
159 | component_unbind_all(dev->dev, dev); | ||
160 | drm_mode_config_cleanup(dev); | 160 | drm_mode_config_cleanup(dev); |
161 | drm_release_iommu_mapping(dev); | 161 | drm_release_iommu_mapping(dev); |
162 | 162 | ||