Commit c52142e6a88da1152ec7c3f887aedee4e50b2d56

Authored by Andrzej Hajda
Committed by Inki Dae
1 parent 10a8fce846

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>

Showing 1 changed file with 9 additions and 9 deletions Side-by-side Diff

drivers/gpu/drm/exynos/exynos_drm_drv.c
... ... @@ -94,10 +94,6 @@
94 94 /* init kms poll for handling hpd */
95 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 97 /* setup possible_clones. */
102 98 exynos_drm_encoder_setup(dev);
103 99  
104 100  
105 101  
... ... @@ -106,12 +102,16 @@
106 102 /* Try to bind all sub drivers. */
107 103 ret = component_bind_all(dev->dev, dev);
108 104 if (ret)
109   - goto err_cleanup_vblank;
  105 + goto err_mode_config_cleanup;
110 106  
  107 + ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
  108 + if (ret)
  109 + goto err_unbind_all;
  110 +
111 111 /* Probe non kms sub drivers and virtual display driver. */
112 112 ret = exynos_drm_device_subdrv_probe(dev);
113 113 if (ret)
114   - goto err_unbind_all;
  114 + goto err_cleanup_vblank;
115 115  
116 116 /* force connectors detection */
117 117 drm_helper_hpd_irq_event(dev);
118 118  
... ... @@ -135,10 +135,10 @@
135 135  
136 136 return 0;
137 137  
138   -err_unbind_all:
139   - component_unbind_all(dev->dev, dev);
140 138 err_cleanup_vblank:
141 139 drm_vblank_cleanup(dev);
  140 +err_unbind_all:
  141 + component_unbind_all(dev->dev, dev);
142 142 err_mode_config_cleanup:
143 143 drm_mode_config_cleanup(dev);
144 144 drm_release_iommu_mapping(dev);
145 145  
... ... @@ -155,8 +155,8 @@
155 155 exynos_drm_fbdev_fini(dev);
156 156 drm_kms_helper_poll_fini(dev);
157 157  
158   - component_unbind_all(dev->dev, dev);
159 158 drm_vblank_cleanup(dev);
  159 + component_unbind_all(dev->dev, dev);
160 160 drm_mode_config_cleanup(dev);
161 161 drm_release_iommu_mapping(dev);
162 162