Commit 7340426a authored by Andrzej Hajda's avatar Andrzej Hajda Committed by Inki Dae

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: default avatarAndrzej Hajda <a.hajda@samsung.com>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
parent 0d8424f8
...@@ -47,6 +47,7 @@ struct vidi_win_data { ...@@ -47,6 +47,7 @@ struct vidi_win_data {
struct vidi_context { struct vidi_context {
struct exynos_drm_manager manager; struct exynos_drm_manager manager;
struct exynos_drm_display display;
struct drm_device *drm_dev; struct drm_device *drm_dev;
struct drm_crtc *crtc; struct drm_crtc *crtc;
struct drm_encoder *encoder; struct drm_encoder *encoder;
...@@ -554,11 +555,6 @@ static struct exynos_drm_display_ops vidi_display_ops = { ...@@ -554,11 +555,6 @@ static struct exynos_drm_display_ops vidi_display_ops = {
.create_connector = vidi_create_connector, .create_connector = vidi_create_connector,
}; };
static struct exynos_drm_display vidi_display = {
.type = EXYNOS_DISPLAY_TYPE_VIDI,
.ops = &vidi_display_ops,
};
static int vidi_subdrv_probe(struct drm_device *drm_dev, struct device *dev) static int vidi_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
{ {
struct vidi_context *ctx = dev_get_drvdata(dev); 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,7 +569,7 @@ static int vidi_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
return ret; return ret;
} }
ret = exynos_drm_create_enc_conn(drm_dev, &vidi_display); ret = exynos_drm_create_enc_conn(drm_dev, &ctx->display);
if (ret) { if (ret) {
crtc->funcs->destroy(crtc); crtc->funcs->destroy(crtc);
DRM_ERROR("failed to create encoder and connector.\n"); DRM_ERROR("failed to create encoder and connector.\n");
...@@ -595,11 +591,13 @@ static int vidi_probe(struct platform_device *pdev) ...@@ -595,11 +591,13 @@ static int vidi_probe(struct platform_device *pdev)
ctx->manager.type = EXYNOS_DISPLAY_TYPE_VIDI; ctx->manager.type = EXYNOS_DISPLAY_TYPE_VIDI;
ctx->manager.ops = &vidi_manager_ops; ctx->manager.ops = &vidi_manager_ops;
ctx->display.type = EXYNOS_DISPLAY_TYPE_VIDI;
ctx->display.ops = &vidi_display_ops;
ctx->default_win = 0; ctx->default_win = 0;
INIT_WORK(&ctx->work, vidi_fake_vblank_handler); INIT_WORK(&ctx->work, vidi_fake_vblank_handler);
vidi_display.ctx = ctx; ctx->display.ctx = ctx;
mutex_init(&ctx->lock); mutex_init(&ctx->lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment