summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/exynos/exynos_drm_vidi.c
diff options
context:
space:
mode:
authorAndrzej Hajda <a.hajda@samsung.com>2017-08-24 15:33:51 +0200
committerInki Dae <inki.dae@samsung.com>2017-08-25 11:26:10 +0900
commit1ca582f10e212e29165f087705460d9de96eb9f4 (patch)
treeda8622fff857277b7d10425414b752de3e659fa7 /drivers/gpu/drm/exynos/exynos_drm_vidi.c
parent30b8913fd3ebc89d8a261b0d75e7034c3460adb9 (diff)
drm/exynos: use helper to set possible crtcs
All encoders share the same code to set encoders possible_crtcs field. The patch creates helper to abstract out this code. 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/exynos_drm_vidi.c')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_vidi.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
index 9186a654c3b5..53e03f8af3d5 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
@@ -381,7 +381,7 @@ static int vidi_bind(struct device *dev, struct device *master, void *data)
struct exynos_drm_plane *exynos_plane;
struct exynos_drm_plane_config plane_config = { 0 };
unsigned int i;
- int pipe, ret;
+ int ret;
ctx->drm_dev = drm_dev;
@@ -406,20 +406,15 @@ static int vidi_bind(struct device *dev, struct device *master, void *data)
return PTR_ERR(ctx->crtc);
}
- pipe = exynos_drm_crtc_get_pipe_from_type(drm_dev,
- EXYNOS_DISPLAY_TYPE_VIDI);
- if (pipe < 0)
- return pipe;
-
- encoder->possible_crtcs = 1 << pipe;
-
- DRM_DEBUG_KMS("possible_crtcs = 0x%x\n", encoder->possible_crtcs);
-
drm_encoder_init(drm_dev, encoder, &exynos_vidi_encoder_funcs,
DRM_MODE_ENCODER_TMDS, NULL);
drm_encoder_helper_add(encoder, &exynos_vidi_encoder_helper_funcs);
+ ret = exynos_drm_set_possible_crtcs(encoder, EXYNOS_DISPLAY_TYPE_VIDI);
+ if (ret < 0)
+ return ret;
+
ret = vidi_create_connector(encoder);
if (ret) {
DRM_ERROR("failed to create connector ret = %d\n", ret);