Skip to content

Commit 66338fe

Browse files
committed
Merge branch 'exynos-drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-fixes
This pull-request includes some bug fixes and code cleanups. Especially, this fixes the bind failure issue occurred when it tries to re-bind Exynos drm driver after unbound, and the modetest failure issue incurred by not having a pair to vblank on and off requests. * 'exynos-drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos: drm/exynos: correct connector->dpms field before resuming drm/exynos: enable vblank after DPMS on drm/exynos: init kms poll at the end of initialization drm/exynos: propagate plane initialization errors drm/exynos: vidi: fix build warning drm/exynos: remove explicit encoder/connector de-initialization drm/exynos: init vblank with real number of crtcs
2 parents 10a8fce + 74cfe07 commit 66338fe

7 files changed

Lines changed: 29 additions & 42 deletions

File tree

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,13 +1355,8 @@ static void exynos_dp_unbind(struct device *dev, struct device *master,
13551355
void *data)
13561356
{
13571357
struct exynos_drm_display *display = dev_get_drvdata(dev);
1358-
struct exynos_dp_device *dp = display->ctx;
1359-
struct drm_encoder *encoder = dp->encoder;
13601358

13611359
exynos_dp_dpms(display, DRM_MODE_DPMS_OFF);
1362-
1363-
exynos_dp_connector_destroy(&dp->connector);
1364-
encoder->funcs->destroy(encoder);
13651360
}
13661361

13671362
static const struct component_ops exynos_dp_ops = {

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,16 @@ static void exynos_drm_crtc_dpms(struct drm_crtc *crtc, int mode)
7171
!atomic_read(&exynos_crtc->pending_flip),
7272
HZ/20))
7373
atomic_set(&exynos_crtc->pending_flip, 0);
74-
drm_vblank_off(crtc->dev, exynos_crtc->pipe);
74+
drm_crtc_vblank_off(crtc);
7575
}
7676

7777
if (manager->ops->dpms)
7878
manager->ops->dpms(manager, mode);
7979

8080
exynos_crtc->dpms = mode;
81+
82+
if (mode == DRM_MODE_DPMS_ON)
83+
drm_crtc_vblank_on(crtc);
8184
}
8285

8386
static void exynos_drm_crtc_prepare(struct drm_crtc *crtc)

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -338,14 +338,10 @@ struct exynos_drm_display *exynos_dpi_probe(struct device *dev)
338338

339339
int exynos_dpi_remove(struct device *dev)
340340
{
341-
struct drm_encoder *encoder = exynos_dpi_display.encoder;
342341
struct exynos_dpi *ctx = exynos_dpi_display.ctx;
343342

344343
exynos_dpi_dpms(&exynos_dpi_display, DRM_MODE_DPMS_OFF);
345344

346-
exynos_dpi_connector_destroy(&ctx->connector);
347-
encoder->funcs->destroy(encoder);
348-
349345
if (ctx->panel)
350346
drm_panel_detach(ctx->panel);
351347

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

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,12 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
8787

8888
plane = exynos_plane_init(dev, possible_crtcs,
8989
DRM_PLANE_TYPE_OVERLAY);
90-
if (IS_ERR(plane))
91-
goto err_mode_config_cleanup;
92-
}
93-
94-
/* init kms poll for handling hpd */
95-
drm_kms_helper_poll_init(dev);
90+
if (!IS_ERR(plane))
91+
continue;
9692

97-
ret = drm_vblank_init(dev, MAX_CRTC);
98-
if (ret)
93+
ret = PTR_ERR(plane);
9994
goto err_mode_config_cleanup;
95+
}
10096

10197
/* setup possible_clones. */
10298
exynos_drm_encoder_setup(dev);
@@ -106,15 +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;
110106

111-
/* Probe non kms sub drivers and virtual display driver. */
112-
ret = exynos_drm_device_subdrv_probe(dev);
107+
ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
113108
if (ret)
114109
goto err_unbind_all;
115110

116-
/* force connectors detection */
117-
drm_helper_hpd_irq_event(dev);
111+
/* Probe non kms sub drivers and virtual display driver. */
112+
ret = exynos_drm_device_subdrv_probe(dev);
113+
if (ret)
114+
goto err_cleanup_vblank;
118115

119116
/*
120117
* enable drm irq mode.
@@ -133,12 +130,18 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
133130
*/
134131
dev->vblank_disable_allowed = true;
135132

133+
/* init kms poll for handling hpd */
134+
drm_kms_helper_poll_init(dev);
135+
136+
/* force connectors detection */
137+
drm_helper_hpd_irq_event(dev);
138+
136139
return 0;
137140

138-
err_unbind_all:
139-
component_unbind_all(dev->dev, dev);
140141
err_cleanup_vblank:
141142
drm_vblank_cleanup(dev);
143+
err_unbind_all:
144+
component_unbind_all(dev->dev, dev);
142145
err_mode_config_cleanup:
143146
drm_mode_config_cleanup(dev);
144147
drm_release_iommu_mapping(dev);
@@ -155,8 +158,8 @@ static int exynos_drm_unload(struct drm_device *dev)
155158
exynos_drm_fbdev_fini(dev);
156159
drm_kms_helper_poll_fini(dev);
157160

158-
component_unbind_all(dev->dev, dev);
159161
drm_vblank_cleanup(dev);
162+
component_unbind_all(dev->dev, dev);
160163
drm_mode_config_cleanup(dev);
161164
drm_release_iommu_mapping(dev);
162165

@@ -191,8 +194,12 @@ static int exynos_drm_resume(struct drm_device *dev)
191194

192195
drm_modeset_lock_all(dev);
193196
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
194-
if (connector->funcs->dpms)
195-
connector->funcs->dpms(connector, connector->dpms);
197+
if (connector->funcs->dpms) {
198+
int dpms = connector->dpms;
199+
200+
connector->dpms = DRM_MODE_DPMS_OFF;
201+
connector->funcs->dpms(connector, dpms);
202+
}
196203
}
197204
drm_modeset_unlock_all(dev);
198205

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,13 +1660,9 @@ static void exynos_dsi_unbind(struct device *dev, struct device *master,
16601660
void *data)
16611661
{
16621662
struct exynos_dsi *dsi = exynos_dsi_display.ctx;
1663-
struct drm_encoder *encoder = dsi->encoder;
16641663

16651664
exynos_dsi_dpms(&exynos_dsi_display, DRM_MODE_DPMS_OFF);
16661665

1667-
exynos_dsi_connector_destroy(&dsi->connector);
1668-
encoder->funcs->destroy(encoder);
1669-
16701666
mipi_dsi_host_unregister(&dsi->dsi_host);
16711667
}
16721668

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,6 @@ static int vidi_remove(struct platform_device *pdev)
630630
{
631631
struct exynos_drm_manager *mgr = platform_get_drvdata(pdev);
632632
struct vidi_context *ctx = mgr->ctx;
633-
struct drm_encoder *encoder = ctx->encoder;
634633

635634
if (ctx->raw_edid != (struct edid *)fake_edid_info) {
636635
kfree(ctx->raw_edid);
@@ -639,9 +638,6 @@ static int vidi_remove(struct platform_device *pdev)
639638
return -EINVAL;
640639
}
641640

642-
encoder->funcs->destroy(encoder);
643-
drm_connector_cleanup(&ctx->connector);
644-
645641
return 0;
646642
}
647643

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2312,12 +2312,6 @@ static int hdmi_bind(struct device *dev, struct device *master, void *data)
23122312

23132313
static void hdmi_unbind(struct device *dev, struct device *master, void *data)
23142314
{
2315-
struct exynos_drm_display *display = get_hdmi_display(dev);
2316-
struct drm_encoder *encoder = display->encoder;
2317-
struct hdmi_context *hdata = display->ctx;
2318-
2319-
hdmi_connector_destroy(&hdata->connector);
2320-
encoder->funcs->destroy(encoder);
23212315
}
23222316

23232317
static const struct component_ops hdmi_component_ops = {

0 commit comments

Comments
 (0)