History

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.

Andrzej Hajda committed 12 years ago

Commit c52142e1 parent 10a8fce1 file · +9 −9Browse files

Unified · Split

drivers/gpu/drm/exynos/exynos_drm_drv.c+9−9
@@ -94,10 +94,6 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags) · 93 unmodified lines
9494 /* init kms poll for handling hpd */
9595 drm_kms_helper_poll_init(dev);
9696
97− ret = drm_vblank_init(dev, MAX_CRTC);
98− if (ret)
99− goto err_mode_config_cleanup;
100−
10197 /* setup possible_clones. */
10298 exynos_drm_encoder_setup(dev);
10399
@@ -106,12 +102,16 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags) · 2 unmodified lines
106102 /* Try to bind all sub drivers. */
107103 ret = component_bind_all(dev->dev, dev);
108104 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;
110110
111111 /* Probe non kms sub drivers and virtual display driver. */
112112 ret = exynos_drm_device_subdrv_probe(dev);
113113 if (ret)
114− goto err_unbind_all;
114+ goto err_cleanup_vblank;
115115
116116 /* force connectors detection */
117117 drm_helper_hpd_irq_event(dev);
@@ -135,10 +135,10 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags) · 17 unmodified lines
135135
136136 return 0;
137137
138−err_unbind_all:
139− component_unbind_all(dev->dev, dev);
140138 err_cleanup_vblank:
141139 drm_vblank_cleanup(dev);
140+err_unbind_all:
141+ component_unbind_all(dev->dev, dev);
142142 err_mode_config_cleanup:
143143 drm_mode_config_cleanup(dev);
144144 drm_release_iommu_mapping(dev);
@@ -155,8 +155,8 @@ static int exynos_drm_unload(struct drm_device *dev) · 10 unmodified lines
155155 exynos_drm_fbdev_fini(dev);
156156 drm_kms_helper_poll_fini(dev);
157157
158− component_unbind_all(dev->dev, dev);
159158 drm_vblank_cleanup(dev);
159+ component_unbind_all(dev->dev, dev);
160160 drm_mode_config_cleanup(dev);
161161 drm_release_iommu_mapping(dev);
162162