aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/exynos
diff options
context:
space:
mode:
authorAndrzej Hajda <a.hajda@samsung.com>2014-11-17 03:54:22 -0500
committerInki Dae <inki.dae@samsung.com>2014-11-24 04:02:55 -0500
commit7340426affacb4b5988f9cf1c3dbfc28e9679360 (patch)
treee7f3d8cbf0ea28991800a0e0d63064d437d2c650 /drivers/gpu/drm/exynos
parent0d8424f83c31f1839826ea17ffc3ddf3f1b332a4 (diff)
drm/exynos/vidi: embed display into private context
exynos_drm_display is used by internal Exynos DRM framework for representing encoder:connector pair. As it should be mapped 1:1 to vidi private context it seems more reasonable to embed it directly in that context. As a result further code simplification will be possible. Moreover it will be possible to handle multiple vidi devices in the system. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
Diffstat (limited to 'drivers/gpu/drm/exynos')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_vidi.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
index f048a903eb8d..f58dd52f6d60 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
@@ -47,6 +47,7 @@ struct vidi_win_data {
47 47
48struct vidi_context { 48struct vidi_context {
49 struct exynos_drm_manager manager; 49 struct exynos_drm_manager manager;
50 struct exynos_drm_display display;
50 struct drm_device *drm_dev; 51 struct drm_device *drm_dev;
51 struct drm_crtc *crtc; 52 struct drm_crtc *crtc;
52 struct drm_encoder *encoder; 53 struct drm_encoder *encoder;
@@ -554,11 +555,6 @@ static struct exynos_drm_display_ops vidi_display_ops = {
554 .create_connector = vidi_create_connector, 555 .create_connector = vidi_create_connector,
555}; 556};
556 557
557static struct exynos_drm_display vidi_display = {
558 .type = EXYNOS_DISPLAY_TYPE_VIDI,
559 .ops = &vidi_display_ops,
560};
561
562static int vidi_subdrv_probe(struct drm_device *drm_dev, struct device *dev) 558static int vidi_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
563{ 559{
564 struct vidi_context *ctx = dev_get_drvdata(dev); 560 struct vidi_context *ctx = dev_get_drvdata(dev);
@@ -573,7 +569,7 @@ static int vidi_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
573 return ret; 569 return ret;
574 } 570 }
575 571
576 ret = exynos_drm_create_enc_conn(drm_dev, &vidi_display); 572 ret = exynos_drm_create_enc_conn(drm_dev, &ctx->display);
577 if (ret) { 573 if (ret) {
578 crtc->funcs->destroy(crtc); 574 crtc->funcs->destroy(crtc);
579 DRM_ERROR("failed to create encoder and connector.\n"); 575 DRM_ERROR("failed to create encoder and connector.\n");
@@ -595,11 +591,13 @@ static int vidi_probe(struct platform_device *pdev)
595 591
596 ctx->manager.type = EXYNOS_DISPLAY_TYPE_VIDI; 592 ctx->manager.type = EXYNOS_DISPLAY_TYPE_VIDI;
597 ctx->manager.ops = &vidi_manager_ops; 593 ctx->manager.ops = &vidi_manager_ops;
594 ctx->display.type = EXYNOS_DISPLAY_TYPE_VIDI;
595 ctx->display.ops = &vidi_display_ops;
598 ctx->default_win = 0; 596 ctx->default_win = 0;
599 597
600 INIT_WORK(&ctx->work, vidi_fake_vblank_handler); 598 INIT_WORK(&ctx->work, vidi_fake_vblank_handler);
601 599
602 vidi_display.ctx = ctx; 600 ctx->display.ctx = ctx;
603 601
604 mutex_init(&ctx->lock); 602 mutex_init(&ctx->lock);
605 603