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.
Unified · Split
| @@ -94,10 +94,6 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags) · 93 unmodified lines | ||
| 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 | |
| @@ -106,12 +102,16 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags) · 2 unmodified lines | ||
| 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; | |
| 106 | + | |
| 107 | + ret = drm_vblank_init(dev, dev->mode_config.num_crtc); | |
| 108 | + if (ret) | |
| 109 | + goto err_unbind_all; | |
| 110 | 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); |
| @@ -135,10 +135,10 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags) · 17 unmodified lines | ||
| 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); |
| @@ -155,8 +155,8 @@ static int exynos_drm_unload(struct drm_device *dev) · 10 unmodified lines | ||
| 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 | |