Skip to content

Commit c52142e

Browse files
Andrzej Hajdadaeinki
authored andcommitted
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>
1 parent 10a8fce commit c52142e

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

‎drivers/gpu/drm/exynos/exynos_drm_drv.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,6 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
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)
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)
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)
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

0 commit comments

Comments
 (0)